Traffic Processing
[API]

Collaboration diagram for Traffic Processing:

Functions

zrtp_status_t zrtp_process_rtp (zrtp_stream_t *stream, char *packet, unsigned int *length)
 Processing outgoing RTP packets.
zrtp_status_t zrtp_process_srtp (zrtp_stream_t *stream, char *packet, unsigned int *length)
 Processing incoming RTP packets.
zrtp_status_t zrtp_process_rtcp (zrtp_stream_t *stream, char *packet, unsigned int *length)
 Processing outgoing RTCP packets.
zrtp_status_t zrtp_process_srtcp (zrtp_stream_t *stream, char *packet, unsigned int *length)
 Processing incoming RTCP packets.

Function Documentation

zrtp_status_t zrtp_process_rtcp ( zrtp_stream_t *  stream,
char *  packet,
unsigned int *  length 
)

Processing outgoing RTCP packets.

This is the main function for processing outgoing RTCP packets. The function behavior is similar to that of zrtp_process_rtp():

  • In SECURE mode, encrypts outgoing RTCP packets. The packet is encrypted right in the transferred buffer. The length of encrypted packet is returned in the length variable;
  • protects codec and data privacy by deleting certain packets from the stream. In this case the body and the length of the packet remain unchanged.

Parameters:
stream - ZRTP session for processing;
packet - buffer storing RTCP packet;
length - length of the buffered packet.
Returns:
  • zrtp_status_ok if encryption is successful. The packet should be sent to the recipient.
  • zrtp_status_fail if there was an error during encryption. The packet should be rejected.
  • zrtp_status_drop if there was interference in the VoIP client codec protection mechanism. The packet should be rejected.
See also:
zrtp_process_srtp() zrtp_process_rtp() zrtp_process_srtcp()

zrtp_status_t zrtp_process_rtp ( zrtp_stream_t *  stream,
char *  packet,
unsigned int *  length 
)

Processing outgoing RTP packets.

This is the main function for processing outgoing RTP packets. As soon as the protocol is started, each outgoing RTP packet (not encrypted) has to go through this function.

It performs different actions depending on the connection state and packet type:

  • In setup ZRTP connection mode, it encrypts outgoing RTP packets. The packet is encrypted right in the transferred buffer;
  • Protects codec and data privacy by deleting certain packets from the stream. In this case the body and the length of the packet remain unchanged.

Parameters:
stream - ZRTP stream to process RTP packet;
packet - buffer storing the RTP packet for encryption. After processing, the encrypted packet is stored in the same buffer.
length - the length of the buffered packet. After processing, the length of encrypted packet is stored here.
Warning:
During encryption, the data length increases in comparison to the source data. Because the function uses the same buffer both for incoming and resulting values, the length of the buffer must be larger than size of source packet.
Returns:
  • zrtp_status_ok if encryption is successful. The packet should be sent to the recipient.
  • zrtp_status_fail if there was an error during encryption. The packet should be rejected.
  • zrtp_status_drop if there was interference in the VoIP client codec protection mechanism. The packet should be rejected.
See also:
zrtp_process_srtp() zrtp_process_rtcp() zrtp_process_srtcp()

zrtp_status_t zrtp_process_srtcp ( zrtp_stream_t *  stream,
char *  packet,
unsigned int *  length 
)

Processing incoming RTCP packets.

This is the main function for processing incoming RTCP packets. The function behavior is similar to that of zrtp_process_srtp():

  • In SECURE mode, decrypts incoming RTCP packets. The packet is decrypted right in the transferred buffer. The length of the encrypted packet is returned in the length variable;
  • In transition states, drops all incoming RTCP traffic. In this case the body and the length of the packet remain unchanged.

Parameters:
stream - ZRTP stream for processing;
packet - buffer storing the RTCP packet;
length - length of the buffered packet.
Returns:
  • zrtp_status_ok if decrypting is successful. Such a packet should be sent to the recipient;
  • zrtp_status_drop if the command packet processing is successful or if there was interference in the VoIP client codec protection mechanism. The packet should be rejected in either case;
  • zrtp_status_fail if there was an error during encryption. The packet should be rejected.
See also:
zrtp_process_srtp() zrtp_process_rtp() zrtp_process_rtcp()

zrtp_status_t zrtp_process_srtp ( zrtp_stream_t *  stream,
char *  packet,
unsigned int *  length 
)

Processing incoming RTP packets.

This is the main function for incoming RTP packets processing. It is an analogue of zrtp_process_rtp() but for an incoming stream. After the protocol is started, each (encrypted) incoming RTP packet has to go through this function.

It performs different actions depending on the connection state and packet type:

  • during setup/interruption of ZRTP connection, processes incoming protocol packets. The body and length of the packet remain unchanged;
  • in setup ZRTP connection mode, decrypts incoming RTP packet. The packet is decrypted right in the transferred buffer;
  • protects codec and data privacy by deleting certain packets from the stream. In this case the body and the length of the packet remain unchanged.

Parameters:
stream - ZRTP stream for processing
packet - buffer storing the packet for decrypting. After processing, the decrypted packet is stored in the same buffer;
length - the length of the buffered packet. After processing, the length of decrypted packet is stored here;
Returns:
  • zrtp_status_ok if decrypting is successful. Such a packet should be sent to the recipient;
  • zrtp_status_fail if an error occurred during decrypting or command packet processing. The packet should be rejected;
  • zrtp_status_drop if the command packet processing is successful or if there was interference in the VoIP client codec protection mechanism. The packet should be rejected in either case;
See also:
zrtp_process_rtp() zrtp_process_rtcp() zrtp_process_srtcp()


Generated on Wed Dec 9 17:31:06 2009 for libzrtp  zfone