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

Public Member Functions

 judpsa ()
 
 judpsa (direction_t dir, protocol_t ver, uint16_t src, uint16_t dst, uint32_t vni, uint32_t mtu)
 
 judpsa (judpsa &rhs)
 Standard copy constructor.
 
 judpsa (std::shared_ptr< judpsa > &rhs)
 Copy constructor from shared pointer.
 
virtual ~judpsa ()=default
 Standard deconstructor.
 
template<typename T >
void set_field (field_t field, T fieldval)
 
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)
 
 judpsa (const judpsa &judpsa)=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

◆ judpsa() [1/2]

ProtocolPP::judpsa::judpsa ( )

Standard constructor using default values

UDP Defaults
fieldDefault Value
dirdirection_t::ENCAP
dirprotocol_t::NOPROTO
src0xFEED
dst0xBEEF
vni0
mtu0

◆ judpsa() [2/2]

ProtocolPP::judpsa::judpsa ( direction_t  dir,
protocol_t  ver,
uint16_t  src,
uint16_t  dst,
uint32_t  vni,
uint32_t  mtu 
)

Parameters necessary to setup a UDP flow

Parameters
dir- Direction of UDP data flow (ENCAP or DECAP)
ver- Version of UDP to use (NOPROT, VXLAN)
src- Source port for data
dst- Destination port for data
vni- VXLAN Network Identifier
mtu- Maximum transmission size

Member Function Documentation

◆ get_field()

template<typename T >
T ProtocolPP::judpsa::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

UDP Get Fields
field typefield nameExample
direction_tDIRECTIONdirection_t mydir = get_field<direction_t>(field_t::DIRECTION)
uint16_tSOURCEuint16_t mysrc = get_field<uint16_t>(field_t::SOURCE)
DESTINATIONuint16_t mydst = get_field<uint16_t>(field_t::DESTINATION)
uint32_tMTUuint32_t mymtu = get_field<uint32_t>(field_t::MTU)

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

  • LENGTH
  • CHECKSUM
Parameters
field- field to set
Returns
- boolean value from the field

◆ set_field()

template<typename T >
void ProtocolPP::judpsa::set_field ( field_t  field,
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

UDP Set Fields
field typefield nameExample
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP)
uint16_tSOURCEset_field<uint16_t>(field_t::SOURCE, 0xFEED)
DESTINATIONset_field<uint16_t>(field_t::DESTINATION, 0xBEEF)
uint32_tMTUset_field<uint32_t>(field_t::MTU, 1500)

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

  • LENGTH
  • CHECKSUM
Parameters
field- field to set
fieldval- boolean value for the field

◆ to_json()

void ProtocolPP::judpsa::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
direction- randomization
indent- indentation for JSON output

Implements ProtocolPP::jsecass.

◆ to_xml()

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

print the protocol and security objects as XML

Parameters
myxml- object to print to
direction- randomization

Implements ProtocolPP::jsecass.


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