diff options
author | paul <paul> | 2006-05-15 16:56:51 +0000 |
---|---|---|
committer | paul <paul> | 2006-05-15 16:56:51 +0000 |
commit | 75ec6dd3085bd68f7a098ff77ff06663e3ed8f96 (patch) | |
tree | fc85e80d1a268dfc420ab5f4f6a306b8e246fc46 /lib/zebra.h | |
parent | e5a3ce7596539b55324017ae2b5d6d9b6a9a997b (diff) | |
download | quagga-75ec6dd3085bd68f7a098ff77ff06663e3ed8f96.tar.bz2 quagga-75ec6dd3085bd68f7a098ff77ff06663e3ed8f96.tar.xz |
[lib] Add string mapping table for Zserv commands
2006-05-15 Paul Jakma <paul.jakma@sun.com>
* log.c: (general) Generalise struct zebra_route_desc into
struct zebra_desc_table and, similar to route_types, add a
command_types table to describe Zserv protocol commands.
(route_types[]) use a macro to use designated initialisers
while avoiding tedious duplication.
(zserv_command_string) lookup string from zebra_desc_table,
similar to zebra_route_string
* zebra.h: Add declaration for zserv_command_string, adjust the
comments to reflect zebra_desc_table.
Diffstat (limited to 'lib/zebra.h')
-rw-r--r-- | lib/zebra.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/zebra.h b/lib/zebra.h index 00f13f57..bf7509e2 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -417,13 +417,17 @@ struct in_pktinfo #define ZEBRA_ROUTE_HSLS 10 #define ZEBRA_ROUTE_MAX 11 -/* Note: whenever a new route type is added (or the numbering is changed), - the route_types[] table in lib/log.c must be updated! */ +/* Note: whenever a new route-type or zserv-command is added the + * corresponding {command,route}_types[] table in lib/log.c MUST be + * updated! */ /* Map a route type to a string. For example, ZEBRA_ROUTE_RIPNG -> "ripng". */ extern const char *zebra_route_string(unsigned int route_type); /* Map a route type to a char. For example, ZEBRA_ROUTE_RIPNG -> 'R'. */ 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" */ +extern const char *zserv_command_string (unsigned int command); /* Zebra's family types. */ #define ZEBRA_FAMILY_IPV4 1 |