Merge pull request #8307 from opensourcerouting/mtypes-cleanup-20210322

isisd, eigrpd, pathd: clean up & drop *_memory.[ch] files, make a whole bunch static
This commit is contained in:
Russ White 2021-03-23 10:07:28 -04:00 committed by GitHub
commit 63d4a9708c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
119 changed files with 260 additions and 734 deletions

View File

@ -57,7 +57,6 @@
#include "eigrpd/eigrp_const.h"
#include "eigrpd/eigrp_filter.h"
#include "eigrpd/eigrp_packet.h"
#include "eigrpd/eigrp_memory.h"
/*
* Distribute-list update functions.

View File

@ -52,12 +52,14 @@
#include "eigrpd/eigrp_vty.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_dump.h"
#include "eigrpd/eigrp_types.h"
#include "eigrpd/eigrp_metric.h"
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF, "EIGRP interface");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IF_INFO, "EIGRP Interface Information");
struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp,
struct prefix *p)
{

View File

@ -1,42 +0,0 @@
/* eigrpd memory type definitions
*
* Copyright (C) 2017 Donald Sharp
*
* This file is part of FRR
*
* FRR 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.
*
* FRR 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 "eigrp_memory.h"
DEFINE_MGROUP(EIGRPD, "eigrpd");
DEFINE_MTYPE(EIGRPD, EIGRP_TOP, "EIGRP structure");
DEFINE_MTYPE(EIGRPD, EIGRP_IF, "EIGRP interface");
DEFINE_MTYPE(EIGRPD, EIGRP_NEIGHBOR, "EIGRP neighbor");
DEFINE_MTYPE(EIGRPD, EIGRP_IF_PARAMS, "EIGRP Interface Parameters");
DEFINE_MTYPE(EIGRPD, EIGRP_IF_INFO, "EIGRP Interface Information");
DEFINE_MTYPE(EIGRPD, EIGRP_FIFO, "EIGRP FIFO");
DEFINE_MTYPE(EIGRPD, EIGRP_PACKET, "EIGRP Packet");
DEFINE_MTYPE(EIGRPD, EIGRP_IPV4_INT_TLV, "EIGRP IPv4 TLV");
DEFINE_MTYPE(EIGRPD, EIGRP_SEQ_TLV, "EIGRP SEQ TLV");
DEFINE_MTYPE(EIGRPD, EIGRP_AUTH_TLV, "EIGRP AUTH TLV");
DEFINE_MTYPE(EIGRPD, EIGRP_AUTH_SHA256_TLV, "EIGRP SHA TLV");
DEFINE_MTYPE(EIGRPD, EIGRP_PREFIX_DESCRIPTOR, "EIGRP Prefix");
DEFINE_MTYPE(EIGRPD, EIGRP_ROUTE_DESCRIPTOR, "EIGRP Nexthop Entry");
DEFINE_MTYPE(EIGRPD, EIGRP_FSM_MSG, "EIGRP FSM Message");

View File

@ -1,43 +0,0 @@
/* eigrpd memory type declarations
*
* Copyright (C) 2017 Donald Sharp
*
* This file is part of FRR.
*
* FRR 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.
*
* FRR 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 _FRR_EIGRP_MEMORY_H
#define _FRR_EIGRP_MEMORY_H
#include "memory.h"
DECLARE_MGROUP(EIGRPD);
DECLARE_MTYPE(EIGRP_TOP);
DECLARE_MTYPE(EIGRP_IF);
DECLARE_MTYPE(EIGRP_NEIGHBOR);
DECLARE_MTYPE(EIGRP_IF_PARAMS);
DECLARE_MTYPE(EIGRP_IF_INFO);
DECLARE_MTYPE(EIGRP_FIFO);
DECLARE_MTYPE(EIGRP_PACKET);
DECLARE_MTYPE(EIGRP_IPV4_INT_TLV);
DECLARE_MTYPE(EIGRP_SEQ_TLV);
DECLARE_MTYPE(EIGRP_AUTH_TLV);
DECLARE_MTYPE(EIGRP_AUTH_SHA256_TLV);
DECLARE_MTYPE(EIGRP_PREFIX_DESCRIPTOR);
DECLARE_MTYPE(EIGRP_ROUTE_DESCRIPTOR);
DECLARE_MTYPE(EIGRP_FSM_MSG);
#endif /* _FRR_EIGRP_MEMORY_H */

View File

