From 4d7b3381e4695fd2a45a401c54e4bdebd995538e Mon Sep 17 00:00:00 2001 From: bossiel Date: Sun, 7 Mar 2010 20:26:45 +0000 Subject: [PATCH] Update android support. --- trunk/android-projects/tinyHTTP/.cproject | 2 + trunk/android-projects/tinyIPSec/.cproject | 253 ++++++++++++++++++ trunk/android-projects/tinyIPSec/.project | 89 ++++++ trunk/android-projects/tinyIPSec/makefile | 11 + trunk/android-projects/tinySAK/.cproject | 2 +- trunk/android-projects/tinySAK/makefile | 2 + trunk/tinyHTTP/include/thttp.h | 2 +- trunk/tinyHTTP/src/auth/thttp_auth.c | 6 +- trunk/tinyHTTP/src/headers/thttp_header.c | 2 +- trunk/tinyHTTP/src/makefile | 9 +- trunk/tinyHTTP/src/thttp_message.c | 2 +- trunk/tinyHTTP/src/thttp_operation.c | 2 +- trunk/tinyHTTP/src/thttp_transport.c | 3 +- trunk/tinyHTTP/test/makefile | 6 +- trunk/tinyIPSec/src/makefile | 38 +++ trunk/tinyIPSec/src/tipsec.h | 4 +- trunk/tinyIPSec/src/tipsec_common.h | 4 +- trunk/tinyIPSec/src/tipsec_racoon.h | 4 +- trunk/tinyIPSec/src/tipsec_vista.h | 4 +- trunk/tinyIPSec/src/tipsec_xp.h | 4 +- trunk/tinyIPSec/test/makefile | 28 ++ trunk/tinyIPSec/test/stdafx.h | 30 ++- trunk/tinyIPSec/test/test.c | 6 +- trunk/tinyNET/src/makefile | 4 + trunk/tinyNET/src/tinyNET_config.h | 2 +- trunk/tinyNET/src/tls/tnet_tls.c | 4 +- trunk/tinyNET/src/tnet_poll.h | 18 +- trunk/tinyNET/src/tnet_transport.h | 1 + trunk/tinyNET/src/tnet_transport_poll.c | 45 +++- trunk/tinyNET/src/tnet_transport_win32.c | 24 +- trunk/tinyNET/src/tnet_utils.c | 49 +++- trunk/tinyNET/src/tnet_utils.h | 2 +- .../src/authentication/tsip_challenge.c | 7 +- trunk/tinySIP/src/dialogs/tsip_dialog_layer.c | 7 +- .../src/dialogs/tsip_dialog_publish.client.c | 2 +- trunk/tinySIP/src/makefile | 10 +- .../src/transports/tsip_transport_ipsec.c | 2 +- .../src/transports/tsip_transport_layer.c | 6 +- trunk/tinySIP/src/tsip.c | 8 +- trunk/tinySIP/test/test/makefile | 3 +- trunk/tinySIP/test/test/test.c | 1 - trunk/tinySIP/test/test/test_stack.h | 7 +- 42 files changed, 621 insertions(+), 94 deletions(-) create mode 100644 trunk/android-projects/tinyIPSec/.cproject create mode 100644 trunk/android-projects/tinyIPSec/.project create mode 100644 trunk/android-projects/tinyIPSec/makefile create mode 100644 trunk/tinyIPSec/src/makefile create mode 100644 trunk/tinyIPSec/test/makefile diff --git a/trunk/android-projects/tinyHTTP/.cproject b/trunk/android-projects/tinyHTTP/.cproject index 972faac9..a9fd0353 100644 --- a/trunk/android-projects/tinyHTTP/.cproject +++ b/trunk/android-projects/tinyHTTP/.cproject @@ -246,6 +246,7 @@ + @@ -490,6 +491,7 @@ + diff --git a/trunk/android-projects/tinyIPSec/.cproject b/trunk/android-projects/tinyIPSec/.cproject new file mode 100644 index 00000000..c6495288 --- /dev/null +++ b/trunk/android-projects/tinyIPSec/.cproject @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/android-projects/tinyIPSec/.project b/trunk/android-projects/tinyIPSec/.project new file mode 100644 index 00000000..d1839dad --- /dev/null +++ b/trunk/android-projects/tinyIPSec/.project @@ -0,0 +1,89 @@ + + + tinyIPSec + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.autoBuildTarget + all + + + org.eclipse.cdt.make.core.buildArguments + OPTIONS="-O0 -g3 -DDEBUG_LEVEL=DEBUG_LEVEL_INFO" + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.cleanBuildTarget + clean + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.fullBuildTarget + all + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + false + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + src + 2 + C:/Projects/Doubango/tinyIPSec/src + + + test + 2 + C:/Projects/Doubango/tinyIPSec/test + + + diff --git a/trunk/android-projects/tinyIPSec/makefile b/trunk/android-projects/tinyIPSec/makefile new file mode 100644 index 00000000..a0f41e4c --- /dev/null +++ b/trunk/android-projects/tinyIPSec/makefile @@ -0,0 +1,11 @@ +include ../root.mk + +export PROJECT=tinyIPSec + +all: + (cd $(DOUBANGO_HOME)/$(PROJECT)/src ; $(MAKE) all; $(MAKE) install; cp lib$(PROJECT).so $(OUTPUT_DIR)) + (cd $(DOUBANGO_HOME)/$(PROJECT)/test; $(MAKE) all; $(MAKE) install; cp test $(OUTPUT_DIR)) + +clean: + (cd $(DOUBANGO_HOME)/$(PROJECT)/src; $(MAKE) clean) + (cd $(DOUBANGO_HOME)/$(PROJECT)/test; $(MAKE) clean) \ No newline at end of file diff --git a/trunk/android-projects/tinySAK/.cproject b/trunk/android-projects/tinySAK/.cproject index c9d128ea..9041659f 100644 --- a/trunk/android-projects/tinySAK/.cproject +++ b/trunk/android-projects/tinySAK/.cproject @@ -25,7 +25,7 @@ - diff --git a/trunk/android-projects/tinySAK/makefile b/trunk/android-projects/tinySAK/makefile index 4454d0f6..cd0d9bcd 100644 --- a/trunk/android-projects/tinySAK/makefile +++ b/trunk/android-projects/tinySAK/makefile @@ -1,5 +1,7 @@ include ../root.mk +export PROJECT=tinySAK + all: (cd ../../tinySAK/src ; $(MAKE) all; $(MAKE) install; cp libtinySAK.so $(OUTPUT_DIR)) (cd ../../tinySAK/test; $(MAKE) all; $(MAKE) install; cp test $(OUTPUT_DIR)) diff --git a/trunk/tinyHTTP/include/thttp.h b/trunk/tinyHTTP/include/thttp.h index 593e59ea..8b6aab00 100644 --- a/trunk/tinyHTTP/include/thttp.h +++ b/trunk/tinyHTTP/include/thttp.h @@ -74,4 +74,4 @@ TINYHTTP_GEXTERN const void *thttp_stack_def_t; THTTP_END_DECLS -#endif /* TINYHTTP_THTTP_H */ \ No newline at end of file +#endif /* TINYHTTP_THTTP_H */ diff --git a/trunk/tinyHTTP/src/auth/thttp_auth.c b/trunk/tinyHTTP/src/auth/thttp_auth.c index deef668b..e17e4939 100644 --- a/trunk/tinyHTTP/src/auth/thttp_auth.c +++ b/trunk/tinyHTTP/src/auth/thttp_auth.c @@ -222,13 +222,11 @@ int thttp_auth_digest_response(const tsk_md5string_t *ha1, const char* nonce, co char *res = 0; - if(tsk_striequals(qop, "auth") || tsk_striequals(qop, "auth-int")) - { + if(tsk_striequals(qop, "auth") || tsk_striequals(qop, "auth-int")){ /* CASE 1 */ tsk_sprintf(&res, "%s:%s:%s:%s:%s:%s", *ha1, nonce, noncecount, cnonce, qop, *ha2); } - else - { + else{ /* CASE 2 */ tsk_sprintf(&res, "%s:%s:%s", *ha1, nonce, *ha2); } diff --git a/trunk/tinyHTTP/src/headers/thttp_header.c b/trunk/tinyHTTP/src/headers/thttp_header.c index 1aa734fd..fd156cd2 100644 --- a/trunk/tinyHTTP/src/headers/thttp_header.c +++ b/trunk/tinyHTTP/src/headers/thttp_header.c @@ -113,4 +113,4 @@ int thttp_header_tostring(const thttp_header_t *self, tsk_buffer_t *output) tsk_buffer_append(output, "\r\n", 2); } return ret; -} \ No newline at end of file +} diff --git a/trunk/tinyHTTP/src/makefile b/trunk/tinyHTTP/src/makefile index 7287887d..056978f0 100644 --- a/trunk/tinyHTTP/src/makefile +++ b/trunk/tinyHTTP/src/makefile @@ -2,14 +2,16 @@ APP := lib$(PROJECT).so INSTALL_DIR = /system/lib -CFLAGS := $(CFLAGS) -I$(DOUBANGO_HOME)/tinySAK/src -I$(DOUBANGO_HOME)/$(PROJECT)/include -LDFLAGS := $(LDFLAGS) -Wl,-soname,lib$(PROJECT).so,-Bsymbolic,-shared,--whole-archive -ltinySAK +CFLAGS := $(CFLAGS) -I$(DOUBANGO_HOME)/tinySAK/src -I$(DOUBANGO_HOME)/tinyNET/src -I$(DOUBANGO_HOME)/$(PROJECT)/include +LDFLAGS := $(LDFLAGS) -Wl,-soname,lib$(PROJECT).so,-Bsymbolic,-shared,--whole-archive -ltinySAK -ltinyNET all: $(APP) OBJS = \ thttp.o\ thttp_message.o\ + thttp_operation.o\ + thttp_transport.o\ thttp_url.o ################### ## auth @@ -20,6 +22,9 @@ OBJS += auth/thttp_auth.o ################### OBJS += headers/thttp_header.o\ headers/thttp_header_Authorization.o\ + headers/thttp_header_Content_Length.o\ + headers/thttp_header_Content_Type.o\ + headers/thttp_header_Dummy.o\ headers/thttp_header_Proxy_Authenticate.o\ headers/thttp_header_WWW_Authenticate.o ################### diff --git a/trunk/tinyHTTP/src/thttp_message.c b/trunk/tinyHTTP/src/thttp_message.c index 17426aff..7371da67 100644 --- a/trunk/tinyHTTP/src/thttp_message.c +++ b/trunk/tinyHTTP/src/thttp_message.c @@ -352,4 +352,4 @@ static const tsk_object_def_t thttp_message_def_s = thttp_message_destroy, 0 }; -const void *thttp_message_def_t = &thttp_message_def_s; \ No newline at end of file +const void *thttp_message_def_t = &thttp_message_def_s; diff --git a/trunk/tinyHTTP/src/thttp_operation.c b/trunk/tinyHTTP/src/thttp_operation.c index a8ca8a86..8b669656 100644 --- a/trunk/tinyHTTP/src/thttp_operation.c +++ b/trunk/tinyHTTP/src/thttp_operation.c @@ -286,4 +286,4 @@ static const tsk_object_def_t thttp_operation_def_s = thttp_operation_destroy, thttp_operation_cmp, }; -const void *thttp_operation_def_t = &thttp_operation_def_s; \ No newline at end of file +const void *thttp_operation_def_t = &thttp_operation_def_s; diff --git a/trunk/tinyHTTP/src/thttp_transport.c b/trunk/tinyHTTP/src/thttp_transport.c index 8cbaf43b..84a47770 100644 --- a/trunk/tinyHTTP/src/thttp_transport.c +++ b/trunk/tinyHTTP/src/thttp_transport.c @@ -27,4 +27,5 @@ * * @date Created: Sat Nov 8 16:54:58 2009 mdiop */ -#include "tinyHTTP/thttp_transport.h" \ No newline at end of file +#include "tinyHTTP/thttp_transport.h" + diff --git a/trunk/tinyHTTP/test/makefile b/trunk/tinyHTTP/test/makefile index 4d074056..22a4784c 100644 --- a/trunk/tinyHTTP/test/makefile +++ b/trunk/tinyHTTP/test/makefile @@ -23,6 +23,10 @@ run: #dbg: # $(MAKE) $(MAKEFILE) DEBUG="-g -DDEBUG" # $(MAKE) $(MAKEFILE) install - + +#c +#set solib-search-path /cygdrive/c/Projects/Doubango/android-projects/output +#set solib-absolute-prefix /cygdrive/c/Projects/Doubango/android-projects/output + clean: @rm -f $(OBJS) $(APP) \ No newline at end of file diff --git a/trunk/tinyIPSec/src/makefile b/trunk/tinyIPSec/src/makefile new file mode 100644 index 00000000..0def09a8 --- /dev/null +++ b/trunk/tinyIPSec/src/makefile @@ -0,0 +1,38 @@ +APP := lib$(PROJECT).so + +INSTALL_DIR = /system/lib + +CFLAGS := $(CFLAGS) -I$(DOUBANGO_HOME)/tinySAK/src +LDFLAGS := $(LDFLAGS) -Wl,-soname,lib$(PROJECT).so,-Bsymbolic,-shared,--whole-archive + +all: $(APP) + +OBJS = tipsec_common.o\ + tipsec_racoon.o\ + tipsec_vista.o\ + tipsec_xp.o\ + tipsec.o + +$(APP): $(OBJS) + $(CPP) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@ + +install: $(APP) + $(ANDROID_SDK_ROOT)/tools/adb remount + $(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(INSTALL_DIR)/$(APP) + $(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(INSTALL_DIR)/$(APP) + +shell: + $(ANDROID_SDK_ROOT)/tools/adb shell + +run: + $(ANDROID_SDK_ROOT)/tools/adb shell $(INSTALL_DIR)/$(APP) + +#dbg: +# $(MAKE) $(MAKEFILE) DEBUG="-g -DDEBUG" +# $(MAKE) $(MAKEFILE) install + +clean: + @rm -f $(OBJS) $(APP) \ No newline at end of file diff --git a/trunk/tinyIPSec/src/tipsec.h b/trunk/tinyIPSec/src/tipsec.h index 9af67742..d04277c3 100644 --- a/trunk/tinyIPSec/src/tipsec.h +++ b/trunk/tinyIPSec/src/tipsec.h @@ -34,8 +34,8 @@ #include "tipsec_common.h" -TSK_BEGIN_DECLS +TIPSEC_BEGIN_DECLS -TSK_END_DECLS +TIPSEC_END_DECLS #endif /* TINYIPSEC_IPSEC_H */ diff --git a/trunk/tinyIPSec/src/tipsec_common.h b/trunk/tinyIPSec/src/tipsec_common.h index a8aa5cb2..a76c9306 100644 --- a/trunk/tinyIPSec/src/tipsec_common.h +++ b/trunk/tinyIPSec/src/tipsec_common.h @@ -40,7 +40,7 @@ * @retval @ref tipsec_context_t object. */ -TSK_BEGIN_DECLS +TIPSEC_BEGIN_DECLS #define TIPSEC_CONTEXT_CREATE(ipproto, use_ipv6, mode, ealg, alg, protocol)\ tsk_object_new(tipsec_context_def_t, (tipsec_ipproto_t)ipproto, (int)use_ipv6, (tipsec_mode_t)mode, (tipsec_ealgorithm_t)ealg, (tipsec_algorithm_t)alg, (tipsec_protocol_t)protocol) @@ -283,6 +283,6 @@ TINYIPSEC_API int tipsec_set_keys(tipsec_context_t* ctx, const tipsec_key_t* ik, TINYIPSEC_API int tipsec_set_remote(tipsec_context_t* ctx, tipsec_spi_t spi_pc, tipsec_spi_t spi_ps, tipsec_port_t port_pc, tipsec_port_t port_ps, tipsec_lifetime_t lifetime); TINYIPSEC_API int tipsec_stop(tipsec_context_t* ctx); -TSK_END_DECLS +TIPSEC_END_DECLS #endif /* TINYIPSEC_IPSEC_COMMON_H */ diff --git a/trunk/tinyIPSec/src/tipsec_racoon.h b/trunk/tinyIPSec/src/tipsec_racoon.h index 9164ada2..704a8d53 100644 --- a/trunk/tinyIPSec/src/tipsec_racoon.h +++ b/trunk/tinyIPSec/src/tipsec_racoon.h @@ -34,7 +34,7 @@ #include "tipsec_common.h" -TSK_BEGIN_DECLS +TIPSEC_BEGIN_DECLS #if HAVE_IPSEC_RACOON @@ -43,7 +43,7 @@ TSK_BEGIN_DECLS #endif /* HAVE_IPSEC_RACOON */ -TSK_END_DECLS +TIPSEC_END_DECLS #endif /* TINYIPSEC_IPSEC_RACOON_H */ diff --git a/trunk/tinyIPSec/src/tipsec_vista.h b/trunk/tinyIPSec/src/tipsec_vista.h index cbe9edf8..531ad51f 100644 --- a/trunk/tinyIPSec/src/tipsec_vista.h +++ b/trunk/tinyIPSec/src/tipsec_vista.h @@ -34,7 +34,7 @@ #include "tipsec_common.h" -TSK_BEGIN_DECLS +TIPSEC_BEGIN_DECLS #if HAVE_IPSEC_VISTA @@ -43,7 +43,7 @@ TSK_BEGIN_DECLS #endif /* HAVE_IPSEC_VISTA */ -TSK_END_DECLS +TIPSEC_END_DECLS #endif /* TINYIPSEC_IPSEC_VISTA_H */ diff --git a/trunk/tinyIPSec/src/tipsec_xp.h b/trunk/tinyIPSec/src/tipsec_xp.h index e76f34cd..185fadfe 100644 --- a/trunk/tinyIPSec/src/tipsec_xp.h +++ b/trunk/tinyIPSec/src/tipsec_xp.h @@ -35,7 +35,7 @@ #include "tipsec_common.h" -TSK_BEGIN_DECLS +TIPSEC_BEGIN_DECLS #if HAVE_IPSEC_XP @@ -44,7 +44,7 @@ TSK_BEGIN_DECLS #endif /* HAVE_IPSEC_XP */ -TSK_END_DECLS +TIPSEC_END_DECLS #endif /* TINYIPSEC_IPSEC_XP_H */ diff --git a/trunk/tinyIPSec/test/makefile b/trunk/tinyIPSec/test/makefile new file mode 100644 index 00000000..10a384f8 --- /dev/null +++ b/trunk/tinyIPSec/test/makefile @@ -0,0 +1,28 @@ +APP := test + +CFLAGS := $(CFLAGS) -I$(DOUBANGO_HOME)/$(PROJECT)/src -I$(DOUBANGO_HOME)/tinySAK/src +LDFLAGS := $(LDFLAGS) -Bsymbolic -l$(PROJECT) -ltinySAK + +all: $(APP) + +OBJS += $(APP).o + +$(APP): $(OBJS) + $(CPP) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@ + +install: $(APP) + $(ANDROID_SDK_ROOT)/tools/adb push $(APP) $(INSTALL_DIR)/$(APP) + $(ANDROID_SDK_ROOT)/tools/adb shell chmod 777 $(INSTALL_DIR)/$(APP) + +run: + $(ANDROID_SDK_ROOT)/tools/adb shell $(INSTALL_DIR)/$(APP) + +#dbg: +# $(MAKE) $(MAKEFILE) DEBUG="-g -DDEBUG" +# $(MAKE) $(MAKEFILE) install + +clean: + @rm -f $(OBJS) $(APP) \ No newline at end of file diff --git a/trunk/tinyIPSec/test/stdafx.h b/trunk/tinyIPSec/test/stdafx.h index 085c84eb..46ad2381 100644 --- a/trunk/tinyIPSec/test/stdafx.h +++ b/trunk/tinyIPSec/test/stdafx.h @@ -18,17 +18,19 @@ * You should have received a copy of the GNU General Public License * along with DOUBANGO. * -*/ - -#pragma once - -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. -#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif - -#include -#include - - - -// TODO: reference additional headers your program requires here +*/ + +#ifndef TEST_TINYIPSEC_STDAFX_H +#define TEST_TINYIPSEC_STDAFX_H + +#include "targetver.h" + +#include + +#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__) +#include +#endif + + +// TODO: reference additional headers your program requires here +#endif /* TEST_TINYIPSEC_STDAFX_H */ diff --git a/trunk/tinyIPSec/test/test.c b/trunk/tinyIPSec/test/test.c index d0c655e9..74d32fb2 100644 --- a/trunk/tinyIPSec/test/test.c +++ b/trunk/tinyIPSec/test/test.c @@ -41,7 +41,11 @@ #define SPI_PC 2222 #define SPI_PS 3333 -int _tmain(int argc, _TCHAR* argv[]) +#ifdef _WIN32_WCE +int _tmain(int argc, _TCHAR* argv[]) +#else +int main() +#endif { int ret; tipsec_lifetime_t lifetime = 600000; /* Always set it to the maximum value. (Not possible to update the value after REGISTER 200OK. ) */ diff --git a/trunk/tinyNET/src/makefile b/trunk/tinyNET/src/makefile index 667182a5..8b608f14 100644 --- a/trunk/tinyNET/src/makefile +++ b/trunk/tinyNET/src/makefile @@ -58,6 +58,10 @@ OBJS += ice/tnet_ice.o OBJS += stun/tnet_stun.o\ stun/tnet_stun_attribute.o\ stun/tnet_stun_message.o + ################### + ## TLS + ################### +OBJS += tls/tnet_tls.o ################### ## TURN ################### diff --git a/trunk/tinyNET/src/tinyNET_config.h b/trunk/tinyNET/src/tinyNET_config.h index ea0e01de..fd866294 100644 --- a/trunk/tinyNET/src/tinyNET_config.h +++ b/trunk/tinyNET/src/tinyNET_config.h @@ -79,7 +79,7 @@ # pragma warning( disable : 4996 ) #endif -#if (_WIN32_WINNT>=0x0600) || (ANDROID) || defined (__APPLE__) +#if (_WIN32_WINNT>=0x0600) || (ANDROID) || defined(__APPLE__) # define TNET_HAVE_POLL 1 #else # define TNET_HAVE_POLL 0 diff --git a/trunk/tinyNET/src/tls/tnet_tls.c b/trunk/tinyNET/src/tls/tnet_tls.c index 46aecec9..aaed715c 100644 --- a/trunk/tinyNET/src/tls/tnet_tls.c +++ b/trunk/tinyNET/src/tls/tnet_tls.c @@ -428,4 +428,6 @@ static const tsk_object_def_t tnet_tls_socket_def_s = tnet_tls_socket_destroy, tnet_tls_socket_cmp, }; -const void *tnet_tls_socket_def_t = &tnet_tls_socket_def_s; \ No newline at end of file +const void *tnet_tls_socket_def_t = &tnet_tls_socket_def_s; + + diff --git a/trunk/tinyNET/src/tnet_poll.h b/trunk/tinyNET/src/tnet_poll.h index 50b4657f..bf77a967 100644 --- a/trunk/tinyNET/src/tnet_poll.h +++ b/trunk/tinyNET/src/tnet_poll.h @@ -73,18 +73,12 @@ typedef struct tnet_pollfd_s } tnet_pollfd_t; -#define TNET_POLLRDNORM 0x0100 -#define TNET_POLLRDBAND 0x0200 -#define TNET_POLLIN (TNET_POLLRDNORM | TNET_POLLRDBAND) -#define TNET_POLLPRI 0x0400 - -#define TNET_POLLWRNORM 0x0010 -#define TNET_POLLOUT (TNET_POLLWRNORM) -#define TNET_POLLWRBAND 0x0020 - -#define TNET_POLLERR 0x0001 -#define TNET_POLLHUP 0x0002 -#define TNET_POLLNVAL 0x0004 +#define TNET_POLLIN 0x0001 /* There is data to read */ +#define TNET_POLLPRI 0x0002 /* There is urgent data to read */ +#define TNET_POLLOUT 0x0004 /* Writing now will not block */ +#define TNET_POLLERR 0x0008 /* Error condition */ +#define TNET_POLLHUP 0x0010 /* Hung up */ +#define TNET_POLLNVAL 0x0020 /* Invalid request: fd not open */ int tnet_poll(tnet_pollfd_t fds[ ], tnet_nfds_t nfds, int timeout); diff --git a/trunk/tinyNET/src/tnet_transport.h b/trunk/tinyNET/src/tnet_transport.h index ba643d25..d7d1fab0 100644 --- a/trunk/tinyNET/src/tnet_transport.h +++ b/trunk/tinyNET/src/tnet_transport.h @@ -53,6 +53,7 @@ typedef enum tnet_transport_event_type_e { event_data, event_closed, + event_error, event_connected } tnet_transport_event_type_t; diff --git a/trunk/tinyNET/src/tnet_transport_poll.c b/trunk/tinyNET/src/tnet_transport_poll.c index 770b6749..c7884089 100644 --- a/trunk/tinyNET/src/tnet_transport_poll.c +++ b/trunk/tinyNET/src/tnet_transport_poll.c @@ -33,6 +33,7 @@ #include "tsk_debug.h" #include "tsk_thread.h" #include "tsk_buffer.h" +#include "tsk_safeobj.h" #if TNET_USE_POLL @@ -63,6 +64,8 @@ typedef struct transport_context_s tnet_fd_t pipeR; tnet_pollfd_t ufds[TNET_MAX_FDS]; transport_socket_t* sockets[TNET_MAX_FDS]; + + TSK_DECLARE_SAFEOBJ; } transport_context_t; @@ -254,15 +257,20 @@ const tnet_tls_socket_handle_t* tnet_transport_get_tlshandle(const tnet_transpor static transport_socket_t* getSocket(transport_context_t *context, tnet_fd_t fd) { size_t i; + transport_socket_t* ret = 0; + if(context){ + tsk_safeobj_lock(context); for(i=0; icount; i++){ if(context->sockets[i]->fd == fd){ - return context->sockets[i]; + ret = context->sockets[i]; + break; } } + tsk_safeobj_unlock(context); } - return 0; + return ret; } /*== Add new socket ==*/ @@ -278,11 +286,15 @@ void addSocket(tnet_fd_t fd, tnet_socket_type_t type, transport_context_t *conte sock->tlshandle = tnet_sockfd_set_tlsfiles(sock->fd, is_client, 0, 0, 0); } + tsk_safeobj_lock(context); + context->ufds[context->count].fd = fd; context->ufds[context->count].events = context->events; context->sockets[context->count] = sock; context->count++; + + tsk_safeobj_unlock(context); } else{ TSK_DEBUG_ERROR("Context is Null."); @@ -309,6 +321,8 @@ void removeSocket(int index, transport_context_t *context) if(index < (int)context->count) { + tsk_safeobj_lock(context); + /* Close the socket if we are the owner. */ if(context->sockets[index]->owner){ tnet_sockfd_close(&(context->sockets[index]->fd)); @@ -328,6 +342,8 @@ void removeSocket(int index, transport_context_t *context) context->sockets[context->count-1] = 0; context->count--; + + tsk_safeobj_unlock(context); } } @@ -446,7 +462,15 @@ void *tnet_transport_mainthread(void *param) } if(!len){ + TSK_DEBUG_WARN("IOCTLT returned zero."); +#if ANDROID /* On Android this mean that the socket has been closed. */ + TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, active_socket->fd); + removeSocket(i, context); +#else + recv(active_socket->fd, 0, 0, 0); +#endif continue; + } if(!(buffer = tsk_calloc(len, sizeof(uint8_t)))){ @@ -508,14 +532,23 @@ void *tnet_transport_mainthread(void *param) } /*================== TNET_POLLHUP ==================*/ - if(context->ufds[i].revents & TNET_POLLHUP) + if(context->ufds[i].revents & (TNET_POLLHUP)) { - TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLPRI", transport->description); + TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLHUP", transport->description); TSK_RUNNABLE_ENQUEUE(transport, event_closed, transport->callback_data, active_socket->fd); removeSocket(i, context); } + /*================== TNET_POLLERR ==================*/ + if(context->ufds[i].revents & (TNET_POLLERR)) + { + TSK_DEBUG_INFO("NETWORK EVENT FOR SERVER [%s] -- TNET_POLLERR", transport->description); + + TSK_RUNNABLE_ENQUEUE(transport, event_error, transport->callback_data, active_socket->fd); + removeSocket(i, context); + } + }/* for */ } @@ -545,7 +578,8 @@ bail: static void* transport_context_create(void * self, va_list * app) { transport_context_t *context = self; - if(context){ + if(context){ + tsk_safeobj_init(context); } return self; } @@ -557,6 +591,7 @@ static void* transport_context_destroy(void * self) while(context->count){ removeSocket(0, context); } + tsk_safeobj_deinit(context); } return self; } diff --git a/trunk/tinyNET/src/tnet_transport_win32.c b/trunk/tinyNET/src/tnet_transport_win32.c index b865acdb..a1d15a37 100644 --- a/trunk/tinyNET/src/tnet_transport_win32.c +++ b/trunk/tinyNET/src/tnet_transport_win32.c @@ -33,6 +33,7 @@ #include "tsk_debug.h" #include "tsk_thread.h" #include "tsk_buffer.h" +#include "tsk_safeobj.h" #if TNET_UNDER_WINDOWS && !TNET_USE_POLL @@ -56,6 +57,8 @@ typedef struct transport_context_s size_t count; WSAEVENT events[WSA_MAXIMUM_WAIT_EVENTS]; transport_socket_t* sockets[WSA_MAXIMUM_WAIT_EVENTS]; + + TSK_DECLARE_SAFEOBJ; } transport_context_t; @@ -305,15 +308,20 @@ int CALLBACK AcceptCondFunc(LPWSABUF lpCallerId, LPWSABUF lpCallerData, LPQOS lp static transport_socket_t* getSocket(transport_context_t *context, tnet_fd_t fd) { size_t i; + transport_socket_t* ret = 0; + if(context){ + tsk_safeobj_lock(context); for(i=0; icount; i++){ if(context->sockets[i]->fd == fd){ - return context->sockets[i]; + ret = context->sockets[i]; + break; } } + tsk_safeobj_unlock(context); } - return 0; + return ret; } /*== Add new socket ==*/ @@ -329,10 +337,12 @@ static void addSocket(tnet_fd_t fd, tnet_socket_type_t type, transport_context_t sock->tlshandle = tnet_sockfd_set_tlsfiles(sock->fd, is_client, 0, 0, 0); } + tsk_safeobj_lock(context); context->events[context->count] = WSACreateEvent(); context->sockets[context->count] = sock; context->count++; + tsk_safeobj_unlock(context); } else{ TSK_DEBUG_ERROR("Context is Null."); @@ -346,6 +356,8 @@ static void removeSocket(int index, transport_context_t *context) if(index < (int)context->count) { + tsk_safeobj_lock(context); + /* Close the socket if we are the owner. */ if(context->sockets[index]->owner){ tnet_sockfd_close(&(context->sockets[index]->fd)); @@ -370,6 +382,8 @@ static void removeSocket(int index, transport_context_t *context) context->events[context->count-1] = 0; context->count--; + + tsk_safeobj_unlock(context); } } @@ -525,7 +539,7 @@ void *tnet_transport_mainthread(void *param) } /* Alloc data */ - if((wsaBuffer.buf = tsk_calloc(wsaBuffer.len, sizeof(uint8_t)))){ + if(!(wsaBuffer.buf = tsk_calloc(wsaBuffer.len, sizeof(uint8_t)))){ continue; } @@ -634,7 +648,8 @@ bail: static void* transport_context_create(void * self, va_list * app) { transport_context_t *context = self; - if(context){ + if(context){ + tsk_safeobj_init(context); } return self; } @@ -646,6 +661,7 @@ static void* transport_context_destroy(void * self) while(context->count){ removeSocket(0, context); } + tsk_safeobj_deinit(context); } return self; } diff --git a/trunk/tinyNET/src/tnet_utils.c b/trunk/tinyNET/src/tnet_utils.c index 57fde5d9..6b14af4d 100644 --- a/trunk/tinyNET/src/tnet_utils.c +++ b/trunk/tinyNET/src/tnet_utils.c @@ -979,22 +979,38 @@ tnet_tls_socket_handle_t* tnet_sockfd_set_tlsfiles(tnet_fd_t fd, int isClient, c */ int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf, size_t size) { + size_t sent = 0; + int ret = -1; + if(fd == TNET_INVALID_FD){ TSK_DEBUG_ERROR("Using invalid FD to send data."); - return -1; + goto bail; } if(!buf || !size){ TSK_DEBUG_ERROR("Using invalid BUFFER."); - return -2; + ret = -2; + goto bail; } + while(sent < size) + { #if TNET_HAVE_SA_LEN - return sendto(fd, buf, size, 0, to, to->sa_len); + ret = sendto(fd, (buf+sent), (size-sent), 0, to, to->sa_len); #else - //return sendto(fd, buf, size, 0, to, sizeof(*to)); - return sendto(fd, buf, size, 0, to, - to->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6): (to->sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(*to))); //FIXME: why sizeof(*to) don't work for IPv6 on XP? + //return sendto(fd, (buf+sent), (size-sent), 0, to, sizeof(*to)); + ret = sendto(fd, (((const uint8_t*)buf)+sent), (size-sent), 0, to, + to->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6): (to->sa_family == AF_INET ? sizeof(struct sockaddr_in) : sizeof(*to))); //FIXME: why sizeof(*to) don't work for IPv6 on XP? #endif + if(ret <= 0){ + goto bail; + } + else{ + sent += ret; + } + } + +bail: + return (size == sent) ? sent : ret; } /**@ingroup tnet_utils_group @@ -1035,24 +1051,31 @@ int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, size_t size, int flags, struct * All flags which can be passed to @b recv. * @retval If no error occurs, send returns the total number of bytes sent, which can be less than the number requested to be sent in the @b size parameter. */ -int tnet_sockfd_send(tnet_fd_t fd, void* buf, size_t size, int flags) +int tnet_sockfd_send(tnet_fd_t fd, const void* buf, size_t size, int flags) { int ret = -1; + size_t sent = 0; if(fd == TNET_INVALID_FD){ TSK_DEBUG_ERROR("Using invalid FD to send data."); goto bail; } - if((ret = send(fd, buf, size, flags)) <= 0){ - TNET_PRINT_LAST_ERROR("send failed."); - // Under Windows XP if WSAGetLastError()==WSAEINTR then try to disable both the ICS and the Firewall - // More info about How to disable the ISC: http://support.microsoft.com/?scid=kb%3Ben-us%3B230112&x=6&y=11 - goto bail; + while(sent < size) + { + if((ret = send(fd, (((const uint8_t*)buf)+sent), (size-sent), flags)) <= 0){ + TNET_PRINT_LAST_ERROR("send failed."); + // Under Windows XP if WSAGetLastError()==WSAEINTR then try to disable both the ICS and the Firewall + // More info about How to disable the ISC: http://support.microsoft.com/?scid=kb%3Ben-us%3B230112&x=6&y=11 + goto bail; + } + else{ + sent += ret; + } } bail: - return ret; + return (size == sent) ? sent : ret; } /**@ingroup tnet_utils_group diff --git a/trunk/tinyNET/src/tnet_utils.h b/trunk/tinyNET/src/tnet_utils.h index 97911aea..eabb1063 100644 --- a/trunk/tinyNET/src/tnet_utils.h +++ b/trunk/tinyNET/src/tnet_utils.h @@ -145,7 +145,7 @@ TINYNET_API tnet_tls_socket_handle_t* tnet_sockfd_set_tlsfiles(tnet_fd_t fd, int TINYNET_API int tnet_sockfd_sendto(tnet_fd_t fd, const struct sockaddr *to, const void* buf, size_t size); TINYNET_API int tnet_sockfd_recvfrom(tnet_fd_t fd, void* buf, size_t size, int flags, struct sockaddr *from); -TINYNET_API int tnet_sockfd_send(tnet_fd_t fd, void* buf, size_t size, int flags); +TINYNET_API int tnet_sockfd_send(tnet_fd_t fd, const void* buf, size_t size, int flags); TINYNET_API int tnet_sockfd_recv(tnet_fd_t fd, void* buf, size_t size, int flags); TINYNET_API int tnet_sockfd_connetto(tnet_fd_t fd, const struct sockaddr_storage *to); diff --git a/trunk/tinySIP/src/authentication/tsip_challenge.c b/trunk/tinySIP/src/authentication/tsip_challenge.c index 6cb452fd..1419ee01 100644 --- a/trunk/tinySIP/src/authentication/tsip_challenge.c +++ b/trunk/tinySIP/src/authentication/tsip_challenge.c @@ -237,8 +237,7 @@ int tsip_challenge_get_response(tsip_challenge_t *self, const char* method, cons if(TSIP_CHALLENGE_IS_AKAv1(self) || TSIP_CHALLENGE_IS_AKAv2(self)){ char* akaresult = 0; tsip_challenge_get_akares(self, TSIP_CHALLENGE_STACK(self)->password, &akaresult); - if(thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, akaresult, &ha1)) - { + if(thttp_auth_digest_HA1(TSIP_CHALLENGE_USERNAME(self), self->realm, akaresult, &ha1)){ // return -1; } TSK_FREE(akaresult); @@ -260,12 +259,12 @@ int tsip_challenge_get_response(tsip_challenge_t *self, const char* method, cons if(self->nc){ THTTP_NCOUNT_2_STRING(self->nc, nc); } - thttp_auth_digest_response(&ha1, + thttp_auth_digest_response((const tsk_md5string_t *)&ha1, self->nonce, nc, self->cnonce, self->qop, - &ha2, + (const tsk_md5string_t *)&ha2, response); if(self->qop){ diff --git a/trunk/tinySIP/src/dialogs/tsip_dialog_layer.c b/trunk/tinySIP/src/dialogs/tsip_dialog_layer.c index 6f6f5e2b..cdc016f3 100644 --- a/trunk/tinySIP/src/dialogs/tsip_dialog_layer.c +++ b/trunk/tinySIP/src/dialogs/tsip_dialog_layer.c @@ -106,13 +106,18 @@ int tsip_dialog_layer_hangupAll(tsip_dialog_layer_t *self) { if(self) { - tsk_list_item_t *item; + tsk_list_item_t *item = 0; tsip_dialog_t *dialog; + + tsk_safeobj_lock(self); + tsk_list_foreach(item, self->dialogs) { dialog = item->data; tsip_dialog_hangup(dialog); } + + tsk_safeobj_unlock(self); return 0; } return -1; diff --git a/trunk/tinySIP/src/dialogs/tsip_dialog_publish.client.c b/trunk/tinySIP/src/dialogs/tsip_dialog_publish.client.c index 3a5be85a..e6daf783 100644 --- a/trunk/tinySIP/src/dialogs/tsip_dialog_publish.client.c +++ b/trunk/tinySIP/src/dialogs/tsip_dialog_publish.client.c @@ -668,4 +668,4 @@ static const tsk_object_def_t tsip_dialog_publish_def_s = tsip_dialog_publish_destroy, tsip_dialog_publish_cmp, }; -const void *tsip_dialog_publish_def_t = &tsip_dialog_publish_def_s; \ No newline at end of file +const void *tsip_dialog_publish_def_t = &tsip_dialog_publish_def_s; diff --git a/trunk/tinySIP/src/makefile b/trunk/tinySIP/src/makefile index 8a171fbe..78ce2bca 100644 --- a/trunk/tinySIP/src/makefile +++ b/trunk/tinySIP/src/makefile @@ -5,11 +5,11 @@ INSTALL_DIR = /system/lib CFLAGS := $(CFLAGS) CFLAGS += -I$(DOUBANGO_HOME)/$(PROJECT)/include CFLAGS += -I$(DOUBANGO_HOME)/tinySAK/src +CFLAGS += -I$(DOUBANGO_HOME)/tinyIPSec/src CFLAGS += -I$(DOUBANGO_HOME)/tinyNET/src CFLAGS += -I$(DOUBANGO_HOME)/tinyHTTP/include -CFLAGS += -I$(DOUBANGO_HOME)/thirdparties/android/include/smc -LDFLAGS := $(LDFLAGS) -Wl,-soname,lib$(PROJECT).so,-Bsymbolic,-shared,--whole-archive -ltinySAK -ltinyNET -ltinyHTTP +LDFLAGS := $(LDFLAGS) -Wl,-soname,lib$(PROJECT).so,-Bsymbolic,-shared,--whole-archive -ltinySAK -ltinyNET -ltinyHTTP -ltinyIPSec all: $(APP) @@ -42,6 +42,7 @@ OBJS += dialogs/tsip_dialog.o\ dialogs/tsip_dialog_invite.server.o\ dialogs/tsip_dialog_layer.o\ dialogs/tsip_dialog_message.o\ + dialogs/tsip_dialog_publish.client.o\ dialogs/tsip_dialog_register.client.o\ dialogs/tsip_dialog_register.server.o\ dialogs/tsip_dialog_subscribe.client.o\ @@ -70,6 +71,7 @@ OBJS += headers/tsip_header.o\ headers/tsip_header_Content_Type.o\ headers/tsip_header_CSeq.o\ headers/tsip_header_Date.o\ + headers/tsip_header_Dummy.o\ headers/tsip_header_Error_Info.o\ headers/tsip_header_Event.o\ headers/tsip_header_Expires.o\ @@ -161,7 +163,9 @@ OBJS += transactions/tsip_transac.o\ ## transport ################### OBJS += transports/tsip_transport.o\ - transports/tsip_transport_layer.o + transports/tsip_transport_ipsec.o\ + transports/tsip_transport_layer.o\ + transports/tsip_transport_tls.o $(APP): $(OBJS) $(CPP) $(LDFLAGS) -o $@ $^ diff --git a/trunk/tinySIP/src/transports/tsip_transport_ipsec.c b/trunk/tinySIP/src/transports/tsip_transport_ipsec.c index bc13f024..39cd06a2 100644 --- a/trunk/tinySIP/src/transports/tsip_transport_ipsec.c +++ b/trunk/tinySIP/src/transports/tsip_transport_ipsec.c @@ -507,4 +507,4 @@ static const tsk_object_def_t tsip_ipsec_association_def_s = tsip_ipsec_association_destroy, tsip_ipsec_association_cmp, }; -const void *tsip_ipsec_association_def_t = &tsip_ipsec_association_def_s; \ No newline at end of file +const void *tsip_ipsec_association_def_t = &tsip_ipsec_association_def_s; diff --git a/trunk/tinySIP/src/transports/tsip_transport_layer.c b/trunk/tinySIP/src/transports/tsip_transport_layer.c index e5468887..73563243 100644 --- a/trunk/tinySIP/src/transports/tsip_transport_layer.c +++ b/trunk/tinySIP/src/transports/tsip_transport_layer.c @@ -500,6 +500,8 @@ int tsip_transport_layer_start(const tsip_transport_layer_t* self) } } + ((tsip_transport_layer_t*)self)->running = 1; + return 0; } else return -2; @@ -512,7 +514,7 @@ int tsip_transport_layer_shutdown(const tsip_transport_layer_t* self) { if(self) { - if(!self->running) + if(self->running) { int ret = 0; tsk_list_item_t *item; @@ -556,7 +558,7 @@ static void* tsip_transport_layer_destroy(void * self) tsip_transport_layer_t *layer = self; if(layer) { - //tsip_transport_layer_shutdown(self); + tsip_transport_layer_shutdown(self); TSK_OBJECT_SAFE_FREE(layer->transports); } diff --git a/trunk/tinySIP/src/tsip.c b/trunk/tinySIP/src/tsip.c index 6bf6003d..5f1e84b1 100644 --- a/trunk/tinySIP/src/tsip.c +++ b/trunk/tinySIP/src/tsip.c @@ -487,8 +487,8 @@ int tsip_stack_stop(tsip_stack_handle_t *self) tsip_dialog_layer_hangupAll(stack->layer_dialog); //tsk_thread_sleep(50000000); - /* Stop timer manager. */ - ret = tsk_timer_manager_stop(stack->timer_mgr); + /* Do not Stop timer manager ==> Dialogs have ref to the stack and rely on the timer manager(to gracefully shutdown).*/ + //ret = tsk_timer_manager_stop(stack->timer_mgr); if(ret = tsk_runnable_stop(TSK_RUNNABLE(stack))){ //return ret; @@ -711,6 +711,8 @@ static void* tsip_stack_destroy(void * self) TSK_OBJECT_SAFE_FREE(stack->layer_dialog); TSK_OBJECT_SAFE_FREE(stack->layer_transac); TSK_OBJECT_SAFE_FREE(stack->layer_transport); + + TSK_DEBUG_INFO("STACK - DESTROYED"); } return self; } @@ -722,4 +724,4 @@ static const tsk_object_def_t tsip_stack_def_s = tsip_stack_destroy, 0, }; -const void *tsip_stack_def_t = &tsip_stack_def_s; \ No newline at end of file +const void *tsip_stack_def_t = &tsip_stack_def_s; diff --git a/trunk/tinySIP/test/test/makefile b/trunk/tinySIP/test/test/makefile index 6e97c246..d2991bb0 100644 --- a/trunk/tinySIP/test/test/makefile +++ b/trunk/tinySIP/test/test/makefile @@ -5,9 +5,8 @@ CFLAGS += -I$(DOUBANGO_HOME)/$(PROJECT)/include CFLAGS += -I$(DOUBANGO_HOME)/tinySAK/src CFLAGS += -I$(DOUBANGO_HOME)/tinyNET/src CFLAGS += -I$(DOUBANGO_HOME)/tinyHTTP/include -CFLAGS += -I$(DOUBANGO_HOME)/thirdparties/android/include/smc -LDFLAGS := $(LDFLAGS) -Bsymbolic -ltinySAK -ltinyNET -ltinyHTTP -l$(PROJECT) +LDFLAGS := $(LDFLAGS) -Bsymbolic -ltinySAK -ltinyNET -ltinyHTTP -ltinyIPSec -l$(PROJECT) all: $(APP) diff --git a/trunk/tinySIP/test/test/test.c b/trunk/tinySIP/test/test/test.c index 42d07d51..de972a19 100644 --- a/trunk/tinySIP/test/test/test.c +++ b/trunk/tinySIP/test/test/test.c @@ -53,7 +53,6 @@ int _tmain(int argc, _TCHAR* argv[]) int main() #endif { - tsip_global_init(); #if RUN_TEST_LOOP diff --git a/trunk/tinySIP/test/test/test_stack.h b/trunk/tinySIP/test/test/test_stack.h index 209cf83d..83feb37b 100644 --- a/trunk/tinySIP/test/test/test_stack.h +++ b/trunk/tinySIP/test/test/test_stack.h @@ -254,7 +254,7 @@ void test_stack() TSIP_STACK_SET_REALM("sip:"DOMAIN), // FIXME: without sip: TSIP_STACK_SET_LOCAL_IP(LOCAL_IP), //TSIP_STACK_SET_DISCOVERY_NAPTR(1), - TSIP_STACK_SET_PROXY_CSCF("192.168.0.11", "udp", 0), + TSIP_STACK_SET_PROXY_CSCF("192.168.0.11", "tcp", 0), //TSIP_STACK_SET_PROXY_CSCF("192.168.0.15", "udp", 0), TSIP_STACK_SET_PROXY_CSCF_PORT(5081), //TSIP_STACK_SET_SECAGREE_IPSEC("hmac-md5-96", "null", "trans", "esp"), @@ -382,6 +382,11 @@ bail: TSK_OBJECT_SAFE_FREE(op); TSK_OBJECT_SAFE_FREE(stack); + + TSK_DEBUG_INFO("=================="); + TSK_DEBUG_INFO("=================="); + TSK_DEBUG_INFO("=================="); + TSK_DEBUG_INFO("=================="); }