]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: kill zebra_memory.h, use MTYPE_STATIC
authorDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 19:02:17 +0000 (20:02 +0100)
committerDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 19:02:17 +0000 (20:02 +0100)
This one also needed a bit of shuffling around, but MTYPE_RE is the only
one left used across file boundaries now.

Signed-off-by: David Lamparter <equinox@diac24.net>
46 files changed:
zebra/connected.c
zebra/if_ioctl.c
zebra/if_netlink.c
zebra/if_sysctl.c
zebra/interface.c
zebra/irdp_interface.c
zebra/irdp_main.c
zebra/irdp_packet.c
zebra/kernel_netlink.c
zebra/kernel_socket.c
zebra/main.c
zebra/redistribute.c
zebra/rib.h
zebra/router-id.c
zebra/rt_netlink.c
zebra/rtadv.c
zebra/rtread_sysctl.c
zebra/subdir.am
zebra/zapi_msg.c
zebra/zapi_msg.h
zebra/zebra_dplane.c
zebra/zebra_evpn.c
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_mh.c
zebra/zebra_evpn_neigh.c
zebra/zebra_fpm.c
zebra/zebra_l2.c
zebra/zebra_memory.c [deleted file]
zebra/zebra_memory.h [deleted file]
zebra/zebra_mlag.c
zebra/zebra_mpls.c
zebra/zebra_netns_notify.c
zebra/zebra_nhg.c
zebra/zebra_ns.c
zebra/zebra_opaque.c
zebra/zebra_pbr.c
zebra/zebra_ptm.c
zebra/zebra_ptm_redistribute.c
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_routemap.c
zebra/zebra_router.c
zebra/zebra_srte.c
zebra/zebra_vrf.c
zebra/zebra_vty.c
zebra/zebra_vxlan.c

index dd8fab5e4e040b7bfdad9229946632900d0c4d34..6f405ca1bbbe533a1cca57e5bbaf11c51c9e5687 100644 (file)
@@ -29,7 +29,6 @@
 #include "table.h"
 #include "log.h"
 #include "memory.h"
-#include "zebra_memory.h"
 
 #include "vty.h"
 #include "zebra/debug.h"
index 8bec2563553252db71cb11385471b5321e63fe2e..14d8ac442ebaf0ef7553017d911f29dfec148285 100644 (file)
@@ -29,7 +29,6 @@
 #include "ioctl.h"
 #include "connected.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "log.h"
 #include "vrf.h"
 #include "vty.h"
index 98bde4b3c05640545672ef8a551db0c9a3e8abdf..af2c2516071d7e60874381f0fb6ff552d74200c8 100644 (file)
@@ -44,7 +44,6 @@
 #include "connected.h"
 #include "table.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "rib.h"
 #include "thread.h"
 #include "privs.h"
index 695cef1995b35db6016e286e121b6732ba46b232..38729c8d38e4a9896d857bae105ee78b0ea8f1f8 100644 (file)
@@ -28,7 +28,6 @@
 #include "prefix.h"
 #include "connected.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "ioctl.h"
 #include "log.h"
 #include "interface.h"
index c679e090cadfeba115d765a42fa6a1a61c6fa878..3eeed9ac90e27cbbcf62d0ceb4f8f6d0ecad8a7b 100644 (file)
@@ -28,7 +28,6 @@
 #include "prefix.h"
 #include "command.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "ioctl.h"
 #include "connected.h"
 #include "log.h"
index 52f485dd17309f53c520e8bafeaeeaeba571454e..28db2ad87d6526619e67d79d4245fe5d8c04f9f4 100644 (file)
@@ -34,7 +34,6 @@
 #include "prefix.h"
 #include "command.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "stream.h"
 #include "ioctl.h"
 #include "connected.h"
index 6a943a2e2bd15fe43f927edbb174363160381c26..600fc3f2fc8ee8299d287d7684d4e2d36f379f8f 100644 (file)
@@ -42,7 +42,6 @@
 #include "prefix.h"
 #include "command.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "stream.h"
 #include "ioctl.h"
 #include "connected.h"
