Functions

modules_k/usrloc/ucontact.c File Reference

USRLOC - Usrloc contact handling functions

More...

#include "ucontact.h"
#include <string.h>
#include "../../mem/shm_mem.h"
#include "../../ut.h"
#include "../../ip_addr.h"
#include "../../socket_info.h"
#include "../../dprint.h"
#include "../../lib/srdb1/db.h"
#include "ul_mod.h"
#include "ul_callback.h"
#include "usrloc.h"
#include "urecord.h"
Include dependency graph for modules_k/usrloc/ucontact.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file modules_k/usrloc/ucontact.c.


Function Documentation

int db_delete_ucontact ( ucontact_t _c  ) 
int db_insert_ucontact ( ucontact_t _c  ) 
int db_update_ucontact ( ucontact_t _c  ) 
void free_ucontact ( ucontact_t _c  ) 
int mem_update_ucontact ( ucontact_t _c,
ucontact_info_t _ci 
)
ucontact_t* new_ucontact ( str _dom,
str _aor,
str _contact,
ucontact_info_t _ci 
)
void print_ucontact ( FILE *  _f,
ucontact_t _c 
)
int st_delete_ucontact ( ucontact_t _c  ) 
Parameters:
_c updated contact
Returns:
1 if the contact should be deleted from memory immediately, 0 otherwise

Definition at line 297 of file modules_k/usrloc/ucontact.c.

References CS_DIRTY, CS_NEW, CS_SYNC, db_mode, ucontact::expires, ucontact::state, and WRITE_BACK.

int st_expired_ucontact ( ucontact_t _c  ) 
Parameters:
_c expired contact
Returns:
1 if the contact should be removed from the database and 0 otherwise

Definition at line 338 of file modules_k/usrloc/ucontact.c.

References CS_DIRTY, CS_NEW, CS_SYNC, and ucontact::state.

int st_flush_ucontact ( ucontact_t _c  ) 
Parameters:
_c flushed contact
Returns:
1 if the contact should be inserted, 2 if update and 0 otherwise

Definition at line 367 of file modules_k/usrloc/ucontact.c.

References CS_DIRTY, CS_NEW, CS_SYNC, and ucontact::state.

void st_update_ucontact ( ucontact_t _c  ) 
Parameters:
_c updated contact

Definition at line 261 of file modules_k/usrloc/ucontact.c.

References CS_DIRTY, CS_NEW, CS_SYNC, db_mode, ucontact::state, WRITE_BACK, and WRITE_THROUGH.

static void unlink_contact ( struct urecord _r,
ucontact_t _c 
) [inline, static]
Parameters:
_r record the contact belongs
_c removed contact

Definition at line 800 of file modules_k/usrloc/ucontact.c.

References urecord::contacts, ucontact::next, and ucontact::prev.

Referenced by update_contact_pos().

Here is the caller graph for this function:

static void update_contact_pos ( struct urecord _r,
ucontact_t _c 
) [inline, static]
Parameters:
_r record that holds the sorted contacts
_c new contact

Definition at line 821 of file modules_k/usrloc/ucontact.c.

References urecord::contacts, desc_time_order, ucontact::next, ucontact::prev, ucontact::q, and unlink_contact().

Referenced by update_ucontact().

Here is the call graph for this function:

Here is the caller graph for this function:

int update_ucontact ( struct urecord _r,
ucontact_t _c,
ucontact_info_t _ci 
)
Parameters:
_r record the contact belongs to
_c updated contact
_ci new contact informations
Returns:
0 on success, -1 on failure

Definition at line 872 of file modules_k/usrloc/ucontact.c.

References db_insert_ucontact(), db_mode, DB_ONLY, db_update_ucontact(), mem_update_ucontact(), run_ul_callbacks(), st_update_ucontact(), ucontact::state, update_contact_pos(), and WRITE_THROUGH.

Here is the call graph for this function: