Commit 482da27d authored by Remy D. Farley's avatar Remy D. Farley Committed by Jakub Kicinski
Browse files

doc/netlink: nftables: Update attribute sets



New attribute sets:
- log-attrs
- numgen-attrs
- range-attrs
- compat-target-attrs
- compat-match-attrs
- compat-attrs

Added missing attributes:
- table-attrs (pad, owner)
- set-attrs (type, count)

Added missing checks:
- range-attrs
- expr-bitwise-attrs
- compat-target-attrs
- compat-match-attrs
- compat-attrs

Annotated doc comment or associated enum:
- batch-attrs
- verdict-attrs
- expr-payload-attrs

Fixed byte order:
- nft-counter-attrs
- expr-counter-attrs
- rule-compat-attrs

Reviewed-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Signed-off-by: default avatarRemy D. Farley <one-d-wide@protonmail.com>
Link: https://patch.msgid.link/20260303195638.381642-4-one-d-wide@protonmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a3a54ba4
Loading
Loading
Loading
Loading
+204 −4
Original line number Diff line number Diff line
@@ -387,16 +387,100 @@ definitions:

attribute-sets:
  -
    name: empty-attrs
    name: log-attrs
    doc: log expression netlink attributes
    attributes:
      # Mentioned in nft_log_init()
      -
        name: name
        name: group
        doc: netlink group to send messages to
        type: u16
        byte-order: big-endian
      -
        name: prefix
        doc: prefix to prepend to log messages
        type: string
      -
        name: snaplen
        doc: length of payload to include in netlink message
        type: u32
        byte-order: big-endian
      -
        name: qthreshold
        doc: queue threshold
        type: u16
        byte-order: big-endian
      -
        name: level
        doc: log level
        type: u32
        enum: log-level
        byte-order: big-endian
      -
        name: flags
        doc: logging flags
        type: u32
        enum: log-flags
        byte-order: big-endian
  -
    name: numgen-attrs
    doc: nf_tables number generator expression netlink attributes
    attributes:
      -
        name: dreg
        doc: destination register
        type: u32
        enum: registers
      -
        name: modulus
        doc: maximum counter value
        type: u32
        byte-order: big-endian
      -
        name: type
        doc: operation type
        type: u32
        byte-order: big-endian
        enum: numgen-types
      -
        name: offset
        doc: offset to be added to the counter
        type: u32
        byte-order: big-endian
  -
    name: range-attrs
    attributes:
      # Mentioned in net/netfilter/nft_range.c
      -
        name: sreg
        doc: source register of data to compare
        type: u32
        byte-order: big-endian
        enum: registers
      -
        name: op
        doc: cmp operation
        type: u32
        byte-order: big-endian
        enum: range-ops
        checks:
          max: 255
      -
        name: from-data
        doc: data range from
        type: nest
        nested-attributes: data-attrs
      -
        name: to-data
        doc: data range to
        type: nest
        nested-attributes: data-attrs
  -
    name: batch-attrs
    attributes:
      -
        name: genid
        doc: generation ID for this changeset
        type: u32
        byte-order: big-endian
  -
@@ -423,10 +507,18 @@ attribute-sets:
        type: u64
        byte-order: big-endian
        doc: numeric handle of the table
      -
        name: pad
        type: pad
      -
        name: userdata
        type: binary
        doc: user data
      -
        name: owner
        type: u32
        byte-order: big-endian
        doc: owner of this table through netlink portID
  -
    name: chain-attrs
    attributes:
@@ -530,9 +622,11 @@ attribute-sets:
      -
        name: bytes
        type: u64
        byte-order: big-endian
      -
        name: packets
        type: u64
        byte-order: big-endian
  -
    name: rule-attrs
    attributes:
@@ -602,15 +696,18 @@ attribute-sets:
        selector: name
        doc: type specific data
  -
    # Mentioned in nft_parse_compat() in net/netfilter/nft_compat.c
    name: rule-compat-attrs
    attributes:
      -
        name: proto
        type: binary
        type: u32
        byte-order: big-endian
        doc: numeric value of the handled protocol
      -
        name: flags
        type: binary
        type: u32
        byte-order: big-endian
        doc: bitmask of flags
  -
    name: set-attrs
@@ -699,6 +796,15 @@ attribute-sets:
        type: nest
        nested-attributes: set-list-attrs
        doc: list of expressions
      -
        name: type
        type: string
        doc: set backend type
      -
        name: count
        type: u32
        byte-order: big-endian
        doc: number of set elements
  -
    name: set-desc-attrs
    attributes:
@@ -968,6 +1074,8 @@ attribute-sets:
        type: u32
        byte-order: big-endian
        enum: bitwise-ops
        checks:
          max: 255
      -
        name: data
        type: nest
@@ -1004,25 +1112,31 @@ attribute-sets:
    attributes:
      -
        name: code
        doc: nf_tables verdict
        type: u32
        byte-order: big-endian
        enum: verdict-code
      -
        name: chain
        doc: jump target chain name
        type: string
      -
        name: chain-id
        doc: jump target chain ID
        type: u32
        byte-order: big-endian
  -
    name: expr-counter-attrs
    attributes:
      -
        name: bytes
        type: u64
        byte-order: big-endian
        doc: Number of bytes
      -
        name: packets
        type: u64
        byte-order: big-endian
        doc: Number of packets
      -
        name: pad
@@ -1107,6 +1221,25 @@ attribute-sets:
        type: u32
        byte-order: big-endian
        enum: lookup-flags
  -
    name: expr-masq-attrs
    attributes:
      -
        name: flags
        type: u32
        byte-order: big-endian
        enum: nat-range-flags
        enum-as-flags: true
      -
        name: reg-proto-min
        type: u32
        byte-order: big-endian
        enum: registers
      -
        name: reg-proto-max
        type: u32
        byte-order: big-endian
        enum: registers
  -
    name: expr-meta-attrs
    attributes:
@@ -1158,37 +1291,49 @@ attribute-sets:
        enum-as-flags: true
  -
    name: expr-payload-attrs
    doc: nf_tables payload expression netlink attributes
    attributes:
      -
        name: dreg
        doc: destination register to load data into
        type: u32
        byte-order: big-endian
        enum: registers
      -
        name: base
        doc: payload base
        type: u32
        enum: payload-base
        byte-order: big-endian
      -
        name: offset
        doc: payload offset relative to base
        type: u32
        byte-order: big-endian
      -
        name: len
        doc: payload length
        type: u32
        byte-order: big-endian
      -
        name: sreg
        doc: source register to load data from
        type: u32
        byte-order: big-endian
        enum: registers
      -
        name: csum-type
        doc: checksum type
        type: u32
        byte-order: big-endian
      -
        name: csum-offset
        doc: checksum offset relative to base
        type: u32
        byte-order: big-endian
      -
        name: csum-flags
        doc: checksum flags
        type: u32
        byte-order: big-endian
  -
@@ -1254,6 +1399,61 @@ attribute-sets:
        type: u32
        byte-order: big-endian
        doc: id of object map
  -
    name: compat-target-attrs
    header: linux/netfilter/nf_tables_compat.h
    attributes:
      -
        name: name
        type: string
        checks:
          max-len: 32
      -
        name: rev
        type: u32
        byte-order: big-endian
        checks:
          max: 255
      -
        name: info
        type: binary
  -
    name: compat-match-attrs
    header: linux/netfilter/nf_tables_compat.h
    attributes:
      -
        name: name
        type: string
        checks:
          max-len: 32
      -
        name: rev
        type: u32
        byte-order: big-endian
        checks:
          max: 255
      -
        name: info
        type: binary
  -
    name: compat-attrs
    header: linux/netfilter/nf_tables_compat.h
    attributes:
      -
        name: name
        type: string
        checks:
          max-len: 32
      -
        name: rev
        type: u32
        byte-order: big-endian
        checks:
          max: 255
      -
        name: type
        type: u32
        byte-order: big-endian

sub-messages:
  -