1 /*******************************************************************************
2 
3     D bindings for the Linux's netinet/tcp.h structures.
4 
5     Defines constants found in tcp.h header on Linux system.
6 
7     Copyright:  Copyright (c) 2016 Sociomantic Labs. All rights reserved.
8     License:    $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
9     Authors:    Nemanja Boric
10 
11 *******************************************************************************/
12 
13 module core.sys.linux.netinet.tcp;
14 
15 /*
16 * Copyright (c) 1982, 1986, 1993
17 * The Regents of the University of California.  All rights reserved.
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
21 * are met:
22 * 1. Redistributions of source code must retain the above copyright
23 *    notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 *    notice, this list of conditions and the following disclaimer in the
26 *    documentation and/or other materials provided with the distribution.
27 * 4. Neither the name of the University nor the names of its contributors
28 *    may be used to endorse or promote products derived from this software
29 *    without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
32 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
35 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
40 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
41 * SUCH DAMAGE.
42 *
43 * @(#)tcp.h 8.1 (Berkeley) 6/10/93
44 */
45 
46 version (linux):
47 
48 /// User-settable options (used with setsockopt).
49 enum
50 {
51      TCP_NODELAY            = 1,  /// Don't delay send to coalesce packets
52      TCP_MAXSEG             = 2,  /// Set maximum segment size
53      TCP_CORK               = 3,  /// Control sending of partial frames
54      TCP_KEEPIDLE           = 4,  /// Start keeplives after this period
55      TCP_KEEPINTVL          = 5,  /// Interval between keepalives
56      TCP_KEEPCNT            = 6,  /// Number of keepalives before death
57      TCP_SYNCNT             = 7,  /// Number of SYN retransmits
58      TCP_LINGER2            = 8,  /// Life time of orphaned FIN-WAIT-2 state
59      TCP_DEFER_ACCEPT       = 9,  /// Wake up listener only when data arrive
60      TCP_WINDOW_CLAMP       = 10, /// Bound advertised window
61      TCP_INFO               = 11, /// Information about this connection.
62      TCP_QUICKACK           = 12, /// Bock/reenable quick ACKs.
63      TCP_CONGESTION         = 13, /// Congestion control algorithm.
64      TCP_MD5SIG             = 14, /// TCP MD5 Signature (RFC2385)
65      TCP_COOKIE_TRANSACTIONS     = 15, /// TCP Cookie Transactions
66      TCP_THIN_LINEAR_TIMEOUTS    = 16, /// Use linear timeouts for thin streams
67      TCP_THIN_DUPACK             = 17, /// Fast retrans. after 1 dupack
68      TCP_USER_TIMEOUT       = 18, /// How long for loss retry before timeout
69      TCP_REPAIR             = 19, /// TCP sock is under repair right now
70      TCP_REPAIR_QUEUE       = 20, /// Set TCP queue to repair
71      TCP_QUEUE_SEQ          = 21, /// Set sequence number of repaired queue.
72      TCP_REPAIR_OPTIONS     = 22, /// Repair TCP connection options
73      TCP_FASTOPEN           = 23, /// Enable FastOpen on listeners
74      TCP_TIMESTAMP          = 24, /// TCP time stamp
75      TCP_NOTSENT_LOWAT      = 25, /// Limit number of unsent bytes in  write queue.
76      TCP_CC_INFO            = 26, /// Get Congestion Control (optional) info.
77      TCP_SAVE_SYN           = 27, /// Record SYN headers for new connections.
78      TCP_SAVED_SYN          = 28, /// Get SYN headers recorded for connection.
79 }
80