#include <stdlib.h>#include <string.h>#include <stdio.h>#include "../../str.h"#include "../../lock_ops.h"#include "../../dprint.h"#include "../../parser/msg_parser.h"


Go to the source code of this file.
Data Structures | |
| struct | hash_entry |
| struct | htable |
| struct | ua_pres |
Defines | |
| #define | BLA_EVENT 1<<2 |
| #define | BLA_PUBLISH 1<<1 |
| #define | BLA_SUBSCRIBE 1<<2 |
| #define | CONFERENCE_EVENT 1<<4 |
| #define | DIALOG_EVENT 1<<5 |
| #define | DIALOG_PUBLISH 1<<10 |
| #define | INSERTDB_FLAG 1<<2 |
| #define | MAX_FORWARD 70 |
| #define | MI_ASYN_PUBLISH 1<<7 |
| #define | MI_PUBLISH 1<<6 |
| #define | MI_SUBSCRIBE 1<<8 |
| #define | MSGSUM_EVENT 1<<3 |
| #define | NO_UPDATEDB_FLAG 1<<0 |
| #define | PRESENCE_EVENT 1<<0 |
| #define | PURPLE_PUBLISH 1<<11 |
| #define | PWINFO_EVENT 1<<1 |
| #define | RLS_SUBSCRIBE 1<<9 |
| #define | UL_PUBLISH 1<<0 |
| #define | UPDATEDB_FLAG 1<<1 |
| #define | XMPP_INITIAL_SUBS 1<<5 |
| #define | XMPP_PUBLISH 1<<3 |
| #define | XMPP_SUBSCRIBE 1<<4 |
Typedefs | |
| typedef int(* | get_record_id_t )(ua_pres_t *dialog, str **rec_id) |
| typedef struct hash_entry | hash_entry_t |
| typedef struct htable | htable_t |
| typedef int(* | query_dialog_t )(ua_pres_t *presentity) |
| typedef struct ua_pres | ua_pres_t |
Functions | |
| void | delete_htable (ua_pres_t *presentity, unsigned int hash_code) |
| void | destroy_htable (void) |
| ua_pres_t * | get_dialog (ua_pres_t *dialog, unsigned int hash_code) |
| static int | get_event_flag (str *event) |
| int | get_record_id (ua_pres_t *dialog, str **rec_id) |
| void | insert_htable (ua_pres_t *presentity) |
| int | is_dialog (ua_pres_t *dialog) |
| htable_t * | new_htable (void) |
| void | print_ua_pres (ua_pres_t *p) |
| ua_pres_t * | search_htable (ua_pres_t *pres, unsigned int hash_code) |
| int | update_contact (struct sip_msg *msg, char *str1, char *str2) |
| void | update_htable (ua_pres_t *presentity, time_t desired_expires, int expires, str *etag, unsigned int hash_code, str *contact) |
| #define BLA_EVENT 1<<2 |
Definition at line 39 of file pua/hash.h.
Referenced by bla_cb(), bla_handle_notify(), get_event_flag(), and pua_add_events().
| #define BLA_PUBLISH 1<<1 |
| #define BLA_SUBSCRIBE 1<<2 |
Definition at line 46 of file pua/hash.h.
Referenced by bla_cb(), bla_handle_notify(), and subs_cback_func().
| #define CONFERENCE_EVENT 1<<4 |
| #define DIALOG_EVENT 1<<5 |
| #define DIALOG_PUBLISH 1<<10 |
Definition at line 54 of file pua/hash.h.
| #define INSERTDB_FLAG 1<<2 |
Definition at line 59 of file pua/hash.h.
Referenced by db_update(), get_wi_notify_body(), insert_htable(), insert_shtable(), notify(), and update_db_subs().
| #define MAX_FORWARD 70 |
Definition at line 61 of file pua/hash.h.
| #define MI_ASYN_PUBLISH 1<<7 |
Definition at line 51 of file pua/hash.h.
Referenced by mi_pua_publish(), mod_init(), and publ_cback_func().
| #define MI_PUBLISH 1<<6 |
| #define MI_SUBSCRIBE 1<<8 |
| #define MSGSUM_EVENT 1<<3 |
| #define NO_UPDATEDB_FLAG 1<<0 |
Definition at line 57 of file pua/hash.h.
Referenced by db_update(), get_subs_dialog(), update_db_subs(), update_htable(), update_rlsubs(), and update_shtable().
| #define PRESENCE_EVENT 1<<0 |
Definition at line 37 of file pua/hash.h.
Referenced by build_publish(), get_event_flag(), Notify2Xmpp(), presence_subscribe(), pua_add_events(), purple_send_sip_publish(), and ul_publish().
| #define PURPLE_PUBLISH 1<<11 |
| #define PWINFO_EVENT 1<<1 |
Definition at line 38 of file pua/hash.h.
Referenced by get_event_flag(), Notify2Xmpp(), pua_add_events(), and request_winfo().
| #define RLS_SUBSCRIBE 1<<9 |
Definition at line 53 of file pua/hash.h.
Referenced by resource_subscriptions(), and rls_handle_notify().
| #define UL_PUBLISH 1<<0 |
| #define UPDATEDB_FLAG 1<<1 |
Definition at line 58 of file pua/hash.h.
Referenced by db_update(), get_subs_dialog(), update_db_subs(), update_htable(), update_pw_dialogs(), update_rlsubs(), and update_shtable().
| #define XMPP_INITIAL_SUBS 1<<5 |
Definition at line 49 of file pua/hash.h.
Referenced by mod_init(), pres_Xmpp2Sip(), send_subscribe(), and subs_cback_func().
| #define XMPP_PUBLISH 1<<3 |
| #define XMPP_SUBSCRIBE 1<<4 |
Definition at line 48 of file pua/hash.h.
Referenced by Notify2Xmpp(), pres_Xmpp2Sip(), request_winfo(), send_subscribe(), and subs_cback_func().
| typedef int(* get_record_id_t)(ua_pres_t *dialog, str **rec_id) |
Definition at line 127 of file pua/hash.h.
| typedef struct hash_entry hash_entry_t |
| typedef int(* query_dialog_t)(ua_pres_t *presentity) |
Definition at line 132 of file pua/hash.h.
| void delete_htable | ( | ua_pres_t * | presentity, | |
| unsigned int | hash_code | |||
| ) |
Definition at line 244 of file pua/hash.c.
References hash_entry::entity, ua_pres::etag, HashT, ua_pres::next, NULL, htable::p_records, ua_pres::remote_contact, _str::s, search_htable(), and shm_free.
Referenced by hashT_clean(), publ_cback_func(), and subs_cback_func().
| void destroy_htable | ( | void | ) |
Definition at line 269 of file pua/hash.c.
References hash_entry::entity, HASH_SIZE, HashT, hash_entry::lock, ua_pres::next, NULL, htable::p_records, and shm_free.
Definition at line 300 of file pua/hash.c.
References ua_pres::call_id, hash_entry::entity, ua_pres::flag, ua_pres::from_tag, HashT, _str::len, LM_DBG, ua_pres::next, NULL, htable::p_records, ua_pres::pres_uri, _str::s, ua_pres::to_tag, and ua_pres::watcher_uri.
Referenced by get_record_id(), is_dialog(), subs_cback_func(), and update_contact().
| static int get_event_flag | ( | str * | event | ) | [inline, static] |
Definition at line 134 of file pua/hash.h.
References BLA_EVENT, CONFERENCE_EVENT, DIALOG_EVENT, _str::len, LM_ERR, MSGSUM_EVENT, PRESENCE_EVENT, PWINFO_EVENT, and _str::s.
Referenced by mi_pua_publish(), mi_pua_subscribe(), resource_subscriptions(), and rls_handle_notify().
Definition at line 338 of file pua/hash.c.
References core_hash(), get_dialog(), HASH_SIZE, HashT, ua_pres::id, id, _str::len, LM_DBG, LM_ERR, hash_entry::lock, NULL, htable::p_records, pkg_free, pkg_malloc, ua_pres::pres_uri, _str::s, and ua_pres::watcher_uri.
Referenced by bind_pua().
| void insert_htable | ( | ua_pres_t * | presentity | ) |
Definition at line 215 of file pua/hash.c.
References core_hash(), ua_pres::db_flag, hash_entry::entity, HASH_SIZE, HashT, INSERTDB_FLAG, hash_entry::lock, ua_pres::next, NULL, htable::p_records, ua_pres::pres_uri, and ua_pres::watcher_uri.
Referenced by db_restore(), publ_cback_func(), and subs_cback_func().
| int is_dialog | ( | ua_pres_t * | dialog | ) |
Definition at line 383 of file pua/hash.c.
References core_hash(), get_dialog(), HASH_SIZE, HashT, hash_entry::lock, NULL, htable::p_records, ua_pres::pres_uri, and ua_pres::watcher_uri.
Referenced by bind_pua(), and update_presentity().
| htable_t* new_htable | ( | void | ) |
Definition at line 61 of file pua/hash.c.
References hash_entry::entity, H, HASH_SIZE, LM_CRIT, LM_ERR, hash_entry::lock, ua_pres::next, NULL, htable::p_records, shm_free, and shm_malloc().
Referenced by mod_init().
| void print_ua_pres | ( | ua_pres_t * | p | ) |
Definition at line 40 of file pua/hash.c.
References ua_pres::call_id, ua_pres::etag, ua_pres::event, ua_pres::expires, ua_pres::flag, ua_pres::from_tag, ua_pres::id, _str::len, LM_DBG, NULL, ua_pres::pres_uri, _str::s, ua_pres::to_tag, and ua_pres::watcher_uri.
Referenced by db_restore(), and hashT_clean().
Definition at line 116 of file pua/hash.c.
References hash_entry::entity, ua_pres::etag, ua_pres::event, ua_pres::flag, HashT, ua_pres::id, _str::len, LM_DBG, ua_pres::next, NULL, htable::p_records, ua_pres::pres_uri, ua_pres::remote_contact, _str::s, and ua_pres::watcher_uri.
Referenced by delete_htable(), publ_cback_func(), send_publish(), and send_subscribe().
| int update_contact | ( | struct sip_msg * | msg, | |
| char * | str1, | |||
| char * | str2 | |||
| ) |
Definition at line 401 of file pua/hash.c.
References hdr_field::body, ua_pres::call_id, sip_msg::callid, sip_msg::contact, core_hash(), sip_msg::from, ua_pres::from_tag, get_dialog(), HASH_SIZE, HashT, HDR_EOH_F, _str::len, LM_DBG, LM_ERR, hash_entry::lock, NULL, htable::p_records, parse_from_header(), parse_headers(), parse_to(), hdr_field::parsed, ua_pres::pres_uri, ua_pres::remote_contact, _str::s, shm_free, shm_malloc(), to_body::tag_value, sip_msg::to, TO, ua_pres::to_tag, to_body::uri, and ua_pres::watcher_uri.
| void update_htable | ( | ua_pres_t * | presentity, | |
| time_t | desired_expires, | |||
| int | expires, | |||
| str * | etag, | |||
| unsigned int | hash_code, | |||
| str * | contact | |||
| ) |
Definition at line 176 of file pua/hash.c.
References ua_pres::cseq, ua_pres::db_flag, ua_pres::desired_expires, ua_pres::etag, ua_pres::expires, _str::len, LM_ERR, NO_UPDATEDB_FLAG, NULL, ua_pres::remote_contact, _str::s, shm_free, shm_malloc(), UPDATEDB_FLAG, and ua_pres::watcher_uri.
Referenced by publ_cback_func(), and subs_cback_func().
1.5.6