#include <string.h>#include <unistd.h>#include <stdio.h>#include "../../dprint.h"#include "../../mem/mem.h"#include "../../mem/shm_mem.h"#include "xjab_worker.h"#include "mdefines.h"

Go to the source code of this file.
Defines | |
| #define | XJ_DEF_JDELIM '*' |
Functions | |
| int | xj_wlist_check (xj_wlist jwl, xj_jkey jkey, xj_jkey *p) |
| int | xj_wlist_check_aliases (xj_wlist jwl, str *addr) |
| void | xj_wlist_del (xj_wlist jwl, xj_jkey jkey, int _pid) |
| void | xj_wlist_free (xj_wlist jwl) |
| int | xj_wlist_get (xj_wlist jwl, xj_jkey jkey, xj_jkey *p) |
| xj_wlist | xj_wlist_init (int **pipes, int size, int max, int cache_time, int sleep_time, int delay_time) |
| int | xj_wlist_set_aliases (xj_wlist jwl, char *als, char *jd, char *pa) |
| int | xj_wlist_set_flag (xj_wlist jwl, xj_jkey jkey, int fl) |
| int | xj_wlist_set_pid (xj_wlist jwl, int pid, int idx) |
| #define XJ_DEF_JDELIM '*' |
return communication pipe with the worker that will process the message for the id 'sid' only if it exists, or -1 if error
Definition at line 205 of file xjab_wlist.c.
References find234(), _xj_jkey::id, _str::len, len, LM_DBG, NULL, _xj_worker::pid, _str::s, _xj_wlist::sems, _xj_worker::sip_ids, _xj_wlist::workers, and _xj_worker::wpipe.
Referenced by xjab_manage_sipmsg().
check if the addr contains jdomain or an alias
Definition at line 582 of file xjab_wlist.c.
References _xj_jalias::a, _xj_wlist::aliases, _xj_jalias::jdm, _str::len, s, _str::s, and _xj_jalias::size.
Referenced by xjab_manage_sipmsg().
delete an entity from working list of a worker
Definition at line 628 of file xjab_wlist.c.
References del234(), _xj_jkey::id, _str::len, _xj_wlist::len, LM_DBG, _xj_worker::nr, NULL, _xj_worker::pid, _str::s, _xj_wlist::sems, _xj_worker::sip_ids, _xj_wlist::workers, and xj_jkey_free_p().
Referenced by xj_worker_check_jcons(), and xj_worker_process().
| void xj_wlist_free | ( | xj_wlist | jwl | ) |
free jab_wlist
Definition at line 148 of file xjab_wlist.c.
References _M_SHM_FREE, _xj_jalias::a, _xj_wlist::aliases, _xj_jalias::d, free2tree234(), _xj_jalias::jdm, _xj_wlist::len, LM_DBG, NULL, _xj_jalias::proxy, _str::s, _xj_wlist::sems, _xj_worker::sip_ids, _xj_jalias::size, _xj_wlist::workers, and xj_jkey_free_p().
return communication pipe with the worker that will process the message for the id 'sid', or -1 if error
Definition at line 250 of file xjab_wlist.c.
References _M_SHM_FREE, _M_SHM_MALLOC, add234(), find234(), _xj_jkey::flag, _xj_jkey::hash, _xj_jkey::id, _str::len, len, LM_DBG, _xj_wlist::maxj, min, _xj_worker::nr, NULL, _xj_worker::pid, _str::s, _xj_wlist::sems, _xj_worker::sip_ids, _xj_wlist::workers, _xj_worker::wpipe, and XJ_FLAG_OPEN.
Referenced by xj_register_watcher(), and xjab_manage_sipmsg().
| xj_wlist xj_wlist_init | ( | int ** | pipes, | |
| int | size, | |||
| int | max, | |||
| int | cache_time, | |||
| int | sleep_time, | |||
| int | delay_time | |||
| ) |
init a workers list
Definition at line 54 of file xjab_wlist.c.
References _M_SHM_FREE, _M_SHM_MALLOC, _xj_wlist::aliases, _xj_wlist::cachet, _xj_wlist::delayt, free2tree234(), jwl, _xj_wlist::len, LM_CRIT, LM_DBG, _xj_wlist::maxj, newtree234(), _xj_worker::nr, NULL, _xj_worker::pid, _xj_worker::rpipe, _xj_wlist::sems, _xj_worker::sip_ids, _xj_wlist::sleept, _xj_wlist::workers, _xj_worker::wpipe, xj_jkey_cmp(), and xj_jkey_free_p().
Referenced by mod_init().
| int xj_wlist_set_aliases | ( | xj_wlist | jwl, | |
| char * | als, | |||
| char * | jd, | |||
| char * | pa | |||
| ) |
set IM aliases, jdomain and outbound proxy
return 0 if OK
Definition at line 392 of file xjab_wlist.c.
References _M_SHM_FREE, _M_SHM_MALLOC, _xj_jalias::a, _xj_wlist::aliases, _xj_jalias::d, _xj_jalias::dlm, _xj_jalias::jdm, _str::len, LM_DBG, NULL, _xj_jalias::proxy, _str::s, _xj_jalias::size, and XJ_DEF_JDELIM.
Referenced by mod_init().
set the flag of the connection identified by 'jkey'
Definition at line 344 of file xjab_wlist.c.
References find234(), _xj_jkey::flag, _xj_jkey::hash, _xj_jkey::id, len, _str::len, LM_DBG, NULL, _xj_worker::pid, _str::s, _xj_wlist::sems, _xj_worker::sip_ids, _xj_wlist::workers, and _xj_worker::wpipe.
| int xj_wlist_set_pid | ( | xj_wlist | jwl, | |
| int | pid, | |||
| int | idx | |||
| ) |
set the p.id's of the workers
Definition at line 134 of file xjab_wlist.c.
References _xj_wlist::len, NULL, _xj_worker::pid, _xj_wlist::sems, and _xj_wlist::workers.
Referenced by child_init(), and xjab_check_workers().
1.5.6