Myra Canyon  v0.0.1-768
network control
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Myra::L4_TCP Namespace Reference

Definitions and helper functions for when layer 4 is TCP. More...

Classes

struct  Header
 TCP header. More...
 

Enumerations

enum  Options {
  Options::EndOfOption = 0,
  Options::NoOp = 1,
  Options::MaximumSegmentSize = 2,
  Options::WindowScale = 3,
  Options::SACKPermitted = 4,
  Options::SACK = 5,
  Options::Timestamp = 8,
  Options::Unknown = 255
}
 TCP options which may be found between the TCP header and the payload. More...
 

Functions

const Headerget_header (const L3_IPv4::Header *l3)
 Get the L4_TCP::Header. More...
 
const Headerget_header (const L3_IPv6::Header *l3)
 Get the L4_TCP::Header. More...
 
int get_data_offset (const Header *header)
 Number of 32-bit words in the TCP header. More...
 
bool is_RES3_flag (const Header *header)
 Reserved flag #3. More...
 
bool is_RES2_flag (const Header *header)
 Reserved flag #2. More...
 
bool is_RES1_flag (const Header *header)
 Reserved flag #1. More...
 
bool is_NS_flag (const Header *header)
 ECN-nonce concealment in L4_TCP::Header::data_offset_and_flags. More...
 
bool is_CWR_flag (const Header *header)
 Congrestion window reduced (RFC 3168) in L4_TCP::Header::flags. More...
 
bool is_ECE_flag (const Header *header)
 ECN-Echo (RFC 3168) in L4_TCP::Header::flags. More...
 
bool is_URG_flag (const Header *header)
 Urgent pointer field in L4_TCP::Header::flags. More...
 
bool is_ACK_flag (const Header *header)
 Acknowledgement in L4_TCP::Header::flags. More...
 
bool is_PSH_flag (const Header *header)
 Push in L4_TCP::Header::flags. More...
 
bool is_RST_flag (const Header *header)
 RST in L4_TCP::Header::flags. More...
 
bool is_SYN_flag (const Header *header)
 SYN in L4_TCP::Header::flags. More...
 
bool is_FIN_flag (const Header *header)
 FIN in L4_TCP::Header::flags. More...
 
uint16_t get_header_length (const Header *header)
 32 bit words, but 8 bits per byte. More...
 
uint16_t get_payload_length (const L3_IPv4::Header *l3)
 Get the TCP payload length. More...
 
uint16_t get_payload_length (const L3_IPv6::Header *l3)
 Get the TCP payload length. More...
 
uint16_t get_options_length (const Header *header)
 Get the number of bytes in the TCP options between the header and the payload. More...
 
const uint8_t * get_payload (const Header *header)
 Get a pointer to the payload. More...
 
Options get_option (const uint8_t *raw)
 Convert the option at the given location to Myra::L4_TCP::Options. More...
 
const uint8_t * get_next_option (const uint8_t *raw)
 Starting at the location specified by raw, find the location of the next TCP option. More...
 

Detailed Description

Definitions and helper functions for when layer 4 is TCP.

Enumeration Type Documentation

enum Myra::L4_TCP::Options
strong

TCP options which may be found between the TCP header and the payload.

Note
This is not a complete list of possible TCP options.
Enumerator
EndOfOption 
NoOp 

0: total len: 1 byte

MaximumSegmentSize 

1: total len: 1 byte

WindowScale 

2: total len: 4 bytes [SYN]

SACKPermitted 

3: total len: 3 bytes [SYN]

SACK 

4: total len: 2 bytes [SYN]

Timestamp 

5: total len: variable

Unknown 

8: total len: 10 bytes

Function Documentation

int Myra::L4_TCP::get_data_offset ( const Header *  header)
inline

Number of 32-bit words in the TCP header.

Here is the caller graph for this function:

const Header* Myra::L4_TCP::get_header ( const L3_IPv4::Header *  l3)
inline

Get the L4_TCP::Header.

Here is the call graph for this function:

Here is the caller graph for this function:

const Header* Myra::L4_TCP::get_header ( const L3_IPv6::Header *  l3)
inline

Get the L4_TCP::Header.

Here is the call graph for this function:

uint16_t Myra::L4_TCP::get_header_length ( const Header *  header)
inline

32 bit words, but 8 bits per byte.

Here is the call graph for this function:

Here is the caller graph for this function:

const uint8_t * Myra::L4_TCP::get_next_option ( const uint8_t *  raw)

Starting at the location specified by raw, find the location of the next TCP option.

Returns
nullptr if there are no further TCP options

Here is the call graph for this function:

Myra::L4_TCP::Options Myra::L4_TCP::get_option ( const uint8_t *  raw)

Convert the option at the given location to Myra::L4_TCP::Options.

Here is the caller graph for this function:

uint16_t Myra::L4_TCP::get_options_length ( const Header *  header)
inline

Get the number of bytes in the TCP options between the header and the payload.

Here is the call graph for this function:

Here is the caller graph for this function:

const uint8_t* Myra::L4_TCP::get_payload ( const Header *  header)
inline

Get a pointer to the payload.

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t Myra::L4_TCP::get_payload_length ( const L3_IPv4::Header *  l3)
inline

Get the TCP payload length.

Here is the call graph for this function:

Here is the caller graph for this function:

uint16_t Myra::L4_TCP::get_payload_length ( const L3_IPv6::Header *  l3)
inline

Get the TCP payload length.

Here is the call graph for this function:

bool Myra::L4_TCP::is_ACK_flag ( const Header *  header)
inline

Acknowledgement in L4_TCP::Header::flags.

Here is the caller graph for this function:

bool Myra::L4_TCP::is_CWR_flag ( const Header *  header)
inline

Congrestion window reduced (RFC 3168) in L4_TCP::Header::flags.

bool Myra::L4_TCP::is_ECE_flag ( const Header *  header)
inline

ECN-Echo (RFC 3168) in L4_TCP::Header::flags.

bool Myra::L4_TCP::is_FIN_flag ( const Header *  header)
inline

FIN in L4_TCP::Header::flags.

Here is the caller graph for this function:

bool Myra::L4_TCP::is_NS_flag ( const Header *  header)
inline

ECN-nonce concealment in L4_TCP::Header::data_offset_and_flags.

bool Myra::L4_TCP::is_PSH_flag ( const Header *  header)
inline
bool Myra::L4_TCP::is_RES1_flag ( const Header *  header)
inline

Reserved flag #1.

bool Myra::L4_TCP::is_RES2_flag ( const Header *  header)
inline

Reserved flag #2.

bool Myra::L4_TCP::is_RES3_flag ( const Header *  header)
inline

Reserved flag #3.

bool Myra::L4_TCP::is_RST_flag ( const Header *  header)
inline

RST in L4_TCP::Header::flags.

Here is the caller graph for this function:

bool Myra::L4_TCP::is_SYN_flag ( const Header *  header)
inline

SYN in L4_TCP::Header::flags.

Here is the caller graph for this function:

bool Myra::L4_TCP::is_URG_flag ( const Header *  header)
inline

Urgent pointer field in L4_TCP::Header::flags.

Here is the caller graph for this function: