Skip to content

Commit 88c536d

Browse files
committed
Recycle IFF_NOTRAILERS into IFF_STATICARP in OpenBSD but not in Bitrig.
https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/net/if.h?rev=1.190&content-type=text/x-cvsweb-markup
1 parent 659de79 commit 88c536d

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

src/unix/bsd/netbsdlike/openbsdlike/bitrig/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ pub const ALTMON_12: ::nl_item = 69;
6565

6666
pub const KERN_RND: ::c_int = 31;
6767

68+
// https://github.com/bitrig/bitrig/blob/master/sys/net/if.h#L187
69+
pub const IFF_UP: ::c_int = 0x1; // interface is up
70+
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
71+
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
72+
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
73+
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
74+
pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
75+
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
76+
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
77+
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
78+
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
79+
pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
80+
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
81+
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
82+
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
83+
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
84+
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
85+
6886
extern {
6987
pub fn nl_langinfo_l(item: ::nl_item, locale: ::locale_t) -> *mut ::c_char;
7088
pub fn duplocale(base: ::locale_t) -> ::locale_t;

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,24 +243,6 @@ pub const SO_RTABLE: ::c_int = 0x1021;
243243
pub const SO_PEERCRED: ::c_int = 0x1022;
244244
pub const SO_SPLICE: ::c_int = 0x1023;
245245

246-
// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
247-
pub const IFF_UP: ::c_int = 0x1; // interface is up
248-
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
249-
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
250-
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
251-
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
252-
pub const IFF_NOTRAILERS: ::c_int = 0x20; // avoid use of trailers
253-
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
254-
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
255-
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
256-
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
257-
pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
258-
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
259-
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
260-
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
261-
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
262-
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
263-
264246
// sys/netinet/in.h
265247
// Protocols (RFC 1700)
266248
// NOTE: These are in addition to the constants defined in src/unix/mod.rs

src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ s! {
2727
}
2828
}
2929

30+
// https://github.com/openbsd/src/blob/master/sys/net/if.h#L187
31+
pub const IFF_UP: ::c_int = 0x1; // interface is up
32+
pub const IFF_BROADCAST: ::c_int = 0x2; // broadcast address valid
33+
pub const IFF_DEBUG: ::c_int = 0x4; // turn on debugging
34+
pub const IFF_LOOPBACK: ::c_int = 0x8; // is a loopback net
35+
pub const IFF_POINTOPOINT: ::c_int = 0x10; // interface is point-to-point link
36+
pub const IFF_STATICARP: ::c_int = 0x20; // only static ARP
37+
pub const IFF_RUNNING: ::c_int = 0x40; // resources allocated
38+
pub const IFF_NOARP: ::c_int = 0x80; // no address resolution protocol
39+
pub const IFF_PROMISC: ::c_int = 0x100; // receive all packets
40+
pub const IFF_ALLMULTI: ::c_int = 0x200; // receive all multicast packets
41+
pub const IFF_OACTIVE: ::c_int = 0x400; // transmission in progress
42+
pub const IFF_SIMPLEX: ::c_int = 0x800; // can't hear own transmissions
43+
pub const IFF_LINK0: ::c_int = 0x1000; // per link layer defined bit
44+
pub const IFF_LINK1: ::c_int = 0x2000; // per link layer defined bit
45+
pub const IFF_LINK2: ::c_int = 0x4000; // per link layer defined bit
46+
pub const IFF_MULTICAST: ::c_int = 0x8000; // supports multicast
47+
3048
extern {
3149
pub fn accept4(s: ::c_int, addr: *mut ::sockaddr,
3250
addrlen: *mut ::socklen_t, flags: ::c_int) -> ::c_int;

0 commit comments

Comments
 (0)