00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef _T_LOOKUP_H
00040 #define _T_LOOKUP_H
00041
00042 #include "defs.h"
00043
00044
00045 #include "config.h"
00046 #include "t_funcs.h"
00047
00048 #define T_UNDEFINED ( (struct cell*) -1 )
00049 #define T_NULL_CELL ( (struct cell*) 0 )
00050
00051 #define T_BR_UNDEFINED (-1)
00052
00053 extern unsigned int global_msg_id;
00054
00055
00056
00057 void init_t(void);
00058 int init_rb( struct retr_buf *rb, struct sip_msg *msg );
00059
00060 typedef struct cell* (*tlookup_original_f)( struct sip_msg* p_msg );
00061 struct cell* t_lookupOriginalT( struct sip_msg* p_msg );
00062
00063 int t_reply_matching( struct sip_msg* , int* );
00064
00065 typedef int (*tlookup_request_f)(struct sip_msg*, int, int*);
00066
00067 int t_lookup_request( struct sip_msg* p_msg, int leave_new_locked,
00068 int* canceled);
00069 int t_newtran( struct sip_msg* p_msg );
00070
00071 int _add_branch_label( struct cell *trans,
00072 char *str, int *len, int branch );
00073 int add_branch_label( struct cell *trans,
00074 struct sip_msg *p_msg, int branch );
00075
00076
00077 int t_unref( struct sip_msg *p_msg);
00078 typedef int (*tunref_f)( struct sip_msg *p_msg);
00079
00080 typedef int (*tcheck_f)(struct sip_msg*, int*);
00081
00082
00083 int t_check(struct sip_msg* , int *branch );
00084
00085 int t_check_msg(struct sip_msg* , int *branch );
00086
00087 typedef struct cell * (*tgett_f)(void);
00088 struct cell *get_t(void);
00089 int get_t_branch(void);
00090
00091
00092
00093 void set_t(struct cell *t, int branch);
00094
00095
00096 #define T_GET_TI "t_get_trans_ident"
00097 #define T_LOOKUP_IDENT "t_lookup_ident"
00098 #define T_IS_LOCAL "t_is_local"
00099
00100 typedef int (*tislocal_f)(struct sip_msg*);
00101 typedef int (*tnewtran_f)(struct sip_msg*);
00102 typedef int (*tget_ti_f)(struct sip_msg*, unsigned int*, unsigned int*);
00103 typedef int (*tlookup_ident_f)(struct cell**, unsigned int, unsigned int);
00104 typedef int (*trelease_f)(struct sip_msg*);
00105 typedef int (*tlookup_callid_f)(struct cell **, str, str);
00106
00107 int t_is_local(struct sip_msg*);
00108 int t_get_trans_ident(struct sip_msg* p_msg, unsigned int* hash_index, unsigned int* label);
00109 int t_lookup_ident(struct cell** trans, unsigned int hash_index, unsigned int label);
00110
00111 int t_lookup_callid(struct cell** trans, str callid, str cseq);
00112
00113 int t_set_fr(struct sip_msg* msg, unsigned int fr_inv_to, unsigned int fr_to );
00114 int t_reset_fr(void);
00115 #ifdef TM_DIFF_RT_TIMEOUT
00116 int t_set_retr(struct sip_msg* msg, unsigned int t1_to, unsigned int t2_to);
00117 int t_reset_retr(void);
00118 #endif
00119 int t_set_max_lifetime(struct sip_msg* msg, unsigned int eol_inv,
00120 unsigned int eol_noninv);
00121 int t_reset_max_lifetime(void);
00122
00123 #ifdef WITH_AS_SUPPORT
00124
00127 int t_get_canceled_ident(struct sip_msg *msg, unsigned int *hash_index,
00128 unsigned int *label);
00129 typedef int (*t_get_canceled_ident_f)(struct sip_msg *msg,
00130 unsigned int *hash_index, unsigned int *label);
00131 #endif
00132
00136 #define WITH_TM_CTX
00137 #ifdef WITH_TM_CTX
00138
00139 typedef struct _tm_ctx {
00140 int branch_index;
00141 } tm_ctx_t;
00142
00143 typedef tm_ctx_t* (*tm_ctx_get_f)(void);
00144
00145 tm_ctx_t* tm_ctx_get(void);
00146 void tm_ctx_init(void);
00147 void tm_ctx_set_branch_index(int v);
00148
00149 #else
00150
00151 #define tm_ctx_get() NULL
00152 #define tm_ctx_init()
00153 #define tm_ctx_set_branch_index(v)
00154
00155 #endif
00156
00157 #endif