index 6134df9c41565a0dd0eeb1f0eb329f86b0e677e9..7d67c42a79e9b06f843b7ca9f4f7bf6af164ebf8 100644 (file)
@@ -54,7 +54,6 @@
 #include "zclient.h"
 #include "lib_errors.h"
 
-#include "zebra_memory.h"
 #include "zebra/interface.h"
 #include "zebra/rtadv.h"
 #include "zebra/rib.h"
index 9e655ab266e1866810f1988e4cc7dfac0330fdb9..e71e6624589d42acff66b861f3c0205f3ef287a5 100644 (file)
@@ -29,7 +29,6 @@
 #include "connected.h"
 #include "table.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "rib.h"
 #include "thread.h"
 #include "privs.h"
index adbdf54c1f763d640acdd7e2ea31bc9c5e424d78..03884a916820e2d200649029b93f453d772c86e3 100644 (file)
@@ -32,7 +32,6 @@
 #include "sockunion.h"
 #include "connected.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "ioctl.h"
 #include "log.h"
 #include "table.h"
index f2fde35f0ee88e70bc9f218eeb5639f3523dcada..09350f72c18fbaadaf6ef36b0436482f5ce4d3b2 100644 (file)
@@ -26,7 +26,6 @@
 #include "thread.h"
 #include "filter.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "prefix.h"
 #include "log.h"
 #include "plist.h"
index ac60d09eccba6592e1490ec32fe2115f5b657d0b..9e675011ee76c8812936a38b369e80e04c68ff0d 100644 (file)
@@ -41,7 +41,6 @@
 #include "zebra/debug.h"
 #include "zebra/router-id.h"
 #include "zebra/zapi_msg.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_vxlan.h"
 #include "zebra/zebra_errors.h"
 
index 564e27497d812d05d34be55075a1a2f8a53cb1cf..e7676a132455bad1457ccc9bdb800cc37859a32f 100644 (file)
@@ -23,6 +23,7 @@
 #define _ZEBRA_RIB_H
 
 #include "zebra.h"
+#include "memory.h"
 #include "hook.h"
 #include "typesafe.h"
 #include "linklist.h"
 extern "C" {
 #endif
 
+DECLARE_MGROUP(ZEBRA);
+
+DECLARE_MTYPE(RE);
+
 enum rnh_type { RNH_NEXTHOP_TYPE, RNH_IMPORT_CHECK_TYPE };
 
 PREDECL_LIST(rnh_list);
index ac21978ee826f96a5c398f68b8966a35ca23a133..3b556c92b5f18e7c0e669e62f13a337eb09e76c0 100644 (file)
@@ -29,7 +29,6 @@
 #include "stream.h"
 #include "command.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "ioctl.h"
 #include "connected.h"
 #include "network.h"
index fdeef2c88c3cca535ee59dfb3039673506cf499e..55e0775a8c49dffe30f87564a4b55d4d9bf08b0f 100644 (file)
@@ -41,7 +41,6 @@
 #include "connected.h"
 #include "table.h"
 #include "memory.h"
-#include "zebra_memory.h"
 #include "rib.h"
 #include "thread.h"
 #include "privs.h"
index 8a7a15e46d843bd3acf97fedf1b7ecfcb3a11204..8ffb3870fa6fb019dfc2161565004428239ee76d 100644 (file)
@@ -23,7 +23,6 @@
 #include <zebra.h>
 
 #include "memory.h"
-#include "zebra_memory.h"
 #include "sockopt.h"
 #include "thread.h"
 #include "if.h"
index 01a97db8b35912276b6af98f100a575e91910863..74c6825ba1225bb4d3dafcc6edc6d9b3e914c55b 100644 (file)
@@ -24,7 +24,6 @@
 #if !defined(GNU_LINUX)
 
 #include "memory.h"
-#include "zebra_memory.h"
 #include "log.h"
 #include "vrf.h"
 
index 47b18b2c0c91d69ff4a06e68e0c665d42c55417b..b5c26d720fe77ed923db7a1a9243b23c3a04f1cb 100644 (file)
@@ -88,7 +88,6 @@ zebra_zebra_SOURCES = \
        zebra/zebra_evpn_neigh.c \
        zebra/zebra_mlag.c \
        zebra/zebra_mlag_vty.c \
-       zebra/zebra_memory.c \
        zebra/zebra_mpls.c \
        zebra/zebra_mpls_netlink.c \
        zebra/zebra_mpls_openbsd.c \
@@ -158,7 +157,6 @@ noinst_HEADERS += \
        zebra/zebra_evpn_vxlan.h \
        zebra/zebra_fpm_private.h \
        zebra/zebra_l2.h \
-       zebra/zebra_memory.h \
        zebra/zebra_mlag.h \
        zebra/zebra_mlag_vty.h \
        zebra/zebra_mpls.h \
index 9f5adfa40993387e2daeeda9ee52aa87bbc9106c..63ba6cd8d906cff713b0c86305cc6e06600bbb92 100644 (file)
@@ -38,7 +38,6 @@
 
 #include "zebra/zebra_router.h"
 #include "zebra/rib.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/router-id.h"
@@ -62,6 +61,8 @@
 #include "zebra/zebra_opaque.h"
 #include "zebra/zebra_srte.h"
 
+DEFINE_MTYPE_STATIC(ZEBRA, OPAQUE, "Opaque Data");
+
 static int zapi_nhg_decode(struct stream *s, int cmd, struct zapi_nhg *api_nhg);
 
 /* Encoding helpers -------------------------------------------------------- */
@@ -2076,6 +2077,11 @@ static void zread_route_add(ZAPI_HANDLER_ARGS)
        }
 }
 
