USRLOC - Userloc domain handling functions
#include "udomain.h"#include <string.h>#include "../../parser/parse_methods.h"#include "../../mem/shm_mem.h"#include "../../dprint.h"#include "../../lib/srdb1/db.h"#include "../../socket_info.h"#include "../../ut.h"#include "../../hashes.h"#include "p_usrloc_mod.h"#include "utime.h"#include "ul_db_layer.h"
Go to the source code of this file.
Definition in file modules_k/p_usrloc/udomain.c.
| _c | database connection | |
| _d | domain | |
| _aor | address of record |
Definition at line 349 of file modules_k/p_usrloc/udomain.c.
References callid_col, contact, contact_col, cseq_col, dbrow2info(), desc_time_order, domain_col, expires_col, flags_col, free_urecord(), get_static_urecord(), last_mod_col, _str::len, mem_insert_ucontact(), methods_col, udomain::name, db_val_t::nul, path_col, q_col, received_col, RES_ROW_N, RES_ROWS, ROW_VALUES, _str::s, sock_col, ucontact::state, db_val_t::str_val, db_val_t::type, use_domain, user_agent_col, user_col, and db_val_t::val.
Referenced by get_urecord().


| int db_timer_udomain | ( | udomain_t * | _d | ) |
| _d | cleaned domain |
Definition at line 452 of file modules_k/p_usrloc/udomain.c.
Referenced by synchronize_all_udomains().

| static ucontact_info_t* dbrow2info | ( | db_val_t * | vals, | |
| str * | contact | |||
| ) | [inline, static] |
Convert database values into ucontact_info, expects 12 rows (contact, expirs, q, callid, cseq, flags, ua, received, path, socket, methods, last_modified)
| vals | database values | |
| contact | contact |
Definition at line 228 of file modules_k/p_usrloc/udomain.c.
References ucontact_info::callid, ucontact_info::cflags, ucontact_info::cseq, ucontact_info::expires, ucontact_info::flags, ucontact_info::last_modified, _str::len, ucontact_info::methods, parse_phostport(), ucontact_info::path, ucontact_info::q, ucontact_info::received, _str::s, ucontact_info::sock, ucontact_info::user_agent, VAL_BITMAP, VAL_DOUBLE, VAL_INT, VAL_NULL, VAL_STRING, and VAL_TIME.
Referenced by db_load_urecord().


| _d | domain where the record should be deleted | |
| _aor | address of record | |
| _r | deleted record |
Definition at line 684 of file modules_k/p_usrloc/udomain.c.
Referenced by mi_usrloc_rm_aor().

| void free_udomain | ( | udomain_t * | _d | ) |
| _d | freed domain |
Definition at line 152 of file modules_k/p_usrloc/udomain.c.
Referenced by free_all_udomains(), and register_udomain().

| static void get_static_urecord | ( | udomain_t * | _d, | |
| str * | _aor, | |||
| struct urecord ** | _r | |||
| ) | [inline, static] |
| _d | domain (needed for the name) | |
| _aor | address of record | |
| _r | new created urecord |
Definition at line 174 of file modules_k/p_usrloc/udomain.c.
References urecord::aor, urecord::domain, and udomain::name.
Referenced by db_load_urecord(), delete_urecord(), and insert_urecord().

| _d | domain to search the record | |
| _aor | address of record | |
| _r | new created record |
Definition at line 645 of file modules_k/p_usrloc/udomain.c.
Referenced by delete_urecord(), mi_usrloc_add(), mi_usrloc_rm_contact(), mi_usrloc_show_contact(), and preload_udomain().

| _d | domain to insert the new record | |
| _aor | address of the record | |
| _r | new created record |
Definition at line 624 of file modules_k/p_usrloc/udomain.c.
Referenced by mi_usrloc_add().

Timer handler for given domain.
| _d | domain | |
| _aor | adress of record, used as hash source for the lock slot |
Definition at line 549 of file modules_k/p_usrloc/udomain.c.
Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), mi_usrloc_show_contact(), and preload_udomain().

| void lock_ulslot | ( | udomain_t * | _d, | |
| int | i | |||
| ) |
| _d | domain | |
| i | slot number |
Definition at line 589 of file modules_k/p_usrloc/udomain.c.
Referenced by free_udomain(), get_all_mem_ucontacts(), get_urecord_by_ruid(), mem_timer_udomain(), and mi_usrloc_dump().

| _d | domain the record belongs to | |
| _r | deleted record |
Definition at line 505 of file modules_k/p_usrloc/udomain.c.
Referenced by mem_timer_udomain(), and release_urecord().

| _d | domain the record belongs to | |
| _aor | address of record | |
| _r | new created record |
Definition at line 484 of file modules_k/p_usrloc/udomain.c.
Referenced by insert_urecord(), and preload_udomain().

| void mem_timer_udomain | ( | udomain_t * | _d | ) |
| _d | domain |
Definition at line 517 of file modules_k/p_usrloc/udomain.c.
References urecord::contacts, lock_ulslot(), mem_delete_urecord(), urecord::next, udomain::size, udomain::table, timer_urecord(), and unlock_ulslot().
Referenced by synchronize_all_udomains().


| _n | is pointer to str representing name of the domain, the string is not copied, it should point to str structure stored in domain list | |
| _s | is hash table size | |
| _d | new created domain |
Definition at line 84 of file modules_k/p_usrloc/udomain.c.
Referenced by new_dlist().

| void print_udomain | ( | FILE * | _f, | |
| udomain_t * | _d | |||
| ) |
Print udomain, debugging helper function.
Definition at line 189 of file modules_k/p_usrloc/udomain.c.
Referenced by print_all_udomains().

| _d | domain | |
| _aor | address of record, uses as hash source for the lock slot |
Definition at line 570 of file modules_k/p_usrloc/udomain.c.
Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), mi_usrloc_show_contact(), and preload_udomain().

| void unlock_ulslot | ( | udomain_t * | _d, | |
| int | i | |||
| ) |
| _d | domain | |
| i | slot number |
Definition at line 605 of file modules_k/p_usrloc/udomain.c.
Referenced by free_udomain(), get_all_mem_ucontacts(), get_urecord_by_ruid(), mem_timer_udomain(), and mi_usrloc_dump().

1.7.1