| ... | ... | @@ -1590,6 +1590,123 @@ pub const RR_A = 1; |
| 1590 | 1590 | pub const RR_CNAME = 5; |
| 1591 | 1591 | pub const RR_AAAA = 28; |
| 1592 | 1592 | |
| 1593 | /// Turn off Nagle's algorithm |
| 1594 | pub const TCP_NODELAY = 1; |
| 1595 | /// Limit MSS |
| 1596 | pub const TCP_MAXSEG = 2; |
| 1597 | /// Never send partially complete segments. |
| 1598 | pub const TCP_CORK = 3; |
| 1599 | /// Start keeplives after this period, in seconds |
| 1600 | pub const TCP_KEEPIDLE = 4; |
| 1601 | /// Interval between keepalives |
| 1602 | pub const TCP_KEEPINTVL = 5; |
| 1603 | /// Number of keepalives before death |
| 1604 | pub const TCP_KEEPCNT = 6; |
| 1605 | /// Number of SYN retransmits |
| 1606 | pub const TCP_SYNCNT = 7; |
| 1607 | /// Life time of orphaned FIN-WAIT-2 state |
| 1608 | pub const TCP_LINGER2 = 8; |
| 1609 | /// Wake up listener only when data arrive |
| 1610 | pub const TCP_DEFER_ACCEPT = 9; |
| 1611 | /// Bound advertised window |
| 1612 | pub const TCP_WINDOW_CLAMP = 10; |
| 1613 | /// Information about this connection. |
| 1614 | pub const TCP_INFO = 11; |
| 1615 | /// Block/reenable quick acks |
| 1616 | pub const TCP_QUICKACK = 12; |
| 1617 | /// Congestion control algorithm |
| 1618 | pub const TCP_CONGESTION = 13; |
| 1619 | /// TCP MD5 Signature (RFC2385) |
| 1620 | pub const TCP_MD5SIG = 14; |
| 1621 | /// Use linear timeouts for thin streams |
| 1622 | pub const TCP_THIN_LINEAR_TIMEOUTS = 16; |
| 1623 | /// Fast retrans. after 1 dupack |
| 1624 | pub const TCP_THIN_DUPACK = 17; |
| 1625 | /// How long for loss retry before timeout |
| 1626 | pub const TCP_USER_TIMEOUT = 18; |
| 1627 | /// TCP sock is under repair right now |
| 1628 | pub const TCP_REPAIR = 19; |
| 1629 | pub const TCP_REPAIR_QUEUE = 20; |
| 1630 | pub const TCP_QUEUE_SEQ = 21; |
| 1631 | pub const TCP_REPAIR_OPTIONS = 22; |
| 1632 | /// Enable FastOpen on listeners |
| 1633 | pub const TCP_FASTOPEN = 23; |
| 1634 | pub const TCP_TIMESTAMP = 24; |
| 1635 | /// limit number of unsent bytes in write queue |
| 1636 | pub const TCP_NOTSENT_LOWAT = 25; |
| 1637 | /// Get Congestion Control (optional) info |
| 1638 | pub const TCP_CC_INFO = 26; |
| 1639 | /// Record SYN headers for new connections |
| 1640 | pub const TCP_SAVE_SYN = 27; |
| 1641 | /// Get SYN headers recorded for connection |
| 1642 | pub const TCP_SAVED_SYN = 28; |
| 1643 | /// Get/set window parameters |
| 1644 | pub const TCP_REPAIR_WINDOW = 29; |
| 1645 | /// Attempt FastOpen with connect |
| 1646 | pub const TCP_FASTOPEN_CONNECT = 30; |
| 1647 | /// Attach a ULP to a TCP connection |
| 1648 | pub const TCP_ULP = 31; |
| 1649 | /// TCP MD5 Signature with extensions |
| 1650 | pub const TCP_MD5SIG_EXT = 32; |
| 1651 | /// Set the key for Fast Open (cookie) |
| 1652 | pub const TCP_FASTOPEN_KEY = 33; |
| 1653 | /// Enable TFO without a TFO cookie |
| 1654 | pub const TCP_FASTOPEN_NO_COOKIE = 34; |
| 1655 | pub const TCP_ZEROCOPY_RECEIVE = 35; |
| 1656 | /// Notify bytes available to read as a cmsg on read |
| 1657 | pub const TCP_INQ = 36; |
| 1658 | pub const TCP_CM_INQ = TCP_INQ; |
| 1659 | /// delay outgoing packets by XX usec |
| 1660 | pub const TCP_TX_DELAY = 37; |
| 1661 | |
| 1662 | pub const TCP_REPAIR_ON = 1; |
| 1663 | pub const TCP_REPAIR_OFF = 0; |
| 1664 | /// Turn off without window probes |
| 1665 | pub const TCP_REPAIR_OFF_NO_WP = -1; |
| 1666 | |
| 1667 | pub const tcp_repair_opt = extern struct { |
| 1668 | opt_code: u32, |
| 1669 | opt_val: u32, |
| 1670 | }; |
| 1671 | |
| 1672 | pub const tcp_repair_window = extern struct { |
| 1673 | snd_wl1: u32, |
| 1674 | snd_wnd: u32, |
| 1675 | max_window: u32, |
| 1676 | rcv_wnd: u32, |
| 1677 | rcv_wup: u32, |
| 1678 | }; |
| 1679 | |
| 1680 | pub const TcpRepairOption = extern enum { |
| 1681 | TCP_NO_QUEUE, |
| 1682 | TCP_RECV_QUEUE, |
| 1683 | TCP_SEND_QUEUE, |
| 1684 | TCP_QUEUES_NR, |
| 1685 | }; |
| 1686 | |
| 1687 | /// why fastopen failed from client perspective |
| 1688 | pub const tcp_fastopen_client_fail = extern enum { |
| 1689 | /// catch-all |
| 1690 | TFO_STATUS_UNSPEC, |
| 1691 | /// if not in TFO_CLIENT_NO_COOKIE mode |
| 1692 | TFO_COOKIE_UNAVAILABLE, |
| 1693 | /// SYN-ACK did not ack SYN data |
| 1694 | TFO_DATA_NOT_ACKED, |
| 1695 | /// SYN-ACK did not ack SYN data after timeout |
| 1696 | TFO_SYN_RETRANSMITTED, |
| 1697 | }; |
| 1698 | |
| 1699 | /// for TCP_INFO socket option |
| 1700 | pub const TCPI_OPT_TIMESTAMPS = 1; |
| 1701 | pub const TCPI_OPT_SACK = 2; |
| 1702 | pub const TCPI_OPT_WSCALE = 4; |
| 1703 | /// ECN was negociated at TCP session init |
| 1704 | pub const TCPI_OPT_ECN = 8; |
| 1705 | /// we received at least one packet with ECT |
| 1706 | pub const TCPI_OPT_ECN_SEEN = 16; |
| 1707 | /// SYN-ACK acked data in SYN sent or rcvd |
| 1708 | pub const TCPI_OPT_SYN_DATA = 32; |
| 1709 | |
| 1593 | 1710 | pub const nfds_t = usize; |
| 1594 | 1711 | pub const pollfd = extern struct { |
| 1595 | 1712 | fd: fd_t, |