USRLOC - Usrloc record structure
#include "urecord.h"#include <string.h>#include "../../mem/shm_mem.h"#include "../../dprint.h"#include "../../ut.h"#include "../../hashes.h"#include "ul_mod.h"#include "usrloc.h"#include "utime.h"#include "ul_callback.h"
Go to the source code of this file.
Definition in file modules_k/usrloc/urecord.c.
| static struct ucontact* contact_callid_match | ( | ucontact_t * | ptr, | |
| str * | _c, | |||
| str * | _callid | |||
| ) | [static, read] |
| ptr | contact record | |
| _c | contact string | |
| _callid | callid |
Definition at line 545 of file modules_k/usrloc/urecord.c.
References ucontact::c, ucontact::callid, _str::len, ucontact::next, and _str::s.
Referenced by get_ucontact().

| static struct ucontact* contact_match | ( | ucontact_t * | ptr, | |
| str * | _c | |||
| ) | [static, read] |
| ptr | contact record | |
| _c | contact string |
Definition at line 525 of file modules_k/usrloc/urecord.c.
References ucontact::c, _str::len, ucontact::next, and _str::s.
Referenced by contact_path_match(), and get_ucontact().

| static struct ucontact* contact_path_match | ( | ucontact_t * | ptr, | |
| str * | _c, | |||
| str * | _path | |||
| ) | [static, read] |
Match a contact record to a contact string and path + *
| ptr | contact record + * | |
| _c | contact string + * | |
| _path | path + * |
Definition at line 568 of file modules_k/usrloc/urecord.c.
References ucontact::c, contact_match(), _str::len, ucontact::next, ucontact::path, and _str::s.
Referenced by get_ucontact().


| int db_delete_urecord | ( | urecord_t * | _r | ) |
| _r | deleted record |
Definition at line 402 of file modules_k/usrloc/urecord.c.
References urecord::aor, urecord::domain, domain_col, _str::len, db_val_t::nul, _str::s, db_val_t::str_val, db_val_t::type, use_domain, user_col, and db_val_t::val.
| _r | record where the contact belongs to | |
| _c | deleted contact |
Definition at line 496 of file modules_k/usrloc/urecord.c.
References db_delete_ucontact(), db_mode, DB_ONLY, mem_delete_ucontact(), run_ul_callbacks(), st_delete_ucontact(), and WRITE_THROUGH.

| void free_urecord | ( | urecord_t * | _r | ) |
Free all memory used by the given structure. The structure must be removed from all linked lists first
| _r | freed record list |
Definition at line 93 of file modules_k/usrloc/urecord.c.
References urecord::aor, urecord::contacts, db_mode, DB_ONLY, free_ucontact(), ucontact::next, and _str::s.

| int get_ucontact | ( | urecord_t * | _r, | |
| str * | _c, | |||
| str * | _callid, | |||
| str * | _path, | |||
| int | _cseq, | |||
| struct ucontact ** | _co | |||
| ) |
| _r | record where to search the contacts | |
| _c | contact string | |
| _callid | callid | |
| _path | path | |
| _cseq | CSEQ number | |
| _co | found contact |
Definition at line 598 of file modules_k/usrloc/urecord.c.
References ucontact::callid, contact_callid_match(), contact_match(), contact_path_match(), urecord::contacts, ucontact::cseq, cseq_delay, get_act_time(), ucontact::last_modified, _str::len, matching_mode, and _str::s.

| int get_ucontact_by_instance | ( | urecord_t * | _r, | |
| str * | _c, | |||
| ucontact_info_t * | _ci, | |||
| ucontact_t ** | _co | |||
| ) |
| _r | record where to search the contacts | |
| _c | contact string | |
| _ci | contact info (callid, cseq, instance, ...) | |
| _co | found contact |
Definition at line 645 of file modules_k/usrloc/urecord.c.
References ucontact_info::callid, urecord::contacts, ucontact_info::cseq, get_ucontact(), ucontact::instance, ucontact_info::instance, _str::len, ucontact::next, ucontact_info::path, ucontact::reg_id, ucontact_info::reg_id, and _str::s.

| int insert_ucontact | ( | urecord_t * | _r, | |
| str * | _contact, | |||
| ucontact_info_t * | _ci, | |||
| ucontact_t ** | _c | |||
| ) |
| _r | record into the new contact should be inserted | |
| _contact | contact string | |
| _ci | contact information | |
| _c | new created contact |
Definition at line 465 of file modules_k/usrloc/urecord.c.
References db_insert_ucontact(), db_mode, DB_ONLY, mem_insert_ucontact(), run_ul_callbacks(), and WRITE_THROUGH.

