Skip to content
Snippets Groups Projects
Commit a7b2294b authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Add more networking constants

parent 5b78afe5
No related branches found
No related tags found
No related merge requests found
Pipeline #14197 passed
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment