From 87c577ef32fa320fc6f130d01063f5b77a9b019a Mon Sep 17 00:00:00 2001 From: Brando Date: Fri, 18 Aug 2023 15:38:48 -0700 Subject: [PATCH 1/2] Adding to missing macros --- src/unix/linux_like/linux/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 4f9ae623a843a..2bdad518ff391 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -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; @@ -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; From 45b1d00b17ef1fbc3626c1d7af1baa3cb16632a6 Mon Sep 17 00:00:00 2001 From: Brando Date: Wed, 27 Sep 2023 10:01:25 -0700 Subject: [PATCH 2/2] Adding to semver --- libc-test/semver/linux.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libc-test/semver/linux.txt b/libc-test/semver/linux.txt index b4091a707047d..1e3a56a699a69 100644 --- a/libc-test/semver/linux.txt +++ b/libc-test/semver/linux.txt @@ -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 @@ -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