SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Typedefs | Enumerations | Functions | Variables
osip_port.h File Reference
#include <stdio.h>
#include <stdarg.h>
#include <osipparser2/osip_const.h>
#include <osipparser2/osip_list.h>
Include dependency graph for osip_port.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SIP_SYNTAX_ERROR   (-1)
 
#define SIP_NETWORK_ERROR   (-2)
 
#define SIP_ECONNREFUSED   (-3)
 
#define SIP_RESSOURCE_ERROR   (-4)
 
#define SIP_GLOBAL_ERROR   (-5)
 
#define osip_malloc(S)   (osip_malloc_func?osip_malloc_func(S):malloc(S))
 
#define osip_realloc(P, S)   (osip_realloc_func?osip_realloc_func(P,S):realloc(P,S))
 
#define osip_free(P)   { if (P!=NULL) { if (osip_free_func) osip_free_func(P); else free(P);} }
 
#define SP   " \0"
 
#define LOG_TRUE   1
 
#define LOG_FALSE   0
 
#define OSIP_FATAL   TRACE_LEVEL0
 
#define OSIP_BUG   TRACE_LEVEL1
 
#define OSIP_ERROR   TRACE_LEVEL2
 
#define OSIP_WARNING   TRACE_LEVEL3
 
#define OSIP_INFO1   TRACE_LEVEL4
 
#define OSIP_INFO2   TRACE_LEVEL5
 
#define OSIP_INFO3   TRACE_LEVEL6
 
#define OSIP_INFO4   TRACE_LEVEL7
 
#define TRACE_INITIALIZE(level, file)   do { } while (0)
 
#define TRACE_ENABLE_LEVEL(level)   do { } while (0)
 
#define TRACE_DISABLE_LEVEL(level)   do { } while (0)
 
#define IS_TRACE_LEVEL_ACTIVATE(level)   (-1)
 
#define OSIP_TRACE(P)   do {} while (0)
 
#define REMOVE_ELEMENT(first_element, element)
 
#define ADD_ELEMENT(first_element, element)
 
#define APPEND_ELEMENT(type_of_element_t, first_element, element)
 
#define OSIP_SUCCESS   0
 
#define OSIP_UNDEFINED_ERROR   -1
 
#define OSIP_BADPARAMETER   -2
 
#define OSIP_WRONG_STATE   -3
 
#define OSIP_NOMEM   -4
 
#define OSIP_SYNTAXERROR   -5
 
#define OSIP_NOTFOUND   -6
 
#define OSIP_API_NOT_INITIALIZED   -7
 
#define OSIP_NO_NETWORK   -10
 
#define OSIP_PORT_BUSY   -11
 
#define OSIP_UNKNOWN_HOST   -12
 
#define OSIP_DISK_FULL   -30
 
#define OSIP_NO_RIGHTS   -31
 
#define OSIP_FILE_NOT_EXIST   -32
 
#define OSIP_TIMEOUT   -50
 
#define OSIP_TOOMUCHCALL   -51
 
#define OSIP_WRONG_FORMAT   -52
 
#define OSIP_NOCOMMONCODEC   -53
 

Typedefs

typedef void * osip_malloc_func_t (size_t size)
 
typedef void osip_free_func_t (void *ptr)
 
typedef void * osip_realloc_func_t (void *ptr, size_t size)
 
typedef enum _trace_level osip_trace_level_t
 
typedef void osip_trace_func_t (char *fi, int li, osip_trace_level_t level, char *chfr, va_list ap)
 

Enumerations

enum  _trace_level {
  TRACE_LEVEL0 = 0, TRACE_LEVEL1 = 1, TRACE_LEVEL2 = 2, TRACE_LEVEL3 = 3,
  TRACE_LEVEL4 = 4, TRACE_LEVEL5 = 5, TRACE_LEVEL6 = 6, TRACE_LEVEL7 = 7,
  END_TRACE_LEVEL = 8
}
 

Functions

void osip_set_allocators (osip_malloc_func_t *malloc_func, osip_realloc_func_t *realloc_func, osip_free_func_t *free_func)
 
unsigned int osip_build_random_number (void)
 
void osip_usleep (int useconds)
 
int osip_atoi (const char *number)
 
int osip_strcasecmp (const char *s1, const char *s2)
 
int osip_strncasecmp (const char *s1, const char *s2, size_t len)
 
char * osip_strcasestr (const char *haystack, const char *needle)
 
char * osip_strncpy (char *dest, const char *src, size_t length)
 
char * osip_strdup (const char *ch)
 
char * osip_strdup_without_quote (const char *ch)
 
int osip_tolower (char *word)
 
int osip_clrspace (char *word)
 
int __osip_set_next_token (char **dest, char *buf, int end_separator, char **next)
 
const char * __osip_quote_find (const char *qstring)
 
char * osip_enquote (const char *s)
 
void osip_dequote (char *s)
 
unsigned long osip_hash (const char *str)
 
