presence/hash.h File Reference

Kamailio presence module :: Hash tables. More...

#include "../../lock_ops.h"

Include dependency graph for presence/hash.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pres_entry
struct  pres_htable
struct  subs_entry

Defines

#define CONT_COPY(buf, dest, source)
#define ERR_MEM(mem_type)
#define LOCAL_TYPE   1<<2
#define PKG_MEM_STR   "pkg"
#define PKG_MEM_TYPE   1<< 1
#define REMOTE_TYPE   1<<1
#define SHARE_MEM   "share"
#define SHM_MEM_TYPE   1<< 2

Typedefs

typedef int(* delete_shtable_t )(shtable_t htable, unsigned int hash_code, str to_tag)
typedef void(* destroy_shtable_t )(shtable_t htable, int hash_size)
typedef int(* insert_shtable_t )(shtable_t htable, unsigned int hash_code, struct subscription *subs)
typedef struct subscription *(* mem_copy_subs_t )(struct subscription *s, int mem_type)
typedef shtable_t(* new_shtable_t )(int hash_size)
typedef struct pres_htable phtable_t
typedef struct pres_entry pres_entry_t
typedef struct subscription *(* search_shtable_t )(shtable_t htable, str callid, str to_tag, str from_tag, unsigned int hash_code)
typedef subs_entry_tshtable_t
typedef struct subs_entry subs_entry_t
typedef int(* update_shtable_t )(shtable_t htable, unsigned int hash_code, struct subscription *subs, int type)

Functions

int delete_phtable (str *pres_uri, int event)
int delete_shtable (shtable_t htable, unsigned int hash_code, str to_tag)
void destroy_phtable (void)
void destroy_shtable (shtable_t htable, int hash_size)
void free_subs_list (struct subscription *s_array, int mem_type, int ic)
int insert_phtable (str *pres_uri, int event, char *sphere)
int insert_shtable (shtable_t htable, unsigned int hash_code, struct subscription *subs)
struct subscriptionmem_copy_subs (struct subscription *s, int mem_type)
phtable_tnew_phtable (void)
shtable_t new_shtable (int hash_size)
pres_entry_tsearch_phtable (str *pres_uri, int event, unsigned int hash_code)
struct subscriptionsearch_shtable (shtable_t htable, str callid, str to_tag, str from_tag, unsigned int hash_code)
int update_phtable (struct presentity *presentity, str pres_uri, str body)
int update_shtable (shtable_t htable, unsigned int hash_code, struct subscription *subs, int type)


Detailed Description

Kamailio presence module :: Hash tables.

Definition in file presence/hash.h.


Define Documentation

#define CONT_COPY ( buf,
dest,
source   ) 

Value:

dest.s= (char*)buf+ size;\
   memcpy(dest.s, source.s, source.len);\
   dest.len= source.len;\
   size+= source.len;

Definition at line 52 of file presence/hash.h.

Referenced by mem_copy_subs(), mem_copy_subs_noc(), shm_copy_event(), subs_cbparam_indlg(), and subscribe_cbparam().

#define ERR_MEM ( mem_type   ) 

#define LOCAL_TYPE   1<<2

Definition at line 44 of file presence/hash.h.

Referenced by agg_body_sendn_update(), and notify().

#define PKG_MEM_STR   "pkg"

#define PKG_MEM_TYPE   1<< 1

#define REMOTE_TYPE   1<<1

Definition at line 43 of file presence/hash.h.

Referenced by update_shtable(), update_subs_db(), and update_subscription().

#define SHARE_MEM   "share"

#define SHM_MEM_TYPE   1<< 2


Typedef Documentation

typedef int(* delete_shtable_t)(shtable_t htable, unsigned int hash_code, str to_tag)

Definition at line 99 of file presence/hash.h.

Definition at line 105 of file presence/hash.h.

typedef int(* insert_shtable_t)(shtable_t htable, unsigned int hash_code, struct subscription *subs)

Definition at line 96 of file presence/hash.h.

typedef struct subscription*(* mem_copy_subs_t)(struct subscription *s, int mem_type)

Definition at line 107 of file presence/hash.h.

Definition at line 91 of file presence/hash.h.

typedef struct pres_htable phtable_t

typedef struct pres_entry pres_entry_t

typedef struct subscription*(* search_shtable_t)(shtable_t htable, str callid, str to_tag, str from_tag, unsigned int hash_code)

Definition at line 93 of file presence/hash.h.

Definition at line 70 of file presence/hash.h.

typedef struct subs_entry subs_entry_t

typedef int(* update_shtable_t)(shtable_t htable, unsigned int hash_code, struct subscription *subs, int type)

Definition at line 102 of file presence/hash.h.


Function Documentation

int delete_phtable ( str pres_uri,
int  event 
)

int delete_shtable ( shtable_t  htable,
unsigned int  hash_code,
str  to_tag 
)

void destroy_phtable ( void   ) 

Definition at line 436 of file presence/hash.c.

References lock, pres_entry::next, NULL, phtable_size, shm_free, and pres_entry::sphere.

void destroy_shtable ( shtable_t  htable,
int  hash_size 
)

Definition at line 89 of file presence/hash.c.

References free_subs_list(), lock, NULL, shm_free, and SHM_MEM_TYPE.

Referenced by bind_presence().

void free_subs_list ( struct subscription s_array,
int  mem_type,
int  ic 
)

int insert_phtable ( str pres_uri,
int  event,
char *  sphere 
)

int insert_shtable ( shtable_t  htable,
unsigned int  hash_code,
struct subscription subs 
)

struct subscription* mem_copy_subs ( struct subscription s,
int  mem_type 
) [read]

phtable_t* new_phtable ( void   ) 

shtable_t new_shtable ( int  hash_size  ) 

Definition at line 44 of file presence/hash.c.

References subs_entry::entries, ERR_MEM, LM_ERR, lock, subscription::next, NULL, SHARE_MEM, shm_free, and shm_malloc().

Referenced by bind_presence(), and mod_init().

pres_entry_t* search_phtable ( str pres_uri,
int  event,
unsigned int  hash_code 
)

struct subscription* search_shtable ( shtable_t  htable,
str  callid,
str  to_tag,
str  from_tag,
unsigned int  hash_code 
) [read]

int update_phtable ( struct presentity presentity,
str  pres_uri,
str  body 
)

int update_shtable ( shtable_t  htable,
unsigned int  hash_code,
struct subscription subs,
int  type 
)


Generated on Thu May 24 02:00:38 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6