@ -52,9 +52,10 @@
#include "eigrpd/eigrp_vty.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_errors.h"
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_NEIGHBOR, "EIGRP neighbor");
struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei)
{
struct eigrp_neighbor *nbr;

View File

@ -56,9 +56,15 @@
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_errors.h"
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_FIFO, "EIGRP FIFO");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_PACKET, "EIGRP Packet");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_IPV4_INT_TLV, "EIGRP IPv4 TLV");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_SEQ_TLV, "EIGRP SEQ TLV");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_AUTH_TLV, "EIGRP AUTH TLV");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_AUTH_SHA256_TLV, "EIGRP SHA TLV");
/* Packet Type String. */
const struct message eigrp_packet_type_str[] = {
{EIGRP_OPC_UPDATE, "Update"},

View File

@ -52,7 +52,6 @@
#include "eigrpd/eigrp_macros.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
uint32_t eigrp_query_send_all(struct eigrp *eigrp)
{

View File

@ -58,7 +58,6 @@
#include "eigrpd/eigrp_macros.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_errors.h"
void eigrp_send_reply(struct eigrp_neighbor *nbr,

View File

@ -52,7 +52,6 @@
#include "eigrpd/eigrp_macros.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
/*EIGRP SIA-QUERY read function*/
void eigrp_siaquery_receive(struct eigrp *eigrp, struct ip *iph,

View File

@ -51,7 +51,6 @@
#include "eigrpd/eigrp_macros.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
/*EIGRP SIA-REPLY read function*/
void eigrp_siareply_receive(struct eigrp *eigrp, struct ip *iph,

View File

@ -51,9 +51,11 @@
#include "eigrpd/eigrp_dump.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_metric.h"
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_ROUTE_DESCRIPTOR, "EIGRP Nexthop Entry");
DEFINE_MTYPE(EIGRPD, EIGRP_PREFIX_DESCRIPTOR, "EIGRP Prefix");
static int eigrp_route_descriptor_cmp(struct eigrp_route_descriptor *rd1,
struct eigrp_route_descriptor *rd2);

View File

@ -32,6 +32,10 @@
#ifndef _ZEBRA_EIGRP_TOPOLOGY_H
#define _ZEBRA_EIGRP_TOPOLOGY_H
#include "memory.h"
DECLARE_MTYPE(EIGRP_PREFIX_DESCRIPTOR);
/* EIGRP Topology table related functions. */
extern struct route_table *eigrp_topology_new(void);
extern void eigrp_topology_init(struct route_table *table);

View File

@ -62,7 +62,6 @@
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_fsm.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_metric.h"
bool eigrp_update_prefix_apply(struct eigrp *eigrp, struct eigrp_interface *ei,

View File

@ -55,9 +55,12 @@
#include "eigrpd/eigrp_packet.h"
#include "eigrpd/eigrp_network.h"
#include "eigrpd/eigrp_topology.h"
#include "eigrpd/eigrp_memory.h"
#include "eigrpd/eigrp_filter.h"
DEFINE_MGROUP(EIGRPD, "eigrpd");
DEFINE_MTYPE_STATIC(EIGRPD, EIGRP_TOP, "EIGRP structure");
DEFINE_QOBJ_TYPE(eigrp);
static struct eigrp_master eigrp_master;

View File

@ -32,6 +32,9 @@
#include "filter.h"
#include "log.h"
#include "memory.h"
DECLARE_MGROUP(EIGRPD);
/* Set EIGRP version is "classic" - wide metrics comes next */
#define EIGRP_MAJOR_VERSION 1

View File

@ -24,7 +24,6 @@ eigrpd_libeigrp_a_SOURCES = \
eigrpd/eigrp_fsm.c \
eigrpd/eigrp_hello.c \
eigrpd/eigrp_interface.c \
eigrpd/eigrp_memory.c \
eigrpd/eigrp_metric.c \
eigrpd/eigrp_neighbor.c \
eigrpd/eigrp_network.c \
@ -63,7 +62,6 @@ noinst_HEADERS += \
eigrpd/eigrp_fsm.h \
eigrpd/eigrp_interface.h \
eigrpd/eigrp_macros.h \
eigrpd/eigrp_memory.h \
eigrpd/eigrp_metric.h \
eigrpd/eigrp_neighbor.h \
eigrpd/eigrp_network.h \

View File

@ -22,7 +22,6 @@
#include <zebra.h>
#include "isisd/fabricd.h"
#include "isisd/isisd.h"
#include "isisd/isis_memory.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_misc.h"
#include "isisd/isis_adjacency.h"

View File

@ -49,6 +49,9 @@
#include "isisd/fabricd.h"
#include "isisd/isis_nb.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_ADJACENCY, "ISIS adjacency");
DEFINE_MTYPE(ISISD, ISIS_ADJACENCY_INFO, "ISIS adjacency info");
static struct isis_adjacency *adj_alloc(struct isis_circuit *circuit,
const uint8_t *id)
{

View File

@ -27,6 +27,8 @@
#include "isisd/isis_tlvs.h"
DECLARE_MTYPE(ISIS_ADJACENCY_INFO);
enum isis_adj_usage {
ISIS_ADJ_NONE,
ISIS_ADJ_LEVEL1,

View File

@ -61,6 +61,8 @@
#include "isisd/isis_nb.h"
#include "isisd/isis_ldp_sync.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_CIRCUIT, "ISIS circuit");
DEFINE_QOBJ_TYPE(isis_circuit);
DEFINE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp));

View File

@ -40,6 +40,8 @@
#include "isisd/isis_misc.h"
#include "isisd/isis_constants.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_DYNHN, "ISIS dyn hostname");
extern struct host host;
struct list *dyn_cache = NULL;

View File

@ -46,6 +46,7 @@ DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_NODE, "ISIS SPF Node");
DEFINE_MTYPE_STATIC(ISISD, ISIS_LFA_TIEBREAKER, "ISIS LFA Tiebreaker");
DEFINE_MTYPE_STATIC(ISISD, ISIS_LFA_EXCL_IFACE, "ISIS LFA Excluded Interface");
DEFINE_MTYPE_STATIC(ISISD, ISIS_RLFA, "ISIS Remote LFA");
DEFINE_MTYPE(ISISD, ISIS_NEXTHOP_LABELS, "ISIS nexthop MPLS labels");
static inline int isis_spf_node_compare(const struct isis_spf_node *a,
const struct isis_spf_node *b)

View File

@ -22,6 +22,9 @@
#include "lib/typesafe.h"
#include "lib/zclient.h"
#include "lib/memory.h"
DECLARE_MTYPE(ISIS_NEXTHOP_LABELS);
PREDECL_RBTREE_UNIQ(lfa_tiebreaker_tree);
PREDECL_RBTREE_UNIQ(rlfa_tree);

View File

@ -60,6 +60,8 @@
#include "isisd/isis_tx_queue.h"
#include "isisd/isis_nb.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_LSP, "ISIS LSP");
static int lsp_refresh(struct thread *thread);
static int lsp_l1_refresh_pseudo(struct thread *thread);
static int lsp_l2_refresh_pseudo(struct thread *thread);

View File

@ -1,49 +0,0 @@
/* isisd 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 "isis_memory.h"
DEFINE_MGROUP(ISISD, "isisd");
DEFINE_MTYPE(ISISD, ISIS, "ISIS");
DEFINE_MTYPE(ISISD, ISIS_TMP, "ISIS TMP");
DEFINE_MTYPE(ISISD, ISIS_CIRCUIT, "ISIS circuit");
DEFINE_MTYPE(ISISD, ISIS_LSP, "ISIS LSP");
DEFINE_MTYPE(ISISD, ISIS_ADJACENCY, "ISIS adjacency");
DEFINE_MTYPE(ISISD, ISIS_ADJACENCY_INFO, "ISIS adjacency info");
DEFINE_MTYPE(ISISD, ISIS_AREA, "ISIS area");
DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address");
DEFINE_MTYPE(ISISD, ISIS_DYNHN, "ISIS dyn hostname");
DEFINE_MTYPE(ISISD, ISIS_SPFTREE, "ISIS SPFtree");
DEFINE_MTYPE(ISISD, ISIS_VERTEX, "ISIS vertex");
DEFINE_MTYPE(ISISD, ISIS_ROUTE_INFO, "ISIS route info");
DEFINE_MTYPE(ISISD, ISIS_NEXTHOP, "ISIS nexthop");
DEFINE_MTYPE(ISISD, ISIS_NEXTHOP_LABELS, "ISIS nexthop MPLS labels");
DEFINE_MTYPE(ISISD, ISIS_DICT, "ISIS dictionary");
DEFINE_MTYPE(ISISD, ISIS_DICT_NODE, "ISIS dictionary node");
DEFINE_MTYPE(ISISD, ISIS_EXT_ROUTE, "ISIS redistributed route");
DEFINE_MTYPE(ISISD, ISIS_EXT_INFO, "ISIS redistributed route info");
DEFINE_MTYPE(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters");
DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name");
DEFINE_MTYPE(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");

View File

@ -1,50 +0,0 @@
/* isisd 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_ISIS_MEMORY_H
#define _QUAGGA_ISIS_MEMORY_H
#include "memory.h"
DECLARE_MGROUP(ISISD);
DECLARE_MTYPE(ISIS);
DECLARE_MTYPE(ISIS_TMP);
DECLARE_MTYPE(ISIS_CIRCUIT);
DECLARE_MTYPE(ISIS_LSP);
DECLARE_MTYPE(ISIS_ADJACENCY);
DECLARE_MTYPE(ISIS_ADJACENCY_INFO);
DECLARE_MTYPE(ISIS_AREA);
DECLARE_MTYPE(ISIS_AREA_ADDR);
DECLARE_MTYPE(ISIS_DYNHN);
DECLARE_MTYPE(ISIS_SPFTREE);
DECLARE_MTYPE(ISIS_VERTEX);
DECLARE_MTYPE(ISIS_ROUTE_INFO);
DECLARE_MTYPE(ISIS_NEXTHOP);
DECLARE_MTYPE(ISIS_NEXTHOP_LABELS);
DECLARE_MTYPE(ISIS_DICT);
DECLARE_MTYPE(ISIS_DICT_NODE);
DECLARE_MTYPE(ISIS_EXT_ROUTE);
DECLARE_MTYPE(ISIS_EXT_INFO);
DECLARE_MTYPE(ISIS_MPLS_TE);
DECLARE_MTYPE(ISIS_ACL_NAME);
DECLARE_MTYPE(ISIS_PLIST_NAME);
#endif /* _QUAGGA_ISIS_MEMORY_H */

View File

@ -21,7 +21,6 @@
*/
#include <zebra.h>
#include "isisd/isisd.h"
#include "isisd/isis_memory.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_adjacency.h"
#include "isisd/isis_misc.h"

View File

@ -48,12 +48,14 @@
#include "isisd/isis_spf.h"
#include "isisd/isis_spf_private.h"
#include "isisd/isis_te.h"
#include "isisd/isis_memory.h"
#include "isisd/isis_mt.h"
#include "isisd/isis_redist.h"
#include "isisd/isis_ldp_sync.h"
#include "isisd/isis_dr.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters");
DEFINE_MTYPE_STATIC(ISISD, ISIS_PLIST_NAME, "ISIS prefix-list name");
extern struct zclient *zclient;
/*

View File

@ -24,7 +24,6 @@
#include "if.h"
#include "linklist.h"
#include "memory.h"
#include "isis_memory.h"
#include "prefix.h"
#include "routemap.h"
#include "stream.h"
@ -42,6 +41,10 @@
#include "isisd/isis_route.h"
#include "isisd/isis_zebra.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_EXT_ROUTE, "ISIS redistributed route");
DEFINE_MTYPE_STATIC(ISISD, ISIS_EXT_INFO, "ISIS redistributed route info");
DEFINE_MTYPE_STATIC(ISISD, ISIS_RMAP_NAME, "ISIS redistribute route-map name");
static int redist_protocol(int family)
{
if (family == AF_INET)
@ -327,13 +330,13 @@ static void isis_redist_routemap_set(struct isis_redist *redist,
const char *routemap)
{
if (redist->map_name) {
XFREE(MTYPE_ISIS, redist->map_name);
XFREE(MTYPE_ISIS_RMAP_NAME, redist->map_name);
route_map_counter_decrement(redist->map);
redist->map = NULL;
}
if (routemap && strlen(routemap)) {
redist->map_name = XSTRDUP(MTYPE_ISIS, routemap);
redist->map_name = XSTRDUP(MTYPE_ISIS_RMAP_NAME, routemap);
redist->map = route_map_lookup_by_name(routemap);
route_map_counter_increment(redist->map);
}
@ -507,7 +510,7 @@ void isis_redist_area_finish(struct isis_area *area)
redist = &area->redist_settings[protocol][type]
[level];
redist->redist = 0;
XFREE(MTYPE_ISIS, redist->map_name);
XFREE(MTYPE_ISIS_RMAP_NAME, redist->map_name);
}
route_table_finish(area->ext_reach[protocol][level]);
}

View File

@ -50,6 +50,9 @@
#include "isis_route.h"
#include "isis_zebra.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_NEXTHOP, "ISIS nexthop");
DEFINE_MTYPE_STATIC(ISISD, ISIS_ROUTE_INFO, "ISIS route info");
DEFINE_HOOK(isis_route_update_hook,
(struct isis_area * area, struct prefix *prefix,
struct isis_route_info *route_info),

View File

@ -60,8 +60,10 @@
#include "fabricd.h"
#include "isis_spf_private.h"
DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_RUN, "ISIS SPF Run Info");
DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_ADJ, "ISIS SPF Adjacency");
DEFINE_MTYPE_STATIC(ISISD, ISIS_SPFTREE, "ISIS SPFtree");
DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_RUN, "ISIS SPF Run Info");
DEFINE_MTYPE_STATIC(ISISD, ISIS_SPF_ADJ, "ISIS SPF Adjacency");
DEFINE_MTYPE_STATIC(ISISD, ISIS_VERTEX, "ISIS vertex");
DEFINE_MTYPE_STATIC(ISISD, ISIS_VERTEX_ADJ, "ISIS SPF Vertex Adjacency");
static void spf_adj_list_parse_lsp(struct isis_spftree *spftree,
@ -248,6 +250,20 @@ static struct isis_vertex *isis_vertex_new(struct isis_spftree *spftree,
return vertex;
}
void isis_vertex_del(struct isis_vertex *vertex)
{
list_delete(&vertex->Adj_N);
list_delete(&vertex->parents);
if (vertex->firsthops) {
hash_clean(vertex->firsthops, NULL);
hash_free(vertex->firsthops);
vertex->firsthops = NULL;
}
memset(vertex, 0, sizeof(struct isis_vertex));
XFREE(MTYPE_ISIS_VERTEX, vertex);
}
struct isis_vertex_adj *
isis_vertex_adj_add(struct isis_spftree *spftree, struct isis_vertex *vertex,
struct list *vadj_list, struct isis_spf_adj *sadj,

View File

@ -179,20 +179,7 @@ static void isis_vertex_queue_init(struct isis_vertex_queue *queue,
isis_vertex_queue_hash_cmp, name);
}
__attribute__((__unused__))
static void isis_vertex_del(struct isis_vertex *vertex)
{
list_delete(&vertex->Adj_N);
list_delete(&vertex->parents);
if (vertex->firsthops) {
hash_clean(vertex->firsthops, NULL);
hash_free(vertex->firsthops);
vertex->firsthops = NULL;
}
memset(vertex, 0, sizeof(struct isis_vertex));
XFREE(MTYPE_ISIS_VERTEX, vertex);
}
void isis_vertex_del(struct isis_vertex *vertex);
bool isis_vertex_adj_exists(const struct isis_spftree *spftree,
const struct isis_vertex *vertex,

View File

@ -33,7 +33,6 @@
#include "network.h"
#include "isisd/isisd.h"
#include "isisd/isis_memory.h"
#include "isisd/isis_tlvs.h"
#include "isisd/isis_common.h"
#include "isisd/isis_mt.h"

View File

@ -25,7 +25,6 @@
#include "jhash.h"
#include "isisd/isisd.h"
#include "isisd/isis_memory.h"
#include "isisd/isis_flags.h"
#include "isisd/isis_circuit.h"
#include "isisd/isis_lsp.h"

View File

@ -81,6 +81,14 @@ unsigned long debug_sr;
unsigned long debug_ldp_sync;
unsigned long debug_lfa;
DEFINE_MGROUP(ISISD, "isisd");
DEFINE_MTYPE_STATIC(ISISD, ISIS, "ISIS process");
DEFINE_MTYPE_STATIC(ISISD, ISIS_NAME, "ISIS process name");
DEFINE_MTYPE_STATIC(ISISD, ISIS_AREA, "ISIS area");
DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address");
DEFINE_MTYPE(ISISD, ISIS_ACL_NAME, "ISIS access-list name");
DEFINE_QOBJ_TYPE(isis_area);
/* ISIS process wide configuration. */
@ -198,10 +206,10 @@ struct isis *isis_new(const char *vrf_name)
if (vrf) {
isis->vrf_id = vrf->vrf_id;
isis_vrf_link(isis, vrf);
isis->name = XSTRDUP(MTYPE_ISIS, vrf->name);
isis->name = XSTRDUP(MTYPE_ISIS_NAME, vrf->name);
} else {
isis->vrf_id = VRF_UNKNOWN;
isis->name = XSTRDUP(MTYPE_ISIS, vrf_name);
isis->name = XSTRDUP(MTYPE_ISIS_NAME, vrf_name);
}
if (IS_DEBUG_EVENTS)
@ -565,7 +573,7 @@ static int isis_vrf_enable(struct vrf *vrf)
isis = isis_lookup_by_vrfname(vrf->name);
if (isis) {
if (isis->name && strmatch(vrf->name, VRF_DEFAULT_NAME)) {
XFREE(MTYPE_ISIS, isis->name);
XFREE(MTYPE_ISIS_NAME, isis->name);
isis->name = NULL;
}
old_vrf_id = isis->vrf_id;
@ -631,7 +639,7 @@ void isis_finish(struct isis *isis)
vrf = vrf_lookup_by_name(isis->name);
if (vrf)
isis_vrf_unlink(isis, vrf);
XFREE(MTYPE_ISIS, isis->name);
XFREE(MTYPE_ISIS_NAME, isis->name);
} else {
vrf = vrf_lookup_by_id(VRF_DEFAULT);
if (vrf)

View File

@ -24,6 +24,7 @@
#define ISISD_H
#include "vty.h"
#include "memory.h"
#include "isisd/isis_constants.h"
#include "isisd/isis_common.h"
@ -34,10 +35,11 @@
#include "isis_flags.h"
#include "isis_lsp.h"
#include "isis_lfa.h"
#include "isis_memory.h"
#include "qobj.h"
#include "ldp_sync.h"
DECLARE_MGROUP(ISISD);
#ifdef FABRICD
static const bool fabricd = true;
#define PROTO_TYPE ZEBRA_ROUTE_OPENFABRIC
@ -240,6 +242,9 @@ struct isis_area {
};
DECLARE_QOBJ_TYPE(isis_area);
DECLARE_MTYPE(ISIS_ACL_NAME); /* isis_area->spf_prefix_prioritites */
DECLARE_MTYPE(ISIS_AREA_ADDR); /* isis_area->area_addrs */
DECLARE_HOOK(isis_area_overload_bit_update, (struct isis_area * area), (area));
void isis_terminate(void);

View File

@ -57,7 +57,6 @@ noinst_HEADERS += \
isisd/isis_ldp_sync.h \
isisd/isis_lfa.h \
isisd/isis_lsp.h \
isisd/isis_memory.h \
isisd/isis_misc.h \
isisd/isis_mt.h \
isisd/isis_nb.h \
@ -92,7 +91,6 @@ LIBISIS_SOURCES = \
isisd/isis_ldp_sync.c \
isisd/isis_lfa.c \
isisd/isis_lsp.c \
isisd/isis_memory.c \
isisd/isis_misc.c \
isisd/isis_mt.c \
isisd/isis_pdu.c \

View File

@ -46,6 +46,7 @@
#include "ospf6d.h"
#include "lib/json.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_AREA, "OSPF6 area");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PLISTNAME, "Prefix list name");
int ospf6_area_cmp(void *va, void *vb)

View File

@ -49,6 +49,10 @@
#include "ospf6d.h"
#include "lib/json.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_EXTERNAL_INFO, "OSPF6 ext. info");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DIST_ARGS, "OSPF6 Distribute arguments");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_REDISTRIBUTE, "OSPF6 Redistribute arguments");
static void ospf6_asbr_redistribute_set(int type, vrf_id_t vrf_id);
static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
struct ospf6_redist *red, int type);

View File

@ -45,6 +45,7 @@
#include "ospf6_zebra.h"
#include "lib/json.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_IF, "OSPF6 interface");
DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names");
DEFINE_QOBJ_TYPE(ospf6_interface);
DEFINE_HOOK(ospf6_interface_change,

View File

@ -43,6 +43,10 @@
#include "ospf6_flood.h"
#include "ospf6d.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA, "OSPF6 LSA");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA_HEADER, "OSPF6 LSA header");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA_SUMMARY, "OSPF6 LSA summary");
vector ospf6_lsa_handler_vector;
struct ospf6 *ospf6_get_by_lsdb(struct ospf6_lsa *lsa)
@ -657,27 +661,29 @@ void ospf6_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
vty_out(vty, "\n");
}
struct ospf6_lsa *ospf6_lsa_alloc(size_t lsa_length)
{
struct ospf6_lsa *lsa;
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
lsa->header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, lsa_length);
return lsa;
}
/* OSPFv3 LSA creation/deletion function */
struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
{
struct ospf6_lsa *lsa = NULL;
struct ospf6_lsa_header *new_header = NULL;
uint16_t lsa_size = 0;
/* size of the entire LSA */
lsa_size = ntohs(header->length); /* XXX vulnerable */
/* allocate memory for this LSA */
new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, lsa_size);
lsa = ospf6_lsa_alloc(lsa_size);
/* copy LSA from original header */
memcpy(new_header, header, lsa_size);
/* LSA information structure */
/* allocate memory */
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
lsa->header = new_header;
memcpy(lsa->header, header, lsa_size);
/* dump string */
ospf6_lsa_printbuf(lsa, lsa->name, sizeof(lsa->name));
@ -691,20 +697,11 @@ struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
struct ospf6_lsa *ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header)
{
struct ospf6_lsa *lsa = NULL;
struct ospf6_lsa_header *new_header = NULL;
/* allocate memory for this LSA */
new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER,
sizeof(struct ospf6_lsa_header));
lsa = ospf6_lsa_alloc(sizeof(struct ospf6_lsa_header));
/* copy LSA from original header */
memcpy(new_header, header, sizeof(struct ospf6_lsa_header));
memcpy(lsa->header, header, sizeof(struct ospf6_lsa_header));
/* LSA information structure */
/* allocate memory */
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
lsa->header = new_header;
SET_FLAG(lsa->flag, OSPF6_LSA_HEADERONLY);
/* dump string */

View File

@ -217,6 +217,7 @@ extern void ospf6_lsa_show_internal(struct vty *vty, struct ospf6_lsa *lsa,
extern void ospf6_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
json_object *json, bool use_json);
extern struct ospf6_lsa *ospf6_lsa_alloc(size_t lsa_length);
extern struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header);
extern struct ospf6_lsa *
ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header);

