summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorEric Leblond <eric@regit.org>2013-05-30 04:22:46 +0000
committerPablo Neira Ayuso <pablo@netfilter.org>2013-05-31 13:10:55 +0200
commit1d00bb3964184531f4533870c66de33de2d689e1 (patch)
tree8a817860dddfe198be379c27b47712cc470f17da /src/rule.c
parent99fc209e6a465ccb6ea96ef81116e8d931e2261c (diff)
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 <eric@regit.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r--src/rule.c3
1 files changed, 3 insertions, 0 deletions
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 <stdio.h>
#include <stdint.h>
#include <string.h>
+#include <inttypes.h>
#include <statement.h>
#include <rule.h>
@@ -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");
}