zrtp_iface_system.h File Reference

#include "zrtp_types.h"
#include "zrtp_config.h"

Go to the source code of this file.

Data Structures

struct  zrtp_time
 Structure for date operations libzrtp uses a unix-like time calculation scheme: time since 1/1/1970. More...

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.

Typedefs

typedef zrtp_time zrtp_time_t
 Structure for date operations libzrtp uses a unix-like time calculation scheme: time since 1/1/1970.

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.
zrtp_status_t zrtp_get_time (zrtp_time_t *zt)
 Returns current date and time This function should return current unix-like date and time: number of seconds and microseconds since 1.1.1970.
int zrtp_add_system_state (zrtp_global_ctx_t *zrtp_global, MD_CTX *ctx)
 Function for entropy collecting. This function should adds some entropy portion to the RNG context. To implement this function:
  • use all available sources for entropy collecting;
  • use "real" entropy. Don't use standard pseudo-randomp generators such as rand() in C.
  • data received from the system should be hashed with the hash context using MD_Update(MD_CTX *, void* data, length). Where data is a pointer to collected entropy sources with length length.
  • function shouldn't add significant time delays;.

zrtp_status_t zrtp_mutex_init (zrtp_mutex_t **mutex)
 Initializing the mutex structure This function initializes the mutex referenced by mutex with default attributes. Upon successful initialization, the state of the mutex becomes initialized and unlocked.
zrtp_status_t zrtp_mutex_destroy (zrtp_mutex_t *mutex)
 Deinitializing the mutex structure This function destroys the mutex object referenced by mutex. The mutex object becomes, in effect, uninitialized. A destroyed mutex object can be reinitialized using zrtp_mutex_init(). This function should create a NON RECURSIVE mutex. (Attempting to relock the mutex causes deadlock).
zrtp_status_t zrtp_mutex_lock (zrtp_mutex_t *mutex)
 Mutex locking This function locks the mutex object referenced by mutex. If the mutex is already locked, the thread that called it is blocked until the mutex becomes available. This operation returns the mutex object referenced by the mutex in the locked state with the calling thread as its owner.
zrtp_status_t zrtp_mutex_unlock (zrtp_mutex_t *mutex)
 Mutex releasing This function releases the mutex object referenced by mutex. The way a mutex is released depends on the mutex's type attribute. If there are threads blocked on the mutex object referenced by mutex when zrtp_mutex_unlock() is called and the mutex becomes available, the scheduling policy determines which thread acquires the mutex.


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