+void zapi_opaque_free(struct opaque *opaque)
+{
+       XFREE(MTYPE_OPAQUE, opaque);
+}
+
 static void zread_route_del(ZAPI_HANDLER_ARGS)
 {
        struct stream *s;
index 023b9f74a8fb6ba1426eb1909a69a854ebbc55e6..ca471f8d989bd1148c4a381805c15396739f38f1 100644 (file)
@@ -111,6 +111,8 @@ extern int zsend_client_close_notify(struct zserv *client,
 int zsend_nhg_notify(uint16_t type, uint16_t instance, uint32_t session_id,
                     uint32_t id, enum zapi_nhg_notify_owner note);
 
+extern void zapi_opaque_free(struct opaque *opaque);
+
 #ifdef __cplusplus
 }
 #endif
index 6f3e5f0427c381be5917b92f07fcab297f545336..18fe0a7e853a597ae56964607f39df2cd019eedb 100644 (file)
@@ -28,7 +28,6 @@
 #include "lib/memory.h"
 #include "lib/queue.h"
 #include "lib/zebra.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_router.h"
 #include "zebra/zebra_dplane.h"
 #include "zebra/zebra_vxlan_private.h"
index 27a5a07e486b0126aaa55a7a22f54d4ca83b86ef..80e06d913de097b0706e783f2f2740c733dd8956 100644 (file)
@@ -44,7 +44,6 @@
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"
index b36e8034b7b97974b6a5a586f6c830c9dd52d998..7bbe092d8c89ea60a5ebbcb29ebad32d3aa49871 100644 (file)
@@ -34,7 +34,6 @@
 #include "zebra/zserv.h"
 #include "zebra/debug.h"
 #include "zebra/zebra_router.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_evpn.h"
index 5a28ee10c621c651132bcb64dec03a49fbb36e02..1c258a04f76ed5e1f61d3663fa8fa8e22b8a60b4 100644 (file)
@@ -41,7 +41,6 @@
 #include "zebra/if_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"
index 0e31617c4f0d4c84365265ed2af7763b39588cae..d1b93dbe8ab2437dd7b746d4b70f7f26ea4a0392 100644 (file)
@@ -34,7 +34,6 @@
 #include "zebra/debug.h"
 #include "zebra/zebra_router.h"
 #include "zebra/rt.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_evpn.h"
index 4882397dd3b4854f090857fd6ac137ed0bbca10c..5fe8934a8221f352c3a05e058c331d0c32ef78ff 100644 (file)
@@ -37,7 +37,6 @@
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_errors.h"
-#include "zebra/zebra_memory.h"
 
 #include "fpm/fpm.h"
 #include "zebra_fpm_private.h"
index 3583c5fbf41157dff50387e25972ccf04c258e40..c3fbff2723c60edf5398c554982313d1ebd8efaa 100644 (file)
@@ -38,7 +38,6 @@
 #include "zebra/zserv.h"
 #include "zebra/debug.h"
 #include "zebra/interface.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/rt_netlink.h"
 #include "zebra/interface.h"
diff --git a/zebra/zebra_memory.c b/zebra/zebra_memory.c
deleted file mode 100644 (file)
index 004da01..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* zebra memory type definitions
- *
- * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "zebra_memory.h"
-
-DEFINE_MGROUP(ZEBRA, "zebra");
-DEFINE_MTYPE(ZEBRA, RE, "Route Entry");
-DEFINE_MTYPE(ZEBRA, RIB_DEST, "RIB destination");
-DEFINE_MTYPE(ZEBRA, ZVLAN, "VLAN");
-DEFINE_MTYPE(ZEBRA, ZVLAN_BITMAP, "VLAN bitmap");
-DEFINE_MTYPE(ZEBRA, OPAQUE, "Opaque Data");
diff --git a/zebra/zebra_memory.h b/zebra/zebra_memory.h
deleted file mode 100644 (file)
index 769a808..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* zebra memory type declarations
- *
- * Copyright (C) 2015  David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _QUAGGA_ZEBRA_MEMORY_H
-#define _QUAGGA_ZEBRA_MEMORY_H
-
-#include "memory.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-DECLARE_MGROUP(ZEBRA);
-DECLARE_MTYPE(ZEBRA_NS);
-DECLARE_MTYPE(RE);
-DECLARE_MTYPE(RIB_DEST);
-DECLARE_MTYPE(OPAQUE);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _QUAGGA_ZEBRA_MEMORY_H */
index 2e65307ea344da03d615694770f26761a9aefdaa..3b0c75151be2d71cb22a22714d8cc92d8c29f1cf 100644 (file)
@@ -29,7 +29,6 @@
 #include "zebra/zebra_mlag.h"
 #include "zebra/zebra_mlag_vty.h"
 #include "zebra/zebra_router.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zapi_msg.h"
 #include "zebra/debug.h"
 
index a87951353922da26a92d8810206caa0237c1a4dd..c0c064cbc7aea4df56556a71d37907b681a03538 100644 (file)
@@ -44,7 +44,6 @@
 #include "zebra/zebra_router.h"
 #include "zebra/redistribute.h"
 #include "zebra/debug.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_mpls.h"
 #include "zebra/zebra_srte.h"
index 5f11bbd60060b6ca6f5a4b7e1f7ecccb023f7a1c..3e89df68fdc9d44a5cfe8073670d7966dcdb2370 100644 (file)
@@ -37,7 +37,6 @@
 #include "lib_errors.h"
 
 #include "zebra_router.h"
-#include "zebra_memory.h"
 #endif /* defined(HAVE_NETLINK) */
 
 #include "zebra_netns_notify.h"
index 9246283fdf6aa06b5ab108e4e7b15d14e5dcf7df..12ed024a661ea3986dc027b700b907157bcbe8dc 100644 (file)
@@ -36,7 +36,6 @@
 #include "zebra/zebra_nhg_private.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/zebra_routemap.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_srte.h"
 #include "zebra/zserv.h"
 #include "zebra/rt.h"
index ae7727ca179f1cd6dafb3d639bf2588b40ad8532..27b8a3ea477e9d527a45f35c6374faf253af8c62 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "zebra_ns.h"
 #include "zebra_vrf.h"
-#include "zebra_memory.h"
 #include "rt.h"
 #include "zebra_vxlan.h"
 #include "debug.h"
@@ -41,7 +40,7 @@
 
 extern struct zebra_privs_t zserv_privs;
 
-DEFINE_MTYPE(ZEBRA, ZEBRA_NS, "Zebra Name Space");
+DEFINE_MTYPE_STATIC(ZEBRA, ZEBRA_NS, "Zebra Name Space");
 
 static struct zebra_ns *dzns;
 
index 1d59e0ab3486b4ff6c5e7e26e91db8fee4d4a75d..244f16302bf40cbe4c3d452207f32feaa440865a 100644 (file)
@@ -24,7 +24,6 @@
 #include "lib/stream.h"
 #include "zebra/debug.h"
 #include "zebra/zserv.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_opaque.h"
 
 /* Mem type */
index 4b87432ffc178768d66037a440fa9e9e785f9dd3..c4004842e6c9c33099437dd165ac49f5723f0b83 100644 (file)
@@ -30,7 +30,6 @@
 #include "zebra/zebra_pbr.h"
 #include "zebra/rt.h"
 #include "zebra/zapi_msg.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zserv.h"
 #include "zebra/debug.h"
 
index 1e7b38086b1d03032cb53fe2ebd6c3e9efefd4d9..bea855d1af6f41f1923190a6ec9c6af65a0f9ceb 100644 (file)
@@ -1167,8 +1167,6 @@ void zebra_ptm_if_write(struct vty *vty, struct zebra_if *zebra_ifp)
 
 #else /* HAVE_BFDD */
 
-#include "zebra/zebra_memory.h"
-
 /*
  * Data structures.
  */
index eabc2e005e10c61d4f05ebb5250d4aa62e0c1728..537d69fbcaad1dad85e15b2406431f10610f71cf 100644 (file)
@@ -26,7 +26,6 @@
 #include "zebra/zapi_msg.h"
 #include "zebra/zebra_ptm.h"
 #include "zebra/zebra_ptm_redistribute.h"
-#include "zebra/zebra_memory.h"
 
 static int zsend_interface_bfd_update(int cmd, struct zserv *client,
                                      struct interface *ifp, struct prefix *dp,
index 6b261927111e3e68fbcb6709ecbc39787d62779b..ffe4be8557fd9d37bffeffeb8abb2ac730533d76 100644 (file)
@@ -49,7 +49,6 @@
 #include "zebra/rt.h"
 #include "zebra/zapi_msg.h"
 #include "zebra/zebra_errors.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/zebra_routemap.h"
 #include "zebra/zapi_msg.h"
 #include "zebra/zebra_dplane.h"
 
+DEFINE_MGROUP(ZEBRA, "zebra");
+
+DEFINE_MTYPE(ZEBRA, RE,       "Route Entry");
+DEFINE_MTYPE_STATIC(ZEBRA, RIB_DEST,       "RIB destination");
 DEFINE_MTYPE_STATIC(ZEBRA, RIB_UPDATE_CTX, "Rib update context object");
 
 /*
@@ -800,6 +803,23 @@ int rib_gc_dest(struct route_node *rn)
        return 1;
 }
 
+void zebra_rtable_node_cleanup(struct route_table *table,
+                              struct route_node *node)
+{
+       struct route_entry *re, *next;
+
+       RNODE_FOREACH_RE_SAFE (node, re, next) {
+               rib_unlink(node, re);
+       }
+
+       if (node->info) {
+               rib_dest_t *dest = node->info;
+
+               rnh_list_fini(&dest->nht);
+               XFREE(MTYPE_RIB_DEST, node->info);
+       }
+}
+
 static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
                                struct route_entry *new)
 {
@@ -2698,7 +2718,7 @@ void rib_unlink(struct route_node *rn, struct route_entry *re)
 
        nexthops_free(re->fib_ng.nexthop);
 
-       XFREE(MTYPE_OPAQUE, re->opaque);
+       zapi_opaque_free(re->opaque);
 
        XFREE(MTYPE_RE, re);
 }
index a6e3f8473f3b18dd6730fdad5014ca5369419956..3b0ef71987449e8cc4139ecd83d90d6011d1942d 100644 (file)
@@ -48,7 +48,6 @@
 #include "zebra/zebra_routemap.h"
 #include "zebra/zebra_srte.h"
 #include "zebra/interface.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_errors.h"
 
 DEFINE_MTYPE_STATIC(ZEBRA, RNH, "Nexthop tracking object");
index 17a9bf97f94c3936d5bb48968c0a15efe902296b..c9660c7309a067a3079529be35524191ab97fd3a 100644 (file)
@@ -21,7 +21,6 @@
 #include <zebra.h>
 
 #include "memory.h"
-#include "zebra_memory.h"
 #include "prefix.h"
 #include "rib.h"
 #include "vty.h"
index 11c1130c4f28bdccfb83401bf2775557ad44f721..5a00f3155d75071d2484fef4675773b08ed9b771 100644 (file)
@@ -25,7 +25,6 @@
 #include "lib/frratomic.h"
 
 #include "zebra_router.h"
-#include "zebra_memory.h"
 #include "zebra_pbr.h"
 #include "zebra_vxlan.h"
 #include "zebra_mlag.h"
@@ -33,6 +32,7 @@
 #include "debug.h"
 
 DEFINE_MTYPE_STATIC(ZEBRA, RIB_TABLE_INFO, "RIB table info");
+DEFINE_MTYPE_STATIC(ZEBRA, ZEBRA_RT_TABLE, "Zebra VRF table");
 
 struct zebra_router zrouter = {
        .multipath_num = MULTIPATH_NUM,
@@ -121,7 +121,7 @@ struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf,
        if (zrt)
                return zrt->table;
 
-       zrt = XCALLOC(MTYPE_ZEBRA_NS, sizeof(*zrt));
+       zrt = XCALLOC(MTYPE_ZEBRA_RT_TABLE, sizeof(*zrt));
        zrt->tableid = tableid;
        zrt->afi = afi;
        zrt->safi = safi;
@@ -185,7 +185,7 @@ static void zebra_router_free_table(struct zebra_router_table *zrt)
        RB_REMOVE(zebra_router_table_head, &zrouter.tables, zrt);
 
        XFREE(MTYPE_RIB_TABLE_INFO, table_info);
-       XFREE(MTYPE_ZEBRA_NS, zrt);
+       XFREE(MTYPE_ZEBRA_RT_TABLE, zrt);
 }
 
 void zebra_router_release_table(struct zebra_vrf *zvrf, uint32_t tableid,
index e761cd7d041e7f2102e20bd831e71e4d1a5741e0..98158ecc12b2a22d1d9a694d1de255e93a7c51fd 100644 (file)
@@ -24,7 +24,6 @@
 #include "lib/lib_errors.h"
 
 #include "zebra/zebra_srte.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_mpls.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/zapi_msg.h"
index 46398f3fb6dc91c33808289248013399194c53b7..b42923640f27e684b1d6ae569a35e494f06de31f 100644 (file)
@@ -36,7 +36,6 @@
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_rnh.h"
 #include "zebra/router-id.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/interface.h"
 #include "zebra/zebra_mpls.h"
 #include "zebra/zebra_vxlan.h"
@@ -413,23 +412,6 @@ done:
        return table;
 }
 
-void zebra_rtable_node_cleanup(struct route_table *table,
-                              struct route_node *node)
-{
-       struct route_entry *re, *next;
-
-       RNODE_FOREACH_RE_SAFE (node, re, next) {
-               rib_unlink(node, re);
-       }
-
-       if (node->info) {
-               rib_dest_t *dest = node->info;
-
-               rnh_list_fini(&dest->nht);
-               XFREE(MTYPE_RIB_DEST, node->info);
-       }
-}
-
 static void zebra_rnhtable_node_cleanup(struct route_table *table,
                                        struct route_node *node)
 {
index 3349c182049119931a9e67e62a12834b468d9209..d5c9f7183dca59ad97e73f11e9a10a8097cf4230 100644 (file)
@@ -21,7 +21,6 @@
 #include <zebra.h>
 
 #include "memory.h"
-#include "zebra_memory.h"
 #include "if.h"
 #include "prefix.h"
 #include "command.h"
index d95967c55d5f29235e0600a5387ab07255e9138c..bc2eac7a0bf53f46383155c7265cdb56dc66ff90 100644 (file)
@@ -46,7 +46,6 @@
 #include "zebra/rt_netlink.h"
 #include "zebra/zebra_errors.h"
 #include "zebra/zebra_l2.h"
-#include "zebra/zebra_memory.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
 #include "zebra/zebra_vxlan.h"