summaryrefslogtreecommitdiff
path: root/lib/zebra.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2009-09-16 01:52:42 +0200
committerDenis Ovsienko <infrastation@yandex.ru>2011-12-13 19:13:17 +0400
commite0ca5fde7be5b5ce90dae78c2477e8245aecb8e9 (patch)
tree0e0b32ddbed4a84a3b2de9dd7217165cb81f52fa /lib/zebra.h
parentebf08631cad8a420fc6bfb7c45af5496dc11023e (diff)
lib: put route_types.txt to real use
this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c. Conflicts: lib/route_types.awk
Diffstat (limited to 'lib/zebra.h')
-rw-r--r--lib/zebra.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/zebra.h b/lib/zebra.h
index c4c69d3d..4b4c7c00 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -425,19 +425,8 @@ struct in_pktinfo
*/
#define ZEBRA_HEADER_MARKER 255
-/* 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_MAX 11
+/* Zebra route's types are defined in route_types.h */
+#include "route_types.h"
/* Note: whenever a new route-type or zserv-command is added the
* corresponding {command,route}_types[] table in lib/log.c MUST be
@@ -451,6 +440,10 @@ extern char zebra_route_char(unsigned int route_type);
* 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);
+/* Map redistribute X argument to protocol number.
+ * unlike proto_name2num, this accepts shorthands and takes
+ * an AFI value to restrict input */
+extern int proto_redistnum(int afi, const char *s);
extern const char *zserv_command_string (unsigned int command);