From d3f143727c308ff303ea9404945e71138a7792a1 Mon Sep 17 00:00:00 2001 From: Serhey Popovych Date: Thu, 1 Mar 2018 13:03:12 +0200 Subject: xtables: Introduce and use common function to print val[/mask] arguments There are number of places where argument is in val[/mask] format printed in extensions and some of them may print corresponding symbolic name. By introducing common function for this task we eliminate custom code parts in extensions to perform printing of arguments in required formats. Use xtables_print_mark_mask() helper for extensions without symbolic name for val[/mask]. Signed-off-by: Serhey Popovych Signed-off-by: Florian Westphal --- include/xtables.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/xtables.h') diff --git a/include/xtables.h b/include/xtables.h index 47129483..304828a6 100644 --- a/include/xtables.h +++ b/include/xtables.h @@ -548,6 +548,15 @@ static inline void xtables_parse_mark_mask(struct xt_option_call *cb, xtables_parse_val_mask(cb, mark, mask, NULL); } +extern void xtables_print_val_mask(unsigned int val, unsigned int mask, + const struct xtables_lmap *lmap); + +static inline void xtables_print_mark_mask(unsigned int mark, + unsigned int mask) +{ + xtables_print_val_mask(mark, mask, NULL); +} + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) # ifdef _INIT # undef _init -- cgit v1.2.3