Skip to content

Commit

Permalink
Flags for SIOC{G,S}IFFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
bentheklutz committed Nov 12, 2024
1 parent 8622665 commit 5112488
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/std/os/linux.zig
Original file line number Diff line number Diff line change
Expand Up @@ -7121,6 +7121,19 @@ pub const SIOCPROTOPRIVATE = 0x89E0;

pub const IFNAMESIZE = 16;

pub const IFF = packed struct(u16) {
UP: bool = false,
BROADCAST: bool = false,
DEBUG: bool = false,
LOOPBACK: bool = false,
POINTOPOINT: bool = false,
NOTRAILERS: bool = false,
RUNNING: bool = false,
NOARP: bool = false,
PROMISC: bool = false,
_: u7 = 0,
};

pub const ifmap = extern struct {
mem_start: usize,
mem_end: usize,
Expand All @@ -7140,7 +7153,7 @@ pub const ifreq = extern struct {
broadaddr: sockaddr,
netmask: sockaddr,
hwaddr: sockaddr,
flags: i16,
flags: IFF,
ivalue: i32,
mtu: i32,
map: ifmap,
Expand Down
1 change: 1 addition & 0 deletions lib/std/posix.zig
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ pub const SIOCGIFINDEX = system.SIOCGIFINDEX;
pub const SO = system.SO;
pub const SOCK = system.SOCK;
pub const SOL = system.SOL;
pub const IFF = system.IFF;
pub const STDERR_FILENO = system.STDERR_FILENO;
pub const STDIN_FILENO = system.STDIN_FILENO;
pub const STDOUT_FILENO = system.STDOUT_FILENO;
Expand Down

0 comments on commit 5112488

Please sign in to comment.