summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog13
-rw-r--r--lib/command.h1
-rw-r--r--lib/log.c14
-rw-r--r--lib/routemap.c22
-rw-r--r--lib/routemap.h3
-rw-r--r--lib/zebra.h3
6 files changed, 43 insertions, 13 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index f8fdd11e..3787b68c 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,16 @@
+2007-05-01 David L Stevens <dlstevens@us.ibm.com>
+
+ * (general) These changes collectively add route-map and
+ prefix-list support to zebra and fix a bug in "show
+ route-map" (with no argument).
+ * command.h: added PROTOCOL_NODE type
+ * log.c: (proto_name2num) new function, protocol name to
+ number translation.
+ * routemap.c: (vty_show_route_map) fixed "show route-map"
+ without route-map name
+ * routemap.h: added RMAP_ZEBRA type
+ * zebra.h: added proto_name2num() prototype
+
2007-04-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* log.c: (quagga_timestamp) Optimize the subsecond timestamp generation.
diff --git a/lib/command.h b/lib/command.h
index ce18731e..a7253788 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -99,6 +99,7 @@ enum node_type
SMUX_NODE, /* SNMP configuration node. */
DUMP_NODE, /* Packet dump node. */
FORWARDING_NODE, /* IP forwarding node. */
+ PROTOCOL_NODE, /* protocol filtering node */
VTY_NODE /* Vty node. */
};
diff --git a/lib/log.c b/lib/log.c
index 21bf3f2f..cbf76af9 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -886,3 +886,17 @@ zserv_command_string (unsigned int command)
}
return command_types[command].string;
}
+
+#define RTSIZE (sizeof(route_types)/sizeof(route_types[0]))
+
+int
+proto_name2num(const char *s)
+{
+ unsigned i;
+
+ for (i=0; i<RTSIZE; ++i)
+ if (strcasecmp(s, route_types[i].string) == 0)
+ return route_types[i].type;
+ return -1;
+}
+#undef RTSIZE
diff --git a/lib/routemap.c b/lib/routemap.c
index 55cc33c7..58ed09a7 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -268,6 +268,11 @@ vty_show_route_map (struct vty *vty, const char *name)
return CMD_WARNING;
}
}
+ else
+ {
+ for (map = route_map_master.head; map; map = map->next)
+ vty_show_route_map_entry (vty, map);
+ }
return CMD_SUCCESS;
}
@@ -1135,23 +1140,17 @@ ALIAS (no_rmap_onmatch_goto,
"Continue on a different entry within the route-map\n"
"Route-map entry sequence number\n")
-DEFUN (rmap_show,
- rmap_show_cmd,
- "show route-map",
- SHOW_STR
- "route-map information\n")
-{
- return vty_show_route_map (vty, NULL);
-}
-
DEFUN (rmap_show_name,
rmap_show_name_cmd,
- "show route-map WORD",
+ "show route-map [WORD]",
SHOW_STR
"route-map information\n"
"route-map name\n")
{
- return vty_show_route_map (vty, argv[0]);
+ const char *name = NULL;
+ if (argc)
+ name = argv[0];
+ return vty_show_route_map (vty, name);
}
ALIAS (rmap_onmatch_goto,
@@ -1322,6 +1321,5 @@ route_map_init_vty (void)
install_element (RMAP_NODE, &no_rmap_description_cmd);
/* Install show command */
- install_element (ENABLE_NODE, &rmap_show_cmd);
install_element (ENABLE_NODE, &rmap_show_name_cmd);
}
diff --git a/lib/routemap.h b/lib/routemap.h
index c9cf4410..321e1927 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -45,7 +45,8 @@ typedef enum
RMAP_RIPNG,
RMAP_OSPF,
RMAP_OSPF6,
- RMAP_BGP
+ RMAP_BGP,
+ RMAP_ZEBRA
} route_map_object_t;
typedef enum
diff --git a/lib/zebra.h b/lib/zebra.h
index 2e2f8cda..85537399 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -444,6 +444,9 @@ extern const char *zebra_route_string(unsigned int route_type);
extern char zebra_route_char(unsigned int route_type);
/* Map a zserv command type to the same string,
* e.g. ZEBRA_INTERFACE_ADD -> "ZEBRA_INTERFACE_ADD" */
+/* Map a protocol name to its number. e.g. ZEBRA_ROUTE_BGP->9*/
+extern int proto_name2num(const char *s);
+
extern const char *zserv_command_string (unsigned int command);
/* Zebra's family types. */