summaryrefslogtreecommitdiffstats
path: root/include/xtables.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2012-10-29 10:49:42 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2013-01-04 20:29:39 +0100
commit2f655ede64e07a861e3ec50150f572ed98755013 (patch)
tree5a6ce8171c678450d77af249a1ba99acb865bc64 /include/xtables.h
parentd1e7922a587a239e16e0dbe654e63f76e1375e49 (diff)
libxtables: add xtables_print_num
This function is used both by iptables and ip6tables, and refactorize to avoid longer than 80-chars per column lines of code. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/xtables.h')
-rw-r--r--include/xtables.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/xtables.h b/include/xtables.h
index add76ae5..75de958e 100644
--- a/include/xtables.h
+++ b/include/xtables.h
@@ -469,6 +469,22 @@ extern void xtables_ip6parse_multiple(const char *, struct in6_addr **,
*/
extern void xtables_save_string(const char *value);
+#define FMT_NUMERIC 0x0001
+#define FMT_NOCOUNTS 0x0002
+#define FMT_KILOMEGAGIGA 0x0004
+#define FMT_OPTIONS 0x0008
+#define FMT_NOTABLE 0x0010
+#define FMT_NOTARGET 0x0020
+#define FMT_VIA 0x0040
+#define FMT_NONEWLINE 0x0080
+#define FMT_LINENUMBERS 0x0100
+
+#define FMT_PRINT_RULE (FMT_NOCOUNTS | FMT_OPTIONS | FMT_VIA \
+ | FMT_NUMERIC | FMT_NOTABLE)
+#define FMT(tab,notab) ((format) & FMT_NOTABLE ? (notab) : (tab))
+
+extern void xtables_print_num(uint64_t number, unsigned int format);
+
#if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS)
# ifdef _INIT
# undef _init