|
| jicmpsa () |
|
| jicmpsa (direction_t dir, iana_t ver, icmpmsg_t msg, icmpcode_t code, uint8_t dsecn, uint8_t ttl, uint8_t flags, uint16_t fragoff, uint16_t id, uint32_t label, jarray< uint8_t > src, jarray< uint8_t > dst) |
|
| jicmpsa (jicmpsa &security) |
|
| jicmpsa (std::shared_ptr< jicmpsa > &security) |
|
virtual | ~jicmpsa ()=default |
| Standard deconstructor.
|
|
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) |
|
| jicmpsa (const jicmpsa &rhs)=delete |
|
| jsecass () |
|
virtual | ~jsecass ()=default |
| Standard deconstructor.
|
|
| jsecass (jsecass &jsecass)=delete |
|
| jsecass (const jsecass &jsecass)=delete |
|
◆ jicmpsa() [1/4]
ProtocolPP::jicmpsa::jicmpsa |
( |
| ) |
|
Standard Constructor with defaults
ICMP SA Defaults
field | Default Value |
dir | direction_t::DECAP |
ver | iana_t::ICMP |
msg | icmpmsg_t::TIMEXCEED |
code | icmpcode_t::TTLEXPIRE |
dsecn | 0 |
ttl | 0xFF |
flags | 0 |
fragoff | 0 |
id | 0xFFFF |
label | 0xFFFFFFFF |
src | 0xBBBBBBBB |
dst | 0xEEEEEEEE |
Generate the security association for ENCAP and new source and destination addresses do the following:
snd.set_field<
direction_t>(field_t::DIRECTION, direction_t::ENCAP);
direction_t
Definition: jenum.h:1688
◆ jicmpsa() [2/4]
ProtocolPP::jicmpsa::jicmpsa |
( |
direction_t |
dir, |
|
|
iana_t |
ver, |
|
|
icmpmsg_t |
msg, |
|
|
icmpcode_t |
code, |
|
|
uint8_t |
dsecn, |
|
|
uint8_t |
ttl, |
|
|
uint8_t |
flags, |
|
|
uint16_t |
fragoff, |
|
|
uint16_t |
id, |
|
|
uint32_t |
label, |
|
|
jarray< uint8_t > |
src, |
|
|
jarray< uint8_t > |
dst |
|
) |
| |
ICMP security association
- Parameters
-
dir | - Direction of data flow (usually opposite the IP/IPsec flow) |
ver | - Version of ICMP (ICMP or ICMPv6) |
msg | - Message to be sent to SENDER |
code | - Code to be sent to SENDER |
dsecn | - DS/ECN from sender |
ttl | - Time-to-Live/HOP Limit |
flags | - IPv4 flags from sender |
fragoff | - IPv4 fragmentation offset from sender |
id | - IPv4 identification field from sender |
label | - IPv6 label from the sender |
src | - Address of RECEIVER |
dst | - Address of SENDER |
◆ jicmpsa() [3/4]
ProtocolPP::jicmpsa::jicmpsa |
( |
jicmpsa & |
security | ) |
|
constructor for ICMP and ICMPv6
- Parameters
-
security | - Parameters necessary to setup ICMP flow such as DIRECTION, VERSION, MSG, CODE, SRC, DST |
◆ jicmpsa() [4/4]
ProtocolPP::jicmpsa::jicmpsa |
( |
std::shared_ptr< jicmpsa > & |
security | ) |
|
|
explicit |
constructor for ICMP and ICMPv6
- Parameters
-
security | - Parameters necessary to setup ICMP flow such as DIRECTION, VERSION, MSG, CODE, SRC, DST |
◆ get_field()
template<typename T >
T ProtocolPP::jicmpsa::get_field |
( |
field_t |
field | ) |
|
Returns the field in ICMPSA
ICMP SA Get Fields
field type | field name | Example |
direction_t | DIRECTION | direction_t mydir = get_field<direction_t>(field_t::DIRECTION) |
iana_t | VERSION | iana_t myver = get_field<iana_t>(field_t::VERSION) |
icmpmsg_t | MESSAGE | icmpmsg_t mymsg = get_field<icmpmsg_t>(field_t::MESSAGE) |
icmpcode_t | CODE | icmpcode_t mycode = get_field<icmpcode_t>(field_t::CODE) |
uint8_t | DSECN | uint8_t mydsecn = get_field<uint8_t>(field_t::DSECN) |
| TTLHOP | uint8_t myttl = get_field<uint8_t>(field_t::TTLHOP) |
| FLAGS | uint8_t myflags = get_field<uint8_t>(field_t::FLAGS) |
uint16_t | FRAGOFFSET | uint16_t myfragoff = get_field<uint16_t>(field_t::FRAGOFFSET) |
| ID | uint16_t myid = get_field<uint16_t>(field_t::ID) |
| LABEL | uint32_t mylabel = get_field<uint32_t>(field_t::LABEL) |
jarray<uint8_t> | SOURCE | jarray<uint8_t> mysrc = get_field<jarray<uint8_t>>(field_t::SOURCE) |
| DESTINATION | jarray<uint8_t> mydst = get_field<jarray<uint8_t>>(field_t::DESTINATION) |
Some fields may only be available in the jicmp protocol due to their dynamic nature as fields in the ICMP header or packet and are not stored in the security association. For ICMP they include
- CHECKSUM
- POINTER
- TYPE
- SEQNUM
- GATEWAY
- ORIGTIMESTAMP
- RXTIMESTAMP
- TXTIMESTAMP
- Parameters
-
field | - field to retrieve from the IP header |
- Returns
- value of the field in the security association
◆ set_field()
template<typename T >
void ProtocolPP::jicmpsa::set_field |
( |
field_t |
field, |
|
|
T |
fieldval |
|
) |
| |
Allows the user to update the field of the IP header
ICMP SA Set Fields
field type | field name | Example |
direction_t | DIRECTION | set_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP) |
iana_t | VERSION | set_field<iana_t>(field_t::VERSION, iana_t::ICMPV6) |
icmpmsg_t | MESSAGE | set_field<icmpmsg_t>(field_t::MESSAGE, icmpmsg_t::TIMEXCEED) |
icmpcode_t | CODE | set_field<icmpcode_t>(field_t::CODE, icmpcode_t::TTLEXPIRE) |
uint8_t | DSECN | set_field<uint8_t>(field_t::DSECN, 0xFF) |
| TTLHOP | set_field<uint8_t>(field_t::TTLHOP, 0xAA) |
| FLAGS | set_field<uint8_t>(field_t::FLAGS, 0xCC) |
uint16_t | FRAGOFFSET | set_field<uint16_t>(field_t::FRAGOFFSET, 0x001E) |
| ID | set_field<uint16_t>(field_t::ID, 0x01CC) |
| LABEL | set_field<uint32_t>(field_t::LABEL, 0xA1CC) |
jarray<uint8_t> | SOURCE | set_field<jarray<uint8_t>>(field_t::SOURCE, jarray<uint8_t>("0xAABBCCDD")) |
| DESTINATION | set_field<jarray<uint8_t>>(field_t::DESTINATION, jarray<uint8_t>("0xEE11AABB")) |
Some fields may only be available in the jicmp protocol due to their dynamic nature as fields in the ICMP header or packet and are not stored in the security association. For ICMP they include
- CHECKSUM
- POINTER
- TYPE
- SEQNUM
- GATEWAY
- ORIGTIMESTAMP
- RXTIMESTAMP
- TXTIMESTAMP
- Parameters
-
field | - field to update the IP header with |
fieldval | - value to update the IP header with |
◆ to_json()
void ProtocolPP::jicmpsa::to_json |
( |
std::ofstream & |
myjson, |
|
|
direction_t |
direction, |
|
|
std::string & |
indent |
|
) |
| |
|
virtual |
Prints the protocol as an JSON object
- Parameters
-
myjson | - JSON object to print with |
direction | - randomization |
indent | - indentation for JSON output |
Implements ProtocolPP::jsecass.
◆ to_xml()
Prints the protocol as an XML object
- Parameters
-
myxml | - XMLPrinter object to print with |
direction | - randomization |
Implements ProtocolPP::jsecass.
The documentation for this class was generated from the following file: