path: root/tests/py/inet/tcp.t.json.output
Commit message (Collapse)AuthorAgeFilesLines
* tests: py: add missing test JSON output for TCP flag tests.Jeremy Sowden2020-10-121-0/+93
| | | | | | Fixes: 3926a3369bb5 ("mergesort: unbreak listing with binops") Signed-off-by: Jeremy Sowden <> Signed-off-by: Pablo Neira Ayuso <>
* tests/py: Fix JSON expected output after expr merge changePhil Sutter2019-05-091-42/+2
| | | | | | | | Looks like original patch missed this one. Fixes: 88ba0c92754d8 ("tests: fix up expected payloads after expr merge change") Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* parser_bison: Fix for ECN keyword in LHS of relationalPhil Sutter2018-10-041-0/+16
| | | | | | | | | | | | | | | | | | | | Of all possible TCP flags, 'ecn' is special since it is recognized by lex as a keyword (there is a a field in IPv4 and IPv6 headers with the same name). Therefore it is listed in keyword_expr, but that was sufficient for RHS only. The following statement reproduces the issue: | tcp flags & (syn | ecn) == (syn | ecn) The solution is to limit binop expressions to accept an RHS expression on RHS ("real" LHS expressions don't make much sense there anyway), which then allows keyword_expr to occur there. In order to maintain the recursive behaviour if braces are present, allow primary_rhs_expr to consist of a basic_rhs_expr enclosed in braces. This in turn requires for braced RHS part in relational_expr to be dropped, otherwise bison complains about shift/reduce conflict. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* JSON: Make match op mandatory, introduce 'in' operatorPhil Sutter2018-08-301-0/+7
| | | | | | | | This special operator is required for cases where missing operator does not lead to same results as equal operator, i.e. with bitmasks on RHS. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* JSON: Review payload expressionPhil Sutter2018-08-301-8/+8
| | | | | | | | | | | For raw payloads, property "name" is not needed, it's clearly identified by base/offset/len properties. In non-raw payload expressions, rename property "name" to "protocol" as suggested during NFWS. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>
* tests/py: Support testing JSON input and output as wellPhil Sutter2018-05-111-0/+134
This extends by optional JSON testing capabilities, activated via '-j'/'--enable-json' parameter). JSON testing happens for all rules which are supposed to work: After a rule has been added and the existing tests (payload, ruleset listing output) have been performed, basically the same test is done again using a recorded JSON equivalent and (if necessary) a recorded listing output. The code tries to ease new test case creation overhead by auto-generating JSON equivalent input via listing the (non-JSON) rule in JSON format. Also, differing netlink debug and listing output are stored in *.got files to assist in analyzing/fixing failing test cases. Signed-off-by: Phil Sutter <> Signed-off-by: Pablo Neira Ayuso <>