summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVarsha Rao <rvarsha016@gmail.com>2017-07-28 10:52:09 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2017-07-31 19:18:04 +0200
commitc88c2325def5f136e8e0cacdea887d7781662f30 (patch)
treef477c895cefba10a9501092740ed68f58c43471c /src
parenta19d8b73b75e58f4b62f78f9ef36b637815a93b1 (diff)
src: nft monitor ruleset
This patch adds event reporting for ruleset, which prints only ruleset events. Syntax : nft monitor ruleset Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/evaluate.c32
-rw-r--r--src/parser_bison.y1
2 files changed, 33 insertions, 0 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index 27feef43..959e8542 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -3235,6 +3235,18 @@ static uint32_t monitor_flags[CMD_MONITOR_EVENT_MAX][CMD_MONITOR_OBJ_MAX] = {
(1 << NFT_MSG_DELSET),
[CMD_MONITOR_OBJ_ELEMS] = (1 << NFT_MSG_NEWSETELEM) |
(1 << NFT_MSG_DELSETELEM),
+ [CMD_MONITOR_OBJ_RULESET] = (1 << NFT_MSG_NEWTABLE) |
+ (1 << NFT_MSG_DELTABLE) |
+ (1 << NFT_MSG_NEWCHAIN) |
+ (1 << NFT_MSG_DELCHAIN) |
+ (1 << NFT_MSG_NEWRULE) |
+ (1 << NFT_MSG_DELRULE) |
+ (1 << NFT_MSG_NEWSET) |
+ (1 << NFT_MSG_DELSET) |
+ (1 << NFT_MSG_NEWSETELEM) |
+ (1 << NFT_MSG_DELSETELEM) |
+ (1 << NFT_MSG_NEWOBJ) |
+ (1 << NFT_MSG_DELOBJ),
},
[CMD_MONITOR_EVENT_NEW] = {
[CMD_MONITOR_OBJ_ANY] = (1 << NFT_MSG_NEWTABLE) |
@@ -3247,6 +3259,12 @@ static uint32_t monitor_flags[CMD_MONITOR_EVENT_MAX][CMD_MONITOR_OBJ_MAX] = {
[CMD_MONITOR_OBJ_RULES] = (1 << NFT_MSG_NEWRULE),
[CMD_MONITOR_OBJ_SETS] = (1 << NFT_MSG_NEWSET),
[CMD_MONITOR_OBJ_ELEMS] = (1 << NFT_MSG_NEWSETELEM),
+ [CMD_MONITOR_OBJ_RULESET] = (1 << NFT_MSG_NEWTABLE) |
+ (1 << NFT_MSG_NEWCHAIN) |
+ (1 << NFT_MSG_NEWRULE) |
+ (1 << NFT_MSG_NEWSET) |
+ (1 << NFT_MSG_NEWSETELEM) |
+ (1 << NFT_MSG_NEWOBJ)
},
[CMD_MONITOR_EVENT_DEL] = {
[CMD_MONITOR_OBJ_ANY] = (1 << NFT_MSG_DELTABLE) |
@@ -3259,6 +3277,12 @@ static uint32_t monitor_flags[CMD_MONITOR_EVENT_MAX][CMD_MONITOR_OBJ_MAX] = {
[CMD_MONITOR_OBJ_RULES] = (1 << NFT_MSG_DELRULE),
[CMD_MONITOR_OBJ_SETS] = (1 << NFT_MSG_DELSET),
[CMD_MONITOR_OBJ_ELEMS] = (1 << NFT_MSG_DELSETELEM),
+ [CMD_MONITOR_OBJ_RULESET] = (1 << NFT_MSG_DELTABLE) |
+ (1 << NFT_MSG_DELCHAIN) |
+ (1 << NFT_MSG_DELRULE) |
+ (1 << NFT_MSG_DELSET) |
+ (1 << NFT_MSG_DELSETELEM) |
+ (1 << NFT_MSG_DELOBJ),
},
[CMD_MONITOR_EVENT_TRACE] = {
[CMD_MONITOR_OBJ_ANY] = (1 << NFT_MSG_NEWTABLE) |
@@ -3274,6 +3298,14 @@ static uint32_t monitor_flags[CMD_MONITOR_EVENT_MAX][CMD_MONITOR_OBJ_MAX] = {
(1 << NFT_MSG_DELCHAIN),
[CMD_MONITOR_OBJ_RULES] = (1 << NFT_MSG_NEWRULE) |
(1 << NFT_MSG_DELRULE),
+ [CMD_MONITOR_OBJ_RULESET] = (1 << NFT_MSG_NEWTABLE) |
+ (1 << NFT_MSG_NEWCHAIN) |
+ (1 << NFT_MSG_NEWRULE) |
+ (1 << NFT_MSG_NEWOBJ) |
+ (1 << NFT_MSG_DELTABLE) |
+ (1 << NFT_MSG_DELCHAIN) |
+ (1 << NFT_MSG_DELRULE) |
+ (1 << NFT_MSG_DELOBJ),
},
};
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 45b1dc9f..86baf23a 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1195,6 +1195,7 @@ monitor_object : /* empty */ { $$ = CMD_MONITOR_OBJ_ANY; }
| SETS { $$ = CMD_MONITOR_OBJ_SETS; }
| RULES { $$ = CMD_MONITOR_OBJ_RULES; }
| ELEMENTS { $$ = CMD_MONITOR_OBJ_ELEMS; }
+ | RULESET { $$ = CMD_MONITOR_OBJ_RULESET; }
;
monitor_format : /* empty */ { $$ = NFTNL_OUTPUT_DEFAULT; }