ccRTP 2.1.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Fields
zrtp_Callbacks Struct Reference

This structure defines the callback functions required by GNU ZRTP. More...

#include <ZrtpCWrapper.h>

Collaboration diagram for zrtp_Callbacks:
Collaboration graph
[legend]

Data Fields

int32_t(* zrtp_sendDataZRTP )(ZrtpContext *ctx, const uint8_t *data, int32_t length)
 Send a ZRTP packet via RTP. More...
 
int32_t(* zrtp_activateTimer )(ZrtpContext *ctx, int32_t time)
 Activate timer. More...
 
int32_t(* zrtp_cancelTimer )(ZrtpContext *ctx)
 Cancel the active timer. More...
 
void(* zrtp_sendInfo )(ZrtpContext *ctx, int32_t severity, int32_t subCode)
 Send information messages to the hosting environment. More...
 
int32_t(* zrtp_srtpSecretsReady )(ZrtpContext *ctx, C_SrtpSecret_t *secrets, int32_t part)
 SRTP crypto data ready for the sender or receiver. More...
 
void(* zrtp_srtpSecretsOff )(ZrtpContext *ctx, int32_t part)
 Switch off the security for the defined part. More...
 
void(* zrtp_rtpSecretsOn )(ZrtpContext *ctx, char *c, char *s, int32_t verified)
 Switch on the security. More...
 
void(* zrtp_handleGoClear )(ZrtpContext *ctx)
 This method handles GoClear requests. More...
 
void(* zrtp_zrtpNegotiationFailed )(ZrtpContext *ctx, int32_t severity, int32_t subCode)
 Handle ZRTP negotiation failed. More...
 
void(* zrtp_zrtpNotSuppOther )(ZrtpContext *ctx)
 ZRTP calls this method if the other side does not support ZRTP. More...
 
void(* zrtp_synchEnter )(ZrtpContext *ctx)
 Enter synchronization mutex. More...
 
void(* zrtp_synchLeave )(ZrtpContext *ctx)
 Leave synchronization mutex. More...
 
void(* zrtp_zrtpAskEnrollment )(ZrtpContext *ctx, int32_t info)
 Inform about a PBX enrollment request. More...
 
void(* zrtp_zrtpInformEnrollment )(ZrtpContext *ctx, int32_t info)
 Inform about PBX enrollment result. More...
 
void(* zrtp_signSAS )(ZrtpContext *ctx, uint8_t *sas)
 Request a SAS signature. More...
 
int32_t(* zrtp_checkSASSignature )(ZrtpContext *ctx, uint8_t *sas)
 ZRTPQueue calls this method to request a SAS signature check. More...
 

Detailed Description

This structure defines the callback functions required by GNU ZRTP.

The RTP stack specific part must implement the callback methods. The generic part of GNU ZRTP uses these mehtods to communicate with the specific part, for example to send data via the RTP/SRTP stack, to set timers and cancel timer and so on.

The generiy part of GNU ZRTP needs only a few callback methods to be implemented by the specific part.

Author
Werner Dittmann Werne.nosp@m.r.Di.nosp@m.ttman.nosp@m.n@t-.nosp@m.onlin.nosp@m.e.de The following methods define the GNU ZRTP callback interface. For detailed documentation refer to file ZrtpCallback.h, each C method has "zrtp_" prepended to the C++ name.
See Also
ZrtpCallback

Definition at line 294 of file ZrtpCWrapper.h.

Field Documentation

int32_t(* zrtp_Callbacks::zrtp_activateTimer)(ZrtpContext *ctx, int32_t time)

Activate timer.

Parameters
ctxPointer to the opaque ZrtpContext structure.
timeThe time in ms for the timer
Returns
zero if activation failed, one if timer was activated

Definition at line 323 of file ZrtpCWrapper.h.

int32_t(* zrtp_Callbacks::zrtp_cancelTimer)(ZrtpContext *ctx)

Cancel the active timer.

Parameters
ctxPointer to the opaque ZrtpContext structure.
Returns
zero if cancel action failed, one if timer was canceled

Definition at line 333 of file ZrtpCWrapper.h.

int32_t(* zrtp_Callbacks::zrtp_checkSASSignature)(ZrtpContext *ctx, uint8_t *sas)

ZRTPQueue calls this method to request a SAS signature check.

After ZRTP received a SAS signature in one of the Confirm packets it call this method. The client may use getSignatureLength() and getSignatureData()of ZrtpQueue to get the signature data and perform the signature check. Refer to chapter 8.2 of ZRTP specification.

If the signature check fails the client may return false to ZRTP. In this case ZRTP signals an error to the other peer and terminates the ZRTP handshake.

Note: SAS signing is not yet fully supported by GNU ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure.
sasPointer to the 32 byte SAS hash that was signed by the other peer.
Returns
true if the signature was ok, false otherwise.

Definition at line 558 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_handleGoClear)(ZrtpContext *ctx)

This method handles GoClear requests.

According to the ZRTP specification the user must be informed about a GoClear request because the ZRTP implementation switches off security if it could authenticate the GoClear packet.

Note: GoClear is not yet implemented in GNU ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure.

Definition at line 430 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_rtpSecretsOn)(ZrtpContext *ctx, char *c, char *s, int32_t verified)

Switch on the security.

ZRTP calls this method after it has computed the SAS and check if it is verified or not. In addition ZRTP provides information about the cipher algorithm and key length for the SRTP session.

This method must enable SRTP processing if it was not enabled during sertSecretsReady().

