Protocol++® (Protocolpp®)
v5.6.2
|
Public Member Functions | |
jsrtpsa () | |
jsrtpsa (direction_t dir, protocol_t mode, srtpcipher_t cipher, uint32_t icvlen, uint32_t blksize, uint16_t seqnum, uint32_t roc, uint32_t ssrc, uint8_t ver, uint8_t type, bool pad, bool ext, std::shared_ptr< jarray< uint8_t >> exthdr, bool marker, bool mki, uint32_t ckeylen, std::shared_ptr< jarray< uint8_t >> cipherkey, uint32_t akeylen, std::shared_ptr< jarray< uint8_t >> authkey, uint32_t saltlen, std::shared_ptr< jarray< uint8_t >> salt, uint32_t mkilen, std::shared_ptr< jarray< uint8_t >> mkidata, uint32_t cc, std::shared_ptr< jarray< uint32_t >> csrc, uint32_t arlen, jarray< uint8_t > arwin) | |
jsrtpsa (jsrtpsa &rhs) | |
jsrtpsa (std::shared_ptr< jsrtpsa > &rhs) | |
~jsrtpsa () | |
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) |
jsrtpsa (const jsrtpsa &rhs)=delete | |
Public Member Functions inherited from ProtocolPP::jsecass | |
jsecass () | |
virtual | ~jsecass ()=default |
Standard deconstructor. | |
jsecass (jsecass &jsecass)=delete | |
jsecass (const jsecass &jsecass)=delete | |
ProtocolPP::jsrtpsa::jsrtpsa | ( | ) |
Standard constructor with defaults
field | Default Value |
---|---|
mode | protocol_t::SRTP |
cipher | srtpcipher_t::AES_CTR_SHA1 |
icvlen | 20 |
blksize | 0 |
seqnum | 0 |
roc | 0 |
ssrc | 0 |
ver | 0x80 |
type | 0 |
pad | false |
ext | false |
marker | false |
mki | false |
ckeylen | 16 |
akeylen | 20 |
saltlen | 4 |
mkilen | 0 |
cc | 0 |
arlen | 0 |
cipherkey | 0 |
salt | 0 |
mkidata | 0 |
exthdr | 0 |
authkey | 0 |
csrc | 0 |
arwin | 0 |
ProtocolPP::jsrtpsa::jsrtpsa | ( | direction_t | dir, |
protocol_t | mode, | ||
srtpcipher_t | cipher, | ||
uint32_t | icvlen, | ||
uint32_t | blksize, | ||
uint16_t | seqnum, | ||
uint32_t | roc, | ||
uint32_t | ssrc, | ||
uint8_t | ver, | ||
uint8_t | type, | ||
bool | pad, | ||
bool | ext, | ||
std::shared_ptr< jarray< uint8_t >> | exthdr, | ||
bool | marker, | ||
bool | mki, | ||
uint32_t | ckeylen, | ||
std::shared_ptr< jarray< uint8_t >> | cipherkey, | ||
uint32_t | akeylen, | ||
std::shared_ptr< jarray< uint8_t >> | authkey, | ||
uint32_t | saltlen, | ||
std::shared_ptr< jarray< uint8_t >> | salt, | ||
uint32_t | mkilen, | ||
std::shared_ptr< jarray< uint8_t >> | mkidata, | ||
uint32_t | cc, | ||
std::shared_ptr< jarray< uint32_t >> | csrc, | ||
uint32_t | arlen, | ||
jarray< uint8_t > | arwin | ||
) |
Security Association for SRTP
dir | - Direction of processing (ENCAP or DECAP) |
mode | - Mode of operation either SRTP or SCRTP |
cipher | - indicates the cipher used for SRTP encryption |
icvlen | - ICV length |
blksize | - Size of the encryption data size |
seqnum | - Sequence number |
roc | - Rollover counter (ROC) |
ssrc | - Synchronization source identifier (SSRC) |
ver | - Version of SRTP (currently 2) |
type | - Type of the payload data |
pad | - Indicates padding is present in the payload |
ext | - If asserted, a single extension header follows the SRTP header |
exthdr | - Extension header data if present |
marker | - Marker for debug |
mki | - MKI flag |
ckeylen | - Cipher key length |
cipherkey | - the session encryption key |
akeylen | - Authentication key length |
authkey | - the session authentication key for HMAC-SHA1 |
saltlen | - Salt length |
salt | - the session salting key |
mkilen | - MKI length |
mkidata | - MKI data |
cc | - Number of CSRC identifiers |
csrc | - Contributing source identifier (CSRC) |
arlen | - Number of packets to track in replay window |
arwin | - Anti-replay window |
ProtocolPP::jsrtpsa::jsrtpsa | ( | jsrtpsa & | rhs | ) |
constructor for SRTP Security Association
rhs | - security association for SRTP |
|
explicit |
constructor for SRTP Security Association
rhs | - security association for SRTP |
T ProtocolPP::jsrtpsa::get_field | ( | field_t | field | ) |
Returns the field of the SRTP security association
field type | field name | Example |
---|---|---|
direction_t | DIRECTION | direction_t mydir = get_field<direction_t>(field_t::DIRECTION) |
protocol_t | MODE | protocol_t mymode = get_field<protocol_t>(field_t::MODE) |
srtpcipher_t | CIPHER | srtpcipher_t mycipher = get_field<srtpcipher_t>(field_t::CIPHER) |
uint32_t | ICVLEN | uint32_t myicvlen = get_field<uint32_t>(field_t::ICVLEN) |
BLKSIZE | uint32_t myblksize = get_field<uint32_t>(field_t::BLKSIZE) | |
ROC | uint32_t myroc = get_field<uint32_t>(field_t::ROC) | |
SSRC | uint32_t myssrc = get_field<uint32_t>(field_t::SSRC) | |
CKEYLEN | uint32_t myckeylen = get_field<uint32_t>(field_t::CKEYLEN) | |
AKEYLEN | uint32_t myakeylen = get_field<uint32_t>(field_t::AKEYLEN) | |
SALTLEN | uint32_t mysaltlen = get_field<uint32_t>(field_t::SALTLEN) | |
MKILEN | uint32_t mymkilen = get_field<uint32_t>(field_t::MKILEN) | |
CC | uint32_t mycc = get_field<uint32_t>(field_t::CC) | |
ARLEN | uint32_t myarlen = get_field<uint32_t>(field_t::ARLEN) | |
uint16_t | SEQNUM | uint16_t myseqnum = get_field<uint16_t>(field_t::SEQNUM) |
uint8_t | VERSION | uint8_t myver = get_field<uint8_t>(field_t::VERSION) |
TYPE | uint8_t mytype = get_field<uint8_t>(field_t::TYPE) | |
bool | PAD | bool mypad = get_field<bool>(field_t::PAD) |
EXTENSION | bool myext = get_field<bool>(field_t::EXTENSION) | |
MARKER | bool mymarker = get_field<bool>(field_t::MARKER) | |
MKI | bool mymki = get_field<bool>(field_t::MKI) | |
jarray<uint8_t> | ARWIN | jarray<uint8_t> myarwin = get_field<jarray<uint8_t>>(field_t::ARWIN) |
std::shared_ptr<jarray<uint8_t>> | EXTHDR | std::shared_ptr<jarray<uint8_t>> myexthdr = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::EXTHDR) |
CIPHERKEY | std::shared_ptr<jarray<uint8_t>> mycipherkey = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY) | |
AUTHKEY | std::shared_ptr<jarray<uint8_t>> myauthkey = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY) | |
SALT | std::shared_ptr<jarray<uint8_t>> mysalt = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT) | |
MKIDATA | std::shared_ptr<jarray<uint8_t>> mymkidata = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::MKIDATA) | |
CSRC | std::shared_ptr<jarray<uint8_t>> mycsrc = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CSRC) |
field | - field to retrieve |
void ProtocolPP::jsrtpsa::set_field | ( | field_t | field, |
T | fieldval | ||
) |
Allows the user to update the field of the SRTP security association
field type | field name | Example |
---|---|---|
direction_t | DIRECTION | set_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP) |
protocol_t | MODE | set_field<protocol_t>(field_t::MODE, protocol_t::SRTP) |
srtpcipher_t | CIPHER | set_field<srtpcipher_t>(field_t::CIPHER, srtpcipher_t::AEAD_AES_256_CCM) |
uint32_t | ICVLEN | set_field<uint32_t>(field_t::ICVLEN, 16) |
BLKSIZE | set_field<uint32_t>(field_t::BLKSIZE, 16) | |
ROC | set_field<uint32_t>(field_t::ROC, 1) | |
SSRC | set_field<uint32_t>(field_t::SSRC, 2) | |
CKEYLEN | set_field<uint32_t>(field_t::CKEYLEN, 32) | |
AKEYLEN | set_field<uint32_t>(field_t::AKEYLEN, 0) | |
SALTLEN | set_field<uint32_t>(field_t::SALTLEN, 3) | |
MKILEN | set_field<uint32_t>(field_t::MKILEN, 0) | |
CC | set_field<uint32_t>(field_t::CC, 1) | |
ARLEN | set_field<uint32_t>(field_t::ARLEN, 64) | |
uint16_t | SEQNUM | set_field<uint16_t>(field_t::SEQNUM, 0x0001) |
uint8_t | VERSION | set_field<uint8_t>(field_t::VERSION, 0x02) |
TYPE | set_field<uint8_t>(field_t::TYPE, 0x13) | |
bool | PAD | set_field<bool>(field_t::PAD, true) |
EXTENSION | set_field<bool>(field_t::EXTENSION, true) | |
MARKER | set_field<bool>(field_t::MARKER, false) | |
MKI | set_field<bool>(field_t::MKI, true) | |
jarray<uint8_t> | ARWIN | set_field<jarray<uint8_t>>(field_t::ARWIN, jarray<uint8_t>("AABBCCDD")) |
std::shared_ptr<jarray<uint8_t>> | EXTHDR | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::EXTHDR, jarray<uint8_t>("AABBCCDD")) |
CIPHERKEY | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, jarray<uint8_t>("AABBCCDD")) | |
AUTHKEY | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY, jarray<uint8_t>("AABBCCDD")) | |
SALT | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT, jarray<uint8_t>("AABBCCDD")) | |
MKIDATA | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::MKIDATA, jarray<uint8_t>("AABBCCDD")) | |
CSRC | set_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CSRC, jarray<uint8_t>("AABBCCDD")) |
field | - field to update the SRTP security association |
fieldval | - value to update the SRTP security association |
|
virtual |
Prints the protocol and security objects to JSON
myjson | - JSON object |
direction | - randomization |
indent | - indentation for JSON output |
Implements ProtocolPP::jsecass.
|
virtual |
Prints the protocol and security objects to XML
myxml | - XMLPrinter object |
direction | - randomization |
Implements ProtocolPP::jsecass.