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

Adding missing macros from linux/if_tun.h #3320

Merged
merged 3 commits into from Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -895,6 +895,14 @@ IFF_MULTICAST
IFF_MULTI_QUEUE
IFF_NOARP
IFF_NOFILTER
TUN_TX_TIMESTAMP
TUN_F_CSUM
TUN_F_TSO4
TUN_F_TSO6
TUN_F_TSO_ECN
TUN_F_UFO
TUN_PKT_STRIP
TUN_FLT_ALLMULTI
IFF_NOTRAILERS
IFF_NO_PI
IFF_ONE_QUEUE
Expand All @@ -906,6 +914,8 @@ IFF_RUNNING
IFF_SLAVE
IFF_TAP
IFF_TUN
IFF_NAPI
IFF_NAPI_FRAGS
IFF_TUN_EXCL
IFF_UP
IFF_VNET_HDR
Expand Down
14 changes: 14 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -1829,6 +1829,8 @@ pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
// linux/if_tun.h
pub const IFF_TUN: ::c_int = 0x0001;
pub const IFF_TAP: ::c_int = 0x0002;
pub const IFF_NAPI: ::c_int = 0x0010;
pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
pub const IFF_NO_PI: ::c_int = 0x1000;
// Read queue size
pub const TUN_READQ_SIZE: ::c_short = 500;
Expand All @@ -1846,6 +1848,18 @@ pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
// read-only flag
pub const IFF_PERSIST: ::c_int = 0x0800;
pub const IFF_NOFILTER: ::c_int = 0x1000;
// Socket options
pub const TUN_TX_TIMESTAMP: ::c_int = 1;
// Features for GSO (TUNSETOFFLOAD)
pub const TUN_F_CSUM: ::c_ushort = 0x01; /* You can hand me unchecksummed packets. */
pub const TUN_F_TSO4: ::c_ushort = 0x02; /* I can handle TSO for IPv4 packets */
pub const TUN_F_TSO6: ::c_ushort = 0x04; /* I can handle TSO for IPv6 packets */
pub const TUN_F_TSO_ECN: ::c_ushort = 0x08; /* I can handle TSO with ECN bits. */
pub const TUN_F_UFO: ::c_ushort = 0x10; /* I can handle UFO packets */
// Protocol info prepended to the packets (when IFF_NO_PI is not set)
pub const TUN_PKT_STRIP: ::c_int = 0x0001;
// Accept all multicast packets
pub const TUN_FLT_ALLMULTI: ::c_int = 0x0001;

// Since Linux 3.1
pub const SEEK_DATA: ::c_int = 3;
Expand Down