Parameters
ctxPointer to the opaque ZrtpContext structure.
cThe name of the used cipher algorithm and mode, or NULL
sThe SAS string
verifiedif verified is true then SAS was verified by both parties during a previous call.

Definition at line 416 of file ZrtpCWrapper.h.

int32_t(* zrtp_Callbacks::zrtp_sendDataZRTP)(ZrtpContext *ctx, const uint8_t *data, int32_t length)

Send a ZRTP packet via RTP.

ZRTP calls this method to send a ZRTP packet via the RTP session. The ZRTP packet will have to be created using the provided ZRTP message.

Parameters
ctxPointer to the opaque ZrtpContext structure.
dataPoints to ZRTP message to send.
lengthThe length in bytes of the data
Returns
zero if sending failed, one if packet was sent

Definition at line 311 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_sendInfo)(ZrtpContext *ctx, int32_t severity, int32_t subCode)

Send information messages to the hosting environment.

The ZRTP implementation uses this method to send information messages to the host. Along with the message ZRTP provides a severity indicator that defines: Info, Warning, Error, Alert. Refer to the MessageSeverity enum above.

Parameters
ctxPointer to the opaque ZrtpContext structure.
severityThis defines the message's severity
subCodeThe subcode identifying the reason.
See Also
ZrtpCodes::MessageSeverity

Definition at line 351 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_signSAS)(ZrtpContext *ctx, uint8_t *sas)

Request a SAS signature.

After ZRTP was able to compute the Short Authentication String (SAS) it calls this method. The client may now use an approriate method to sign the SAS. The client may use ZrtpQueue::setSignatureData() to store the signature data and enable signature transmission to the other peer. Refer to chapter 8.2 of ZRTP specification.

Note: SAS signing is not yet fully supported by GNU ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure.
sasPointer to the 32 byte SAS hash to sign.

Definition at line 532 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_srtpSecretsOff)(ZrtpContext *ctx, int32_t part)

Switch off the security for the defined part.

Parameters
ctxPointer to the opaque ZrtpContext structure.
partDefines for which part (sender or receiver) to switch on security

Definition at line 394 of file ZrtpCWrapper.h.

int32_t(* zrtp_Callbacks::zrtp_srtpSecretsReady)(ZrtpContext *ctx, C_SrtpSecret_t *secrets, int32_t part)

SRTP crypto data ready for the sender or receiver.

The ZRTP implementation calls this method right after all SRTP secrets are computed and ready to be used. The parameter points to a structure that contains pointers to the SRTP secrets and a enum Role. The called method (the implementation of this abstract method) must either copy the pointers to the SRTP data or the SRTP data itself to a save place. The SrtpSecret_t structure is destroyed after the callback method returns to the ZRTP implementation.

The SRTP data themselves are obtained in the ZRtp object and are valid as long as the ZRtp object is active. TheZRtp's destructor clears the secrets. Thus the called method needs to save the pointers only, ZRtp takes care of the data.

The implementing class may enable SRTP processing in this method or delay it to srtpSecertsOn().

Parameters
ctxPointer to the opaque ZrtpContext structure.
secretsA pointer to a SrtpSecret_t structure that contains all necessary data.
partfor which part (Sender or Receiver) this data is valid.
Returns
Returns false if something went wrong during initialization of SRTP context, for example memory shortage.

Definition at line 384 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_synchEnter)(ZrtpContext *ctx)

Enter synchronization mutex.

GNU ZRTP requires one mutex to synchronize its processing. Because mutex implementations depend on the underlying infrastructure, for example operating system or thread implementation, GNU ZRTP delegates mutex handling to the specific part of its implementation.

Parameters
ctxPointer to the opaque ZrtpContext structure.

Definition at line 471 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_synchLeave)(ZrtpContext *ctx)

Leave synchronization mutex.

Parameters
ctxPointer to the opaque ZrtpContext structure.

Definition at line 479 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_zrtpAskEnrollment)(ZrtpContext *ctx, int32_t info)

Inform about a PBX enrollment request.

Please refer to chapter 8.3 ff to get more details about PBX enrollment and SAS relay.

Note: PBX enrollement is not yet fully supported by GNU ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure.
infoGive some information to the user about the PBX requesting an enrollment.

Definition at line 495 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_zrtpInformEnrollment)(ZrtpContext *ctx, int32_t info)

Inform about PBX enrollment result.

Informs the use about the acceptance or denial of an PBX enrollment request

Note: PBX enrollement is not yet fully supported by GNU ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure.
infoGive some information to the user about the result of an enrollment.

Definition at line 511 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_zrtpNegotiationFailed)(ZrtpContext *ctx, int32_t severity, int32_t subCode)

Handle ZRTP negotiation failed.

ZRTP calls this method in case ZRTP negotiation failed. The parameters show the severity as well as the reason.

Parameters
ctxPointer to the opaque ZrtpContext structure.
severityThis defines the message's severity
subCodeThe subcode identifying the reason.
See Also
ZrtpCodes::MessageSeverity

Definition at line 446 of file ZrtpCWrapper.h.

void(* zrtp_Callbacks::zrtp_zrtpNotSuppOther)(ZrtpContext *ctx)

ZRTP calls this method if the other side does not support ZRTP.

Parameters
ctxPointer to the opaque ZrtpContext structure. If the other side does not answer the ZRTP Hello packets then ZRTP calls this method,

Definition at line 457 of file ZrtpCWrapper.h.


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