File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,7 @@ fn main() {
169
169
cfg. header ( "xlocale.h" ) ;
170
170
cfg. header ( "sys/xattr.h" ) ;
171
171
cfg. header ( "sys/sys_domain.h" ) ;
172
+ cfg. header ( "net/if_utun.h" ) ;
172
173
if target. starts_with ( "x86" ) {
173
174
cfg. header ( "crt_externs.h" ) ;
174
175
}
@@ -264,6 +265,7 @@ fn main() {
264
265
cfg. header ( "linux/random.h" ) ;
265
266
cfg. header ( "elf.h" ) ;
266
267
cfg. header ( "link.h" ) ;
268
+ cfg. header ( "linux/if_tun.h" ) ;
267
269
}
268
270
269
271
if freebsd {
Original file line number Diff line number Diff line change @@ -1523,7 +1523,7 @@ pub const MSG_RCVMORE: ::c_int = 0x4000;
1523
1523
pub const SCM_TIMESTAMP : :: c_int = 0x02 ;
1524
1524
pub const SCM_CREDS : :: c_int = 0x03 ;
1525
1525
1526
- /// https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156
1526
+ // https://github.com/aosm/xnu/blob/master/bsd/net/if.h#L140-L156
1527
1527
pub const IFF_UP : :: c_int = 0x1 ; // interface is up
1528
1528
pub const IFF_BROADCAST : :: c_int = 0x2 ; // broadcast address valid
1529
1529
pub const IFF_DEBUG : :: c_int = 0x4 ; // turn on debugging
@@ -2070,6 +2070,10 @@ pub const LC_SEGMENT_64: u32 = 0x19;
2070
2070
pub const MH_MAGIC : u32 = 0xfeedface ;
2071
2071
pub const MH_MAGIC_64 : u32 = 0xfeedfacf ;
2072
2072
2073
+ // net/if_utun.h
2074
+ pub const UTUN_OPT_FLAGS : :: c_int = 1 ;
2075
+ pub const UTUN_OPT_IFNAME : :: c_int = 2 ;
2076
+
2073
2077
f ! {
2074
2078
pub fn WSTOPSIG ( status: :: c_int) -> :: c_int {
2075
2079
status >> 8
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ pub const S_ISGID: ::c_int = 0x400;
210
210
pub const S_ISVTX : :: c_int = 0x200 ;
211
211
212
212
pub const IF_NAMESIZE : :: size_t = 16 ;
213
+ pub const IFNAMSIZ : :: size_t = IF_NAMESIZE ;
213
214
214
215
pub const LOG_EMERG : :: c_int = 0 ;
215
216
pub const LOG_ALERT : :: c_int = 1 ;
Original file line number Diff line number Diff line change @@ -726,6 +726,28 @@ pub const IFF_LOWER_UP: ::c_int = 0x10000;
726
726
pub const IFF_DORMANT : :: c_int = 0x20000 ;
727
727
pub const IFF_ECHO : :: c_int = 0x40000 ;
728
728
729
+ // linux/if_tun.h
730
+ // Read queue size
731
+ pub const TUN_READQ_SIZE : :: c_short = 500 ;
732
+ // TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead.
733
+ pub const TUN_TUN_DEV : :: c_short = IFF_TUN ;
734
+ pub const TUN_TAP_DEV : :: c_short = IFF_TAP ;
735
+ pub const TUN_TYPE_MASK : :: c_short = 0x000f ;
736
+ // TUNSETIFF ifr flags
737
+ pub const IFF_TUN : :: c_short = 0x0001 ;
738
+ pub const IFF_TAP : :: c_short = 0x0002 ;
739
+ pub const IFF_NO_PI : :: c_short = 0x1000 ;
740
+ // This flag has no real effect
741
+ pub const IFF_ONE_QUEUE : :: c_short = 0x2000 ;
742
+ pub const IFF_VNET_HDR : :: c_short = 0x4000 ;
743
+ pub const IFF_TUN_EXCL : :: c_short = 0x8000 ;
744
+ pub const IFF_MULTI_QUEUE : :: c_short = 0x0100 ;
745
+ pub const IFF_ATTACH_QUEUE : :: c_short = 0x0200 ;
746
+ pub const IFF_DETACH_QUEUE : :: c_short = 0x0400 ;
747
+ // read-only flag
748
+ pub const IFF_PERSIST : :: c_short = 0x0800 ;
749
+ pub const IFF_NOFILTER : :: c_short = 0x1000 ;
750
+
729
751
pub const ST_RDONLY : :: c_ulong = 1 ;
730
752
pub const ST_NOSUID : :: c_ulong = 2 ;
731
753
pub const ST_NODEV : :: c_ulong = 4 ;
You can’t perform that action at this time.
0 commit comments