| void mem_delete_ucontact | ( | urecord_t * | _r, | |
| ucontact_t * | _c | |||
| ) |
| _r | record this contact belongs to | |
| _c | deleted contact |
Definition at line 217 of file modules_k/usrloc/urecord.c.
References free_ucontact(), mem_remove_ucontact(), and urecord::slot.

| ucontact_t* mem_insert_ucontact | ( | urecord_t * | _r, | |
| str * | _c, | |||
| ucontact_info_t * | _ci | |||
| ) |
Add a new contact in memory, contacts are ordered by: 1) q value, 2) descending modification time
| _r | record this contact belongs to | |
| _c | contact | |
| _ci | contact information |
Definition at line 148 of file modules_k/usrloc/urecord.c.
References urecord::aor, ucontact::c, urecord::contacts, desc_time_order, urecord::domain, new_ucontact(), ucontact::next, ucontact::prev, ucontact::q, and urecord::slot.

| void mem_remove_ucontact | ( | urecord_t * | _r, | |
| ucontact_t * | _c | |||
| ) |
| _r | record this contact belongs to | |
| _c | removed contact |
Definition at line 196 of file modules_k/usrloc/urecord.c.
References urecord::contacts, ucontact::next, and ucontact::prev.
Hash table slot.
| _dom | domain name | |
| _aor | address of record | |
| _r | pointer to the new record |
Definition at line 61 of file modules_k/usrloc/urecord.c.
| static void nodb_timer | ( | urecord_t * | _r | ) | [inline, static] |
Expires timer for NO_DB db_mode, process all contacts from the record, delete the expired ones from memory.
| _r | processed record |
Definition at line 232 of file modules_k/usrloc/urecord.c.
References ucontact::aor, ucontact::c, urecord::contacts, _str::len, mem_delete_ucontact(), ucontact::next, run_ul_callbacks(), _str::s, urecord::slot, and VALID_CONTACT.
Referenced by timer_urecord().


| void print_urecord | ( | FILE * | _f, | |
| urecord_t * | _r | |||
| ) |
| _f | print output | |
| _r | printed record |
Definition at line 116 of file modules_k/usrloc/urecord.c.
References urecord::aor, urecord::aorhash, urecord::contacts, urecord::domain, _str::len, ucontact::next, print_ucontact(), _str::s, and urecord::slot.

| void release_urecord | ( | urecord_t * | _r | ) |
| _r | released record |
Definition at line 447 of file modules_k/usrloc/urecord.c.
References urecord::contacts, db_mode, DB_ONLY, free_urecord(), mem_delete_urecord(), and urecord::slot.

| void timer_urecord | ( | urecord_t * | _r | ) |
Helper function that run the appropriate timer function, depending on the db_mode setting.
| _r | processed record |
Definition at line 382 of file modules_k/usrloc/urecord.c.
References db_mode, NO_DB, nodb_timer(), wb_timer(), WRITE_BACK, and WRITE_THROUGH.

| static void wb_timer | ( | urecord_t * | _r | ) | [inline, static] |
Write-back timer, used for WRITE_BACK db_mode. Process all contacts from the record, delete expired ones from the DB. Furthermore it updates changed contacts, and also insert new ones in the DB.
| _r | processed record |
Definition at line 309 of file modules_k/usrloc/urecord.c.
References ucontact::aor, ucontact::c, urecord::contacts, db_delete_ucontact(), db_insert_ucontact(), db_update_ucontact(), _str::len, mem_delete_ucontact(), ucontact::next, run_ul_callbacks(), _str::s, urecord::slot, st_expired_ucontact(), st_flush_ucontact(), ucontact::state, and VALID_CONTACT.
Referenced by timer_urecord().


| static void wt_timer | ( | urecord_t * | _r | ) | [inline, static] |
Write through timer, used for WRITE_THROUGH db_mode. Process all contacts from the record, delete all expired ones from the DB.
| _r | processed record |
Definition at line 268 of file modules_k/usrloc/urecord.c.
References ucontact::aor, ucontact::c, urecord::contacts, db_delete_ucontact(), _str::len, mem_delete_ucontact(), ucontact::next, run_ul_callbacks(), _str::s, urecord::slot, and VALID_CONTACT.

1.7.1