Skip to content

Commit a8f1791

Browse files
committed
Init
Signed-off-by: Gris Ge <fge@redhat.com>
0 parents  commit a8f1791

19 files changed

Lines changed: 865 additions & 0 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Rustfmt and clippy check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
rustfmt_clippy:
12+
strategy:
13+
fail-fast: true
14+
15+
name: Rustfmt and clippy check
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Install Rust Nightly
22+
run: |
23+
rustup override set nightly
24+
rustup update nightly
25+
rustup component add rustfmt clippy
26+
27+
- name: rustfmt
28+
run: cargo fmt --all -- --check
29+
30+
- name: clippy-tokio-socket
31+
run: cargo clippy -- -D warnings
32+
33+
- name: clippy-smol-socket
34+
run: >
35+
cargo clippy --no-default-features
36+
--features smol_socket -- -D warnings

.github/workflows/license.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: license
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
check-license:
12+
name: Check License
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 3
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Check License Header
19+
uses: apache/skywalking-eyes@v0.3.0

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
ci:
12+
name: CI (stable)
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Install Rust Stable
19+
run: |
20+
rustup override set stable
21+
rustup update stable
22+
23+
- name: Test with default feature
24+
run: cargo test
25+
26+
- name: Test with tokio feature
27+
run: cargo test --features tokio_socket
28+
29+
- name: Test with smol_socket feature
30+
run: cargo test --features smol_socket

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Cargo.lock
2+
target
3+
vendor/
4+
tag
5+
*.swp

.licenserc.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
header:
2+
license:
3+
content: |
4+
SPDX-License-Identifier: MIT
5+
paths-ignore:
6+
- 'target'
7+
- '**/*.toml'
8+
- '**/*.lock'
9+
- '**/*.yml'
10+
- '**/*.md'
11+
- 'CHANGELOG'
12+
- 'LICENSE-MIT'
13+
- '.gitignore'
14+
15+
comment: on-failure

.rustfmt.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
edition = "2021"
2+
max_width = 80
3+
wrap_comments = true
4+
reorder_imports = true
5+
format_strings = true
6+
group_imports = "StdExternalCrate"
7+
imports_granularity = "Crate"

CHANGELOG

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Changelog
2+
## [0.2.9] - 2025-08-28
3+
### Breaking changes
4+
- N/A
5+
6+
### New features
7+
- Support channel get/set. (c64872a)
8+
9+
### Bug fixes
10+
- Use latest rust-netlink crates. (39a1702)
11+
12+
## [0.2.8] - 2025-03-11
13+
### Breaking changes
14+
- N/A
15+
16+
### New features
17+
- N/A
18+
19+
### Bug fixes
20+
- Remove debug print. (945fc73)
21+
22+
## [0.2.7] - 2025-03-11
23+
### Breaking changes
24+
- N/A
25+
26+
### New features
27+
- N/A
28+
29+
### Bug fixes
30+
- Expose `EthtoolFecMode` and `EthtoolFecStat`. (6daba73)
31+
32+
## [0.2.6] - 2025-03-10
33+
### Breaking changes
34+
- N/A
35+
36+
### New features
37+
- Support FEC query. (c71ed0e)
38+
39+
### Bug fixes
40+
- N/A
41+
42+
## [0.2.5] - 2023-07-10
43+
### Breaking changes
44+
- N/A
45+
46+
### New features
47+
- Support time stamp (`ethtool --show-time-stamping`). (b753d74)
48+
49+
### Bug fixes
50+
- Use latest rust-netlink crates. (615b168)
51+
52+
## [0.2.4] - 2023-01-29
53+
### Breaking changes
54+
- N/A
55+
56+
### New features
57+
- N/A
58+
59+
### Bug fixes
60+
- Use latest rust-netlink crates. (151f217)

Cargo.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[package]
2+
name = "nl-wireguard"
3+
version = "0.2.9"
4+
authors = ["Gris Ge <fge@redhat.com>"]
5+
license = "MIT"
6+
edition = "2021"
7+
description = "Linux netlink library for wireguard management"
8+
keywords = ["network"]
9+
categories = ["network-programming", "os"]
10+
readme = "README.md"
11+
12+
[lib]
13+
name = "nl_wireguard"
14+
path = "src/lib.rs"
15+
crate-type = ["lib"]
16+
17+
[features]
18+
default = ["tokio_socket"]
19+
tokio_socket = ["netlink-proto/tokio_socket", "tokio"]
20+
smol_socket = ["netlink-proto/smol_socket", "async-std"]
21+
22+
[dependencies]
23+
async-std = { version = "1.13.0", optional = true}
24+
futures-util = "0.3.11"
25+
futures-channel = "0.3.11"
26+
log = "0.4.26"
27+
genetlink = { default-features = false, version = "0.2.6"}
28+
netlink-packet-core = { version = "0.8.0"}
29+
netlink-packet-generic = { version = "0.4.0" }
30+
netlink-packet-wireguard = { version = "0.3.0" }
31+
netlink-proto = { default-features = false, version = "0.12.0" }
32+
netlink-sys = { version = "0.8.7" }
33+
tokio = { version = "1.44.0", features = ["rt"], optional = true}
34+
35+
[dev-dependencies]
36+
base64 = "0.13.0"
37+
futures-util = "0.3.11"
38+
env_logger = "0.10.0"
39+
tokio = { version = "1.9.0", features = ["macros", "rt-multi-thread"] }

LICENSE-MIT

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy of
2+
this software and associated documentation files (the "Software"), to deal in
3+
the Software without restriction, including without limitation the rights to
4+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
5+
of the Software, and to permit persons to whom the Software is furnished to do
6+
so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all
9+
copies or substantial portions of the Software.
10+
11+
Distributions of all or part of the Software intended to be used by the
12+
recipients as they would use the unmodified Software, containing modifications
13+
that substantially alter, remove, or disable functionality of the Software,
14+
outside of the documented configuration mechanisms provided by the Software,
15+
shall be modified such that the Original Author's bug reporting email addresses
16+
and urls are either replaced with the contact information of the parties
17+
responsible for the changes, or removed entirely.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# WIP: Rust crate for linux wireguard netlink management

0 commit comments

Comments
 (0)