Helper Reference Manual  1.7.1
tcp.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2014-2018 Linaro Limited
3  */
4 
5 
12 #ifndef ODPH_TCP_H_
13 #define ODPH_TCP_H_
14 
15 #include <odp_api.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
26 #define ODPH_TCPHDR_LEN 20
29 typedef struct ODP_PACKED {
30  odp_u16be_t src_port;
31  odp_u16be_t dst_port;
32  odp_u32be_t seq_no;
33  odp_u32be_t ack_no;
35  union {
36  odp_u16be_t doffset_flags;
37 #if ODP_BIG_ENDIAN_BITFIELD
38  struct {
39  odp_u16be_t rsvd1:8;
40  odp_u16be_t flags:8;
41  };
42  struct {
43  odp_u16be_t hl:4;
44  odp_u16be_t rsvd3:4;
45  odp_u16be_t cwr:1;
46  odp_u16be_t ece:1;
47  odp_u16be_t urg:1;
48  odp_u16be_t ack:1;
49  odp_u16be_t psh:1;
50  odp_u16be_t rst:1;
51  odp_u16be_t syn:1;
52  odp_u16be_t fin:1;
53  };
54 #elif ODP_LITTLE_ENDIAN_BITFIELD
55  struct {
56  odp_u16be_t flags:8;
57  odp_u16be_t rsvd1:8;
58  };
59  struct {
60  odp_u16be_t rsvd3:4;
61  odp_u16be_t hl:4;
62  odp_u16be_t fin:1;
63  odp_u16be_t syn:1;
64  odp_u16be_t rst:1;
65  odp_u16be_t psh:1;
66  odp_u16be_t ack:1;
67  odp_u16be_t urg:1;
68  odp_u16be_t ece:1;
69  odp_u16be_t cwr:1;
70  };
71 
72 #else
73 #error "Endian BitField order not defined!"
74 #endif
75  };
76  odp_u16be_t window;
77  odp_u16be_t cksm;
78  odp_u16be_t urgptr;
80 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif
struct ODP_PACKED odph_tcphdr_t
TCP header.
Ethernet MAC address.
Definition: eth.h:54
odp_u16be_t dst_port
Destination port.
Definition: sctp.h:31
odp_u32be_t seq_no
Sequence Number.
Definition: ipsec.h:36
odp_u16be_t window
Window size.
Definition: tcp.h:76
odp_u16be_t src_port
Source port.
Definition: sctp.h:30
odp_u16be_t urgptr
Urgent pointer.
Definition: tcp.h:78
odp_u16be_t doffset_flags
TCP Flags aggregate.
Definition: tcp.h:36
odp_u32be_t ack_no
Acknowledgment number.
Definition: tcp.h:33
odp_u16be_t cksm
Checksum.
Definition: tcp.h:77