mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 05:34:41 +00:00
lib: migrate to new memory-type handling
Move over to the new allocation counting added in the previous commit. (This commit is mostly mechanical.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
This commit is contained in:
parent
3b4cd78375
commit
fc7948fafe
@ -27,6 +27,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include <lib/version.h>
|
#include <lib/version.h>
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
|
@ -30,6 +30,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "if.h"
|
#include "if.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "if.h"
|
#include "if.h"
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "memtypes.h"
|
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "routemap.h"
|
#include "routemap.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
|
@ -39,12 +39,12 @@ noinst_HEADERS = \
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
regex.c regex-gnu.h \
|
regex.c regex-gnu.h \
|
||||||
queue.h \
|
queue.h \
|
||||||
memtypes.awk \
|
memtypes.pl \
|
||||||
route_types.pl route_types.txt \
|
route_types.pl route_types.txt \
|
||||||
gitversion.pl
|
gitversion.pl
|
||||||
|
|
||||||
memtypes.h: $(srcdir)/memtypes.c $(srcdir)/memtypes.awk
|
memtypes.h: $(srcdir)/memtypes.c $(srcdir)/memtypes.pl
|
||||||
($(GAWK) -f $(srcdir)/memtypes.awk $(srcdir)/memtypes.c > $@)
|
@PERL@ $(srcdir)/memtypes.pl < $(srcdir)/memtypes.c > $@
|
||||||
|
|
||||||
route_types.h: $(srcdir)/route_types.txt $(srcdir)/route_types.pl
|
route_types.h: $(srcdir)/route_types.txt $(srcdir)/route_types.pl
|
||||||
@PERL@ $(srcdir)/route_types.pl < $(srcdir)/route_types.txt > $@
|
@PERL@ $(srcdir)/route_types.pl < $(srcdir)/route_types.txt > $@
|
||||||
|
@ -150,7 +150,6 @@ extern void *qstrdup (struct memtype *mt, const char *str)
|
|||||||
extern void qfree (struct memtype *mt, void *ptr)
|
extern void qfree (struct memtype *mt, void *ptr)
|
||||||
__attribute__ ((nonnull (1)));
|
__attribute__ ((nonnull (1)));
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define XMALLOC(mtype, size) qmalloc(mtype, size)
|
#define XMALLOC(mtype, size) qmalloc(mtype, size)
|
||||||
#define XCALLOC(mtype, size) qcalloc(mtype, size)
|
#define XCALLOC(mtype, size) qcalloc(mtype, size)
|
||||||
#define XREALLOC(mtype, ptr, size) qrealloc(mtype, ptr, size)
|
#define XREALLOC(mtype, ptr, size) qrealloc(mtype, ptr, size)
|
||||||
@ -162,9 +161,6 @@ static inline size_t mtype_stats_alloc(struct memtype *mt)
|
|||||||
{
|
{
|
||||||
return mt->n_alloc;
|
return mt->n_alloc;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* still here until next commit */
|
|
||||||
#include "memory_vty.h"
|
|
||||||
|
|
||||||
/* NB: calls are ordered by memgroup; and there is a call with mt == NULL for
|
/* NB: calls are ordered by memgroup; and there is a call with mt == NULL for
|
||||||
* each memgroup (so that a header can be printed, and empty memgroups show)
|
* each memgroup (so that a header can be printed, and empty memgroups show)
|
||||||
@ -176,4 +172,6 @@ extern int qmem_walk (qmem_walk_fn *func, void *arg);
|
|||||||
|
|
||||||
extern void memory_oom (size_t size, const char *name);
|
extern void memory_oom (size_t size, const char *name);
|
||||||
|
|
||||||
|
#include "memtypes.h"
|
||||||
|
|
||||||
#endif /* _QUAGGA_MEMORY_H */
|
#endif /* _QUAGGA_MEMORY_H */
|
||||||
|
270
lib/memory_vty.c
270
lib/memory_vty.c
@ -28,267 +28,17 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
static void alloc_inc (int);
|
|
||||||
static void alloc_dec (int);
|
|
||||||
static void log_memstats(int log_priority);
|
|
||||||
|
|
||||||
static const struct message mstr [] =
|
|
||||||
{
|
|
||||||
{ MTYPE_THREAD, "thread" },
|
|
||||||
{ MTYPE_THREAD_MASTER, "thread_master" },
|
|
||||||
{ MTYPE_VECTOR, "vector" },
|
|
||||||
{ MTYPE_VECTOR_INDEX, "vector_index" },
|
|
||||||
{ MTYPE_IF, "interface" },
|
|
||||||
{ 0, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Fatal memory allocation error occured. */
|
|
||||||
static void __attribute__ ((noreturn))
|
|
||||||
zerror (const char *fname, int type, size_t size)
|
|
||||||
{
|
|
||||||
zlog_err ("%s : can't allocate memory for `%s' size %d: %s\n",
|
|
||||||
fname, lookup (mstr, type), (int) size, safe_strerror(errno));
|
|
||||||
log_memstats(LOG_WARNING);
|
|
||||||
/* N.B. It might be preferable to call zlog_backtrace_sigsafe here, since
|
|
||||||
that function should definitely be safe in an OOM condition. But
|
|
||||||
unfortunately zlog_backtrace_sigsafe does not support syslog logging at
|
|
||||||
this time... */
|
|
||||||
zlog_backtrace(LOG_WARNING);
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocate memory of a given size, to be tracked by a given type.
|
|
||||||
* Effects: Returns a pointer to usable memory. If memory cannot
|
|
||||||
* be allocated, aborts execution.
|
|
||||||
*/
|
|
||||||
void *
|
|
||||||
zmalloc (int type, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
memory = malloc (size);
|
|
||||||
|
|
||||||
if (memory == NULL)
|
|
||||||
zerror ("malloc", type, size);
|
|
||||||
|
|
||||||
alloc_inc (type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocate memory as in zmalloc, and also clear the memory.
|
|
||||||
* Add an extra 'z' prefix to function name to avoid collision when linking
|
|
||||||
* statically with zlib that exports the 'zcalloc' symbol.
|
|
||||||
*/
|
|
||||||
void *
|
|
||||||
zzcalloc (int type, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
memory = calloc (1, size);
|
|
||||||
|
|
||||||
if (memory == NULL)
|
|
||||||
zerror ("calloc", type, size);
|
|
||||||
|
|
||||||
alloc_inc (type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Given a pointer returned by zmalloc or zzcalloc, free it and
|
|
||||||
* return a pointer to a new size, basically acting like realloc().
|
|
||||||
* Requires: ptr was returned by zmalloc, zzcalloc, or zrealloc with the
|
|
||||||
* same type.
|
|
||||||
* Effects: Returns a pointer to the new memory, or aborts.
|
|
||||||
*/
|
|
||||||
void *
|
|
||||||
zrealloc (int type, void *ptr, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
if (ptr == NULL) /* is really alloc */
|
|
||||||
return zzcalloc(type, size);
|
|
||||||
|
|
||||||
memory = realloc (ptr, size);
|
|
||||||
if (memory == NULL)
|
|
||||||
zerror ("realloc", type, size);
|
|
||||||
if (ptr == NULL)
|
|
||||||
alloc_inc (type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Free memory allocated by z*alloc or zstrdup.
|
|
||||||
* Requires: ptr was returned by zmalloc, zzcalloc, or zrealloc with the
|
|
||||||
* same type.
|
|
||||||
* Effects: The memory is freed and may no longer be referenced.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
zfree (int type, void *ptr)
|
|
||||||
{
|
|
||||||
if (ptr != NULL)
|
|
||||||
{
|
|
||||||
alloc_dec (type);
|
|
||||||
free (ptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Duplicate a string, counting memory usage by type.
|
|
||||||
* Effects: The string is duplicated, and the return value must
|
|
||||||
* eventually be passed to zfree with the same type. The function will
|
|
||||||
* succeed or abort.
|
|
||||||
*/
|
|
||||||
char *
|
|
||||||
zstrdup (int type, const char *str)
|
|
||||||
{
|
|
||||||
void *dup;
|
|
||||||
|
|
||||||
dup = strdup (str);
|
|
||||||
if (dup == NULL)
|
|
||||||
zerror ("strdup", type, strlen (str));
|
|
||||||
alloc_inc (type);
|
|
||||||
return dup;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MEMORY_LOG
|
|
||||||
static struct
|
|
||||||
{
|
|
||||||
const char *name;
|
|
||||||
long alloc;
|
|
||||||
unsigned long t_malloc;
|
|
||||||
unsigned long c_malloc;
|
|
||||||
unsigned long t_calloc;
|
|
||||||
unsigned long c_calloc;
|
|
||||||
unsigned long t_realloc;
|
|
||||||
unsigned long t_free;
|
|
||||||
unsigned long c_strdup;
|
|
||||||
} mstat [MTYPE_MAX];
|
|
||||||
|
|
||||||
static void
|
|
||||||
mtype_log (char *func, void *memory, const char *file, int line, int type)
|
|
||||||
{
|
|
||||||
zlog_debug ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, line);
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
mtype_zmalloc (const char *file, int line, int type, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
mstat[type].c_malloc++;
|
|
||||||
mstat[type].t_malloc++;
|
|
||||||
|
|
||||||
memory = zmalloc (type, size);
|
|
||||||
mtype_log ("zmalloc", memory, file, line, type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
mtype_zcalloc (const char *file, int line, int type, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
mstat[type].c_calloc++;
|
|
||||||
mstat[type].t_calloc++;
|
|
||||||
|
|
||||||
memory = zzcalloc (type, size);
|
|
||||||
mtype_log ("xcalloc", memory, file, line, type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *
|
|
||||||
mtype_zrealloc (const char *file, int line, int type, void *ptr, size_t size)
|
|
||||||
{
|
|
||||||
void *memory;
|
|
||||||
|
|
||||||
/* Realloc need before allocated pointer. */
|
|
||||||
mstat[type].t_realloc++;
|
|
||||||
|
|
||||||
memory = zrealloc (type, ptr, size);
|
|
||||||
|
|
||||||
mtype_log ("xrealloc", memory, file, line, type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Important function. */
|
|
||||||
void
|
|
||||||
mtype_zfree (const char *file, int line, int type, void *ptr)
|
|
||||||
{
|
|
||||||
mstat[type].t_free++;
|
|
||||||
|
|
||||||
mtype_log ("xfree", ptr, file, line, type);
|
|
||||||
|
|
||||||
zfree (type, ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
|
||||||
mtype_zstrdup (const char *file, int line, int type, const char *str)
|
|
||||||
{
|
|
||||||
char *memory;
|
|
||||||
|
|
||||||
mstat[type].c_strdup++;
|
|
||||||
|
|
||||||
memory = zstrdup (type, str);
|
|
||||||
|
|
||||||
mtype_log ("xstrdup", memory, file, line, type);
|
|
||||||
|
|
||||||
return memory;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static struct
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
long alloc;
|
|
||||||
} mstat [MTYPE_MAX];
|
|
||||||
#endif /* MEMORY_LOG */
|
|
||||||
|
|
||||||
/* Increment allocation counter. */
|
|
||||||
static void
|
|
||||||
alloc_inc (int type)
|
|
||||||
{
|
|
||||||
mstat[type].alloc++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Decrement allocation counter. */
|
|
||||||
static void
|
|
||||||
alloc_dec (int type)
|
|
||||||
{
|
|
||||||
mstat[type].alloc--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Looking up memory status from vty interface. */
|
/* Looking up memory status from vty interface. */
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
|
||||||
static void
|
|
||||||
log_memstats(int pri)
|
|
||||||
{
|
|
||||||
struct mlist *ml;
|
|
||||||
|
|
||||||
for (ml = mlists; ml->list; ml++)
|
|
||||||
{
|
|
||||||
struct memory_list *m;
|
|
||||||
|
|
||||||
zlog (NULL, pri, "Memory utilization in module %s:", ml->name);
|
|
||||||
for (m = ml->list; m->index >= 0; m++)
|
|
||||||
if (m->index && mstat[m->index].alloc)
|
|
||||||
zlog (NULL, pri, " %-30s: %10ld", m->format, mstat[m->index].alloc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_memstats_stderr (const char *prefix)
|
log_memstats_stderr (const char *prefix)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
struct mlist *ml;
|
struct mlist *ml;
|
||||||
struct memory_list *m;
|
struct memory_list *m;
|
||||||
int i;
|
int i;
|
||||||
@ -325,8 +75,10 @@ log_memstats_stderr (const char *prefix)
|
|||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s: memstats: No remaining tracked memory utilization.\n",
|
"%s: memstats: No remaining tracked memory utilization.\n",
|
||||||
prefix);
|
prefix);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
show_separator(struct vty *vty)
|
show_separator(struct vty *vty)
|
||||||
{
|
{
|
||||||
@ -355,6 +107,7 @@ show_memory_vty (struct vty *vty, struct memory_list *list)
|
|||||||
}
|
}
|
||||||
return needsep;
|
return needsep;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MALLINFO
|
#ifdef HAVE_MALLINFO
|
||||||
static int
|
static int
|
||||||
@ -421,19 +174,22 @@ DEFUN (show_memory,
|
|||||||
"Show running system information\n"
|
"Show running system information\n"
|
||||||
"Memory statistics\n")
|
"Memory statistics\n")
|
||||||
{
|
{
|
||||||
struct mlist *ml;
|
|
||||||
int needsep = 0;
|
int needsep = 0;
|
||||||
|
|
||||||
#ifdef HAVE_MALLINFO
|
#ifdef HAVE_MALLINFO
|
||||||
needsep = show_memory_mallinfo (vty);
|
needsep = show_memory_mallinfo (vty);
|
||||||
#endif /* HAVE_MALLINFO */
|
#endif /* HAVE_MALLINFO */
|
||||||
|
|
||||||
|
(void) needsep;
|
||||||
|
#if 0
|
||||||
|
struct mlist *ml;
|
||||||
for (ml = mlists; ml->list; ml++)
|
for (ml = mlists; ml->list; ml++)
|
||||||
{
|
{
|
||||||
if (needsep)
|
if (needsep)
|
||||||
show_separator (vty);
|
show_separator (vty);
|
||||||
needsep = show_memory_vty (vty, ml->list);
|
needsep = show_memory_vty (vty, ml->list);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
qmem_walk(qmem_walker, vty);
|
qmem_walk(qmem_walker, vty);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
@ -498,9 +254,3 @@ mtype_memstr (char *buf, size_t len, unsigned long bytes)
|
|||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long
|
|
||||||
mtype_stats_alloc (int type)
|
|
||||||
{
|
|
||||||
return mstat[type].alloc;
|
|
||||||
}
|
|
||||||
|
@ -21,73 +21,11 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|||||||
#ifndef _ZEBRA_MEMORY_VTY_H
|
#ifndef _ZEBRA_MEMORY_VTY_H
|
||||||
#define _ZEBRA_MEMORY_VTY_H
|
#define _ZEBRA_MEMORY_VTY_H
|
||||||
|
|
||||||
/* For pretty printing of memory allocate information. */
|
#include "memory.h"
|
||||||
struct memory_list
|
|
||||||
{
|
|
||||||
int index;
|
|
||||||
const char *format;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct mlist {
|
|
||||||
struct memory_list *list;
|
|
||||||
const char *name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#include "lib/memtypes.h"
|
|
||||||
|
|
||||||
extern struct mlist mlists[];
|
|
||||||
|
|
||||||
/* #define MEMORY_LOG */
|
|
||||||
#ifdef MEMORY_LOG
|
|
||||||
#define XMALLOC(mtype, size) \
|
|
||||||
mtype_zmalloc (__FILE__, __LINE__, (mtype), (size))
|
|
||||||
#define XCALLOC(mtype, size) \
|
|
||||||
mtype_zcalloc (__FILE__, __LINE__, (mtype), (size))
|
|
||||||
#define XREALLOC(mtype, ptr, size) \
|
|
||||||
mtype_zrealloc (__FILE__, __LINE__, (mtype), (ptr), (size))
|
|
||||||
#define XFREE(mtype, ptr) \
|
|
||||||
do { \
|
|
||||||
mtype_zfree (__FILE__, __LINE__, (mtype), (ptr)); \
|
|
||||||
ptr = NULL; } \
|
|
||||||
while (0)
|
|
||||||
#define XSTRDUP(mtype, str) \
|
|
||||||
mtype_zstrdup (__FILE__, __LINE__, (mtype), (str))
|
|
||||||
#else
|
|
||||||
#define XMALLOC(mtype, size) zmalloc ((mtype), (size))
|
|
||||||
#define XCALLOC(mtype, size) zcalloc ((mtype), (size))
|
|
||||||
#define XREALLOC(mtype, ptr, size) zrealloc ((mtype), (ptr), (size))
|
|
||||||
#define XFREE(mtype, ptr) do { \
|
|
||||||
zfree ((mtype), (ptr)); \
|
|
||||||
ptr = NULL; } \
|
|
||||||
while (0)
|
|
||||||
#define XSTRDUP(mtype, str) zstrdup ((mtype), (str))
|
|
||||||
#endif /* MEMORY_LOG */
|
|
||||||
|
|
||||||
/* Prototypes of memory function. */
|
|
||||||
extern void *zmalloc (int type, size_t size);
|
|
||||||
extern void *zcalloc (int type, size_t size);
|
|
||||||
extern void *zrealloc (int type, void *ptr, size_t size);
|
|
||||||
extern void zfree (int type, void *ptr);
|
|
||||||
extern char *zstrdup (int type, const char *str);
|
|
||||||
|
|
||||||
extern void *mtype_zmalloc (const char *file, int line, int type, size_t size);
|
|
||||||
|
|
||||||
extern void *mtype_zcalloc (const char *file, int line, int type, size_t size);
|
|
||||||
|
|
||||||
extern void *mtype_zrealloc (const char *file, int line, int type, void *ptr,
|
|
||||||
size_t size);
|
|
||||||
|
|
||||||
extern void mtype_zfree (const char *file, int line, int type,
|
|
||||||
void *ptr);
|
|
||||||
|
|
||||||
extern char *mtype_zstrdup (const char *file, int line, int type,
|
|
||||||
const char *str);
|
|
||||||
extern void memory_init (void);
|
extern void memory_init (void);
|
||||||
extern void log_memstats_stderr (const char *);
|
extern void log_memstats_stderr (const char *);
|
||||||
|
|
||||||
/* return number of allocations outstanding for the type */
|
|
||||||
extern unsigned long mtype_stats_alloc (int);
|
|
||||||
|
|
||||||
/* Human friendly string for given byte count */
|
/* Human friendly string for given byte count */
|
||||||
#define MTYPE_MEMSTR_LEN 20
|
#define MTYPE_MEMSTR_LEN 20
|
||||||
extern const char *mtype_memstr (char *, size_t, unsigned long);
|
extern const char *mtype_memstr (char *, size_t, unsigned long);
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
###
|
|
||||||
# Copyright (C) Paul Jakma 2005
|
|
||||||
#
|
|
||||||
# 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 Quagga; see the file COPYING. If not, write to the Free
|
|
||||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
###
|
|
||||||
#
|
|
||||||
# Scan a file of memory definitions (see eg memtypes.c) and generate
|
|
||||||
# a corresponding header file with an enum of the MTYPE's and declarations
|
|
||||||
# for the struct memory_list arrays
|
|
||||||
#
|
|
||||||
# struct memory_list's must be declared as:
|
|
||||||
# '\nstruct memory_list memory_list_<name>[] .....'
|
|
||||||
#
|
|
||||||
# Each MTYPE_ within the definition must the second token on the line,
|
|
||||||
# tokens being delineated by whitespace. It may only consist of the set of
|
|
||||||
# characters [[:upper:]_[:digit:]]. Eg:
|
|
||||||
#
|
|
||||||
# '\n { MTYPE_AWESOME_IPV8 , "Amazing new protocol, says genius" {}..boo'
|
|
||||||
#
|
|
||||||
# We try to ignore lines whose first token is /* or *, ie C comment lines.
|
|
||||||
# So the following should work fine:
|
|
||||||
#
|
|
||||||
# '/* This is the best memory_list ever!
|
|
||||||
# ' * It's got all my MTYPE's */
|
|
||||||
# '
|
|
||||||
# 'struct memory_list memory_list_my_amazing_mlist[] = =
|
|
||||||
# '{
|
|
||||||
# ' { MTYPE_DONGLE, "Dongle widget" }
|
|
||||||
# ' { MTYPE_FROB, "Frobulator" },
|
|
||||||
# '{ MTYPE_WIPPLE, "Wipple combombulator"}
|
|
||||||
# '}}}
|
|
||||||
#
|
|
||||||
# Even if it isn't quite a valid C declaration.
|
|
||||||
#
|
|
||||||
|
|
||||||
BEGIN {
|
|
||||||
mlistregex = "memory_list_(.*)\\[\\]";
|
|
||||||
mtyperegex = "^(MTYPE_[[:upper:]_[:digit:]]+).*";
|
|
||||||
header = "/* Auto-generated from memtypes.c by " ARGV[0] ". */\n";
|
|
||||||
header = header "/* Do not edit! */\n";
|
|
||||||
header = header "\n#ifndef _QUAGGA_MEMTYPES_H\n";
|
|
||||||
header = header "#define _QUAGGA_MEMTYPES_H\n";
|
|
||||||
footer = "\n#endif /* _QUAGGA_MEMTYPES_H */\n\n";
|
|
||||||
mlistformat = "extern struct memory_list memory_list_%s[];";
|
|
||||||
printf ("%s\n", header);
|
|
||||||
}
|
|
||||||
|
|
||||||
# catch lines beginning with 'struct memory list ' and try snag the
|
|
||||||
# memory_list name. Has to be 3rd field.
|
|
||||||
($0 ~ /^struct memory_list /) && (NF >= 3) {
|
|
||||||
mlists[lcount++] = gensub(mlistregex, "\\1", "g",$3);
|
|
||||||
}
|
|
||||||
|
|
||||||
# snag the MTYPE, it must self-standing and the second field,
|
|
||||||
# though we do manage to tolerate the , C seperator being appended
|
|
||||||
($1 !~ /^\/?\*/) && ($2 ~ /^MTYPE_/) {
|
|
||||||
mtype[tcount++] = gensub(mtyperegex, "\\1", "g", $2);
|
|
||||||
}
|
|
||||||
|
|
||||||
END {
|
|
||||||
printf("enum\n{\n MTYPE_TMP = 1,\n");
|
|
||||||
for (i = 0; i < tcount; i++) {
|
|
||||||
if (mtype[i] != "" && mtype[i] != "MTYPE_TMP")
|
|
||||||
printf (" %s,\n", mtype[i]);
|
|
||||||
}
|
|
||||||
printf (" MTYPE_MAX,\n};\n\n");
|
|
||||||
for (i = 0; i < lcount; i++) {
|
|
||||||
if (mlists[i] != "")
|
|
||||||
printf (mlistformat "\n", mlists[i]);
|
|
||||||
}
|
|
||||||
printf (footer);
|
|
||||||
}
|
|
565
lib/memtypes.c
565
lib/memtypes.c
@ -10,308 +10,283 @@
|
|||||||
#include "zebra.h"
|
#include "zebra.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
struct memory_list memory_list_lib[] =
|
DEFINE_MGROUP(LIB, "libzebra")
|
||||||
{
|
DEFINE_MTYPE(LIB, TMP, "Temporary memory")
|
||||||
{ MTYPE_TMP, "Temporary memory" },
|
DEFINE_MTYPE(LIB, STRVEC, "String vector")
|
||||||
{ MTYPE_STRVEC, "String vector" },
|
DEFINE_MTYPE(LIB, VECTOR, "Vector")
|
||||||
{ MTYPE_VECTOR, "Vector" },
|
DEFINE_MTYPE(LIB, VECTOR_INDEX, "Vector index")
|
||||||
{ MTYPE_VECTOR_INDEX, "Vector index" },
|
DEFINE_MTYPE(LIB, LINK_LIST, "Link List")
|
||||||
{ MTYPE_LINK_LIST, "Link List" },
|
DEFINE_MTYPE(LIB, LINK_NODE, "Link Node")
|
||||||
{ MTYPE_LINK_NODE, "Link Node" },
|
DEFINE_MTYPE(LIB, THREAD, "Thread")
|
||||||
{ MTYPE_THREAD, "Thread" },
|
DEFINE_MTYPE(LIB, THREAD_MASTER, "Thread master")
|
||||||
{ MTYPE_THREAD_MASTER, "Thread master" },
|
DEFINE_MTYPE(LIB, THREAD_STATS, "Thread stats")
|
||||||
{ MTYPE_THREAD_STATS, "Thread stats" },
|
DEFINE_MTYPE(LIB, VTY, "VTY")
|
||||||
{ MTYPE_VTY, "VTY" },
|
DEFINE_MTYPE(LIB, VTY_OUT_BUF, "VTY output buffer")
|
||||||
{ MTYPE_VTY_OUT_BUF, "VTY output buffer" },
|
DEFINE_MTYPE(LIB, VTY_HIST, "VTY history")
|
||||||
{ MTYPE_VTY_HIST, "VTY history" },
|
DEFINE_MTYPE(LIB, IF, "Interface")
|
||||||
{ MTYPE_IF, "Interface" },
|
DEFINE_MTYPE(LIB, CONNECTED, "Connected")
|
||||||
{ MTYPE_CONNECTED, "Connected" },
|
DEFINE_MTYPE(LIB, NBR_CONNECTED, "Neighbor Connected")
|
||||||
{ MTYPE_NBR_CONNECTED, "Neighbor Connected" },
|
DEFINE_MTYPE(LIB, CONNECTED_LABEL, "Connected interface label")
|
||||||
{ MTYPE_CONNECTED_LABEL, "Connected interface label" },
|
DEFINE_MTYPE(LIB, BUFFER, "Buffer")
|
||||||
{ MTYPE_BUFFER, "Buffer" },
|
DEFINE_MTYPE(LIB, BUFFER_DATA, "Buffer data")
|
||||||
{ MTYPE_BUFFER_DATA, "Buffer data" },
|
DEFINE_MTYPE(LIB, STREAM, "Stream")
|
||||||
{ MTYPE_STREAM, "Stream" },
|
DEFINE_MTYPE(LIB, STREAM_DATA, "Stream data")
|
||||||
{ MTYPE_STREAM_DATA, "Stream data" },
|
DEFINE_MTYPE(LIB, STREAM_FIFO, "Stream FIFO")
|
||||||
{ MTYPE_STREAM_FIFO, "Stream FIFO" },
|
DEFINE_MTYPE(LIB, PREFIX, "Prefix")
|
||||||
{ MTYPE_PREFIX, "Prefix" },
|
DEFINE_MTYPE(LIB, PREFIX_IPV4, "Prefix IPv4")
|
||||||
{ MTYPE_PREFIX_IPV4, "Prefix IPv4" },
|
DEFINE_MTYPE(LIB, PREFIX_IPV6, "Prefix IPv6")
|
||||||
{ MTYPE_PREFIX_IPV6, "Prefix IPv6" },
|
DEFINE_MTYPE(LIB, HASH, "Hash")
|
||||||
{ MTYPE_HASH, "Hash" },
|
DEFINE_MTYPE(LIB, HASH_BACKET, "Hash Bucket")
|
||||||
{ MTYPE_HASH_BACKET, "Hash Bucket" },
|
DEFINE_MTYPE(LIB, HASH_INDEX, "Hash Index")
|
||||||
{ MTYPE_HASH_INDEX, "Hash Index" },
|
DEFINE_MTYPE(LIB, ROUTE_TABLE, "Route table")
|
||||||
{ MTYPE_ROUTE_TABLE, "Route table" },
|
DEFINE_MTYPE(LIB, ROUTE_NODE, "Route node")
|
||||||
{ MTYPE_ROUTE_NODE, "Route node" },
|
DEFINE_MTYPE(LIB, DISTRIBUTE, "Distribute list")
|
||||||
{ MTYPE_DISTRIBUTE, "Distribute list" },
|
DEFINE_MTYPE(LIB, DISTRIBUTE_IFNAME, "Dist-list ifname")
|
||||||
{ MTYPE_DISTRIBUTE_IFNAME, "Dist-list ifname" },
|
DEFINE_MTYPE(LIB, DISTRIBUTE_NAME, "Dist-list name")
|
||||||
{ MTYPE_DISTRIBUTE_NAME, "Dist-list name" },
|
DEFINE_MTYPE(LIB, ACCESS_LIST, "Access List")
|
||||||
{ MTYPE_ACCESS_LIST, "Access List" },
|
DEFINE_MTYPE(LIB, ACCESS_LIST_STR, "Access List Str")
|
||||||
{ MTYPE_ACCESS_LIST_STR, "Access List Str" },
|
DEFINE_MTYPE(LIB, ACCESS_FILTER, "Access Filter")
|
||||||
{ MTYPE_ACCESS_FILTER, "Access Filter" },
|
DEFINE_MTYPE(LIB, PREFIX_LIST, "Prefix List")
|
||||||
{ MTYPE_PREFIX_LIST, "Prefix List" },
|
DEFINE_MTYPE(LIB, PREFIX_LIST_ENTRY, "Prefix List Entry")
|
||||||
{ MTYPE_PREFIX_LIST_ENTRY, "Prefix List Entry" },
|
DEFINE_MTYPE(LIB, PREFIX_LIST_STR, "Prefix List Str")
|
||||||
{ MTYPE_PREFIX_LIST_STR, "Prefix List Str" },
|
DEFINE_MTYPE(LIB, PREFIX_LIST_TRIE, "Prefix List Trie Table")
|
||||||
{ MTYPE_PREFIX_LIST_TRIE, "Prefix List Trie Table" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP, "Route map")
|
||||||
{ MTYPE_ROUTE_MAP, "Route map" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_NAME, "Route map name")
|
||||||
{ MTYPE_ROUTE_MAP_NAME, "Route map name" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_INDEX, "Route map index")
|
||||||
{ MTYPE_ROUTE_MAP_INDEX, "Route map index" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_RULE, "Route map rule")
|
||||||
{ MTYPE_ROUTE_MAP_RULE, "Route map rule" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_RULE_STR, "Route map rule str")
|
||||||
{ MTYPE_ROUTE_MAP_RULE_STR, "Route map rule str" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_COMPILED, "Route map compiled")
|
||||||
{ MTYPE_ROUTE_MAP_COMPILED, "Route map compiled" },
|
DEFINE_MTYPE(LIB, ROUTE_MAP_DEP, "Route map dependency")
|
||||||
{ MTYPE_ROUTE_MAP_DEP, "Route map dependency" },
|
DEFINE_MTYPE(LIB, CMD_TOKENS, "Command desc")
|
||||||
{ MTYPE_CMD_TOKENS, "Command desc" },
|
DEFINE_MTYPE(LIB, KEY, "Key")
|
||||||
{ MTYPE_KEY, "Key" },
|
DEFINE_MTYPE(LIB, KEYCHAIN, "Key chain")
|
||||||
{ MTYPE_KEYCHAIN, "Key chain" },
|
DEFINE_MTYPE(LIB, IF_RMAP, "Interface route map")
|
||||||
{ MTYPE_IF_RMAP, "Interface route map" },
|
DEFINE_MTYPE(LIB, IF_RMAP_NAME, "I.f. route map name")
|
||||||
{ MTYPE_IF_RMAP_NAME, "I.f. route map name", },
|
DEFINE_MTYPE(LIB, SOCKUNION, "Socket union")
|
||||||
{ MTYPE_SOCKUNION, "Socket union" },
|
DEFINE_MTYPE(LIB, PRIVS, "Privilege information")
|
||||||
{ MTYPE_PRIVS, "Privilege information" },
|
DEFINE_MTYPE(LIB, ZLOG, "Logging")
|
||||||
{ MTYPE_ZLOG, "Logging" },
|
DEFINE_MTYPE(LIB, ZCLIENT, "Zclient")
|
||||||
{ MTYPE_ZCLIENT, "Zclient" },
|
DEFINE_MTYPE(LIB, WORK_QUEUE, "Work queue")
|
||||||
{ MTYPE_WORK_QUEUE, "Work queue" },
|
DEFINE_MTYPE(LIB, WORK_QUEUE_ITEM, "Work queue item")
|
||||||
{ MTYPE_WORK_QUEUE_ITEM, "Work queue item" },
|
DEFINE_MTYPE(LIB, WORK_QUEUE_NAME, "Work queue name string")
|
||||||
{ MTYPE_WORK_QUEUE_NAME, "Work queue name string" },
|
DEFINE_MTYPE(LIB, PQUEUE, "Priority queue")
|
||||||
{ MTYPE_PQUEUE, "Priority queue" },
|
DEFINE_MTYPE(LIB, PQUEUE_DATA, "Priority queue data")
|
||||||
{ MTYPE_PQUEUE_DATA, "Priority queue data" },
|
DEFINE_MTYPE(LIB, HOST, "host configuration")
|
||||||
{ MTYPE_HOST, "Host config" },
|
DEFINE_MTYPE(LIB, BFD_INFO, "BFD info")
|
||||||
{ MTYPE_BFD_INFO, "BFD info" },
|
DEFINE_MTYPE(LIB, VRF, "VRF")
|
||||||
{ MTYPE_VRF, "VRF" },
|
DEFINE_MTYPE(LIB, VRF_NAME, "VRF name")
|
||||||
{ MTYPE_VRF_NAME, "VRF name" },
|
DEFINE_MTYPE(LIB, VRF_BITMAP, "VRF bit-map")
|
||||||
{ MTYPE_VRF_BITMAP, "VRF bit-map" },
|
DEFINE_MTYPE(LIB, IF_LINK_PARAMS, "Informational Link Parameters")
|
||||||
{ MTYPE_NS, "Logical-Router" },
|
DEFINE_MTYPE(LIB, NS, "Logical-Router")
|
||||||
{ MTYPE_NS_NAME, "Logical-Router Name" },
|
DEFINE_MTYPE(LIB, NS_NAME, "Logical-Router Name")
|
||||||
{ MTYPE_NS_BITMAP, "Logical-Router bit-map" },
|
DEFINE_MTYPE(LIB, NS_BITMAP, "Logical-Router bit-map")
|
||||||
{ MTYPE_IF_LINK_PARAMS, "Informational Link Parameters" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_zebra[] =
|
|
||||||
{
|
|
||||||
{ MTYPE_RTADV_PREFIX, "Router Advertisement Prefix" },
|
|
||||||
{ MTYPE_ZEBRA_NS, "Zebra Name Space" },
|
|
||||||
{ MTYPE_ZEBRA_VRF, "ZEBRA VRF" },
|
|
||||||
{ MTYPE_NEXTHOP, "Nexthop" },
|
|
||||||
{ MTYPE_RIB, "RIB" },
|
|
||||||
{ MTYPE_RIB_QUEUE, "RIB process work queue" },
|
|
||||||
{ MTYPE_STATIC_ROUTE, "Static route" },
|
|
||||||
{ MTYPE_RIB_DEST, "RIB destination" },
|
|
||||||
{ MTYPE_RIB_TABLE_INFO, "RIB table info" },
|
|
||||||
{ MTYPE_RNH, "Nexthop tracking object" },
|
|
||||||
{ MTYPE_NETLINK_NAME, "Netlink name" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_bgp[] =
|
|
||||||
{
|
|
||||||
{ MTYPE_BGP, "BGP instance" },
|
|
||||||
{ MTYPE_BGP_LISTENER, "BGP listen socket details" },
|
|
||||||
{ MTYPE_BGP_PEER, "BGP peer" },
|
|
||||||
{ MTYPE_BGP_PEER_HOST, "BGP peer hostname" },
|
|
||||||
{ MTYPE_BGP_PEER_IFNAME, "BGP peer ifname" },
|
|
||||||
{ MTYPE_BGP_PEER_GROUP, "BGP Peer group" },
|
|
||||||
{ MTYPE_BGP_PEER_GROUP_HOST, "BGP Peer group hostname" },
|
|
||||||
{ MTYPE_PEER_DESC, "Peer description" },
|
|
||||||
{ MTYPE_PEER_PASSWORD, "Peer password string" },
|
|
||||||
{ MTYPE_BGP_PEER_AF, "BGP peer af" },
|
|
||||||
{ MTYPE_BGP_UPDGRP, "BGP update group" },
|
|
||||||
{ MTYPE_BGP_UPD_SUBGRP, "BGP update subgroup" },
|
|
||||||
{ MTYPE_BGP_PACKET, "BGP packet" },
|
|
||||||
{ MTYPE_ATTR, "BGP attribute" },
|
|
||||||
{ MTYPE_ATTR_EXTRA, "BGP extra attributes" },
|
|
||||||
{ MTYPE_AS_PATH, "BGP aspath" },
|
|
||||||
{ MTYPE_AS_SEG, "BGP aspath seg" },
|
|
||||||
{ MTYPE_AS_SEG_DATA, "BGP aspath segment data" },
|
|
||||||
{ MTYPE_AS_STR, "BGP aspath str" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_BGP_TABLE, "BGP table" },
|
|
||||||
{ MTYPE_BGP_NODE, "BGP node" },
|
|
||||||
{ MTYPE_BGP_ROUTE, "BGP route" },
|
|
||||||
{ MTYPE_BGP_ROUTE_EXTRA, "BGP ancillary route info" },
|
|
||||||
{ MTYPE_BGP_CONN, "BGP connected" },
|
|
||||||
{ MTYPE_BGP_STATIC, "BGP static" },
|
|
||||||
{ MTYPE_BGP_ADVERTISE_ATTR, "BGP adv attr" },
|
|
||||||
{ MTYPE_BGP_ADVERTISE, "BGP adv" },
|
|
||||||
{ MTYPE_BGP_SYNCHRONISE, "BGP synchronise" },
|
|
||||||
{ MTYPE_BGP_ADJ_IN, "BGP adj in" },
|
|
||||||
{ MTYPE_BGP_ADJ_OUT, "BGP adj out" },
|
|
||||||
{ MTYPE_BGP_MPATH_INFO, "BGP multipath info" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_AS_LIST, "BGP AS list" },
|
|
||||||
{ MTYPE_AS_FILTER, "BGP AS filter" },
|
|
||||||
{ MTYPE_AS_FILTER_STR, "BGP AS filter str" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_COMMUNITY, "community" },
|
|
||||||
{ MTYPE_COMMUNITY_VAL, "community val" },
|
|
||||||
{ MTYPE_COMMUNITY_STR, "community str" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_ECOMMUNITY, "extcommunity" },
|
|
||||||
{ MTYPE_ECOMMUNITY_VAL, "extcommunity val" },
|
|
||||||
{ MTYPE_ECOMMUNITY_STR, "extcommunity str" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_COMMUNITY_LIST, "community-list" },
|
|
||||||
{ MTYPE_COMMUNITY_LIST_NAME, "community-list name" },
|
|
||||||
{ MTYPE_COMMUNITY_LIST_ENTRY, "community-list entry" },
|
|
||||||
{ MTYPE_COMMUNITY_LIST_CONFIG, "community-list config" },
|
|
||||||
{ MTYPE_COMMUNITY_LIST_HANDLER, "community-list handler" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_CLUSTER, "Cluster list" },
|
|
||||||
{ MTYPE_CLUSTER_VAL, "Cluster list val" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_BGP_PROCESS_QUEUE, "BGP Process queue" },
|
|
||||||
{ MTYPE_BGP_CLEAR_NODE_QUEUE, "BGP node clear queue" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_TRANSIT, "BGP transit attr" },
|
|
||||||
{ MTYPE_TRANSIT_VAL, "BGP transit val" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_BGP_DEBUG_FILTER, "BGP debug filter" },
|
|
||||||
{ MTYPE_BGP_DEBUG_STR, "BGP debug filter string" },
|
|
||||||
{ 0, NULL },
|
|
||||||
{ MTYPE_BGP_DISTANCE, "BGP distance" },
|
|
||||||
{ MTYPE_BGP_NEXTHOP_CACHE, "BGP nexthop" },
|
|
||||||
{ MTYPE_BGP_CONFED_LIST, "BGP confed list" },
|
|
||||||
{ MTYPE_PEER_UPDATE_SOURCE, "BGP peer update interface" },
|
|
||||||
{ MTYPE_PEER_CONF_IF, "BGP peer config interface" },
|
|
||||||
{ MTYPE_BGP_DAMP_INFO, "Dampening info" },
|
|
||||||
{ MTYPE_BGP_DAMP_ARRAY, "BGP Dampening array" },
|
|
||||||
{ MTYPE_BGP_REGEXP, "BGP regexp" },
|
|
||||||
{ MTYPE_BGP_AGGREGATE, "BGP aggregate" },
|
|
||||||
{ MTYPE_BGP_ADDR, "BGP own address" },
|
|
||||||
{ 0 , NULL},
|
|
||||||
{ MTYPE_BGP_REDIST, "BGP redistribution" },
|
|
||||||
{ MTYPE_BGP_FILTER_NAME, "BGP Filter Information" },
|
|
||||||
{ MTYPE_BGP_DUMP_STR, "BGP Dump String Information" },
|
|
||||||
{ MTYPE_ENCAP_TLV, "ENCAP TLV", },
|
|
||||||
{ -1, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_rip[] =
|
DEFINE_MGROUP(ZEBRA, "zebra")
|
||||||
{
|
DEFINE_MTYPE(ZEBRA, RTADV_PREFIX, "Router Advertisement Prefix")
|
||||||
{ MTYPE_RIP, "RIP structure" },
|
DEFINE_MTYPE(ZEBRA, ZEBRA_NS, "Zebra Name Space")
|
||||||
{ MTYPE_RIP_INFO, "RIP route info" },
|
DEFINE_MTYPE(ZEBRA, ZEBRA_VRF, "ZEBRA VRF")
|
||||||
{ MTYPE_RIP_INTERFACE, "RIP interface" },
|
DEFINE_MTYPE(ZEBRA, NEXTHOP, "Nexthop")
|
||||||
{ MTYPE_RIP_PEER, "RIP peer" },
|
DEFINE_MTYPE(ZEBRA, RIB, "RIB")
|
||||||
{ MTYPE_RIP_OFFSET_LIST, "RIP offset list" },
|
DEFINE_MTYPE(ZEBRA, RIB_QUEUE, "RIB process work queue")
|
||||||
{ MTYPE_RIP_DISTANCE, "RIP distance" },
|
DEFINE_MTYPE(ZEBRA, STATIC_ROUTE, "Static route")
|
||||||
{ -1, NULL }
|
DEFINE_MTYPE(ZEBRA, RIB_DEST, "RIB destination")
|
||||||
};
|
DEFINE_MTYPE(ZEBRA, RIB_TABLE_INFO, "RIB table info")
|
||||||
|
DEFINE_MTYPE(ZEBRA, RNH, "Nexthop tracking object")
|
||||||
|
DEFINE_MTYPE(ZEBRA, NETLINK_NAME, "Netlink name")
|
||||||
|
|
||||||
struct memory_list memory_list_ripng[] =
|
|
||||||
{
|
|
||||||
{ MTYPE_RIPNG, "RIPng structure" },
|
|
||||||
{ MTYPE_RIPNG_ROUTE, "RIPng route info" },
|
|
||||||
{ MTYPE_RIPNG_AGGREGATE, "RIPng aggregate" },
|
|
||||||
{ MTYPE_RIPNG_PEER, "RIPng peer" },
|
|
||||||
{ MTYPE_RIPNG_OFFSET_LIST, "RIPng offset lst" },
|
|
||||||
{ MTYPE_RIPNG_RTE_DATA, "RIPng rte data" },
|
|
||||||
{ -1, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_ospf[] =
|
|
||||||
{
|
|
||||||
{ MTYPE_OSPF_TOP, "OSPF top" },
|
|
||||||
{ MTYPE_OSPF_AREA, "OSPF area" },
|
|
||||||
{ MTYPE_OSPF_AREA_RANGE, "OSPF area range" },
|
|
||||||
{ MTYPE_OSPF_NETWORK, "OSPF network" },
|
|
||||||
{ MTYPE_OSPF_NEIGHBOR_STATIC,"OSPF static nbr" },
|
|
||||||
{ MTYPE_OSPF_IF, "OSPF interface" },
|
|
||||||
{ MTYPE_OSPF_NEIGHBOR, "OSPF neighbor" },
|
|
||||||
{ MTYPE_OSPF_ROUTE, "OSPF route" },
|
|
||||||
{ MTYPE_OSPF_TMP, "OSPF tmp mem" },
|
|
||||||
{ MTYPE_OSPF_LSA, "OSPF LSA" },
|
|
||||||
{ MTYPE_OSPF_LSA_DATA, "OSPF LSA data" },
|
|
||||||
{ MTYPE_OSPF_LSDB, "OSPF LSDB" },
|
|
||||||
{ MTYPE_OSPF_PACKET, "OSPF packet" },
|
|
||||||
{ MTYPE_OSPF_FIFO, "OSPF FIFO queue" },
|
|
||||||
{ MTYPE_OSPF_VERTEX, "OSPF vertex" },
|
|
||||||
{ MTYPE_OSPF_VERTEX_PARENT, "OSPF vertex parent", },
|
|
||||||
{ MTYPE_OSPF_NEXTHOP, "OSPF nexthop" },
|
|
||||||
{ MTYPE_OSPF_PATH, "OSPF path" },
|
|
||||||
{ MTYPE_OSPF_VL_DATA, "OSPF VL data" },
|
|
||||||
{ MTYPE_OSPF_CRYPT_KEY, "OSPF crypt key" },
|
|
||||||
{ MTYPE_OSPF_EXTERNAL_INFO, "OSPF ext. info" },
|
|
||||||
{ MTYPE_OSPF_DISTANCE, "OSPF distance" },
|
|
||||||
{ MTYPE_OSPF_IF_INFO, "OSPF if info" },
|
|
||||||
{ MTYPE_OSPF_IF_PARAMS, "OSPF if params" },
|
|
||||||
{ MTYPE_OSPF_MESSAGE, "OSPF message" },
|
|
||||||
{ MTYPE_OSPF_MPLS_TE, "OSPF MPLS parameters" },
|
|
||||||
{ MTYPE_OSPF_PCE_PARAMS, "OSPF PCE parameters" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_ospf6[] =
|
DEFINE_MGROUP(BGPD, "bgpd")
|
||||||
{
|
DEFINE_MTYPE(BGPD, BGP, "BGP instance")
|
||||||
{ MTYPE_OSPF6_TOP, "OSPF6 top" },
|
DEFINE_MTYPE(BGPD, BGP_LISTENER, "BGP listen socket details")
|
||||||
{ MTYPE_OSPF6_AREA, "OSPF6 area" },
|
DEFINE_MTYPE(BGPD, BGP_PEER, "BGP peer")
|
||||||
{ MTYPE_OSPF6_IF, "OSPF6 interface" },
|
DEFINE_MTYPE(BGPD, BGP_PEER_HOST, "BGP peer hostname")
|
||||||
{ MTYPE_OSPF6_NEIGHBOR, "OSPF6 neighbor" },
|
DEFINE_MTYPE(BGPD, BGP_PEER_IFNAME, "BGP peer ifname")
|
||||||
{ MTYPE_OSPF6_ROUTE, "OSPF6 route" },
|
DEFINE_MTYPE(BGPD, PEER_GROUP, "Peer group")
|
||||||
{ MTYPE_OSPF6_PREFIX, "OSPF6 prefix" },
|
DEFINE_MTYPE(BGPD, PEER_GROUP_HOST, "BGP Peer group hostname")
|
||||||
{ MTYPE_OSPF6_MESSAGE, "OSPF6 message" },
|
DEFINE_MTYPE(BGPD, PEER_DESC, "Peer description")
|
||||||
{ MTYPE_OSPF6_LSA, "OSPF6 LSA" },
|
DEFINE_MTYPE(BGPD, PEER_PASSWORD, "Peer password string")
|
||||||
{ MTYPE_OSPF6_LSA_SUMMARY, "OSPF6 LSA summary" },
|
DEFINE_MTYPE(BGPD, BGP_PEER_AF, "BGP peer af")
|
||||||
{ MTYPE_OSPF6_LSDB, "OSPF6 LSA database" },
|
DEFINE_MTYPE(BGPD, BGP_UPDGRP, "BGP update group")
|
||||||
{ MTYPE_OSPF6_VERTEX, "OSPF6 vertex" },
|
DEFINE_MTYPE(BGPD, BGP_UPD_SUBGRP, "BGP update subgroup")
|
||||||
{ MTYPE_OSPF6_SPFTREE, "OSPF6 SPF tree" },
|
DEFINE_MTYPE(BGPD, BGP_PACKET, "BGP packet")
|
||||||
{ MTYPE_OSPF6_NEXTHOP, "OSPF6 nexthop" },
|
DEFINE_MTYPE(BGPD, ATTR, "BGP attribute")
|
||||||
{ MTYPE_OSPF6_EXTERNAL_INFO,"OSPF6 ext. info" },
|
DEFINE_MTYPE(BGPD, ATTR_EXTRA, "BGP extra attributes")
|
||||||
{ MTYPE_OSPF6_OTHER, "OSPF6 other" },
|
DEFINE_MTYPE(BGPD, AS_PATH, "BGP aspath")
|
||||||
{ -1, NULL },
|
DEFINE_MTYPE(BGPD, AS_SEG, "BGP aspath seg")
|
||||||
};
|
DEFINE_MTYPE(BGPD, AS_SEG_DATA, "BGP aspath segment data")
|
||||||
|
DEFINE_MTYPE(BGPD, AS_STR, "BGP aspath str")
|
||||||
|
|
||||||
struct memory_list memory_list_isis[] =
|
DEFINE_MTYPE(BGPD, BGP_TABLE, "BGP table")
|
||||||
{
|
DEFINE_MTYPE(BGPD, BGP_NODE, "BGP node")
|
||||||
{ MTYPE_ISIS, "ISIS" },
|
DEFINE_MTYPE(BGPD, BGP_ROUTE, "BGP route")
|
||||||
{ MTYPE_ISIS_TMP, "ISIS TMP" },
|
DEFINE_MTYPE(BGPD, BGP_ROUTE_EXTRA, "BGP ancillary route info")
|
||||||
{ MTYPE_ISIS_CIRCUIT, "ISIS circuit" },
|
DEFINE_MTYPE(BGPD, BGP_CONN, "BGP connected")
|
||||||
{ MTYPE_ISIS_LSP, "ISIS LSP" },
|
DEFINE_MTYPE(BGPD, BGP_STATIC, "BGP static")
|
||||||
{ MTYPE_ISIS_ADJACENCY, "ISIS adjacency" },
|
DEFINE_MTYPE(BGPD, BGP_ADVERTISE_ATTR, "BGP adv attr")
|
||||||
{ MTYPE_ISIS_AREA, "ISIS area" },
|
DEFINE_MTYPE(BGPD, BGP_ADVERTISE, "BGP adv")
|
||||||
{ MTYPE_ISIS_AREA_ADDR, "ISIS area address" },
|
DEFINE_MTYPE(BGPD, BGP_SYNCHRONISE, "BGP synchronise")
|
||||||
{ MTYPE_ISIS_TLV, "ISIS TLV" },
|
DEFINE_MTYPE(BGPD, BGP_ADJ_IN, "BGP adj in")
|
||||||
{ MTYPE_ISIS_DYNHN, "ISIS dyn hostname" },
|
DEFINE_MTYPE(BGPD, BGP_ADJ_OUT, "BGP adj out")
|
||||||
{ MTYPE_ISIS_SPFTREE, "ISIS SPFtree" },
|
DEFINE_MTYPE(BGPD, BGP_MPATH_INFO, "BGP multipath info")
|
||||||
{ MTYPE_ISIS_VERTEX, "ISIS vertex" },
|
|
||||||
{ MTYPE_ISIS_ROUTE_INFO, "ISIS route info" },
|
|
||||||
{ MTYPE_ISIS_NEXTHOP, "ISIS nexthop" },
|
|
||||||
{ MTYPE_ISIS_NEXTHOP6, "ISIS nexthop6" },
|
|
||||||
{ MTYPE_ISIS_DICT, "ISIS dictionary" },
|
|
||||||
{ MTYPE_ISIS_DICT_NODE, "ISIS dictionary node" },
|
|
||||||
{ MTYPE_ISIS_MPLS_TE, "ISIS MPLS_TE parameters" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_pim[] =
|
DEFINE_MTYPE(BGPD, AS_LIST, "BGP AS list")
|
||||||
{
|
DEFINE_MTYPE(BGPD, AS_FILTER, "BGP AS filter")
|
||||||
{ MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
|
DEFINE_MTYPE(BGPD, AS_FILTER_STR, "BGP AS filter str")
|
||||||
{ MTYPE_PIM_INTERFACE, "PIM interface" },
|
|
||||||
{ MTYPE_PIM_IGMP_JOIN, "PIM interface IGMP static join" },
|
|
||||||
{ MTYPE_PIM_IGMP_SOCKET, "PIM interface IGMP socket" },
|
|
||||||
{ MTYPE_PIM_IGMP_GROUP, "PIM interface IGMP group" },
|
|
||||||
{ MTYPE_PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source" },
|
|
||||||
{ MTYPE_PIM_NEIGHBOR, "PIM interface neighbor" },
|
|
||||||
{ MTYPE_PIM_IFCHANNEL, "PIM interface (S,G) state" },
|
|
||||||
{ MTYPE_PIM_UPSTREAM, "PIM upstream (S,G) state" },
|
|
||||||
{ MTYPE_PIM_SSMPINGD, "PIM sspimgd socket" },
|
|
||||||
{ MTYPE_PIM_STATIC_ROUTE, "PIM Static Route" },
|
|
||||||
{ MTYPE_PIM_BR, "PIM Bridge Router info" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct memory_list memory_list_vtysh[] =
|
DEFINE_MTYPE(BGPD, COMMUNITY, "community")
|
||||||
{
|
DEFINE_MTYPE(BGPD, COMMUNITY_VAL, "community val")
|
||||||
{ MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
|
DEFINE_MTYPE(BGPD, COMMUNITY_STR, "community str")
|
||||||
{ MTYPE_VTYSH_CONFIG_LINE, "Vtysh configuration line" },
|
|
||||||
{ -1, NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
struct mlist mlists[] __attribute__ ((unused)) = {
|
DEFINE_MTYPE(BGPD, ECOMMUNITY, "extcommunity")
|
||||||
{ memory_list_lib, "LIB" },
|
DEFINE_MTYPE(BGPD, ECOMMUNITY_VAL, "extcommunity val")
|
||||||
{ memory_list_zebra, "ZEBRA" },
|
DEFINE_MTYPE(BGPD, ECOMMUNITY_STR, "extcommunity str")
|
||||||
{ memory_list_rip, "RIP" },
|
|
||||||
{ memory_list_ripng, "RIPNG" },
|
DEFINE_MTYPE(BGPD, COMMUNITY_LIST, "community-list")
|
||||||
{ memory_list_ospf, "OSPF" },
|
DEFINE_MTYPE(BGPD, COMMUNITY_LIST_NAME, "community-list name")
|
||||||
{ memory_list_ospf6, "OSPF6" },
|
DEFINE_MTYPE(BGPD, COMMUNITY_LIST_ENTRY, "community-list entry")
|
||||||
{ memory_list_isis, "ISIS" },
|
DEFINE_MTYPE(BGPD, COMMUNITY_LIST_CONFIG, "community-list config")
|
||||||
{ memory_list_bgp, "BGP" },
|
DEFINE_MTYPE(BGPD, COMMUNITY_LIST_HANDLER, "community-list handler")
|
||||||
{ memory_list_pim, "PIM" },
|
|
||||||
{ NULL, NULL},
|
DEFINE_MTYPE(BGPD, CLUSTER, "Cluster list")
|
||||||
};
|
DEFINE_MTYPE(BGPD, CLUSTER_VAL, "Cluster list val")
|
||||||
|
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_PROCESS_QUEUE, "BGP Process queue")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_CLEAR_NODE_QUEUE, "BGP node clear queue")
|
||||||
|
|
||||||
|
DEFINE_MTYPE(BGPD, TRANSIT, "BGP transit attr")
|
||||||
|
DEFINE_MTYPE(BGPD, TRANSIT_VAL, "BGP transit val")
|
||||||
|
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DEBUG_FILTER, "BGP debug filter")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DEBUG_STR, "BGP debug filter string")
|
||||||
|
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DISTANCE, "BGP distance")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_NEXTHOP_CACHE, "BGP nexthop")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_CONFED_LIST, "BGP confed list")
|
||||||
|
DEFINE_MTYPE(BGPD, PEER_UPDATE_SOURCE, "BGP peer update interface")
|
||||||
|
DEFINE_MTYPE(BGPD, PEER_CONF_IF, "BGP peer config interface")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DAMP_INFO, "Dampening info")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DAMP_ARRAY, "BGP Dampening array")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_REGEXP, "BGP regexp")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_AGGREGATE, "BGP aggregate")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_ADDR, "BGP own address")
|
||||||
|
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_REDIST, "BGP redistribution")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_FILTER_NAME, "BGP Filter Information")
|
||||||
|
DEFINE_MTYPE(BGPD, BGP_DUMP_STR, "BGP Dump String Information")
|
||||||
|
DEFINE_MTYPE(BGPD, ENCAP_TLV, "ENCAP TLV")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE_MGROUP(RIPD, "ripd")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP, "RIP structure")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP_INFO, "RIP route info")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP_INTERFACE, "RIP interface")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP_PEER, "RIP peer")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP_OFFSET_LIST, "RIP offset list")
|
||||||
|
DEFINE_MTYPE(RIPD, RIP_DISTANCE, "RIP distance")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE_MGROUP(RIPNGD, "ripngd")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG, "RIPng structure")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG_ROUTE, "RIPng route info")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG_AGGREGATE, "RIPng aggregate")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG_PEER, "RIPng peer")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG_OFFSET_LIST, "RIPng offset lst")
|
||||||
|
DEFINE_MTYPE(RIPNGD, RIPNG_RTE_DATA, "RIPng rte data")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE_MGROUP(OSPFD, "ospfd")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_TOP, "OSPF top")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_AREA, "OSPF area")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_AREA_RANGE, "OSPF area range")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_NETWORK, "OSPF network")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_NEIGHBOR_STATIC, "OSPF static nbr")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_IF, "OSPF interface")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_NEIGHBOR, "OSPF neighbor")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_ROUTE, "OSPF route")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_TMP, "OSPF tmp mem")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_LSA, "OSPF LSA")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_LSA_DATA, "OSPF LSA data")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_LSDB, "OSPF LSDB")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_PACKET, "OSPF packet")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_FIFO, "OSPF FIFO queue")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_VERTEX, "OSPF vertex")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_VERTEX_PARENT, "OSPF vertex parent")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_NEXTHOP, "OSPF nexthop")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_PATH, "OSPF path")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_VL_DATA, "OSPF VL data")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_CRYPT_KEY, "OSPF crypt key")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_EXTERNAL_INFO, "OSPF ext. info")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_DISTANCE, "OSPF distance")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_IF_INFO, "OSPF if info")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_IF_PARAMS, "OSPF if params")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_MESSAGE, "OSPF message")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_MPLS_TE, "OSPF MPLS parameters")
|
||||||
|
DEFINE_MTYPE(OSPFD, OSPF_PCE_PARAMS, "OSPF PCE parameters")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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_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_OTHER, "OSPF6 other")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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_AREA, "ISIS area")
|
||||||
|
DEFINE_MTYPE(ISISD, ISIS_AREA_ADDR, "ISIS area address")
|
||||||
|
DEFINE_MTYPE(ISISD, ISIS_TLV, "ISIS TLV")
|
||||||
|
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_NEXTHOP6, "ISIS nexthop6")
|
||||||
|
DEFINE_MTYPE(ISISD, ISIS_DICT, "ISIS dictionary")
|
||||||
|
DEFINE_MTYPE(ISISD, ISIS_DICT_NODE, "ISIS dictionary node")
|
||||||
|
DEFINE_MTYPE(ISISD, ISIS_MPLS_TE, "ISIS MPLS_TE parameters")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE_MGROUP(PIMD, "pimd")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_INTERFACE, "PIM interface")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_IGMP_JOIN, "PIM interface IGMP static join")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_IGMP_SOCKET, "PIM interface IGMP socket")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_IGMP_GROUP, "PIM interface IGMP group")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_IGMP_GROUP_SOURCE, "PIM interface IGMP source")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_NEIGHBOR, "PIM interface neighbor")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_IFCHANNEL, "PIM interface (S,G) state")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_UPSTREAM, "PIM upstream (S,G) state")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_SSMPINGD, "PIM sspimgd socket")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_STATIC_ROUTE, "PIM Static Route")
|
||||||
|
DEFINE_MTYPE(PIMD, PIM_BR, "PIM Bridge Router info")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DEFINE_MGROUP(MVTYSH, "vtysh")
|
||||||
|
DEFINE_MTYPE(MVTYSH, VTYSH_CONFIG, "Vtysh configuration")
|
||||||
|
DEFINE_MTYPE(MVTYSH, VTYSH_CONFIG_LINE, "Vtysh configuration line")
|
||||||
|
6
lib/memtypes.pl
Executable file
6
lib/memtypes.pl
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
while (<STDIN>) {
|
||||||
|
$_ =~ s/DEFINE_MTYPE\([^,]+,\s*([^,]+)\s*,.*\)/DECLARE_MTYPE\($1\)/;
|
||||||
|
$_ =~ s/DEFINE_MGROUP\(([^,]+),.*\)/DECLARE_MGROUP\($1\)/;
|
||||||
|
print $_;
|
||||||
|
}
|
@ -29,6 +29,7 @@
|
|||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "if.h"
|
#include "if.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
#include "ospf_apiclient.h"
|
#include "ospf_apiclient.h"
|
||||||
|
|
||||||
|
DEFINE_MTYPE_STATIC(OSPFD, OSPF_APICLIENT, "OSPF-API client")
|
||||||
|
|
||||||
/* Backlog for listen */
|
/* Backlog for listen */
|
||||||
#define BACKLOG 5
|
#define BACKLOG 5
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@
|
|||||||
#ifndef _OSPF_APICLIENT_H
|
#ifndef _OSPF_APICLIENT_H
|
||||||
#define _OSPF_APICLIENT_H
|
#define _OSPF_APICLIENT_H
|
||||||
|
|
||||||
#define MTYPE_OSPF_APICLIENT MTYPE_TMP
|
|
||||||
|
|
||||||
/* Structure for the OSPF API client */
|
/* Structure for the OSPF API client */
|
||||||
struct ospf_apiclient
|
struct ospf_apiclient
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
#include "sigevent.h"
|
#include "sigevent.h"
|
||||||
#include "zclient.h"
|
#include "zclient.h"
|
||||||
|
@ -21,11 +21,6 @@
|
|||||||
* 02111-1307, USA.
|
* 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/***** MTYPE definitions are not reflected to "memory.h" yet. *****/
|
|
||||||
#define MTYPE_OSPF_OPAQUE_FUNCTAB MTYPE_TMP
|
|
||||||
#define MTYPE_OPAQUE_INFO_PER_TYPE MTYPE_TMP
|
|
||||||
#define MTYPE_OPAQUE_INFO_PER_ID MTYPE_TMP
|
|
||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
|
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
@ -57,6 +52,10 @@
|
|||||||
#include "ospfd/ospf_ase.h"
|
#include "ospfd/ospf_ase.h"
|
||||||
#include "ospfd/ospf_zebra.h"
|
#include "ospfd/ospf_zebra.h"
|
||||||
|
|
||||||
|
DEFINE_MTYPE_STATIC(OSPFD, OSPF_OPAQUE_FUNCTAB, "OSPF opaque function table")
|
||||||
|
DEFINE_MTYPE_STATIC(OSPFD, OPAQUE_INFO_PER_TYPE, "OSPF opaque per-type info")
|
||||||
|
DEFINE_MTYPE_STATIC(OSPFD, OPAQUE_INFO_PER_ID, "OSPF opaque per-ID info")
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*
|
/*------------------------------------------------------------------------*
|
||||||
* Followings are initialize/terminate functions for Opaque-LSAs handling.
|
* Followings are initialize/terminate functions for Opaque-LSAs handling.
|
||||||
*------------------------------------------------------------------------*/
|
*------------------------------------------------------------------------*/
|
||||||
|
@ -63,6 +63,8 @@
|
|||||||
#include "ospfd/ospf_te.h"
|
#include "ospfd/ospf_te.h"
|
||||||
#include "ospfd/ospf_vty.h"
|
#include "ospfd/ospf_vty.h"
|
||||||
|
|
||||||
|
DEFINE_MTYPE_STATIC(OSPFD, OSPF_MPLS_TE_LINKPARAMS, "OSPF MPLS-TE link parameters")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variable to manage Opaque-LSA/MPLS-TE on this node.
|
* Global variable to manage Opaque-LSA/MPLS-TE on this node.
|
||||||
* Note that all parameter values are stored in network byte order.
|
* Note that all parameter values are stored in network byte order.
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "vrf.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "sigevent.h"
|
#include "sigevent.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "keychain.h"
|
#include "keychain.h"
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "common-cli.h"
|
#include "common-cli.h"
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "vty.h"
|
#include "vty.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
|
|
||||||
extern void test_init();
|
extern void test_init();
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <zebra.h>
|
#include <zebra.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
#include <memory_vty.h>
|
||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
|
|
||||||
struct thread_master *master;
|
struct thread_master *master;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
|
|
||||||
zebra_capabilities_t _caps_p [] =
|
zebra_capabilities_t _caps_p [] =
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
|
|
||||||
#include "vtysh/vtysh.h"
|
#include "vtysh/vtysh.h"
|
||||||
#include "vtysh/vtysh_user.h"
|
#include "vtysh/vtysh_user.h"
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "plist.h"
|
#include "plist.h"
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "memory_vty.h"
|
||||||
#include "prefix.h"
|
#include "prefix.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "privs.h"
|
#include "privs.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user