summaryrefslogtreecommitdiffstats
path: root/eigrpd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2021-03-22 18:37:25 +0100
committerDavid Lamparter <equinox@diac24.net>2021-03-22 18:37:25 +0100
commitb4216e2c6681fabb755b814f8304f37cea0d235b (patch)
tree16cee9606ce98ac97554b7cb7052b5d63ef6ae3b /eigrpd
parentisisd: kill isis_memory.h, use MTYPE_STATIC (diff)
downloadfrr-b4216e2c6681fabb755b814f8304f37cea0d235b.tar.xz
frr-b4216e2c6681fabb755b814f8304f37cea0d235b.zip
eigrpd: kill eigrp_memory.h, use MTYPE_STATIC
Same as previous commit -- convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_filter.c1
-rw-r--r--eigrpd/eigrp_interface.c4
-rw-r--r--eigrpd/eigrp_memory.c42
-rw-r--r--eigrpd/eigrp_memory.h43
-rw-r--r--eigrpd/eigrp_neighbor.c3
-rw-r--r--eigrpd/eigrp_packet.c8
-rw-r--r--eigrpd/eigrp_query.c1
-rw-r--r--eigrpd/eigrp_reply.c1
-rw-r--r--eigrpd/eigrp_siaquery.c1
-rw-r--r--eigrpd/eigrp_siareply.c1
-rw-r--r--eigrpd/eigrp_topology.c4
-rw-r--r--eigrpd/eigrp_topology.h4
-rw-r--r--eigrpd/eigrp_update.c1
-rw-r--r--eigrpd/eigrpd.c5
-rw-r--r--eigrpd/eigrpd.h3
-rw-r--r--eigrpd/subdir.am2
16 files changed, 26 insertions, 98 deletions
diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c
index c77a6fc1b..8f80b78d2 100644
--- a/eigrpd/eigrp_filter.c
+++ b/eigrpd/eigrp_filter.c
@@ -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.
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index bb7a930e6..02e943043 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -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)
{
diff --git a/eigrpd/eigrp_memory.c b/eigrpd/eigrp_memory.c
deleted file mode 100644
index f2cb9a5c9..000000000
--- a/eigrpd/eigrp_memory.c
+++ /dev/null
@@ -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");
diff --git a/eigrpd/eigrp_memory.h b/eigrpd/eigrp_memory.h
deleted file mode 100644
index bf1eff875..000000000
--- a/eigrpd/eigrp_memory.h
+++ /dev/null
@@ -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 */
diff --git a/eigrpd/eigrp_neighbor.c b/eigrpd/eigrp_neighbor.c
index 1da2f7a10..f2d5217eb 100644
--- a/eigrpd/eigrp_neighbor.c
+++ b/eigrpd/eigrp_neighbor.c
@@ -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;
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
index 7eee25462..0b3773399 100644
--- a/eigrpd/eigrp_packet.c
+++ b/eigrpd/eigrp_packet.c
@@ -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"},
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
index 0ab7b59db..c8769fb11 100644
--- a/eigrpd/eigrp_query.c
+++ b/eigrpd/eigrp_query.c
@@ -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)
{
diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c
index d16482173..015daa768 100644
--- a/eigrpd/eigrp_reply.c
+++ b/eigrpd/eigrp_reply.c
@@ -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,
diff --git a/eigrpd/eigrp_siaquery.c b/eigrpd/eigrp_siaquery.c
index 027700fe1..9c2a8c9d8 100644
--- a/eigrpd/eigrp_siaquery.c
+++ b/eigrpd/eigrp_siaquery.c
@@ -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,
diff --git a/eigrpd/eigrp_siareply.c b/eigrpd/eigrp_siareply.c
index 590b224d6..2d298c20b 100644
--- a/eigrpd/eigrp_siareply.c
+++ b/eigrpd/eigrp_siareply.c
@@ -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,
diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c
index 6da7756f8..846e21162 100644
--- a/eigrpd/eigrp_topology.c
+++ b/eigrpd/eigrp_topology.c
@@ -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);
diff --git a/eigrpd/eigrp_topology.h b/eigrpd/eigrp_topology.h
index 26fa1a11b..d7f79057a 100644
--- a/eigrpd/eigrp_topology.h
+++ b/eigrpd/eigrp_topology.h
@@ -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);
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
index 91f3b3218..0dc509706 100644
--- a/eigrpd/eigrp_update.c
+++ b/eigrpd/eigrp_update.c
@@ -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,
diff --git a/eigrpd/eigrpd.c b/eigrpd/eigrpd.c
index 8c16cf3d5..103015490 100644
--- a/eigrpd/eigrpd.c
+++ b/eigrpd/eigrpd.c
@@ -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;
diff --git a/eigrpd/eigrpd.h b/eigrpd/eigrpd.h
index 01173768b..949fe682c 100644
--- a/eigrpd/eigrpd.h
+++ b/eigrpd/eigrpd.h
@@ -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
diff --git a/eigrpd/subdir.am b/eigrpd/subdir.am
index 13c9f7f8a..ba9445acb 100644
--- a/eigrpd/subdir.am
+++ b/eigrpd/subdir.am
@@ -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 \