Skip to content

Commit 32a7d17

Browse files
committed
Add some TCP constants
1 parent 50719a3 commit 32a7d17

File tree

7 files changed

+28
-3
lines changed

7 files changed

+28
-3
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,6 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13;
15491549
pub const IPV6_PKTINFO: ::c_int = 46;
15501550
pub const IPV6_RECVPKTINFO: ::c_int = 61;
15511551

1552-
pub const TCP_NODELAY: ::c_int = 0x01;
15531552
pub const TCP_KEEPALIVE: ::c_int = 0x10;
15541553

15551554
pub const SOL_LOCAL: ::c_int = 0;

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,11 @@ pub const IPPROTO_DONE: ::c_int = 257;
682682
/// Used by RSS: the layer3 protocol is unknown
683683
pub const IPPROTO_UNKNOWN: ::c_int = 258;
684684

685+
// sys/netinet/tcp.h
686+
pub const TCP_SIGNATURE_ENABLE: ::c_int = 16;
687+
pub const TCP_KEEPINIT: ::c_int = 32;
688+
pub const TCP_FASTKEEP: ::c_int = 128;
689+
685690
pub const AF_BLUETOOTH: ::c_int = 33;
686691
pub const AF_MPLS: ::c_int = 34;
687692
pub const AF_IEEE80211: ::c_int = 35;

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,16 @@ pub const IPPROTO_DIVERT: ::c_int = 258;
792792
/// SeND pseudo-protocol
793793
pub const IPPROTO_SEND: ::c_int = 259;
794794

795+
// sys/netinet/TCP.h
796+
pub const TCP_MD5SIG: ::c_int = 16;
797+
pub const TCP_INFO: ::c_int = 32;
798+
pub const TCP_CONGESTION: ::c_int = 64;
799+
pub const TCP_CCALGOOPT: ::c_int = 65;
800+
pub const TCP_KEEPINIT: ::c_int = 128;
801+
pub const TCP_FASTOPEN: ::c_int = 1025;
802+
pub const TCP_PCAP_OUT: ::c_int = 2048;
803+
pub const TCP_PCAP_IN: ::c_int = 4096;
804+
795805
pub const IP_BINDANY: ::c_int = 24;
796806

797807
pub const PF_SLOW: ::c_int = AF_SLOW;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ pub const IPV6_LEAVE_GROUP: ::c_int = 13;
669669
pub const IPV6_RECVPKTINFO: ::c_int = 36;
670670
pub const IPV6_PKTINFO: ::c_int = 46;
671671

672-
pub const TCP_NODELAY: ::c_int = 1;
673672
pub const TCP_KEEPIDLE: ::c_int = 256;
674673
pub const TCP_KEEPINTVL: ::c_int = 512;
675674
pub const TCP_KEEPCNT: ::c_int = 1024;

src/unix/bsd/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
316316
pub const LOG_FTP: ::c_int = 11 << 3;
317317
pub const LOG_PERROR: ::c_int = 0x20;
318318

319+
pub const TCP_NODELAY: ::c_int = 1;
319320
pub const TCP_MAXSEG: ::c_int = 2;
321+
pub const TCP_NOPUSH: ::c_int = 4;
322+
pub const TCP_NOOPT: ::c_int = 8;
320323

321324
pub const PIPE_BUF: usize = 512;
322325

src/unix/bsd/netbsdlike/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,13 @@ pub const IP_DROP_MEMBERSHIP: ::c_int = 13;
431431
pub const IPV6_RECVPKTINFO: ::c_int = 36;
432432
pub const IPV6_PKTINFO: ::c_int = 46;
433433

434-
pub const TCP_NODELAY: ::c_int = 0x01;
434+
pub const TCP_KEEPIDLE: ::c_int = 3;
435+
pub const TCP_KEEPINTVL: ::c_int = 5;
436+
pub const TCP_KEEPCNT: ::c_int = 6;
437+
pub const TCP_KEEPINIT: ::c_int = 7;
438+
pub const TCP_INFO: ::c_int = 9;
439+
pub const TCP_MD5SIG: ::c_int = 0x10;
440+
pub const TCP_CONGCTL: ::c_int = 0x20;
435441

436442
pub const SOL_SOCKET: ::c_int = 0xffff;
437443
pub const SO_DEBUG: ::c_int = 0x01;

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ pub const IPPROTO_DIVERT: ::c_int = 258;
320320
pub const IP_RECVDSTADDR: ::c_int = 7;
321321
pub const IP_SENDSRCADDR: ::c_int = IP_RECVDSTADDR;
322322

323+
// sys/netinet/in.h
324+
pub const TCP_NOPUSH: ::c_int = 0x10;
325+
323326
pub const AF_ECMA: ::c_int = 8;
324327
pub const AF_ROUTE: ::c_int = 17;
325328
pub const AF_ENCAP: ::c_int = 28;

0 commit comments

Comments
 (0)