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

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 >
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
 

Constructor & Destructor Documentation

◆ jsrtpsa() [1/4]

ProtocolPP::jsrtpsa::jsrtpsa ( )

Standard constructor with defaults

SRTP Defaults
fieldDefault Value
modeprotocol_t::SRTP
ciphersrtpcipher_t::AES_CTR_SHA1
icvlen20
blksize0
seqnum0
roc0
ssrc0
ver0x80
type0
padfalse
extfalse
markerfalse
mkifalse
ckeylen16
akeylen20
saltlen4
mkilen0
cc0
arlen0
cipherkey0
salt0
mkidata0
exthdr0
authkey0
csrc0
arwin0

◆ jsrtpsa() [2/4]

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

Parameters
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

◆ jsrtpsa() [3/4]

ProtocolPP::jsrtpsa::jsrtpsa ( jsrtpsa rhs)

constructor for SRTP Security Association

Parameters
rhs- security association for SRTP

◆ jsrtpsa() [4/4]

ProtocolPP::jsrtpsa::jsrtpsa ( std::shared_ptr< jsrtpsa > &  rhs)
explicit

constructor for SRTP Security Association

Parameters
rhs- security association for SRTP

Member Function Documentation

◆ get_field()

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

Returns the field of the SRTP security association

SRTP Set Fields
field typefield nameExample
direction_tDIRECTIONdirection_t mydir = get_field<direction_t>(field_t::DIRECTION)
protocol_tMODEprotocol_t mymode = get_field<protocol_t>(field_t::MODE)
srtpcipher_tCIPHERsrtpcipher_t mycipher = get_field<srtpcipher_t>(field_t::CIPHER)
uint32_tICVLENuint32_t myicvlen = get_field<uint32_t>(field_t::ICVLEN)
BLKSIZEuint32_t myblksize = get_field<uint32_t>(field_t::BLKSIZE)
ROCuint32_t myroc = get_field<uint32_t>(field_t::ROC)
SSRCuint32_t myssrc = get_field<uint32_t>(field_t::SSRC)
CKEYLENuint32_t myckeylen = get_field<uint32_t>(field_t::CKEYLEN)
AKEYLENuint32_t myakeylen = get_field<uint32_t>(field_t::AKEYLEN)
SALTLENuint32_t mysaltlen = get_field<uint32_t>(field_t::SALTLEN)
MKILENuint32_t mymkilen = get_field<uint32_t>(field_t::MKILEN)
CCuint32_t mycc = get_field<uint32_t>(field_t::CC)
ARLENuint32_t myarlen = get_field<uint32_t>(field_t::ARLEN)
uint16_tSEQNUMuint16_t myseqnum = get_field<uint16_t>(field_t::SEQNUM)
uint8_tVERSIONuint8_t myver = get_field<uint8_t>(field_t::VERSION)
TYPEuint8_t mytype = get_field<uint8_t>(field_t::TYPE)
boolPADbool mypad = get_field<bool>(field_t::PAD)
EXTENSIONbool myext = get_field<bool>(field_t::EXTENSION)
MARKERbool mymarker = get_field<bool>(field_t::MARKER)
MKIbool mymki = get_field<bool>(field_t::MKI)
jarray<uint8_t>ARWINjarray<uint8_t> myarwin = get_field<jarray<uint8_t>>(field_t::ARWIN)
std::shared_ptr<jarray<uint8_t>>EXTHDRstd::shared_ptr<jarray<uint8_t>> myexthdr = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::EXTHDR)
CIPHERKEYstd::shared_ptr<jarray<uint8_t>> mycipherkey = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY)
AUTHKEYstd::shared_ptr<jarray<uint8_t>> myauthkey = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY)
SALTstd::shared_ptr<jarray<uint8_t>> mysalt = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT)
MKIDATAstd::shared_ptr<jarray<uint8_t>> mymkidata = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::MKIDATA)
CSRCstd::shared_ptr<jarray<uint8_t>> mycsrc = get_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CSRC)
Parameters
field- field to retrieve
Returns
value of the field

◆ set_field()

template<typename T >
void ProtocolPP::jsrtpsa::set_field ( field_t  field,
fieldval 
)

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

SRTP Set Fields
field typefield nameExample
direction_tDIRECTIONset_field<direction_t>(field_t::DIRECTION, direction_t::ENCAP)
protocol_tMODEset_field<protocol_t>(field_t::MODE, protocol_t::SRTP)
srtpcipher_tCIPHERset_field<srtpcipher_t>(field_t::CIPHER, srtpcipher_t::AEAD_AES_256_CCM)
uint32_tICVLENset_field<uint32_t>(field_t::ICVLEN, 16)
BLKSIZEset_field<uint32_t>(field_t::BLKSIZE, 16)
ROCset_field<uint32_t>(field_t::ROC, 1)
SSRCset_field<uint32_t>(field_t::SSRC, 2)
CKEYLENset_field<uint32_t>(field_t::CKEYLEN, 32)
AKEYLENset_field<uint32_t>(field_t::AKEYLEN, 0)
SALTLENset_field<uint32_t>(field_t::SALTLEN, 3)
MKILENset_field<uint32_t>(field_t::MKILEN, 0)
CCset_field<uint32_t>(field_t::CC, 1)
ARLENset_field<uint32_t>(field_t::ARLEN, 64)
uint16_tSEQNUMset_field<uint16_t>(field_t::SEQNUM, 0x0001)
uint8_tVERSIONset_field<uint8_t>(field_t::VERSION, 0x02)
TYPEset_field<uint8_t>(field_t::TYPE, 0x13)
boolPADset_field<bool>(field_t::PAD, true)
EXTENSIONset_field<bool>(field_t::EXTENSION, true)
MARKERset_field<bool>(field_t::MARKER, false)
MKIset_field<bool>(field_t::MKI, true)
jarray<uint8_t>ARWINset_field<jarray<uint8_t>>(field_t::ARWIN, jarray<uint8_t>("AABBCCDD"))
std::shared_ptr<jarray<uint8_t>>EXTHDRset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::EXTHDR, jarray<uint8_t>("AABBCCDD"))
CIPHERKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CIPHERKEY, jarray<uint8_t>("AABBCCDD"))
AUTHKEYset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::AUTHKEY, jarray<uint8_t>("AABBCCDD"))
SALTset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::SALT, jarray<uint8_t>("AABBCCDD"))
MKIDATAset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::MKIDATA, jarray<uint8_t>("AABBCCDD"))
CSRCset_field<std::shared_ptr<jarray<uint8_t>>>(field_t::CSRC, jarray<uint8_t>("AABBCCDD"))
Parameters
field- field to update the SRTP security association
fieldval- value to update the SRTP security association

◆ to_json()

void ProtocolPP::jsrtpsa::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::jsecass.

◆ to_xml()

void ProtocolPP::jsrtpsa::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::jsecass.


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