Skip to content

pause: add parsed configuration and set support - #40

Merged
cathay4t merged 4 commits into
rust-netlink:mainfrom
cathay4t:main
Oct 12, 2026
Merged

cathay4t merged 4 commits into
rust-netlink:mainfrom
cathay4t:main

Conversation

@cathay4t

Copy link
Copy Markdown
Member

By mimicing nl-wireguard design, introducing pause support:

  • handle.get_pause(iface_name: &str): query pause config of specified
    interface

  • handle.dump_pause(): dump all pause config of all interfaces.

  • handle.apply_pause(): set pause config.

Example code included.

Rename the `dump_*` examples to `query_*` and add `query_pause_conf`
and `set_pause_conf` which show the parsed configuration API. The
README follows the nl-wireguard structure and links to one example per
subsystem instead of inlining the code.

Signed-off-by: Gris Ge <cnfourt@gmail.com>
One query test per subsystem and a set test for the subsystems with
apply support (pause and channels). The loopback interface is used when
it supports the subsystem, the netdevsim tests skip when no netdevsim
device is available, and `EOPNOTSUPP`/`EPERM` make a test skip so
`cargo test` passes without `CAP_NET_ADMIN`.

Signed-off-by: Gris Ge <cnfourt@gmail.com>
Signed-off-by: Gris Ge <cnfourt@gmail.com>
By mimicing nl-wireguard design, introducing pause support:

- `handle.get_pause(iface_name: &str)`: query pause config of specified
  interface

- `handle.dump_pause()`: dump all pause config of all interfaces.

- `handle.apply_pause()`: set pause config.

Example code included.

Signed-off-by: Gris Ge <cnfourt@gmail.com>
@cathay4t
cathay4t enabled auto-merge (rebase) October 12, 2026 07:31
@cathay4t
cathay4t merged commit a60f235 into rust-netlink:main Oct 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant