libZRTP OS specified functions


Defines

#define ZRTP_MIN(left, right)   ((left < right) ? left : right)
 Function computing minimum value This function should return the lesser of two 32-byte unsigned integers. If the numbers are equal, either of them is returned.

Functions

void * zrtp_sys_alloc (unsigned int size)
 Allocates memory of a defined size Allocates size bytes and returns a pointer to the allocated memory Allocated memory is not cleared.
void zrtp_sys_free (void *obj)
 release memory Release the memory space pointed to by obj, which was returned by a previous zrtp_sys_alloc call. If obj is NULL, no operation is performed.
void * zrtp_memcpy (void *dest, const void *src, unsigned int length)
 Memory copying function. This function copies length bytes from memory area src to memory area dest. The memory areas should not overlap.
void * zrtp_memset (void *s, int c, unsigned int n)
int zrtp_send_rtp (const zrtp_stream_ctx_t *stream_ctx, char *packet, unsigned int length)
 RTP packet sending function This function pushes an outgoing ZRTP packet to the network. Correct building of IP and UPD headers is the developer's responsibility.

Detailed Description

This section outlines description and semantics of the main system functions. The majority are trivial and do not need detailed explanation.

Define Documentation

#define ZRTP_MIN ( left,
right   )     ((left < right) ? left : right)

Function computing minimum value This function should return the lesser of two 32-byte unsigned integers. If the numbers are equal, either of them is returned.

Parameters:
left - first number for comparison;
right - second number for comparison.
Returns:
  • lesser of compared numbers.

Definition at line 76 of file zrtp_iface_system.h.


Function Documentation

void* zrtp_memcpy ( void *  dest,
const void *  src,
unsigned int  length 
)

Memory copying function. This function copies length bytes from memory area src to memory area dest. The memory areas should not overlap.

Parameters:
dest - pointer to the destination buffer
src - pointer to the source buffer;
length - number of bytes to be copied.
Returns:
  • pointer to the destination buffer (dest)

void* zrtp_memset ( void *  s,
int  c,
unsigned int  n 
)

int zrtp_send_rtp ( const zrtp_stream_ctx_t *  stream_ctx,
char *  packet,
unsigned int  length 
)

RTP packet sending function This function pushes an outgoing ZRTP packet to the network. Correct building of IP and UPD headers is the developer's responsibility.

Parameters:
stream_ctx - ZRTP stream context;
packet - buffer storing the ZRTP packet to send;
length - size of the ZRTP packet.
Returns:
  • number of bytes sent if successful;
  • -1 if error occurred.

void* zrtp_sys_alloc ( unsigned int  size  ) 

Allocates memory of a defined size Allocates size bytes and returns a pointer to the allocated memory Allocated memory is not cleared.

Parameters:
size - number of bytes for allocation
Returns:
  • pointer to the allocated memory if successful;
  • NULL if the memory allocation failed.

void zrtp_sys_free ( void *  obj  ) 

release memory Release the memory space pointed to by obj, which was returned by a previous zrtp_sys_alloc call. If obj is NULL, no operation is performed.

Parameters:
obj - pointer to the released memory


This file is part of the documentation for Zfone.
Copyright ©  2006-2008 Philip R. Zimmermann. All rights reserved.
Generated on Mon November 10 2008 by doxygen 1.5.7-20060202. Written by Viktor Krikun, © 2006-2008