Skip to content

Commit fc54bbd

Browse files
pvachonwycats
authored andcommitted
Add Special INADDR_* definitions
Add definitions for INADDR_* types that are handy when instructing the kernel how to specify interfaces.
1 parent 2ccffa9 commit fc54bbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sys/socket.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ mod consts {
113113
pub const IP_MULTICAST_LOOP: SockOpt = 34;
114114
pub const IP_ADD_MEMBERSHIP: SockOpt = 35;
115115
pub const IP_DROP_MEMBERSHIP: SockOpt = 36;
116+
117+
pub type InAddrT = u32;
118+
119+
// Declarations of special addresses
120+
pub const INADDR_ANY: InAddrT = 0;
121+
pub const INADDR_NONE: InAddrT = 0xffffffff;
122+
pub const INADDR_BROADCAST: InAddrT = 0xffffffff;
116123
}
117124

118125
#[cfg(any(target_os = "macos", target_os = "ios"))]

0 commit comments

Comments
 (0)