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 #ifndef _MSG_TRANSLATOR_H
00037 #define _MSG_TRANSLATOR_H
00038
00039 #define MY_HF_SEP ": "
00040 #define MY_HF_SEP_LEN 2
00041
00042 #define BRANCH_SEPARATOR '.'
00043 #define WARNING "Warning: 392 "
00044 #define WARNING_LEN (sizeof(WARNING)-1)
00045 #define WARNING_PHRASE " \"Noisy feedback tells: "
00046 #define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1)
00047
00048 #define MSG_TRANS_SHM_FLAG (1<<0)
00049 #define MSG_TRANS_NOVIA_FLAG (1<<1)
00050
00051
00052
00053
00054 #include "parser/msg_parser.h"
00055 #include "ip_addr.h"
00056
00057
00058 struct bookmark {
00059 str to_tag_val;
00060 };
00061
00062
00063 struct hostport {
00064 str* host;
00065 str* port;
00066 };
00067
00068
00069 #define set_hostport(hp, msg) \
00070 do{ \
00071 if ((msg) && ((struct sip_msg*)(msg))->set_global_address.len) \
00072 (hp)->host=&(((struct sip_msg*)(msg))->set_global_address); \
00073 else \
00074 (hp)->host=&default_global_address; \
00075 if ((msg) && ((struct sip_msg*)(msg))->set_global_port.len) \
00076 (hp)->port=&(((struct sip_msg*)(msg))->set_global_port); \
00077 else \
00078 (hp)->port=&default_global_port; \
00079 }while(0)
00080
00081 char * build_req_buf_from_sip_req ( struct sip_msg* msg,
00082 unsigned int *returned_len, struct socket_info* send_sock,
00083 int proto, unsigned int flags);
00084
00085 char * build_res_buf_from_sip_res( struct sip_msg* msg,
00086 unsigned int *returned_len);
00087
00088
00089 char * build_res_buf_from_sip_req( unsigned int code,
00090 str *text,
00091 str *new_tag,
00092 struct sip_msg* msg,
00093 unsigned int *returned_len,
00094 struct bookmark *bmark);
00095
00096 char* via_builder( unsigned int *len,
00097 struct socket_info* send_sock,
00098 str *branch, str* extra_params, int proto, struct hostport *hp );
00099
00100
00101 int branch_builder( unsigned int hash_index,
00102
00103 unsigned int label, char * char_v,
00104 int branch,
00105
00106 char *branch_str, int *len );
00107
00108
00109 int received_test( struct sip_msg *msg );
00110
00111 #endif