@@ -25,13 +25,13 @@ table filter {
type ifindex
}
- # named map of type ifindex => ipv4_address
+ # named map of type ifindex : ipv4_address
map nat_map {
- type ifindex => ipv4_address
+ type ifindex : ipv4_address
}
map jump_map {
- type ifindex => verdict
+ type ifindex : verdict
}
chain input_1 { counter; }
@@ -48,6 +48,6 @@ table filter {
meta iif @local_ifs counter
meta iif vmap @jump_map
- #meta iif vmap { eth0 => jump input1, eth1 => jump input2 }
+ #meta iif vmap { eth0 : jump input1, eth1 : jump input2 }
}
}
@@ -27,7 +27,7 @@
* @EXPR_LIST: list of expressions
* @EXPR_SET: literal set
* @EXPR_SET_REF: set reference
- * @EXPR_MAPPING: a single mapping (key => value)
+ * @EXPR_MAPPING: a single mapping (key : value)
* @EXPR_MAP: map operation (expr map { EXPR_MAPPING, ... })
* @EXPR_UNARY: byteorder conversion, generated during evaluation
* @EXPR_BINOP: binary operations (bitwise, shifts)
@@ -644,7 +644,7 @@ struct expr *set_expr_alloc(const struct location *loc)
static void mapping_expr_print(const struct expr *expr)
{
expr_print(expr->left);
- printf(" => ");
+ printf(" : ");
expr_print(expr->right);
}
@@ -150,7 +150,6 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%token ASTERISK "*"
%token DASH "-"
%token AT "@"
-%token ARROW "=>"
%token VMAP "vmap"
%token INCLUDE "include"
@@ -751,7 +750,7 @@ map_block : /* empty */ { $$ = $<set>-1; }
| map_block common_block
| map_block stmt_seperator
| map_block TYPE
- identifier ARROW identifier
+ identifier COLON identifier
stmt_seperator
{
$1->keytype = datatype_lookup_byname($3);
@@ -1243,11 +1242,11 @@ set_list_member_expr : opt_newline expr opt_newline
{
$$ = $2;
}
- | opt_newline map_lhs_expr ARROW concat_expr opt_newline
+ | opt_newline map_lhs_expr COLON concat_expr opt_newline
{
$$ = mapping_expr_alloc(&@$, $2, $4);
}
- | opt_newline map_lhs_expr ARROW verdict_expr opt_newline
+ | opt_newline map_lhs_expr COLON verdict_expr opt_newline
{
$$ = mapping_expr_alloc(&@$, $2, $4);
}
@@ -96,7 +96,7 @@ void set_print(const struct set *set)
printf("\t\ttype %s", set->keytype->name);
if (set->flags & SET_F_MAP)
- printf(" => %s", set->datatype->name);
+ printf(" : %s", set->datatype->name);
printf("\n");
if (set->flags & SET_F_ANONYMOUS)
@@ -221,7 +221,6 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"@" { return AT; }
"$" { return '$'; }
"=" { return '='; }
-"=>" { return ARROW; }
"vmap" { return VMAP; }
"include" { return INCLUDE; }
@@ -21,32 +21,32 @@ add rule ip filter OUTPUT tcp dport { \
192.168.0.1, \
}
-# must succeed: expr { expr => verdict, ... }
+# must succeed: expr { expr : verdict, ... }
add rule ip filter OUTPUT tcp dport vmap { \
- 22 => jump chain1, \
- 23 => jump chain2, \
+ 22 : jump chain1, \
+ 23 : jump chain2, \
}
-# must fail: expr { expr => verdict, expr => expr, ... }
+# must fail: expr { expr : verdict, expr : expr, ... }
add rule ip filter OUTPUT tcp dport vmap { \
- 22 => jump chain1, \
- 23 => 0x100, \
+ 22 : jump chain1, \
+ 23 : 0x100, \
}
-# must fail: expr { expr => expr, ...}
+# must fail: expr { expr : expr, ...}
add rule ip filter OUTPUT tcp dport vmap { \
- 22 => 0x100, \
- 23 => 0x200, \
+ 22 : 0x100, \
+ 23 : 0x200, \
}
-# must succeed: expr MAP { expr => expr, ... } expr
+# must succeed: expr MAP { expr : expr, ... } expr
add rule ip filter OUTPUT meta mark set tcp dport map { \
- 22 => 1, \
- 23 => 2, \
+ 22 : 1, \
+ 23 : 2, \
}
-# must fail: expr MAP { expr => type1, expr => type2, .. } expr
+# must fail: expr MAP { expr : type1, expr : type2, .. } expr
add rule ip filter OUTPUT meta mark set tcp dport map { \
- 22 => 1, \
- 23 => 192.168.0.1, \
+ 22 : 1, \
+ 23 : 192.168.0.1, \
}
@@ -4,4 +4,4 @@
flush table filter
add filter chain1 jump chain2
add filter chain2 jump chain3
-add filter chain3 ip daddr vmap { 10.0.0.1 => continue, 192.168.0.1 => jump chain1 }
+add filter chain3 ip daddr vmap { 10.0.0.1 : continue, 192.168.0.1 : jump chain1 }
@@ -3,5 +3,5 @@
# Circular jump with an intermediate anonymous verdict map: chain1 -> chain2 -> chain3 -> chain1
flush table filter
add filter chain1 jump chain2
-add filter chain2 ip daddr vmap { 10.0.0.1 => continue, 192.168.0.1 => jump chain3 }
+add filter chain2 ip daddr vmap { 10.0.0.1 : continue, 192.168.0.1 : jump chain3 }
add filter chain3 jump chain1
@@ -14,7 +14,7 @@ add chain ip filter chain3
add filter chain3 counter
add filter input ip saddr vmap { \
- 10.0.0.0/24 => jump chain1, \
- 10.0.0.0/8 => jump chain2, \
- 8.8.8.8 => jump chain3 \
+ 10.0.0.0/24 : jump chain1, \
+ 10.0.0.0/8 : jump chain2, \
+ 8.8.8.8 : jump chain3 \
}