Functions

modules_k/p_usrloc/dlist.c File Reference

USRLOC - List of registered domains

More...

#include "dlist.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "../../ut.h"
#include "../../lib/srdb1/db.h"
#include "../../mem/shm_mem.h"
#include "../../dprint.h"
#include "../../ip_addr.h"
#include "../../socket_info.h"
#include "udomain.h"
#include "utime.h"
#include "p_usrloc_mod.h"
#include "ul_db_layer.h"
Include dependency graph for modules_k/p_usrloc/dlist.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file modules_k/p_usrloc/dlist.c.


Function Documentation

int get_all_ucontacts ( void *  ,
int  ,
unsigned  int,
unsigned int  part_idx,
unsigned int  part_max 
)

Return list of all contacts for all currently registered users in all domains. The caller must provide buffer of sufficient length for fitting all those contacts. In the case when buffer was exhausted, the function returns estimated amount of additional space needed, in this case the caller is expected to repeat the call using this value as the hint.

Information is packed into the buffer as follows:

+------------+----------+-----+------+-----+ |contact1.len|contact1.s|sock1|flags1|path1| +------------+----------+-----+------+-----+ |contact2.len|contact2.s|sock2|flags2|path1| +------------+----------+-----+------+-----+ |..........................................| +------------+----------+-----+------+-----+ |contactN.len|contactN.s|sockN|flagsN|pathN| +------------+----------+-----+------+-----+ |000000000000| +------------+

Parameters:
buf target buffer
len length of buffer
flags contact flags
part_idx part index
part_max maximal part
Returns:
0 on success, positive if buffer size was not sufficient, negative on failure

Definition at line 162 of file modules_k/p_usrloc/dlist.c.

unsigned long get_number_of_users ( void   ) 
Returns:
the number of users, could be zero

Definition at line 154 of file modules_k/p_usrloc/dlist.c.

int register_udomain ( const char *  name,
udomain_t **  domain 
)

Registers a new domain with usrloc. If the domain exists, a pointer to existing structure will be returned, otherwise a new domain will be created

Parameters:
_n domain name
_d new created domain
Returns:
0 on success, -1 on failure

Definition at line 124 of file modules_k/p_usrloc/dlist.c.

Referenced by db_delete_ucontact(), db_insert_ucontact(), db_update_ucontact(), and mod_init().

Here is the caller graph for this function:

int synchronize_all_udomains ( void   ) 
Returns:
0 if all timer return 0, != 0 otherwise

Definition at line 172 of file modules_k/p_usrloc/dlist.c.

Referenced by destroy(), mi_usrloc_flush(), ul_core_timer(), and ul_local_timer().

Here is the caller graph for this function: