From: Ido Schimmel Date: Mon, 17 Feb 2025 13:41:07 +0000 (+0200) Subject: netlink: specs: Add FIB rule port mask attributes X-Git-Tag: v6.15-rc1~160^2~276^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab35ebfabb530409d608a1e53138831e346243f0;p=thirdparty%2Flinux.git netlink: specs: Add FIB rule port mask attributes Add new port mask attributes to the spec. Example: # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \ --do newrule \ --json '{"family": 2, "sport-range": { "start": 12345, "end": 12345 }, "sport-mask": 65535, "action": 1, "table": 1}' None # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \ --do newrule \ --json '{"family": 2, "dport-range": { "start": 54321, "end": 54321 }, "dport-mask": 65535, "action": 1, "table": 2}' None $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \ --dump getrule --json '{"family": 2}' --output-json | jq '.[]' [...] { "table": 2, "suppress-prefixlen": "0xffffffff", "protocol": 0, "priority": 32764, "dport-range": { "start": 54321, "end": 54321 }, "dport-mask": "0xffff", "family": 2, "dst-len": 0, "src-len": 0, "tos": 0, "action": "to-tbl", "flags": 0 } { "table": 1, "suppress-prefixlen": "0xffffffff", "protocol": 0, "priority": 32765, "sport-range": { "start": 12345, "end": 12345 }, "sport-mask": "0xffff", "family": 2, "dst-len": 0, "src-len": 0, "tos": 0, "action": "to-tbl", "flags": 0 } [...] Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Reviewed-by: Guillaume Nault Reviewed-by: David Ahern Link: https://patch.msgid.link/20250217134109.311176-7-idosch@nvidia.com Signed-off-by: Jakub Kicinski --- diff --git a/Documentation/netlink/specs/rt_rule.yaml b/Documentation/netlink/specs/rt_rule.yaml index a9debac3058a0..b30c924087fa8 100644 --- a/Documentation/netlink/specs/rt_rule.yaml +++ b/Documentation/netlink/specs/rt_rule.yaml @@ -182,6 +182,14 @@ attribute-sets: type: u32 byte-order: big-endian display-hint: hex + - + name: sport-mask + type: u16 + display-hint: hex + - + name: dport-mask + type: u16 + display-hint: hex operations: enum-model: directional @@ -215,6 +223,8 @@ operations: - dscp - flowlabel - flowlabel-mask + - sport-mask + - dport-mask - name: newrule-ntf doc: Notify a rule creation