Skip to content

Commit 11994fb

Browse files
authored
Merge branch 'main' into main
2 parents 5a41cb7 + 9c9b712 commit 11994fb

File tree

2 files changed

+26
-28
lines changed

2 files changed

+26
-28
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ description = "generic netlink packet types"
1212

1313
[dependencies]
1414
anyhow = "1.0.39"
15-
libc = "0.2.86"
1615
byteorder = "1.4.2"
17-
netlink-packet-core = { version = "0.5.0" }
16+
netlink-packet-core = { version = "0.6.0" }
1817
netlink-packet-utils = { version = "0.5.2" }
1918

2019
[dev-dependencies]

src/constants.rs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
11
// SPDX-License-Identifier: MIT
22

33
//! Define constants related to generic netlink
4-
pub const GENL_ID_CTRL: u16 = libc::GENL_ID_CTRL as u16;
4+
pub const GENL_ID_CTRL: u16 = 16;
55
pub const GENL_HDRLEN: usize = 4;
66

7-
pub const CTRL_CMD_UNSPEC: u8 = libc::CTRL_CMD_UNSPEC as u8;
8-
pub const CTRL_CMD_NEWFAMILY: u8 = libc::CTRL_CMD_NEWFAMILY as u8;
9-
pub const CTRL_CMD_DELFAMILY: u8 = libc::CTRL_CMD_DELFAMILY as u8;
10-
pub const CTRL_CMD_GETFAMILY: u8 = libc::CTRL_CMD_GETFAMILY as u8;
11-
pub const CTRL_CMD_NEWOPS: u8 = libc::CTRL_CMD_NEWOPS as u8;
12-
pub const CTRL_CMD_DELOPS: u8 = libc::CTRL_CMD_DELOPS as u8;
13-
pub const CTRL_CMD_GETOPS: u8 = libc::CTRL_CMD_GETOPS as u8;
14-
pub const CTRL_CMD_NEWMCAST_GRP: u8 = libc::CTRL_CMD_NEWMCAST_GRP as u8;
15-
pub const CTRL_CMD_DELMCAST_GRP: u8 = libc::CTRL_CMD_DELMCAST_GRP as u8;
16-
pub const CTRL_CMD_GETMCAST_GRP: u8 = libc::CTRL_CMD_GETMCAST_GRP as u8;
7+
pub const CTRL_CMD_UNSPEC: u8 = 0;
8+
pub const CTRL_CMD_NEWFAMILY: u8 = 1;
9+
pub const CTRL_CMD_DELFAMILY: u8 = 2;
10+
pub const CTRL_CMD_GETFAMILY: u8 = 3;
11+
pub const CTRL_CMD_NEWOPS: u8 = 4;
12+
pub const CTRL_CMD_DELOPS: u8 = 5;
13+
pub const CTRL_CMD_GETOPS: u8 = 6;
14+
pub const CTRL_CMD_NEWMCAST_GRP: u8 = 7;
15+
pub const CTRL_CMD_DELMCAST_GRP: u8 = 8;
16+
pub const CTRL_CMD_GETMCAST_GRP: u8 = 9;
1717
pub const CTRL_CMD_GETPOLICY: u8 = 10;
1818

19-
pub const CTRL_ATTR_UNSPEC: u16 = libc::CTRL_ATTR_UNSPEC as u16;
20-
pub const CTRL_ATTR_FAMILY_ID: u16 = libc::CTRL_ATTR_FAMILY_ID as u16;
21-
pub const CTRL_ATTR_FAMILY_NAME: u16 = libc::CTRL_ATTR_FAMILY_NAME as u16;
22-
pub const CTRL_ATTR_VERSION: u16 = libc::CTRL_ATTR_VERSION as u16;
23-
pub const CTRL_ATTR_HDRSIZE: u16 = libc::CTRL_ATTR_HDRSIZE as u16;
24-
pub const CTRL_ATTR_MAXATTR: u16 = libc::CTRL_ATTR_MAXATTR as u16;
25-
pub const CTRL_ATTR_OPS: u16 = libc::CTRL_ATTR_OPS as u16;
26-
pub const CTRL_ATTR_MCAST_GROUPS: u16 = libc::CTRL_ATTR_MCAST_GROUPS as u16;
19+
pub const CTRL_ATTR_UNSPEC: u16 = 0;
20+
pub const CTRL_ATTR_FAMILY_ID: u16 = 1;
21+
pub const CTRL_ATTR_FAMILY_NAME: u16 = 2;
22+
pub const CTRL_ATTR_VERSION: u16 = 3;
23+
pub const CTRL_ATTR_HDRSIZE: u16 = 4;
24+
pub const CTRL_ATTR_MAXATTR: u16 = 5;
25+
pub const CTRL_ATTR_OPS: u16 = 6;
26+
pub const CTRL_ATTR_MCAST_GROUPS: u16 = 7;
2727
pub const CTRL_ATTR_POLICY: u16 = 8;
2828
pub const CTRL_ATTR_OP_POLICY: u16 = 9;
2929
pub const CTRL_ATTR_OP: u16 = 10;
3030

31-
pub const CTRL_ATTR_OP_UNSPEC: u16 = libc::CTRL_ATTR_OP_UNSPEC as u16;
32-
pub const CTRL_ATTR_OP_ID: u16 = libc::CTRL_ATTR_OP_ID as u16;
33-
pub const CTRL_ATTR_OP_FLAGS: u16 = libc::CTRL_ATTR_OP_FLAGS as u16;
31+
pub const CTRL_ATTR_OP_UNSPEC: u16 = 0;
32+
pub const CTRL_ATTR_OP_ID: u16 = 1;
33+
pub const CTRL_ATTR_OP_FLAGS: u16 = 2;
3434

35-
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: u16 =
36-
libc::CTRL_ATTR_MCAST_GRP_UNSPEC as u16;
37-
pub const CTRL_ATTR_MCAST_GRP_NAME: u16 = libc::CTRL_ATTR_MCAST_GRP_NAME as u16;
38-
pub const CTRL_ATTR_MCAST_GRP_ID: u16 = libc::CTRL_ATTR_MCAST_GRP_ID as u16;
35+
pub const CTRL_ATTR_MCAST_GRP_UNSPEC: u16 = 0;
36+
pub const CTRL_ATTR_MCAST_GRP_NAME: u16 = 1;
37+
pub const CTRL_ATTR_MCAST_GRP_ID: u16 = 2;
3938

4039
pub const CTRL_ATTR_POLICY_UNSPEC: u16 = 0;
4140
pub const CTRL_ATTR_POLICY_DO: u16 = 1;

0 commit comments

Comments
 (0)