From d968c7e9452b4e5756fded9766d424b859aca3e5 Mon Sep 17 00:00:00 2001 From: bossiel Date: Fri, 12 Feb 2010 18:28:33 +0000 Subject: [PATCH] Update parsers. --- trunk/tinySAK/src/tsk_object.c | 2 +- trunk/tinySAK/src/tsk_params.c | 19 +- trunk/tinySAK/src/tsk_params.h | 1 + trunk/tinySAK/src/tsk_string.c | 5 +- trunk/tinySAK/src/tsk_string.h | 2 +- .../tinysip/headers/tsip_header_Call_ID.h | 4 +- .../tinysip/headers/tsip_header_Contact.h | 19 - .../tinysip/headers/tsip_header_Path.h | 22 +- .../tinysip/headers/tsip_header_Route.h | 22 +- .../headers/tsip_header_Service_Route.h | 13 +- trunk/tinySIP/include/tsip.h | 6 + trunk/tinySIP/ragel.sh | 13 +- trunk/tinySIP/ragel/tsip_parser_header.rl | 44 +- .../ragel/tsip_parser_header_Call_ID.rl | 5 +- .../tinySIP/ragel/tsip_parser_header_Path.rl | 211 ++ .../tinySIP/ragel/tsip_parser_header_Route.rl | 214 ++ .../ragel/tsip_parser_header_Service_Route.rl | 81 +- trunk/tinySIP/ragel/tsip_parser_uri.rl | 11 +- .../src/authentication/tsip_challenge.c | 8 +- trunk/tinySIP/src/dialogs/tsip_dialog.c | 20 +- .../src/dialogs/tsip_dialog_register.client.c | 43 +- .../tinySIP/src/headers/tsip_header_Call_ID.c | 27 +- trunk/tinySIP/src/headers/tsip_header_Path.c | 1760 +++++++++++++++- trunk/tinySIP/src/headers/tsip_header_Route.c | 1768 +++++++++++++++- .../src/headers/tsip_header_Service_Route.c | 1832 ++++++++++++++++- .../tinySIP/src/parsers/tsip_parser_header.c | 248 ++- trunk/tinySIP/src/parsers/tsip_parser_uri.c | 160 +- trunk/tinySIP/src/transports/tsip_transport.c | 1 - trunk/tinySIP/src/tsip.c | 10 + trunk/tinySIP/src/tsip_message.c | 41 +- trunk/tinySIP/src/tsip_uri.c | 29 +- trunk/tinySIP/test/test/test_sipmessages.h | 33 +- trunk/tinySIP/test/test/test_stack.h | 17 +- trunk/tinySIP/test/test/test_uri.h | 2 + trunk/vs_2005/tinySIP/tinySIP.vcproj | 2 +- 35 files changed, 6362 insertions(+), 333 deletions(-) diff --git a/trunk/tinySAK/src/tsk_object.c b/trunk/tinySAK/src/tsk_object.c index 3f086b20..6a35d6f8 100644 --- a/trunk/tinySAK/src/tsk_object.c +++ b/trunk/tinySAK/src/tsk_object.c @@ -32,7 +32,7 @@ #include "tsk_debug.h" #if defined (_DEBUG) || defined (DEBUG) -# define TSK_DEBUG_OBJECTS 1 +# define TSK_DEBUG_OBJECTS 0 static int tsk_objects_count = 0; #else # define TSK_DEBUG_OBJECTS 0 diff --git a/trunk/tinySAK/src/tsk_params.c b/trunk/tinySAK/src/tsk_params.c index b4ee5727..55c71ebc 100644 --- a/trunk/tinySAK/src/tsk_params.c +++ b/trunk/tinySAK/src/tsk_params.c @@ -50,20 +50,23 @@ tsk_param_t *tsk_params_parse_param(const char* line, size_t size) const char* start = line; const char* end = (line + size); const char* equal = strstr(line, "="); - tsk_param_t *param = TSK_PARAM_CREATE(0, 0); + tsk_param_t *param = TSK_PARAM_CREATE_NULL(); - if(equal && equalname = tsk_calloc((equal-start)+1, sizeof(const char)); + if((param->name = tsk_calloc((equal-start)+1, sizeof(const char)))){ memcpy(param->name, start, (equal-start)); + } - param->value = tsk_calloc((end-equal-1)+1, sizeof(const char)); - memcpy(param->value, equal+1, (end-equal-1)); + if((param->value = tsk_calloc((end-equal-1)+1, sizeof(const char)))){ + memcpy(param->value, equal+1, (end-equal-1)); + } } - else + else if(param) { - param->name = tsk_calloc((end-start)+1, sizeof(const char)); - memcpy(param->name, start, (end-start)); + if((param->name = tsk_calloc((end-start)+1, sizeof(const char)))){ + memcpy(param->name, start, (end-start)); + } } return param; diff --git a/trunk/tinySAK/src/tsk_params.h b/trunk/tinySAK/src/tsk_params.h index 56e436f1..6f3cfbb2 100644 --- a/trunk/tinySAK/src/tsk_params.h +++ b/trunk/tinySAK/src/tsk_params.h @@ -38,6 +38,7 @@ TSK_BEGIN_DECLS #define TSK_PARAM_CREATE(name, value) tsk_object_new(tsk_param_def_t, name, value) +#define TSK_PARAM_CREATE_NULL() TSK_PARAM_CREATE(0,0) typedef struct tsk_param_s { diff --git a/trunk/tinySAK/src/tsk_string.c b/trunk/tinySAK/src/tsk_string.c index 2e4b96b6..69465a52 100644 --- a/trunk/tinySAK/src/tsk_string.c +++ b/trunk/tinySAK/src/tsk_string.c @@ -159,12 +159,13 @@ char* tsk_strndup(const char *s1, size_t n) /**@ingroup tsk_string_group * Checks if @ref str1 contains an occurrence of @ref str2. * @param str1 The master. +* @param size The size of @b str1. * @param str2 The string for which to search an occcurrence. * @retval 1 if @ref str1 contains an occurrence of @ref str2 and Zero otherwise. */ -int tsk_strcontains(const char * str1, const char * str2) +int tsk_strcontains(const char * str1, size_t size, const char * str2) { - return ((str1 && str2) && strstr(str1, str2)); + return ((str1 && str2) && (strstr(str1, str2) && strstr(str1, str2) < (str1 + size))); } /**@ingroup tsk_string_group diff --git a/trunk/tinySAK/src/tsk_string.h b/trunk/tinySAK/src/tsk_string.h index 775e7b37..4b92e5e3 100644 --- a/trunk/tinySAK/src/tsk_string.h +++ b/trunk/tinySAK/src/tsk_string.h @@ -52,7 +52,7 @@ TINYSAK_API int tsk_strcmp(const char * str1, const char * str2); TINYSAK_API int tsk_strncmp(const char * str1, const char * str2, size_t n); TINYSAK_API char* tsk_strdup(const char *s1); TINYSAK_API char* tsk_strndup(const char *s1, size_t n); -TINYSAK_API int tsk_strcontains(const char * str1, const char * str2); +TINYSAK_API int tsk_strcontains(const char * str1, size_t size, const char * str2); TINYSAK_API void tsk_strcat(char** destination, const char* source); TINYSAK_API void tsk_strncat(char** destination, const char* source, size_t n); TINYSAK_API int tsk_sprintf(char** str, const char* format, ...); diff --git a/trunk/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h b/trunk/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h index 0ebcafc7..ede01e05 100644 --- a/trunk/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h +++ b/trunk/tinySIP/include/tinysip/headers/tsip_header_Call_ID.h @@ -33,6 +33,8 @@ #include "tinysip_config.h" #include "tinysip/headers/tsip_header.h" +#include "tsk_uuid.h" + TSIP_BEGIN_DECLS /**@def TSIP_HEADER_CALL_ID_CREATE @@ -62,7 +64,7 @@ typedef struct tsip_header_Call_ID_s } tsip_header_Call_ID_t; -void tsip_header_Call_ID_random(tsk_istr_t *result); +int tsip_header_Call_ID_random(tsk_uuidstring_t *result); tsip_header_Call_ID_t *tsip_header_Call_ID_parse(const char *data, size_t size); TINYSIP_GEXTERN const void *tsip_header_Call_ID_def_t; diff --git a/trunk/tinySIP/include/tinysip/headers/tsip_header_Contact.h b/trunk/tinySIP/include/tinysip/headers/tsip_header_Contact.h index 95f10e70..c081def2 100644 --- a/trunk/tinySIP/include/tinysip/headers/tsip_header_Contact.h +++ b/trunk/tinySIP/include/tinysip/headers/tsip_header_Contact.h @@ -42,20 +42,6 @@ TSIP_BEGIN_DECLS */ #define TSIP_HEADER_CONTACT_CREATE() tsk_object_new(tsip_header_Contact_def_t) -//#define TSIP_CONTACT_CREATE() tsk_object_new(tsip_contact_def_t) -// -//typedef struct tsip_contact_s -//{ -// TSK_DECLARE_OBJECT; -// -// char *display_name; -// tsip_uri_t *uri; -// int32_t expires; -// tsk_params_L_t *params; -//} -//tsip_contact_t; -//typedef tsk_list_t tsip_contacts_L_t; - //////////////////////////////////////////////////////////////////////////////////////////////////// /// @struct @@ -97,18 +83,13 @@ typedef struct tsip_header_Contact_s char *display_name; tsip_uri_t *uri; int32_t expires; - //tsip_contacts_L_t *contacts; } tsip_header_Contact_t; typedef tsk_list_t tsip_header_Contacts_L_t; -//const tsip_contact_t *tsip_header_Contact_get_ContactAt(tsip_header_Contact_t *hdr_contact, size_t index); -//#define tsip_header_Contact_get_Contact(hdr_contact) tsip_header_Contact_get_ContactAt(hdr_contact, 0) - tsip_header_Contacts_L_t *tsip_header_Contact_parse(const char *data, size_t size); TINYSIP_GEXTERN const void *tsip_header_Contact_def_t; -//TINYSIP_GEXTERN const void *tsip_contact_def_t; TSIP_END_DECLS diff --git a/trunk/tinySIP/include/tinysip/headers/tsip_header_Path.h b/trunk/tinySIP/include/tinysip/headers/tsip_header_Path.h index b84b1043..5301be7a 100644 --- a/trunk/tinySIP/include/tinysip/headers/tsip_header_Path.h +++ b/trunk/tinySIP/include/tinysip/headers/tsip_header_Path.h @@ -33,24 +33,42 @@ #include "tinysip_config.h" #include "tinysip/headers/tsip_header.h" +#include "tinysip/tsip_uri.h" + TSIP_BEGIN_DECLS +/**@def TSIP_HEADER_PATH_CREATE +* Creates new sip 'Path' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header. +* @sa TSK_OBJECT_SAFE_FREE. +*/ +#define TSIP_HEADER_PATH_CREATE() tsk_object_new(tsip_header_Path_def_t) + //////////////////////////////////////////////////////////////////////////////////////////////////// /// @struct /// -/// @brief SIP header 'Path'. +/// @brief SIP header 'Path' as per RFC 3327. /// @author Mamadou /// @date 12/3/2009 /// -/// @par ABNF +/// @par ABNF : Path = "Path" HCOLON path-value *(COMMA path-value) +/// path-value = name-addr *( SEMI rr-param ) /// //////////////////////////////////////////////////////////////////////////////////////////////////// typedef struct tsip_header_Path_s { TSIP_DECLARE_HEADER; + + char *display_name; + tsip_uri_t *uri; } tsip_header_Path_t; +typedef tsk_list_t tsip_header_Paths_L_t; + +tsip_header_Paths_L_t *tsip_header_Path_parse(const char *data, size_t size); + +TINYSIP_GEXTERN const void *tsip_header_Path_def_t; + TSIP_END_DECLS #endif /* _TSIP_HEADER_PATH_H_ */ diff --git a/trunk/tinySIP/include/tinysip/headers/tsip_header_Route.h b/trunk/tinySIP/include/tinysip/headers/tsip_header_Route.h index a75812b1..f71133f1 100644 --- a/trunk/tinySIP/include/tinysip/headers/tsip_header_Route.h +++ b/trunk/tinySIP/include/tinysip/headers/tsip_header_Route.h @@ -33,8 +33,16 @@ #include "tinysip_config.h" #include "tinysip/headers/tsip_header.h" +#include "tinysip/tsip_uri.h" + TSIP_BEGIN_DECLS +/**@def TSIP_HEADER_ROUTE_CREATE +* Creates new sip 'Route' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header. +* @sa TSK_OBJECT_SAFE_FREE. +*/ +#define TSIP_HEADER_ROUTE_CREATE() tsk_object_new(tsip_header_Route_def_t) + //////////////////////////////////////////////////////////////////////////////////////////////////// /// @struct /// @@ -42,15 +50,27 @@ TSIP_BEGIN_DECLS /// @author Mamadou /// @date 12/3/2009 /// -/// @par ABNF +/// @par ABNF : Route = "Route" HCOLON route-param *(COMMA route-param) +/// route-param = name-addr *( SEMI rr-param ) /// //////////////////////////////////////////////////////////////////////////////////////////////////// typedef struct tsip_header_Route_s { TSIP_DECLARE_HEADER; + + char *display_name; + tsip_uri_t *uri; } tsip_header_Route_t; +//#define TSIP_DECLARE_HEADER_ROUTE tsip_header_Route_t header_Route + +typedef tsk_list_t tsip_header_Routes_L_t; + +tsip_header_Routes_L_t *tsip_header_Route_parse(const char *data, size_t size); + +TINYSIP_GEXTERN const void *tsip_header_Route_def_t; + TSIP_END_DECLS #endif /* _TSIP_HEADER_ROUTE_H_ */ diff --git a/trunk/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h b/trunk/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h index 97ac6e9a..45b8abee 100644 --- a/trunk/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h +++ b/trunk/tinySIP/include/tinysip/headers/tsip_header_Service_Route.h @@ -33,14 +33,15 @@ #include "tinysip_config.h" #include "tinysip/headers/tsip_header.h" +#include "tinysip/tsip_uri.h" + TSIP_BEGIN_DECLS /**@def TSIP_HEADER_SERVICE_ROUTE_CREATE * Creates new sip 'Service-Route' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header. * @sa TSK_OBJECT_SAFE_FREE. */ -#define TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(service_route) tsip_header_Service_Route_def_t, (const char*)service_route -#define TSIP_HEADER_SERVICE_ROUTE_CREATE(service_route) tsk_object_new(TSIP_HEADER_SERVICE_ROUTE_VA_ARGS(service_route)) +#define TSIP_HEADER_SERVICE_ROUTE_CREATE() tsk_object_new(tsip_header_Service_Route_def_t) //////////////////////////////////////////////////////////////////////////////////////////////////// /// @struct @@ -56,11 +57,15 @@ TSIP_BEGIN_DECLS typedef struct tsip_header_Service_Route_s { TSIP_DECLARE_HEADER; - char *value; + + char *display_name; + tsip_uri_t *uri; } tsip_header_Service_Route_t; -tsip_header_Service_Route_t *tsip_header_Service_Route_parse(const char *data, size_t size); +typedef tsk_list_t tsip_header_Service_Routes_L_t; + +tsip_header_Service_Routes_L_t *tsip_header_Service_Route_parse(const char *data, size_t size); TINYSIP_GEXTERN const void *tsip_header_Service_Route_def_t; diff --git a/trunk/tinySIP/include/tsip.h b/trunk/tinySIP/include/tsip.h index ed9c922c..735486a3 100644 --- a/trunk/tinySIP/include/tsip.h +++ b/trunk/tinySIP/include/tsip.h @@ -38,6 +38,9 @@ #include "tinysip/api/tsip_register.h" +#include "tinysip/headers/tsip_header_Service_Route.h" +#include "tinysip/headers/tsip_header_Path.h" + #include "tnet_socket.h" #include "dns/tnet_dns.h" @@ -130,6 +133,7 @@ typedef struct tsip_stack_s char* display_name; struct tsip_uri_s *public_identity; struct tsip_uri_s *preferred_identity; + //struct tsip_uri_s *associated_identity; char *private_identity; char *password; @@ -149,6 +153,8 @@ typedef struct tsip_stack_s char* device_id; char* mobility; char* sec_agree_mech; + tsip_header_Paths_L_t* paths; + tsip_header_Service_Routes_L_t* service_routes; /* DNS */ tnet_dns_ctx_t *dns_ctx; diff --git a/trunk/tinySIP/ragel.sh b/trunk/tinySIP/ragel.sh index 88c0c9eb..73664b9d 100644 --- a/trunk/tinySIP/ragel.sh +++ b/trunk/tinySIP/ragel.sh @@ -21,7 +21,7 @@ ragel.exe $OPTIONS -o ../src/parsers/tsip_parser_uri.c tsip_parser_uri.rl #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Allow_Events.c tsip_parser_header_Allow_Events.rl # ==Authorization -ragel.exe $OPTIONS -o ../src/headers/tsip_header_Authorization.c tsip_parser_header_Authorization.rl +#ragel.exe $OPTIONS -o ../src/headers/tsip_header_Authorization.c tsip_parser_header_Authorization.rl # ==Call-ID #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Call_ID.c tsip_parser_header_Call_ID.rl @@ -50,6 +50,9 @@ ragel.exe $OPTIONS -o ../src/headers/tsip_header_Authorization.c tsip_parser_hea # ==Min-Expires #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Min_Expires.c tsip_parser_header_Min_Expires.rl +# ==Path +#ragel.exe $OPTIONS -o ../src/headers/tsip_header_Path.c tsip_parser_header_Path.rl + # ==P-Access-Network-Info #ragel.exe $OPTIONS -o ../src/headers/tsip_header_P_Access_Network_Info.c tsip_parser_header_P_Access_Network_Info.rl @@ -63,7 +66,7 @@ ragel.exe $OPTIONS -o ../src/headers/tsip_header_Authorization.c tsip_parser_hea #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Proxy_Authenticate.c tsip_parser_header_Proxy_Authenticate.rl # ==Proxy-Authorization -ragel.exe $OPTIONS -o ../src/headers/tsip_header_Proxy_Authorization.c tsip_parser_header_Proxy_Authorization.rl +#ragel.exe $OPTIONS -o ../src/headers/tsip_header_Proxy_Authorization.c tsip_parser_header_Proxy_Authorization.rl # ==Record-Route #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Record_Route.c tsip_parser_header_Record_Route.rl @@ -71,6 +74,12 @@ ragel.exe $OPTIONS -o ../src/headers/tsip_header_Proxy_Authorization.c tsip_pars # ==Require #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Require.c tsip_parser_header_Require.rl +# == Service-Route +#ragel.exe $OPTIONS -o ../src/headers/tsip_header_Route.c tsip_parser_header_Route.rl + +# == Service-Route +#ragel.exe $OPTIONS -o ../src/headers/tsip_header_Service_Route.c tsip_parser_header_Service_Route.rl + # ==Supported #ragel.exe $OPTIONS -o ../src/headers/tsip_header_Supported.c tsip_parser_header_Supported.rl diff --git a/trunk/tinySIP/ragel/tsip_parser_header.rl b/trunk/tinySIP/ragel/tsip_parser_header.rl index 8beb9790..4da3d45a 100644 --- a/trunk/tinySIP/ragel/tsip_parser_header.rl +++ b/trunk/tinySIP/ragel/tsip_parser_header.rl @@ -39,13 +39,16 @@ #include "tinysip/headers/tsip_header_From.h" #include "tinysip/headers/tsip_header_Max_Forwards.h" #include "tinysip/headers/tsip_header_Min_Expires.h" -#include "tinysip/headers/tsip_header_P_Preferred_Identity.h" +#include "tinysip/headers/tsip_header_Path.h" #include "tinysip/headers/tsip_header_P_Access_Network_Info.h" +#include "tinysip/headers/tsip_header_P_Preferred_Identity.h" #include "tinysip/headers/tsip_header_Privacy.h" #include "tinysip/headers/tsip_header_Proxy_Authenticate.h" #include "tinysip/headers/tsip_header_Proxy_Authorization.h" #include "tinysip/headers/tsip_header_Record_Route.h" #include "tinysip/headers/tsip_header_Require.h" +#include "tinysip/headers/tsip_header_Route.h" +#include "tinysip/headers/tsip_header_Service_Route.h" #include "tinysip/headers/tsip_header_Supported.h" #include "tinysip/headers/tsip_header_To.h" #include "tinysip/headers/tsip_header_User_Agent.h" @@ -440,7 +443,18 @@ # /*== Path: ==*/ action parse_header_Path { - TSK_DEBUG_ERROR("parse_header_Path NOT IMPLEMENTED"); + tsip_header_Paths_L_t* headers = tsip_header_Path_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } # /* == Priority: ==*/ @@ -574,7 +588,18 @@ # /*== Route: ==*/ action parse_header_Route { - TSK_DEBUG_ERROR("parse_header_Route NOT IMPLEMENTED"); + tsip_header_Routes_L_t* headers = tsip_header_Route_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } # /*== RSeq: ==*/ @@ -610,7 +635,18 @@ # /*== Service-Route: ==*/ action parse_header_Service_Route { - TSK_DEBUG_ERROR("parse_header_Service_Route NOT IMPLEMENTED"); + tsip_header_Service_Routes_L_t* headers = tsip_header_Service_Route_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Service_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } # /*== Session-Expires: ==*/ diff --git a/trunk/tinySIP/ragel/tsip_parser_header_Call_ID.rl b/trunk/tinySIP/ragel/tsip_parser_header_Call_ID.rl index 01054c8f..a73bbec8 100644 --- a/trunk/tinySIP/ragel/tsip_parser_header_Call_ID.rl +++ b/trunk/tinySIP/ragel/tsip_parser_header_Call_ID.rl @@ -84,10 +84,9 @@ int tsip_header_Call_ID_tostring(const void* header, tsk_buffer_t* output) return -1; } -void tsip_header_Call_ID_random(tsk_istr_t *result) +int tsip_header_Call_ID_random(tsk_uuidstring_t *result) { - uint64_t epoch = tsk_time_epoch(); - tsk_itoa(epoch, result); + return tsk_uuidgenerate(result); } tsip_header_Call_ID_t *tsip_header_Call_ID_parse(const char *data, size_t size) diff --git a/trunk/tinySIP/ragel/tsip_parser_header_Path.rl b/trunk/tinySIP/ragel/tsip_parser_header_Path.rl index e69de29b..2443ea53 100644 --- a/trunk/tinySIP/ragel/tsip_parser_header_Path.rl +++ b/trunk/tinySIP/ragel/tsip_parser_header_Path.rl @@ -0,0 +1,211 @@ +/* +* Copyright (C) 2009 Mamadou Diop. +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tsip_header_Path.c + * @brief SIP Service-Path header as per RFC 3608. + * + * @author Mamadou Diop + * + * @date Created: Sat Nov 8 16:54:58 2009 mdiop + */ +#include "tinysip/headers/tsip_header_Path.h" + +#include "tinysip/parsers/tsip_parser_uri.h" + +#include "tsk_debug.h" +#include "tsk_memory.h" +#include "tsk_time.h" + +#include + +/**@defgroup tsip_header_Path_group SIP Service-Path header. +*/ + +/*********************************** +* Ragel state machine. +*/ +%%{ + machine tsip_machine_parser_header_Path; + + # Includes + include tsip_machine_utils "./tsip_machine_utils.rl"; + + action tag + { + tag_start = p; + } + + action create_path + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + + action parse_display_name + { + if(curr_path) + { + PARSER_SET_STRING(curr_path->display_name); + } + } + + action parse_uri + { + if(curr_path && !curr_path->uri) + { + int len = (int)(p - tag_start); + curr_path->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + + action parse_param + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } + + action add_path + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + + action eob + { + } + + + URI = (scheme HCOLON any+)>tag %parse_uri; + display_name = (( token LWS )+ | quoted_string)>tag %parse_display_name; + my_name_addr = display_name? :>LAQUOT<: URI :>RAQUOT; + + rr_param = (generic_param)>tag %parse_param; + + path_value = (my_name_addr ( SEMI rr_param )*) >create_path %add_path; + Path = "Path" HCOLON path_value (COMMA path_value)*; + + # Entry point + main := Path :>CRLF @eob; + +}%% + +int tsip_header_Path_tostring(const void* header, tsk_buffer_t* output) +{ + if(header) + { + const tsip_header_Path_t *Path = header; + int ret = 0; + + if(Path->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Path->display_name); + } + + if(ret=tsip_uri_serialize(Path->uri, 1, 1, output)){ /* Path */ + return ret; + } + + return ret; + } + + return -1; +} + +tsip_header_Paths_L_t *tsip_header_Path_parse(const char *data, size_t size) +{ + int cs = 0; + const char *p = data; + const char *pe = p + size; + const char *eof = pe; + tsip_header_Paths_L_t *hdr_paths = TSK_LIST_CREATE(); + + const char *tag_start; + tsip_header_Path_t *curr_path = 0; + + %%write data; + %%write init; + %%write exec; + + if( cs < %%{ write first_final; }%% ) + { + TSK_OBJECT_SAFE_FREE(curr_path); + TSK_OBJECT_SAFE_FREE(hdr_paths); + } + + return hdr_paths; +} + + + + + +//======================================================== +// Path header object definition +// + +/**@ingroup tsip_header_Path_group +*/ +static void* tsip_header_Path_create(void *self, va_list * app) +{ + tsip_header_Path_t *Path = self; + if(Path) + { + TSIP_HEADER(Path)->type = tsip_htype_Path; + TSIP_HEADER(Path)->tostring = tsip_header_Path_tostring; + } + else + { + TSK_DEBUG_ERROR("Failed to create new Path header."); + } + return self; +} + +/**@ingroup tsip_header_Path_group +*/ +static void* tsip_header_Path_destroy(void *self) +{ + tsip_header_Path_t *Path = self; + if(Path) + { + TSK_FREE(Path->display_name); + TSK_OBJECT_SAFE_FREE(Path->uri); + + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Path)); + } + else TSK_DEBUG_ERROR("Null Path header."); + + return self; +} + +static const tsk_object_def_t tsip_header_Path_def_s = +{ + sizeof(tsip_header_Path_t), + tsip_header_Path_create, + tsip_header_Path_destroy, + 0 +}; +const void *tsip_header_Path_def_t = &tsip_header_Path_def_s; \ No newline at end of file diff --git a/trunk/tinySIP/ragel/tsip_parser_header_Route.rl b/trunk/tinySIP/ragel/tsip_parser_header_Route.rl index e69de29b..ee2b7554 100644 --- a/trunk/tinySIP/ragel/tsip_parser_header_Route.rl +++ b/trunk/tinySIP/ragel/tsip_parser_header_Route.rl @@ -0,0 +1,214 @@ +/* +* Copyright (C) 2009 Mamadou Diop. +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tsip_header_Route.c + * @brief SIP Service-Route header as per RFC 3608. + * + * @author Mamadou Diop + * + * @date Created: Sat Nov 8 16:54:58 2009 mdiop + */ +#include "tinysip/headers/tsip_header_Route.h" + +#include "tinysip/parsers/tsip_parser_uri.h" + +#include "tsk_debug.h" +#include "tsk_memory.h" +#include "tsk_time.h" + +#include + +/**@defgroup tsip_header_Route_group SIP Service-Route header. +*/ + +/*********************************** +* Ragel state machine. +*/ +%%{ + machine tsip_machine_parser_header_Route; + + # Includes + include tsip_machine_utils "./tsip_machine_utils.rl"; + + action tag + { + tag_start = p; + } + + action create_route + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + + action parse_display_name + { + if(curr_route) + { + PARSER_SET_STRING(curr_route->display_name); + } + } + + action parse_uri + { + if(curr_route && !curr_route->uri) + { + int len = (int)(p - tag_start); + curr_route->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + + action parse_param + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } + + action add_route + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + + action eob + { + } + + + URI = (scheme HCOLON any+)>tag %parse_uri; + display_name = (( token LWS )+ | quoted_string)>tag %parse_display_name; + my_name_addr = display_name? :>LAQUOT<: URI :>RAQUOT; + + rr_param = (generic_param)>tag %parse_param; + + #route_param = (my_name_addr ( SEMI rr_param )*)>create_route %add_route; + #Route = "Route" HCOLON route_param (COMMA route_param)*; + + route_value = (my_name_addr ( SEMI rr_param )*) >create_route %add_route; + Route = "Route" HCOLON route_value (COMMA route_value)*; + + # Entry point + main := Route :>CRLF @eob; + +}%% + +int tsip_header_Route_tostring(const void* header, tsk_buffer_t* output) +{ + if(header) + { + const tsip_header_Route_t *Route = header; + int ret = 0; + + if(Route->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Route->display_name); + } + + if(ret=tsip_uri_serialize(Route->uri, 1, 1, output)){ /* Route */ + return ret; + } + + return ret; + } + + return -1; +} + +tsip_header_Routes_L_t *tsip_header_Route_parse(const char *data, size_t size) +{ + int cs = 0; + const char *p = data; + const char *pe = p + size; + const char *eof = pe; + tsip_header_Routes_L_t *hdr_routes = TSK_LIST_CREATE(); + + const char *tag_start; + tsip_header_Route_t *curr_route = 0; + + %%write data; + %%write init; + %%write exec; + + if( cs < %%{ write first_final; }%% ) + { + TSK_OBJECT_SAFE_FREE(curr_route); + TSK_OBJECT_SAFE_FREE(hdr_routes); + } + + return hdr_routes; +} + + + + + +//======================================================== +// Route header object definition +// + +/**@ingroup tsip_header_Route_group +*/ +static void* tsip_header_Route_create(void *self, va_list * app) +{ + tsip_header_Route_t *Route = self; + if(Route) + { + TSIP_HEADER(Route)->type = tsip_htype_Route; + TSIP_HEADER(Route)->tostring = tsip_header_Route_tostring; + } + else + { + TSK_DEBUG_ERROR("Failed to create new Route header."); + } + return self; +} + +/**@ingroup tsip_header_Route_group +*/ +static void* tsip_header_Route_destroy(void *self) +{ + tsip_header_Route_t *Route = self; + if(Route) + { + TSK_FREE(Route->display_name); + TSK_OBJECT_SAFE_FREE(Route->uri); + + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Route)); + } + else TSK_DEBUG_ERROR("Null Route header."); + + return self; +} + +static const tsk_object_def_t tsip_header_Route_def_s = +{ + sizeof(tsip_header_Route_t), + tsip_header_Route_create, + tsip_header_Route_destroy, + 0 +}; +const void *tsip_header_Route_def_t = &tsip_header_Route_def_s; \ No newline at end of file diff --git a/trunk/tinySIP/ragel/tsip_parser_header_Service_Route.rl b/trunk/tinySIP/ragel/tsip_parser_header_Service_Route.rl index c5c35c2f..8679b4dc 100644 --- a/trunk/tinySIP/ragel/tsip_parser_header_Service_Route.rl +++ b/trunk/tinySIP/ragel/tsip_parser_header_Service_Route.rl @@ -54,16 +54,60 @@ tag_start = p; } - action parse_route + action create_service { - PARSER_SET_STRING(hdr_service_route->value); + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + + action parse_display_name + { + if(curr_service) + { + PARSER_SET_STRING(curr_service->display_name); + } + } + + action parse_uri + { + if(curr_service && !curr_service->uri) + { + int len = (int)(p - tag_start); + curr_service->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + + action parse_param + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } + + action add_service + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } } action eob { } - Service_Route = ( "Service-Route"i ) HCOLON any*>tag %parse_route; + + URI = (scheme HCOLON any+)>tag %parse_uri; + display_name = (( token LWS )+ | quoted_string)>tag %parse_display_name; + my_name_addr = display_name? :>LAQUOT<: URI :>RAQUOT; + + rr_param = (generic_param)>tag %parse_param; + + sr_value = (my_name_addr ( SEMI rr_param )*) >create_service %add_service; + Service_Route = "Service-Route" HCOLON sr_value (COMMA sr_value)*; # Entry point main := Service_Route :>CRLF @eob; @@ -75,23 +119,32 @@ int tsip_header_Service_Route_tostring(const void* header, tsk_buffer_t* output) if(header) { const tsip_header_Service_Route_t *Service_Route = header; - if(Service_Route->value) - { - return tsk_buffer_append(output, Service_Route->value, strlen(Service_Route->value)); + int ret = 0; + + if(Service_Route->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Service_Route->display_name); } + + if(ret=tsip_uri_serialize(Service_Route->uri, 1, 1, output)){ /* Route */ + return ret; + } + + return ret; } + return -1; } -tsip_header_Service_Route_t *tsip_header_Service_Route_parse(const char *data, size_t size) +tsip_header_Service_Routes_L_t *tsip_header_Service_Route_parse(const char *data, size_t size) { int cs = 0; const char *p = data; const char *pe = p + size; const char *eof = pe; - tsip_header_Service_Route_t *hdr_service_route = TSIP_HEADER_SERVICE_ROUTE_CREATE(0); + tsip_header_Service_Routes_L_t *hdr_services = TSK_LIST_CREATE(); const char *tag_start; + tsip_header_Service_Route_t *curr_service = 0; %%write data; %%write init; @@ -99,18 +152,17 @@ tsip_header_Service_Route_t *tsip_header_Service_Route_parse(const char *data, s if( cs < %%{ write first_final; }%% ) { - TSK_OBJECT_SAFE_FREE(hdr_service_route); + TSK_OBJECT_SAFE_FREE(curr_service); + TSK_OBJECT_SAFE_FREE(hdr_services); } - return hdr_service_route; + return hdr_services; } - - //======================================================== // Service_Route header object definition // @@ -122,7 +174,6 @@ static void* tsip_header_Service_Route_create(void *self, va_list * app) tsip_header_Service_Route_t *Service_Route = self; if(Service_Route) { - Service_Route->value = tsk_strdup(va_arg(*app, const char *)); TSIP_HEADER(Service_Route)->type = tsip_htype_Service_Route; TSIP_HEADER(Service_Route)->tostring = tsip_header_Service_Route_tostring; } @@ -140,7 +191,9 @@ static void* tsip_header_Service_Route_destroy(void *self) tsip_header_Service_Route_t *Service_Route = self; if(Service_Route) { - TSK_FREE(Service_Route->value); + TSK_FREE(Service_Route->display_name); + TSK_OBJECT_SAFE_FREE(Service_Route->uri); + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Service_Route)); } else TSK_DEBUG_ERROR("Null Service_Route header."); diff --git a/trunk/tinySIP/ragel/tsip_parser_uri.rl b/trunk/tinySIP/ragel/tsip_parser_uri.rl index 31a5d4cd..15d4fce9 100644 --- a/trunk/tinySIP/ragel/tsip_parser_uri.rl +++ b/trunk/tinySIP/ragel/tsip_parser_uri.rl @@ -48,7 +48,6 @@ action tag { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } @@ -69,17 +68,17 @@ action parse_user_name { - PARSER_SET_STRING(uri->user_name); + PARSER_SET_STRING(uri->user_name); } action parse_password { - PARSER_SET_STRING(uri->password); + PARSER_SET_STRING(uri->password); } action parse_host { - PARSER_SET_STRING(uri->host); + PARSER_SET_STRING(uri->host); } action parse_port @@ -104,7 +103,7 @@ main := |* ("sip:"i>tag %is_sip | "sips:"i>tag %is_sips) @100 { - if(tsk_strcontains(te, "@")) + if(tsk_strcontains(te, (pe - te), "@")) { fgoto sip_usrinfo; } @@ -121,7 +120,7 @@ } }; - (':' port)@80 + (":" port)@80 { ts++; SCANNER_SET_INTEGER(uri->port); diff --git a/trunk/tinySIP/src/authentication/tsip_challenge.c b/trunk/tinySIP/src/authentication/tsip_challenge.c index 914bf124..edcb8ec0 100644 --- a/trunk/tinySIP/src/authentication/tsip_challenge.c +++ b/trunk/tinySIP/src/authentication/tsip_challenge.c @@ -288,8 +288,8 @@ int tsip_challenge_update(tsip_challenge_t *self, const char* scheme, const char tsk_strupdate(&self->nonce, nonce); tsk_strupdate(&self->opaque, opaque); tsk_strupdate(&self->algorithm, algorithm); - self->qop = tsk_strcontains(qop, "auth-int") ? "auth-int" : - (tsk_strcontains(qop, "auth") ? "auth" : 0); + self->qop = tsk_strcontains(qop, strlen(qop), "auth-int") ? "auth-int" : + (tsk_strcontains(qop, strlen(qop), "auth") ? "auth" : 0); if(noncechanged && self->qop){ tsip_challenge_reset_cnonce(self); @@ -443,8 +443,8 @@ static void* tsip_challenge_create(void *self, va_list * app) challenge->opaque = tsk_strdup(va_arg(*app, const char*)); challenge->algorithm = tsk_strdup(va_arg(*app, const char*)); qop = va_arg(*app, const char*); - challenge->qop = tsk_strcontains(qop, "auth-int") ? "auth-int" : - (tsk_strcontains(qop, "auth") ? "auth" : 0); + challenge->qop = tsk_strcontains(qop, strlen(qop), "auth-int") ? "auth-int" : + (tsk_strcontains(qop, strlen(qop), "auth") ? "auth" : 0); if(challenge->qop){ tsip_challenge_reset_cnonce(challenge); diff --git a/trunk/tinySIP/src/dialogs/tsip_dialog.c b/trunk/tinySIP/src/dialogs/tsip_dialog.c index c38ded33..bd110602 100644 --- a/trunk/tinySIP/src/dialogs/tsip_dialog.c +++ b/trunk/tinySIP/src/dialogs/tsip_dialog.c @@ -611,19 +611,21 @@ int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, tsip_stack_ha self->type = type; self->stack = tsk_object_ref(stack); - if(!self->routes)self->routes = TSK_LIST_CREATE(); - if(!self->challenges)self->challenges = TSK_LIST_CREATE(); + if(!self->routes){ + self->routes = TSK_LIST_CREATE(); + } + if(!self->challenges){ + self->challenges = TSK_LIST_CREATE(); + } self->expires = TSIP_DIALOG_EXPIRES_DEFAULT; - if(call_id) - { + if(call_id){ tsk_strupdate(&self->callid, call_id); } - else - { - tsk_istr_t cid; - tsip_header_Call_ID_random(&cid); - tsk_strupdate(&self->callid, cid); + else{ + tsk_uuidstring_t uuid; /* Call-id is a random UUID */ + tsip_header_Call_ID_random(&uuid); + tsk_strupdate(&self->callid, uuid); } self->operation = tsk_object_ref(operation); diff --git a/trunk/tinySIP/src/dialogs/tsip_dialog_register.client.c b/trunk/tinySIP/src/dialogs/tsip_dialog_register.client.c index c011b9f6..cc8c003d 100644 --- a/trunk/tinySIP/src/dialogs/tsip_dialog_register.client.c +++ b/trunk/tinySIP/src/dialogs/tsip_dialog_register.client.c @@ -178,7 +178,7 @@ void tsip_dialog_register_init(tsip_dialog_register_t *self) */ tsip_dialog_registerContext_Init(&self->_fsm, self); - TSIP_DIALOG(self)->expires = 10; + TSIP_DIALOG(self)->expires = 30; TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK(tsip_dialog_register_event_callback); TSIP_DIALOG(self)->uri_local = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity); @@ -241,12 +241,47 @@ void tsip_dialog_register_Trying_2_Trying_X_1xx(tsip_dialog_register_t *self, co /* Trying -> (2xx) -> Connected */ -#include "tsk_thread.h" +//#include "tsk_thread.h" void tsip_dialog_register_Trying_2_Connected_X_2xx(tsip_dialog_register_t *self, const tsip_message_t* msg) { /* Alert the user. */ - TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, self->unregistering ? tsip_unregister_ok : tsip_register_ok, - TSIP_RESPONSE_CODE(msg), TSIP_RESPONSE_PHRASE(msg)); + TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_ok, + TSIP_RESPONSE_CODE(msg), TSIP_RESPONSE_PHRASE(msg)); + + /* - Set P-associated-uriS + * - Update service-routes + * - Update Pats + */ + if(TSIP_DIALOG(self)->state != tsip_established) /* Must be called before "tsip_dialog_update" update the state. */ + { + size_t index; + tsip_header_t* hdr; + + /* To avoid memory leaks ==> delete all concerned objects (it worth nothing) */ + //TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->associated_uri); + TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->service_routes); + TSK_OBJECT_SAFE_FREE(TSIP_DIALOG_GET_STACK(self)->paths); + + /* Service-Route */ + for(index = 0; (hdr = (tsip_header_t*)tsip_message_get_headerAt(msg, tsip_htype_Service_Route, index)); index++){ + if(index == 0){ + TSIP_DIALOG_GET_STACK(self)->service_routes = TSK_LIST_CREATE(); + } + hdr = tsk_object_ref(hdr); + tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->service_routes, (void**)&hdr); + } + + /* Paths */ + for(index = 0; (hdr = (tsip_header_t*)tsip_message_get_headerAt(msg, tsip_htype_Path, index)); index++){ + if(index == 0){ + TSIP_DIALOG_GET_STACK(self)->paths = TSK_LIST_CREATE(); + } + hdr = tsk_object_ref(hdr); + tsk_list_push_back_data(TSIP_DIALOG_GET_STACK(self)->paths, (void**)&hdr); + } + /* Associated Uris */ + // FIXME + } /* Update the dialog state. */ tsip_dialog_update(TSIP_DIALOG(self), msg); diff --git a/trunk/tinySIP/src/headers/tsip_header_Call_ID.c b/trunk/tinySIP/src/headers/tsip_header_Call_ID.c index b63c3628..0e244ad4 100644 --- a/trunk/tinySIP/src/headers/tsip_header_Call_ID.c +++ b/trunk/tinySIP/src/headers/tsip_header_Call_ID.c @@ -62,10 +62,9 @@ int tsip_header_Call_ID_tostring(const void* header, tsk_buffer_t* output) return -1; } -void tsip_header_Call_ID_random(tsk_istr_t *result) +int tsip_header_Call_ID_random(tsk_uuidstring_t *result) { - uint64_t epoch = tsk_time_epoch(); - tsk_itoa(epoch, result); + return tsk_uuidgenerate(result); } tsip_header_Call_ID_t *tsip_header_Call_ID_parse(const char *data, size_t size) @@ -79,7 +78,7 @@ tsip_header_Call_ID_t *tsip_header_Call_ID_parse(const char *data, size_t size) const char *tag_start; -/* #line 83 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 82 "../src/headers/tsip_header_Call_ID.c" */ static const int tsip_machine_parser_header_Call_ID_start = 1; static const int tsip_machine_parser_header_Call_ID_first_final = 17; static const int tsip_machine_parser_header_Call_ID_error = 0; @@ -87,16 +86,16 @@ static const int tsip_machine_parser_header_Call_ID_error = 0; static const int tsip_machine_parser_header_Call_ID_en_main = 1; -/* #line 104 "tsip_parser_header_Call_ID.rl" */ +/* #line 103 "tsip_parser_header_Call_ID.rl" */ -/* #line 93 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 92 "../src/headers/tsip_header_Call_ID.c" */ { cs = tsip_machine_parser_header_Call_ID_start; } -/* #line 105 "tsip_parser_header_Call_ID.rl" */ +/* #line 104 "tsip_parser_header_Call_ID.rl" */ -/* #line 100 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 99 "../src/headers/tsip_header_Call_ID.c" */ { if ( p == pe ) goto _test_eof; @@ -264,7 +263,7 @@ st13: if ( ++p == pe ) goto _test_eof13; case 13: -/* #line 268 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 267 "../src/headers/tsip_header_Call_ID.c" */ switch( (*p) ) { case 13: goto tr13; case 37: goto st13; @@ -299,7 +298,7 @@ st14: if ( ++p == pe ) goto _test_eof14; case 14: -/* #line 303 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 302 "../src/headers/tsip_header_Call_ID.c" */ if ( (*p) == 10 ) goto tr16; goto st0; @@ -312,7 +311,7 @@ st17: if ( ++p == pe ) goto _test_eof17; case 17: -/* #line 316 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 315 "../src/headers/tsip_header_Call_ID.c" */ goto st0; st15: if ( ++p == pe ) @@ -395,12 +394,12 @@ case 16: _out: {} } -/* #line 106 "tsip_parser_header_Call_ID.rl" */ +/* #line 105 "tsip_parser_header_Call_ID.rl" */ if( cs < -/* #line 402 "../source/headers/tsip_header_Call_ID.c" */ +/* #line 401 "../src/headers/tsip_header_Call_ID.c" */ 17 -/* #line 107 "tsip_parser_header_Call_ID.rl" */ +/* #line 106 "tsip_parser_header_Call_ID.rl" */ ) { TSK_OBJECT_SAFE_FREE(hdr_call_id); diff --git a/trunk/tinySIP/src/headers/tsip_header_Path.c b/trunk/tinySIP/src/headers/tsip_header_Path.c index 8b137891..eb29ebea 100644 --- a/trunk/tinySIP/src/headers/tsip_header_Path.c +++ b/trunk/tinySIP/src/headers/tsip_header_Path.c @@ -1 +1,1759 @@ - + +/* #line 1 "tsip_parser_header_Path.rl" */ +/* +* Copyright (C) 2009 Mamadou Diop. +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tsip_header_Path.c + * @brief SIP Service-Path header as per RFC 3608. + * + * @author Mamadou Diop + * + * @date Created: Sat Nov 8 16:54:58 2009 mdiop + */ +#include "tinysip/headers/tsip_header_Path.h" + +#include "tinysip/parsers/tsip_parser_uri.h" + +#include "tsk_debug.h" +#include "tsk_memory.h" +#include "tsk_time.h" + +#include + +/**@defgroup tsip_header_Path_group SIP Service-Path header. +*/ + +/*********************************** +* Ragel state machine. +*/ + +/* #line 115 "tsip_parser_header_Path.rl" */ + + +int tsip_header_Path_tostring(const void* header, tsk_buffer_t* output) +{ + if(header) + { + const tsip_header_Path_t *Path = header; + int ret = 0; + + if(Path->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Path->display_name); + } + + if(ret=tsip_uri_serialize(Path->uri, 1, 1, output)){ /* Path */ + return ret; + } + + return ret; + } + + return -1; +} + +tsip_header_Paths_L_t *tsip_header_Path_parse(const char *data, size_t size) +{ + int cs = 0; + const char *p = data; + const char *pe = p + size; + const char *eof = pe; + tsip_header_Paths_L_t *hdr_paths = TSK_LIST_CREATE(); + + const char *tag_start; + tsip_header_Path_t *curr_path = 0; + + +/* #line 86 "../src/headers/tsip_header_Path.c" */ +static const int tsip_machine_parser_header_Path_start = 1; +static const int tsip_machine_parser_header_Path_first_final = 101; +static const int tsip_machine_parser_header_Path_error = 0; + +static const int tsip_machine_parser_header_Path_en_main = 1; + + +/* #line 150 "tsip_parser_header_Path.rl" */ + +/* #line 96 "../src/headers/tsip_header_Path.c" */ + { + cs = tsip_machine_parser_header_Path_start; + } + +/* #line 151 "tsip_parser_header_Path.rl" */ + +/* #line 103 "../src/headers/tsip_header_Path.c" */ + { + if ( p == pe ) + goto _test_eof; + switch ( cs ) + { +case 1: + if ( (*p) == 80 ) + goto st2; + goto st0; +st0: +cs = 0; + goto _out; +st2: + if ( ++p == pe ) + goto _test_eof2; +case 2: + if ( (*p) == 97 ) + goto st3; + goto st0; +st3: + if ( ++p == pe ) + goto _test_eof3; +case 3: + if ( (*p) == 116 ) + goto st4; + goto st0; +st4: + if ( ++p == pe ) + goto _test_eof4; +case 4: + if ( (*p) == 104 ) + goto st5; + goto st0; +st5: + if ( ++p == pe ) + goto _test_eof5; +case 5: + switch( (*p) ) { + case 9: goto st5; + case 32: goto st5; + case 58: goto st6; + } + goto st0; +tr6: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + goto st6; +tr26: +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st6; +tr36: +/* #line 83 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st6; +st6: + if ( ++p == pe ) + goto _test_eof6; +case 6: +/* #line 185 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto tr6; + case 13: goto tr7; + case 32: goto tr6; + case 33: goto tr8; + case 34: goto tr9; + case 37: goto tr8; + case 39: goto tr8; + case 60: goto tr10; + case 126: goto tr8; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr8; + } else if ( (*p) >= 42 ) + goto tr8; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr8; + } else if ( (*p) >= 65 ) + goto tr8; + } else + goto tr8; + goto st0; +tr7: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + goto st7; +st7: + if ( ++p == pe ) + goto _test_eof7; +case 7: +/* #line 225 "../src/headers/tsip_header_Path.c" */ + if ( (*p) == 10 ) + goto st8; + goto st0; +st8: + if ( ++p == pe ) + goto _test_eof8; +case 8: + switch( (*p) ) { + case 9: goto st9; + case 32: goto st9; + } + goto st0; +tr13: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + goto st9; +st9: + if ( ++p == pe ) + goto _test_eof9; +case 9: +/* #line 251 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto tr13; + case 13: goto tr14; + case 32: goto tr13; + case 33: goto tr8; + case 34: goto tr9; + case 37: goto tr8; + case 39: goto tr8; + case 60: goto tr10; + case 126: goto tr8; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr8; + } else if ( (*p) >= 42 ) + goto tr8; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr8; + } else if ( (*p) >= 65 ) + goto tr8; + } else + goto tr8; + goto st0; +tr14: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + goto st10; +tr104: +/* #line 66 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_SET_STRING(curr_path->display_name); + } + } + goto st10; +st10: + if ( ++p == pe ) + goto _test_eof10; +case 10: +/* #line 300 "../src/headers/tsip_header_Path.c" */ + if ( (*p) == 10 ) + goto st11; + goto st0; +st11: + if ( ++p == pe ) + goto _test_eof11; +case 11: + switch( (*p) ) { + case 9: goto st12; + case 32: goto st12; + } + goto st0; +st12: + if ( ++p == pe ) + goto _test_eof12; +case 12: + switch( (*p) ) { + case 9: goto st12; + case 32: goto st12; + case 60: goto st13; + } + goto st0; +tr10: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } + goto st13; +tr105: +/* #line 66 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_SET_STRING(curr_path->display_name); + } + } + goto st13; +st13: + if ( ++p == pe ) + goto _test_eof13; +case 13: +/* #line 345 "../src/headers/tsip_header_Path.c" */ + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr18; + } else if ( (*p) >= 65 ) + goto tr18; + goto st0; +tr18: +/* #line 53 "tsip_parser_header_Path.rl" */ + { + tag_start = p; + } + goto st14; +st14: + if ( ++p == pe ) + goto _test_eof14; +case 14: +/* #line 362 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st15; + case 32: goto st15; + case 43: goto st14; + case 58: goto st16; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st14; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st14; + } else if ( (*p) >= 65 ) + goto st14; + } else + goto st14; + goto st0; +st15: + if ( ++p == pe ) + goto _test_eof15; +case 15: + switch( (*p) ) { + case 9: goto st15; + case 32: goto st15; + case 58: goto st16; + } + goto st0; +st16: + if ( ++p == pe ) + goto _test_eof16; +case 16: + goto st17; +st17: + if ( ++p == pe ) + goto _test_eof17; +case 17: + if ( (*p) == 62 ) + goto tr23; + goto st17; +tr23: +/* #line 74 "tsip_parser_header_Path.rl" */ + { + if(curr_path && !curr_path->uri) + { + int len = (int)(p - tag_start); + curr_path->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + goto st18; +tr24: +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st18; +st18: + if ( ++p == pe ) + goto _test_eof18; +case 18: +/* #line 426 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto tr24; + case 13: goto tr25; + case 32: goto tr24; + case 44: goto tr26; + case 59: goto st20; + } + goto st0; +tr25: +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st19; +tr34: +/* #line 83 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st19; +st19: + if ( ++p == pe ) + goto _test_eof19; +case 19: +/* #line 464 "../src/headers/tsip_header_Path.c" */ + if ( (*p) == 10 ) + goto tr28; + goto st0; +tr28: +/* #line 99 "tsip_parser_header_Path.rl" */ + { + } + goto st101; +st101: + if ( ++p == pe ) + goto _test_eof101; +case 101: +/* #line 477 "../src/headers/tsip_header_Path.c" */ + goto st0; +tr37: +/* #line 83 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } + goto st20; +st20: + if ( ++p == pe ) + goto _test_eof20; +case 20: +/* #line 492 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st20; + case 13: goto st21; + case 32: goto st20; + case 33: goto tr30; + case 37: goto tr30; + case 39: goto tr30; + case 126: goto tr30; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr30; + } else if ( (*p) >= 42 ) + goto tr30; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr30; + } else if ( (*p) >= 65 ) + goto tr30; + } else + goto tr30; + goto st0; +st21: + if ( ++p == pe ) + goto _test_eof21; +case 21: + if ( (*p) == 10 ) + goto st22; + goto st0; +st22: + if ( ++p == pe ) + goto _test_eof22; +case 22: + switch( (*p) ) { + case 9: goto st23; + case 32: goto st23; + } + goto st0; +st23: + if ( ++p == pe ) + goto _test_eof23; +case 23: + switch( (*p) ) { + case 9: goto st23; + case 32: goto st23; + case 33: goto tr30; + case 37: goto tr30; + case 39: goto tr30; + case 126: goto tr30; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr30; + } else if ( (*p) >= 42 ) + goto tr30; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr30; + } else if ( (*p) >= 65 ) + goto tr30; + } else + goto tr30; + goto st0; +tr30: +/* #line 53 "tsip_parser_header_Path.rl" */ + { + tag_start = p; + } + goto st24; +st24: + if ( ++p == pe ) + goto _test_eof24; +case 24: +/* #line 570 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto tr33; + case 13: goto tr34; + case 32: goto tr33; + case 33: goto st24; + case 37: goto st24; + case 39: goto st24; + case 44: goto tr36; + case 59: goto tr37; + case 61: goto st29; + case 126: goto st24; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st24; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st24; + } else if ( (*p) >= 65 ) + goto st24; + } else + goto st24; + goto st0; +tr33: +/* #line 83 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st25; +st25: + if ( ++p == pe ) + goto _test_eof25; +case 25: +/* #line 615 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st25; + case 13: goto st26; + case 32: goto st25; + case 44: goto st6; + case 59: goto st20; + case 61: goto st29; + } + goto st0; +st26: + if ( ++p == pe ) + goto _test_eof26; +case 26: + if ( (*p) == 10 ) + goto st27; + goto st0; +st27: + if ( ++p == pe ) + goto _test_eof27; +case 27: + switch( (*p) ) { + case 9: goto st28; + case 32: goto st28; + } + goto st0; +st28: + if ( ++p == pe ) + goto _test_eof28; +case 28: + switch( (*p) ) { + case 9: goto st28; + case 32: goto st28; + case 44: goto st6; + case 59: goto st20; + case 61: goto st29; + } + goto st0; +st29: + if ( ++p == pe ) + goto _test_eof29; +case 29: + switch( (*p) ) { + case 9: goto st29; + case 13: goto st30; + case 32: goto st29; + case 33: goto st50; + case 34: goto st36; + case 37: goto st50; + case 39: goto st50; + case 91: goto st51; + case 126: goto st50; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st50; + } else if ( (*p) >= 42 ) + goto st50; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st50; + } else if ( (*p) >= 65 ) + goto st50; + } else + goto st50; + goto st0; +st30: + if ( ++p == pe ) + goto _test_eof30; +case 30: + if ( (*p) == 10 ) + goto st31; + goto st0; +st31: + if ( ++p == pe ) + goto _test_eof31; +case 31: + switch( (*p) ) { + case 9: goto st32; + case 32: goto st32; + } + goto st0; +st32: + if ( ++p == pe ) + goto _test_eof32; +case 32: + switch( (*p) ) { + case 9: goto st32; + case 13: goto st33; + case 32: goto st32; + case 33: goto st50; + case 34: goto st36; + case 37: goto st50; + case 39: goto st50; + case 91: goto st51; + case 126: goto st50; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st50; + } else if ( (*p) >= 42 ) + goto st50; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st50; + } else if ( (*p) >= 65 ) + goto st50; + } else + goto st50; + goto st0; +st33: + if ( ++p == pe ) + goto _test_eof33; +case 33: + if ( (*p) == 10 ) + goto st34; + goto st0; +st34: + if ( ++p == pe ) + goto _test_eof34; +case 34: + switch( (*p) ) { + case 9: goto st35; + case 32: goto st35; + } + goto st0; +st35: + if ( ++p == pe ) + goto _test_eof35; +case 35: + switch( (*p) ) { + case 9: goto st35; + case 32: goto st35; + case 34: goto st36; + } + goto st0; +st36: + if ( ++p == pe ) + goto _test_eof36; +case 36: + switch( (*p) ) { + case 9: goto st36; + case 13: goto st42; + case 34: goto st44; + case 92: goto st49; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st38; + } else if ( (*p) >= -64 ) + goto st37; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st40; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st36; + } else + goto st41; + } else + goto st39; + goto st0; +st37: + if ( ++p == pe ) + goto _test_eof37; +case 37: + if ( (*p) <= -65 ) + goto st36; + goto st0; +st38: + if ( ++p == pe ) + goto _test_eof38; +case 38: + if ( (*p) <= -65 ) + goto st37; + goto st0; +st39: + if ( ++p == pe ) + goto _test_eof39; +case 39: + if ( (*p) <= -65 ) + goto st38; + goto st0; +st40: + if ( ++p == pe ) + goto _test_eof40; +case 40: + if ( (*p) <= -65 ) + goto st39; + goto st0; +st41: + if ( ++p == pe ) + goto _test_eof41; +case 41: + if ( (*p) <= -65 ) + goto st40; + goto st0; +st42: + if ( ++p == pe ) + goto _test_eof42; +case 42: + if ( (*p) == 10 ) + goto st43; + goto st0; +st43: + if ( ++p == pe ) + goto _test_eof43; +case 43: + switch( (*p) ) { + case 9: goto st36; + case 32: goto st36; + } + goto st0; +st44: + if ( ++p == pe ) + goto _test_eof44; +case 44: + switch( (*p) ) { + case 9: goto tr61; + case 13: goto tr34; + case 32: goto tr61; + case 44: goto tr36; + case 59: goto tr37; + } + goto st0; +tr61: +/* #line 83 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_path)); + } + } +/* #line 91 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + tsk_list_push_back_data(hdr_paths, ((void**) &curr_path)); + } + } + goto st45; +st45: + if ( ++p == pe ) + goto _test_eof45; +case 45: +/* #line 866 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st45; + case 13: goto st46; + case 32: goto st45; + case 44: goto st6; + case 59: goto st20; + } + goto st0; +st46: + if ( ++p == pe ) + goto _test_eof46; +case 46: + if ( (*p) == 10 ) + goto st47; + goto st0; +st47: + if ( ++p == pe ) + goto _test_eof47; +case 47: + switch( (*p) ) { + case 9: goto st48; + case 32: goto st48; + } + goto st0; +st48: + if ( ++p == pe ) + goto _test_eof48; +case 48: + switch( (*p) ) { + case 9: goto st48; + case 32: goto st48; + case 44: goto st6; + case 59: goto st20; + } + goto st0; +st49: + if ( ++p == pe ) + goto _test_eof49; +case 49: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st36; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st36; + } else + goto st36; + goto st0; +st50: + if ( ++p == pe ) + goto _test_eof50; +case 50: + switch( (*p) ) { + case 9: goto tr61; + case 13: goto tr34; + case 32: goto tr61; + case 33: goto st50; + case 37: goto st50; + case 39: goto st50; + case 44: goto tr36; + case 59: goto tr37; + case 126: goto st50; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st50; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st50; + } else if ( (*p) >= 65 ) + goto st50; + } else + goto st50; + goto st0; +st51: + if ( ++p == pe ) + goto _test_eof51; +case 51: + if ( (*p) == 58 ) + goto st85; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st52; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st52; + } else + goto st52; + goto st0; +st52: + if ( ++p == pe ) + goto _test_eof52; +case 52: + switch( (*p) ) { + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st53; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st53; + } else + goto st53; + goto st0; +st53: + if ( ++p == pe ) + goto _test_eof53; +case 53: + switch( (*p) ) { + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st54; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st54; + } else + goto st54; + goto st0; +st54: + if ( ++p == pe ) + goto _test_eof54; +case 54: + switch( (*p) ) { + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st55; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st55; + } else + goto st55; + goto st0; +st55: + if ( ++p == pe ) + goto _test_eof55; +case 55: + switch( (*p) ) { + case 58: goto st56; + case 93: goto st44; + } + goto st0; +st56: + if ( ++p == pe ) + goto _test_eof56; +case 56: + if ( (*p) == 58 ) + goto st72; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st57; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st52; + } else + goto st52; + goto st0; +st57: + if ( ++p == pe ) + goto _test_eof57; +case 57: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st70; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st53; + } else + goto st53; + goto st0; +st58: + if ( ++p == pe ) + goto _test_eof58; +case 58: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st59; + goto st0; +st59: + if ( ++p == pe ) + goto _test_eof59; +case 59: + if ( (*p) == 46 ) + goto st60; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st68; + goto st0; +st60: + if ( ++p == pe ) + goto _test_eof60; +case 60: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st61; + goto st0; +st61: + if ( ++p == pe ) + goto _test_eof61; +case 61: + if ( (*p) == 46 ) + goto st62; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st66; + goto st0; +st62: + if ( ++p == pe ) + goto _test_eof62; +case 62: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st63; + goto st0; +st63: + if ( ++p == pe ) + goto _test_eof63; +case 63: + if ( (*p) == 93 ) + goto st44; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st64; + goto st0; +st64: + if ( ++p == pe ) + goto _test_eof64; +case 64: + if ( (*p) == 93 ) + goto st44; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st65; + goto st0; +st65: + if ( ++p == pe ) + goto _test_eof65; +case 65: + if ( (*p) == 93 ) + goto st44; + goto st0; +st66: + if ( ++p == pe ) + goto _test_eof66; +case 66: + if ( (*p) == 46 ) + goto st62; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st67; + goto st0; +st67: + if ( ++p == pe ) + goto _test_eof67; +case 67: + if ( (*p) == 46 ) + goto st62; + goto st0; +st68: + if ( ++p == pe ) + goto _test_eof68; +case 68: + if ( (*p) == 46 ) + goto st60; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st69; + goto st0; +st69: + if ( ++p == pe ) + goto _test_eof69; +case 69: + if ( (*p) == 46 ) + goto st60; + goto st0; +st70: + if ( ++p == pe ) + goto _test_eof70; +case 70: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st71; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st54; + } else + goto st54; + goto st0; +st71: + if ( ++p == pe ) + goto _test_eof71; +case 71: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st56; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st55; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st55; + } else + goto st55; + goto st0; +st72: + if ( ++p == pe ) + goto _test_eof72; +case 72: + switch( (*p) ) { + case 58: goto st81; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st73; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st73; + } else + goto st73; + goto st0; +st73: + if ( ++p == pe ) + goto _test_eof73; +case 73: + switch( (*p) ) { + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st74; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st74; + } else + goto st74; + goto st0; +st74: + if ( ++p == pe ) + goto _test_eof74; +case 74: + switch( (*p) ) { + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st75; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st75; + } else + goto st75; + goto st0; +st75: + if ( ++p == pe ) + goto _test_eof75; +case 75: + switch( (*p) ) { + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st76; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st76; + } else + goto st76; + goto st0; +st76: + if ( ++p == pe ) + goto _test_eof76; +case 76: + switch( (*p) ) { + case 58: goto st77; + case 93: goto st44; + } + goto st0; +st77: + if ( ++p == pe ) + goto _test_eof77; +case 77: + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st78; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st73; + } else + goto st73; + goto st0; +st78: + if ( ++p == pe ) + goto _test_eof78; +case 78: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st79; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st74; + } else + goto st74; + goto st0; +st79: + if ( ++p == pe ) + goto _test_eof79; +case 79: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st80; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st75; + } else + goto st75; + goto st0; +st80: + if ( ++p == pe ) + goto _test_eof80; +case 80: + switch( (*p) ) { + case 46: goto st58; + case 58: goto st77; + case 93: goto st44; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st76; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st76; + } else + goto st76; + goto st0; +st81: + if ( ++p == pe ) + goto _test_eof81; +case 81: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st82; + goto st0; +st82: + if ( ++p == pe ) + goto _test_eof82; +case 82: + if ( (*p) == 46 ) + goto st58; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st83; + goto st0; +st83: + if ( ++p == pe ) + goto _test_eof83; +case 83: + if ( (*p) == 46 ) + goto st58; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st84; + goto st0; +st84: + if ( ++p == pe ) + goto _test_eof84; +case 84: + if ( (*p) == 46 ) + goto st58; + goto st0; +st85: + if ( ++p == pe ) + goto _test_eof85; +case 85: + if ( (*p) == 58 ) + goto st72; + goto st0; +tr8: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Path.rl" */ + { + tag_start = p; + } + goto st86; +st86: + if ( ++p == pe ) + goto _test_eof86; +case 86: +/* #line 1382 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st87; + case 13: goto st89; + case 32: goto st87; + case 33: goto st86; + case 37: goto st86; + case 39: goto st86; + case 126: goto st86; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st86; + } else if ( (*p) >= 42 ) + goto st86; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st86; + } else if ( (*p) >= 65 ) + goto st86; + } else + goto st86; + goto st0; +st87: + if ( ++p == pe ) + goto _test_eof87; +case 87: + switch( (*p) ) { + case 9: goto tr103; + case 13: goto tr104; + case 32: goto tr103; + case 33: goto st86; + case 37: goto st86; + case 39: goto st86; + case 60: goto tr105; + case 126: goto st86; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st86; + } else if ( (*p) >= 42 ) + goto st86; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st86; + } else if ( (*p) >= 65 ) + goto st86; + } else + goto st86; + goto st0; +tr103: +/* #line 66 "tsip_parser_header_Path.rl" */ + { + if(curr_path) + { + PARSER_SET_STRING(curr_path->display_name); + } + } + goto st88; +st88: + if ( ++p == pe ) + goto _test_eof88; +case 88: +/* #line 1449 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st88; + case 13: goto st10; + case 32: goto st88; + case 60: goto st13; + } + goto st0; +st89: + if ( ++p == pe ) + goto _test_eof89; +case 89: + if ( (*p) == 10 ) + goto st90; + goto st0; +st90: + if ( ++p == pe ) + goto _test_eof90; +case 90: + switch( (*p) ) { + case 9: goto st87; + case 32: goto st87; + } + goto st0; +tr9: +/* #line 58 "tsip_parser_header_Path.rl" */ + { + if(!curr_path) + { + curr_path = TSIP_HEADER_PATH_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Path.rl" */ + { + tag_start = p; + } + goto st91; +st91: + if ( ++p == pe ) + goto _test_eof91; +case 91: +/* #line 1490 "../src/headers/tsip_header_Path.c" */ + switch( (*p) ) { + case 9: goto st91; + case 13: goto st97; + case 34: goto st99; + case 92: goto st100; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st93; + } else if ( (*p) >= -64 ) + goto st92; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st95; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st91; + } else + goto st96; + } else + goto st94; + goto st0; +st92: + if ( ++p == pe ) + goto _test_eof92; +case 92: + if ( (*p) <= -65 ) + goto st91; + goto st0; +st93: + if ( ++p == pe ) + goto _test_eof93; +case 93: + if ( (*p) <= -65 ) + goto st92; + goto st0; +st94: + if ( ++p == pe ) + goto _test_eof94; +case 94: + if ( (*p) <= -65 ) + goto st93; + goto st0; +st95: + if ( ++p == pe ) + goto _test_eof95; +case 95: + if ( (*p) <= -65 ) + goto st94; + goto st0; +st96: + if ( ++p == pe ) + goto _test_eof96; +case 96: + if ( (*p) <= -65 ) + goto st95; + goto st0; +st97: + if ( ++p == pe ) + goto _test_eof97; +case 97: + if ( (*p) == 10 ) + goto st98; + goto st0; +st98: + if ( ++p == pe ) + goto _test_eof98; +case 98: + switch( (*p) ) { + case 9: goto st91; + case 32: goto st91; + } + goto st0; +st99: + if ( ++p == pe ) + goto _test_eof99; +case 99: + switch( (*p) ) { + case 9: goto tr103; + case 13: goto tr104; + case 32: goto tr103; + case 60: goto tr105; + } + goto st0; +st100: + if ( ++p == pe ) + goto _test_eof100; +case 100: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st91; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st91; + } else + goto st91; + goto st0; + } + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof101: cs = 101; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof28: cs = 28; goto _test_eof; + _test_eof29: cs = 29; goto _test_eof; + _test_eof30: cs = 30; goto _test_eof; + _test_eof31: cs = 31; goto _test_eof; + _test_eof32: cs = 32; goto _test_eof; + _test_eof33: cs = 33; goto _test_eof; + _test_eof34: cs = 34; goto _test_eof; + _test_eof35: cs = 35; goto _test_eof; + _test_eof36: cs = 36; goto _test_eof; + _test_eof37: cs = 37; goto _test_eof; + _test_eof38: cs = 38; goto _test_eof; + _test_eof39: cs = 39; goto _test_eof; + _test_eof40: cs = 40; goto _test_eof; + _test_eof41: cs = 41; goto _test_eof; + _test_eof42: cs = 42; goto _test_eof; + _test_eof43: cs = 43; goto _test_eof; + _test_eof44: cs = 44; goto _test_eof; + _test_eof45: cs = 45; goto _test_eof; + _test_eof46: cs = 46; goto _test_eof; + _test_eof47: cs = 47; goto _test_eof; + _test_eof48: cs = 48; goto _test_eof; + _test_eof49: cs = 49; goto _test_eof; + _test_eof50: cs = 50; goto _test_eof; + _test_eof51: cs = 51; goto _test_eof; + _test_eof52: cs = 52; goto _test_eof; + _test_eof53: cs = 53; goto _test_eof; + _test_eof54: cs = 54; goto _test_eof; + _test_eof55: cs = 55; goto _test_eof; + _test_eof56: cs = 56; goto _test_eof; + _test_eof57: cs = 57; goto _test_eof; + _test_eof58: cs = 58; goto _test_eof; + _test_eof59: cs = 59; goto _test_eof; + _test_eof60: cs = 60; goto _test_eof; + _test_eof61: cs = 61; goto _test_eof; + _test_eof62: cs = 62; goto _test_eof; + _test_eof63: cs = 63; goto _test_eof; + _test_eof64: cs = 64; goto _test_eof; + _test_eof65: cs = 65; goto _test_eof; + _test_eof66: cs = 66; goto _test_eof; + _test_eof67: cs = 67; goto _test_eof; + _test_eof68: cs = 68; goto _test_eof; + _test_eof69: cs = 69; goto _test_eof; + _test_eof70: cs = 70; goto _test_eof; + _test_eof71: cs = 71; goto _test_eof; + _test_eof72: cs = 72; goto _test_eof; + _test_eof73: cs = 73; goto _test_eof; + _test_eof74: cs = 74; goto _test_eof; + _test_eof75: cs = 75; goto _test_eof; + _test_eof76: cs = 76; goto _test_eof; + _test_eof77: cs = 77; goto _test_eof; + _test_eof78: cs = 78; goto _test_eof; + _test_eof79: cs = 79; goto _test_eof; + _test_eof80: cs = 80; goto _test_eof; + _test_eof81: cs = 81; goto _test_eof; + _test_eof82: cs = 82; goto _test_eof; + _test_eof83: cs = 83; goto _test_eof; + _test_eof84: cs = 84; goto _test_eof; + _test_eof85: cs = 85; goto _test_eof; + _test_eof86: cs = 86; goto _test_eof; + _test_eof87: cs = 87; goto _test_eof; + _test_eof88: cs = 88; goto _test_eof; + _test_eof89: cs = 89; goto _test_eof; + _test_eof90: cs = 90; goto _test_eof; + _test_eof91: cs = 91; goto _test_eof; + _test_eof92: cs = 92; goto _test_eof; + _test_eof93: cs = 93; goto _test_eof; + _test_eof94: cs = 94; goto _test_eof; + _test_eof95: cs = 95; goto _test_eof; + _test_eof96: cs = 96; goto _test_eof; + _test_eof97: cs = 97; goto _test_eof; + _test_eof98: cs = 98; goto _test_eof; + _test_eof99: cs = 99; goto _test_eof; + _test_eof100: cs = 100; goto _test_eof; + + _test_eof: {} + _out: {} + } + +/* #line 152 "tsip_parser_header_Path.rl" */ + + if( cs < +/* #line 1699 "../src/headers/tsip_header_Path.c" */ +101 +/* #line 153 "tsip_parser_header_Path.rl" */ + ) + { + TSK_OBJECT_SAFE_FREE(curr_path); + TSK_OBJECT_SAFE_FREE(hdr_paths); + } + + return hdr_paths; +} + + + + + +//======================================================== +// Path header object definition +// + +/**@ingroup tsip_header_Path_group +*/ +static void* tsip_header_Path_create(void *self, va_list * app) +{ + tsip_header_Path_t *Path = self; + if(Path) + { + TSIP_HEADER(Path)->type = tsip_htype_Path; + TSIP_HEADER(Path)->tostring = tsip_header_Path_tostring; + } + else + { + TSK_DEBUG_ERROR("Failed to create new Path header."); + } + return self; +} + +/**@ingroup tsip_header_Path_group +*/ +static void* tsip_header_Path_destroy(void *self) +{ + tsip_header_Path_t *Path = self; + if(Path) + { + TSK_FREE(Path->display_name); + TSK_OBJECT_SAFE_FREE(Path->uri); + + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Path)); + } + else TSK_DEBUG_ERROR("Null Path header."); + + return self; +} + +static const tsk_object_def_t tsip_header_Path_def_s = +{ + sizeof(tsip_header_Path_t), + tsip_header_Path_create, + tsip_header_Path_destroy, + 0 +}; +const void *tsip_header_Path_def_t = &tsip_header_Path_def_s; \ No newline at end of file diff --git a/trunk/tinySIP/src/headers/tsip_header_Route.c b/trunk/tinySIP/src/headers/tsip_header_Route.c index 8b137891..1e8227e3 100644 --- a/trunk/tinySIP/src/headers/tsip_header_Route.c +++ b/trunk/tinySIP/src/headers/tsip_header_Route.c @@ -1 +1,1767 @@ - + +/* #line 1 "tsip_parser_header_Route.rl" */ +/* +* Copyright (C) 2009 Mamadou Diop. +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tsip_header_Route.c + * @brief SIP Service-Route header as per RFC 3608. + * + * @author Mamadou Diop + * + * @date Created: Sat Nov 8 16:54:58 2009 mdiop + */ +#include "tinysip/headers/tsip_header_Route.h" + +#include "tinysip/parsers/tsip_parser_uri.h" + +#include "tsk_debug.h" +#include "tsk_memory.h" +#include "tsk_time.h" + +#include + +/**@defgroup tsip_header_Route_group SIP Service-Route header. +*/ + +/*********************************** +* Ragel state machine. +*/ + +/* #line 118 "tsip_parser_header_Route.rl" */ + + +int tsip_header_Route_tostring(const void* header, tsk_buffer_t* output) +{ + if(header) + { + const tsip_header_Route_t *Route = header; + int ret = 0; + + if(Route->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Route->display_name); + } + + if(ret=tsip_uri_serialize(Route->uri, 1, 1, output)){ /* Route */ + return ret; + } + + return ret; + } + + return -1; +} + +tsip_header_Routes_L_t *tsip_header_Route_parse(const char *data, size_t size) +{ + int cs = 0; + const char *p = data; + const char *pe = p + size; + const char *eof = pe; + tsip_header_Routes_L_t *hdr_routes = TSK_LIST_CREATE(); + + const char *tag_start; + tsip_header_Route_t *curr_route = 0; + + +/* #line 86 "../src/headers/tsip_header_Route.c" */ +static const int tsip_machine_parser_header_Route_start = 1; +static const int tsip_machine_parser_header_Route_first_final = 102; +static const int tsip_machine_parser_header_Route_error = 0; + +static const int tsip_machine_parser_header_Route_en_main = 1; + + +/* #line 153 "tsip_parser_header_Route.rl" */ + +/* #line 96 "../src/headers/tsip_header_Route.c" */ + { + cs = tsip_machine_parser_header_Route_start; + } + +/* #line 154 "tsip_parser_header_Route.rl" */ + +/* #line 103 "../src/headers/tsip_header_Route.c" */ + { + if ( p == pe ) + goto _test_eof; + switch ( cs ) + { +case 1: + if ( (*p) == 82 ) + goto st2; + goto st0; +st0: +cs = 0; + goto _out; +st2: + if ( ++p == pe ) + goto _test_eof2; +case 2: + if ( (*p) == 111 ) + goto st3; + goto st0; +st3: + if ( ++p == pe ) + goto _test_eof3; +case 3: + if ( (*p) == 117 ) + goto st4; + goto st0; +st4: + if ( ++p == pe ) + goto _test_eof4; +case 4: + if ( (*p) == 116 ) + goto st5; + goto st0; +st5: + if ( ++p == pe ) + goto _test_eof5; +case 5: + if ( (*p) == 101 ) + goto st6; + goto st0; +st6: + if ( ++p == pe ) + goto _test_eof6; +case 6: + switch( (*p) ) { + case 9: goto st6; + case 32: goto st6; + case 58: goto st7; + } + goto st0; +tr7: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + goto st7; +tr27: +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st7; +tr37: +/* #line 83 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st7; +st7: + if ( ++p == pe ) + goto _test_eof7; +case 7: +/* #line 192 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto tr7; + case 13: goto tr8; + case 32: goto tr7; + case 33: goto tr9; + case 34: goto tr10; + case 37: goto tr9; + case 39: goto tr9; + case 60: goto tr11; + case 126: goto tr9; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr9; + } else if ( (*p) >= 42 ) + goto tr9; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr9; + } else if ( (*p) >= 65 ) + goto tr9; + } else + goto tr9; + goto st0; +tr8: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + goto st8; +st8: + if ( ++p == pe ) + goto _test_eof8; +case 8: +/* #line 232 "../src/headers/tsip_header_Route.c" */ + if ( (*p) == 10 ) + goto st9; + goto st0; +st9: + if ( ++p == pe ) + goto _test_eof9; +case 9: + switch( (*p) ) { + case 9: goto st10; + case 32: goto st10; + } + goto st0; +tr14: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + goto st10; +st10: + if ( ++p == pe ) + goto _test_eof10; +case 10: +/* #line 258 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto tr14; + case 13: goto tr15; + case 32: goto tr14; + case 33: goto tr9; + case 34: goto tr10; + case 37: goto tr9; + case 39: goto tr9; + case 60: goto tr11; + case 126: goto tr9; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr9; + } else if ( (*p) >= 42 ) + goto tr9; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr9; + } else if ( (*p) >= 65 ) + goto tr9; + } else + goto tr9; + goto st0; +tr15: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + goto st11; +tr105: +/* #line 66 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_SET_STRING(curr_route->display_name); + } + } + goto st11; +st11: + if ( ++p == pe ) + goto _test_eof11; +case 11: +/* #line 307 "../src/headers/tsip_header_Route.c" */ + if ( (*p) == 10 ) + goto st12; + goto st0; +st12: + if ( ++p == pe ) + goto _test_eof12; +case 12: + switch( (*p) ) { + case 9: goto st13; + case 32: goto st13; + } + goto st0; +st13: + if ( ++p == pe ) + goto _test_eof13; +case 13: + switch( (*p) ) { + case 9: goto st13; + case 32: goto st13; + case 60: goto st14; + } + goto st0; +tr11: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } + goto st14; +tr106: +/* #line 66 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_SET_STRING(curr_route->display_name); + } + } + goto st14; +st14: + if ( ++p == pe ) + goto _test_eof14; +case 14: +/* #line 352 "../src/headers/tsip_header_Route.c" */ + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr19; + } else if ( (*p) >= 65 ) + goto tr19; + goto st0; +tr19: +/* #line 53 "tsip_parser_header_Route.rl" */ + { + tag_start = p; + } + goto st15; +st15: + if ( ++p == pe ) + goto _test_eof15; +case 15: +/* #line 369 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st16; + case 32: goto st16; + case 43: goto st15; + case 58: goto st17; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st15; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st15; + } else if ( (*p) >= 65 ) + goto st15; + } else + goto st15; + goto st0; +st16: + if ( ++p == pe ) + goto _test_eof16; +case 16: + switch( (*p) ) { + case 9: goto st16; + case 32: goto st16; + case 58: goto st17; + } + goto st0; +st17: + if ( ++p == pe ) + goto _test_eof17; +case 17: + goto st18; +st18: + if ( ++p == pe ) + goto _test_eof18; +case 18: + if ( (*p) == 62 ) + goto tr24; + goto st18; +tr24: +/* #line 74 "tsip_parser_header_Route.rl" */ + { + if(curr_route && !curr_route->uri) + { + int len = (int)(p - tag_start); + curr_route->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + goto st19; +tr25: +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st19; +st19: + if ( ++p == pe ) + goto _test_eof19; +case 19: +/* #line 433 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto tr25; + case 13: goto tr26; + case 32: goto tr25; + case 44: goto tr27; + case 59: goto st21; + } + goto st0; +tr26: +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st20; +tr35: +/* #line 83 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st20; +st20: + if ( ++p == pe ) + goto _test_eof20; +case 20: +/* #line 471 "../src/headers/tsip_header_Route.c" */ + if ( (*p) == 10 ) + goto tr29; + goto st0; +tr29: +/* #line 99 "tsip_parser_header_Route.rl" */ + { + } + goto st102; +st102: + if ( ++p == pe ) + goto _test_eof102; +case 102: +/* #line 484 "../src/headers/tsip_header_Route.c" */ + goto st0; +tr38: +/* #line 83 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } + goto st21; +st21: + if ( ++p == pe ) + goto _test_eof21; +case 21: +/* #line 499 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st21; + case 13: goto st22; + case 32: goto st21; + case 33: goto tr31; + case 37: goto tr31; + case 39: goto tr31; + case 126: goto tr31; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr31; + } else if ( (*p) >= 42 ) + goto tr31; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr31; + } else if ( (*p) >= 65 ) + goto tr31; + } else + goto tr31; + goto st0; +st22: + if ( ++p == pe ) + goto _test_eof22; +case 22: + if ( (*p) == 10 ) + goto st23; + goto st0; +st23: + if ( ++p == pe ) + goto _test_eof23; +case 23: + switch( (*p) ) { + case 9: goto st24; + case 32: goto st24; + } + goto st0; +st24: + if ( ++p == pe ) + goto _test_eof24; +case 24: + switch( (*p) ) { + case 9: goto st24; + case 32: goto st24; + case 33: goto tr31; + case 37: goto tr31; + case 39: goto tr31; + case 126: goto tr31; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr31; + } else if ( (*p) >= 42 ) + goto tr31; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr31; + } else if ( (*p) >= 65 ) + goto tr31; + } else + goto tr31; + goto st0; +tr31: +/* #line 53 "tsip_parser_header_Route.rl" */ + { + tag_start = p; + } + goto st25; +st25: + if ( ++p == pe ) + goto _test_eof25; +case 25: +/* #line 577 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto tr34; + case 13: goto tr35; + case 32: goto tr34; + case 33: goto st25; + case 37: goto st25; + case 39: goto st25; + case 44: goto tr37; + case 59: goto tr38; + case 61: goto st30; + case 126: goto st25; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st25; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st25; + } else if ( (*p) >= 65 ) + goto st25; + } else + goto st25; + goto st0; +tr34: +/* #line 83 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st26; +st26: + if ( ++p == pe ) + goto _test_eof26; +case 26: +/* #line 622 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st26; + case 13: goto st27; + case 32: goto st26; + case 44: goto st7; + case 59: goto st21; + case 61: goto st30; + } + goto st0; +st27: + if ( ++p == pe ) + goto _test_eof27; +case 27: + if ( (*p) == 10 ) + goto st28; + goto st0; +st28: + if ( ++p == pe ) + goto _test_eof28; +case 28: + switch( (*p) ) { + case 9: goto st29; + case 32: goto st29; + } + goto st0; +st29: + if ( ++p == pe ) + goto _test_eof29; +case 29: + switch( (*p) ) { + case 9: goto st29; + case 32: goto st29; + case 44: goto st7; + case 59: goto st21; + case 61: goto st30; + } + goto st0; +st30: + if ( ++p == pe ) + goto _test_eof30; +case 30: + switch( (*p) ) { + case 9: goto st30; + case 13: goto st31; + case 32: goto st30; + case 33: goto st51; + case 34: goto st37; + case 37: goto st51; + case 39: goto st51; + case 91: goto st52; + case 126: goto st51; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st51; + } else if ( (*p) >= 42 ) + goto st51; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st51; + } else if ( (*p) >= 65 ) + goto st51; + } else + goto st51; + goto st0; +st31: + if ( ++p == pe ) + goto _test_eof31; +case 31: + if ( (*p) == 10 ) + goto st32; + goto st0; +st32: + if ( ++p == pe ) + goto _test_eof32; +case 32: + switch( (*p) ) { + case 9: goto st33; + case 32: goto st33; + } + goto st0; +st33: + if ( ++p == pe ) + goto _test_eof33; +case 33: + switch( (*p) ) { + case 9: goto st33; + case 13: goto st34; + case 32: goto st33; + case 33: goto st51; + case 34: goto st37; + case 37: goto st51; + case 39: goto st51; + case 91: goto st52; + case 126: goto st51; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st51; + } else if ( (*p) >= 42 ) + goto st51; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st51; + } else if ( (*p) >= 65 ) + goto st51; + } else + goto st51; + goto st0; +st34: + if ( ++p == pe ) + goto _test_eof34; +case 34: + if ( (*p) == 10 ) + goto st35; + goto st0; +st35: + if ( ++p == pe ) + goto _test_eof35; +case 35: + switch( (*p) ) { + case 9: goto st36; + case 32: goto st36; + } + goto st0; +st36: + if ( ++p == pe ) + goto _test_eof36; +case 36: + switch( (*p) ) { + case 9: goto st36; + case 32: goto st36; + case 34: goto st37; + } + goto st0; +st37: + if ( ++p == pe ) + goto _test_eof37; +case 37: + switch( (*p) ) { + case 9: goto st37; + case 13: goto st43; + case 34: goto st45; + case 92: goto st50; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st39; + } else if ( (*p) >= -64 ) + goto st38; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st41; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st37; + } else + goto st42; + } else + goto st40; + goto st0; +st38: + if ( ++p == pe ) + goto _test_eof38; +case 38: + if ( (*p) <= -65 ) + goto st37; + goto st0; +st39: + if ( ++p == pe ) + goto _test_eof39; +case 39: + if ( (*p) <= -65 ) + goto st38; + goto st0; +st40: + if ( ++p == pe ) + goto _test_eof40; +case 40: + if ( (*p) <= -65 ) + goto st39; + goto st0; +st41: + if ( ++p == pe ) + goto _test_eof41; +case 41: + if ( (*p) <= -65 ) + goto st40; + goto st0; +st42: + if ( ++p == pe ) + goto _test_eof42; +case 42: + if ( (*p) <= -65 ) + goto st41; + goto st0; +st43: + if ( ++p == pe ) + goto _test_eof43; +case 43: + if ( (*p) == 10 ) + goto st44; + goto st0; +st44: + if ( ++p == pe ) + goto _test_eof44; +case 44: + switch( (*p) ) { + case 9: goto st37; + case 32: goto st37; + } + goto st0; +st45: + if ( ++p == pe ) + goto _test_eof45; +case 45: + switch( (*p) ) { + case 9: goto tr62; + case 13: goto tr35; + case 32: goto tr62; + case 44: goto tr37; + case 59: goto tr38; + } + goto st0; +tr62: +/* #line 83 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_route)); + } + } +/* #line 91 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + tsk_list_push_back_data(hdr_routes, ((void**) &curr_route)); + } + } + goto st46; +st46: + if ( ++p == pe ) + goto _test_eof46; +case 46: +/* #line 873 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st46; + case 13: goto st47; + case 32: goto st46; + case 44: goto st7; + case 59: goto st21; + } + goto st0; +st47: + if ( ++p == pe ) + goto _test_eof47; +case 47: + if ( (*p) == 10 ) + goto st48; + goto st0; +st48: + if ( ++p == pe ) + goto _test_eof48; +case 48: + switch( (*p) ) { + case 9: goto st49; + case 32: goto st49; + } + goto st0; +st49: + if ( ++p == pe ) + goto _test_eof49; +case 49: + switch( (*p) ) { + case 9: goto st49; + case 32: goto st49; + case 44: goto st7; + case 59: goto st21; + } + goto st0; +st50: + if ( ++p == pe ) + goto _test_eof50; +case 50: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st37; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st37; + } else + goto st37; + goto st0; +st51: + if ( ++p == pe ) + goto _test_eof51; +case 51: + switch( (*p) ) { + case 9: goto tr62; + case 13: goto tr35; + case 32: goto tr62; + case 33: goto st51; + case 37: goto st51; + case 39: goto st51; + case 44: goto tr37; + case 59: goto tr38; + case 126: goto st51; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st51; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st51; + } else if ( (*p) >= 65 ) + goto st51; + } else + goto st51; + goto st0; +st52: + if ( ++p == pe ) + goto _test_eof52; +case 52: + if ( (*p) == 58 ) + goto st86; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st53; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st53; + } else + goto st53; + goto st0; +st53: + if ( ++p == pe ) + goto _test_eof53; +case 53: + switch( (*p) ) { + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st54; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st54; + } else + goto st54; + goto st0; +st54: + if ( ++p == pe ) + goto _test_eof54; +case 54: + switch( (*p) ) { + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st55; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st55; + } else + goto st55; + goto st0; +st55: + if ( ++p == pe ) + goto _test_eof55; +case 55: + switch( (*p) ) { + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st56; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st56; + } else + goto st56; + goto st0; +st56: + if ( ++p == pe ) + goto _test_eof56; +case 56: + switch( (*p) ) { + case 58: goto st57; + case 93: goto st45; + } + goto st0; +st57: + if ( ++p == pe ) + goto _test_eof57; +case 57: + if ( (*p) == 58 ) + goto st73; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st58; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st53; + } else + goto st53; + goto st0; +st58: + if ( ++p == pe ) + goto _test_eof58; +case 58: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st71; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st54; + } else + goto st54; + goto st0; +st59: + if ( ++p == pe ) + goto _test_eof59; +case 59: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st60; + goto st0; +st60: + if ( ++p == pe ) + goto _test_eof60; +case 60: + if ( (*p) == 46 ) + goto st61; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st69; + goto st0; +st61: + if ( ++p == pe ) + goto _test_eof61; +case 61: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st62; + goto st0; +st62: + if ( ++p == pe ) + goto _test_eof62; +case 62: + if ( (*p) == 46 ) + goto st63; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st67; + goto st0; +st63: + if ( ++p == pe ) + goto _test_eof63; +case 63: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st64; + goto st0; +st64: + if ( ++p == pe ) + goto _test_eof64; +case 64: + if ( (*p) == 93 ) + goto st45; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st65; + goto st0; +st65: + if ( ++p == pe ) + goto _test_eof65; +case 65: + if ( (*p) == 93 ) + goto st45; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st66; + goto st0; +st66: + if ( ++p == pe ) + goto _test_eof66; +case 66: + if ( (*p) == 93 ) + goto st45; + goto st0; +st67: + if ( ++p == pe ) + goto _test_eof67; +case 67: + if ( (*p) == 46 ) + goto st63; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st68; + goto st0; +st68: + if ( ++p == pe ) + goto _test_eof68; +case 68: + if ( (*p) == 46 ) + goto st63; + goto st0; +st69: + if ( ++p == pe ) + goto _test_eof69; +case 69: + if ( (*p) == 46 ) + goto st61; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st70; + goto st0; +st70: + if ( ++p == pe ) + goto _test_eof70; +case 70: + if ( (*p) == 46 ) + goto st61; + goto st0; +st71: + if ( ++p == pe ) + goto _test_eof71; +case 71: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st72; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st55; + } else + goto st55; + goto st0; +st72: + if ( ++p == pe ) + goto _test_eof72; +case 72: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st57; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st56; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st56; + } else + goto st56; + goto st0; +st73: + if ( ++p == pe ) + goto _test_eof73; +case 73: + switch( (*p) ) { + case 58: goto st82; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st74; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st74; + } else + goto st74; + goto st0; +st74: + if ( ++p == pe ) + goto _test_eof74; +case 74: + switch( (*p) ) { + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st75; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st75; + } else + goto st75; + goto st0; +st75: + if ( ++p == pe ) + goto _test_eof75; +case 75: + switch( (*p) ) { + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st76; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st76; + } else + goto st76; + goto st0; +st76: + if ( ++p == pe ) + goto _test_eof76; +case 76: + switch( (*p) ) { + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st77; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st77; + } else + goto st77; + goto st0; +st77: + if ( ++p == pe ) + goto _test_eof77; +case 77: + switch( (*p) ) { + case 58: goto st78; + case 93: goto st45; + } + goto st0; +st78: + if ( ++p == pe ) + goto _test_eof78; +case 78: + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st79; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st74; + } else + goto st74; + goto st0; +st79: + if ( ++p == pe ) + goto _test_eof79; +case 79: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st80; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st75; + } else + goto st75; + goto st0; +st80: + if ( ++p == pe ) + goto _test_eof80; +case 80: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st81; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st76; + } else + goto st76; + goto st0; +st81: + if ( ++p == pe ) + goto _test_eof81; +case 81: + switch( (*p) ) { + case 46: goto st59; + case 58: goto st78; + case 93: goto st45; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st77; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st77; + } else + goto st77; + goto st0; +st82: + if ( ++p == pe ) + goto _test_eof82; +case 82: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st83; + goto st0; +st83: + if ( ++p == pe ) + goto _test_eof83; +case 83: + if ( (*p) == 46 ) + goto st59; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st84; + goto st0; +st84: + if ( ++p == pe ) + goto _test_eof84; +case 84: + if ( (*p) == 46 ) + goto st59; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st85; + goto st0; +st85: + if ( ++p == pe ) + goto _test_eof85; +case 85: + if ( (*p) == 46 ) + goto st59; + goto st0; +st86: + if ( ++p == pe ) + goto _test_eof86; +case 86: + if ( (*p) == 58 ) + goto st73; + goto st0; +tr9: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Route.rl" */ + { + tag_start = p; + } + goto st87; +st87: + if ( ++p == pe ) + goto _test_eof87; +case 87: +/* #line 1389 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st88; + case 13: goto st90; + case 32: goto st88; + case 33: goto st87; + case 37: goto st87; + case 39: goto st87; + case 126: goto st87; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st87; + } else if ( (*p) >= 42 ) + goto st87; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st87; + } else if ( (*p) >= 65 ) + goto st87; + } else + goto st87; + goto st0; +st88: + if ( ++p == pe ) + goto _test_eof88; +case 88: + switch( (*p) ) { + case 9: goto tr104; + case 13: goto tr105; + case 32: goto tr104; + case 33: goto st87; + case 37: goto st87; + case 39: goto st87; + case 60: goto tr106; + case 126: goto st87; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st87; + } else if ( (*p) >= 42 ) + goto st87; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st87; + } else if ( (*p) >= 65 ) + goto st87; + } else + goto st87; + goto st0; +tr104: +/* #line 66 "tsip_parser_header_Route.rl" */ + { + if(curr_route) + { + PARSER_SET_STRING(curr_route->display_name); + } + } + goto st89; +st89: + if ( ++p == pe ) + goto _test_eof89; +case 89: +/* #line 1456 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st89; + case 13: goto st11; + case 32: goto st89; + case 60: goto st14; + } + goto st0; +st90: + if ( ++p == pe ) + goto _test_eof90; +case 90: + if ( (*p) == 10 ) + goto st91; + goto st0; +st91: + if ( ++p == pe ) + goto _test_eof91; +case 91: + switch( (*p) ) { + case 9: goto st88; + case 32: goto st88; + } + goto st0; +tr10: +/* #line 58 "tsip_parser_header_Route.rl" */ + { + if(!curr_route) + { + curr_route = TSIP_HEADER_ROUTE_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Route.rl" */ + { + tag_start = p; + } + goto st92; +st92: + if ( ++p == pe ) + goto _test_eof92; +case 92: +/* #line 1497 "../src/headers/tsip_header_Route.c" */ + switch( (*p) ) { + case 9: goto st92; + case 13: goto st98; + case 34: goto st100; + case 92: goto st101; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st94; + } else if ( (*p) >= -64 ) + goto st93; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st96; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st92; + } else + goto st97; + } else + goto st95; + goto st0; +st93: + if ( ++p == pe ) + goto _test_eof93; +case 93: + if ( (*p) <= -65 ) + goto st92; + goto st0; +st94: + if ( ++p == pe ) + goto _test_eof94; +case 94: + if ( (*p) <= -65 ) + goto st93; + goto st0; +st95: + if ( ++p == pe ) + goto _test_eof95; +case 95: + if ( (*p) <= -65 ) + goto st94; + goto st0; +st96: + if ( ++p == pe ) + goto _test_eof96; +case 96: + if ( (*p) <= -65 ) + goto st95; + goto st0; +st97: + if ( ++p == pe ) + goto _test_eof97; +case 97: + if ( (*p) <= -65 ) + goto st96; + goto st0; +st98: + if ( ++p == pe ) + goto _test_eof98; +case 98: + if ( (*p) == 10 ) + goto st99; + goto st0; +st99: + if ( ++p == pe ) + goto _test_eof99; +case 99: + switch( (*p) ) { + case 9: goto st92; + case 32: goto st92; + } + goto st0; +st100: + if ( ++p == pe ) + goto _test_eof100; +case 100: + switch( (*p) ) { + case 9: goto tr104; + case 13: goto tr105; + case 32: goto tr104; + case 60: goto tr106; + } + goto st0; +st101: + if ( ++p == pe ) + goto _test_eof101; +case 101: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st92; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st92; + } else + goto st92; + goto st0; + } + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof102: cs = 102; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof28: cs = 28; goto _test_eof; + _test_eof29: cs = 29; goto _test_eof; + _test_eof30: cs = 30; goto _test_eof; + _test_eof31: cs = 31; goto _test_eof; + _test_eof32: cs = 32; goto _test_eof; + _test_eof33: cs = 33; goto _test_eof; + _test_eof34: cs = 34; goto _test_eof; + _test_eof35: cs = 35; goto _test_eof; + _test_eof36: cs = 36; goto _test_eof; + _test_eof37: cs = 37; goto _test_eof; + _test_eof38: cs = 38; goto _test_eof; + _test_eof39: cs = 39; goto _test_eof; + _test_eof40: cs = 40; goto _test_eof; + _test_eof41: cs = 41; goto _test_eof; + _test_eof42: cs = 42; goto _test_eof; + _test_eof43: cs = 43; goto _test_eof; + _test_eof44: cs = 44; goto _test_eof; + _test_eof45: cs = 45; goto _test_eof; + _test_eof46: cs = 46; goto _test_eof; + _test_eof47: cs = 47; goto _test_eof; + _test_eof48: cs = 48; goto _test_eof; + _test_eof49: cs = 49; goto _test_eof; + _test_eof50: cs = 50; goto _test_eof; + _test_eof51: cs = 51; goto _test_eof; + _test_eof52: cs = 52; goto _test_eof; + _test_eof53: cs = 53; goto _test_eof; + _test_eof54: cs = 54; goto _test_eof; + _test_eof55: cs = 55; goto _test_eof; + _test_eof56: cs = 56; goto _test_eof; + _test_eof57: cs = 57; goto _test_eof; + _test_eof58: cs = 58; goto _test_eof; + _test_eof59: cs = 59; goto _test_eof; + _test_eof60: cs = 60; goto _test_eof; + _test_eof61: cs = 61; goto _test_eof; + _test_eof62: cs = 62; goto _test_eof; + _test_eof63: cs = 63; goto _test_eof; + _test_eof64: cs = 64; goto _test_eof; + _test_eof65: cs = 65; goto _test_eof; + _test_eof66: cs = 66; goto _test_eof; + _test_eof67: cs = 67; goto _test_eof; + _test_eof68: cs = 68; goto _test_eof; + _test_eof69: cs = 69; goto _test_eof; + _test_eof70: cs = 70; goto _test_eof; + _test_eof71: cs = 71; goto _test_eof; + _test_eof72: cs = 72; goto _test_eof; + _test_eof73: cs = 73; goto _test_eof; + _test_eof74: cs = 74; goto _test_eof; + _test_eof75: cs = 75; goto _test_eof; + _test_eof76: cs = 76; goto _test_eof; + _test_eof77: cs = 77; goto _test_eof; + _test_eof78: cs = 78; goto _test_eof; + _test_eof79: cs = 79; goto _test_eof; + _test_eof80: cs = 80; goto _test_eof; + _test_eof81: cs = 81; goto _test_eof; + _test_eof82: cs = 82; goto _test_eof; + _test_eof83: cs = 83; goto _test_eof; + _test_eof84: cs = 84; goto _test_eof; + _test_eof85: cs = 85; goto _test_eof; + _test_eof86: cs = 86; goto _test_eof; + _test_eof87: cs = 87; goto _test_eof; + _test_eof88: cs = 88; goto _test_eof; + _test_eof89: cs = 89; goto _test_eof; + _test_eof90: cs = 90; goto _test_eof; + _test_eof91: cs = 91; goto _test_eof; + _test_eof92: cs = 92; goto _test_eof; + _test_eof93: cs = 93; goto _test_eof; + _test_eof94: cs = 94; goto _test_eof; + _test_eof95: cs = 95; goto _test_eof; + _test_eof96: cs = 96; goto _test_eof; + _test_eof97: cs = 97; goto _test_eof; + _test_eof98: cs = 98; goto _test_eof; + _test_eof99: cs = 99; goto _test_eof; + _test_eof100: cs = 100; goto _test_eof; + _test_eof101: cs = 101; goto _test_eof; + + _test_eof: {} + _out: {} + } + +/* #line 155 "tsip_parser_header_Route.rl" */ + + if( cs < +/* #line 1707 "../src/headers/tsip_header_Route.c" */ +102 +/* #line 156 "tsip_parser_header_Route.rl" */ + ) + { + TSK_OBJECT_SAFE_FREE(curr_route); + TSK_OBJECT_SAFE_FREE(hdr_routes); + } + + return hdr_routes; +} + + + + + +//======================================================== +// Route header object definition +// + +/**@ingroup tsip_header_Route_group +*/ +static void* tsip_header_Route_create(void *self, va_list * app) +{ + tsip_header_Route_t *Route = self; + if(Route) + { + TSIP_HEADER(Route)->type = tsip_htype_Route; + TSIP_HEADER(Route)->tostring = tsip_header_Route_tostring; + } + else + { + TSK_DEBUG_ERROR("Failed to create new Route header."); + } + return self; +} + +/**@ingroup tsip_header_Route_group +*/ +static void* tsip_header_Route_destroy(void *self) +{ + tsip_header_Route_t *Route = self; + if(Route) + { + TSK_FREE(Route->display_name); + TSK_OBJECT_SAFE_FREE(Route->uri); + + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Route)); + } + else TSK_DEBUG_ERROR("Null Route header."); + + return self; +} + +static const tsk_object_def_t tsip_header_Route_def_s = +{ + sizeof(tsip_header_Route_t), + tsip_header_Route_create, + tsip_header_Route_destroy, + 0 +}; +const void *tsip_header_Route_def_t = &tsip_header_Route_def_s; \ No newline at end of file diff --git a/trunk/tinySIP/src/headers/tsip_header_Service_Route.c b/trunk/tinySIP/src/headers/tsip_header_Service_Route.c index 8b137891..1d8ffed4 100644 --- a/trunk/tinySIP/src/headers/tsip_header_Service_Route.c +++ b/trunk/tinySIP/src/headers/tsip_header_Service_Route.c @@ -1 +1,1831 @@ - + +/* #line 1 "tsip_parser_header_Service_Route.rl" */ +/* +* Copyright (C) 2009 Mamadou Diop. +* +* Contact: Mamadou Diop +* +* This file is part of Open Source Doubango Framework. +* +* DOUBANGO is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* DOUBANGO is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with DOUBANGO. +* +*/ + +/**@file tsip_header_Service_Route.c + * @brief SIP Service-Route header as per RFC 3608. + * + * @author Mamadou Diop + * + * @date Created: Sat Nov 8 16:54:58 2009 mdiop + */ +#include "tinysip/headers/tsip_header_Service_Route.h" + +#include "tinysip/parsers/tsip_parser_uri.h" + +#include "tsk_debug.h" +#include "tsk_memory.h" +#include "tsk_time.h" + +#include + +/**@defgroup tsip_header_Service_Route_group SIP Service-Route header. +*/ + +/*********************************** +* Ragel state machine. +*/ + +/* #line 115 "tsip_parser_header_Service_Route.rl" */ + + +int tsip_header_Service_Route_tostring(const void* header, tsk_buffer_t* output) +{ + if(header) + { + const tsip_header_Service_Route_t *Service_Route = header; + int ret = 0; + + if(Service_Route->display_name){ /* Display Name */ + tsk_buffer_appendEx(output, "\"%s\"", Service_Route->display_name); + } + + if(ret=tsip_uri_serialize(Service_Route->uri, 1, 1, output)){ /* Route */ + return ret; + } + + return ret; + } + + return -1; +} + +tsip_header_Service_Routes_L_t *tsip_header_Service_Route_parse(const char *data, size_t size) +{ + int cs = 0; + const char *p = data; + const char *pe = p + size; + const char *eof = pe; + tsip_header_Service_Routes_L_t *hdr_services = TSK_LIST_CREATE(); + + const char *tag_start; + tsip_header_Service_Route_t *curr_service = 0; + + +/* #line 86 "../src/headers/tsip_header_Service_Route.c" */ +static const int tsip_machine_parser_header_Service_Route_start = 1; +static const int tsip_machine_parser_header_Service_Route_first_final = 110; +static const int tsip_machine_parser_header_Service_Route_error = 0; + +static const int tsip_machine_parser_header_Service_Route_en_main = 1; + + +/* #line 150 "tsip_parser_header_Service_Route.rl" */ + +/* #line 96 "../src/headers/tsip_header_Service_Route.c" */ + { + cs = tsip_machine_parser_header_Service_Route_start; + } + +/* #line 151 "tsip_parser_header_Service_Route.rl" */ + +/* #line 103 "../src/headers/tsip_header_Service_Route.c" */ + { + if ( p == pe ) + goto _test_eof; + switch ( cs ) + { +case 1: + if ( (*p) == 83 ) + goto st2; + goto st0; +st0: +cs = 0; + goto _out; +st2: + if ( ++p == pe ) + goto _test_eof2; +case 2: + if ( (*p) == 101 ) + goto st3; + goto st0; +st3: + if ( ++p == pe ) + goto _test_eof3; +case 3: + if ( (*p) == 114 ) + goto st4; + goto st0; +st4: + if ( ++p == pe ) + goto _test_eof4; +case 4: + if ( (*p) == 118 ) + goto st5; + goto st0; +st5: + if ( ++p == pe ) + goto _test_eof5; +case 5: + if ( (*p) == 105 ) + goto st6; + goto st0; +st6: + if ( ++p == pe ) + goto _test_eof6; +case 6: + if ( (*p) == 99 ) + goto st7; + goto st0; +st7: + if ( ++p == pe ) + goto _test_eof7; +case 7: + if ( (*p) == 101 ) + goto st8; + goto st0; +st8: + if ( ++p == pe ) + goto _test_eof8; +case 8: + if ( (*p) == 45 ) + goto st9; + goto st0; +st9: + if ( ++p == pe ) + goto _test_eof9; +case 9: + if ( (*p) == 82 ) + goto st10; + goto st0; +st10: + if ( ++p == pe ) + goto _test_eof10; +case 10: + if ( (*p) == 111 ) + goto st11; + goto st0; +st11: + if ( ++p == pe ) + goto _test_eof11; +case 11: + if ( (*p) == 117 ) + goto st12; + goto st0; +st12: + if ( ++p == pe ) + goto _test_eof12; +case 12: + if ( (*p) == 116 ) + goto st13; + goto st0; +st13: + if ( ++p == pe ) + goto _test_eof13; +case 13: + if ( (*p) == 101 ) + goto st14; + goto st0; +st14: + if ( ++p == pe ) + goto _test_eof14; +case 14: + switch( (*p) ) { + case 9: goto st14; + case 32: goto st14; + case 58: goto st15; + } + goto st0; +tr15: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + goto st15; +tr35: +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st15; +tr45: +/* #line 83 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st15; +st15: + if ( ++p == pe ) + goto _test_eof15; +case 15: +/* #line 248 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto tr15; + case 13: goto tr16; + case 32: goto tr15; + case 33: goto tr17; + case 34: goto tr18; + case 37: goto tr17; + case 39: goto tr17; + case 60: goto tr19; + case 126: goto tr17; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr17; + } else if ( (*p) >= 42 ) + goto tr17; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr17; + } else if ( (*p) >= 65 ) + goto tr17; + } else + goto tr17; + goto st0; +tr16: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + goto st16; +st16: + if ( ++p == pe ) + goto _test_eof16; +case 16: +/* #line 288 "../src/headers/tsip_header_Service_Route.c" */ + if ( (*p) == 10 ) + goto st17; + goto st0; +st17: + if ( ++p == pe ) + goto _test_eof17; +case 17: + switch( (*p) ) { + case 9: goto st18; + case 32: goto st18; + } + goto st0; +tr22: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + goto st18; +st18: + if ( ++p == pe ) + goto _test_eof18; +case 18: +/* #line 314 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto tr22; + case 13: goto tr23; + case 32: goto tr22; + case 33: goto tr17; + case 34: goto tr18; + case 37: goto tr17; + case 39: goto tr17; + case 60: goto tr19; + case 126: goto tr17; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr17; + } else if ( (*p) >= 42 ) + goto tr17; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr17; + } else if ( (*p) >= 65 ) + goto tr17; + } else + goto tr17; + goto st0; +tr23: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + goto st19; +tr113: +/* #line 66 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_SET_STRING(curr_service->display_name); + } + } + goto st19; +st19: + if ( ++p == pe ) + goto _test_eof19; +case 19: +/* #line 363 "../src/headers/tsip_header_Service_Route.c" */ + if ( (*p) == 10 ) + goto st20; + goto st0; +st20: + if ( ++p == pe ) + goto _test_eof20; +case 20: + switch( (*p) ) { + case 9: goto st21; + case 32: goto st21; + } + goto st0; +st21: + if ( ++p == pe ) + goto _test_eof21; +case 21: + switch( (*p) ) { + case 9: goto st21; + case 32: goto st21; + case 60: goto st22; + } + goto st0; +tr19: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } + goto st22; +tr114: +/* #line 66 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_SET_STRING(curr_service->display_name); + } + } + goto st22; +st22: + if ( ++p == pe ) + goto _test_eof22; +case 22: +/* #line 408 "../src/headers/tsip_header_Service_Route.c" */ + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto tr27; + } else if ( (*p) >= 65 ) + goto tr27; + goto st0; +tr27: +/* #line 53 "tsip_parser_header_Service_Route.rl" */ + { + tag_start = p; + } + goto st23; +st23: + if ( ++p == pe ) + goto _test_eof23; +case 23: +/* #line 425 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st24; + case 32: goto st24; + case 43: goto st23; + case 58: goto st25; + } + if ( (*p) < 48 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st23; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 97 <= (*p) && (*p) <= 122 ) + goto st23; + } else if ( (*p) >= 65 ) + goto st23; + } else + goto st23; + goto st0; +st24: + if ( ++p == pe ) + goto _test_eof24; +case 24: + switch( (*p) ) { + case 9: goto st24; + case 32: goto st24; + case 58: goto st25; + } + goto st0; +st25: + if ( ++p == pe ) + goto _test_eof25; +case 25: + goto st26; +st26: + if ( ++p == pe ) + goto _test_eof26; +case 26: + if ( (*p) == 62 ) + goto tr32; + goto st26; +tr32: +/* #line 74 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service && !curr_service->uri) + { + int len = (int)(p - tag_start); + curr_service->uri = tsip_uri_parse(tag_start, (size_t)len); + } + } + goto st27; +tr33: +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st27; +st27: + if ( ++p == pe ) + goto _test_eof27; +case 27: +/* #line 489 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto tr33; + case 13: goto tr34; + case 32: goto tr33; + case 44: goto tr35; + case 59: goto st29; + } + goto st0; +tr34: +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st28; +tr43: +/* #line 83 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st28; +st28: + if ( ++p == pe ) + goto _test_eof28; +case 28: +/* #line 527 "../src/headers/tsip_header_Service_Route.c" */ + if ( (*p) == 10 ) + goto tr37; + goto st0; +tr37: +/* #line 99 "tsip_parser_header_Service_Route.rl" */ + { + } + goto st110; +st110: + if ( ++p == pe ) + goto _test_eof110; +case 110: +/* #line 540 "../src/headers/tsip_header_Service_Route.c" */ + goto st0; +tr46: +/* #line 83 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } + goto st29; +st29: + if ( ++p == pe ) + goto _test_eof29; +case 29: +/* #line 555 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st29; + case 13: goto st30; + case 32: goto st29; + case 33: goto tr39; + case 37: goto tr39; + case 39: goto tr39; + case 126: goto tr39; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr39; + } else if ( (*p) >= 42 ) + goto tr39; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr39; + } else if ( (*p) >= 65 ) + goto tr39; + } else + goto tr39; + goto st0; +st30: + if ( ++p == pe ) + goto _test_eof30; +case 30: + if ( (*p) == 10 ) + goto st31; + goto st0; +st31: + if ( ++p == pe ) + goto _test_eof31; +case 31: + switch( (*p) ) { + case 9: goto st32; + case 32: goto st32; + } + goto st0; +st32: + if ( ++p == pe ) + goto _test_eof32; +case 32: + switch( (*p) ) { + case 9: goto st32; + case 32: goto st32; + case 33: goto tr39; + case 37: goto tr39; + case 39: goto tr39; + case 126: goto tr39; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto tr39; + } else if ( (*p) >= 42 ) + goto tr39; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto tr39; + } else if ( (*p) >= 65 ) + goto tr39; + } else + goto tr39; + goto st0; +tr39: +/* #line 53 "tsip_parser_header_Service_Route.rl" */ + { + tag_start = p; + } + goto st33; +st33: + if ( ++p == pe ) + goto _test_eof33; +case 33: +/* #line 633 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto tr42; + case 13: goto tr43; + case 32: goto tr42; + case 33: goto st33; + case 37: goto st33; + case 39: goto st33; + case 44: goto tr45; + case 59: goto tr46; + case 61: goto st38; + case 126: goto st33; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st33; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st33; + } else if ( (*p) >= 65 ) + goto st33; + } else + goto st33; + goto st0; +tr42: +/* #line 83 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st34; +st34: + if ( ++p == pe ) + goto _test_eof34; +case 34: +/* #line 678 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st34; + case 13: goto st35; + case 32: goto st34; + case 44: goto st15; + case 59: goto st29; + case 61: goto st38; + } + goto st0; +st35: + if ( ++p == pe ) + goto _test_eof35; +case 35: + if ( (*p) == 10 ) + goto st36; + goto st0; +st36: + if ( ++p == pe ) + goto _test_eof36; +case 36: + switch( (*p) ) { + case 9: goto st37; + case 32: goto st37; + } + goto st0; +st37: + if ( ++p == pe ) + goto _test_eof37; +case 37: + switch( (*p) ) { + case 9: goto st37; + case 32: goto st37; + case 44: goto st15; + case 59: goto st29; + case 61: goto st38; + } + goto st0; +st38: + if ( ++p == pe ) + goto _test_eof38; +case 38: + switch( (*p) ) { + case 9: goto st38; + case 13: goto st39; + case 32: goto st38; + case 33: goto st59; + case 34: goto st45; + case 37: goto st59; + case 39: goto st59; + case 91: goto st60; + case 126: goto st59; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st59; + } else if ( (*p) >= 42 ) + goto st59; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st59; + } else if ( (*p) >= 65 ) + goto st59; + } else + goto st59; + goto st0; +st39: + if ( ++p == pe ) + goto _test_eof39; +case 39: + if ( (*p) == 10 ) + goto st40; + goto st0; +st40: + if ( ++p == pe ) + goto _test_eof40; +case 40: + switch( (*p) ) { + case 9: goto st41; + case 32: goto st41; + } + goto st0; +st41: + if ( ++p == pe ) + goto _test_eof41; +case 41: + switch( (*p) ) { + case 9: goto st41; + case 13: goto st42; + case 32: goto st41; + case 33: goto st59; + case 34: goto st45; + case 37: goto st59; + case 39: goto st59; + case 91: goto st60; + case 126: goto st59; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st59; + } else if ( (*p) >= 42 ) + goto st59; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st59; + } else if ( (*p) >= 65 ) + goto st59; + } else + goto st59; + goto st0; +st42: + if ( ++p == pe ) + goto _test_eof42; +case 42: + if ( (*p) == 10 ) + goto st43; + goto st0; +st43: + if ( ++p == pe ) + goto _test_eof43; +case 43: + switch( (*p) ) { + case 9: goto st44; + case 32: goto st44; + } + goto st0; +st44: + if ( ++p == pe ) + goto _test_eof44; +case 44: + switch( (*p) ) { + case 9: goto st44; + case 32: goto st44; + case 34: goto st45; + } + goto st0; +st45: + if ( ++p == pe ) + goto _test_eof45; +case 45: + switch( (*p) ) { + case 9: goto st45; + case 13: goto st51; + case 34: goto st53; + case 92: goto st58; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st47; + } else if ( (*p) >= -64 ) + goto st46; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st49; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st45; + } else + goto st50; + } else + goto st48; + goto st0; +st46: + if ( ++p == pe ) + goto _test_eof46; +case 46: + if ( (*p) <= -65 ) + goto st45; + goto st0; +st47: + if ( ++p == pe ) + goto _test_eof47; +case 47: + if ( (*p) <= -65 ) + goto st46; + goto st0; +st48: + if ( ++p == pe ) + goto _test_eof48; +case 48: + if ( (*p) <= -65 ) + goto st47; + goto st0; +st49: + if ( ++p == pe ) + goto _test_eof49; +case 49: + if ( (*p) <= -65 ) + goto st48; + goto st0; +st50: + if ( ++p == pe ) + goto _test_eof50; +case 50: + if ( (*p) <= -65 ) + goto st49; + goto st0; +st51: + if ( ++p == pe ) + goto _test_eof51; +case 51: + if ( (*p) == 10 ) + goto st52; + goto st0; +st52: + if ( ++p == pe ) + goto _test_eof52; +case 52: + switch( (*p) ) { + case 9: goto st45; + case 32: goto st45; + } + goto st0; +st53: + if ( ++p == pe ) + goto _test_eof53; +case 53: + switch( (*p) ) { + case 9: goto tr70; + case 13: goto tr43; + case 32: goto tr70; + case 44: goto tr45; + case 59: goto tr46; + } + goto st0; +tr70: +/* #line 83 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_ADD_PARAM(TSIP_HEADER_PARAMS(curr_service)); + } + } +/* #line 91 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + tsk_list_push_back_data(hdr_services, ((void**) &curr_service)); + } + } + goto st54; +st54: + if ( ++p == pe ) + goto _test_eof54; +case 54: +/* #line 929 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st54; + case 13: goto st55; + case 32: goto st54; + case 44: goto st15; + case 59: goto st29; + } + goto st0; +st55: + if ( ++p == pe ) + goto _test_eof55; +case 55: + if ( (*p) == 10 ) + goto st56; + goto st0; +st56: + if ( ++p == pe ) + goto _test_eof56; +case 56: + switch( (*p) ) { + case 9: goto st57; + case 32: goto st57; + } + goto st0; +st57: + if ( ++p == pe ) + goto _test_eof57; +case 57: + switch( (*p) ) { + case 9: goto st57; + case 32: goto st57; + case 44: goto st15; + case 59: goto st29; + } + goto st0; +st58: + if ( ++p == pe ) + goto _test_eof58; +case 58: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st45; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st45; + } else + goto st45; + goto st0; +st59: + if ( ++p == pe ) + goto _test_eof59; +case 59: + switch( (*p) ) { + case 9: goto tr70; + case 13: goto tr43; + case 32: goto tr70; + case 33: goto st59; + case 37: goto st59; + case 39: goto st59; + case 44: goto tr45; + case 59: goto tr46; + case 126: goto st59; + } + if ( (*p) < 48 ) { + if ( 42 <= (*p) && (*p) <= 46 ) + goto st59; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st59; + } else if ( (*p) >= 65 ) + goto st59; + } else + goto st59; + goto st0; +st60: + if ( ++p == pe ) + goto _test_eof60; +case 60: + if ( (*p) == 58 ) + goto st94; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st61; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st61; + } else + goto st61; + goto st0; +st61: + if ( ++p == pe ) + goto _test_eof61; +case 61: + switch( (*p) ) { + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st62; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st62; + } else + goto st62; + goto st0; +st62: + if ( ++p == pe ) + goto _test_eof62; +case 62: + switch( (*p) ) { + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st63; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st63; + } else + goto st63; + goto st0; +st63: + if ( ++p == pe ) + goto _test_eof63; +case 63: + switch( (*p) ) { + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st64; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st64; + } else + goto st64; + goto st0; +st64: + if ( ++p == pe ) + goto _test_eof64; +case 64: + switch( (*p) ) { + case 58: goto st65; + case 93: goto st53; + } + goto st0; +st65: + if ( ++p == pe ) + goto _test_eof65; +case 65: + if ( (*p) == 58 ) + goto st81; + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st66; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st61; + } else + goto st61; + goto st0; +st66: + if ( ++p == pe ) + goto _test_eof66; +case 66: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st79; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st62; + } else + goto st62; + goto st0; +st67: + if ( ++p == pe ) + goto _test_eof67; +case 67: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st68; + goto st0; +st68: + if ( ++p == pe ) + goto _test_eof68; +case 68: + if ( (*p) == 46 ) + goto st69; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st77; + goto st0; +st69: + if ( ++p == pe ) + goto _test_eof69; +case 69: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st70; + goto st0; +st70: + if ( ++p == pe ) + goto _test_eof70; +case 70: + if ( (*p) == 46 ) + goto st71; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st75; + goto st0; +st71: + if ( ++p == pe ) + goto _test_eof71; +case 71: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st72; + goto st0; +st72: + if ( ++p == pe ) + goto _test_eof72; +case 72: + if ( (*p) == 93 ) + goto st53; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st73; + goto st0; +st73: + if ( ++p == pe ) + goto _test_eof73; +case 73: + if ( (*p) == 93 ) + goto st53; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st74; + goto st0; +st74: + if ( ++p == pe ) + goto _test_eof74; +case 74: + if ( (*p) == 93 ) + goto st53; + goto st0; +st75: + if ( ++p == pe ) + goto _test_eof75; +case 75: + if ( (*p) == 46 ) + goto st71; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st76; + goto st0; +st76: + if ( ++p == pe ) + goto _test_eof76; +case 76: + if ( (*p) == 46 ) + goto st71; + goto st0; +st77: + if ( ++p == pe ) + goto _test_eof77; +case 77: + if ( (*p) == 46 ) + goto st69; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st78; + goto st0; +st78: + if ( ++p == pe ) + goto _test_eof78; +case 78: + if ( (*p) == 46 ) + goto st69; + goto st0; +st79: + if ( ++p == pe ) + goto _test_eof79; +case 79: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st80; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st63; + } else + goto st63; + goto st0; +st80: + if ( ++p == pe ) + goto _test_eof80; +case 80: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st65; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st64; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st64; + } else + goto st64; + goto st0; +st81: + if ( ++p == pe ) + goto _test_eof81; +case 81: + switch( (*p) ) { + case 58: goto st90; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st82; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st82; + } else + goto st82; + goto st0; +st82: + if ( ++p == pe ) + goto _test_eof82; +case 82: + switch( (*p) ) { + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st83; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st83; + } else + goto st83; + goto st0; +st83: + if ( ++p == pe ) + goto _test_eof83; +case 83: + switch( (*p) ) { + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st84; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st84; + } else + goto st84; + goto st0; +st84: + if ( ++p == pe ) + goto _test_eof84; +case 84: + switch( (*p) ) { + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st85; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st85; + } else + goto st85; + goto st0; +st85: + if ( ++p == pe ) + goto _test_eof85; +case 85: + switch( (*p) ) { + case 58: goto st86; + case 93: goto st53; + } + goto st0; +st86: + if ( ++p == pe ) + goto _test_eof86; +case 86: + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st87; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st82; + } else + goto st82; + goto st0; +st87: + if ( ++p == pe ) + goto _test_eof87; +case 87: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st88; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st83; + } else + goto st83; + goto st0; +st88: + if ( ++p == pe ) + goto _test_eof88; +case 88: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st89; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st84; + } else + goto st84; + goto st0; +st89: + if ( ++p == pe ) + goto _test_eof89; +case 89: + switch( (*p) ) { + case 46: goto st67; + case 58: goto st86; + case 93: goto st53; + } + if ( (*p) < 65 ) { + if ( 48 <= (*p) && (*p) <= 57 ) + goto st85; + } else if ( (*p) > 70 ) { + if ( 97 <= (*p) && (*p) <= 102 ) + goto st85; + } else + goto st85; + goto st0; +st90: + if ( ++p == pe ) + goto _test_eof90; +case 90: + if ( 48 <= (*p) && (*p) <= 57 ) + goto st91; + goto st0; +st91: + if ( ++p == pe ) + goto _test_eof91; +case 91: + if ( (*p) == 46 ) + goto st67; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st92; + goto st0; +st92: + if ( ++p == pe ) + goto _test_eof92; +case 92: + if ( (*p) == 46 ) + goto st67; + if ( 48 <= (*p) && (*p) <= 57 ) + goto st93; + goto st0; +st93: + if ( ++p == pe ) + goto _test_eof93; +case 93: + if ( (*p) == 46 ) + goto st67; + goto st0; +st94: + if ( ++p == pe ) + goto _test_eof94; +case 94: + if ( (*p) == 58 ) + goto st81; + goto st0; +tr17: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Service_Route.rl" */ + { + tag_start = p; + } + goto st95; +st95: + if ( ++p == pe ) + goto _test_eof95; +case 95: +/* #line 1445 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st96; + case 13: goto st98; + case 32: goto st96; + case 33: goto st95; + case 37: goto st95; + case 39: goto st95; + case 126: goto st95; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st95; + } else if ( (*p) >= 42 ) + goto st95; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st95; + } else if ( (*p) >= 65 ) + goto st95; + } else + goto st95; + goto st0; +st96: + if ( ++p == pe ) + goto _test_eof96; +case 96: + switch( (*p) ) { + case 9: goto tr112; + case 13: goto tr113; + case 32: goto tr112; + case 33: goto st95; + case 37: goto st95; + case 39: goto st95; + case 60: goto tr114; + case 126: goto st95; + } + if ( (*p) < 48 ) { + if ( (*p) > 43 ) { + if ( 45 <= (*p) && (*p) <= 46 ) + goto st95; + } else if ( (*p) >= 42 ) + goto st95; + } else if ( (*p) > 57 ) { + if ( (*p) > 90 ) { + if ( 95 <= (*p) && (*p) <= 122 ) + goto st95; + } else if ( (*p) >= 65 ) + goto st95; + } else + goto st95; + goto st0; +tr112: +/* #line 66 "tsip_parser_header_Service_Route.rl" */ + { + if(curr_service) + { + PARSER_SET_STRING(curr_service->display_name); + } + } + goto st97; +st97: + if ( ++p == pe ) + goto _test_eof97; +case 97: +/* #line 1512 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st97; + case 13: goto st19; + case 32: goto st97; + case 60: goto st22; + } + goto st0; +st98: + if ( ++p == pe ) + goto _test_eof98; +case 98: + if ( (*p) == 10 ) + goto st99; + goto st0; +st99: + if ( ++p == pe ) + goto _test_eof99; +case 99: + switch( (*p) ) { + case 9: goto st96; + case 32: goto st96; + } + goto st0; +tr18: +/* #line 58 "tsip_parser_header_Service_Route.rl" */ + { + if(!curr_service) + { + curr_service = TSIP_HEADER_SERVICE_ROUTE_CREATE(); + } + } +/* #line 53 "tsip_parser_header_Service_Route.rl" */ + { + tag_start = p; + } + goto st100; +st100: + if ( ++p == pe ) + goto _test_eof100; +case 100: +/* #line 1553 "../src/headers/tsip_header_Service_Route.c" */ + switch( (*p) ) { + case 9: goto st100; + case 13: goto st106; + case 34: goto st108; + case 92: goto st109; + } + if ( (*p) < -16 ) { + if ( (*p) > -33 ) { + if ( -32 <= (*p) && (*p) <= -17 ) + goto st102; + } else if ( (*p) >= -64 ) + goto st101; + } else if ( (*p) > -9 ) { + if ( (*p) < -4 ) { + if ( -8 <= (*p) && (*p) <= -5 ) + goto st104; + } else if ( (*p) > -3 ) { + if ( 32 <= (*p) && (*p) <= 126 ) + goto st100; + } else + goto st105; + } else + goto st103; + goto st0; +st101: + if ( ++p == pe ) + goto _test_eof101; +case 101: + if ( (*p) <= -65 ) + goto st100; + goto st0; +st102: + if ( ++p == pe ) + goto _test_eof102; +case 102: + if ( (*p) <= -65 ) + goto st101; + goto st0; +st103: + if ( ++p == pe ) + goto _test_eof103; +case 103: + if ( (*p) <= -65 ) + goto st102; + goto st0; +st104: + if ( ++p == pe ) + goto _test_eof104; +case 104: + if ( (*p) <= -65 ) + goto st103; + goto st0; +st105: + if ( ++p == pe ) + goto _test_eof105; +case 105: + if ( (*p) <= -65 ) + goto st104; + goto st0; +st106: + if ( ++p == pe ) + goto _test_eof106; +case 106: + if ( (*p) == 10 ) + goto st107; + goto st0; +st107: + if ( ++p == pe ) + goto _test_eof107; +case 107: + switch( (*p) ) { + case 9: goto st100; + case 32: goto st100; + } + goto st0; +st108: + if ( ++p == pe ) + goto _test_eof108; +case 108: + switch( (*p) ) { + case 9: goto tr112; + case 13: goto tr113; + case 32: goto tr112; + case 60: goto tr114; + } + goto st0; +st109: + if ( ++p == pe ) + goto _test_eof109; +case 109: + if ( (*p) < 11 ) { + if ( 0 <= (*p) && (*p) <= 9 ) + goto st100; + } else if ( (*p) > 12 ) { + if ( 14 <= (*p) ) + goto st100; + } else + goto st100; + goto st0; + } + _test_eof2: cs = 2; goto _test_eof; + _test_eof3: cs = 3; goto _test_eof; + _test_eof4: cs = 4; goto _test_eof; + _test_eof5: cs = 5; goto _test_eof; + _test_eof6: cs = 6; goto _test_eof; + _test_eof7: cs = 7; goto _test_eof; + _test_eof8: cs = 8; goto _test_eof; + _test_eof9: cs = 9; goto _test_eof; + _test_eof10: cs = 10; goto _test_eof; + _test_eof11: cs = 11; goto _test_eof; + _test_eof12: cs = 12; goto _test_eof; + _test_eof13: cs = 13; goto _test_eof; + _test_eof14: cs = 14; goto _test_eof; + _test_eof15: cs = 15; goto _test_eof; + _test_eof16: cs = 16; goto _test_eof; + _test_eof17: cs = 17; goto _test_eof; + _test_eof18: cs = 18; goto _test_eof; + _test_eof19: cs = 19; goto _test_eof; + _test_eof20: cs = 20; goto _test_eof; + _test_eof21: cs = 21; goto _test_eof; + _test_eof22: cs = 22; goto _test_eof; + _test_eof23: cs = 23; goto _test_eof; + _test_eof24: cs = 24; goto _test_eof; + _test_eof25: cs = 25; goto _test_eof; + _test_eof26: cs = 26; goto _test_eof; + _test_eof27: cs = 27; goto _test_eof; + _test_eof28: cs = 28; goto _test_eof; + _test_eof110: cs = 110; goto _test_eof; + _test_eof29: cs = 29; goto _test_eof; + _test_eof30: cs = 30; goto _test_eof; + _test_eof31: cs = 31; goto _test_eof; + _test_eof32: cs = 32; goto _test_eof; + _test_eof33: cs = 33; goto _test_eof; + _test_eof34: cs = 34; goto _test_eof; + _test_eof35: cs = 35; goto _test_eof; + _test_eof36: cs = 36; goto _test_eof; + _test_eof37: cs = 37; goto _test_eof; + _test_eof38: cs = 38; goto _test_eof; + _test_eof39: cs = 39; goto _test_eof; + _test_eof40: cs = 40; goto _test_eof; + _test_eof41: cs = 41; goto _test_eof; + _test_eof42: cs = 42; goto _test_eof; + _test_eof43: cs = 43; goto _test_eof; + _test_eof44: cs = 44; goto _test_eof; + _test_eof45: cs = 45; goto _test_eof; + _test_eof46: cs = 46; goto _test_eof; + _test_eof47: cs = 47; goto _test_eof; + _test_eof48: cs = 48; goto _test_eof; + _test_eof49: cs = 49; goto _test_eof; + _test_eof50: cs = 50; goto _test_eof; + _test_eof51: cs = 51; goto _test_eof; + _test_eof52: cs = 52; goto _test_eof; + _test_eof53: cs = 53; goto _test_eof; + _test_eof54: cs = 54; goto _test_eof; + _test_eof55: cs = 55; goto _test_eof; + _test_eof56: cs = 56; goto _test_eof; + _test_eof57: cs = 57; goto _test_eof; + _test_eof58: cs = 58; goto _test_eof; + _test_eof59: cs = 59; goto _test_eof; + _test_eof60: cs = 60; goto _test_eof; + _test_eof61: cs = 61; goto _test_eof; + _test_eof62: cs = 62; goto _test_eof; + _test_eof63: cs = 63; goto _test_eof; + _test_eof64: cs = 64; goto _test_eof; + _test_eof65: cs = 65; goto _test_eof; + _test_eof66: cs = 66; goto _test_eof; + _test_eof67: cs = 67; goto _test_eof; + _test_eof68: cs = 68; goto _test_eof; + _test_eof69: cs = 69; goto _test_eof; + _test_eof70: cs = 70; goto _test_eof; + _test_eof71: cs = 71; goto _test_eof; + _test_eof72: cs = 72; goto _test_eof; + _test_eof73: cs = 73; goto _test_eof; + _test_eof74: cs = 74; goto _test_eof; + _test_eof75: cs = 75; goto _test_eof; + _test_eof76: cs = 76; goto _test_eof; + _test_eof77: cs = 77; goto _test_eof; + _test_eof78: cs = 78; goto _test_eof; + _test_eof79: cs = 79; goto _test_eof; + _test_eof80: cs = 80; goto _test_eof; + _test_eof81: cs = 81; goto _test_eof; + _test_eof82: cs = 82; goto _test_eof; + _test_eof83: cs = 83; goto _test_eof; + _test_eof84: cs = 84; goto _test_eof; + _test_eof85: cs = 85; goto _test_eof; + _test_eof86: cs = 86; goto _test_eof; + _test_eof87: cs = 87; goto _test_eof; + _test_eof88: cs = 88; goto _test_eof; + _test_eof89: cs = 89; goto _test_eof; + _test_eof90: cs = 90; goto _test_eof; + _test_eof91: cs = 91; goto _test_eof; + _test_eof92: cs = 92; goto _test_eof; + _test_eof93: cs = 93; goto _test_eof; + _test_eof94: cs = 94; goto _test_eof; + _test_eof95: cs = 95; goto _test_eof; + _test_eof96: cs = 96; goto _test_eof; + _test_eof97: cs = 97; goto _test_eof; + _test_eof98: cs = 98; goto _test_eof; + _test_eof99: cs = 99; goto _test_eof; + _test_eof100: cs = 100; goto _test_eof; + _test_eof101: cs = 101; goto _test_eof; + _test_eof102: cs = 102; goto _test_eof; + _test_eof103: cs = 103; goto _test_eof; + _test_eof104: cs = 104; goto _test_eof; + _test_eof105: cs = 105; goto _test_eof; + _test_eof106: cs = 106; goto _test_eof; + _test_eof107: cs = 107; goto _test_eof; + _test_eof108: cs = 108; goto _test_eof; + _test_eof109: cs = 109; goto _test_eof; + + _test_eof: {} + _out: {} + } + +/* #line 152 "tsip_parser_header_Service_Route.rl" */ + + if( cs < +/* #line 1771 "../src/headers/tsip_header_Service_Route.c" */ +110 +/* #line 153 "tsip_parser_header_Service_Route.rl" */ + ) + { + TSK_OBJECT_SAFE_FREE(curr_service); + TSK_OBJECT_SAFE_FREE(hdr_services); + } + + return hdr_services; +} + + + + + +//======================================================== +// Service_Route header object definition +// + +/**@ingroup tsip_header_Service_Route_group +*/ +static void* tsip_header_Service_Route_create(void *self, va_list * app) +{ + tsip_header_Service_Route_t *Service_Route = self; + if(Service_Route) + { + TSIP_HEADER(Service_Route)->type = tsip_htype_Service_Route; + TSIP_HEADER(Service_Route)->tostring = tsip_header_Service_Route_tostring; + } + else + { + TSK_DEBUG_ERROR("Failed to create new Service_Route header."); + } + return self; +} + +/**@ingroup tsip_header_Service_Route_group +*/ +static void* tsip_header_Service_Route_destroy(void *self) +{ + tsip_header_Service_Route_t *Service_Route = self; + if(Service_Route) + { + TSK_FREE(Service_Route->display_name); + TSK_OBJECT_SAFE_FREE(Service_Route->uri); + + TSK_OBJECT_SAFE_FREE(TSIP_HEADER_PARAMS(Service_Route)); + } + else TSK_DEBUG_ERROR("Null Service_Route header."); + + return self; +} + +static const tsk_object_def_t tsip_header_Service_Route_def_s = +{ + sizeof(tsip_header_Service_Route_t), + tsip_header_Service_Route_create, + tsip_header_Service_Route_destroy, + 0 +}; +const void *tsip_header_Service_Route_def_t = &tsip_header_Service_Route_def_s; \ No newline at end of file diff --git a/trunk/tinySIP/src/parsers/tsip_parser_header.c b/trunk/tinySIP/src/parsers/tsip_parser_header.c index e94367e8..64627450 100644 --- a/trunk/tinySIP/src/parsers/tsip_parser_header.c +++ b/trunk/tinySIP/src/parsers/tsip_parser_header.c @@ -41,13 +41,16 @@ #include "tinysip/headers/tsip_header_From.h" #include "tinysip/headers/tsip_header_Max_Forwards.h" #include "tinysip/headers/tsip_header_Min_Expires.h" -#include "tinysip/headers/tsip_header_P_Preferred_Identity.h" +#include "tinysip/headers/tsip_header_Path.h" #include "tinysip/headers/tsip_header_P_Access_Network_Info.h" +#include "tinysip/headers/tsip_header_P_Preferred_Identity.h" #include "tinysip/headers/tsip_header_Privacy.h" #include "tinysip/headers/tsip_header_Proxy_Authenticate.h" #include "tinysip/headers/tsip_header_Proxy_Authorization.h" #include "tinysip/headers/tsip_header_Record_Route.h" #include "tinysip/headers/tsip_header_Require.h" +#include "tinysip/headers/tsip_header_Route.h" +#include "tinysip/headers/tsip_header_Service_Route.h" #include "tinysip/headers/tsip_header_Supported.h" #include "tinysip/headers/tsip_header_To.h" #include "tinysip/headers/tsip_header_User_Agent.h" @@ -60,7 +63,7 @@ * Ragel state machine. */ -/* #line 739 "tsip_parser_header.rl" */ +/* #line 775 "tsip_parser_header.rl" */ TSIP_BOOLEAN tsip_header_parse(tsip_ragel_state_t *state, tsip_message_t *message) @@ -71,7 +74,7 @@ TSIP_BOOLEAN tsip_header_parse(tsip_ragel_state_t *state, tsip_message_t *messag const char *eof = pe; -/* #line 75 "../source/parsers/tsip_parser_header.c" */ +/* #line 78 "../src/parsers/tsip_parser_header.c" */ static const int tsip_machine_parser_headers_start = 1; static const int tsip_machine_parser_headers_first_final = 1306; static const int tsip_machine_parser_headers_error = 0; @@ -79,16 +82,16 @@ static const int tsip_machine_parser_headers_error = 0; static const int tsip_machine_parser_headers_en_main = 1; -/* #line 749 "tsip_parser_header.rl" */ +/* #line 785 "tsip_parser_header.rl" */ -/* #line 85 "../source/parsers/tsip_parser_header.c" */ +/* #line 88 "../src/parsers/tsip_parser_header.c" */ { cs = tsip_machine_parser_headers_start; } -/* #line 750 "tsip_parser_header.rl" */ +/* #line 786 "tsip_parser_header.rl" */ -/* #line 92 "../source/parsers/tsip_parser_header.c" */ +/* #line 95 "../src/parsers/tsip_parser_header.c" */ { if ( p == pe ) goto _test_eof; @@ -236,43 +239,43 @@ case 11: goto tr50; goto st0; tr50: -/* #line 66 "tsip_parser_header.rl" */ +/* #line 69 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Accept NOT IMPLEMENTED"); } goto st1306; tr66: -/* #line 72 "tsip_parser_header.rl" */ +/* #line 75 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Accept_Contact NOT IMPLEMENTED"); } goto st1306; tr79: -/* #line 78 "tsip_parser_header.rl" */ +/* #line 81 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Accept_Encoding NOT IMPLEMENTED"); } goto st1306; tr92: -/* #line 84 "tsip_parser_header.rl" */ +/* #line 87 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Accept_Language NOT IMPLEMENTED"); } goto st1306; tr114: -/* #line 90 "tsip_parser_header.rl" */ +/* #line 93 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Accept_Resource_Priority NOT IMPLEMENTED"); } goto st1306; tr129: -/* #line 96 "tsip_parser_header.rl" */ +/* #line 99 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Alert_Info NOT IMPLEMENTED"); } goto st1306; tr139: -/* #line 102 "tsip_parser_header.rl" */ +/* #line 105 "tsip_parser_header.rl" */ { tsip_header_Allow_t *header = tsip_header_Allow_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -282,7 +285,7 @@ tr139: } goto st1306; tr151: -/* #line 112 "tsip_parser_header.rl" */ +/* #line 115 "tsip_parser_header.rl" */ { tsip_header_Allow_Events_t *header = tsip_header_Allow_Events_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -292,13 +295,13 @@ tr151: } goto st1306; tr175: -/* #line 122 "tsip_parser_header.rl" */ +/* #line 125 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Authentication_Info NOT IMPLEMENTED"); } goto st1306; tr189: -/* #line 128 "tsip_parser_header.rl" */ +/* #line 131 "tsip_parser_header.rl" */ { tsip_header_Authorization_t *header = tsip_header_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -308,7 +311,7 @@ tr189: } goto st1306; tr204: -/* #line 138 "tsip_parser_header.rl" */ +/* #line 141 "tsip_parser_header.rl" */ { if(!message->Call_ID) { @@ -317,13 +320,13 @@ tr204: } goto st1306; tr212: -/* #line 147 "tsip_parser_header.rl" */ +/* #line 150 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Call_Info NOT IMPLEMENTED"); } goto st1306; tr224: -/* #line 153 "tsip_parser_header.rl" */ +/* #line 156 "tsip_parser_header.rl" */ { tsip_header_Contacts_L_t* headers = tsip_header_Contact_parse(state->tag_start, (state->tag_end-state->tag_start)); if(headers) @@ -347,25 +350,25 @@ tr224: } goto st1306; tr247: -/* #line 177 "tsip_parser_header.rl" */ +/* #line 180 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Content_Disposition NOT IMPLEMENTED"); } goto st1306; tr260: -/* #line 183 "tsip_parser_header.rl" */ +/* #line 186 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("PARSE_HEADER_ACCEPT NOT IMPLEMENTED"); } goto st1306; tr274: -/* #line 189 "tsip_parser_header.rl" */ +/* #line 192 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Content_Language NOT IMPLEMENTED"); } goto st1306; tr283: -/* #line 195 "tsip_parser_header.rl" */ +/* #line 198 "tsip_parser_header.rl" */ { if(!message->Content_Length) { @@ -374,7 +377,7 @@ tr283: } goto st1306; tr292: -/* #line 204 "tsip_parser_header.rl" */ +/* #line 207 "tsip_parser_header.rl" */ { if(!message->Content_Type) { @@ -383,7 +386,7 @@ tr292: } goto st1306; tr300: -/* #line 213 "tsip_parser_header.rl" */ +/* #line 216 "tsip_parser_header.rl" */ { if(!message->CSeq) { @@ -392,25 +395,25 @@ tr300: } goto st1306; tr309: -/* #line 222 "tsip_parser_header.rl" */ +/* #line 225 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Date NOT IMPLEMENTED"); } goto st1306; tr326: -/* #line 228 "tsip_parser_header.rl" */ +/* #line 231 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Error_Info NOT IMPLEMENTED"); } goto st1306; tr335: -/* #line 234 "tsip_parser_header.rl" */ +/* #line 237 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Event NOT IMPLEMENTED"); } goto st1306; tr346: -/* #line 240 "tsip_parser_header.rl" */ +/* #line 243 "tsip_parser_header.rl" */ { if(!message->Expires) { @@ -419,7 +422,7 @@ tr346: } goto st1306; tr355: -/* #line 249 "tsip_parser_header.rl" */ +/* #line 252 "tsip_parser_header.rl" */ { if(!message->From) { @@ -428,37 +431,37 @@ tr355: } goto st1306; tr372: -/* #line 258 "tsip_parser_header.rl" */ +/* #line 261 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_History_Info NOT IMPLEMENTED"); } goto st1306; tr387: -/* #line 264 "tsip_parser_header.rl" */ +/* #line 267 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Identity NOT IMPLEMENTED"); } goto st1306; tr396: -/* #line 270 "tsip_parser_header.rl" */ +/* #line 273 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Identity_Info NOT IMPLEMENTED"); } goto st1306; tr411: -/* #line 276 "tsip_parser_header.rl" */ +/* #line 279 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_In_Reply_To NOT IMPLEMENTED"); } goto st1306; tr420: -/* #line 282 "tsip_parser_header.rl" */ +/* #line 285 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Join NOT IMPLEMENTED"); } goto st1306; tr438: -/* #line 288 "tsip_parser_header.rl" */ +/* #line 291 "tsip_parser_header.rl" */ { tsip_header_Max_Forwards_t *header = tsip_header_Max_Forwards_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -468,13 +471,13 @@ tr438: } goto st1306; tr455: -/* #line 298 "tsip_parser_header.rl" */ +/* #line 301 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_MIME_Version NOT IMPLEMENTED"); } goto st1306; tr470: -/* #line 304 "tsip_parser_header.rl" */ +/* #line 307 "tsip_parser_header.rl" */ { tsip_header_Min_Expires_t *header = tsip_header_Min_Expires_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -484,19 +487,19 @@ tr470: } goto st1306; tr477: -/* #line 314 "tsip_parser_header.rl" */ +/* #line 317 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Min_SE NOT IMPLEMENTED"); } goto st1306; tr494: -/* #line 320 "tsip_parser_header.rl" */ +/* #line 323 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Organization NOT IMPLEMENTED"); } goto st1306; tr531: -/* #line 326 "tsip_parser_header.rl" */ +/* #line 329 "tsip_parser_header.rl" */ { tsip_header_P_Access_Network_Info_t *header = tsip_header_P_Access_Network_Info_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -506,85 +509,85 @@ tr531: } goto st1306; tr547: -/* #line 336 "tsip_parser_header.rl" */ +/* #line 339 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Answer_State NOT IMPLEMENTED"); } goto st1306; tr569: -/* #line 342 "tsip_parser_header.rl" */ +/* #line 345 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Asserted_Identity NOT IMPLEMENTED"); } goto st1306; tr585: -/* #line 348 "tsip_parser_header.rl" */ +/* #line 351 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Associated_URI NOT IMPLEMENTED"); } goto st1306; tr606: -/* #line 354 "tsip_parser_header.rl" */ +/* #line 357 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Called_Party_ID NOT IMPLEMENTED"); } goto st1306; tr638: -/* #line 360 "tsip_parser_header.rl" */ +/* #line 363 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Charging_Function_Addresses NOT IMPLEMENTED"); } goto st1306; tr649: -/* #line 366 "tsip_parser_header.rl" */ +/* #line 369 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Charging_Vector NOT IMPLEMENTED"); } goto st1306; tr674: -/* #line 372 "tsip_parser_header.rl" */ +/* #line 375 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_DCS_Billing_Info NOT IMPLEMENTED"); } goto st1306; tr683: -/* #line 378 "tsip_parser_header.rl" */ +/* #line 381 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_DCS_LAES NOT IMPLEMENTED"); } goto st1306; tr692: -/* #line 384 "tsip_parser_header.rl" */ +/* #line 387 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_DCS_OSPS NOT IMPLEMENTED"); } goto st1306; tr705: -/* #line 390 "tsip_parser_header.rl" */ +/* #line 393 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_DCS_Redirect NOT IMPLEMENTED"); } goto st1306; tr724: -/* #line 396 "tsip_parser_header.rl" */ +/* #line 399 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_DCS_Trace_Party_ID NOT IMPLEMENTED"); } goto st1306; tr740: -/* #line 402 "tsip_parser_header.rl" */ +/* #line 405 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Early_Media NOT IMPLEMENTED"); } goto st1306; tr764: -/* #line 408 "tsip_parser_header.rl" */ +/* #line 411 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Media_Authorization NOT IMPLEMENTED"); } goto st1306; tr788: -/* #line 414 "tsip_parser_header.rl" */ +/* #line 417 "tsip_parser_header.rl" */ { tsip_header_P_Preferred_Identity_t *header = tsip_header_P_Preferred_Identity_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -594,37 +597,48 @@ tr788: } goto st1306; tr802: -/* #line 424 "tsip_parser_header.rl" */ +/* #line 427 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Profile_Key NOT IMPLEMENTED"); } goto st1306; tr820: -/* #line 430 "tsip_parser_header.rl" */ +/* #line 433 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_User_Database NOT IMPLEMENTED"); } goto st1306; tr843: -/* #line 436 "tsip_parser_header.rl" */ +/* #line 439 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_P_Visited_Network_ID NOT IMPLEMENTED"); } goto st1306; tr851: -/* #line 442 "tsip_parser_header.rl" */ +/* #line 445 "tsip_parser_header.rl" */ { - TSK_DEBUG_ERROR("parse_header_Path NOT IMPLEMENTED"); + tsip_header_Paths_L_t* headers = tsip_header_Path_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } goto st1306; tr865: -/* #line 448 "tsip_parser_header.rl" */ +/* #line 462 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Priority NOT IMPLEMENTED"); } goto st1306; tr874: -/* #line 454 "tsip_parser_header.rl" */ +/* #line 468 "tsip_parser_header.rl" */ { tsip_header_Privacy_t *header = tsip_header_Privacy_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -634,7 +648,7 @@ tr874: } goto st1306; tr897: -/* #line 464 "tsip_parser_header.rl" */ +/* #line 478 "tsip_parser_header.rl" */ { tsip_header_Proxy_Authenticate_t *header = tsip_header_Proxy_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -644,7 +658,7 @@ tr897: } goto st1306; tr911: -/* #line 474 "tsip_parser_header.rl" */ +/* #line 488 "tsip_parser_header.rl" */ { tsip_header_Proxy_Authorization_t *header = tsip_header_Proxy_Authorization_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -654,25 +668,25 @@ tr911: } goto st1306; tr923: -/* #line 484 "tsip_parser_header.rl" */ +/* #line 498 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Proxy_Require NOT IMPLEMENTED"); } goto st1306; tr935: -/* #line 490 "tsip_parser_header.rl" */ +/* #line 504 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_RAck NOT IMPLEMENTED"); } goto st1306; tr952: -/* #line 496 "tsip_parser_header.rl" */ +/* #line 510 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Reason NOT IMPLEMENTED"); } goto st1306; tr967: -/* #line 502 "tsip_parser_header.rl" */ +/* #line 516 "tsip_parser_header.rl" */ { tsip_header_Record_Route_t *header = tsip_header_Record_Route_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -682,49 +696,49 @@ tr967: } goto st1306; tr980: -/* #line 518 "tsip_parser_header.rl" */ +/* #line 532 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Refer_To NOT IMPLEMENTED"); } goto st1306; tr990: -/* #line 524 "tsip_parser_header.rl" */ +/* #line 538 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Referred_By NOT IMPLEMENTED"); } goto st1306; tr999: -/* #line 512 "tsip_parser_header.rl" */ +/* #line 526 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Refer_Sub NOT IMPLEMENTED"); } goto st1306; tr1016: -/* #line 530 "tsip_parser_header.rl" */ +/* #line 544 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Reject_Contact NOT IMPLEMENTED"); } goto st1306; tr1028: -/* #line 536 "tsip_parser_header.rl" */ +/* #line 550 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Replaces NOT IMPLEMENTED"); } goto st1306; tr1037: -/* #line 542 "tsip_parser_header.rl" */ +/* #line 556 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Reply_To NOT IMPLEMENTED"); } goto st1306; tr1060: -/* #line 548 "tsip_parser_header.rl" */ +/* #line 562 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Request_Disposition NOT IMPLEMENTED"); } goto st1306; tr1068: -/* #line 554 "tsip_parser_header.rl" */ +/* #line 568 "tsip_parser_header.rl" */ { tsip_header_Require_t *header = tsip_header_Require_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -734,91 +748,113 @@ tr1068: } goto st1306; tr1088: -/* #line 564 "tsip_parser_header.rl" */ +/* #line 578 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Resource_Priority NOT IMPLEMENTED"); } goto st1306; tr1102: -/* #line 570 "tsip_parser_header.rl" */ +/* #line 584 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Retry_After NOT IMPLEMENTED"); } goto st1306; tr1111: -/* #line 576 "tsip_parser_header.rl" */ +/* #line 590 "tsip_parser_header.rl" */ { - TSK_DEBUG_ERROR("parse_header_Route NOT IMPLEMENTED"); + tsip_header_Routes_L_t* headers = tsip_header_Route_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } goto st1306; tr1119: -/* #line 582 "tsip_parser_header.rl" */ +/* #line 607 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_RSeq NOT IMPLEMENTED"); } goto st1306; tr1145: -/* #line 588 "tsip_parser_header.rl" */ +/* #line 613 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Security_Client NOT IMPLEMENTED"); } goto st1306; tr1156: -/* #line 594 "tsip_parser_header.rl" */ +/* #line 619 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Security_Server NOT IMPLEMENTED"); } goto st1306; tr1167: -/* #line 600 "tsip_parser_header.rl" */ +/* #line 625 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Security_Verify NOT IMPLEMENTED"); } goto st1306; tr1177: -/* #line 606 "tsip_parser_header.rl" */ +/* #line 631 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Server NOT IMPLEMENTED"); } goto st1306; tr1191: -/* #line 612 "tsip_parser_header.rl" */ +/* #line 637 "tsip_parser_header.rl" */ { - TSK_DEBUG_ERROR("parse_header_Service_Route NOT IMPLEMENTED"); + tsip_header_Service_Routes_L_t* headers = tsip_header_Service_Route_parse(state->tag_start, (state->tag_end-state->tag_start)); + if(headers) + { + tsk_list_item_t *item; + tsk_list_foreach(item, headers) + { + tsip_header_Service_Route_t *hdr = tsk_object_ref(item->data); + tsk_list_push_back_data(message->headers, ((void**) &hdr)); + } + + TSK_OBJECT_SAFE_FREE(headers); + } } goto st1306; tr1208: -/* #line 618 "tsip_parser_header.rl" */ +/* #line 654 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Session_Expires NOT IMPLEMENTED"); } goto st1306; tr1221: -/* #line 624 "tsip_parser_header.rl" */ +/* #line 660 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_SIP_ETag NOT IMPLEMENTED"); } goto st1306; tr1234: -/* #line 630 "tsip_parser_header.rl" */ +/* #line 666 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_SIP_If_Match NOT IMPLEMENTED"); } goto st1306; tr1247: -/* #line 636 "tsip_parser_header.rl" */ +/* #line 672 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Subject NOT IMPLEMENTED"); } goto st1306; tr1267: -/* #line 642 "tsip_parser_header.rl" */ +/* #line 678 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("PARSE_HEADER_ACCEPT NOT IMPLEMENTED"); } goto st1306; tr1278: -/* #line 648 "tsip_parser_header.rl" */ +/* #line 684 "tsip_parser_header.rl" */ { tsip_header_Supported_t *header = tsip_header_Supported_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -828,19 +864,19 @@ tr1278: } goto st1306; tr1298: -/* #line 658 "tsip_parser_header.rl" */ +/* #line 694 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Target_Dialog NOT IMPLEMENTED"); } goto st1306; tr1311: -/* #line 664 "tsip_parser_header.rl" */ +/* #line 700 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Timestamp NOT IMPLEMENTED"); } goto st1306; tr1317: -/* #line 670 "tsip_parser_header.rl" */ +/* #line 706 "tsip_parser_header.rl" */ { if(!message->To) { @@ -849,13 +885,13 @@ tr1317: } goto st1306; tr1334: -/* #line 679 "tsip_parser_header.rl" */ +/* #line 715 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Unsupported NOT IMPLEMENTED"); } goto st1306; tr1348: -/* #line 685 "tsip_parser_header.rl" */ +/* #line 721 "tsip_parser_header.rl" */ { tsip_header_User_Agent_t *header = tsip_header_User_Agent_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -865,7 +901,7 @@ tr1348: } goto st1306; tr1356: -/* #line 695 "tsip_parser_header.rl" */ +/* #line 731 "tsip_parser_header.rl" */ { if(!message->firstVia) { @@ -882,13 +918,13 @@ tr1356: } goto st1306; tr1369: -/* #line 712 "tsip_parser_header.rl" */ +/* #line 748 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Warning NOT IMPLEMENTED"); } goto st1306; tr1389: -/* #line 718 "tsip_parser_header.rl" */ +/* #line 754 "tsip_parser_header.rl" */ { tsip_header_WWW_Authenticate_t *header = tsip_header_WWW_Authenticate_parse(state->tag_start, (state->tag_end-state->tag_start)); if(header) @@ -898,11 +934,11 @@ tr1389: } goto st1306; tr1396: -/* #line 183 "tsip_parser_header.rl" */ +/* #line 186 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("PARSE_HEADER_ACCEPT NOT IMPLEMENTED"); } -/* #line 234 "tsip_parser_header.rl" */ +/* #line 237 "tsip_parser_header.rl" */ { TSK_DEBUG_ERROR("parse_header_Event NOT IMPLEMENTED"); } @@ -911,7 +947,7 @@ st1306: if ( ++p == pe ) goto _test_eof1306; case 1306: -/* #line 915 "../source/parsers/tsip_parser_header.c" */ +/* #line 951 "../src/parsers/tsip_parser_header.c" */ goto st0; st12: if ( ++p == pe ) @@ -13614,7 +13650,7 @@ case 1305: _out: {} } -/* #line 751 "tsip_parser_header.rl" */ +/* #line 787 "tsip_parser_header.rl" */ return (cs == tsip_machine_parser_headers_first_final); } \ No newline at end of file diff --git a/trunk/tinySIP/src/parsers/tsip_parser_uri.c b/trunk/tinySIP/src/parsers/tsip_parser_uri.c index f273b09c..728f1139 100644 --- a/trunk/tinySIP/src/parsers/tsip_parser_uri.c +++ b/trunk/tinySIP/src/parsers/tsip_parser_uri.c @@ -42,7 +42,7 @@ * Ragel state machine. */ -/* #line 139 "tsip_parser_uri.rl" */ +/* #line 138 "tsip_parser_uri.rl" */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -82,7 +82,7 @@ static const int tsip_machine_parser_uri_en_sip_usrinfo = 65; static const int tsip_machine_parser_uri_en_main = 73; -/* #line 169 "tsip_parser_uri.rl" */ +/* #line 168 "tsip_parser_uri.rl" */ /* #line 88 "../src/parsers/tsip_parser_uri.c" */ { @@ -92,7 +92,7 @@ static const int tsip_machine_parser_uri_en_main = 73; act = 0; } -/* #line 170 "tsip_parser_uri.rl" */ +/* #line 169 "tsip_parser_uri.rl" */ /* #line 98 "../src/parsers/tsip_parser_uri.c" */ { @@ -101,11 +101,11 @@ static const int tsip_machine_parser_uri_en_main = 73; switch ( cs ) { tr13: -/* #line 130 "tsip_parser_uri.rl" */ +/* #line 129 "tsip_parser_uri.rl" */ {{p = ((te))-1;}{ }} goto st73; tr21: -/* #line 116 "tsip_parser_uri.rl" */ +/* #line 115 "tsip_parser_uri.rl" */ {{p = ((te))-1;}{ SCANNER_SET_STRING(uri->host); if(uri->host_type == host_ipv6) @@ -115,11 +115,11 @@ tr21: }} goto st73; tr28: -/* #line 113 "tsip_parser_uri.rl" */ +/* #line 112 "tsip_parser_uri.rl" */ {{p = ((te))-1;}{ }} goto st73; tr40: -/* #line 116 "tsip_parser_uri.rl" */ +/* #line 115 "tsip_parser_uri.rl" */ {te = p+1;{ SCANNER_SET_STRING(uri->host); if(uri->host_type == host_ipv6) @@ -129,11 +129,11 @@ tr40: }} goto st73; tr93: -/* #line 131 "tsip_parser_uri.rl" */ +/* #line 130 "tsip_parser_uri.rl" */ {te = p;p--;{ }} goto st73; tr94: -/* #line 116 "tsip_parser_uri.rl" */ +/* #line 115 "tsip_parser_uri.rl" */ {te = p;p--;{ SCANNER_SET_STRING(uri->host); if(uri->host_type == host_ipv6) @@ -143,56 +143,56 @@ tr94: }} goto st73; tr97: -/* #line 125 "tsip_parser_uri.rl" */ +/* #line 124 "tsip_parser_uri.rl" */ {te = p;p--;{ ts++; SCANNER_SET_INTEGER(uri->port); }} goto st73; tr99: -/* #line 91 "tsip_parser_uri.rl" */ +/* #line 90 "tsip_parser_uri.rl" */ { PARSER_ADD_PARAM(uri->params); } -/* #line 130 "tsip_parser_uri.rl" */ +/* #line 129 "tsip_parser_uri.rl" */ {te = p;p--;{ }} goto st73; tr109: -/* #line 56 "tsip_parser_uri.rl" */ +/* #line 55 "tsip_parser_uri.rl" */ { uri->scheme = tsk_strdup("sip"), uri->type = uri_sip; } -/* #line 106 "tsip_parser_uri.rl" */ +/* #line 105 "tsip_parser_uri.rl" */ {te = p;p--;{ - if(tsk_strcontains(te, "@")) + if(tsk_strcontains(te, (pe - te), "@")) { {goto st65;} } }} goto st73; tr111: -/* #line 57 "tsip_parser_uri.rl" */ +/* #line 56 "tsip_parser_uri.rl" */ { uri->scheme = tsk_strdup("sips"), uri->type = uri_sips; } -/* #line 106 "tsip_parser_uri.rl" */ +/* #line 105 "tsip_parser_uri.rl" */ {te = p;p--;{ - if(tsk_strcontains(te, "@")) + if(tsk_strcontains(te, (pe - te), "@")) { {goto st65;} } }} goto st73; tr115: -/* #line 71 "tsip_parser_uri.rl" */ +/* #line 70 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->user_name); + PARSER_SET_STRING(uri->user_name); } -/* #line 113 "tsip_parser_uri.rl" */ +/* #line 112 "tsip_parser_uri.rl" */ {te = p;p--;{ }} goto st73; tr118: -/* #line 91 "tsip_parser_uri.rl" */ +/* #line 90 "tsip_parser_uri.rl" */ { PARSER_ADD_PARAM(uri->params); } -/* #line 113 "tsip_parser_uri.rl" */ +/* #line 112 "tsip_parser_uri.rl" */ {te = p;p--;{ }} goto st73; st73: @@ -228,7 +228,7 @@ st74: case 74: goto st74; tr86: -/* #line 61 "tsip_parser_uri.rl" */ +/* #line 60 "tsip_parser_uri.rl" */ { uri->host_type = uri->host_type = host_ipv4; } goto st1; st1: @@ -391,7 +391,6 @@ tr16: {te = p+1;} /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st80; @@ -399,7 +398,7 @@ st80: if ( ++p == pe ) goto _test_eof80; case 80: -/* #line 403 "../src/parsers/tsip_parser_uri.c" */ +/* #line 402 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr15; case 37: goto st13; @@ -424,7 +423,6 @@ case 80: tr17: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st13; @@ -432,7 +430,7 @@ st13: if ( ++p == pe ) goto _test_eof13; case 13: -/* #line 436 "../src/parsers/tsip_parser_uri.c" */ +/* #line 434 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st14; @@ -456,7 +454,7 @@ case 14: goto tr15; goto tr13; tr101: -/* #line 91 "tsip_parser_uri.rl" */ +/* #line 90 "tsip_parser_uri.rl" */ { PARSER_ADD_PARAM(uri->params); } @@ -465,7 +463,7 @@ st15: if ( ++p == pe ) goto _test_eof15; case 15: -/* #line 469 "../src/parsers/tsip_parser_uri.c" */ +/* #line 467 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr16; case 37: goto tr17; @@ -516,7 +514,7 @@ st81: if ( ++p == pe ) goto _test_eof81; case 81: -/* #line 520 "../src/parsers/tsip_parser_uri.c" */ +/* #line 518 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr18; case 37: goto st17; @@ -566,7 +564,6 @@ case 18: tr98: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st82; @@ -574,7 +571,7 @@ st82: if ( ++p == pe ) goto _test_eof82; case 82: -/* #line 578 "../src/parsers/tsip_parser_uri.c" */ +/* #line 575 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st83; @@ -604,14 +601,14 @@ tr23: tr89: /* #line 1 "tsip_parser_uri.rl" */ {te = p+1;} -/* #line 63 "tsip_parser_uri.rl" */ +/* #line 62 "tsip_parser_uri.rl" */ { uri->host_type = uri->host_type = host_hostname; } goto st84; st84: if ( ++p == pe ) goto _test_eof84; case 84: -/* #line 615 "../src/parsers/tsip_parser_uri.c" */ +/* #line 612 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -648,7 +645,7 @@ st85: if ( ++p == pe ) goto _test_eof85; case 85: -/* #line 652 "../src/parsers/tsip_parser_uri.c" */ +/* #line 649 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st20; @@ -708,17 +705,16 @@ tr90: {te = p+1;} /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } -/* #line 63 "tsip_parser_uri.rl" */ +/* #line 62 "tsip_parser_uri.rl" */ { uri->host_type = uri->host_type = host_hostname; } goto st86; st86: if ( ++p == pe ) goto _test_eof86; case 86: -/* #line 722 "../src/parsers/tsip_parser_uri.c" */ +/* #line 718 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -742,7 +738,7 @@ st87: if ( ++p == pe ) goto _test_eof87; case 87: -/* #line 746 "../src/parsers/tsip_parser_uri.c" */ +/* #line 742 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -766,7 +762,7 @@ st88: if ( ++p == pe ) goto _test_eof88; case 88: -/* #line 770 "../src/parsers/tsip_parser_uri.c" */ +/* #line 766 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -796,7 +792,7 @@ st90: if ( ++p == pe ) goto _test_eof90; case 90: -/* #line 800 "../src/parsers/tsip_parser_uri.c" */ +/* #line 796 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -819,14 +815,14 @@ case 91: tr91: /* #line 1 "tsip_parser_uri.rl" */ {te = p+1;} -/* #line 63 "tsip_parser_uri.rl" */ +/* #line 62 "tsip_parser_uri.rl" */ { uri->host_type = uri->host_type = host_hostname; } goto st92; st92: if ( ++p == pe ) goto _test_eof92; case 92: -/* #line 830 "../src/parsers/tsip_parser_uri.c" */ +/* #line 826 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -850,7 +846,7 @@ st93: if ( ++p == pe ) goto _test_eof93; case 93: -/* #line 854 "../src/parsers/tsip_parser_uri.c" */ +/* #line 850 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -874,7 +870,7 @@ st94: if ( ++p == pe ) goto _test_eof94; case 94: -/* #line 878 "../src/parsers/tsip_parser_uri.c" */ +/* #line 874 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 45: goto st19; case 46: goto tr104; @@ -901,11 +897,10 @@ tr116: tr27: /* #line 1 "tsip_parser_uri.rl" */ {te = p+1;} -/* #line 58 "tsip_parser_uri.rl" */ +/* #line 57 "tsip_parser_uri.rl" */ { uri->scheme = tsk_strdup("tel"), uri->type = uri_tel; } /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st95; @@ -913,18 +908,18 @@ st95: if ( ++p == pe ) goto _test_eof95; case 95: -/* #line 917 "../src/parsers/tsip_parser_uri.c" */ +/* #line 912 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) == 59 ) goto tr117; goto tr116; tr117: -/* #line 71 "tsip_parser_uri.rl" */ +/* #line 70 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->user_name); + PARSER_SET_STRING(uri->user_name); } goto st24; tr120: -/* #line 91 "tsip_parser_uri.rl" */ +/* #line 90 "tsip_parser_uri.rl" */ { PARSER_ADD_PARAM(uri->params); } @@ -933,7 +928,7 @@ st24: if ( ++p == pe ) goto _test_eof24; case 24: -/* #line 937 "../src/parsers/tsip_parser_uri.c" */ +/* #line 932 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr29; case 37: goto tr30; @@ -962,7 +957,6 @@ tr29: {te = p+1;} /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st96; @@ -970,7 +964,7 @@ st96: if ( ++p == pe ) goto _test_eof96; case 96: -/* #line 974 "../src/parsers/tsip_parser_uri.c" */ +/* #line 968 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr32; case 37: goto st25; @@ -995,7 +989,6 @@ case 96: tr30: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st25; @@ -1003,7 +996,7 @@ st25: if ( ++p == pe ) goto _test_eof25; case 25: -/* #line 1007 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1000 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st26; @@ -1057,7 +1050,7 @@ st97: if ( ++p == pe ) goto _test_eof97; case 97: -/* #line 1061 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1054 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr33; case 37: goto st28; @@ -1105,14 +1098,14 @@ case 29: goto tr33; goto tr28; tr92: -/* #line 62 "tsip_parser_uri.rl" */ +/* #line 61 "tsip_parser_uri.rl" */ { uri->host_type = uri->host_type = host_ipv6; } goto st30; st30: if ( ++p == pe ) goto _test_eof30; case 30: -/* #line 1116 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1109 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) == 58 ) goto st64; if ( (*p) < 65 ) { @@ -1538,7 +1531,7 @@ st65: if ( ++p == pe ) goto _test_eof65; case 65: -/* #line 1542 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1535 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr71; case 37: goto tr72; @@ -1560,7 +1553,6 @@ case 65: tr71: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st66; @@ -1568,7 +1560,7 @@ st66: if ( ++p == pe ) goto _test_eof66; case 66: -/* #line 1572 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1564 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto st66; case 37: goto st67; @@ -1590,7 +1582,6 @@ case 66: tr72: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st67; @@ -1598,7 +1589,7 @@ st67: if ( ++p == pe ) goto _test_eof67; case 67: -/* #line 1602 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1593 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st68; @@ -1622,16 +1613,16 @@ case 68: goto st66; goto st0; tr75: -/* #line 71 "tsip_parser_uri.rl" */ +/* #line 70 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->user_name); + PARSER_SET_STRING(uri->user_name); } goto st69; st69: if ( ++p == pe ) goto _test_eof69; case 69: -/* #line 1635 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1626 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto tr78; case 37: goto tr79; @@ -1655,7 +1646,6 @@ case 69: tr78: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st70; @@ -1663,7 +1653,7 @@ st70: if ( ++p == pe ) goto _test_eof70; case 70: -/* #line 1667 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1657 "../src/parsers/tsip_parser_uri.c" */ switch( (*p) ) { case 33: goto st70; case 37: goto st71; @@ -1687,7 +1677,6 @@ case 70: tr79: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } goto st71; @@ -1695,7 +1684,7 @@ st71: if ( ++p == pe ) goto _test_eof71; case 71: -/* #line 1699 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1688 "../src/parsers/tsip_parser_uri.c" */ if ( (*p) < 65 ) { if ( 48 <= (*p) && (*p) <= 57 ) goto st72; @@ -1719,39 +1708,38 @@ case 72: goto st70; goto st0; tr76: -/* #line 71 "tsip_parser_uri.rl" */ +/* #line 70 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->user_name); + PARSER_SET_STRING(uri->user_name); } -/* #line 102 "tsip_parser_uri.rl" */ +/* #line 101 "tsip_parser_uri.rl" */ { {goto st73;} } goto st98; tr80: /* #line 50 "tsip_parser_uri.rl" */ { - TSK_DEBUG_INFO("URI::TAG"); tag_start = p; } -/* #line 76 "tsip_parser_uri.rl" */ +/* #line 75 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->password); + PARSER_SET_STRING(uri->password); } -/* #line 102 "tsip_parser_uri.rl" */ +/* #line 101 "tsip_parser_uri.rl" */ { {goto st73;} } goto st98; tr83: -/* #line 76 "tsip_parser_uri.rl" */ +/* #line 75 "tsip_parser_uri.rl" */ { - PARSER_SET_STRING(uri->password); + PARSER_SET_STRING(uri->password); } -/* #line 102 "tsip_parser_uri.rl" */ +/* #line 101 "tsip_parser_uri.rl" */ { {goto st73;} } goto st98; st98: if ( ++p == pe ) goto _test_eof98; case 98: -/* #line 1755 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1743 "../src/parsers/tsip_parser_uri.c" */ goto st0; } _test_eof73: cs = 73; goto _test_eof; @@ -1904,12 +1892,12 @@ case 98: _out: {} } -/* #line 171 "tsip_parser_uri.rl" */ +/* #line 170 "tsip_parser_uri.rl" */ if( cs < -/* #line 1911 "../src/parsers/tsip_parser_uri.c" */ +/* #line 1899 "../src/parsers/tsip_parser_uri.c" */ 73 -/* #line 172 "tsip_parser_uri.rl" */ +/* #line 171 "tsip_parser_uri.rl" */ ) { TSK_DEBUG_ERROR("Failed to parse SIP/SIPS/TEL URI."); diff --git a/trunk/tinySIP/src/transports/tsip_transport.c b/trunk/tinySIP/src/transports/tsip_transport.c index b77bf8af..92f61de7 100644 --- a/trunk/tinySIP/src/transports/tsip_transport.c +++ b/trunk/tinySIP/src/transports/tsip_transport.c @@ -151,7 +151,6 @@ size_t tsip_transport_send(const tsip_transport_t* self, const char *branch, tsi if(buffer) { tsip_message_tostring(msg, buffer); - printf(buffer->data); if(buffer->size >1300) { diff --git a/trunk/tinySIP/src/tsip.c b/trunk/tinySIP/src/tsip.c index a31ddf25..95fad637 100644 --- a/trunk/tinySIP/src/tsip.c +++ b/trunk/tinySIP/src/tsip.c @@ -490,9 +490,19 @@ int tsip_stack_destroy(tsip_stack_handle_t *self) { tsip_stack_t *stack = self; + TSK_FREE(stack->display_name); + TSK_OBJECT_SAFE_FREE(stack->public_identity); + TSK_OBJECT_SAFE_FREE(stack->preferred_identity); + //TSK_OBJECT_SAFE_FREE(stack->associated_identity); + TSK_FREE(stack->private_identity); + TSK_FREE(stack->password); + TSK_OBJECT_SAFE_FREE(stack->timer_mgr); TSK_OBJECT_SAFE_FREE(stack->operations); + TSK_OBJECT_SAFE_FREE(stack->service_routes); + TSK_OBJECT_SAFE_FREE(stack->paths); + TSK_OBJECT_SAFE_FREE(stack->layer_dialog); TSK_OBJECT_SAFE_FREE(stack->layer_transac); TSK_OBJECT_SAFE_FREE(stack->layer_transport); diff --git a/trunk/tinySIP/src/tsip_message.c b/trunk/tinySIP/src/tsip_message.c index f5406742..f9135e40 100644 --- a/trunk/tinySIP/src/tsip_message.c +++ b/trunk/tinySIP/src/tsip_message.c @@ -262,23 +262,41 @@ int tsip_message_tostring(const tsip_message_t *self, tsk_buffer_t *output) } /* First Via */ - if(self->firstVia) tsip_header_tostring(TSIP_HEADER(self->firstVia), output); + if(self->firstVia){ + tsip_header_tostring(TSIP_HEADER(self->firstVia), output); + } /* From */ - if(self->From) tsip_header_tostring(TSIP_HEADER(self->From), output); + if(self->From){ + tsip_header_tostring(TSIP_HEADER(self->From), output); + } /* To */ - if(self->To) tsip_header_tostring(TSIP_HEADER(self->To), output); + if(self->To){ + tsip_header_tostring(TSIP_HEADER(self->To), output); + } /* Contact */ - if(self->Contact) tsip_header_tostring(TSIP_HEADER(self->Contact), output); + if(self->Contact){ + tsip_header_tostring(TSIP_HEADER(self->Contact), output); + } /* Call_id */ - if(self->Call_ID) tsip_header_tostring(TSIP_HEADER(self->Call_ID), output); + if(self->Call_ID){ + tsip_header_tostring(TSIP_HEADER(self->Call_ID), output); + } /* CSeq */ - if(self->CSeq) tsip_header_tostring(TSIP_HEADER(self->CSeq), output); + if(self->CSeq){ + tsip_header_tostring(TSIP_HEADER(self->CSeq), output); + } /* Expires */ - if(self->Expires) tsip_header_tostring(TSIP_HEADER(self->Expires), output); + if(self->Expires){ + tsip_header_tostring(TSIP_HEADER(self->Expires), output); + } /* Content-Type */ - if(self->Content_Type) tsip_header_tostring(TSIP_HEADER(self->Content_Type), output); + if(self->Content_Type){ + tsip_header_tostring(TSIP_HEADER(self->Content_Type), output); + } /* Content-Length*/ - if(self->Content_Length) tsip_header_tostring(TSIP_HEADER(self->Content_Length), output); + if(self->Content_Length){ + tsip_header_tostring(TSIP_HEADER(self->Content_Length), output); + } /* All other headers */ { @@ -294,8 +312,7 @@ int tsip_message_tostring(const tsip_message_t *self, tsk_buffer_t *output) tsk_buffer_append(output, "\r\n", 2); /* CONTENT */ - if(TSIP_MESSAGE_HAS_CONTENT(self)) - { + if(TSIP_MESSAGE_HAS_CONTENT(self)){ tsk_buffer_append(output, TSK_BUFFER_TO_STRING(self->Content), TSK_BUFFER_SIZE(self->Content)); } @@ -315,7 +332,7 @@ tsip_request_t *tsip_request_new(const char* method, const tsip_uri_t *request_u TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_CALL_ID_VA_ARGS(call_id)); TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_CSEQ_VA_ARGS(cseq, method)); TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_MAX_FORWARDS_VA_ARGS(TSIP_HEADER_MAX_FORWARDS_DEFAULT)); - TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_USER_AGENT_VA_ARGS(TSIP_HEADER_USER_AGENT_DEFAULT)); + TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_USER_AGENT_VA_ARGS(/*TSIP_HEADER_USER_AGENT_DEFAULT*/"IM-client/OMA1.0 Mercuro-Gold/v4.0.1610.0")); /*request->From = TSIP_HEADER_FROM_CREATE(0, from, 0); diff --git a/trunk/tinySIP/src/tsip_uri.c b/trunk/tinySIP/src/tsip_uri.c index d72ddaaa..7a45d342 100644 --- a/trunk/tinySIP/src/tsip_uri.c +++ b/trunk/tinySIP/src/tsip_uri.c @@ -78,24 +78,31 @@ int __tsip_uri_serialize(const tsip_uri_t *uri, int with_params, tsk_buffer_t *o int tsip_uri_serialize(const tsip_uri_t *uri, int with_params, int quote, tsk_buffer_t *output) { - if(quote) + if(uri) { - if(uri->display_name) + if(quote) { - tsk_buffer_appendEx(output, "\"%s\"", uri->display_name); + if(uri->display_name) + { + tsk_buffer_appendEx(output, "\"%s\"", uri->display_name); + } + + tsk_buffer_append(output, "<", 1); + __tsip_uri_serialize(uri, with_params, output); + tsk_buffer_append(output, ">", 1); + + return 0; } + else + { + __tsip_uri_serialize(uri, with_params, output); - tsk_buffer_append(output, "<", 1); - __tsip_uri_serialize(uri, with_params, output); - tsk_buffer_append(output, ">", 1); - - return 0; + return 0; + } } else { - __tsip_uri_serialize(uri, with_params, output); - - return 0; + TSK_DEBUG_ERROR("Cannot serialize NULL URI."); } return -1; diff --git a/trunk/tinySIP/test/test/test_sipmessages.h b/trunk/tinySIP/test/test/test_sipmessages.h index 1eba65ce..a4589ced 100644 --- a/trunk/tinySIP/test/test/test_sipmessages.h +++ b/trunk/tinySIP/test/test/test_sipmessages.h @@ -23,11 +23,11 @@ #define _TEST_SIPMESSAGES_H #define SIP_REQUEST \ - "REGISTER sip:ims-network.com SIP/2.0\r\n" \ + "REGISTER sip:open-ims.test SIP/2.0\r\n" \ "Test-Header: 0\r\n" \ "v: SIP/2.0/UDP [::]:1988;test=1234;comp=sigcomp;rport=254;ttl=457;received=192.0.2.101;branch=z9hG4bK1245420841406\r\n" \ - "f: \"Mamadou\" ;tag=29358\r\n" \ - "t: ;tag= 12345\r\n" \ + "f: \"Mamadou\" ;tag=29358\r\n" \ + "t: ;tag= 12345\r\n" \ "i: M-fa53180346f7f55ceb8d8670f9223dbb\r\n" \ "CSeq: 201 REGISTER\r\n" \ "Max-Forwards: 70\r\n" \ @@ -37,8 +37,10 @@ "m: ;expires=600000;+deviceID=\"3ca50bcb-7a67-44f1-afd0-994a55f930f4\";mobility=\"fixed\";+g.3gpp.cs-voice;+g.3gpp.app%5fref=\"urn%3Aurnxxx%3A3gpp-application.ims.iari.gsmais\";+g.oma.sip-im.large-message;+g.oma.sip-im\r\n" \ "User-Agent: IM-client/OMA1.0 doubango/v0.0.0\r\n" \ "Require: pref, path\r\n" \ + "Service-Route: ,\r\n" \ + "Path: \r\n" \ "Require: 100rel\r\n" \ - "P-Preferred-Identity: \r\n" \ + "P-Preferred-Identity: \r\n" \ "k: path\r\n" \ "k: gruu, outbound, timer\r\n" \ "P-Access-Network-Info: 3GPP-UTRAN-TDD;utran-cell-id-3gpp=00000000\r\n" \ @@ -50,17 +52,19 @@ #define SIP_RESPONSE \ "SIP/2.0 200 This is my reason phrase\r\n" \ - "To: ;tag=bweyal\r\n" \ + "To: ;tag=bweyal\r\n" \ "Via: SIP/2.0/UDP 192.168.0.11:63140;branch=z9hG4bK1261611942868;rport=63140\r\n" \ "CSeq: 31516 REGISTER\r\n" \ "Content-Length: 0\r\n" \ "Call-ID: 1261611941121\r\n" \ "Min-Expires: 30\r\n" \ - "From: ;tag=1261611941121\r\n" \ + "From: ;tag=1261611941121\r\n" \ "Contact: ;expires=3600;q=1.0,;expires=3600;q=1.0\r\n" \ "Contact: ;expires=3600;q=1.0\r\n" \ "Contact: ;expires=3600;q=1.0\r\n" \ - "P-Preferred-Identity: \r\n" \ + "P-Preferred-Identity: \r\n" \ + "Service-Route: ,\r\n" \ + "Path: \r\n" \ "P-Access-Network-Info: 3GPP-UTRAN-TDD;utran-cell-id-3gpp=00000000\r\n" \ "Authorization: Digest username=\"Alice\", realm=\"atlanta.com\",nonce=\"84a4cc6f3082121f32b42a2187831a9e\",response=\"7587245234b3434cc3412213e5f113a5432,test=123\"\r\n" \ "Privacy: none;user;id\r\n" \ @@ -72,19 +76,22 @@ "\r\n" #define SIP_MESSAGE \ - "MESSAGE sip:mamadou@micromethod.com SIP/2.0\r\n" \ + "MESSAGE sip:mamadou@open-ims.test SIP/2.0\r\n" \ "Via: SIP/2.0/UDP 192.168.0.11:64163;rport=4;branch=z9hG4bK1262758946486\r\n" \ "Via: SIP/2.0/UDP 192.168.0.11:59265;rport=59265;branch=z9hG4bK1263064096664\r\n" \ "Route: ;tag=mercuro\r\n" \ - "To: \r\n" \ + "From: ;tag=mercuro\r\n" \ + "To: \r\n" \ "Call-ID: 1262767804423\r\n" \ "CSeq: 8 MESSAGE\r\n" \ "Max-Forwards: 70\r\n" \ "Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFER\r\n" \ "User-Agent: IM-client/OMA1.0 Mercuro-Bronze/v4.0.1508.0\r\n" \ "c: text/plain; charset=utf-8\r\n" \ - "P-Preferred-Identity: ,,\r\n" \ + "Path: \r\n" \ + "Route: ,\r\n" \ + "P-Preferred-Identity: