Defines | Functions | Variables

usrloc/ul_mi.c File Reference

USRLOC - Usrloc MI functions

More...

#include <string.h>
#include <stdio.h>
#include "../../lib/kmi/mi.h"
#include "../../lib/srutils/sruid.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../qvalue.h"
#include "../../ip_addr.h"
#include "ul_mi.h"
#include "dlist.h"
#include "udomain.h"
#include "utime.h"
#include "ul_mod.h"
#include "usrloc.h"
Include dependency graph for usrloc/ul_mi.c:

Go to the source code of this file.

Defines

Functions

Variables


Detailed Description

Definition in file usrloc/ul_mi.c.


Function Documentation

static int mi_add_aor_node ( struct mi_node *  parent,
urecord_t r,
time_t  t,
int  short_dump 
) [inline, static]
Parameters:
parent parent node
r printed record
t actual time
short_dump 0 means that all informations will be included, 1 that only the AOR is printed
Returns:
0 on success, -1 on failure

Definition at line 115 of file usrloc/ul_mi.c.

References urecord::aor, urecord::aorhash, ucontact::c, ucontact::callid, ucontact::cflags, urecord::contacts, CS_DIRTY, CS_NEW, CS_SYNC, ucontact::cseq, ucontact::expires, ucontact::flags, ucontact::instance, int2str(), _str::len, ucontact::methods, ucontact::next, ucontact::path, ucontact::q, ucontact::received, ucontact::reg_id, ucontact::ruid, _str::s, ucontact::sock, ucontact::state, UL_EXPIRED_TIME, and ucontact::user_agent.

Referenced by mi_usrloc_dump().

Here is the call graph for this function:

Here is the caller graph for this function:

static udomain_t* mi_find_domain ( str table  )  [inline, static]
Parameters:
table domain (table) name
Returns:
pointer to domain if found, 0 if not found

Definition at line 68 of file usrloc/ul_mi.c.

References dlist::d, _str::len, dlist::name, dlist::next, root, and _str::s.

Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), and mi_usrloc_show_contact().

Here is the caller graph for this function:

static int mi_fix_aor ( str aor  )  [inline, static]

Convert an address of record string to lower case, and truncate it when use_domain is not set.

Parameters:
aor address of record
Returns:
0 on success, -1 on error

Definition at line 89 of file usrloc/ul_mi.c.

References _str::len, _str::s, and use_domain.

Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), and mi_usrloc_show_contact().

Here is the caller graph for this function:

struct mi_root* mi_usrloc_add ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Note:
Expects 7 nodes: table name, AOR, contact, expires, Q, useless - backward compatible, flags, cflags, methods
Returns:
mi_root with the result

Definition at line 483 of file usrloc/ul_mi.c.

References ucontact_info::callid, ucontact_info::cflags, contact, ucontact_info::cseq, ucontact_info::expires, ucontact_info::flags, get_act_time(), get_ucontact(), get_urecord(), insert_ucontact(), insert_urecord(), lock_udomain(), ucontact_info::methods, mi_find_domain(), mi_fix_aor(), MI_UL_CSEQ, ucontact_info::q, release_urecord(), ucontact_info::ruid, unlock_udomain(), update_ucontact(), and ucontact_info::user_agent.

Here is the call graph for this function:

struct mi_root* mi_usrloc_dump ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Returns:
mi_root with the result or 0 on failure

Definition at line 375 of file usrloc/ul_mi.c.

References dlist::d, int2str(), _str::len, lock_ulslot(), mi_add_aor_node(), dlist::name, urecord::next, dlist::next, root, _str::s, udomain::size, table, udomain::table, and unlock_ulslot().

Here is the call graph for this function:

struct mi_root* mi_usrloc_flush ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Returns:
mi_root with the result or 0 on failure

Definition at line 462 of file usrloc/ul_mi.c.

References synchronize_all_udomains().

Here is the call graph for this function:

struct mi_root* mi_usrloc_rm_aor ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Note:
expects 2 nodes: the table name and the AOR
Returns:
mi_root with the result

Definition at line 277 of file usrloc/ul_mi.c.

References delete_urecord(), lock_udomain(), mi_find_domain(), mi_fix_aor(), and unlock_udomain().

Here is the call graph for this function:

struct mi_root* mi_usrloc_rm_contact ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Note:
expects 3 nodes: the table name, the AOR and contact
Returns:
mi_root with the result or 0 on failure

Definition at line 315 of file usrloc/ul_mi.c.

References contact, delete_ucontact(), get_ucontact(), get_urecord(), lock_udomain(), mi_find_domain(), mi_fix_aor(), MI_UL_CSEQ, release_urecord(), and unlock_udomain().

Here is the call graph for this function:

struct mi_root* mi_usrloc_show_contact ( struct mi_root *  cmd,
void *  param 
) [read]
Parameters:
cmd mi_root containing the parameter
param not used
Note:
expects 2 nodes: the table name and the AOR
Returns:
mi_root with the result or 0 on failure

Definition at line 602 of file usrloc/ul_mi.c.

References ucontact::c, ucontact::cflags, urecord::contacts, ucontact::expires, ucontact::flags, get_act_time(), get_urecord(), _str::len, lock_udomain(), ucontact::methods, mi_find_domain(), mi_fix_aor(), ucontact::next, ucontact::path, ucontact::q, ucontact::received, _str::s, ucontact::sock, unlock_udomain(), ucontact::user_agent, and VALID_CONTACT.

Here is the call graph for this function: