Skip to content

Commit

Permalink
Auto merge of #3320 - BrandonMFong:main, r=JohnTitor
Browse files Browse the repository at this point in the history
Adding missing macros from linux/if_tun.h

Close #3151

I found the missing lines from my debian environment.
```
brandonmfong@kama:~/brando/sources/repo/rust-libc/libc-test$ lsb_release  -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye
```
  • Loading branch information
bors committed Oct 25, 2023
2 parents df3f7c1 + 45b1d00 commit 6314c9f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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 @@ -1830,6 +1830,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 @@ -1847,6 +1849,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

0 comments on commit 6314c9f

Please sign in to comment.