char * osip_str_append (char *dst, const char *src)
 
char * osip_strn_append (char *dst, const char *src, size_t len)
 
char * osip_clrncpy (char *dst, const char *src, size_t len)
 
void osip_trace_initialize_func (osip_trace_level_t level, osip_trace_func_t *func)
 
void osip_trace_initialize_syslog (osip_trace_level_t level, char *ident)
 
int osip_trace_initialize (osip_trace_level_t level, FILE *file)
 
void osip_trace_enable_until_level (osip_trace_level_t level)
 
void osip_trace_enable_level (osip_trace_level_t level)
 
void osip_trace_disable_level (osip_trace_level_t level)
 
int osip_is_trace_level_activate (osip_trace_level_t level)
 
int osip_trace (char *fi, int li, osip_trace_level_t level, FILE *f, char *chfr,...)
 
const char * osip_strerror (int err)
 

Variables

osip_malloc_func_tosip_malloc_func
 
osip_realloc_func_tosip_realloc_func
 
osip_free_func_tosip_free_func
 

Macro Definition Documentation

#define ADD_ELEMENT (   first_element,
  element 
)
Value:
if (first_element==NULL) \
{ \
first_element = element; \
element->next = NULL; \
element->parent = NULL; \
} \
else \
{ \
element->next = first_element; \
element->parent = NULL; \
element->next->parent = element; \
first_element = element; \
}

Definition at line 280 of file osip_port.h.

#define APPEND_ELEMENT (   type_of_element_t,
  first_element,
  element 
)
Value:
if (first_element==NULL) \
{ first_element = element; \
element->next = NULL; /* useless */ \
element->parent = NULL; /* useless */ } \
else \
{ type_of_element_t *f; \
for (f=first_element; f->next!=NULL; f=f->next) \
{ } \
f->next = element; \
element->parent = f; \
element->next = NULL; \
}

Definition at line 295 of file osip_port.h.

#define IS_TRACE_LEVEL_ACTIVATE (   level)    (-1)

Definition at line 244 of file osip_port.h.

#define LOG_FALSE   0

Definition at line 204 of file osip_port.h.

#define LOG_TRUE   1

Definition at line 203 of file osip_port.h.

#define OSIP_API_NOT_INITIALIZED   -7

Definition at line 321 of file osip_port.h.

#define OSIP_BADPARAMETER   -2

Definition at line 316 of file osip_port.h.

#define OSIP_BUG   TRACE_LEVEL1

Definition at line 210 of file osip_port.h.

#define OSIP_DISK_FULL   -30

Definition at line 325 of file osip_port.h.

#define OSIP_ERROR   TRACE_LEVEL2

Definition at line 212 of file osip_port.h.

#define OSIP_FATAL   TRACE_LEVEL0

Definition at line 208 of file osip_port.h.

#define OSIP_FILE_NOT_EXIST   -32

Definition at line 327 of file osip_port.h.

#define osip_free (   P)    { if (P!=NULL) { if (osip_free_func) osip_free_func(P); else free(P);} }

Definition at line 105 of file osip_port.h.

#define OSIP_INFO1   TRACE_LEVEL4

Definition at line 216 of file osip_port.h.

#define OSIP_INFO2   TRACE_LEVEL5

Definition at line 218 of file osip_port.h.

#define OSIP_INFO3   TRACE_LEVEL6

Definition at line 220 of file osip_port.h.

#define OSIP_INFO4   TRACE_LEVEL7

Definition at line 222 of file osip_port.h.

#define osip_malloc (   S)    (osip_malloc_func?osip_malloc_func(S):malloc(S))

Definition at line 99 of file osip_port.h.

#define OSIP_NO_NETWORK   -10

Definition at line 322 of file osip_port.h.

#define OSIP_NO_RIGHTS   -31

Definition at line 326 of file osip_port.h.

#define OSIP_NOCOMMONCODEC   -53

Definition at line 331 of file osip_port.h.

#define OSIP_NOMEM   -4

Definition at line 318 of file osip_port.h.

#define OSIP_NOTFOUND   -6

Definition at line 320 of file osip_port.h.

#define OSIP_PORT_BUSY   -11

Definition at line 323 of file osip_port.h.

#define osip_realloc (   P,
 
)    (osip_realloc_func?osip_realloc_func(P,S):realloc(P,S))

Definition at line 102 of file osip_port.h.

#define OSIP_SUCCESS   0

Definition at line 314 of file osip_port.h.

#define OSIP_SYNTAXERROR   -5

Definition at line 319 of file osip_port.h.

#define OSIP_TIMEOUT   -50

Definition at line 328 of file osip_port.h.

#define OSIP_TOOMUCHCALL   -51

Definition at line 329 of file osip_port.h.

#define OSIP_TRACE (   P)    do {} while (0)

Definition at line 265 of file osip_port.h.

#define OSIP_UNDEFINED_ERROR   -1

