Update android support.

This commit is contained in:
bossiel 2010-03-07 20:26:45 +00:00
parent 0310ec9cd4
commit 4d7b3381e4
42 changed files with 621 additions and 94 deletions

View File

@ -246,6 +246,7 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
<cconfiguration id="0.861580449.471602204">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.861580449.471602204" moduleId="org.eclipse.cdt.core.settings" name="release">
@ -490,6 +491,7 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">

View File

@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="0.1047579928">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1047579928" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="tinyIPSec" buildProperties="" description="" id="0.1047579928" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.1047579928." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1069654525" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.1069654525.621337982" name=""/>
<builder arguments="OPTIONS=&quot;-O0 -g3 -DDEBUG_LEVEL=DEBUG_LEVEL_INFO&quot; -j1" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.1497076629" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1182995675" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.689903073" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1857741920" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1687322631" name="UPC" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1767952175" languageId="org.eclipse.cdt.core.parser.upc.upc" languageName="UPC" sourceContentType="org.eclipse.cdt.core.parser.upc.upcSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.125241707" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.262120431" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1519701795" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1039698159" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="false"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="false"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="0.1047579928">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="false"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="false" filePath=""/>
<parser enabled="false"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="tinyIPSec.null.1426757898" name="tinyIPSec"/>
</storageModule>
</cproject>

View File

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tinyIPSec</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value>OPTIONS=&quot;-O0 -g3 -DDEBUG_LEVEL=DEBUG_LEVEL_INFO&quot;</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>false</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>src</name>
<type>2</type>
<location>C:/Projects/Doubango/tinyIPSec/src</location>
</link>
<link>
<name>test</name>
<type>2</type>
<location>C:/Projects/Doubango/tinyIPSec/test</location>
</link>
</linkedResources>
</projectDescription>

View File

@ -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)

View File

@ -25,7 +25,7 @@
<builder arguments="OPTIONS=&quot;-O0 -g3 -DDEBUG_LEVEL=DEBUG_LEVEL_INFO&quot;" autoBuildTarget="all" cleanBuildTarget="clean" command="make" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.settings.default.builder.1108010119" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="1" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.3257326" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1957503900" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1763668133" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols"/>
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1763668133" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols"/>
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.2092821952" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
</tool>
<tool id="org.eclipse.cdt.build.core.settings.holder.1724636093" name="UPC" superClass="org.eclipse.cdt.build.core.settings.holder">

View File

@ -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))

View File

@ -74,4 +74,4 @@ TINYHTTP_GEXTERN const void *thttp_stack_def_t;
THTTP_END_DECLS
#endif /* TINYHTTP_THTTP_H */
#endif /* TINYHTTP_THTTP_H */

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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
###################

View File

@ -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;
const void *thttp_message_def_t = &thttp_message_def_s;

View File

@ -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;
const void *thttp_operation_def_t = &thttp_operation_def_s;

View File

@ -27,4 +27,5 @@
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinyHTTP/thttp_transport.h"
#include "tinyHTTP/thttp_transport.h"

View File

@ -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)

View File

@ -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)

View File

@ -34,8 +34,8 @@
#include "tipsec_common.h"
TSK_BEGIN_DECLS
TIPSEC_BEGIN_DECLS
TSK_END_DECLS
TIPSEC_END_DECLS
#endif /* TINYIPSEC_IPSEC_H */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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)

View File

@ -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 <stdio.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
*/
#ifndef TEST_TINYIPSEC_STDAFX_H
#define TEST_TINYIPSEC_STDAFX_H
#include "targetver.h"
#include <stdio.h>
#if (defined(_WIN32) || defined(WIN32) || defined(_WIN32_WCE)) && !defined(__SYMBIAN32__)
#include <tchar.h>
#endif
// TODO: reference additional headers your program requires here
#endif /* TEST_TINYIPSEC_STDAFX_H */

View File

@ -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. ) */

View File

@ -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
###################

View File

@ -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

View File

@ -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;
const void *tnet_tls_socket_def_t = &tnet_tls_socket_def_s;

View File

@ -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);

View File

@ -53,6 +53,7 @@ typedef enum tnet_transport_event_type_e
{
event_data,
event_closed,
event_error,
event_connected
}
tnet_transport_event_type_t;

View File

@ -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; i<context->count; 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;
}

View File

@ -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; i<context->count; 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;
}

View File

@ -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

View File

@ -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);

View File

@ -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){

View File

@ -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;

View File

@ -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;
const void *tsip_dialog_publish_def_t = &tsip_dialog_publish_def_s;

View File

@ -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 $@ $^

View File

@ -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;
const void *tsip_ipsec_association_def_t = &tsip_ipsec_association_def_s;

View File

@ -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);
}

View File

@ -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;
const void *tsip_stack_def_t = &tsip_stack_def_s;

View File

@ -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)

View File

@ -53,7 +53,6 @@ int _tmain(int argc, _TCHAR* argv[])
int main()
#endif
{
tsip_global_init();
#if RUN_TEST_LOOP

View File

@ -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("==================");
}