From d23234b11b76c4d3f2be5f844e6dd2a93bac04fb Mon Sep 17 00:00:00 2001 From: Ana Rey Date: Tue, 2 Sep 2014 20:37:17 +0200 Subject: src: Add devgroup support in meta expresion This adds device group support in meta expresion. The new attributes of meta are "iffgroup" and "oifgroup" - iffgroup: Match device group of incoming device. - oifgroup: Match device group of outcoming device. Example of use: nft add rule ip test input meta iifgroup 2 counter nft add rule ip test output meta oifgroup 2 counter The kernel and libnftnl support were added in these commits: netfilter: nf_tables: add devgroup support in meta expresion src: meta: Add devgroup support to meta expresion Signed-off-by: Ana Rey Signed-off-by: Pablo Neira Ayuso --- src/meta.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/meta.c') diff --git a/src/meta.c b/src/meta.c index bf41ac46..cea3ccbb 100644 --- a/src/meta.c +++ b/src/meta.c @@ -396,6 +396,12 @@ static const struct meta_template meta_templates[] = { [NFT_META_CPU] = META_TEMPLATE("cpu", &integer_type, 4 * BITS_PER_BYTE, BYTEORDER_HOST_ENDIAN), + [NFT_META_IIFGROUP] = META_TEMPLATE("iifgroup", &integer_type, + 4 * BITS_PER_BYTE, + BYTEORDER_HOST_ENDIAN), + [NFT_META_OIFGROUP] = META_TEMPLATE("oifgroup", &integer_type, + 4 * BITS_PER_BYTE, + BYTEORDER_HOST_ENDIAN), }; static void meta_expr_print(const struct expr *expr) -- cgit v1.2.3