Skip to content

Add some TCP constants #1151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2018
Merged
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
1 change: 0 additions & 1 deletion src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,6 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const IPV6_PKTINFO: ::c_int = 46;
pub const IPV6_RECVPKTINFO: ::c_int = 61;

pub const TCP_NODELAY: ::c_int = 0x01;
pub const TCP_KEEPALIVE: ::c_int = 0x10;

pub const SOL_LOCAL: ::c_int = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ pub const IPPROTO_DONE: ::c_int = 257;
/// Used by RSS: the layer3 protocol is unknown
pub const IPPROTO_UNKNOWN: ::c_int = 258;

// sys/netinet/tcp.h
pub const TCP_SIGNATURE_ENABLE: ::c_int = 16;
pub const TCP_KEEPINIT: ::c_int = 32;
pub const TCP_FASTKEEP: ::c_int = 128;

pub const AF_BLUETOOTH: ::c_int = 33;
pub const AF_MPLS: ::c_int = 34;
pub const AF_IEEE80211: ::c_int = 35;
Expand Down
10 changes: 10 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,16 @@ pub const IPPROTO_DIVERT: ::c_int = 258;
/// SeND pseudo-protocol
pub const IPPROTO_SEND: ::c_int = 259;

// sys/netinet/TCP.h
pub const TCP_MD5SIG: ::c_int = 16;
pub const TCP_INFO: ::c_int = 32;
pub const TCP_CONGESTION: ::c_int = 64;
pub const TCP_CCALGOOPT: ::c_int = 65;
pub const TCP_KEEPINIT: ::c_int = 128;
pub const TCP_FASTOPEN: ::c_int = 1025;
pub const TCP_PCAP_OUT: ::c_int = 2048;
pub const TCP_PCAP_IN: ::c_int = 4096;

pub const IP_BINDANY: ::c_int = 24;

pub const PF_SLOW: ::c_int = AF_SLOW;
Expand Down
1 change: 0 additions & 1 deletion src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,6 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13;
pub const IPV6_RECVPKTINFO: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;

pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_KEEPIDLE: ::c_int = 256;
pub const TCP_KEEPINTVL: ::c_int = 512;
pub const TCP_KEEPCNT: ::c_int = 1024;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/bsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
pub const LOG_FTP: ::c_int = 11 << 3;
pub const LOG_PERROR: ::c_int = 0x20;

pub const TCP_NODELAY: ::c_int = 1;
pub const TCP_MAXSEG: ::c_int = 2;
pub const TCP_NOPUSH: ::c_int = 4;
pub const TCP_NOOPT: ::c_int = 8;

pub const PIPE_BUF: usize = 512;

Expand Down
8 changes: 7 additions & 1 deletion src/unix/bsd/netbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,13 @@ pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
pub const IPV6_RECVPKTINFO: ::c_int = 36;
pub const IPV6_PKTINFO: ::c_int = 46;

pub const TCP_NODELAY: ::c_int = 0x01;
pub const TCP_KEEPIDLE: ::c_int = 3;
pub const TCP_KEEPINTVL: ::c_int = 5;
pub const TCP_KEEPCNT: ::c_int = 6;
pub const TCP_KEEPINIT: ::c_int = 7;
pub const TCP_INFO: ::c_int = 9;
pub const TCP_MD5SIG: ::c_int = 0x10;
pub const TCP_CONGCTL: ::c_int = 0x20;

pub const SOL_SOCKET: ::c_int = 0xffff;
pub const SO_DEBUG: ::c_int = 0x01;
Expand Down
3 changes: 3 additions & 0 deletions src/unix/bsd/netbsdlike/openbsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ pub const IPPROTO_DIVERT: ::c_int = 258;
pub const IP_RECVDSTADDR: ::c_int = 7;
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;

// sys/netinet/in.h
pub const TCP_NOPUSH: ::c_int = 0x10;

pub const AF_ECMA: ::c_int = 8;
pub const AF_ROUTE: ::c_int = 17;
pub const AF_ENCAP: ::c_int = 28;
Expand Down