Add TCPOPT_* constants.

Adds the TCPOPT_* constants from NetBSD. Note that the BSDs also have
TCPOPT_SIGNATURE, but Linux calls that TCPOPT_MD5SIG and glibc doesn't
have any corresponding constant yet, so let's wait until we see which name
wins out.

Change-Id: If53cdada5595285d9a7e7248ef74cd7502d804c0
This commit is contained in:
Elliott Hughes 2014-01-03 15:58:40 -08:00
parent c1c3f7d446
commit 338e6102a6

View file

@ -25,10 +25,10 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _NETINET_TCP_H
#define _NETINET_TCP_H
#include <endian.h> /* Include *before* linux/tcp.h */
#include <linux/tcp.h>
__BEGIN_DECLS
@ -47,6 +47,21 @@ enum {
TCP_CLOSING
};
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
#define TCPOLEN_MAXSEG 4
#define TCPOPT_WINDOW 3
#define TCPOLEN_WINDOW 3
#define TCPOPT_SACK_PERMITTED 4
#define TCPOLEN_SACK_PERMITTED 2
#define TCPOPT_SACK 5
#define TCPOPT_TIMESTAMP 8
#define TCPOLEN_TIMESTAMP 10
#define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2)
#define TCPOPT_TSTAMP_HDR (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
__END_DECLS
#endif /* _NETINET_TCP_H */