Data Structures | Functions

modules_k/p_usrloc/udomain.h File Reference

USRLOC - Usrloc domain structure. More...

#include <stdio.h>
#include "../../lib/kcore/statistics.h"
#include "../../locking.h"
#include "../../str.h"
#include "../../lib/srdb1/db.h"
#include "../usrloc/usrloc.h"
#include "urecord.h"
#include "hslot.h"
#include "urecord.h"
Include dependency graph for modules_k/p_usrloc/udomain.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

Functions


Detailed Description

Definition in file modules_k/p_usrloc/udomain.h.


Function Documentation

int db_timer_udomain ( udomain_t _d  ) 
Parameters:
_d cleaned domain
Returns:
0 on success, -1 on failure

Definition at line 452 of file modules_k/p_usrloc/udomain.c.

int delete_urecord ( udomain_t _d,
str _aor,
struct urecord _r 
)
Parameters:
_d domain where the record should be deleted
_aor address of record
_r deleted record
Returns:
0 on success, -1 if the record could not be deleted

Definition at line 684 of file modules_k/p_usrloc/udomain.c.

void free_udomain ( udomain_t _d  ) 
Parameters:
_d freed domain

Definition at line 152 of file modules_k/p_usrloc/udomain.c.

int get_urecord ( udomain_t _d,
str _aor,
struct urecord **  _r 
)
Parameters:
_d domain to search the record
_aor address of record
_r new created record
Returns:
0 if a record was found, 1 if nothing could be found

Definition at line 645 of file modules_k/p_usrloc/udomain.c.

int insert_urecord ( udomain_t _d,
str _aor,
struct urecord **  _r 
)
Parameters:
_d domain to insert the new record
_aor address of the record
_r new created record
Returns:
return 0 on success, -1 on failure

Definition at line 624 of file modules_k/p_usrloc/udomain.c.

void lock_udomain ( udomain_t _d,
str _aor 
)

Timer handler for given domain.

Parameters:
_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.

void lock_ulslot ( udomain_t _d,
int  i 
)
Parameters:
_d domain
i slot number

Definition at line 589 of file modules_k/p_usrloc/udomain.c.

void mem_delete_urecord ( udomain_t _d,
struct urecord _r 
)
Parameters:
_d domain the record belongs to
_r deleted record

Definition at line 505 of file modules_k/p_usrloc/udomain.c.

int mem_insert_urecord ( udomain_t _d,
str _aor,
struct urecord **  _r 
)
Parameters:
_d domain the record belongs to
_aor address of record
_r new created record
Returns:
0 on success, -1 on failure

Definition at line 484 of file modules_k/p_usrloc/udomain.c.

void mem_timer_udomain ( udomain_t _d  ) 
Parameters:
_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().

Here is the call graph for this function:

Here is the caller graph for this function:

int new_udomain ( str _n,
int  _s,
udomain_t **  _d 
)
Parameters:
_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
Returns:
0 on success, -1 on failure

Definition at line 84 of file modules_k/p_usrloc/udomain.c.

void unlock_udomain ( udomain_t _d,
str _aor 
)
Parameters:
_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.

void unlock_ulslot ( udomain_t _d,
int  i 
)
Parameters:
_d domain
i slot number

Definition at line 605 of file modules_k/p_usrloc/udomain.c.