]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripd: use MTYPE_STATIC
authorDavid Lamparter <equinox@diac24.net>
Fri, 21 Jun 2019 06:39:33 +0000 (08:39 +0200)
committerDavid Lamparter <equinox@diac24.net>
Fri, 21 Jun 2019 06:54:25 +0000 (08:54 +0200)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ripd/rip_interface.c
ripd/rip_interface.h
ripd/rip_memory.c [deleted file]
ripd/rip_memory.h [deleted file]
ripd/rip_northbound.c
ripd/rip_offset.c
ripd/rip_peer.c
ripd/ripd.c
ripd/ripd.h
ripd/subdir.am

index 634fee0b3025ad57776ddfdcd230f8af57cbb94d..80561f350ba2abcf901d1873c5447f2477e80387 100644 (file)
@@ -43,6 +43,8 @@
 #include "ripd/rip_debug.h"
 #include "ripd/rip_interface.h"
 
+DEFINE_MTYPE_STATIC(RIPD, RIP_INTERFACE, "RIP interface")
+DEFINE_MTYPE(RIPD, RIP_INTERFACE_STRING, "RIP Interface String")
 DEFINE_HOOK(rip_ifaddr_add, (struct connected * ifc), (ifc))
 DEFINE_HOOK(rip_ifaddr_del, (struct connected * ifc), (ifc))
 
index 6befda0e28606c883690ee6e880de9fdd3bef9c7..715daf2e503b63a60d5cc46cbfc21381ec4b2351 100644 (file)
 #ifndef _QUAGGA_RIP_INTERFACE_H
 #define _QUAGGA_RIP_INTERFACE_H
 
+#include "memory.h"
 #include "zclient.h"
 
+DECLARE_MTYPE(RIP_INTERFACE_STRING)
+
 extern int rip_interface_down(int, struct zclient *, zebra_size_t, vrf_id_t);
 extern int rip_interface_up(int, struct zclient *, zebra_size_t, vrf_id_t);
 extern int rip_interface_add(int, struct zclient *, zebra_size_t, vrf_id_t);
diff --git a/ripd/rip_memory.c b/ripd/rip_memory.c
deleted file mode 100644 (file)
index 7d703a8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ripd 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 "rip_memory.h"
-
-DEFINE_MGROUP(RIPD, "ripd")
-DEFINE_MTYPE(RIPD, RIP, "RIP structure")
-DEFINE_MTYPE(RIPD, RIP_VRF_NAME, "RIP VRF name")
-DEFINE_MTYPE(RIPD, RIP_INFO, "RIP route info")
-DEFINE_MTYPE(RIPD, RIP_INTERFACE, "RIP interface")
-DEFINE_MTYPE(RIPD, RIP_INTERFACE_STRING, "RIP Interface String")
-DEFINE_MTYPE(RIPD, RIP_PEER, "RIP peer")
-DEFINE_MTYPE(RIPD, RIP_OFFSET_LIST, "RIP offset list")
-DEFINE_MTYPE(RIPD, RIP_DISTANCE, "RIP distance")
diff --git a/ripd/rip_memory.h b/ripd/rip_memory.h
deleted file mode 100644 (file)
index 1f9d8f5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ripd 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_RIP_MEMORY_H
-#define _QUAGGA_RIP_MEMORY_H
-
-#include "memory.h"
-
-DECLARE_MGROUP(RIPD)
-DECLARE_MTYPE(RIP)
-DECLARE_MTYPE(RIP_VRF_NAME)
-DECLARE_MTYPE(RIP_INFO)
-DECLARE_MTYPE(RIP_INTERFACE)
-DECLARE_MTYPE(RIP_INTERFACE_STRING)
-DECLARE_MTYPE(RIP_PEER)
-DECLARE_MTYPE(RIP_OFFSET_LIST)
-DECLARE_MTYPE(RIP_DISTANCE)
-
-#endif /* _QUAGGA_RIP_MEMORY_H */
index f8a7f5dc678d9ccd5da8c9a13c8a3f645bdb33fe..1238d0f0fc8b4ff50e85d78f8e4305767bd92a0a 100644 (file)
@@ -33,6 +33,7 @@
 #include "ripd/ripd.h"
 #include "ripd/rip_debug.h"
 #include "ripd/rip_cli.h"
