summaryrefslogtreecommitdiffstats
path: root/lib/log.h
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-06-13 23:15:32 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-06-19 23:20:24 +0200
commitc0dc23460ba43192703a3bf76eca08c71257d42c (patch)
tree921b9ff7ea7239b04e162d18ebae923ef2a9be64 /lib/log.h
parentvtysh: Update vtysh commands with all daemon str (diff)
downloadfrr-c0dc23460ba43192703a3bf76eca08c71257d42c.tar.xz
frr-c0dc23460ba43192703a3bf76eca08c71257d42c.zip
lib: Add log filter manipulation code
Add code for manipulation/creation of log filters and their table. Specifically, add lookup,clear,add,del,dump functionality. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'lib/log.h')
-rw-r--r--lib/log.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/log.h b/lib/log.h
index c5ae6fe32..501da88a5 100644
--- a/lib/log.h
+++ b/lib/log.h
@@ -115,6 +115,15 @@ extern int zlog_reset_file(void);
/* Rotate log. */
extern int zlog_rotate(void);
+#define ZLOG_FILTERS_MAX 100 /* Max # of filters at once */
+#define ZLOG_FILTER_LENGTH_MAX 80 /* 80 character filter limit */
+
+/* Add/Del/Dump log filters */
+extern void zlog_filter_clear(void);
+extern int zlog_filter_add(const char *filter);
+extern int zlog_filter_del(const char *filter);
+extern int zlog_filter_dump(char *buf, size_t max_size);
+
const char *lookup_msg(const struct message *mz, int kz, const char *nf);
/* Safe version of strerror -- never returns NULL. */