From 1d00bb3964184531f4533870c66de33de2d689e1 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 30 May 2013 04:22:46 +0000 Subject: rule: add flag to display rule handle as comment Knowing the rule handle is necessary to be able to delete a single rule. It was not displayed till now in the output and it was thus impossible to remove a single rule. This patch modify the listing output to add a comment containing the handle when the -a/--handle flag is provided. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 9d9eaee3..e77323d8 100644 --- a/src/rule.c +++ b/src/rule.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -136,6 +137,8 @@ void rule_print(const struct rule *rule) printf(" "); stmt->ops->print(stmt); } + if (handle_output > 0) + printf(" # handle %" PRIu64, rule->handle.handle); printf("\n"); } -- cgit v1.2.3