eBPF for Windows
tcp.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation
2 // SPDX-License-Identifier: MIT
3 #pragma once
4 
5 struct tcphdr
6 {
7  uint16_t source;
8  uint16_t dest;
9  uint32_t seq; // Sequence Number
10  uint32_t ack_seq; // Acknowledgement Number
11 
12  // List bits in each byte from right (low) to left (high).
13  uint16_t ns : 1;
14  uint16_t reserved : 3;
15  uint16_t doff : 4; // Data Offset
16 
17  uint16_t fin : 1;
18  uint16_t syn : 1;
19  uint16_t rst : 1;
20  uint16_t psh : 1;
21  uint16_t ack : 1;
22  uint16_t urg : 1;
23  uint16_t ece : 1;
24  uint16_t cwr : 1;
25 
26  uint16_t window; // Window Size
27  uint16_t check; // Checksum
28  uint16_t urg_ptr; // Urgent Pointer
29 };
30 
31 // Verify the bit fields give the correct header size.
32 #ifndef C_ASSERT
33 #define C_ASSERT(e) typedef char __C_ASSERT__[(e) ? 1 : -1]
34 #endif
35 C_ASSERT(sizeof(struct tcphdr) == 20);
#define C_ASSERT(e)
Definition: tcp.h:33
Definition: tcp.h:6
uint16_t urg_ptr
Definition: tcp.h:28
uint16_t dest
Definition: tcp.h:8
uint16_t fin
Definition: tcp.h:17
uint16_t psh
Definition: tcp.h:20
uint16_t ece
Definition: tcp.h:23
uint16_t window
Definition: tcp.h:26
uint16_t rst
Definition: tcp.h:19
uint16_t syn
Definition: tcp.h:18
uint16_t ack
Definition: tcp.h:21
uint16_t check
Definition: tcp.h:27
uint32_t seq
Definition: tcp.h:9
uint16_t doff
Definition: tcp.h:15
uint16_t source
Definition: tcp.h:7
uint16_t reserved
Definition: tcp.h:14
uint16_t urg
Definition: tcp.h:22
uint16_t ns
Definition: tcp.h:13
uint16_t cwr
Definition: tcp.h:24
uint32_t ack_seq
Definition: tcp.h:10