aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-06-12 10:01:43 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-15 14:56:19 -0400
commita3433f35a55f7604742cae620c6dc6edfc70db6a (patch)
tree4ce6d169e402c03a48319a9db4055cc31df00d42 /include/net/tcp.h
parentf350a0a87374418635689471606454abc7beaa3a (diff)
tcp: unify tcp flag macros
unify tcp flag macros: TCPHDR_FIN, TCPHDR_SYN, TCPHDR_RST, TCPHDR_PSH, TCPHDR_ACK, TCPHDR_URG, TCPHDR_ECE and TCPHDR_CWR. TCBCB_FLAG_* are replaced with the corresponding TCPHDR_*. Signed-off-by: Changli Gao <xiaosuo@gmail.com> ---- include/net/tcp.h | 24 ++++++------- net/ipv4/tcp.c | 8 ++-- net/ipv4/tcp_input.c | 2 - net/ipv4/tcp_output.c | 59 ++++++++++++++++----------------- net/netfilter/nf_conntrack_proto_tcp.c | 32 ++++++----------- net/netfilter/xt_TCPMSS.c | 4 -- 6 files changed, 58 insertions(+), 71 deletions(-) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 573166484413..9e68e25c8b82 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -602,6 +602,17 @@ extern u32 __tcp_select_window(struct sock *sk);
602 */ 602 */
603#define tcp_time_stamp ((__u32)(jiffies)) 603#define tcp_time_stamp ((__u32)(jiffies))
604 604
605#define tcp_flag_byte(th) (((u_int8_t *)th)[13])
606
607#define TCPHDR_FIN 0x01
608#define TCPHDR_SYN 0x02
609#define TCPHDR_RST 0x04
610#define TCPHDR_PSH 0x08
611#define TCPHDR_ACK 0x10
612#define TCPHDR_URG 0x20
613#define TCPHDR_ECE 0x40
614#define TCPHDR_CWR 0x80
615
605/* This is what the send packet queuing engine uses to pass 616/* This is what the send packet queuing engine uses to pass
606 * TCP per-packet control information to the transmission 617 * TCP per-packet control information to the transmission
607 * code. We also store the host-order sequence numbers in 618 * code. We also store the host-order sequence numbers in
@@ -620,19 +631,6 @@ struct tcp_skb_cb {
620 __u32 end_seq; /* SEQ + FIN + SYN + datalen */ 631 __u32 end_seq; /* SEQ + FIN + SYN + datalen */
621 __u32 when; /* used to compute rtt's */ 632 __u32 when; /* used to compute rtt's */
622 __u8 flags; /* TCP header flags. */ 633 __u8 flags; /* TCP header flags. */
623
624 /* NOTE: These must match up to the flags byte in a
625 * real TCP header.
626 */
627#define TCPCB_FLAG_FIN 0x01
628#define TCPCB_FLAG_SYN 0x02
629#define TCPCB_FLAG_RST 0x04
630#define TCPCB_FLAG_PSH 0x08
631#define TCPCB_FLAG_ACK 0x10
632#define TCPCB_FLAG_URG 0x20
633#define TCPCB_FLAG_ECE 0x40
634#define TCPCB_FLAG_CWR 0x80
635
636 __u8 sacked; /* State flags for SACK/FACK. */ 634 __u8 sacked; /* State flags for SACK/FACK. */
637#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ 635#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */
638#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ 636#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */