![]() |
TrustCore SDK NanoSSL API reference
version 7.0
|
Customizable SRTP callbacks. More...
Variables | |
sbyte4(* | sslSettings::funcPtrSrtpEncodeCallback )(sbyte4 connectionInstance, peerDescr *pChannelDescr, const sbyte *pData, ubyte4 pDataLength, ubyte **encodedData, ubyte4 *encodedLength) |
Apply SRTP profile to an RTP packet. More... | |
sbyte4(* | sslSettings::funcPtrSrtpInitCallback )(sbyte4 connectionInstance, peerDescr *pChannelDescr, const SrtpProfileInfo *pProfile, void *keyMaterials, ubyte *mki) |
Initialize SRTP cryptographic context. More... | |
sbyte4(* sslSettings::funcPtrSrtpEncodeCallback) (sbyte4 connectionInstance, peerDescr *pChannelDescr, const sbyte *pData, ubyte4 pDataLength, ubyte **encodedData, ubyte4 *encodedLength) |
This callback function is called by the DTLS stack at data send to apply the SRTP profile to an RTP packet. Using this callback is optional; the SRTP stack can take over the data communication using the DTLS-SRTP negotiated security profile.
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_DTLS_SRTP__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_DTLS_CLIENT__
__ENABLE_MOCANA_DTLS_SERVER__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pChannelDescr | Pointer peer descriptor. |
pData | At call, the RTP packet. On return, pointer to enlarged SRTP packet. |
pDataLength | At call, number of bytes in RTP packet (pData ). On return, pointer to number of bytes in enlarged SRTP packet (pData ). |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sbyte4(* sslSettings::funcPtrSrtpInitCallback) (sbyte4 connectionInstance, peerDescr *pChannelDescr, const SrtpProfileInfo *pProfile, void *keyMaterials, ubyte *mki) |
This callback function is called at the end of a DTLS handshake to initialize SRTP cryptographic context for given connectionInstance.
Callback registration happens at session creation and initialization by assigning your custom callback function (which can have any name) to this callback pointer.
To enable this callback, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_DTLS_SRTP__
Additionally, at least one of the following flags must be defined in moptions.h:
__ENABLE_MOCANA_DTLS_CLIENT__
__ENABLE_MOCANA_DTLS_SERVER__
connectionInstance | Pointer to the SSL/TLS Client instance. |
pChannelDescr | Pointer peer descriptor. |
profileId | Profile Id. |
keyMaterials | Opaque value that contains the SRTP key materials. Its components can be retrieved from the key material by using the following macro functions (defined in dtls_srtp.h):
|
mki | Pointer to MKI (master key identifier) value, a variable length value defined with TLS syntax. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.