1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cstdlib/LINCINET/TCP.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,104 @@
1.4 +/* TCP.H
1.5 + *
1.6 + * Portions Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
1.7 + * All rights reserved.
1.8 + */
1.9 +
1.10 +/** @file
1.11 +@publishedAll
1.12 +@released
1.13 +*/
1.14 +
1.15 +/*
1.16 + * Copyright (c) 1982, 1986 Regents of the University of California.
1.17 + * All rights reserved. The Berkeley software License Agreement
1.18 + * specifies the terms and conditions for redistribution.
1.19 + */
1.20 +
1.21 +#ifndef _NETINET_TCP_H
1.22 +#define _NETINET_TCP_H
1.23 +
1.24 +#ifdef __cplusplus
1.25 +extern "C" {
1.26 +#endif
1.27 +
1.28 +typedef u_long tcp_seq;
1.29 +/**
1.30 +TCP header.
1.31 +Per RFC 793, September, 1981.
1.32 +@PublishedAll
1.33 +*/
1.34 +struct tcphdr {
1.35 + u_short th_sport; /* source port */
1.36 + u_short th_dport; /* destination port */
1.37 + tcp_seq th_seq; /* sequence number */
1.38 + tcp_seq th_ack; /* acknowledgement number */
1.39 +#ifdef _BIT_FIELDS_LTOH
1.40 + u_int th_x2:4, /* (unused) */
1.41 + th_off:4; /* data offset */
1.42 +#else
1.43 + u_int th_off:4, /* data offset */
1.44 + th_x2:4; /* (unused) */
1.45 +#endif
1.46 + u_char th_flags;
1.47 +/**
1.48 +@PublishedAll
1.49 +*/
1.50 +#define TH_FIN 0x01
1.51 +/**
1.52 +@PublishedAll
1.53 +*/
1.54 +#define TH_SYN 0x02
1.55 +/**
1.56 +@PublishedAll
1.57 +*/
1.58 +#define TH_RST 0x04
1.59 +/**
1.60 +@PublishedAll
1.61 +*/
1.62 +#define TH_PUSH 0x08
1.63 +/**
1.64 +@PublishedAll
1.65 +*/
1.66 +#define TH_ACK 0x10
1.67 +/**
1.68 +@PublishedAll
1.69 +*/
1.70 +#define TH_URG 0x20
1.71 + u_short th_win; /* window */
1.72 + u_short th_sum; /* checksum */
1.73 + u_short th_urp; /* urgent pointer */
1.74 +};
1.75 +
1.76 +#define TCPOPT_EOL 0
1.77 +#define TCPOPT_NOP 1
1.78 +#define TCPOPT_MAXSEG 2
1.79 +
1.80 +/**
1.81 +Default maximum segment size for TCP.
1.82 +With an IP MSS of 576, this is 536,
1.83 +but 512 is probably more convenient.
1.84 +*/
1.85 +#ifdef lint
1.86 +#define TCP_MSS 536
1.87 +#else
1.88 +#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))
1.89 +#endif
1.90 +
1.91 +/**
1.92 +User-settable options (used with setsockopt).
1.93 +*/
1.94 +#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
1.95 +#define TCP_MAXSEG 0x02 /* set maximum segment size */
1.96 +
1.97 +#define TCP_NOTIFY_THRESHOLD 0x10
1.98 +#define TCP_ABORT_THRESHOLD 0x11
1.99 +#define TCP_CONN_NOTIFY_THRESHOLD 0x12
1.100 +#define TCP_CONN_ABORT_THRESHOLD 0x13
1.101 +
1.102 +
1.103 +#ifdef __cplusplus
1.104 +}
1.105 +#endif
1.106 +
1.107 +#endif /* _NETINET_TCP_H */