ripd: use MTYPE_STATIC

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2019-06-21 08:39:33 +02:00
parent 7c136b081e
commit 814a25859a
10 changed files with 19 additions and 76 deletions

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

View file

@ -20,8 +20,11 @@
#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);

View file

@ -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")

View file

@ -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 */

View 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

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

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

View file

@ -51,6 +51,12 @@
/* 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);

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

View 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