Protocol++® (Protocolpp®)  v5.6.2
ProtocolPP::jipsa Class Reference
Inheritance diagram for ProtocolPP::jipsa:
Collaboration diagram for ProtocolPP::jipsa:

Public Member Functions

 jipsa ()
 
 jipsa (direction_t dir, iana_t version, iana_t nh, jarray< uint8_t > src, jarray< uint8_t > dst, jarray< uint8_t > exthdr, uint8_t dsecn, uint8_t ttl, uint8_t flags, uint16_t fragoff, uint16_t id, uint32_t label, bool jumbogram, uint32_t mtu)
 
 jipsa (jipsa &rhs)
 standard copy constructor
 
 jipsa (std::shared_ptr< jipsa > &rhs)
 standard copy constructor from shared pointer
 
virtual ~jipsa ()=default
 Standard deconstructor.
 
template<typename T >
void set_field (field_t field, T value)
 
template<typename 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)
 
 jipsa (const jipsa &jip)=delete
 
- Public Member Functions inherited from ProtocolPP::jsecass
 jsecass ()
 
virtual ~jsecass ()=default
 Standard deconstructor.
 
 jsecass (jsecass &jsecass)=delete
 
 jsecass (const jsecass &jsecass)=delete
 

Constructor & Destructor Documentation

◆ jipsa() [1/2]

ProtocolPP::jipsa::jipsa ( )

Standard constructor with defaults

IP Defaults
fieldDefault Value
dirdirection_t::ENCAP
veriana_t::IPV4
nhiana_t::TCP
src0xAAAAAAAA
dst0xDDDDDDDD
exthdr0
dsecn0
ttl0xFF
flags0
fragoff0
id0
label0
jumbogramtrue
mtu1500
jipsa snd;
snd.set_field<iana_t>(field_t::NH, iana_t::UDP);
snd.set_field<uint32_t>(field_t::MTU, 390);
snd.set_field<bool>(field_t::JUMBOGRAM, false);
iana_t
Definition: jenum.h:2010

◆ jipsa() [2/2]

ProtocolPP::jipsa::jipsa ( direction_t  dir,
iana_t  version,
iana_t  nh,
jarray< uint8_t >  src,
jarray< uint8_t >  dst,
jarray< uint8_t >  exthdr,
uint8_t  dsecn,
uint8_t  ttl,
uint8_t  flags,
uint16_t  fragoff,
uint16_t  id,
uint32_t  label,
bool  jumbogram,
uint32_t  mtu 
)

Security Association for IP

Required fields for IP

Parameters
dir- Direction of data flow
version- Version of IP to use (IPv4, IPv6)
nh- Next header of the extension header or payload
src- Source address (4 bytes for IPv4, 16 bytes for IPv6)
dst- Destination address (4 bytes for IPv4, 16 bytes for IPv6)
exthdr- Extension header to add to standard header
dsecn- Differentiated services and Congestion bits
ttl- Time-To-Live / Hop Limit
jumbogram- Nodal support for IPv6 JUMBOGRAMs
mtu- if using a file for input data, size of the payload

Required IPv4 fields

Parameters
flags- Flags for the IPv4 header
fragoff- Fragment offset
id- ID field for IPv4 header

Required IPv6 fields

Parameters
label- Label field

Member Function Documentation

◆ get_field()

template<typename T >
T ProtocolPP::jipsa::get_field ( field_t  field)

Returns the version field of the IP security association

IP Get Fields
field typefield nameExample
direction_tDIRECTIONdirection_t mydir = get_field<direction_t>(field_t::DIRECTION)
iana_tVERSIONiana_t myver = get_field<iana_t>(field_t::VERSION)
NHiana_t mynh = get_field<iana_t>(field_t::NH)
jarray<uint8_t>SOURCEjarray<uint8_t> mysrc = get_field<jarray<uint8_t>>(field_t::SOURCE)
DESTINATIONjarray<uint8_t> mydst = get_field<jarray<uint8_t>>(field_t::DESTINATION)
EXTHDRjarray<uint8_t> myexthdr = get_field<jarray<uint8_t>>(field_t::EXTHDR)
uint8_tDSECNuint8_t mydsecn = get_field<uint8_t>(field_t::DSECN)
TTLHOPuint8_t myttl = get_field<uint8_t>(field_t::TTLHOP)
FLAGSuint8_t myflags = get_field<uint8_t>(field_t::FLAGS)
uint16_tFRAGOFFSETuint16_t myoffset = get_field<uint16_t>(field_t::FRAGOFFSET)
IDuint16_t myid = get_field<uint16_t>(field_t::ID)
uint32_tLABELuint32_t mylabel = get_field<uint32_t>(field_t::LABEL)
MTUuint32_t mymtu = get_field<uint32_t>(field_t::MTU)
boolMODEJUMBObool myjumbo = get_field<uint32_t>(field_t::MODEJUMBO)

Due to their dynamic nature, some fields are only available in jip which include the following fields

  • LENGTH
  • CHECKSUM
Parameters
field- field to retrieve from the IP security association
Returns
field of the IP security association

◆ set_field()

template<typename T >
void ProtocolPP::jipsa::set_field ( field_t  field,
value 
)

Allows the user to update the field of the IP security association

IP Set Fields
field typefield nameExample
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::DECAP)
iana_tVERSIONset_field<iana_t>(field_t::VERSION, iana_t::IPV4)
NHset_field<iana_t>(field_t::NH, iana_t::UDP)
jarray<uint8_t>SOURCEset_field<jarray<uint8_t>>(field_t::SOURCE, jarray<uint8_t>("CCEE1144"))
DESTINATIONset_field<jarray<uint8_t>>(field_t::DESTINATION, jarray<uint8_t>("4433AABB"))
EXTHDRset_field<jarray<uint8_t>>(field_t::EXTHDR, jarray<uint8_t>("50000104"))
uint8_tDSECNset_field<uint8_t>(field_t::DSECN, 0x11)
TTLHOPset_field<uint8_t>(field_t::TTLHOP, 0xFF)
FLAGSset_field<uint8_t>(field_t::FLAGS, 0x01)
uint16_tFRAGOFFSETset_field<uint16_t>(field_t::FRAGOFFSET, 0x0010)
IDset_field<uint16_t>(field_t::ID, 0xFFEE)
uint32_tLABELset_field<uint32_t>(field_t::LABEL, 0xAABB1155)
MTUset_field<uint32_t>(field_t::MTU, 0x00000040)
boolMODEJUMBOset_field<uint32_t>(field_t::MODEJUMBO, true)

Due to their dynamic nature, some fields are only available in jip which include the following fields

  • LENGTH
  • CHECKSUM
Parameters
field- field to update the IP security association
value- value to update the IP security association

◆ to_json()

void ProtocolPP::jipsa::to_json ( std::ofstream &  myjson,
direction_t  direction,
std::string &  indent 
)
virtual

Prints the protocol object in JSON

Parameters
myjson- JSON object to print to
direction- randomzation
indent- indentation for JSON output

Implements ProtocolPP::jsecass.

◆ to_xml()

void ProtocolPP::jipsa::to_xml ( tinyxml2::XMLPrinter myxml,
direction_t  direction 
)
virtual

Prints the protocol object in XML

Parameters
myxml- XMLPrinter object to print to
direction- randomzation

Implements ProtocolPP::jsecass.


The documentation for this class was generated from the following file: