Protocol++® (Protocolpp®)
v5.6.2
|
Public Member Functions | |
jip (std::shared_ptr< jipsa > &security) | |
jip (std::shared_ptr< jipsa > &security, std::string &file) | |
virtual | ~jip ()=default |
Standard deconstructor. | |
void | encap_packet (std::shared_ptr< jarray< uint8_t >> &output) |
void | encap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output) |
void | decap_packet (std::shared_ptr< jarray< uint8_t >> &input) |
void | decap_packet (std::shared_ptr< jarray< uint8_t >> &input, std::shared_ptr< jarray< uint8_t >> &output) |
void | set_hdr (jarray< uint8_t > &hdr) |
void | set_exthdr (jarray< uint8_t > &exthdr) |
void | set_field (field_t field, uint64_t value) |
jarray< uint8_t > | format_exthdr (iana_t extension, iana_t nh, jarray< uint8_t > &data, uint16_t type_offset=0, uint8_t segments=0) |
jarray< uint8_t > | get_hdr () |
jarray< uint8_t > | get_exthdr () |
uint64_t | get_field (field_t field, jarray< uint8_t > &iphdr) |
uint64_t | get_field (field_t field) |
void | get_security (std::shared_ptr< jipsa > &sec) |
void | to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction) |
void | to_json (std::ofstream &myjson, direction_t direction, std::string &indent) |
jip (jip &jip)=delete | |
jip (const jip &jip)=delete | |
Public Member Functions inherited from ProtocolPP::jprotocol | |
jprotocol (direction_t dir) | |
jprotocol (direction_t dir, std::string &file) | |
jprotocol (direction_t dir, std::shared_ptr< jrand > &rand) | |
jprotocol (direction_t dir, std::shared_ptr< jrand > &rand, std::string &file) | |
virtual | ~jprotocol () |
Standard deconstructor. | |
bool | hasfile () |
uint32_t | get_status () |
jarray< uint8_t > | checksum (iana_t prot, direction_t dir, jarray< uint8_t > &check, uint32_t offset=0) |
jarray< uint8_t > | pad (pad_t padtype, uint32_t len) |
jprotocol (jprotocol &jprotocol)=delete | |
jprotocol (const jprotocol &jprotocol)=delete | |
Additional Inherited Members | |
Static Public Member Functions inherited from ProtocolPP::jprotocol | |
const static std::string | currentDateTime () |
static std::string | str_status (uint32_t status) |
static jarray< uint8_t > | to_array (uint8_t input) |
static jarray< uint8_t > | to_array (uint16_t input) |
static jarray< uint8_t > | to_array (uint32_t input) |
static jarray< uint8_t > | to_array (uint64_t input) |
static uint8_t | to_u8 (jarray< uint8_t > src_array) |
static uint16_t | to_u16 (jarray< uint8_t > src_array) |
static uint32_t | to_u32 (jarray< uint8_t > src_array) |
static uint64_t | to_u64 (jarray< uint8_t > src_array) |
static uint32_t | fnv_hash (std::shared_ptr< jarray< uint8_t >> &header, jarray< uint8_t > &mask, uint32_t hdrlen) |
Protected Member Functions inherited from ProtocolPP::jprotocol | |
template<typename T , typename TE > | |
std::shared_ptr< jreplay< T, TE > > | update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size) |
template<typename T , typename TE > | |
std::shared_ptr< jreplay< T, TE > > | update_replay (protocol_t prot, T &seqnum, TE &extseq, bool usext, uint32_t size, jarray< uint8_t > &window) |
void | update_status (uint32_t stat) |
void | get_data (std::shared_ptr< jarray< uint8_t >> &data) |
void | put_data (std::shared_ptr< jarray< uint8_t >> &wdata) |
void | encryptdat (std::shared_ptr< jarray< uint8_t >> &red, std::shared_ptr< jarray< uint8_t >> &black) |
void | decryptdat (std::shared_ptr< jarray< uint8_t >> &black, std::shared_ptr< jarray< uint8_t >> &red) |
uint32_t | roundup (uint32_t value, uint32_t mult) |
Protected Attributes inherited from ProtocolPP::jprotocol | |
direction_t | m_dir |
direction of processing | |
uint32_t | m_status |
std::shared_ptr< jrand > | m_rand |
random data generator passed into constructor | |
std::string | m_filename |
file input string for this protocol | |
std::fstream | m_file |
input file stream object for this protocol | |
endian_t | m_endian |
endianess string for this protocol | |
|
explicit |
constructor for normal IP
security | - parameters necessary to setup and IP flow such as NH, SRC, DST, DSECN, TTL, FLAGS(IPv4), ID(IPv4), and LABEL(IPv6) |
ProtocolPP::jip::jip | ( | std::shared_ptr< jipsa > & | security, |
std::string & | file | ||
) |
constructor for normal IP with file containing input data
security | - parameters necessary to setup and IP flow such as NH, SRC, DST, DSECN, TTL, FLAGS(IPv4), ID(IPv4), and LABEL(IPv6) |
file | - File containing input data |
|
virtual |
This function is for use with the constructor with a file handle. Decap will produce a payload from the packet passed in and write it to the output file
input | - IP encapsulated packet to decapsulate |
Reimplemented from ProtocolPP::jprotocol.
|
virtual |
This function is for use with the constructor without a file handle. Decap will produce a payload from the packet passed in.
input | - IP encapsulated packet to decapsulate |
output | - decapsulated payload |
Implements ProtocolPP::jprotocol.
|
virtual |
This function is for use with the constructor without a file handle. Encap will produce a packet with the payload passed in
input | - payload to encapsulate with IP |
output | - IP encapsulated packet |
Implements ProtocolPP::jprotocol.
|
virtual |
This function is for use with the constructor with a file handle. Encap will produce a packet with a payload from the file handle passed in
output | - IP encapsulated packet |
Reimplemented from ProtocolPP::jprotocol.
jarray<uint8_t> ProtocolPP::jip::format_exthdr | ( | iana_t | extension, |
iana_t | nh, | ||
jarray< uint8_t > & | data, | ||
uint16_t | type_offset = 0 , |
||
uint8_t | segments = 0 |
||
) |
Adds extension headers to the packet
extension | - extension type to add to IP header |
nh | - Next Header (NH) for this extension header |
data | - Data necessary for the extension header (32-bit length for JUMBOGRAM, Route header, Identifcation for Fragment, etc.) |
type_offset | - Type (8-bits) for Routing header, offset (13-bits) for Fragment header |
segments | - Number of segments left for Routing header (8-bits), "More" bit for Fragment header (1-bit) |
jarray<uint8_t> ProtocolPP::jip::get_exthdr | ( | ) |
Returns the extension header
|
virtual |
Returns the field from the security association
field | - field to retrieve from the security association |
Reimplemented from ProtocolPP::jprotocol.
Returns the version field of the IP header
field | - field to retrieve from the IP header |
iphdr | - header to retrieve the field from |
Implements ProtocolPP::jprotocol.
|
virtual |
void ProtocolPP::jip::get_security | ( | std::shared_ptr< jipsa > & | sec | ) |
get_security
sec | - Shared pointer to hold the security association |
void ProtocolPP::jip::set_exthdr | ( | jarray< uint8_t > & | exthdr | ) |
Allows the user to update the IP extension header with their own header
exthdr | - new extension header to use |
|
virtual |
Allows the user to update the field of the IP header
field | - field to update the IP header with |
value | - value to update the IP header with |
Implements ProtocolPP::jprotocol.
|
virtual |
Allows the user to update the IP header with their own header Note : This function will NOT save the previous header. If it is desired to keep the current header the user would need to use the get_iphdr() function and save the current header before updating the IP header with a custom header. The header would then need to be restored when the custom header is no longer needed
hdr | - new IP header to use |
Implements ProtocolPP::jprotocol.
|
virtual |
Prints the protocol object in JSON
myjson | - JSON object to print to |
direction | - randomzation |
indent | - indentation for JSON output |
Implements ProtocolPP::jprotocol.
|
virtual |
Prints the protocol object in XML
myxml | - XMLPrinter object to print to |
direction | - randomzation |
Implements ProtocolPP::jprotocol.