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

Public Member Functions

 jsrtp (std::shared_ptr< jrand > &rand, std::shared_ptr< jsrtpsa > &security, std::string &replay)
 
virtual ~jsrtp ()=default
 Standard deconstructor.
 
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, 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)
 
void set_field (field_t field, uint64_t value, uint32_t index)
 
jarray< uint8_t > get_hdr ()
 
jarray< uint8_t > get_exthdr ()
 
uint64_t get_field (field_t field, jarray< uint8_t > &header)
 
uint64_t get_field (field_t field, jarray< uint8_t > &header, uint32_t index)
 
void get_security (std::shared_ptr< jsrtpsa > &sec)
 
void to_xml (tinyxml2::XMLPrinter &myxml, direction_t direction)
 
void to_json (std::ofstream &myjson, direction_t direction, std::string &indent)
 
 jsrtp (jsrtp &jsrtp)=delete
 
 jsrtp (const jsrtp &jsrtp)=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.
 
virtual void encap_packet (std::shared_ptr< jarray< uint8_t >> &output)
 
virtual void decap_packet (std::shared_ptr< jarray< uint8_t >> &input)
 
virtual uint64_t get_field (field_t field)
 
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< jrandm_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
 

Constructor & Destructor Documentation

◆ jsrtp()

ProtocolPP::jsrtp::jsrtp ( std::shared_ptr< jrand > &  rand,
std::shared_ptr< jsrtpsa > &  security,
std::string &  replay 
)

constructor for SRTP

Parameters
rand- random data generator for padding
security- security association for SRTP
replay- type of packets to create

Member Function Documentation

◆ decap_packet()

void ProtocolPP::jsrtp::decap_packet ( std::shared_ptr< jarray< uint8_t >> &  input,
std::shared_ptr< jarray< uint8_t >> &  output 
)
virtual

This function is for use with the constructor without a file handle. Decap will produce a payload from the packet passed in.

Parameters
input- SRTP encapsulated packet to decapsulate
output- decapsulated payload

Implements ProtocolPP::jprotocol.

◆ encap_packet()

void ProtocolPP::jsrtp::encap_packet ( std::shared_ptr< jarray< uint8_t >> &  input,
std::shared_ptr< jarray< uint8_t >> &  output 
)
virtual

This function is for use with the constructor without a file handle. Encap will produce a packet with the payload passed in

Parameters
input- payload to encapsulate with SRTP
output- SRTP encapsulated packet

Implements ProtocolPP::jprotocol.

◆ get_exthdr()

jarray<uint8_t> ProtocolPP::jsrtp::get_exthdr ( )

Returns the complete extension header

Returns
current extension header

◆ get_field() [1/2]

uint64_t ProtocolPP::jsrtp::get_field ( field_t  field,
jarray< uint8_t > &  header 
)
virtual

Returns the field of the SRTP header

Parameters
field- field to retrieve from the SRTP header
header- SRTP header to retrieve the field from
Returns
field of the SRTP header

Implements ProtocolPP::jprotocol.

◆ get_field() [2/2]

uint64_t ProtocolPP::jsrtp::get_field ( field_t  field,
jarray< uint8_t > &  header,
uint32_t  index 
)

Returns the field of the SRTP header

Parameters
field- field to retrieve from the SRTP header
header- SRTP header to retrieve the field from
index- Only used for CSRC field to retrieve additional CSRC fields past the first one
Returns
field of the SRTP header

◆ get_hdr()

jarray<uint8_t> ProtocolPP::jsrtp::get_hdr ( )
virtual

Returns the complete SRTP header

Returns
current SRTP header

Implements ProtocolPP::jprotocol.

◆ get_security()

void ProtocolPP::jsrtp::get_security ( std::shared_ptr< jsrtpsa > &  sec)

get_security

Parameters
sec- Shared pointer to hold the security association

◆ set_exthdr()

void ProtocolPP::jsrtp::set_exthdr ( jarray< uint8_t > &  exthdr)

Allows the user to update the SRTP header with a single extension header

Parameters
exthdr- extension header to use

◆ set_field() [1/2]

void ProtocolPP::jsrtp::set_field ( field_t  field,
uint64_t  value 
)
virtual

Allows the user to update the field of the SRTP header

Parameters
field- field to update the SRTP header with
value- value to update the SRTP header with

Implements ProtocolPP::jprotocol.

◆ set_field() [2/2]

void ProtocolPP::jsrtp::set_field ( field_t  field,
uint64_t  value,
uint32_t  index 
)

Allows the user to update the field of the SRTP header

Parameters
field- field to update the SRTP header with
value- value to update the SRTP header with
index- Index into the CSRC field of the SRTP header

◆ set_hdr()

void ProtocolPP::jsrtp::set_hdr ( jarray< uint8_t > &  hdr)
virtual

Allows the user to update the SRTP 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_hdr() function and save the current header before updating the SRTP header with a custom header. The header would then need to be restored when the custom header is no longer needed

Parameters
hdr- new SRTP header to use

Implements ProtocolPP::jprotocol.

◆ to_json()

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

Prints the protocol and security objects to JSON

Parameters
myjson- JSON object
direction- randomization
indent- indentation for JSON output

Implements ProtocolPP::jprotocol.

◆ to_xml()

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

Prints the protocol and security objects to XML

Parameters
myxml- XMLPrinter object
direction- randomization

Implements ProtocolPP::jprotocol.


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