[pim] Initial pim 0.155
diff --git a/lib/command.h b/lib/command.h
index 8dc50d0..5156dbf 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -1,6 +1,7 @@
/*
* Zebra configuration command interface routine
* Copyright (C) 1997, 98 Kunihiro Ishiguro
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
*
* This file is part of GNU Zebra.
*
@@ -88,6 +89,7 @@
OSPF_NODE, /* OSPF protocol mode */
OSPF6_NODE, /* OSPF protocol for IPv6 mode */
ISIS_NODE, /* ISIS protocol mode */
+ PIM_NODE, /* PIM protocol mode */
MASC_NODE, /* MASC for multicast. */
IRDP_NODE, /* ICMP Router Discovery Protocol mode. */
IP_NODE, /* Static ip route node. */
diff --git a/lib/log.c b/lib/log.c
index 04f8fab..abfd35b 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -1,6 +1,7 @@
/*
* Logging of zebra
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
*
* This file is part of GNU Zebra.
*
@@ -51,6 +52,7 @@
"BABEL",
"OSPF6",
"ISIS",
+ "PIM",
"MASC",
NULL,
};
diff --git a/lib/log.h b/lib/log.h
index f3b43ad..d9f1eca 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -1,6 +1,7 @@
/*
* Zebra logging funcions.
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
*
* This file is part of GNU Zebra.
*
@@ -53,6 +54,7 @@
ZLOG_BABEL,
ZLOG_OSPF6,
ZLOG_ISIS,
+ ZLOG_PIM,
ZLOG_MASC
} zlog_proto_t;
diff --git a/lib/memory.c b/lib/memory.c
index 620bdee..28bbdc1 100644
--- a/lib/memory.c
+++ b/lib/memory.c
@@ -1,6 +1,7 @@
/*
* Memory management routine
* Copyright (C) 1998 Kunihiro Ishiguro
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
*
* This file is part of GNU Zebra.
*
@@ -521,6 +522,17 @@
return CMD_SUCCESS;
}
+DEFUN (show_memory_pim,
+ show_memory_pim_cmd,
+ "show memory pim",
+ SHOW_STR
+ "Memory statistics\n"
+ "PIM memory\n")
+{
+ show_memory_vty (vty, memory_list_pim);
+ return CMD_SUCCESS;
+}
+
void
memory_init (void)
{
@@ -545,6 +557,7 @@
install_element (VIEW_NODE, &show_memory_ospf_cmd);
install_element (VIEW_NODE, &show_memory_ospf6_cmd);
install_element (VIEW_NODE, &show_memory_isis_cmd);
+ install_element (VIEW_NODE, &show_memory_pim_cmd);
install_element (ENABLE_NODE, &show_memory_cmd);
install_element (ENABLE_NODE, &show_memory_all_cmd);
@@ -556,7 +569,7 @@
install_element (ENABLE_NODE, &show_memory_bgp_cmd);
install_element (ENABLE_NODE, &show_memory_ospf_cmd);
install_element (ENABLE_NODE, &show_memory_ospf6_cmd);
- install_element (ENABLE_NODE, &show_memory_isis_cmd);
+ install_element (ENABLE_NODE, &show_memory_pim_cmd);
}
/* Stats querying from users */
diff --git a/lib/memtypes.c b/lib/memtypes.c
index 47a3438..26e27e7 100644
--- a/lib/memtypes.c
+++ b/lib/memtypes.c
@@ -1,4 +1,6 @@
/*
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
+ *
* Memory type definitions. This file is parsed by memtypes.awk to extract
* MTYPE_ and memory_list_.. information in order to autogenerate
* memtypes.h.
@@ -255,6 +257,20 @@
{ -1, NULL },
};
+struct memory_list memory_list_pim[] =
+{
+ { MTYPE_PIM_CHANNEL_OIL, "PIM SSM (S,G) channel OIL" },
+ { 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" },
+ { -1, NULL },
+};
+
struct memory_list memory_list_vtysh[] =
{
{ MTYPE_VTYSH_CONFIG, "Vtysh configuration", },
@@ -271,5 +287,6 @@
{ memory_list_ospf6, "OSPF6" },
{ memory_list_isis, "ISIS" },
{ memory_list_bgp, "BGP" },
+ { memory_list_pim, "PIM" },
{ NULL, NULL},
};
diff --git a/lib/zebra.h b/lib/zebra.h
index a4e0214..67d714c 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -1,5 +1,6 @@
/* Zebra common header.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Kunihiro Ishiguro
+ Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
This file is part of GNU Zebra.
@@ -434,8 +435,20 @@
*/
#define ZEBRA_HEADER_MARKER 255
-/* Zebra route's types are defined in route_types.h */
-#include "route_types.h"
+/* Zebra route's types. */
+#define ZEBRA_ROUTE_SYSTEM 0
+#define ZEBRA_ROUTE_KERNEL 1
+#define ZEBRA_ROUTE_CONNECT 2
+#define ZEBRA_ROUTE_STATIC 3
+#define ZEBRA_ROUTE_RIP 4
+#define ZEBRA_ROUTE_RIPNG 5
+#define ZEBRA_ROUTE_OSPF 6
+#define ZEBRA_ROUTE_OSPF6 7
+#define ZEBRA_ROUTE_ISIS 8
+#define ZEBRA_ROUTE_BGP 9
+#define ZEBRA_ROUTE_HSLS 10
+#define ZEBRA_ROUTE_PIM 11
+#define ZEBRA_ROUTE_MAX 12
/* Note: whenever a new route-type or zserv-command is added the
* corresponding {command,route}_types[] table in lib/log.c MUST be