Definition at line 315 of file osip_port.h.

#define OSIP_UNKNOWN_HOST   -12

Definition at line 324 of file osip_port.h.

#define OSIP_WARNING   TRACE_LEVEL3

Definition at line 214 of file osip_port.h.

#define OSIP_WRONG_FORMAT   -52

Definition at line 330 of file osip_port.h.

#define OSIP_WRONG_STATE   -3

Definition at line 317 of file osip_port.h.

#define REMOVE_ELEMENT (   first_element,
  element 
)
Value:
if (element->parent==NULL) \
{ first_element = element->next; \
if (first_element!=NULL) \
first_element->parent = NULL; } \
else \
{ element->parent->next = element->next; \
if (element->next!=NULL) \
element->next->parent = element->parent; \
element->next = NULL; \
element->parent = NULL; }

Definition at line 268 of file osip_port.h.

#define SIP_ECONNREFUSED   (-3)

Definition at line 53 of file osip_port.h.

#define SIP_GLOBAL_ERROR   (-5)

Definition at line 55 of file osip_port.h.

#define SIP_NETWORK_ERROR   (-2)

Definition at line 52 of file osip_port.h.

#define SIP_RESSOURCE_ERROR   (-4)

Definition at line 54 of file osip_port.h.

#define SIP_SYNTAX_ERROR   (-1)

Definition at line 51 of file osip_port.h.

#define SP   " \0"

Definition at line 162 of file osip_port.h.

#define TRACE_DISABLE_LEVEL (   level)    do { } while (0)

Definition at line 243 of file osip_port.h.

#define TRACE_ENABLE_LEVEL (   level)    do { } while (0)

Definition at line 242 of file osip_port.h.

#define TRACE_INITIALIZE (   level,
  file 
)    do { } while (0)

Definition at line 241 of file osip_port.h.

Typedef Documentation

typedef void osip_free_func_t(void *ptr)

Definition at line 69 of file osip_port.h.

typedef void* osip_malloc_func_t(size_t size)

Definition at line 68 of file osip_port.h.

typedef void* osip_realloc_func_t(void *ptr, size_t size)

Definition at line 70 of file osip_port.h.

typedef void osip_trace_func_t(char *fi, int li, osip_trace_level_t level, char *chfr, va_list ap)

Definition at line 227 of file osip_port.h.

Enumeration Type Documentation

Enumerator
TRACE_LEVEL0 
TRACE_LEVEL1 
TRACE_LEVEL2 
TRACE_LEVEL3 
TRACE_LEVEL4 
TRACE_LEVEL5 
TRACE_LEVEL6 
TRACE_LEVEL7 
END_TRACE_LEVEL 

Definition at line 206 of file osip_port.h.

Function Documentation

const char* __osip_quote_find ( const char *  qstring)
int __osip_set_next_token ( char **  dest,
char *  buf,
int  end_separator,
char **  next 
)
int osip_atoi ( const char *  number)
unsigned int osip_build_random_number ( void  )
char* osip_clrncpy ( char *  dst,
const char *  src,
size_t  len 
)
int osip_clrspace ( char *  word)
void osip_dequote ( char *  s)
char* osip_enquote ( const char *  s)
unsigned long osip_hash ( const char *  str)
int osip_is_trace_level_activate ( osip_trace_level_t  level)
void osip_set_allocators ( osip_malloc_func_t malloc_func,
osip_realloc_func_t realloc_func,
osip_free_func_t free_func 
)
char* osip_str_append ( char *  dst,
const char *  src 
)
int osip_strcasecmp ( const char *  s1,
const char *  s2 
)
char* osip_strcasestr ( const char *  haystack,
const char *  needle 
)
char* osip_strdup ( const char *  ch)
char* osip_strdup_without_quote ( const char *  ch)
const char* osip_strerror ( int  err)
char* osip_strn_append ( char *  dst,
const char *  src,
size_t  len 
)
int osip_strncasecmp ( const char *  s1,
const char *  s2,
size_t  len 
)
char* osip_strncpy ( char *  dest,
const char *  src,
size_t  length 
)
int osip_tolower ( char *  word)
int osip_trace ( char *  fi,
int  li,
osip_trace_level_t  level,
FILE *  f,
char *  chfr,
  ... 
)
void osip_trace_disable_level ( osip_trace_level_t  level)
void osip_trace_enable_level ( osip_trace_level_t  level)
void osip_trace_enable_until_level ( osip_trace_level_t  level)
int osip_trace_initialize ( osip_trace_level_t  level,
FILE *  file 
)
void osip_trace_initialize_func ( osip_trace_level_t  level,
osip_trace_func_t func 
)
void osip_trace_initialize_syslog ( osip_trace_level_t  level,
char *  ident 
)
void osip_usleep ( int  useconds)

Variable Documentation

osip_free_func_t* osip_free_func
osip_malloc_func_t* osip_malloc_func
osip_realloc_func_t* osip_realloc_func