diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/meta.c | 3 | ||||
-rw-r--r-- | src/parser.y | 2 | ||||
-rw-r--r-- | src/scanner.l | 1 |
3 files changed, 6 insertions, 0 deletions
@@ -393,6 +393,9 @@ static const struct meta_template meta_templates[] = { [NFT_META_PKTTYPE] = META_TEMPLATE("pkttype", &pkttype_type, BITS_PER_BYTE, BYTEORDER_HOST_ENDIAN), + [NFT_META_CPU] = META_TEMPLATE("cpu", &integer_type, + 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 f06a2651..d7bc287f 100644 --- a/src/parser.y +++ b/src/parser.y @@ -326,6 +326,7 @@ static int monitor_lookup_event(const char *event) %token IBRIPORT "ibriport" %token OBRIPORT "obriport" %token PKTTYPE "pkttype" +%token CPU "cpu" %token CT "ct" %token DIRECTION "direction" @@ -1840,6 +1841,7 @@ meta_key_unqualified : MARK { $$ = NFT_META_MARK; } | IBRIPORT { $$ = NFT_META_BRI_IIFNAME; } | OBRIPORT { $$ = NFT_META_BRI_OIFNAME; } | PKTTYPE { $$ = NFT_META_PKTTYPE; } + | CPU { $$ = NFT_META_CPU; } ; meta_stmt : META meta_key SET expr diff --git a/src/scanner.l b/src/scanner.l index ca6db6e1..b7a00b4f 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -416,6 +416,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr}) "ibriport" { return IBRIPORT; } "obriport" { return OBRIPORT; } "pkttype" { return PKTTYPE; } +"cpu" { return CPU; } "ct" { return CT; } "direction" { return DIRECTION; } |