]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospf6d: kill ospf6_memory.h, use MTYPE_STATIC
authorDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 18:31:56 +0000 (19:31 +0100)
committerDavid Lamparter <equinox@diac24.net>
Mon, 22 Mar 2021 18:31:56 +0000 (19:31 +0100)
Same as other commits -- 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>
15 files changed:
ospf6d/ospf6_area.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_lsa.c
ospf6d/ospf6_lsdb.c
ospf6d/ospf6_memory.c [deleted file]
ospf6d/ospf6_memory.h [deleted file]
ospf6d/ospf6_message.c
ospf6d/ospf6_neighbor.c
ospf6d/ospf6_route.c
ospf6d/ospf6_spf.c
ospf6d/ospf6_top.c
ospf6d/ospf6d.c
ospf6d/ospf6d.h
ospf6d/subdir.am

index 9223083aef6c5d8de0dbeef6641ad82e59fd6e05..6bf61b4804b0981c43311331c4757d7c32d7e55f 100644 (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)
index 977d810be50ed6d21525d79d80cfd5d9dcb7aaec..3497b2665699ceeb6e070800e0f13515f2c3b572 100644 (file)
 #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);
index 6f6bbc2b67d30da062aa84dd0514fd8ae8f14070..158b8dc483d017c7438a90efe35b0fdad280a405 100644 (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,
index 2de95ec2c4b7ccd61ad5407c02bd40f7c3106ff2..f2a933d8780da08a419ffb24db846b73cd8ed880 100644 (file)
 #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)
@@ -659,6 +663,8 @@ void ospf6_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
 
 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);
 
index 9636e1a230f110091ca1f594822cae138e5bdf5d..18f121e3a2bc4f6405081bd09ac87b17f6df4ddd 100644 (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;
diff --git a/ospf6d/ospf6_memory.c b/ospf6d/ospf6_memory.c
deleted file mode 100644 (file)
index 05bad49..0000000
+++ /dev/null
@@ -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");
diff --git a/ospf6d/ospf6_memory.h b/ospf6d/ospf6_memory.h
deleted file mode 100644 (file)
index 68a0363..0000000
+++ /dev/null
@@ -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 */
index aebe43b9ecff86c8dd5d30cbeebafe023b8e7dd6..7aedd3df45a624c41f2a559b0a38a139f7ffa473 100644 (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"},
index 15065c98eb2fe7c1287f1f16691ec93ecbcf849a..485bde4b7b77ce8d62ab5e7fedb1c16251198909 100644 (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));
index b77f968179d811702df64b1b606917f6f23f60b3..9770dd0444be8a5b27ff1c02c7112c78b8ac3d91 100644 (file)
 #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)
index d71f7629c696642a44b92f6fd6c8bf12fb804c9f..7652d71c59d52ed52e7050dca9bc14a674cf254f 100644 (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,
index 2fed7c5d03db2462258b76fe451f43ef08ebb2bc..a38f1cbc4500a6e0240cc4213572daf771003483 100644 (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,
index 8d9c85fd08288de5f7167e59e6eba6c3230cfde6..91d427c78c5a04b9f524bbae9dfb817aa5b06b20 100644 (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;
index d85ff40f3254bd2d00c4acfa5cd99b5240e3f761..3f9461c7f0be8b65d82e654336a11a2c28ac0d33 100644 (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;
index d9d4301df799b7988819a5dff592804041ffc1b8..82d880cca868a1b84bc6c9ebe213d49130f90dd1 100644 (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 \