Max OS 0.3
Loading...
Searching...
No Matches
tcp.h File Reference

Defines the Transmission Control Protocol (TCP) structures and classes for handling TCP sockets and payloads. More...

#include <cstdint>
#include <net/ipv4.h>
#include <memory/memorymanagement.h>

Go to the source code of this file.

Classes

struct  MaxOS::net::TCPHeader
 The header of a TCP packet. More...
 
struct  MaxOS::net::TCPPseudoHeader
 The pseudo header used for TCP checksum calculation. More...
 
class  MaxOS::net::DataReceivedEvent
 Event for when data is received on a TCP socket. More...
 
class  MaxOS::net::ConnectedEvent
 Event for when a TCP socket is connected. More...
 
class  MaxOS::net::DisconnectedEvent
 Event for when a TCP socket is disconnected. More...
 
class  MaxOS::net::TCPPayloadHandler
 Handler for TCP payloads. More...
 
class  MaxOS::net::TCPSocket
 A TCP socket. Allows for sending and receiving data over TCP at a port. More...
 
class  MaxOS::net::TransmissionControlProtocolHandler
 Handles TCP packets and manages TCP sockets. More...
 

Typedefs

typedef uint16_t MaxOS::net::TransmissionControlProtocolPort
 TCP port.
 
typedef struct PACKED MaxOS::net::TCPHeader MaxOS::net::tcp_header_t
 Alias for TCPHeader struct.
 
typedef struct PACKED MaxOS::net::TCPPseudoHeader MaxOS::net::tcp_pseudo_header_t
 Alias for TCPPseudoHeader struct.
 

Enumerations

enum class  MaxOS::net::TCPSocketState {
  CLOSED , LISTEN , SYN_SENT , SYN_RECEIVED ,
  ESTABLISHED , FIN_WAIT1 , FIN_WAIT2 , CLOSING ,
  TIME_WAIT , CLOSE_WAIT , LAST_ACK
}
 The state of a TCP socket. More...
 
enum class  MaxOS::net::TCPFlag {
  FIN = 1 , SYN = 2 , RST = 4 , PSH = 8 ,
  ACK = 16 , URG = 32 , ECE = 64 , CWR = 128 ,
  NS = 256
}
 The flags in a TCP header. More...
 
enum class  MaxOS::net::TCPPayloadHandlerEvents { CONNECTED , DISCONNECTED , DATA_RECEIVED }
 Events for the TCPPayloadHandler. More...
 

Detailed Description

Defines the Transmission Control Protocol (TCP) structures and classes for handling TCP sockets and payloads.

Date
12th September 2022
Author
Max Tyson

Definition in file tcp.h.

Typedef Documentation

◆ TransmissionControlProtocolPort

TCP port.

Todo:
: Make TCPPort class and do tcp_port_t

Definition at line 19 of file tcp.h.

Enumeration Type Documentation

◆ TCPFlag

enum class MaxOS::net::TCPFlag
strong

The flags in a TCP header.

Definition at line 46 of file tcp.h.

46 {
47 FIN = 1,
48 SYN = 2,
49 RST = 4,
50 PSH = 8,
51 ACK = 16,
52 URG = 32,
53 ECE = 64,
54 CWR = 128,
55 NS = 256
56 };

◆ TCPPayloadHandlerEvents

Events for the TCPPayloadHandler.

Definition at line 113 of file tcp.h.

113 {
114 CONNECTED,
115 DISCONNECTED,
116 DATA_RECEIVED
117 };

◆ TCPSocketState

enum class MaxOS::net::TCPSocketState
strong

The state of a TCP socket.

Definition at line 25 of file tcp.h.

25 {
26 CLOSED,
27 LISTEN,
28 SYN_SENT,
29 SYN_RECEIVED,
30
31 ESTABLISHED,
32
33 FIN_WAIT1,
34 FIN_WAIT2,
35 CLOSING,
36 TIME_WAIT,
37
38 CLOSE_WAIT,
39 LAST_ACK
40 };