View File

@ -34,6 +34,8 @@
#include "ospf6d.h"
#include "bitfield.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSDB, "OSPF6 LSA database");
struct ospf6_lsdb *ospf6_lsdb_create(void *data)
{
struct ospf6_lsdb *lsdb;

View File

@ -1,47 +0,0 @@
/* ospf6d 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 "ospf6_memory.h"
DEFINE_MGROUP(OSPF6D, "ospf6d");
DEFINE_MTYPE(OSPF6D, OSPF6_TOP, "OSPF6 top");
DEFINE_MTYPE(OSPF6D, OSPF6_AREA, "OSPF6 area");
DEFINE_MTYPE(OSPF6D, OSPF6_IF, "OSPF6 interface");
DEFINE_MTYPE(OSPF6D, OSPF6_NEIGHBOR, "OSPF6 neighbor");
DEFINE_MTYPE(OSPF6D, OSPF6_ROUTE, "OSPF6 route");
DEFINE_MTYPE(OSPF6D, OSPF6_PREFIX, "OSPF6 prefix");
DEFINE_MTYPE(OSPF6D, OSPF6_MESSAGE, "OSPF6 message");
DEFINE_MTYPE(OSPF6D, OSPF6_LSA, "OSPF6 LSA");
DEFINE_MTYPE(OSPF6D, OSPF6_LSA_HEADER, "OSPF6 LSA header");
DEFINE_MTYPE(OSPF6D, OSPF6_LSA_SUMMARY, "OSPF6 LSA summary");
DEFINE_MTYPE(OSPF6D, OSPF6_LSDB, "OSPF6 LSA database");
DEFINE_MTYPE(OSPF6D, OSPF6_VERTEX, "OSPF6 vertex");
DEFINE_MTYPE(OSPF6D, OSPF6_SPFTREE, "OSPF6 SPF tree");
DEFINE_MTYPE(OSPF6D, OSPF6_NEXTHOP, "OSPF6 nexthop");
DEFINE_MTYPE(OSPF6D, OSPF6_EXTERNAL_INFO, "OSPF6 ext. info");
DEFINE_MTYPE(OSPF6D, OSPF6_PATH, "OSPF6 Path");
DEFINE_MTYPE(OSPF6D, OSPF6_DIST_ARGS, "OSPF6 Distribute arguments");
DEFINE_MTYPE(OSPF6D, OSPF6_OTHER, "OSPF6 other");
DEFINE_MTYPE(OSPF6D, OSPF6_REDISTRIBUTE, "OSPF6 Redistribute arguments");

View File

@ -1,48 +0,0 @@
/* ospf6d 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_OSPF6_MEMORY_H
#define _QUAGGA_OSPF6_MEMORY_H
#include "memory.h"
DECLARE_MGROUP(OSPF6D);
DECLARE_MTYPE(OSPF6_TOP);
DECLARE_MTYPE(OSPF6_AREA);
DECLARE_MTYPE(OSPF6_IF);
DECLARE_MTYPE(OSPF6_NEIGHBOR);
DECLARE_MTYPE(OSPF6_ROUTE);
DECLARE_MTYPE(OSPF6_PREFIX);
DECLARE_MTYPE(OSPF6_MESSAGE);
DECLARE_MTYPE(OSPF6_LSA);
DECLARE_MTYPE(OSPF6_LSA_HEADER);
DECLARE_MTYPE(OSPF6_LSA_SUMMARY);
DECLARE_MTYPE(OSPF6_LSDB);
DECLARE_MTYPE(OSPF6_VERTEX);
DECLARE_MTYPE(OSPF6_SPFTREE);
DECLARE_MTYPE(OSPF6_NEXTHOP);
DECLARE_MTYPE(OSPF6_EXTERNAL_INFO);
DECLARE_MTYPE(OSPF6_PATH);
DECLARE_MTYPE(OSPF6_DIST_ARGS);
DECLARE_MTYPE(OSPF6_REDISTRIBUTE);
DECLARE_MTYPE(OSPF6_OTHER);
#endif /* _QUAGGA_OSPF6_MEMORY_H */

View File

@ -49,6 +49,8 @@
#include <netinet/ip6.h>
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_MESSAGE, "OSPF6 message");
unsigned char conf_debug_ospf6_message[6] = {0x03, 0, 0, 0, 0, 0};
static const struct message ospf6_message_type_str[] = {
{OSPF6_MESSAGE_TYPE_HELLO, "Hello"},

View File

@ -46,6 +46,8 @@
#include "ospf6_zebra.h"
#include "lib/json.h"
DEFINE_MTYPE(OSPF6D, OSPF6_NEIGHBOR, "OSPF6 neighbor");
DEFINE_HOOK(ospf6_neighbor_change,
(struct ospf6_neighbor * on, int state, int next_state),
(on, state, next_state));

View File

@ -38,6 +38,10 @@
#include "ospf6d.h"
#include "ospf6_zebra.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_ROUTE, "OSPF6 route");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_NEXTHOP, "OSPF6 nexthop");
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PATH, "OSPF6 Path");
unsigned char conf_debug_ospf6_route = 0;
static char *ospf6_route_table_name(struct ospf6_route_table *table)

