#include "config.h"
#include "h_table.h"
#include "timer.h"
#include "../../dprint.h"
#include "lock.h"
#include "../../hash_func.h"
#include "../../config.h"
#include "../../parser/parser_f.h"
#include "../../ut.h"
#include "t_funcs.h"
#include "t_reply.h"
#include "t_cancel.h"

Go to the source code of this file.
Defines | |
| #define | DETACHED_LIST (&detached_timer) |
| #define | is_in_timer_list2(_tl) |
| #define | run_handler_for_each(_tl, _handler) |
| #define | UTIME_TYPE 1 |
Functions | |
| static struct timer_link * | check_and_split_time_list (struct timer *timer_list, utime_t time) |
| void | cleanup_localcancel_timers (struct cell *t) |
| static void | delete_cell (struct cell *p_cell, int unlock) |
| static void | delete_handler (struct timer_link *dele_tl) |
| static void | fake_reply (struct cell *t, int branch, int code) |
| static void | final_response_handler (struct timer_link *fr_tl) |
| void | free_timer_table (void) |
| struct timer_table * | get_timertable (void) |
| void | init_timer_list (enum lists list_id) |
| static void | insert_timer_unsafe (struct timer *timer_list, struct timer_link *tl, utime_t time_out) |
| void | print_timer_list (enum lists list_id) |
| static void | remove_timer_unsafe (struct timer_link *tl) |
| void | reset_timer (struct timer_link *tl) |
| void | reset_timer_list (enum lists list_id) |
| static void | retransmission_handler (struct timer_link *retr_tl) |
| void | set_1timer (struct timer_link *new_tl, enum lists list_id, utime_t *ext_timeout) |
| void | set_timer (struct timer_link *new_tl, enum lists list_id, utime_t *ext_timeout) |
| void | timer_routine (unsigned int ticks, void *attr) |
| struct timer_table * | tm_init_timers (void) |
| void | unlink_timer_lists (void) |
| static void | unlink_timers (struct cell *t) |
| void | utimer_routine (utime_t uticks, void *attr) |
| static void | wait_handler (struct timer_link *wait_tl) |
Variables | |
| static struct timer | detached_timer |
| int | timer_group [NR_OF_TIMER_LISTS] |
| unsigned int | timer_id2timeout [NR_OF_TIMER_LISTS] |
| static unsigned int | timer_id2type [NR_OF_TIMER_LISTS] |
| static struct timer_table * | timertable = 0 |
Definition in file modules/tm/timer.c.
| #define DETACHED_LIST (&detached_timer) |
Definition at line 131 of file modules/tm/timer.c.
Referenced by check_and_split_time_list(), and set_timer().
| #define is_in_timer_list2 | ( | _tl | ) |
Value:
( (_tl)->timer_list && \ ((_tl)->timer_list!=DETACHED_LIST) )
Definition at line 133 of file modules/tm/timer.c.
Referenced by delete_cell(), remove_timer_unsafe(), and unlink_timers().
| #define run_handler_for_each | ( | _tl, | |||
| _handler | ) |
Definition at line 979 of file modules/tm/timer.c.
Referenced by timer_routine(), and utimer_routine().
| #define UTIME_TYPE 1 |
| static struct timer_link* check_and_split_time_list | ( | struct timer * | timer_list, | |
| utime_t | time | |||
| ) | [static, read] |
Definition at line 750 of file modules/tm/timer.c.
References DETACHED_LIST, timer::first_tl, timer::id, timer::last_tl, timer_link::ld_tl, LM_CRIT, lock, timer::mutex, timer_link::next_tl, NULL, timer_link::prev_tl, timer_link::time_out, timer_link::timer_list, and unlock.
Referenced by timer_routine(), and utimer_routine().
| void cleanup_localcancel_timers | ( | struct cell * | t | ) |
Definition at line 383 of file modules/tm/timer.c.
References retr_buf::fr_timer, ua_client::local_cancel, cell::nr_of_outgoings, reset_timer(), retr_buf::retr_timer, and cell::uac.
Referenced by wait_handler().
| static void delete_cell | ( | struct cell * | p_cell, | |
| int | unlock | |||
| ) | [static] |
Definition at line 181 of file modules/tm/timer.c.
References cell::dele_tl, DELETE_LIST, retr_buf::fr_timer, free_cell(), cell::hash_index, is_in_timer_list2, IS_REFFED_UNSAFE, LM_DBG, LM_ERR, ua_client::local_cancel, cell::nr_of_outgoings, NULL, cell::ref_count, ua_client::request, ua_server::response, retr_buf::retr_timer, set_timer(), timer_link::time_out, timer_link::timer_list, cell::uac, cell::uas, unlink_timers(), UNLOCK_HASH, and cell::wait_tl.
Referenced by delete_handler(), and wait_handler().
| static void delete_handler | ( | struct timer_link * | dele_tl | ) | [inline, static] |
Definition at line 426 of file modules/tm/timer.c.
References delete_cell(), get_dele_timer_payload, LM_DBG, and LM_ERR.
Referenced by timer_routine().
| static void fake_reply | ( | struct cell * | t, | |
| int | branch, | |||
| int | code | |||
| ) | [static] |
Definition at line 254 of file modules/tm/timer.c.
References cancel_branch(), FAKED_REPLY, is_invite, is_local, local_reply(), put_on_wait(), relay_reply(), RPS_COMPLETED, and should_cancel_branch().
Referenced by final_response_handler(), and retransmission_handler().
| static void final_response_handler | ( | struct timer_link * | fr_tl | ) | [inline, static] |
Definition at line 327 of file modules/tm/timer.c.
References retr_buf::activ_type, retr_buf::branch, fake_reply(), get_fr_timer_payload, LM_CRIT, LM_DBG, LM_ERR, LOCK_REPLIES, METHOD_INVITE, retr_buf::my_T, put_on_wait(), ua_server::request, reset_timer(), retr_buf::retr_timer, ua_server::status, TYPE_LOCAL_CANCEL, and cell::uas.
Referenced by timer_routine().
| void free_timer_table | ( | void | ) |
Definition at line 563 of file modules/tm/timer.c.
References shm_free.
Referenced by tm_shutdown().
| struct timer_table* get_timertable | ( | void | ) | [read] |
| void init_timer_list | ( | enum lists | list_id | ) |
Definition at line 583 of file modules/tm/timer.c.
References init_timerlist_lock(), and reset_timer_list().
Referenced by tm_init_timers().
| static void insert_timer_unsafe | ( | struct timer * | timer_list, | |
| struct timer_link * | tl, | |||
| utime_t | time_out | |||
| ) | [static] |
Definition at line 708 of file modules/tm/timer.c.
References timer_link::deleted, timer::first_tl, timer::id, timer::last_tl, timer_link::ld_tl, LM_DBG, timer_link::next_tl, timer_link::prev_tl, timer_link::time_out, and timer_link::timer_list.
Referenced by set_1timer(), and set_timer().
| void print_timer_list | ( | enum lists | list_id | ) |
Definition at line 592 of file modules/tm/timer.c.
References timer::first_tl, timer::last_tl, LM_DBG, timer_link::next_tl, and timer_table::timers.
| static void remove_timer_unsafe | ( | struct timer_link * | tl | ) | [static] |
Definition at line 668 of file modules/tm/timer.c.
References timer::id, is_in_timer_list2, timer::last_tl, timer_link::ld_tl, LM_CRIT, LM_DBG, timer_link::next_tl, NULL, timer_link::prev_tl, timer_link::time_out, and timer_link::timer_list.
Referenced by set_timer(), and unlink_timers().
| void reset_timer | ( | struct timer_link * | tl | ) |
Definition at line 812 of file modules/tm/timer.c.
References timer_link::deleted, and LM_DBG.
Referenced by cancel_invite(), cleanup_localcancel_timers(), cleanup_uac_timers(), final_response_handler(), reply_received(), retransmission_handler(), and t_release_transaction().
| void reset_timer_list | ( | enum lists | list_id | ) |
Definition at line 569 of file modules/tm/timer.c.
References timer::first_tl, timer::last_tl, timer_link::next_tl, NULL, timer_link::prev_tl, timer_link::time_out, and timer_table::timers.
Referenced by init_timer_list(), and unlink_timer_lists().
| static void retransmission_handler | ( | struct timer_link * | retr_tl | ) | [inline, static] |
Definition at line 284 of file modules/tm/timer.c.
References retr_buf::activ_type, retr_buf::branch, retr_buf::buffer, fake_reply(), retr_buf::fr_timer, get_retr_timer_payload, id, LM_DBG, LM_ERR, retr_buf::my_T, NULL, reset_timer(), retr_buf::retr_list, RT_T2, _str::s, SEND_BUFFER, set_timer(), t_retransmit_reply(), timer_link::timer_list, TYPE_LOCAL_CANCEL, and TYPE_REQUEST.
Referenced by utimer_routine().
| void set_1timer | ( | struct timer_link * | new_tl, | |
| enum lists | list_id, | |||
| utime_t * | ext_timeout | |||
| ) |
Definition at line 883 of file modules/tm/timer.c.
References get_ticks(), get_uticks(), insert_timer_unsafe(), LM_CRIT, lock, timer::mutex, NR_OF_TIMER_LISTS, timer_link::time_out, timeout, timer_id2timeout, timer_id2type, timer_table::timers, unlock, and UTIME_TYPE.
Referenced by put_on_wait().
| void set_timer | ( | struct timer_link * | new_tl, | |
| enum lists | list_id, | |||
| utime_t * | ext_timeout | |||
| ) |
Definition at line 837 of file modules/tm/timer.c.
References DETACHED_LIST, get_ticks(), get_uticks(), insert_timer_unsafe(), LM_CRIT, LM_DBG, lock, timer::mutex, NR_OF_TIMER_LISTS, remove_timer_unsafe(), timeout, timer_id2timeout, timer_id2type, timer_link::timer_list, timer_table::timers, unlock, and UTIME_TYPE.
Referenced by _set_fr_retr(), delete_cell(), reply_received(), and retransmission_handler().
| void timer_routine | ( | unsigned int | ticks, | |
| void * | attr | |||
| ) |
Definition at line 995 of file modules/tm/timer.c.
References check_and_split_time_list(), delete_handler(), DELETE_LIST, final_response_handler(), FR_INV_TIMER_LIST, FR_TIMER_LIST, id, RT_T1_TO_1, run_handler_for_each, timer_table::timers, wait_handler(), and WT_TIMER_LIST.
| struct timer_table* tm_init_timers | ( | void | ) | [read] |
Definition at line 487 of file modules/tm/timer.c.
References DELETE_LIST, FR_INV_TIMER_LIST, FR_TIMER_LIST, timer::id, init_timer_list(), LM_ERR, MIN_TIMER_VALUE, NR_OF_TIMER_LISTS, RT_T1_TO_1, RT_T1_TO_2, RT_T1_TO_3, RT_T2, shm_malloc(), timer_id2timeout, timer_table::timers, and WT_TIMER_LIST.
Referenced by mod_init().
| void unlink_timer_lists | ( | void | ) |
Definition at line 462 of file modules/tm/timer.c.
References DELETE_LIST, timer::first_tl, free_cell(), get_dele_timer_payload, timer::last_tl, LM_DBG, timer_link::next_tl, NR_OF_TIMER_LISTS, reset_timer_list(), and timer_table::timers.
Referenced by tm_shutdown().
| static void unlink_timers | ( | struct cell * | t | ) | [static] |
Definition at line 918 of file modules/tm/timer.c.
References retr_buf::fr_timer, FR_TIMER_LIST, is_in_timer_list2, ua_client::local_cancel, lock, timer::mutex, cell::nr_of_outgoings, remove_timer_unsafe(), ua_client::request, ua_server::response, retr_buf::retr_timer, RT_T1_TO_1, timer_table::timers, cell::uac, cell::uas, and unlock.
Referenced by delete_cell().
| void utimer_routine | ( | utime_t | uticks, | |
| void * | attr | |||
| ) |
Definition at line 1024 of file modules/tm/timer.c.
References check_and_split_time_list(), id, NR_OF_TIMER_LISTS, retransmission_handler(), RT_T1_TO_1, RT_T1_TO_2, RT_T1_TO_3, RT_T2, run_handler_for_each, and timer_table::timers.
Referenced by mod_init().
| static void wait_handler | ( | struct timer_link * | wait_tl | ) | [inline, static] |
Definition at line 393 of file modules/tm/timer.c.
References cleanup_localcancel_timers(), delete_cell(), get_wait_timer_payload, cell::hash_index, is_invite, LM_DBG, LM_ERR, LOCK_HASH, and remove_from_hash_table_unsafe().
Referenced by timer_routine().
struct timer detached_timer [static] |
Definition at line 129 of file modules/tm/timer.c.
| int timer_group[NR_OF_TIMER_LISTS] |
Definition at line 138 of file modules/tm/timer.c.
Referenced by init_timerlist_lock(), and lock_initialize().
| unsigned int timer_id2timeout[NR_OF_TIMER_LISTS] |
Definition at line 149 of file modules/tm/timer.c.
Referenced by set_1timer(), set_timer(), t_next_contacts(), and tm_init_timers().
unsigned int timer_id2type[NR_OF_TIMER_LISTS] [static] |
struct timer_table* timertable = 0 [static] |
Definition at line 128 of file modules/tm/timer.c.
1.5.6