Broadcom SDK and wireless driver: another attempt to update to ver. 5.10.147.0
[tomato.git] / release / src-rt / include / proto / bcmtcp.h
blob35e2839ec1de8e6bcc6c91833034c4e6bd477943
1 /*
2 * Fundamental constants relating to TCP Protocol
4 * Copyright (C) 2009, Broadcom Corporation
5 * All Rights Reserved.
6 *
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 $
15 #ifndef _bcmtcp_h_
16 #define _bcmtcp_h_
18 /* enable structure packing */
19 #if defined(__GNUC__)
20 #define PACKED __attribute__((packed))
21 #else
22 #pragma pack(1)
23 #define PACKED
24 #endif
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 */
35 struct bcmtcp_hdr
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 */
45 } PACKED;
47 #undef PACKED
48 #if !defined(__GNUC__)
49 #pragma pack()
50 #endif
52 #endif /* #ifndef _bcmtcp_h_ */