summaryrefslogtreecommitdiff
path: root/tcp.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-12-11 00:17:47 -0800
committerGuy Harris <guy@alum.mit.edu>2017-12-11 00:17:47 -0800
commit0f328b4aa16b0b47f05a85c440ce1d07719e3cac (patch)
treea5a9a3a1dad2f4ce32c9116665d420ae06c448dc /tcp.h
parente1dd70a1b6754ba6946095cdbdb7850c08541117 (diff)
downloadtcpdump-0f328b4aa16b0b47f05a85c440ce1d07719e3cac.tar.gz
More nd_ification of structures.
We don't need to use & to get a pointer to an nd_uintN_t/nd_intN_t type, as they're arrays.
Diffstat (limited to 'tcp.h')
-rw-r--r--tcp.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/tcp.h b/tcp.h
index d9ffd0df..a6916052 100644
--- a/tcp.h
+++ b/tcp.h
@@ -33,24 +33,23 @@
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
*/
-typedef uint32_t tcp_seq;
/*
* TCP header.
* Per RFC 793, September, 1981.
*/
struct tcphdr {
- uint16_t th_sport; /* source port */
- uint16_t th_dport; /* destination port */
- tcp_seq th_seq; /* sequence number */
- tcp_seq th_ack; /* acknowledgement number */
- uint8_t th_offx2; /* data offset, rsvd */
- uint8_t th_flags;
- uint16_t th_win; /* window */
- uint16_t th_sum; /* checksum */
- uint16_t th_urp; /* urgent pointer */
+ nd_uint16_t th_sport; /* source port */
+ nd_uint16_t th_dport; /* destination port */
+ nd_uint32_t th_seq; /* sequence number */
+ nd_uint32_t th_ack; /* acknowledgement number */
+ nd_uint8_t th_offx2; /* data offset, rsvd */
+ nd_uint8_t th_flags;
+ nd_uint16_t th_win; /* window */
+ nd_uint16_t th_sum; /* checksum */
+ nd_uint16_t th_urp; /* urgent pointer */
} UNALIGNED;
-#define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
+#define TH_OFF(th) ((EXTRACT_U_1((th)->th_offx2) & 0xf0) >> 4)
/* TCP flags */
#define TH_FIN 0x01