Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing things #12

Merged
merged 6 commits into from
Jan 22, 2024
Merged

Conversation

marcinosypka
Copy link
Contributor

  • add a missing ifname SetType
  • add a missing dynamic SetFlag
  • add Elemn counter field
  • change Elem fields to be Option

The type can be found on a nftables wiki page (in section "Named sets
Specifications") https://wiki.nftables.org/wiki-nftables/index.php/Sets
The flag is documented in NFT(8) manual (Table 8, set specifications)
Since nftables 0.9.5  there is a counter per element available
E.g. for the set:
set test_set {
    typeof ip saddr
    flags interval
    elements = { 10.0.0.0/24 }
}

The json object will look like this:
 "set": {
    "family": "ip",
    "name": "snat_hv",
    "table": "nat",
    "type": "ipv4_addr",
    "handle": 4,
    "flags": [
      "interval"
    ],
    "elem": [
      {
        "elem": {
          "val": {
            "prefix": {
              "addr": "10.0.0.0",
              "len": 24
            }
          },
        }
      }
 }
 There is no timeout, expires and comments fields, they should be
 optional.
@JKRhb JKRhb requested a review from jwhb January 18, 2024 03:04
The comment field on a set is not present in documentation but it is
working and sometimes convenient to use.
src/schema.rs Show resolved Hide resolved
@jwhb jwhb merged commit 04e29d8 into namib-project:main Jan 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants