summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaura Garcia Liebana <nevola@gmail.com>2018-03-02 10:50:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-02 11:47:08 +0100
commit949cc39eb93fd0fbd7ba712f468281dc349dc8cd (patch)
treeaa5fcf7dab3ddbc7927636c846b3aef275984abf /src
parent671851617c8d8c1dfe9822eee8dcc7b827fff850 (diff)
parser: support of maps with timeout
Support of key and value association with a certain timeout. Example: nft add map nftlb mapa { type inet_service: ipv4_addr\; timeout 5s\; } Results in: table ip nftlb { map mapa { type inet_service : ipv4_addr timeout 5s } } Signed-off-by: Laura Garcia Liebana <nevola@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/parser_bison.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index df672b1e..0c9e6c2b 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1462,6 +1462,11 @@ map_block_alloc : /* empty */
map_block : /* empty */ { $$ = $<set>-1; }
| map_block common_block
| map_block stmt_separator
+ | map_block TIMEOUT time_spec stmt_separator
+ {
+ $1->timeout = $3 * 1000;
+ $$ = $1;
+ }
| map_block TYPE
data_type_expr COLON data_type_expr
stmt_separator