t_fwd.h

00001 /*
00002  * $Id$
00003  *
00004  *
00005  * Copyright (C) 2001-2003 FhG Fokus
00006  *
00007  * This file is part of ser, a free SIP server.
00008  *
00009  * ser is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version
00013  *
00014  * For a license to use the ser software under conditions
00015  * other than those described here, or to purchase support for this
00016  * software, please contact iptel.org by e-mail at the following addresses:
00017  *    info@iptel.org
00018  *
00019  * ser is distributed in the hope that it will be useful,
00020  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  * GNU General Public License for more details.
00023  *
00024  * You should have received a copy of the GNU General Public License 
00025  * along with this program; if not, write to the Free Software 
00026  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027  */
00028 /*
00029  * History:
00030  * --------
00031  *  2003-02-18  added proto to various function prototypes (andrei)
00032  *  2007-05-02  added unmatched_cancel & t_forward_cancel (andrei)
00033  */
00034 
00035 
00036 #ifndef _T_FWD_H
00037 #define _T_FWD_H
00038 
00039 #include "defs.h"
00040 
00041 #include "../../proxy.h"
00042 #include "h_table.h"
00043 
00044 /* cancel hop by hop */
00045 #define E2E_CANCEL_HOP_BY_HOP
00046 
00047 enum unmatched_cancel_t { UM_CANCEL_STATEFULL=0, UM_CANCEL_STATELESS,
00048                                                         UM_CANCEL_DROP };
00049 
00050 typedef int (*tfwd_f)(struct sip_msg* p_msg , struct proxy_l * proxy );
00051 typedef int (*taddblind_f)( /*struct cell *t */ void);
00052 typedef int (*treplicate_uri_f)(struct sip_msg* p_msg , str *suri );
00053 
00054 void t_on_branch(unsigned int go_to);
00055 unsigned int get_on_branch(void);
00056 int t_replicate_uri(struct sip_msg *p_msg, str *suri);
00057 int t_replicate(struct sip_msg *p_msg, struct proxy_l * proxy, int proto);
00058 /*  -- not use outside t_fwd.c for noe
00059 char *print_uac_request( struct cell *t, struct sip_msg *i_req,
00060     int branch, str *uri, unsigned int *len, struct dest_info *dst);
00061 */
00062 void e2e_cancel( struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite );
00063 int e2e_cancel_branch( struct sip_msg *cancel_msg, struct cell *t_cancel, struct cell *t_invite, int branch );
00064 /*
00065 int add_uac(struct cell *t, struct sip_msg *request, str *uri, str* next_hop,
00066                                 str* path, struct proxy_l *proxy, int proto );
00067 */
00068 #ifdef USE_DNS_FAILOVER
00069 int add_uac_dns_fallback( struct cell *t, struct sip_msg* msg, 
00070                                                                         struct ua_client* old_uac,
00071                                                                         int lock_replies);
00072 #endif
00073 int add_blind_uac(/* struct cell *t */ void);
00074 int t_forward_nonack( struct cell *t, struct sip_msg* p_msg,
00075                                                 struct proxy_l * p, int proto);
00076 int t_forward_cancel(struct sip_msg* p_msg , struct proxy_l * proxy,
00077                                                 int proto, struct cell** tran);
00078 int t_forward_ack( struct sip_msg* p_msg );
00079 int t_send_branch( struct cell *t, int branch, struct sip_msg* p_msg ,
00080                                         struct proxy_l * proxy, int lock_replies);
00081 int t_relay_cancel(struct sip_msg* p_msg);
00082 
00083 int reparse_on_dns_failover_fixup(void *handle, str *gname, str *name, void **val);
00084 
00085 #endif
00086 
00087