diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-05-15 16:56:51 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-05-15 16:56:51 +0000 |
commit | d6d672aaf930661f502a623d18d7a4abb4f184f2 (patch) | |
tree | fc85e80d1a268dfc420ab5f4f6a306b8e246fc46 /lib/zebra.h | |
parent | d16e04335968ea05fda60cec01b48df8c345a8ce (diff) |
[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 |