View File

@ -43,6 +43,8 @@
#include "ospf6d.h"
#include "ospf6_abr.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_VERTEX, "OSPF6 vertex");
unsigned char conf_debug_ospf6_spf = 0;
static void ospf6_spf_copy_nexthops_to_route(struct ospf6_route *rt,
@ -1021,13 +1023,8 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
return NULL;
}
/* Allocate memory for this LSA */
new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, total_lsa_length);
/* LSA information structure */
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
lsa->header = (struct ospf6_lsa_header *)new_header;
lsa = ospf6_lsa_alloc(total_lsa_length);
new_header = (uint8_t *)lsa->header;
lsa->lsdb = area->temp_router_lsa_lsdb;

View File

@ -53,6 +53,8 @@
#include "ospf6d.h"
#include "lib/json.h"
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_TOP, "OSPF6 top");
DEFINE_QOBJ_TYPE(ospf6);
FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES,

View File

@ -46,6 +46,8 @@
#include "ospf6_bfd.h"
#include "lib/json.h"
DEFINE_MGROUP(OSPF6D, "ospf6d");
struct route_node *route_prev(struct route_node *node)
{
struct route_node *end;

View File

@ -23,8 +23,9 @@
#include "libospf.h"
#include "thread.h"
#include "memory.h"
#include "ospf6_memory.h"
DECLARE_MGROUP(OSPF6D);
/* global variables */
extern struct thread_master *master;

View File

@ -40,7 +40,6 @@ ospf6d_libospf6_a_SOURCES = \
ospf6d/ospf6_intra.c \
ospf6d/ospf6_lsa.c \
ospf6d/ospf6_lsdb.c \
ospf6d/ospf6_memory.c \
ospf6d/ospf6_message.c \
ospf6d/ospf6_neighbor.c \
ospf6d/ospf6_network.c \
@ -62,7 +61,6 @@ noinst_HEADERS += \
ospf6d/ospf6_intra.h \
ospf6d/ospf6_lsa.h \
ospf6d/ospf6_lsdb.h \
ospf6d/ospf6_memory.h \
ospf6d/ospf6_message.h \
ospf6d/ospf6_neighbor.h \
ospf6d/ospf6_network.h \

View File

@ -20,6 +20,7 @@
#include <math.h>
#include <zebra.h>
#include "memory.h"
#include "log.h"
#include "command.h"
#include "mpls.h"
@ -28,7 +29,6 @@
#include "pathd/pathd.h"
#include "pathd/path_nb.h"
#include "pathd/path_memory.h"
#ifndef VTYSH_EXTRACT_PL
#include "pathd/path_cli_clippy.c"
#endif

View File

@ -1,25 +0,0 @@
/*
* Copyright (C) 2020 NetDEF, Inc.
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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
*/
#include <zebra.h>
#include <memory.h>
#include "pathd/path_memory.h"
DEFINE_MGROUP(PATHD, "pathd");

View File

@ -1,26 +0,0 @@
/*
* Copyright (C) 2020 NetDEF, Inc.
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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 _FRR_PATH_MEMORY_H_
#define _FRR_PATH_MEMORY_H_
#include "memory.h"
DECLARE_MGROUP(PATHD);
#endif /* _FRR_PATH_MEMORY_H_ */

View File

@ -19,6 +19,7 @@
#include <zebra.h>
#include "pceplib/pcep_utils_counters.h"
#include "memory.h"
#include "log.h"
#include "command.h"
#include "libfrr.h"
@ -31,13 +32,13 @@
#include "pathd/pathd.h"
#include "pathd/path_errors.h"
#include "pathd/path_pcep_memory.h"
#include "pathd/path_pcep.h"
#include "pathd/path_pcep_cli.h"
#include "pathd/path_pcep_controller.h"
#include "pathd/path_pcep_lib.h"
#include "pathd/path_pcep_config.h"
DEFINE_MTYPE(PATHD, PCEP, "PCEP module");
/*
* Globals.

View File

@ -22,11 +22,13 @@
#include <stdbool.h>
#include <debug.h>
#include <netinet/tcp.h>
#include "memory.h"
#include "pceplib/pcep_utils_logging.h"
#include "pceplib/pcep_pcc_api.h"
#include "mpls.h"
#include "pathd/pathd.h"
#include "pathd/path_pcep_memory.h"
DECLARE_MTYPE(PCEP);
#define PCEP_DEFAULT_PORT 4189
#define MAX_PCC 32

View File

@ -33,7 +33,6 @@
#include "pathd/pathd.h"
#include "pathd/path_errors.h"
#include "pathd/path_pcep_memory.h"
#include "pathd/path_pcep.h"
#include "pathd/path_pcep_cli.h"
#include "pathd/path_pcep_controller.h"

View File

@ -18,15 +18,18 @@
#include <zebra.h>
#include "memory.h"
#include <debug.h>
#include "pceplib/pcep_utils_counters.h"
#include "pceplib/pcep_timers.h"
#include "pathd/path_errors.h"
#include "pathd/path_memory.h"
#include "pathd/path_pcep.h"
#include "pathd/path_pcep_lib.h"
#include "pathd/path_pcep_debug.h"
#include "pathd/path_pcep_memory.h"
DEFINE_MTYPE_STATIC(PATHD, PCEPLIB_INFRA, "PCEPlib Infrastructure");
DEFINE_MTYPE_STATIC(PATHD, PCEPLIB_MESSAGES, "PCEPlib PCEP Messages");
#define CLASS_TYPE(CLASS, TYPE) (((CLASS) << 16) | (TYPE))
#define DEFAULT_LSAP_SETUP_PRIO 4

View File

@ -1,27 +0,0 @@
/*
* Copyright (C) 2020 NetDEF, Inc.
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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
*/
#include <zebra.h>
#include <memory.h>
#include "pathd/path_pcep_memory.h"
DEFINE_MTYPE(PATHD, PCEP, "PCEP module");
DEFINE_MTYPE(PATHD, PCEPLIB_INFRA, "PCEPlib Infrastructure");
DEFINE_MTYPE(PATHD, PCEPLIB_MESSAGES, "PCEPlib PCEP Messages");

View File

@ -1,28 +0,0 @@
/*
* Copyright (C) 2020 NetDEF, Inc.
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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 _FRR_PATH_PCEP_MEMORY_H_
#define _FRR_PATH_PCEP_MEMORY_H_
#include "pathd/path_memory.h"
DECLARE_MTYPE(PCEP);
DECLARE_MTYPE(PCEPLIB_INFRA);
DECLARE_MTYPE(PCEPLIB_MESSAGES);
#endif /* _FRR_PATH_PCEP_MEMORY_H_ */

View File

@ -41,7 +41,6 @@
#include "pathd/pathd.h"
#include "pathd/path_zebra.h"
#include "pathd/path_errors.h"
#include "pathd/path_pcep_memory.h"
#include "pathd/path_pcep.h"
#include "pathd/path_pcep_controller.h"
#include "pathd/path_pcep_lib.h"

View File

@ -24,12 +24,13 @@
#include "network.h"
#include "pathd/pathd.h"
#include "pathd/path_memory.h"
#include "pathd/path_zebra.h"
#include "pathd/path_debug.h"
#define HOOK_DELAY 3
DEFINE_MGROUP(PATHD, "pathd");
DEFINE_MTYPE_STATIC(PATHD, PATH_SEGMENT_LIST, "Segment List");
DEFINE_MTYPE_STATIC(PATHD, PATH_SR_POLICY, "SR Policy");
DEFINE_MTYPE_STATIC(PATHD, PATH_SR_CANDIDATE, "SR Policy candidate path");

View File

@ -19,11 +19,14 @@
#ifndef _FRR_PATHD_H_
#define _FRR_PATHD_H_
#include "lib/memory.h"
#include "lib/mpls.h"
#include "lib/ipaddr.h"
#include "lib/srte.h"
#include "lib/hook.h"
DECLARE_MGROUP(PATHD);
enum srte_protocol_origin {
SRTE_ORIGIN_UNDEFINED = 0,
SRTE_ORIGIN_PCEP = 1,

View File

@ -23,7 +23,6 @@ pathd_libpath_a_SOURCES = \
pathd/path_debug.c \
pathd/path_errors.c \
pathd/path_main.c \
pathd/path_memory.c \
pathd/path_nb.c \
pathd/path_nb_config.c \
pathd/path_nb_state.c \
@ -39,14 +38,12 @@ clippy_scan += \
noinst_HEADERS += \
pathd/path_debug.h \
pathd/path_errors.h \
pathd/path_memory.h \
pathd/path_nb.h \
pathd/path_pcep.h \
pathd/path_pcep_cli.h \
pathd/path_pcep_controller.h \
pathd/path_pcep_debug.h \
pathd/path_pcep_lib.h \
pathd/path_pcep_memory.h \
pathd/path_pcep_config.h \
pathd/path_pcep_pcc.h \
pathd/path_zebra.h \
@ -65,7 +62,6 @@ pathd_pathd_pcep_la_SOURCES = \
pathd/path_pcep_controller.c \
pathd/path_pcep_debug.c \
pathd/path_pcep_lib.c \
pathd/path_pcep_memory.c \
pathd/path_pcep_config.c \
pathd/path_pcep_pcc.c \
# end

View File

@ -1,28 +0,0 @@
/*
* static memory code.
* Copyright (C) 2018 Cumulus Networks, Inc.
* Donald Sharp
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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
*/
#include <zebra.h>
#include <memory.h>
#include "staticd/static_memory.h"
DEFINE_MGROUP(STATIC, "staticd");
DEFINE_MTYPE(STATIC, STATIC_NEXTHOP, "Static Nexthop");

View File

@ -1,30 +0,0 @@
/*
* static memory code.
* Copyright (C) 2018 Cumulus Networks, Inc.
* Donald Sharp
*
* This program 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 of the License, or (at your option)
* any later version.
*
* This program 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 __STATIC_MEMORY_H__
#include "memory.h"
DECLARE_MGROUP(STATIC);
DECLARE_MTYPE(STATIC_ROUTE);
DECLARE_MTYPE(STATIC_NEXTHOP);
DECLARE_MTYPE(STATIC_PATH);
#endif

View File

@ -31,12 +31,71 @@
#include "static_vrf.h"
#include "static_routes.h"
#include "static_memory.h"
#include "static_zebra.h"
#include "static_debug.h"
DEFINE_MTYPE(STATIC, STATIC_ROUTE, "Static Route Info");
DEFINE_MTYPE(STATIC, STATIC_PATH, "Static Path");
DEFINE_MGROUP(STATIC, "staticd");
DEFINE_MTYPE_STATIC(STATIC, STATIC_ROUTE, "Static Route Info");
DEFINE_MTYPE_STATIC(STATIC, STATIC_PATH, "Static Path");
DEFINE_MTYPE_STATIC(STATIC, STATIC_NEXTHOP, "Static Nexthop");
void zebra_stable_node_cleanup(struct route_table *table,
struct route_node *node)
{
struct static_nexthop *nh;
struct static_path *pn;
struct static_route_info *si;
struct route_table *src_table;
struct route_node *src_node;
struct static_path *src_pn;
struct static_route_info *src_si;
si = node->info;
if (si) {
frr_each_safe(static_path_list, &si->path_list, pn) {
frr_each_safe(static_nexthop_list, &pn->nexthop_list,
nh) {
static_nexthop_list_del(&pn->nexthop_list, nh);
XFREE(MTYPE_STATIC_NEXTHOP, nh);
}
static_path_list_del(&si->path_list, pn);
XFREE(MTYPE_STATIC_PATH, pn);
}
/* clean up for dst table */
src_table = srcdest_srcnode_table(node);
if (src_table) {
/* This means the route_node is part of the top
* hierarchy and refers to a destination prefix.
*/
for (src_node = route_top(src_table); src_node;
src_node = route_next(src_node)) {
src_si = src_node->info;
frr_each_safe(static_path_list,
&src_si->path_list, src_pn) {
frr_each_safe(static_nexthop_list,
&src_pn->nexthop_list,
nh) {
static_nexthop_list_del(
&src_pn->nexthop_list,
nh);
XFREE(MTYPE_STATIC_NEXTHOP, nh);
}
static_path_list_del(&src_si->path_list,
src_pn);
XFREE(MTYPE_STATIC_PATH, src_pn);
}
XFREE(MTYPE_STATIC_ROUTE, src_node->info);
}
}
XFREE(MTYPE_STATIC_ROUTE, node->info);
}
}
/* Install static path into rib. */
void static_install_path(struct route_node *rn, struct static_path *pn,

View File

@ -22,6 +22,9 @@
#include "lib/mpls.h"
#include "table.h"
#include "memory.h"
DECLARE_MGROUP(STATIC);
/* Static route label information */
struct static_nh_label {
@ -198,6 +201,9 @@ extern bool static_add_nexthop_validate(const char *nh_vrf_name,
extern struct stable_info *static_get_stable_info(struct route_node *rn);
extern void static_route_info_init(struct static_route_info *si);
extern void zebra_stable_node_cleanup(struct route_table *table,
struct route_node *node);
/*
* Max string return via API static_get_nh_str in size_t
*/

View File

@ -24,7 +24,6 @@
#include "table.h"
#include "srcdest_table.h"
#include "static_memory.h"
#include "static_vrf.h"
#include "static_routes.h"
#include "static_zebra.h"
@ -32,63 +31,6 @@
DEFINE_MTYPE_STATIC(STATIC, STATIC_RTABLE_INFO, "Static Route Table Info");
static void zebra_stable_node_cleanup(struct route_table *table,
struct route_node *node)
{
struct static_nexthop *nh;
struct static_path *pn;
struct static_route_info *si;
struct route_table *src_table;
struct route_node *src_node;
struct static_path *src_pn;
struct static_route_info *src_si;
si = node->info;
if (si) {
frr_each_safe(static_path_list, &si->path_list, pn) {
frr_each_safe(static_nexthop_list, &pn->nexthop_list,
nh) {
static_nexthop_list_del(&pn->nexthop_list, nh);
XFREE(MTYPE_STATIC_NEXTHOP, nh);
}
static_path_list_del(&si->path_list, pn);
XFREE(MTYPE_STATIC_PATH, pn);
}
/* clean up for dst table */
src_table = srcdest_srcnode_table(node);
if (src_table) {
/* This means the route_node is part of the top
* hierarchy and refers to a destination prefix.
*/
for (src_node = route_top(src_table); src_node;
src_node = route_next(src_node)) {
src_si = src_node->info;
frr_each_safe(static_path_list,
&src_si->path_list, src_pn) {
frr_each_safe(static_nexthop_list,
&src_pn->nexthop_list,
nh) {
static_nexthop_list_del(
&src_pn->nexthop_list,
nh);
XFREE(MTYPE_STATIC_NEXTHOP, nh);
}
static_path_list_del(&src_si->path_list,
src_pn);
XFREE(MTYPE_STATIC_PATH, src_pn);
}
XFREE(MTYPE_STATIC_ROUTE, src_node->info);
}
}
XFREE(MTYPE_STATIC_ROUTE, node->info);
}
}
static struct static_vrf *static_vrf_alloc(void)
{
struct route_table *table;

View File

@ -33,7 +33,6 @@
#include "northbound_cli.h"
#include "static_vrf.h"
#include "static_memory.h"
#include "static_vty.h"
#include "static_routes.h"
#include "static_debug.h"

View File

@ -13,7 +13,6 @@ endif
staticd_libstatic_a_SOURCES = \
staticd/static_debug.c \
staticd/static_memory.c \
staticd/static_nht.c \
staticd/static_routes.c \
staticd/static_zebra.c \
@ -25,7 +24,6 @@ staticd_libstatic_a_SOURCES = \
noinst_HEADERS += \
staticd/static_debug.h \
staticd/static_memory.h \
staticd/static_nht.h \
staticd/static_zebra.h \
staticd/static_routes.h \

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View File

@ -23,6 +23,7 @@
#define _ZEBRA_RIB_H
#include "zebra.h"
#include "memory.h"
#include "hook.h"
#include "typesafe.h"
#include "linklist.h"
@ -41,6 +42,10 @@
extern "C" {
#endif
DECLARE_MGROUP(ZEBRA);
DECLARE_MTYPE(RE);
enum rnh_type { RNH_NEXTHOP_TYPE, RNH_IMPORT_CHECK_TYPE };
PREDECL_LIST(rnh_list);

View 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"

View 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"

View File

@ -23,7 +23,6 @@
#include <zebra.h>
#include "memory.h"
#include "zebra_memory.h"
#include "sockopt.h"
#include "thread.h"
#include "if.h"

View File

@ -24,7 +24,6 @@
#if !defined(GNU_LINUX)
#include "memory.h"
#include "zebra_memory.h"
#include "log.h"
#include "vrf.h"

View 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 \

View 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;

View 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

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

View 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"

Some files were not shown because too many files have changed in this diff Show More