|
| | jtcpsa () |
| |
| | jtcpsa (direction_t dir, uint32_t mtu, uint16_t src, uint16_t dst, uint32_t seqnum, uint32_t acknum, uint8_t doffset, uint8_t flags, uint16_t window, uint16_t urgpointer, uint32_t timeout) |
| |
|
| jtcpsa (jtcpsa &rhs) |
| | Standard copy constructor.
|
| |
|
virtual | ~jtcpsa ()=default |
| | Standard deconstructor.
|
| |
|
| jtcpsa (std::shared_ptr< jtcpsa > &rhs) |
| | Standard copy constructor from shared pointer.
|
| |
| template<typename T > |
| void | set_field (field_t field, T fieldval) |
| |
| template<typename T > |
| T | get_field (field_t field) |
| |
| void | to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction) |
| |
| void | to_json (std::ofstream &myjson, direction_t direction, std::string &indent) |
| |
|
| jtcpsa (const jtcpsa &jtcpsa)=delete |
| |
| | jsecass () |
| |
|
virtual | ~jsecass ()=default |
| | Standard deconstructor.
|
| |
|
| jsecass (jsecass &jsecass)=delete |
| |
|
| jsecass (const jsecass &jsecass)=delete |
| |
◆ jtcpsa() [1/2]
| ProtocolPP::jtcpsa::jtcpsa |
( |
| ) |
|
Standard constructor using default values
TCP Defaults
| field | Default Value |
| dir | direction_t::ENCAP |
| mtu | 1500 |
| src | 0xDEAD |
| dst | 0xBEEF |
| seqnum | 0x00000001 |
| acknum | 0x00000001 |
| doffset | 0 |
| flags | 0 |
| window | 1500 |
| urgpointer | 0 |
| timeout | 0 |
◆ jtcpsa() [2/2]
| ProtocolPP::jtcpsa::jtcpsa |
( |
direction_t |
dir, |
|
|
uint32_t |
mtu, |
|
|
uint16_t |
src, |
|
|
uint16_t |
dst, |
|
|
uint32_t |
seqnum, |
|
|
uint32_t |
acknum, |
|
|
uint8_t |
doffset, |
|
|
uint8_t |
flags, |
|
|
uint16_t |
window, |
|
|
uint16_t |
urgpointer, |
|
|
uint32_t |
timeout |
|
) |
| |
TCP security association needed to setup a flow
- Parameters
-
| dir | - direction. Because TCP is bi-directional in all cases, this parameter is mainly used to decide if a file is being read from or written to (ENCAP or DECAP) and it keeps the interface consistent with other protocols |
| mtu | - Maximum Transmission Unit |
| src | - Source Port |
| dst | - Destination Port |
| seqnum | - Sequence Number |
| acknum | - Acknowledgement Number |
| doffset | - offset to where data begins |
| flags | - header flags in following order (RSVD, RSVD, URG, ACK, PSH, RST, SYN, FIN) |
| window | - size of the receive window |
| urgpointer | - points to the octet following urgent data |
| timeout | - Time to wait before closing idle socket |
◆ get_field()
template<typename T >
| T ProtocolPP::jtcpsa::get_field |
( |
field_t |
field | ) |
|
Retrieves a boolean value from the field requested. If the function is called with a field that is not a boolean, this function prints an error to the screen
TCP Get Fields
| field type | field name | Example |
| direction_t | DIRECTION | direction_t mydir = get_field<direction_t>(field_t::DIRECTION) |
| uint32_t | MTU | uint32_t mymtu = get_field<uint32_t>(field_t::MTU) |
| SEQNUM | uint32_t myseqnum = get_field<uint32_t>(field_t::SEQNUM) |
| ACKNUM | uint32_t myacknum = get_field<uint32_t>(field_t::ACKNUM) |
| TIMEOUT | uint32_t mytimeout = get_field<uint32_t>(field_t::TIMEOUT) |
| uint16_t | SOURCE | uint16_t mysrc = get_field<uint16_t>(field_t::SOURCE) |
| DESTINATION | uint16_t mydst = get_field<uint16_t>(field_t::DESTINATION) |
| WINDOW | uint16_t mywin = get_field<uint16_t>(field_t::WINDOW) |
| URGPOINTER | uint16_t myptr = get_field<uint16_t>(field_t::URGPOINTER) |
| uint8_t | DOFFSET | uint8_t myoff = get_field<uint8_t>(field_t::DOFFSET) |
| FLAGS | uint8_t myflags = get_field<uint8_t>(field_t::FLAGS) |
Due to their dynamic nature, some fields are only available in jtcp which include the following fields
- LENGTH
- CHECKSUM
- STATE
- LISTEN
- SYN_SENT
- SYN_RCVD
- FIN_WAIT_1
- FIN_WAIT_2
- CLOSE_WAIT
- LAST_ACK
- TIME_WAIT
- CLOSED
- SNDUNA
- SNDNXT
- SNDWND
- SNDUP
- SNDW1
- SNDW2
- ISS
- RCVNXT
- RCVWND
- RCVUP
- IRS
- Parameters
-
- Returns
- - boolean value from the field
◆ set_field()
template<typename T >
| void ProtocolPP::jtcpsa::set_field |
( |
field_t |
field, |
|
|
T |
fieldval |
|
) |
| |
Sets a boolean field in the security association. If the function is called with a field that is not boolean, this function prints an error to the screen
TCP Set Fields
| field type | field name | Example |
| direction_t | DIRECTION | set_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP) |
| uint32_t | MTU | set_field<uint32_t>(field_t::MTU, 1500) |
| SEQNUM | set_field<uint32_t>(field_t::SEQNUM, 0x00000001) |
| ACKNUM | set_field<uint32_t>(field_t::ACKNUM, 0x00000001) |
| TIMEOUT | set_field<uint32_t>(field_t::TIMEOUT, 0x00000001) |
| uint16_t | SOURCE | set_field<uint16_t>(field_t::SOURCE, 0xDEAD) |
| DESTINATION | set_field<uint16_t>(field_t::DESTINATION, 0xBEEF) |
| WINDOW | set_field<uint16_t>(field_t::WINDOW, 0x1000) |
| URGPOINTER | set_field<uint16_t>(field_t::URGPOINTER, 0x1000) |
| uint8_t | DOFFSET | set_field<uint8_t>(field_t::DOFFSET, 0x10) |
| FLAGS | set_field<uint8_t>(field_t::FLAGS, 0x10) |
Due to their dynamic nature, some fields are only available in jtcp which include the following fields
- LENGTH
- CHECKSUM
- STATE
- LISTEN
- SYN_SENT
- SYN_RCVD
- FIN_WAIT_1
- FIN_WAIT_2
- CLOSE_WAIT
- LAST_ACK
- TIME_WAIT
- CLOSED
- SNDUNA
- SNDNXT
- SNDWND
- SNDUP
- SNDW1
- SNDW2
- ISS
- RCVNXT
- RCVWND
- RCVUP
- IRS
- Parameters
-
| field | - field to set |
| fieldval | - boolean value for the field |
◆ to_json()
| void ProtocolPP::jtcpsa::to_json |
( |
std::ofstream & |
myjson, |
|
|
direction_t |
direction, |
|
|
std::string & |
indent |
|
) |
| |
|
virtual |
print the protocol and security objects as JSON
- Parameters
-
| myjson- | object to print to JSON |
| direction | - randomization |
| indent | - indentation for JSON output |
Implements ProtocolPP::jsecass.
◆ to_xml()
print the protocol and security objects as XML
- Parameters
-
| myxml | - object to print to XML |
| direction | - randomization |
Implements ProtocolPP::jsecass.
The documentation for this class was generated from the following file: