Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH v6 0/3] parser_json: support handle for rule positioning
@ 2026-01-20 19:53 Alexandre Knecht
  2026-01-20 19:53 ` [PATCH v6 1/3] parser_json: support handle for rule positioning in explicit JSON format Alexandre Knecht
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexandre Knecht @ 2026-01-20 19:53 UTC (permalink / raw)
  To: netfilter-devel; +Cc: phil, fw, Alexandre Knecht

This patch series enables handle-based rule positioning for JSON
add/insert commands.

Changes since v5:
- Merged nested if-conditionals, sorted expressions cheap to expensive
  (Phil feedback)
- Use Reverse Christmas Tree notation for variable declarations
  (Phil feedback)
- Test 0007: Use $DIFF to verify ruleset state after ADD operations
  instead of just checking command success (Phil feedback)

Changes since v4:
- CTX_F_EXPR_MASK now uses inverse mask (UINT32_MAX & ~(...)) as
  suggested by Phil, for future-proof expression flag filtering
- Removed nested block in json_parse_cmd(), variables declared at
  function start per project style (Phil/Florian feedback)
- Test 0007: Removed redundant insert position check (covered by 0008),
  replaced grep|grep|awk with single sed call
- Test 0008: Added test for insert without handle, added test for
  multiple commands in single transaction, fixed error message typo
- Added .json-nft dump files for both tests

All JSON tests pass. check-tree.sh shows no new errors.

Alexandre Knecht (3):
  parser_json: support handle for rule positioning in explicit JSON
    format
  tests: shell: add JSON test for all object types
  tests: shell: add JSON test for handle-based rule positioning

 src/parser_json.c                             |  36 +++-
 .../json/0007add_insert_delete_objects_0      | 163 ++++++++++++++++++
 .../testcases/json/0008rule_position_handle_0 | 162 +++++++++++++++++
 .../0007add_insert_delete_objects_0.json-nft  |  18 ++
 .../dumps/0007add_insert_delete_objects_0.nft |   2 +
 .../dumps/0008rule_position_handle_0.json-nft |  76 ++++++++
 .../json/dumps/0008rule_position_handle_0.nft |   6 +
 7 files changed, 460 insertions(+), 3 deletions(-)
 create mode 100755 tests/shell/testcases/json/0007add_insert_delete_objects_0
 create mode 100755 tests/shell/testcases/json/0008rule_position_handle_0
 create mode 100644 tests/shell/testcases/json/dumps/0007add_insert_delete_objects_0.json-nft
 create mode 100644 tests/shell/testcases/json/dumps/0007add_insert_delete_objects_0.nft
 create mode 100644 tests/shell/testcases/json/dumps/0008rule_position_handle_0.json-nft
 create mode 100644 tests/shell/testcases/json/dumps/0008rule_position_handle_0.nft

-- 
2.51.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-20 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-20 19:53 [PATCH v6 0/3] parser_json: support handle for rule positioning Alexandre Knecht
2026-01-20 19:53 ` [PATCH v6 1/3] parser_json: support handle for rule positioning in explicit JSON format Alexandre Knecht
2026-01-20 19:53 ` [PATCH v6 2/3] tests: shell: add JSON test for all object types Alexandre Knecht
2026-01-20 19:53 ` [PATCH v6 3/3] tests: shell: add JSON test for handle-based rule positioning Alexandre Knecht
2026-01-20 22:55 ` [PATCH v6 0/3] parser_json: support handle for " Phil Sutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox