summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2014-04-14 15:41:30 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2014-04-24 10:50:49 +0200
commit275e3f55e20c82a944e3edadb26dba0fcc1f5d97 (patch)
treed284502dedeb034226aec30f11564e72efa58380 /src
parentdaf4958b54bd1a20ab022cced4d5b0566119676d (diff)
meta: Add support for input and output bridge interface name
Add support to get an input or output bridge interface name through the relevant meta keys. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/meta.c6
-rw-r--r--src/parser.y4
-rw-r--r--src/scanner.l2
3 files changed, 12 insertions, 0 deletions
diff --git a/src/meta.c b/src/meta.c
index 173040ef..80f88ffb 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -332,6 +332,12 @@ static const struct meta_template meta_templates[] = {
1 , BYTEORDER_HOST_ENDIAN),
[NFT_META_RTCLASSID] = META_TEMPLATE("rtclassid", &realm_type,
4 * 8, BYTEORDER_HOST_ENDIAN),
+ [NFT_META_BRI_IIFNAME] = META_TEMPLATE("ibriport", &string_type,
+ IFNAMSIZ * BITS_PER_BYTE,
+ BYTEORDER_HOST_ENDIAN),
+ [NFT_META_BRI_OIFNAME] = META_TEMPLATE("obriport", &string_type,
+ IFNAMSIZ * BITS_PER_BYTE,
+ BYTEORDER_HOST_ENDIAN),
};
static void meta_expr_print(const struct expr *expr)
diff --git a/src/parser.y b/src/parser.y
index de5c0edf..010cf9c3 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -304,6 +304,8 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%token SKGID "skgid"
%token NFTRACE "nftrace"
%token RTCLASSID "rtclassid"
+%token IBRIPORT "ibriport"
+%token OBRIPORT "obriport"
%token CT "ct"
%token DIRECTION "direction"
@@ -1563,6 +1565,8 @@ meta_key_unqualified : MARK { $$ = NFT_META_MARK; }
| SKGID { $$ = NFT_META_SKGID; }
| NFTRACE { $$ = NFT_META_NFTRACE; }
| RTCLASSID { $$ = NFT_META_RTCLASSID; }
+ | IBRIPORT { $$ = NFT_META_BRI_IIFNAME; }
+ | OBRIPORT { $$ = NFT_META_BRI_OIFNAME; }
;
meta_stmt : META meta_key SET expr
diff --git a/src/scanner.l b/src/scanner.l
index 47c5933c..69d6b8f8 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -402,6 +402,8 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"skgid" { return SKGID; }
"nftrace" { return NFTRACE; }
"rtclassid" { return RTCLASSID; }
+"ibriport" { return IBRIPORT; }
+"obriport" { return OBRIPORT; }
"ct" { return CT; }
"direction" { return DIRECTION; }