t_lookup.h

Go to the documentation of this file.
00001 /*
00002  * $Id: t_lookup.h 5003 2008-09-26 11:01:51Z henningw $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License 
00019  * along with this program; if not, write to the Free Software 
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  * History:
00023  * --------
00024  *  2003-02-24  s/T_NULL/T_NULL_CELL/ to avoid redefinition conflict w/
00025  *               nameser_compat.h (andrei)
00026  *  2004-02-11  FIFO/CANCEL + alignments (hash=f(callid,cseq)) (uli+jiri)
00027  */
00028 
00029 /*! \file
00030  * \brief TM :: Hash lookups
00031  *
00032  * \ingroup tm
00033  * - Module: \ref tm
00034  */
00035 
00036 #ifndef _T_LOOKUP_H
00037 #define _T_LOOKUP_H
00038 
00039 #include "config.h"
00040 #include "t_funcs.h"
00041 
00042 #define T_UNDEFINED  ( (struct cell*) -1 )
00043 #define T_NULL_CELL       ( (struct cell*) 0 )
00044 
00045 extern unsigned int     global_msg_id;
00046 extern int ruri_matching;
00047 extern int via1_matching;
00048 
00049 void init_t(void);
00050 int init_rb( struct retr_buf *rb, struct sip_msg *msg );
00051 struct cell* t_lookupOriginalT( struct sip_msg* p_msg );
00052 int t_reply_matching( struct sip_msg* , int* );
00053 int t_lookup_request( struct sip_msg* p_msg , int leave_new_locked );
00054 int t_newtran( struct sip_msg* p_msg );
00055 
00056 int _add_branch_label( struct cell *trans,
00057     char *str, int *len, int branch );
00058 int add_branch_label( struct cell *trans, 
00059    struct sip_msg *p_msg, int branch );
00060 
00061 /* releases T-context */
00062 int  t_unref( struct sip_msg *p_msg);
00063 void t_unref_cell( struct cell *);
00064 typedef void (*tunrefcell_f)(struct cell *);
00065 
00066 
00067 /* function returns:
00068  *      -1 - transaction wasn't found
00069  *       1 - transaction found
00070  */
00071 int t_check( struct sip_msg* , int *branch );
00072 
00073 typedef struct cell * (*tlookuporiginalt_f)(struct sip_msg*);
00074 
00075 typedef struct cell * (*tgett_f)(void);
00076 struct cell *get_t(void);
00077 
00078 /* use carefully or better not at all -- current transaction is 
00079  * primarily set by lookup functions */
00080 void set_t(struct cell *t);
00081 
00082 
00083 struct cell *get_cancelled_t(void);
00084 void reset_cancelled_t(void);
00085 
00086 struct cell *get_e2eack_t(void);
00087 void reset_e2eack_t(void);
00088 
00089 
00090 #define T_GET_TI       "t_get_trans_ident"
00091 #define T_LOOKUP_IDENT "t_lookup_ident"
00092 #define T_IS_LOCAL     "t_is_local"
00093 
00094 typedef int (*tislocal_f)(struct sip_msg*);
00095 typedef int (*tnewtran_f)(struct sip_msg*);
00096 typedef int (*tget_ti_f)(struct sip_msg*, unsigned int*, unsigned int*);
00097 typedef int (*tlookup_ident_f)(struct cell**, unsigned int, unsigned int);
00098 
00099 int t_is_local(struct sip_msg*);
00100 int t_get_trans_ident(struct sip_msg* p_msg, 
00101    unsigned int* hash_index, unsigned int* label);
00102 int t_lookup_ident(struct cell** trans,
00103    unsigned int hash_index, unsigned int label);
00104 
00105 /* lookup a transaction by callid and cseq */
00106 int t_lookup_callid(struct cell** trans, str callid, str cseq);
00107 
00108 #endif
00109 

Generated on Thu May 24 20:00:32 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6