Add more networking constants

This commit is contained in:
Jeremy Soller
2024-02-03 13:17:40 -07:00
parent 5b78afe5be
commit a7b2294b62
2 changed files with 15 additions and 5 deletions
+12 -5
View File
@@ -44,12 +44,19 @@ pub struct ipv6_mreq {
pub const INET_ADDRSTRLEN: c_int = 16;
pub const INET6_ADDRSTRLEN: c_int = 46;
// IP options
pub const IP_TOS: c_int = 1;
pub const IP_RECVTOS: c_int = 13;
// Protocol Numbers
pub const IPPROTO_IP: u8 = 0x00;
pub const IPPROTO_ICMP: u8 = 0x01;
pub const IPPROTO_TCP: u8 = 0x06;
pub const IPPROTO_UDP: u8 = 0x11;
pub const IPPROTO_IPV6: u8 = 0x29;
pub const IPPROTO_IP: u8 = 0;
pub const IPPROTO_ICMP: u8 = 1;
pub const IPPROTO_IGMP: u8 = 2;
pub const IPPROTO_TCP: u8 = 6;
pub const IPPROTO_PUP: u8 = 12;
pub const IPPROTO_UDP: u8 = 17;
pub const IPPROTO_IDP: u8 = 22;
pub const IPPROTO_IPV6: u8 = 41;
pub const IPPROTO_RAW: u8 = 0xff;
pub const IPPROTO_MAX: u8 = 0xff;
+3
View File
@@ -2,6 +2,7 @@ use crate::platform::types::*;
pub const SOCK_STREAM: c_int = 1;
pub const SOCK_DGRAM: c_int = 2;
pub const SOCK_RAW: c_int = 3;
pub const SOCK_NONBLOCK: c_int = 0o4_000;
pub const SOCK_CLOEXEC: c_int = 0o2_000_000;
@@ -52,11 +53,13 @@ pub const MSG_WAITALL: c_int = 256;
pub const AF_INET: c_int = 2;
pub const AF_INET6: c_int = 10;
pub const AF_LOCAL: c_int = AF_UNIX;
pub const AF_UNIX: c_int = 1;
pub const AF_UNSPEC: c_int = 0;
pub const PF_INET: c_int = 2;
pub const PF_INET6: c_int = 10;
pub const PF_LOCAL: c_int = PF_UNIX;
pub const PF_UNIX: c_int = 1;
pub const PF_UNSPEC: c_int = 0;