#include "table.h"
#include "log.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "vty.h"
#include "zebra/debug.h"
#include "ioctl.h"
#include "connected.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "log.h"
#include "vrf.h"
#include "vty.h"
#include "connected.h"
#include "table.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "rib.h"
#include "thread.h"
#include "privs.h"
#include "prefix.h"
#include "connected.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "ioctl.h"
#include "log.h"
#include "interface.h"
#include "prefix.h"
#include "command.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "ioctl.h"
#include "connected.h"
#include "log.h"
#include "prefix.h"
#include "command.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "stream.h"
#include "ioctl.h"
#include "connected.h"
#include "prefix.h"
#include "command.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "stream.h"
#include "ioctl.h"
#include "connected.h"
#include "zclient.h"
#include "lib_errors.h"
-#include "zebra_memory.h"
#include "zebra/interface.h"
#include "zebra/rtadv.h"
#include "zebra/rib.h"
#include "connected.h"
#include "table.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "rib.h"
#include "thread.h"
#include "privs.h"
#include "sockunion.h"
#include "connected.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "ioctl.h"
#include "log.h"
#include "table.h"
#include "thread.h"
#include "filter.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "prefix.h"
#include "log.h"
#include "plist.h"
#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"
#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);
#include "stream.h"
#include "command.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "ioctl.h"
#include "connected.h"
#include "network.h"
#include "connected.h"
#include "table.h"
#include "memory.h"
-#include "zebra_memory.h"
#include "rib.h"
#include "thread.h"
#include "privs.h"
#include <zebra.h>
#include "memory.h"
-#include "zebra_memory.h"
#include "sockopt.h"
#include "thread.h"
#include "if.h"
#if !defined(GNU_LINUX)
#include "memory.h"
-#include "zebra_memory.h"
#include "log.h"
#include "vrf.h"
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 \
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 \
#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"
#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 -------------------------------------------------------- */
}
}
+void zapi_opaque_free(struct opaque *opaque)
+{
+ XFREE(MTYPE_OPAQUE, opaque);
+}
+
static void zread_route_del(ZAPI_HANDLER_ARGS)
{
struct stream *s;
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
#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"
#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"
#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"
#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"
#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"
#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"
#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"
+++ /dev/null
-/* 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");
+++ /dev/null
-/* 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 */
#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"
#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"
#include "lib_errors.h"
#include "zebra_router.h"
-#include "zebra_memory.h"
#endif /* defined(HAVE_NETLINK) */
#include "zebra_netns_notify.h"
#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"
#include "zebra_ns.h"
#include "zebra_vrf.h"
-#include "zebra_memory.h"
#include "rt.h"
#include "zebra_vxlan.h"
#include "debug.h"
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;
#include "lib/stream.h"
#include "zebra/debug.h"
#include "zebra/zserv.h"
-#include "zebra/zebra_memory.h"
#include "zebra/zebra_opaque.h"
/* Mem type */
#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"
#else /* HAVE_BFDD */
-#include "zebra/zebra_memory.h"
-
/*
* Data structures.
*/
#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,
#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");
/*
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)
{
nexthops_free(re->fib_ng.nexthop);
- XFREE(MTYPE_OPAQUE, re->opaque);
+ zapi_opaque_free(re->opaque);
XFREE(MTYPE_RE, re);
}
#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");
#include <zebra.h>
#include "memory.h"
-#include "zebra_memory.h"
#include "prefix.h"
#include "rib.h"
#include "vty.h"
#include "lib/frratomic.h"
#include "zebra_router.h"
-#include "zebra_memory.h"
#include "zebra_pbr.h"
#include "zebra_vxlan.h"
#include "zebra_mlag.h"
#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,
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;
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,
#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"
#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"
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)
{
#include <zebra.h>
#include "memory.h"
-#include "zebra_memory.h"
#include "if.h"
#include "prefix.h"
#include "command.h"
#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"