Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,15 @@ pub const LOCAL_CONNWAIT: c_int = 0x0002; // connects block until accepted
pub const LOCAL_PEEREID: c_int = 0x0003; // get peer identification
pub const LOCAL_CREDS: c_int = 0x0004; // pass credentials to receiver

// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373
// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L207
/// link invalid/unknown
pub const LINK_STATE_UNKNOWN: c_int = 0;
/// link is down
pub const LINK_STATE_DOWN: c_int = 1;
/// link is up
pub const LINK_STATE_UP: c_int = 2;

// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L445
pub const IFF_UP: c_int = 0x0001; // interface is up
pub const IFF_BROADCAST: c_int = 0x0002; // broadcast address valid
pub const IFF_DEBUG: c_int = 0x0004; // turn on debugging
Expand Down
16 changes: 16 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1629,6 +1629,22 @@ const SI_PAD: size_t = (SI_MAXSZ / size_of::<c_int>()) - 3;
pub const MAP_STACK: c_int = 0x4000;
pub const MAP_CONCEAL: c_int = 0x8000;

// https://github.com/openbsd/src/blob/HEAD/sys/net/if.h#L135
/// link unknown
pub const LINK_STATE_UNKNOWN: c_int = 0;
/// link invalid
pub const LINK_STATE_INVALID: c_int = 1;
/// link is down
pub const LINK_STATE_DOWN: c_int = 2;
/// keepalive reports down
pub const LINK_STATE_KALIVE_DOWN: c_int = 3;
/// link is up
pub const LINK_STATE_UP: c_int = 4;
/// link is up and half duplex
pub const LINK_STATE_HALF_DUPLEX: c_int = 5;
/// link is up and full duplex
pub const LINK_STATE_FULL_DUPLEX: c_int = 6;

// https://github.com/openbsd/src/blob/HEAD/sys/net/if.h#L187
pub const IFF_UP: c_int = 0x1; // interface is up
pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid
Expand Down
Loading