2 * Fundamental constants relating to TCP Protocol
4 * Copyright (C) 2009, Broadcom Corporation
7 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
12 * $Id: bcmtcp.h,v 1.2.28.1 2009/10/12 23:01:02 Exp $
18 /* enable structure packing */
20 #define PACKED __attribute__((packed))
26 #define TCP_SRC_PORT_OFFSET 0 /* TCP source port offset */
27 #define TCP_DEST_PORT_OFFSET 2 /* TCP dest port offset */
28 #define TCP_CHKSUM_OFFSET 16 /* TCP body checksum offset */
30 #define TCP_FLAG_RST 0x0004
31 #define TCP_FLAG_SYN 0x0002
32 #define TCP_FLAG_FIN 0x0001
34 /* These fields are stored in network order */
37 uint16 src_port
; /* Source Port Address */
38 uint16 dst_port
; /* Destination Port Address */
39 uint32 seq_num
; /* TCP Sequence Number */
40 uint32 ack_num
; /* TCP Sequence Number */
41 uint16 hdrlen_rsvd_flags
; /* Header length, reserved bits and flags */
42 uint16 tcpwin
; /* TCP window */
43 uint16 chksum
; /* Segment checksum with pseudoheader */
44 uint16 urg_ptr
; /* Points to seq-num of byte following urg data */
48 #if !defined(__GNUC__)
52 #endif /* #ifndef _bcmtcp_h_ */