[nft PATCH 7/9] JSON: Rename mangle statement properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of the generic "left" and "right", use "key" and "value".

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 doc/libnftables-json.adoc        | 11 +++---
 src/json.c                       | 16 ++++----
 src/parser_json.c                | 46 ++++++++++-----------
 tests/py/any/ct.t.json           | 68 ++++++++++++++++----------------
 tests/py/any/ct.t.json.output    | 24 +++++------
 tests/py/any/meta.t.json         | 36 ++++++++---------
 tests/py/any/meta.t.json.output  | 32 +++++++--------
 tests/py/arp/arp.t.json          |  4 +-
 tests/py/arp/arp.t.json.output   |  4 +-
 tests/py/bridge/ether.t.json     |  4 +-
 tests/py/inet/map.t.json         |  8 ++--
 tests/py/inet/map.t.json.output  |  8 ++--
 tests/py/inet/rt.t.json          |  4 +-
 tests/py/inet/tcpopt.t.json      |  4 +-
 tests/py/inet/udp.t.json         |  8 ++--
 tests/py/ip/hash.t.json          | 24 +++++------
 tests/py/ip/ip.t.json            | 36 ++++++++---------
 tests/py/ip/ip.t.json.output     |  4 +-
 tests/py/ip/ip_tcp.t.json        |  4 +-
 tests/py/ip/ip_tcp.t.json.output |  4 +-
 tests/py/ip/numgen.t.json        |  8 ++--
 tests/py/ip/numgen.t.json.output |  4 +-
 tests/py/ip6/ip6.t.json          | 36 ++++++++---------
 tests/py/ip6/ip6.t.json.output   |  4 +-
 tests/py/ip6/map.t.json          |  4 +-
 tests/py/ip6/map.t.json.output   |  4 +-
 26 files changed, 205 insertions(+), 204 deletions(-)

diff --git a/doc/libnftables-json.adoc b/doc/libnftables-json.adoc
index ab11d7dff92a5..309988bcf02af 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 5cd0c35e789c2..baeb0eaafdf6c 100644
--- a/src/json.c
+++ b/src/json.c
@@ -924,15 +924,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)
@@ -968,8 +968,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)
@@ -1046,8 +1046,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 8b695cecb9e6b..cf41af9bd339c 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -1426,50 +1426,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 8e3127957b00c..2fb4e7270c974 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 eb11ecc4f9217..8f0ca93c13427 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 9149b641ef6a8..00a4f237ce712 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 682ad684a1720..398583f444d3c 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 49f5c2ca22ef4..7f5c3ca254636 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 295d05fa700fe..7ee4dbfaa6668 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 136a22cac0787..d9a0066bec3eb 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 207ac3f3f0c73..1cb28e016eb4d 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 9c235e3060b0c..b0bb7ddf91d05 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 92f2dbeafe600..e81bcfd83270e 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 d4632187496c2..431ee0212c91a 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 896d20d8acd2e..5ea073d7042b0 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 febf02740ccc0..a95cf22f24ce5 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 3e4f2d8027cce..c8b2bf83d95cf 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 22b4d8c95e515..0378c00ffda77 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 453c1e4312029..15b5f386ba69a 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 15bd8e11a3045..63cdfe0bc536b 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 5318a0f539b7c..9902c2cf905ef 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 ffab43bae4536..b54121ca0f721 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 a0a3079a8a940..d6acaa3b7d357 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 2b8147216a20d..48f28b3d6e17a 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 2ddb3080d5844..78a01c6baa9c4 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 84343763b98fe..9280d55e07887 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": {
                         "&": [
-- 
2.18.0





[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux