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-11-21 18:24:50 +0400
commitdaca2cf463496e5844812ea13a4fafefafe4853f (patch)
treefa15ebaba782e946197a18d4739b2539f4c9a1a9 /lib/zebra.h
parent6864a990771c66384a66cd6e7db443529460b0a6 (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);