summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/libnftables-json.adoc11
-rw-r--r--src/json.c16
-rw-r--r--src/parser_json.c46
-rw-r--r--tests/py/any/ct.t.json68
-rw-r--r--tests/py/any/ct.t.json.output24
-rw-r--r--tests/py/any/meta.t.json36
-rw-r--r--tests/py/any/meta.t.json.output32
-rw-r--r--tests/py/arp/arp.t.json4
-rw-r--r--tests/py/arp/arp.t.json.output4
-rw-r--r--tests/py/bridge/ether.t.json4
-rw-r--r--tests/py/inet/map.t.json8
-rw-r--r--tests/py/inet/map.t.json.output8
-rw-r--r--tests/py/inet/rt.t.json4
-rw-r--r--tests/py/inet/tcpopt.t.json4
-rw-r--r--tests/py/inet/udp.t.json8
-rw-r--r--tests/py/ip/hash.t.json24
-rw-r--r--tests/py/ip/ip.t.json36
-rw-r--r--tests/py/ip/ip.t.json.output4
-rw-r--r--tests/py/ip/ip_tcp.t.json4
-rw-r--r--tests/py/ip/ip_tcp.t.json.output4
-rw-r--r--tests/py/ip/numgen.t.json8
-rw-r--r--tests/py/ip/numgen.t.json.output4
-rw-r--r--tests/py/ip6/ip6.t.json36
-rw-r--r--tests/py/ip6/ip6.t.json.output4
-rw-r--r--tests/py/ip6/map.t.json4
-rw-r--r--tests/py/ip6/map.t.json.output4
26 files changed, 205 insertions, 204 deletions
diff --git a/doc/libnftables-json.adoc b/doc/libnftables-json.adoc
index ab11d7df..309988bc 100644
--- a/doc/libnftables-json.adoc
+++ b/doc/libnftables-json.adoc
@@ -618,15 +618,16 @@ in. The second form specifies a reference to a named counter object.
=== MANGLE
[verse]
*{ "mangle": {
- "left":* 'EXPRESSION'*,
- "right":* 'EXPRESSION'
+ "key":* 'EXPRESSION'*,
+ "value":* 'EXPRESSION'
*}}*
Change packet data or meta info.
-*left*::
- Packet data to be changed.
-*right*::
+*key*::
+ Packet data to be changed, given as *exthdr*, *payload*, *meta*, *ct* or
+ *ct helper* expression.
+*value*::
Value to change data to.
=== QUOTA
diff --git a/src/json.c b/src/json.c
index 1b596897..4af8ee8e 100644
--- a/src/json.c
+++ b/src/json.c
@@ -929,15 +929,15 @@ json_t *expr_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
json_t *payload_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
{
return json_pack("{s: {s:o, s:o}}", "mangle",
- "left", expr_print_json(stmt->payload.expr, octx),
- "right", expr_print_json(stmt->payload.val, octx));
+ "key", expr_print_json(stmt->payload.expr, octx),
+ "value", expr_print_json(stmt->payload.val, octx));
}
json_t *exthdr_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
{
return json_pack("{s: {s:o, s:o}}", "mangle",
- "left", expr_print_json(stmt->exthdr.expr, octx),
- "right", expr_print_json(stmt->exthdr.val, octx));
+ "key", expr_print_json(stmt->exthdr.expr, octx),
+ "value", expr_print_json(stmt->exthdr.val, octx));
}
json_t *quota_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
@@ -973,8 +973,8 @@ json_t *ct_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
};
return json_pack("{s:{s:o, s:o}}", "mangle",
- "left", ct_expr_json(&expr, octx),
- "right", expr_print_json(stmt->ct.expr, octx));
+ "key", ct_expr_json(&expr, octx),
+ "value", expr_print_json(stmt->ct.expr, octx));
}
json_t *limit_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
@@ -1051,8 +1051,8 @@ json_t *meta_stmt_json(const struct stmt *stmt, struct output_ctx *octx)
root = json_pack("{s:{s:s}}", "meta",
"key", meta_templates[stmt->meta.key].token);
root = json_pack("{s:o, s:o}",
- "left", root,
- "right", expr_print_json(stmt->meta.expr, octx));
+ "key", root,
+ "value", expr_print_json(stmt->meta.expr, octx));
return json_pack("{s:o}", "mangle", root);
}
diff --git a/src/parser_json.c b/src/parser_json.c
index 1bb4f1f1..2f7e0a3e 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -1441,50 +1441,50 @@ static struct stmt *json_parse_verdict_stmt(struct json_ctx *ctx,
}
static struct stmt *json_parse_mangle_stmt(struct json_ctx *ctx,
- const char *key, json_t *value)
+ const char *type, json_t *root)
{
- json_t *jleft, *jright;
- struct expr *left, *right;
+ json_t *jkey, *jvalue;
+ struct expr *key, *value;
struct stmt *stmt;
- if (json_unpack_err(ctx, value, "{s:o, s:o}",
- "left", &jleft, "right", &jright))
+ if (json_unpack_err(ctx, root, "{s:o, s:o}",
+ "key", &jkey, "value", &jvalue))
return NULL;
- left = json_parse_mangle_lhs_expr(ctx, jleft);
- if (!left) {
- json_error(ctx, "Invalid LHS of mangle statement");
+ key = json_parse_mangle_lhs_expr(ctx, jkey);
+ if (!key) {
+ json_error(ctx, "Invalid mangle statement key");
return NULL;
}
- right = json_parse_stmt_expr(ctx, jright);
- if (!right) {
- json_error(ctx, "Invalid RHS of mangle statement");
- expr_free(left);
+ value = json_parse_stmt_expr(ctx, jvalue);
+ if (!value) {
+ json_error(ctx, "Invalid mangle statement value");
+ expr_free(key);
return NULL;
}
- switch (left->ops->type) {
+ switch (key->ops->type) {
case EXPR_EXTHDR:
- return exthdr_stmt_alloc(int_loc, left, right);
+ return exthdr_stmt_alloc(int_loc, key, value);
case EXPR_PAYLOAD:
- return payload_stmt_alloc(int_loc, left, right);
+ return payload_stmt_alloc(int_loc, key, value);
case EXPR_META:
- stmt = meta_stmt_alloc(int_loc, left->meta.key, right);
- expr_free(left);
+ stmt = meta_stmt_alloc(int_loc, key->meta.key, value);
+ expr_free(key);
return stmt;
case EXPR_CT:
- if (left->ct.key == NFT_CT_HELPER) {
+ if (key->ct.key == NFT_CT_HELPER) {
stmt = objref_stmt_alloc(int_loc);
stmt->objref.type = NFT_OBJECT_CT_HELPER;
- stmt->objref.expr = right;
+ stmt->objref.expr = value;
} else {
- stmt = ct_stmt_alloc(int_loc, left->ct.key,
- left->ct.direction, right);
+ stmt = ct_stmt_alloc(int_loc, key->ct.key,
+ key->ct.direction, value);
}
- expr_free(left);
+ expr_free(key);
return stmt;
default:
- json_error(ctx, "Invalid LHS expression type for mangle statement.");
+ json_error(ctx, "Invalid mangle statement key expression type.");
return NULL;
}
}
diff --git a/tests/py/any/ct.t.json b/tests/py/any/ct.t.json
index 8e312795..2fb4e727 100644
--- a/tests/py/any/ct.t.json
+++ b/tests/py/any/ct.t.json
@@ -613,12 +613,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": { "^": [ "0x11", "0x1331" ] }
+ "value": { "^": [ "0x11", "0x1331" ] }
}
}
]
@@ -627,12 +627,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": { "&": [ "0x11333", "0x11" ] }
+ "value": { "&": [ "0x11333", "0x11" ] }
}
}
]
@@ -641,12 +641,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": { "|": [ "0x12", "0x11" ] }
+ "value": { "|": [ "0x12", "0x11" ] }
}
}
]
@@ -655,12 +655,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": "0x11"
+ "value": "0x11"
}
}
]
@@ -669,12 +669,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"meta": { "key": "mark" }
}
}
@@ -685,12 +685,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"map": {
"key": {
"meta": { "key": "mark" }
@@ -1125,12 +1125,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": "new"
+ "value": "new"
}
}
]
@@ -1139,12 +1139,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": [
+ "value": [
"new",
"related",
"destroy",
@@ -1158,12 +1158,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": [
+ "value": [
"new",
"related",
"destroy",
@@ -1177,12 +1177,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": [
+ "value": [
"new",
"destroy"
]
@@ -1194,12 +1194,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1208,12 +1208,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": "0x0"
+ "value": "0x0"
}
}
]
@@ -1236,12 +1236,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "label"
}
},
- "right": 127
+ "value": 127
}
}
]
@@ -1308,12 +1308,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "zone"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1322,13 +1322,13 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"dir": "original",
"key": "zone"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1337,13 +1337,13 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"dir": "reply",
"key": "zone"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1352,12 +1352,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "zone"
}
},
- "right": {
+ "value": {
"map": {
"key": {
"meta": { "key": "mark" }
diff --git a/tests/py/any/ct.t.json.output b/tests/py/any/ct.t.json.output
index eb11ecc4..8f0ca93c 100644
--- a/tests/py/any/ct.t.json.output
+++ b/tests/py/any/ct.t.json.output
@@ -348,12 +348,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": 4896
+ "value": 4896
}
}
]
@@ -362,12 +362,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": 17
+ "value": 17
}
}
]
@@ -376,12 +376,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": 19
+ "value": 19
}
}
]
@@ -390,12 +390,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": 17
+ "value": 17
}
}
]
@@ -608,12 +608,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": "new"
+ "value": "new"
}
}
]
@@ -622,12 +622,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "event"
}
},
- "right": 0
+ "value": 0
}
}
]
diff --git a/tests/py/any/meta.t.json b/tests/py/any/meta.t.json
index 9149b641..00a4f237 100644
--- a/tests/py/any/meta.t.json
+++ b/tests/py/any/meta.t.json
@@ -521,10 +521,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "priority" }
},
- "right": "cafe:beef"
+ "value": "cafe:beef"
}
}
]
@@ -1502,10 +1502,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "^": [ "0xffffffc8", "0x16" ] }
+ "value": { "^": [ "0xffffffc8", "0x16" ] }
}
}
]
@@ -1514,10 +1514,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "&": [ "0x16", "0x16" ] }
+ "value": { "&": [ "0x16", "0x16" ] }
}
}
]
@@ -1526,10 +1526,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "|": [ "0xffffffe9", "0x16" ] }
+ "value": { "|": [ "0xffffffe9", "0x16" ] }
}
}
]
@@ -1538,10 +1538,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "&": [ "0xffffffde", "0x16" ] }
+ "value": { "&": [ "0xffffffde", "0x16" ] }
}
}
]
@@ -1550,10 +1550,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "|": [ "0xf045ffde", "0x10" ] }
+ "value": { "|": [ "0xf045ffde", "0x10" ] }
}
}
]
@@ -1562,10 +1562,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "|": [ "0xffffffde", "0x16" ] }
+ "value": { "|": [ "0xffffffde", "0x16" ] }
}
}
]
@@ -1574,10 +1574,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "|": [ "0x32", "0xfffff" ] }
+ "value": { "|": [ "0x32", "0xfffff" ] }
}
}
]
@@ -1586,10 +1586,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": { "^": [ "0xfffe", "0x16" ] }
+ "value": { "^": [ "0xfffe", "0x16" ] }
}
}
]
diff --git a/tests/py/any/meta.t.json.output b/tests/py/any/meta.t.json.output
index 682ad684..398583f4 100644
--- a/tests/py/any/meta.t.json.output
+++ b/tests/py/any/meta.t.json.output
@@ -401,10 +401,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 4294967262
+ "value": 4294967262
}
}
]
@@ -413,10 +413,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 22
+ "value": 22
}
}
]
@@ -425,10 +425,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 4294967295
+ "value": 4294967295
}
}
]
@@ -437,10 +437,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 22
+ "value": 22
}
}
]
@@ -449,10 +449,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 4031119326
+ "value": 4031119326
}
}
]
@@ -461,10 +461,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 4294967262
+ "value": 4294967262
}
}
]
@@ -473,10 +473,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 1048575
+ "value": 1048575
}
}
]
@@ -485,10 +485,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 65512
+ "value": 65512
}
}
]
diff --git a/tests/py/arp/arp.t.json b/tests/py/arp/arp.t.json
index 49f5c2ca..7f5c3ca2 100644
--- a/tests/py/arp/arp.t.json
+++ b/tests/py/arp/arp.t.json
@@ -861,14 +861,14 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"base": "nh",
"len": 48,
"offset": 144
}
},
- "right": "0x112233445566"
+ "value": "0x112233445566"
}
}
]
diff --git a/tests/py/arp/arp.t.json.output b/tests/py/arp/arp.t.json.output
index 295d05fa..7ee4dbfa 100644
--- a/tests/py/arp/arp.t.json.output
+++ b/tests/py/arp/arp.t.json.output
@@ -132,14 +132,14 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"base": "nh",
"len": 48,
"offset": 144
}
},
- "right": 18838586676582
+ "value": 18838586676582
}
}
]
diff --git a/tests/py/bridge/ether.t.json b/tests/py/bridge/ether.t.json
index 136a22ca..d9a0066b 100644
--- a/tests/py/bridge/ether.t.json
+++ b/tests/py/bridge/ether.t.json
@@ -164,13 +164,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "saddr",
"protocol": "ether"
}
},
- "right": "ff:fe:dc:ba:98:76"
+ "value": "ff:fe:dc:ba:98:76"
}
},
{
diff --git a/tests/py/inet/map.t.json b/tests/py/inet/map.t.json
index 207ac3f3..1cb28e01 100644
--- a/tests/py/inet/map.t.json
+++ b/tests/py/inet/map.t.json
@@ -2,10 +2,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"payload": {
@@ -35,10 +35,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"payload": {
diff --git a/tests/py/inet/map.t.json.output b/tests/py/inet/map.t.json.output
index 9c235e30..b0bb7ddf 100644
--- a/tests/py/inet/map.t.json.output
+++ b/tests/py/inet/map.t.json.output
@@ -2,10 +2,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"payload": {
@@ -35,10 +35,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"payload": {
diff --git a/tests/py/inet/rt.t.json b/tests/py/inet/rt.t.json
index 92f2dbea..e81bcfd8 100644
--- a/tests/py/inet/rt.t.json
+++ b/tests/py/inet/rt.t.json
@@ -39,13 +39,13 @@
[
{
"mangle": {
- "left": {
+ "key": {
"tcp option": {
"field": "size",
"name": "maxseg"
}
},
- "right": {
+ "value": {
"rt": {
"key": "mtu"
}
diff --git a/tests/py/inet/tcpopt.t.json b/tests/py/inet/tcpopt.t.json
index d4632187..431ee021 100644
--- a/tests/py/inet/tcpopt.t.json
+++ b/tests/py/inet/tcpopt.t.json
@@ -405,13 +405,13 @@
[
{
"mangle": {
- "left": {
+ "key": {
"tcp option": {
"field": "size",
"name": "maxseg"
}
},
- "right": 1360
+ "value": 1360
}
}
]
diff --git a/tests/py/inet/udp.t.json b/tests/py/inet/udp.t.json
index 896d20d8..5ea073d7 100644
--- a/tests/py/inet/udp.t.json
+++ b/tests/py/inet/udp.t.json
@@ -694,13 +694,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "checksum",
"protocol": "udp"
}
},
- "right": 0
+ "value": 0
}
}
]
@@ -717,13 +717,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "dport",
"protocol": "udp"
}
},
- "right": 65535
+ "value": 65535
}
}
]
diff --git a/tests/py/ip/hash.t.json b/tests/py/ip/hash.t.json
index febf0274..a95cf22f 100644
--- a/tests/py/ip/hash.t.json
+++ b/tests/py/ip/hash.t.json
@@ -2,12 +2,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"jhash": {
"expr": {
"concat": [
@@ -37,12 +37,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"jhash": {
"expr": {
"concat": [
@@ -71,12 +71,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"jhash": {
"expr": {
"concat": [
@@ -106,12 +106,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"jhash": {
"expr": {
"concat": [
@@ -142,12 +142,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"jhash": {
"expr": {
"concat": [
@@ -213,12 +213,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"symhash": {
"mod": 2,
"offset": 100
diff --git a/tests/py/ip/ip.t.json b/tests/py/ip/ip.t.json
index 3e4f2d80..c8b2bf83 100644
--- a/tests/py/ip/ip.t.json
+++ b/tests/py/ip/ip.t.json
@@ -1584,13 +1584,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "daddr",
"protocol": "ip"
}
},
- "right": "127.0.0.1"
+ "value": "127.0.0.1"
}
}
]
@@ -1607,13 +1607,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "checksum",
"protocol": "ip"
}
},
- "right": 0
+ "value": 0
}
}
]
@@ -1630,13 +1630,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "id",
"protocol": "ip"
}
},
- "right": 0
+ "value": 0
}
}
]
@@ -1653,13 +1653,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ecn",
"protocol": "ip"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1676,13 +1676,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ecn",
"protocol": "ip"
}
},
- "right": "ce"
+ "value": "ce"
}
}
]
@@ -1699,13 +1699,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ttl",
"protocol": "ip"
}
},
- "right": 23
+ "value": 23
}
}
]
@@ -1722,13 +1722,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "protocol",
"protocol": "ip"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1745,13 +1745,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "dscp",
"protocol": "ip"
}
},
- "right": "af23"
+ "value": "af23"
}
}
]
@@ -1768,13 +1768,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "dscp",
"protocol": "ip"
}
},
- "right": "cs0"
+ "value": "cs0"
}
}
]
diff --git a/tests/py/ip/ip.t.json.output b/tests/py/ip/ip.t.json.output
index 22b4d8c9..0378c00f 100644
--- a/tests/py/ip/ip.t.json.output
+++ b/tests/py/ip/ip.t.json.output
@@ -213,13 +213,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ecn",
"protocol": "ip"
}
},
- "right": "ect1"
+ "value": "ect1"
}
}
]
diff --git a/tests/py/ip/ip_tcp.t.json b/tests/py/ip/ip_tcp.t.json
index 453c1e43..15b5f386 100644
--- a/tests/py/ip/ip_tcp.t.json
+++ b/tests/py/ip/ip_tcp.t.json
@@ -39,10 +39,10 @@
},
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 1
+ "value": 1
}
},
{
diff --git a/tests/py/ip/ip_tcp.t.json.output b/tests/py/ip/ip_tcp.t.json.output
index 15bd8e11..63cdfe0b 100644
--- a/tests/py/ip/ip_tcp.t.json.output
+++ b/tests/py/ip/ip_tcp.t.json.output
@@ -28,10 +28,10 @@
},
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": 1
+ "value": 1
}
},
{
diff --git a/tests/py/ip/numgen.t.json b/tests/py/ip/numgen.t.json
index 5318a0f5..9902c2cf 100644
--- a/tests/py/ip/numgen.t.json
+++ b/tests/py/ip/numgen.t.json
@@ -2,12 +2,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"numgen": {
"mod": 2,
"mode": "inc"
@@ -21,12 +21,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"numgen": {
"mod": 2,
"mode": "inc",
diff --git a/tests/py/ip/numgen.t.json.output b/tests/py/ip/numgen.t.json.output
index ffab43ba..b54121ca 100644
--- a/tests/py/ip/numgen.t.json.output
+++ b/tests/py/ip/numgen.t.json.output
@@ -2,12 +2,12 @@
[
{
"mangle": {
- "left": {
+ "key": {
"ct": {
"key": "mark"
}
},
- "right": {
+ "value": {
"numgen": {
"mod": 2,
"mode": "inc",
diff --git a/tests/py/ip6/ip6.t.json b/tests/py/ip6/ip6.t.json
index a0a3079a..d6acaa3b 100644
--- a/tests/py/ip6/ip6.t.json
+++ b/tests/py/ip6/ip6.t.json
@@ -1416,13 +1416,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "daddr",
"protocol": "ip6"
}
},
- "right": "::1"
+ "value": "::1"
}
}
]
@@ -1439,13 +1439,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "hoplimit",
"protocol": "ip6"
}
},
- "right": 1
+ "value": 1
}
}
]
@@ -1462,13 +1462,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "dscp",
"protocol": "ip6"
}
},
- "right": "af42"
+ "value": "af42"
}
}
]
@@ -1485,13 +1485,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "dscp",
"protocol": "ip6"
}
},
- "right": 63
+ "value": 63
}
}
]
@@ -1508,13 +1508,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ecn",
"protocol": "ip6"
}
},
- "right": "ect0"
+ "value": "ect0"
}
}
]
@@ -1531,13 +1531,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "ecn",
"protocol": "ip6"
}
},
- "right": "ce"
+ "value": "ce"
}
}
]
@@ -1554,13 +1554,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "flowlabel",
"protocol": "ip6"
}
},
- "right": 0
+ "value": 0
}
}
]
@@ -1577,13 +1577,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "flowlabel",
"protocol": "ip6"
}
},
- "right": 12345
+ "value": 12345
}
}
]
@@ -1600,13 +1600,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "flowlabel",
"protocol": "ip6"
}
},
- "right": "0xfffff"
+ "value": "0xfffff"
}
}
]
diff --git a/tests/py/ip6/ip6.t.json.output b/tests/py/ip6/ip6.t.json.output
index 2b814721..48f28b3d 100644
--- a/tests/py/ip6/ip6.t.json.output
+++ b/tests/py/ip6/ip6.t.json.output
@@ -348,13 +348,13 @@
},
{
"mangle": {
- "left": {
+ "key": {
"payload": {
"field": "flowlabel",
"protocol": "ip6"
}
},
- "right": 1048575
+ "value": 1048575
}
}
]
diff --git a/tests/py/ip6/map.t.json b/tests/py/ip6/map.t.json
index 2ddb3080..78a01c6b 100644
--- a/tests/py/ip6/map.t.json
+++ b/tests/py/ip6/map.t.json
@@ -2,10 +2,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"&": [
diff --git a/tests/py/ip6/map.t.json.output b/tests/py/ip6/map.t.json.output
index 84343763..9280d55e 100644
--- a/tests/py/ip6/map.t.json.output
+++ b/tests/py/ip6/map.t.json.output
@@ -2,10 +2,10 @@
[
{
"mangle": {
- "left": {
+ "key": {
"meta": { "key": "mark" }
},
- "right": {
+ "value": {
"map": {
"key": {
"&": [