+#include "ripd/rip_interface.h"
 
 /*
  * XPath: /frr-ripd:ripd/instance
index 8307a95d27b3b11a792297d8b82105b3e8247bf6..776f121d59dac59af71e64e0b6a7220243e97b2d 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "ripd/ripd.h"
 
+DEFINE_MTYPE_STATIC(RIPD, RIP_OFFSET_LIST, "RIP offset list")
+
 #define OFFSET_LIST_IN_NAME(O)  ((O)->direct[RIP_OFFSET_LIST_IN].alist_name)
 #define OFFSET_LIST_IN_METRIC(O)  ((O)->direct[RIP_OFFSET_LIST_IN].metric)
 
index 08aa61257d2853e8cade46a696f3e4e238a1b117..4ad7309c41c3b30a0a3bc86a5982f6abde72c7e7 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "ripd/ripd.h"
 
+DEFINE_MTYPE_STATIC(RIPD, RIP_PEER, "RIP peer")
+
 static struct rip_peer *rip_peer_new(void)
 {
        return XCALLOC(MTYPE_RIP_PEER, sizeof(struct rip_peer));
index 3a1ffd17a6f47561d7b54a1e40f4c71e77509602..e0ff0430f81a4728cbe5524754975a60bdd0ed45 100644 (file)
 /* UDP receive buffer size */
 #define RIP_UDP_RCV_BUF 41600
 
+DEFINE_MGROUP(RIPD, "ripd")
+DEFINE_MTYPE_STATIC(RIPD, RIP, "RIP structure")
+DEFINE_MTYPE_STATIC(RIPD, RIP_VRF_NAME, "RIP VRF name")
+DEFINE_MTYPE_STATIC(RIPD, RIP_INFO, "RIP route info")
+DEFINE_MTYPE_STATIC(RIPD, RIP_DISTANCE, "RIP distance")
+
 /* Prototypes. */
 static void rip_output_process(struct connected *, struct sockaddr_in *, int,
                               uint8_t);
index 44f5932fb69a2c99e0bfa27a506cac86b9ce978c..7f2c3fd068e9e3c4f771bd46db2c87cfb67791f0 100644 (file)
@@ -24,7 +24,7 @@
 #include "hook.h"
 #include "nexthop.h"
 #include "distribute.h"
-#include "rip_memory.h"
+#include "memory.h"
 
 /* RIP version number. */
 #define RIPv1                            1
@@ -97,6 +97,8 @@
 #define RIP_INSTANCE   "/frr-ripd:ripd/instance"
 #define RIP_IFACE      "/frr-interface:lib/interface/frr-ripd:rip"
 
+DECLARE_MGROUP(RIPD)
+
 /* RIP structure. */
 struct rip {
        RB_ENTRY(rip) entry;
index 2a63cc52296a2afaaf100b6b7f7fd4d0c845e0c8..312c1db6afd56c565f512922ab66605799fe0b36 100644 (file)
@@ -23,7 +23,6 @@ ripd_librip_a_SOURCES = \
        ripd/rip_debug.c \
        ripd/rip_errors.c \
        ripd/rip_interface.c \
-       ripd/rip_memory.c \
        ripd/rip_offset.c \
        ripd/rip_northbound.c \
        ripd/rip_peer.c \
@@ -40,7 +39,6 @@ noinst_HEADERS += \
        ripd/rip_debug.h \
        ripd/rip_errors.h \
        ripd/rip_interface.h \
-       ripd/rip_memory.h \
        ripd/ripd.h \
        # end