Skip to content

Commit

Permalink
linux: add rtnetlink ifinfomsg attribute enumerals
Browse files Browse the repository at this point in the history
  • Loading branch information
tones111 committed Jan 29, 2023
1 parent 4d072b0 commit bfc1543
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3595,6 +3595,9 @@ fn test_linux(target: &str) {
// FIXME: requires Linux >= 5.7:
"MREMAP_DONTUNMAP" if musl || sparc64 => true,

// FIXME: requires Linux >= v5.8
"IF_LINK_MODE_TESTING" if musl => true,

// FIXME: Requires more recent kernel headers (5.9 / 5.11):
| "CLOSE_RANGE_UNSHARE"
| "CLOSE_RANGE_CLOEXEC" if musl || sparc64 => true,
Expand Down
10 changes: 10 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,16 @@ GRND_NONBLOCK
GRND_RANDOM
GRND_INSECURE
IBSHIFT
IF_LINK_MODE_DEFAULT
IF_LINK_MODE_DORMANT
IF_LINK_MODE_TESTING
IF_OPER_DORMANT
IF_OPER_DOWN
IF_OPER_LOWERLAYERDOWN
IF_OPER_NOTPRESENT
IF_OPER_TESTING
IF_OPER_UNKNOWN
IF_OPER_UP
IFA_ADDRESS
IFA_ANYCAST
IFA_BROADCAST
Expand Down
13 changes: 13 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3058,6 +3058,19 @@ pub const ALG_SET_AEAD_AUTHSIZE: ::c_int = 5;
pub const ALG_OP_DECRYPT: ::c_int = 0;
pub const ALG_OP_ENCRYPT: ::c_int = 1;

// include/uapi/linux/if.h
pub const IF_OPER_UNKNOWN: ::c_int = 0;
pub const IF_OPER_NOTPRESENT: ::c_int = 1;
pub const IF_OPER_DOWN: ::c_int = 2;
pub const IF_OPER_LOWERLAYERDOWN: ::c_int = 3;
pub const IF_OPER_TESTING: ::c_int = 4;
pub const IF_OPER_DORMANT: ::c_int = 5;
pub const IF_OPER_UP: ::c_int = 6;

pub const IF_LINK_MODE_DEFAULT: ::c_int = 0;
pub const IF_LINK_MODE_DORMANT: ::c_int = 1;
pub const IF_LINK_MODE_TESTING: ::c_int = 2;

// include/uapi/linux/udp.h
pub const UDP_CORK: ::c_int = 1;
pub const UDP_ENCAP: ::c_int = 100;
Expand Down

0 comments on commit bfc1543

Please sign in to comment.