Skip to content

Commit 6314c9f

Browse files
committed
Auto merge of #3320 - BrandonMFong:main, r=JohnTitor
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 ```
2 parents df3f7c1 + 45b1d00 commit 6314c9f

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

libc-test/semver/linux.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,14 @@ IFF_MULTICAST
895895
IFF_MULTI_QUEUE
896896
IFF_NOARP
897897
IFF_NOFILTER
898+
TUN_TX_TIMESTAMP
899+
TUN_F_CSUM
900+
TUN_F_TSO4
901+
TUN_F_TSO6
902+
TUN_F_TSO_ECN
903+
TUN_F_UFO
904+
TUN_PKT_STRIP
905+
TUN_FLT_ALLMULTI
898906
IFF_NOTRAILERS
899907
IFF_NO_PI
900908
IFF_ONE_QUEUE
@@ -906,6 +914,8 @@ IFF_RUNNING
906914
IFF_SLAVE
907915
IFF_TAP
908916
IFF_TUN
917+
IFF_NAPI
918+
IFF_NAPI_FRAGS
909919
IFF_TUN_EXCL
910920
IFF_UP
911921
IFF_VNET_HDR

src/unix/linux_like/linux/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,8 @@ pub const IFLA_INFO_SLAVE_DATA: ::c_ushort = 5;
18301830
// linux/if_tun.h
18311831
pub const IFF_TUN: ::c_int = 0x0001;
18321832
pub const IFF_TAP: ::c_int = 0x0002;
1833+
pub const IFF_NAPI: ::c_int = 0x0010;
1834+
pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
18331835
pub const IFF_NO_PI: ::c_int = 0x1000;
18341836
// Read queue size
18351837
pub const TUN_READQ_SIZE: ::c_short = 500;
@@ -1847,6 +1849,18 @@ pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
18471849
// read-only flag
18481850
pub const IFF_PERSIST: ::c_int = 0x0800;
18491851
pub const IFF_NOFILTER: ::c_int = 0x1000;
1852+
// Socket options
1853+
pub const TUN_TX_TIMESTAMP: ::c_int = 1;
1854+
// Features for GSO (TUNSETOFFLOAD)
1855+
pub const TUN_F_CSUM: ::c_ushort = 0x01; /* You can hand me unchecksummed packets. */
1856+
pub const TUN_F_TSO4: ::c_ushort = 0x02; /* I can handle TSO for IPv4 packets */
1857+
pub const TUN_F_TSO6: ::c_ushort = 0x04; /* I can handle TSO for IPv6 packets */
1858+
pub const TUN_F_TSO_ECN: ::c_ushort = 0x08; /* I can handle TSO with ECN bits. */
1859+
pub const TUN_F_UFO: ::c_ushort = 0x10; /* I can handle UFO packets */
1860+
// Protocol info prepended to the packets (when IFF_NO_PI is not set)
1861+
pub const TUN_PKT_STRIP: ::c_int = 0x0001;
1862+
// Accept all multicast packets
1863+
pub const TUN_FLT_ALLMULTI: ::c_int = 0x0001;
18501864

18511865
// Since Linux 3.1
18521866
pub const SEEK_DATA: ::c_int = 3;

0 commit comments

Comments
 (0)