summaryrefslogtreecommitdiffstats
path: root/lib/log.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2019-06-11 11:36:17 +0200
committerGitHub <noreply@github.com>2019-06-11 11:36:17 +0200
commit0afc154435ee93bd411718c488321d25d815a568 (patch)
tree90ee2a305941039d0da23c7a874d1843d6def28f /lib/log.h
parentMerge pull request #4481 from donaldsharp/pim_zlookup_fixup (diff)
parentlib: Move zebra_size_t to zclient.h who should own it (diff)
downloadfrr-0afc154435ee93bd411718c488321d25d815a568.tar.xz
frr-0afc154435ee93bd411718c488321d25d815a568.zip
Zebra.h header cleanup (#4444)
Zebra.h header cleanup
Diffstat (limited to 'lib/log.h')
-rw-r--r--lib/log.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/log.h b/lib/log.h
index e41a472e0..3ef4d2f37 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -154,6 +154,25 @@ extern void zlog_hexdump(const void *mem, unsigned int len);
extern const char *zlog_sanitize(char *buf, size_t bufsz, const void *in,
size_t inlen);
+/* 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" */
+/* 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);
+
extern int vzlog_test(int priority);