فهرست منبع

【删减】未用到的文件

Signed-off-by: MurphyZhao <d2014zjt@163.com>
MurphyZhao 7 سال پیش
والد
کامیت
d807d61266
100فایلهای تغییر یافته به همراه0 افزوده شده و 13367 حذف شده
  1. 0 55
      iotkit-embedded/build-rules/_rules-complib.mk
  2. 0 41
      iotkit-embedded/build-rules/_rules-coverage.mk
  3. 0 35
      iotkit-embedded/build-rules/_rules-dist.mk
  4. 0 149
      iotkit-embedded/build-rules/_rules-flat.mk
  5. 0 35
      iotkit-embedded/build-rules/_rules-kmod.mk
  6. 0 80
      iotkit-embedded/build-rules/_rules-libs.mk
  7. 0 32
      iotkit-embedded/build-rules/_rules-modinfo.mk
  8. 0 120
      iotkit-embedded/build-rules/_rules-origin.mk
  9. 0 20
      iotkit-embedded/build-rules/_rules-prefix.mk
  10. 0 65
      iotkit-embedded/build-rules/_rules-prog.mk
  11. 0 16
      iotkit-embedded/build-rules/_rules-repo.mk
  12. 0 136
      iotkit-embedded/build-rules/_rules-submods.mk
  13. 0 194
      iotkit-embedded/build-rules/_rules-top.mk
  14. 0 41
      iotkit-embedded/build-rules/docs/Build-System-Config.md
  15. 0 16
      iotkit-embedded/build-rules/docs/Build-System-Debug.md
  16. 0 124
      iotkit-embedded/build-rules/docs/Build-System-Introduction.md
  17. 0 39
      iotkit-embedded/build-rules/docs/Build-System-Proj.md
  18. 0 130
      iotkit-embedded/build-rules/docs/Build-System-Units.md
  19. 0 23
      iotkit-embedded/build-rules/docs/Help.md
  20. 0 172
      iotkit-embedded/build-rules/funcs.mk
  21. 0 23
      iotkit-embedded/build-rules/hooks/pre-commit
  22. 0 2426
      iotkit-embedded/build-rules/misc/Doxyfile.tpl
  23. 0 2
      iotkit-embedded/build-rules/misc/config.generic.default
  24. 0 159
      iotkit-embedded/build-rules/misc/cut.c
  25. 0 247
      iotkit-embedded/build-rules/misc/cut.h
  26. 0 194
      iotkit-embedded/build-rules/pre-build.sh
  27. 0 173
      iotkit-embedded/build-rules/rules.mk
  28. 0 40
      iotkit-embedded/build-rules/scripts/add_license.sh
  29. 0 10
      iotkit-embedded/build-rules/scripts/del_license.sh
  30. 0 25
      iotkit-embedded/build-rules/scripts/exe_coverage_progs.sh
  31. 0 82
      iotkit-embedded/build-rules/scripts/gen_lcov_report.sh
  32. 0 65
      iotkit-embedded/build-rules/scripts/ops_repository.sh
  33. 0 64
      iotkit-embedded/build-rules/scripts/stats_static_lib.sh
  34. 0 83
      iotkit-embedded/build-rules/settings.mk
  35. 0 6
      iotkit-embedded/cmake/modules/iotx-sdk-version.cmake
  36. 0 21
      iotkit-embedded/doc/config.mdm9206.sim7000c
  37. 0 6
      iotkit-embedded/doc/export.sdk.demo/coap.mk
  38. 0 13
      iotkit-embedded/doc/export.sdk.demo/head.mk
  39. 0 16
      iotkit-embedded/doc/export.sdk.demo/head_id2.mk
  40. 0 6
      iotkit-embedded/doc/export.sdk.demo/http.mk
  41. 0 6
      iotkit-embedded/doc/export.sdk.demo/mqtt.mk
  42. 0 16
      iotkit-embedded/doc/make.settings.sections/README.md
  43. 0 35
      iotkit-embedded/doc/make.settings.sections/enum_config.sh
  44. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.1
  45. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.2
  46. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.3
  47. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.1
  48. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.2
  49. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.3
  50. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.1
  51. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.2
  52. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.3
  53. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.1
  54. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.2
  55. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.3
  56. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.1
  57. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.2
  58. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.3
  59. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.1
  60. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.2
  61. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.3
  62. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.1
  63. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.2
  64. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.3
  65. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.1
  66. 0 11
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.2
  67. 0 10
      iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.3
  68. 0 3
      iotkit-embedded/doc/make.settings.sections/section.1.1
  69. 0 3
      iotkit-embedded/doc/make.settings.sections/section.1.2
  70. 0 3
      iotkit-embedded/doc/make.settings.sections/section.1.3
  71. 0 3
      iotkit-embedded/doc/make.settings.sections/section.1.4
  72. 0 1
      iotkit-embedded/doc/make.settings.sections/section.2.1
  73. 0 1
      iotkit-embedded/doc/make.settings.sections/section.2.2
  74. 0 2
      iotkit-embedded/doc/make.settings.sections/section.3.1
  75. 0 2
      iotkit-embedded/doc/make.settings.sections/section.3.2
  76. 0 1
      iotkit-embedded/doc/make.settings.sections/section.3.3
  77. 0 9
      iotkit-embedded/doc/website.documents/Board_List.md
  78. 0 301
      iotkit-embedded/doc/website.documents/C-SDK_Usage.md
  79. 0 234
      iotkit-embedded/doc/website.documents/Porting_Guider.md
  80. 0 102
      iotkit-embedded/doc/website.documents/Quick_Start.md
  81. 0 106
      iotkit-embedded/doc/website.documents/SDK_Download.md
  82. 0 498
      iotkit-embedded/src/import/mdm9206/example/iotkit_demo.c
  83. 0 70
      iotkit-embedded/src/import/mdm9206/example/iotkit_hal.c
  84. 0 334
      iotkit-embedded/src/import/mdm9206/include/qapi_ali_iot.h
  85. 0 20
      iotkit-embedded/src/import/mdm9206/include/qapi_ali_iot_txm_base.h
  86. 0 105
      iotkit-embedded/src/import/mdm9206/include/qapi_txm_base.h
  87. 0 43
      iotkit-embedded/src/import/mdm9206/include/txm_module.h
  88. 0 669
      iotkit-embedded/src/import/ubuntu/include/itls/check_config.h
  89. 0 709
      iotkit-embedded/src/import/ubuntu/include/itls/cipher.h
  90. 0 82
      iotkit-embedded/src/import/ubuntu/include/itls/config.h
  91. 0 228
      iotkit-embedded/src/import/ubuntu/include/itls/debug.h
  92. 0 37
      iotkit-embedded/src/import/ubuntu/include/itls/mbedtls_auth.h
  93. 0 354
      iotkit-embedded/src/import/ubuntu/include/itls/md.h
  94. 0 31
      iotkit-embedded/src/import/ubuntu/include/itls/net.h
  95. 0 225
      iotkit-embedded/src/import/ubuntu/include/itls/net_sockets.h
  96. 0 351
      iotkit-embedded/src/import/ubuntu/include/itls/platform.h
  97. 0 27
      iotkit-embedded/src/import/ubuntu/include/itls/platform_alt.h
  98. 0 2622
      iotkit-embedded/src/import/ubuntu/include/itls/ssl.h
  99. 0 494
      iotkit-embedded/src/import/ubuntu/include/itls/ssl_ciphersuites.h
  100. 0 200
      iotkit-embedded/src/import/ubuntu/include/tfs/tfs.h

+ 0 - 55
iotkit-embedded/build-rules/_rules-complib.mk

@@ -1,55 +0,0 @@
-.PHONY: comp-lib
-
-ifdef COMP_LIB
-ifeq (dynamic,$(CONFIG_LIB_EXPORT))
-define Finalize_CompLib
-( \
-    $(CC) -shared -Os -o $(2)/lib$(3).so $(1) $(LDFLAGS); \
-)
-endef
-define Info_CompLib
-( \
-	EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \
-\
-    echo -ne "\033[1;32m"; \
-    printf "\r%-32s%s\n" "[AR] lib$(1).a" "<=      "; \
-    for i in $${EXIST_OBJS}; do \
-        printf "%-32s%s\n" "" "   $${i}"|$(SED) 's:$(LIBOBJ_TMPDIR)/::g'; \
-    done; \
-    echo -ne "\033[0m"; \
-)
-endef
-else
-define Finalize_CompLib
-( \
-	EXIST_OBJS="$$(ls $(1) 2>/dev/null)"; \
-\
-	if [ "$${EXIST_OBJS}" != "" ]; then \
-	    $(AR) -rcs $(2)/lib$(3).a $${EXIST_OBJS}; \
-	fi \
-)
-endef
-define Info_CompLib
-( \
-	EXIST_OBJS="$$(ls $(2) 2>/dev/null)"; \
-\
-    echo -ne "\033[1;35m"; \
-    printf "\r%-32s%s\n" "[AR] lib$(1).a" "<=      "; \
-    for i in $${EXIST_OBJS}; do \
-        printf "%-32s%s\n" "" "   $${i}"|$(SED) 's:$(LIBOBJ_TMPDIR)/::g'; \
-    done; \
-    echo -ne "\033[0m"; \
-)
-endef
-endif # dynamic
-endif # COMP_LIB
-
-comp-lib: toolchain
-ifdef COMP_LIB
-	$(TOP_Q)+( \
-	if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
-	    $(call Build_CompLib,FORCE) \
-	fi)
-else
-	$(Q)true
-endif

+ 0 - 41
iotkit-embedded/build-rules/_rules-coverage.mk

@@ -1,41 +0,0 @@
-.PHONY: coverage lcov test
-
-ifneq (,$(COVERAGE_LIST))
-COVERAGE_PROGS  := \(
-COVERAGE_PROGS  += $(COVERAGE_LIST)
-COVERAGE_PROGS  += \)
-COVERAGE_CMD    := $(RULE_DIR)/scripts/exe_coverage_progs.sh
-endif
-
-ifeq (,$(COVERAGE_CMD))
-coverage lcov test:
-	@echo "COVERAGE_CMD not defined, skip"
-else
-coverage lcov test: all $(UTEST_RECP)
-#
-#	SKIP --coverage existing in $(CFLAGS) check for now
-#
-	$(Q)rm -rf $(OUTPUT_DIR)/$(LCOV_DIR) $(DIST_DIR)/$(LCOV_DIR)
-	$(Q)rm -f $(OUTPUT_DIR)/{files,tests,all,final}.info
-	$(Q)find $(OUTPUT_DIR) -name "*.gcno" -o -name "*.gcda" -exec rm -f {} \;
-	$(Q)OUTPUT_DIR=$(OUTPUT_DIR) bash <($(SED) '2iPROGS=$(COVERAGE_PROGS)' $(COVERAGE_CMD)) || true
-	$(Q)lcov --quiet \
-	    --capture --initial --directory $(OUTPUT_DIR)/ \
-	    -o $(OUTPUT_DIR)/files.info
-	$(Q)lcov --quiet \
-	    --capture --directory $(OUTPUT_DIR) \
-	    -o $(OUTPUT_DIR)/tests.info
-	$(Q)lcov --quiet \
-	    --add-tracefile $(OUTPUT_DIR)/files.info \
-	    --add-tracefile $(OUTPUT_DIR)/tests.info \
-	    -o $(OUTPUT_DIR)/all.info
-	$(Q)lcov --quiet \
-	    --remove $(OUTPUT_DIR)/all.info \
-	    -o $(OUTPUT_DIR)/final.info '*.h'
-	$(Q)genhtml --quiet \
-	    --legend --no-branch-coverage -o $(OUTPUT_DIR)/$(LCOV_DIR) $(OUTPUT_DIR)/final.info
-	$(Q)cp -rf $(OUTPUT_DIR)/$(LCOV_DIR) $(DIST_DIR)/$(LCOV_DIR)
-	$(Q)cd $(DIST_DIR)/$(LCOV_DIR) && \
-	    $(SED) -i 's:\(coverFile.*\)>$(OUTPUT_DIR)/:\1>:g' index.html
-	$(Q)bash $(RULE_DIR)/scripts/gen_lcov_report.sh $(DIST_DIR)/$(LCOV_DIR)
-endif

+ 0 - 35
iotkit-embedded/build-rules/_rules-dist.mk

@@ -1,35 +0,0 @@
-
-final-out: sub-mods
-ifneq (,$(COMP_LIB_NAME))
-	$(TOP_Q) \
-	if  [ ! -f $(SYSROOT_LIB)/lib$(COMP_LIB_NAME).a ] && \
-	    [ ! -f $(SYSROOT_LIB)/lib$(COMP_LIB_NAME).so ]; then \
-	    $(call Build_CompLib, FORCE) \
-	fi;
-endif
-
-	$(TOP_Q) \
-	if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
-	    rm -rf $(DIST_DIR); \
-	    mkdir -p $(DIST_DIR) $(FINAL_DIR); \
-	    for i in bin lib include; do \
-	        if [ -d $(OUTPUT_DIR)/usr/$${i} ]; then \
-	            cp -rf $(OUTPUT_DIR)/usr/$${i} $(FINAL_DIR); \
-	        fi; \
-	    done; \
-	    VDR_NAME=$$(grep -m 1 "VENDOR *:" $(CONFIG_TPL) 2>/dev/null|awk '{ print $$NF }'); \
-	    if [ "$$(ls $(IMPORT_DIR)/$${VDR_NAME}/$(PREBUILT_LIBDIR)/lib* 2>/dev/null)" != "" ]; then \
-	        cp -f $(IMPORT_DIR)/$${VDR_NAME}/$(PREBUILT_LIBDIR)/lib* $(FINAL_DIR)/lib; \
-	    fi; \
-	fi
-
-	$(TOP_Q) \
-	if [ "$$(ls $(FINAL_DIR)/bin/)" != "" ]; then \
-	    $(STRIP) $(FINAL_DIR)/bin/* 2>/dev/null || (echo "$(STRIP) $(FINAL_DIR)/bin/* failed!" && exit 1); \
-	fi
-	$(TOP_Q) \
-	if [ "$$(ls $(FINAL_DIR)/lib/*.so 2>/dev/null)" != "" ]; then \
-	    $(STRIP) $(STRIP_DBGOPT) $(FINAL_DIR)/lib/*.so 2>/dev/null || (echo "$(STRIP) $(FINAL_DIR)/lib/*.so failed!" && exit 1); \
-	fi
-
-	$(TOP_Q)+$(call $(POST_FINAL_OUT_HOOK))

+ 0 - 149
iotkit-embedded/build-rules/_rules-flat.mk

@@ -1,149 +0,0 @@
-ifneq ($(TOP_DIR),$(CURDIR))
-INTERNAL_INCLUDES += -I$(SYSROOT_INC)
-INTERNAL_INCLUDES += $(foreach d, $(shell find $(SYSROOT_INC) -type d), -I$(d))
-INTERNAL_INCLUDES += -I$(TOP_DIR)
-INTERNAL_INCLUDES += -I$(IMPORT_DIR)
-INTERNAL_INCLUDES += -I$(IMPORT_DIR)/include
-INTERNAL_INCLUDES += \
-$(foreach d, \
-    $(shell [ -d $(IMPORT_DIR)/$(CONFIG_VENDOR) ] && find -L $(IMPORT_DIR)/$(CONFIG_VENDOR)/include -type d), \
-    -I$(d) \
-)
-INTERNAL_INCLUDES += $(foreach mod, $(MODULE_NAME) $(HDR_REFS), \
-    $(foreach d, \
-        $(shell [ -d $(TOP_DIR)/$(mod) ] && \
-            find -L $(TOP_DIR)/$(mod)/ -type d \
-                -a -name "[^.]*" \
-                -not -path "*.git*"), \
-        -I$(d) \
-    ) \
-)
-
-# INTERNAL_INCLUDES += \
-    $(foreach d, \
-        $(shell find $(OUTPUT_DIR)/$(MODULE_NAME) -type d -a -name "[^.]*"), \
-        -I$(d) \
-    )
-
-INTERNAL_INCLUDES := $(strip $(sort $(INTERNAL_INCLUDES)))
-
-EXTERNAL_INCLUDES += $(foreach mod, $(DEPENDS), \
-    $(foreach d, \
-        $(shell $(SHELL_DBG) find \
-            $(SYSROOT_INC)/$(mod)/ -maxdepth 2 -type d 2>/dev/null) \
-        $(shell $(SHELL_DBG) find \
-            $(IMPORT_VDRDIR)/include/$(mod)/ -maxdepth 2 -type d 2>/dev/null), \
-        -I$(d) \
-    ) \
-)
-EXTERNAL_INCLUDES := $(strip $(EXTERNAL_INCLUDES))
-endif   # ifneq ($(TOP_DIR),$(CURDIR))
-
-ifeq (dynamic,$(strip $(CONFIG_LIB_EXPORT)))
-CFLAGS  += -fPIC
-endif
-
-CFLAGS  := $(sort $(strip $(CFLAGS)))
-
-LDFLAGS += -L$(SYSROOT_LIB)
-ifeq (y,$(shell [ -d $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR) ] && echo y))
-LDFLAGS += -L$(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)
-endif
-
-LDFLAGS += $(foreach d,$(DEPENDS_$(MODULE_NAME)),$(REF_LDFLAGS_$(d)))
-
-WATCHED_VARS = \
-    TARGET \
-    CFLAGS \
-    CC \
-    LDFLAGS \
-    CURDIR \
-    INTERNAL_INCLUDES \
-    DEPENDS \
-    MAKECMDGOALS \
-    EXTERNAL_INCLUDES \
-    LIBA_TARGET \
-    LIBSO_TARGET \
-
-ALL_TARGETS := $(TARGET) $(LIBSO_TARGET) $(LIBA_TARGET) $(firstword $(KMOD_TARGET))
-
-ifneq (,$(strip $(PKG_SWITCH)))
-all: $(ALL_TARGETS)
-else
-all:
-	$(Q)true
-endif
-
-clean:
-	$(Q)rm -f \
-        $(strip \
-            $(ALL_TARGETS) $(OBJS) $(LIB_OBJS) \
-            $(OBJS:.o=.d) $(LIB_OBJS:.o=.d) \
-            $(LIB_OBJS:.o=.gcno) $(LIB_OBJS:.o=.gcda) \
-        ) \
-        *.o.e *.d *.o *.a *.so *.log *.gc*
-
-%.o: %.c $(HD_MAKEFILE)
-	@$(call Brief_Log,"CC")
-	$(call Inspect_Env,$(WATCHED_VARS))
-	$(Q) \
-	set -o pipefail; \
-	$(CC) -I$(CURDIR) \
-	    $(INTERNAL_INCLUDES) \
-	    $(EXTERNAL_INCLUDES) \
-	    $(CFLAGS) \
-	    -c -o $@ $<
-ifneq (,$(OBJCOPY_FLAGS))
-	$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) $@
-endif
-
-NODEP_LIST = \
-    $(SYSROOT_INC)/git_version.h \
-    $(SYSROOT_INC)/platform.h \
-    $(SYSROOT_INC)/product.h \
-    $(SYSROOT_INC)/product_config.h \
-
-ifneq (,$(findstring gcc,$(CC)))
-ifeq (,$(filter modinfo,$(MAKECMDGOALS)))
-%.d: %.c
-	$(Q) \
-( \
-	D=$$(dirname $<|$(SED) 's:$(TOP_DIR):$(OUTPUT_DIR):1'); \
-	F=$$(basename $<); \
-	mkdir -p $${D}; \
-	$(CC) -MM -I$(CURDIR) \
-	    $(INTERNAL_INCLUDES) \
-	    $(EXTERNAL_INCLUDES) \
-	    $(CFLAGS) \
-	$< > $${D}/$${F}.$$$$; \
-	$(SED) -i 's!$(shell basename $*)\.o[ :]!$*.o:!1' $${D}/$${F}.$$$$; \
-	mv $${D}/$${F}.$$$$ $@; \
-)
-endif
-endif
-
-%.o: %.cpp
-	@$(call Brief_Log,"CC")
-	$(call Inspect_Env,$(WATCHED_VARS))
-	$(Q)$(CXX) -I$(CURDIR) \
-	    $(INTERNAL_INCLUDES) \
-	    $(EXTERNAL_INCLUDES) \
-	    $(CFLAGS) \
-	    -c -o $@ $<
-
-ifneq (,$(findstring gcc,$(CC)))
-%.d: %.cpp
-	$(Q) \
-	$(CXX) -MM -I$(CURDIR) \
-	    $(INTERNAL_INCLUDES) \
-	    $(EXTERNAL_INCLUDES) \
-	    $(CFLAGS) \
-	$< > $@.$$$$; \
-	$(foreach D,$(NODEP_LIST),$(SED) -i 's:$(D)::g' $@.$$$$;) \
-	$(SED) 's,\($*\)\.o[ :]*,\1.o $@: ,g' < $@.$$$$ > $@; \
-	rm -f $@.$$$$;
-endif
-
-include $(RULE_DIR)/_rules-libs.mk
-include $(RULE_DIR)/_rules-prog.mk
-include $(RULE_DIR)/_rules-kmod.mk

+ 0 - 35
iotkit-embedded/build-rules/_rules-kmod.mk

@@ -1,35 +0,0 @@
-ifdef KMOD_TARGET
-KMOD_NAME := $(subst .o,,$(obj-m))
-KMOD_OBJS := $(foreach mod, $(KMOD_NAME), $($(mod)-objs))
-KMOD_SRCS := $(subst .o,.c,$(KMOD_OBJS))
-KMOD_BUILD_DIR := $(CURDIR)/build-$(shell $(SHELL_DBG) basename $(CURDIR))-kmod
-KMOD_MAKEFILE := $(KMOD_BUILD_DIR)/Makefile
-
-$(firstword $(KMOD_TARGET)): $(KMOD_SRCS)
-	$(Q)rm -rf $(KMOD_BUILD_DIR) && mkdir -p $(KMOD_BUILD_DIR)
-	$(Q)cp -f $(KMOD_SRCS) $(KMOD_BUILD_DIR)
-	$(Q)echo "EXTRA_CFLAGS += " \
-	         "-I$(CURDIR)" \
-	         "$(INTERNAL_INCLUDES)" \
-	         | $(SED) 's/-I/\\\n    -I/g' \
-	         >> $(KMOD_MAKEFILE)
-	$(Q)echo "" >> $(KMOD_MAKEFILE)
-	$(Q)echo "obj-m := $(obj-m)" >> $(KMOD_MAKEFILE)
-	$(Q)echo "" >> $(KMOD_MAKEFILE)
-	$(Q) \
-	$(foreach mod, $(KMOD_NAME), \
-	    echo "$(mod)-objs := $($(mod)-objs)" \
-	    | $(SED) 's/ [_a-z]*\.o/ \\\n   &/g' \
-	    >> $(KMOD_MAKEFILE); \
-	    echo "" >> $(KMOD_MAKEFILE); \
-	)
-	@$(call Brief_Log,"CC",$(KMOD_TARGET))
-	$(Q) \
-	LDFLAGS=""; \
-	    $(MAKE) -C $(KERNEL_DIR) M=$(KMOD_BUILD_DIR) CROSS_COMPILE=$(CROSS_PREFIX) modules
-	$(Q)cp -f $(KMOD_BUILD_DIR)/*.ko $(CURDIR)
-	$(Q)mkdir -p $(SYSROOT_LIB)
-	$(Q)install -m 0755 $(KMOD_BUILD_DIR)/*.ko $(SYSROOT_LIB)
-
-endif   # ifdef KMOD_TARGET
-

+ 0 - 80
iotkit-embedded/build-rules/_rules-libs.mk

@@ -1,80 +0,0 @@
-VPATH    := $(TOP_DIR)/$(MODULE_NAME)
-LIB_SRCS ?= $(foreach M,*.c */*.c */*/*.c,$(wildcard $(TOP_DIR)/$(MODULE_NAME)/$(M))) $(wildcard *.c)
-LIB_OBJS := $(LIB_SRCS:.c=.o)
-LIB_OBJS := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(LIB_OBJS))
-
-ifdef LIB_SRCS_PATTERN
-SRC_LIST := $(foreach M,$(LIB_SRCS_PATTERN),$(shell ls $(TOP_DIR)/$(MODULE_NAME)/$(M) 2>/dev/null))
-LIB_SRCS := $(SRC_LIST)
-LIB_OBJS := $(SRC_LIST:.c=.o)
-LIB_OBJS := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(LIB_OBJS))
-endif
-
-sinclude $(LIB_OBJS:.o=.d)
-
-ifdef LIBA_TARGET
-.PHONY: StaticLib_Install
-
-ifeq (1,$(words $(LIBA_TARGET)))
-
-$(LIBA_TARGET) :: $(LIB_OBJS)
-	@$(call Brief_Log,"AR")
-	$(call Inspect_Env,$(WATCHED_VARS))
-	$(Q)rm -f $@
-ifdef CONFIG_LIBOBJ_STRIP
-	@$(call Brief_Log,"ST")
-	$(TOP_Q)$(STRIP) $(STRIP_DBGOPT) $(LIB_OBJS)
-endif
-	$(TOP_Q) \
-	if [ "$$(echo "$(LIB_OBJS)"|awk '{ print NF }')" != "0" ]; then \
-	    $(AR) -rcs $@ $(LIB_OBJS); \
-	fi
-
-$(LIBA_TARGET) :: StaticLib_Install
-	$(Q)mkdir -p $(LIBOBJ_TMPDIR)/$(MODULE_NAME)
-ifneq (,$(strip $(LIB_OBJS)))
-ifneq ($(LIBA_TARGET),$(LIBA_SKIP_COMBO))
-	$(Q)cp -f $(LIB_OBJS) $(LIBOBJ_TMPDIR)/$(MODULE_NAME)
-endif
-endif
-	$(Q)mkdir -p $(SYSROOT_LIB)
-	$(Q)if [ -f $@ ]; then cp -f $@ $(SYSROOT_LIB); fi
-	$(call Copy_Headers, $(LIB_HEADERS),$(SYSROOT_INC),$(LIB_HDRS_DIR))
-
-else
-
-$(foreach t,$(sort $(LIBA_TARGET)),$(t)): FORCE
-	$(Q) \
-	$(MAKE) LIBA_TARGET=$@ \
-	    LIB_SRCS="$(LIB_SRCS_$(subst .a,,$(subst lib,,$@)))" \
-	    LIB_SRCS_PATTERN="$(LIB_SRCS_PATTERN_$(subst .a,,$(subst lib,,$@)))" \
-
-
-endif   # ifeq (1,$(words $(LIBA_TARGET)))
-
-endif   # ifdef LIBA_TARGET
-
-ifdef LIBSO_TARGET
-.PHONY: DynamicLib_Install
-
-$(LIBSO_TARGET) :: SELF_LIBNAME = $(subst lib,,$(subst .so,,$(LIBSO_TARGET)))
-$(LIBSO_TARGET) :: LDFLAGS := $(filter-out -l$(SELF_LIBNAME), $(LDFLAGS))
-$(LIBSO_TARGET) :: $(LIB_OBJS) $(foreach d,$(DEPENDS_$(MODULE_NAME)),$(SYSROOT_LIB)/$(LIBA_TARGET_$(d)))
-	@$(call Brief_Log,"CC")
-	$(call Inspect_Env,$(WATCHED_VARS))
-	$(Q)$(CC) -shared -Os \
-	    $(CFLAGS) \
-	    $(RPATH_CFLAGS) \
-	    -o $@ \
-	    $(LIB_OBJS) \
-	    -Wl,--start-group $(LDFLAGS) -Wl,--end-group
-
-$(LIBSO_TARGET) :: DynamicLib_Install
-	$(Q)mkdir -p $(LIBOBJ_TMPDIR)/$(shell $(SHELL_DBG) basename $(CURDIR))
-	$(Q)cp -f $(LIB_OBJS) $(LIBOBJ_TMPDIR)/$(shell $(SHELL_DBG) basename $(CURDIR))
-	$(Q)mkdir -p $(SYSROOT_LIB)
-	$(Q)install -m 0755 $@ $(SYSROOT_LIB)
-	$(call Copy_Headers, $(LIB_HEADERS),$(SYSROOT_INC),$(LIB_HDRS_DIR))
-
-endif   # ifdef LIBSO_TARGET
-

+ 0 - 32
iotkit-embedded/build-rules/_rules-modinfo.mk

@@ -1,32 +0,0 @@
-.PHONY: modinfo
-
-modinfo:
-	@true
-
-MODINFO_VARS := \
-    EXTRA_SRCS \
-    PKG_SWITCH \
-    ORIGIN \
-    PKG_SOURCE \
-    PKG_BRANCH \
-    PKG_REVISION \
-    PKG_UPSTREAM \
-    REF_CFLAGS \
-    REF_LDFLAGS \
-    LDFLAGS \
-    LIBA_TARGET \
-    TARGET \
-    LIBSO_TARGET \
-
-$(if $(filter modinfo,$(MAKECMDGOALS)), \
-    $(if $(strip $(DEPENDS)), \
-        $(info DEPENDS_$(MODULE_NAME) = $(strip $(DEPENDS))) \
-    ) \
-)
-$(if $(filter modinfo,$(MAKECMDGOALS)), \
-    $(foreach v, $(MODINFO_VARS), \
-        $(if $(strip $($(v))), \
-            $(info $(v)_$(MODULE_NAME) = $(strip $($(v)))) \
-        ) \
-    ) \
-)

+ 0 - 120
iotkit-embedded/build-rules/_rules-origin.mk

@@ -1,120 +0,0 @@
-CFLAGS := $(filter-out -Werror,$(CFLAGS))
-LDFLAGS :=
-
-.PHONY: config build install post-install
-
-ORIGIN_Q ?= @
-ifeq ($(strip $(PKG_SWITCH)),y)
-all :
-ifeq ($(PKG_SOURCE),)
-$(error PKG_SOURCE for $(PKG_NAME) cannot be found!)
-endif
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(strip $(if $(filter 0 1,$(MAKELEVEL)), \
-	    "\r$(PKG_NAME) already pre-built at $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)\n","")); \
-	if  [ "$(LIBA_TARGET)"  != "" -a -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBA_TARGET) ] || \
-	    [ "$(LIBSO_TARGET)" != "" -a -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBSO_TARGET) ]; then \
-	    echo -ne $${MESSAGE}; \
-	    cp -P -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/{$(LIBA_TARGET),$(LIBSO_TARGET)*} \
-	        $(SYSROOT_LIB) 2>/dev/null; \
-	    for t in $(TARGET); do \
-	        cp -f $(IMPORT_VDRDIR)/$(PREBUILT_BINDIR)/$${t} $(SYSROOT_BIN); \
-	    done; \
-	    touch $(STAMP_SHIELD); \
-	fi
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already unpacked\n",""); \
-	if [ -f $(STAMP_SHIELD) ]; then true; \
-	elif [ -f $(STAMP_UNPACK) ]; then \
-	    echo -ne $${MESSAGE}; \
-	else \
-	    rm -rf $(PKG_NAME)* && \
-	    if [ -f $(PKG_SOURCE) ]; then \
-	        tar xf $(PKG_SOURCE) -C . && \
-	        for i in $(wildcard *.patch); do \
-	            cd $(PKG_NAME)* && patch -d . -p 1 < ../$${i} && cd $${OLDPWD}; \
-	        done \
-	    fi \
-	    && touch $(STAMP_UNPACK); \
-	fi
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already configured\n",""); \
-	if [ -f $(STAMP_SHIELD) ]; then true; \
-	elif [ -f $(STAMP_CONFIG) ]; then \
-	    echo -ne $${MESSAGE}; \
-	else \
-	    if grep -q 'config *:' $(HD_MAKEFILE); then \
-	        export SHELL=$(SHELL); \
-	        $(MAKE) config -f $(HD_MAKEFILE); \
-	    else \
-	        cd $(PKG_NAME)* && ( \
-	        ./configure \
-	            --prefix=$(OUTPUT_DIR)/usr \
-	            --host=$(HOST) \
-	            --target=$(shell $(SHELL_DBG) basename $(CROSS_PREFIX) 2>/dev/null) \
-	            --enable-static --enable-shared \
-	        || \
-	        ./configure \
-	            --prefix=$(OUTPUT_DIR)/usr \
-	            --host=$(HOST) \
-	            --target=$(shell $(SHELL_DBG) basename $(CROSS_PREFIX) 2>/dev/null|cut -d'-' -f1) \
-	            --enable-static --enable-shared \
-	        ) && cd $${OLDPWD}; \
-	    fi \
-	    && touch $(STAMP_CONFIG); \
-	fi
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already built\n",""); \
-	if [ -f $(STAMP_SHIELD) ]; then true; \
-	elif [ -f $(STAMP_BUILD) ]; then \
-	    echo -ne $${MESSAGE}; \
-	else \
-	    if grep -q 'build *:' $(HD_MAKEFILE); then \
-	        $(MAKE) build -f $(HD_MAKEFILE); \
-	    else \
-	        if [ -d $(PKG_NAME)* ]; then \
-	            cd $(PKG_NAME)* && $(MAKE) -j8 all && cd ..; \
-	        fi \
-	    fi \
-	    && touch $(STAMP_BUILD); \
-	fi
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already installed\n",""); \
-	if [ -f $(STAMP_SHIELD) ]; then true; \
-	elif [ -f $(STAMP_INSTALL) ]; then \
-	    echo -ne $${MESSAGE}; \
-	else \
-	    if grep -q 'install *:' $(HD_MAKEFILE); then \
-	        $(MAKE) install -f $(HD_MAKEFILE); \
-	    else \
-	        if [ -d $(PKG_NAME)* ]; then \
-	            cd $(PKG_NAME)* && $(MAKE) install && cd ..; \
-	        fi \
-	    fi \
-	    && touch $(STAMP_INSTALL); \
-	fi
-
-	$(ORIGIN_Q) \
-	MESSAGE=$(if $(filter 0 1,$(MAKELEVEL)),"\r$(PKG_NAME) already post-installed\n",""); \
-	if [ -f $(STAMP_POSTINS) ]; then \
-	    echo -ne $${MESSAGE}; \
-	else \
-	    if grep -q 'post-install *:' $(HD_MAKEFILE); then \
-	        $(MAKE) post-install -f $(HD_MAKEFILE); \
-	    fi \
-	    && touch $(STAMP_POSTINS); \
-	fi
-
-clean-prepare:
-	$(Q)rm -f $(STAMP_BUILD) $(STAMP_INSTALL) $(STAMP_POSTINS)
-else
-all:
-	$(Q)true
-clean:
-	$(Q)true
-endif   # ifeq ($(strip $(PKG_SWITCH)),y)

+ 0 - 20
iotkit-embedded/build-rules/_rules-prefix.mk

@@ -1,20 +0,0 @@
-CFLAGS  := $(sort $(CFLAGS) $(CONFIG_ENV_CFLAGS))
-LDFLAGS := $(sort $(LDFLAGS) $(CONFIG_ENV_LDFLAGS))
-
-ifeq (dynamic,$(CONFIG_LIB_EXPORT))
-CFLAGS  := $(filter-out --coverage,$(CFLAGS))
-endif
-
-MAKE_ENV_VARS := \
-$(foreach v, \
-    $(shell grep -o 'CONFIG_ENV_[_A-Z]*' $(CONFIG_TPL) 2>/dev/null), \
-        $(subst CONFIG_ENV_,,$(v)) \
-)
-
-# $(eval ...) causes '$' in CFLAGS lost
-MAKE_ENV_VARS := $(sort $(filter-out CFLAGS LDFLAGS,$(MAKE_ENV_VARS)))
-
-$(foreach V, \
-    $(MAKE_ENV_VARS), \
-        $(eval export $(V) := $(sort $(CONFIG_ENV_$(V)))) \
-)

+ 0 - 65
iotkit-embedded/build-rules/_rules-prog.mk

@@ -1,65 +0,0 @@
-VPATH   := $(TOP_DIR)/$(MODULE_NAME)
-SRCS    ?= $(foreach M,*.c */*.c */*/*.c,$(wildcard $(TOP_DIR)/$(MODULE_NAME)/$(M))) $(wildcard *.c)
-OBJS    := $(SRCS:.c=.o)
-OBJS    := $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(OBJS))
-
-ifdef SRCS_PATTERN
-PROG_LIST	:= $(foreach M,$(SRCS_PATTERN),$(shell ls $(TOP_DIR)/$(MODULE_NAME)/$(M) 2>/dev/null))
-SRCS 		:= $(PROG_LIST)
-OBJS 		:= $(PROG_LIST:.c=.o)
-OBJS 		:= $(subst $(TOP_DIR)/$(MODULE_NAME)/,,$(OBJS))
-endif
-
-ifdef TARGET
-
-ifneq (modinfo,$(MAKECMDGOALS))
-ifneq (clean,$(MAKECMDGOALS))
-sinclude $(OBJS:.o=.d)
-endif
-endif
-
-ifdef LIBA_TARGET
-$(TARGET): $(LIBA_TARGET)
-
-LDFLAGS := -l$(subst .a,,$(subst lib,,$(LIBA_TARGET))) $(LDFLAGS)
-endif
-
-ifdef LIBSO_TARGET
-$(TARGET): $(LIBSO_TARGET)
-
-LDFLAGS := -l$(subst .so,,$(subst lib,,$(LIBSO_TARGET))) $(LDFLAGS)
-endif
-
-LDFLAGS += $(sort $(CONFIG_ENV_LDFLAGS))
-
-ifneq (,$(filter %.cpp %.cc,$(SRCS)))
-CCLD    := $(CXX)
-else
-CCLD    := $(CC)
-endif
-
-ifeq (1,$(words $(TARGET)))
-
-$(TARGET): $(OBJS) FORCE
-	$(call Inspect_Env,$(WATCHED_VARS))
-	$(Q) \
-( \
-	if [ "$(strip $(CC))" = "gcc" ] || [ "$(filter -D_PLATFORM_IS_LINUX_,$(CFLAGS))" != "" ]; then \
-	    $(call Brief_Log,"LD"); \
-	    mkdir -p $(OUTPUT_DIR)${bindir}; \
-	    $(CCLD) $(CFLAGS) -o $@ \
-	        $(RPATH_CFLAGS) \
-	        $(OBJS) \
-	        $(LDFLAGS) && \
-	    cp -f $@ $(OUTPUT_DIR)${bindir}; \
-	fi; \
-)
-
-else
-
-$(foreach t,$(sort $(TARGET)),$(t)): FORCE
-	$(Q)$(MAKE) TARGET=$@ OBJS="$(SRCS_$@:.c=.o)"
-
-endif
-
-endif   # ifdef TARGET

+ 0 - 16
iotkit-embedded/build-rules/_rules-repo.mk

@@ -1,16 +0,0 @@
-OPS_CMDLINE_V := \
-    PACKAGE_DIR \
-    TOP_DIR \
-    STAMP_BLD_VAR \
-
-OPS_SCRIPT := \
-    $(strip $(foreach V, $(OPS_CMDLINE_V), $(V)="$($(V))")) \
-    $(SHELL) \
-    $(RULE_DIR)/scripts/ops_repository.sh \
-    $(STAMP_BLD_VAR)
-
-repo-list: config
-	$(TOP_Q)$(OPS_SCRIPT) list
-
-repo-update: config
-	$(TOP_Q)$(OPS_SCRIPT) update

+ 0 - 136
iotkit-embedded/build-rules/_rules-submods.mk

@@ -1,136 +0,0 @@
-SUB_LOG_OPTION := $(if $(Q),,| tee -a $(OUTPUT_DIR)/$${i}/$(COMPILE_LOG))
-ALL_LOG_OPTION := $(if $(Q),,| tee -a $(COMPILE_LOG))
-
-sub-mods: toolchain
-	$(Q) \
-	if [ -f $(STAMP_PRJ_CFG) ]; then true; else \
-	    set -o pipefail; \
-	    for i in \
-	        $$(echo $(IMPORT_DIR)|$(SED) 's:$(TOP_DIR)/*::g')/$(CONFIG_VENDOR)/platform \
-	        $(SUBDIRS); do \
-	            if [ ! -d $${i} ]; then continue; fi; \
-	            $(MAKE) --no-print-directory Q=$(Q) $${i} 2>&1 $(SUB_LOG_OPTION); \
-	            RETVAL=$$?; \
-	            if [ $${RETVAL} != 0 ]; then exit $${RETVAL}; fi; \
-	    done 2>&1 $(ALL_LOG_OPTION); \
-	fi
-
-SUB_BUILD_VARS := \
-    CFLAGS LDFLAGS \
-    PACKAGE_DIR \
-    IMPORT_DIR \
-    TOP_DIR \
-    RULE_DIR \
-    CONFIG_VENDOR \
-    COMP_LIB \
-    $(CROSS_CANDIDATES) \
-    $(MAKE_ENV_VARS) \
-    INSTALL_DIR \
-    INSTALL_LIB_DIR \
-    SYSROOT_INC \
-    KERNEL_DIR \
-    MAKE_ENV_VARS \
-    CROSS_PREFIX \
-    CROSS_CANDIDATES \
-    ALL_SUB_DIRS \
-
-CMDLINE_VARS := \
-    HD_MAKEFILE \
-    MAKE_SEGMENT \
-    OUTPUT_DIR \
-    PACKAGE_DIR \
-    STAMP_BLD_ENV \
-    STAMP_UNPACK \
-    TOP_DIR \
-    RULE_DIR \
-
-# When SUB_BUILD_VARS like $(CFLAGS) contains special character '$'
-# simply echo its value into 'Makefile' will cause '$' lost when GNU make read in again
-#
-$(STAMP_BLD_ENV): $(TOP_DIR)/makefile $(shell ls $(CONFIG_TPL) 2>/dev/null) \
-                  $(wildcard $(RULE_DIR)/*.mk) \
-                  $(shell grep "^ *include" $(TOP_DIR)/$(TOP_MAKEFILE)|awk '{ print $$NF }'|$(SED) '/^\$$/d')
-	@rm -f $@
-	@$(foreach V, \
-	    $(sort $(SUB_BUILD_VARS)), \
-	        echo "$(V) := $(sort $($(V)))"|$(SED) 's:\$$:$$$$:g' >> $(STAMP_BLD_ENV); \
-	)
-
-# note:
-#   $(SED) -i "/CONFIG_$${i//\//\\/}.*/d" $(CONFIG_TPL);
-# above
-#   $(SED) -i "1iCONFIG_$${i} = y" $(CONFIG_TPL)
-# was removed since modules will be skipped in some cases
-
-$(STAMP_BLD_VAR): $(foreach d,$(ALL_SUB_DIRS),$(d)/$(MAKE_SEGMENT)) $(STAMP_BLD_ENV) $(wildcard $(RULE_DIR)/*.mk)
-	$(TOP_Q) \
-( \
-	if [ ! -f $(STAMP_BLD_VAR) ]; then echo ""; VERBOSE=1; fi; \
-	rm -f $(STAMP_BLD_VAR); \
-	for i in $(shell echo "$(ALL_SUB_DIRS)"|tr ' ' '\n'|sort -u); do \
-	    if [ "$${VERBOSE}" != "" ]; then \
-	        if [ ! -L $${i} ]; then \
-	            printf "CONFIGURE .............................. [%s]\n" $${i}; \
-	        fi; \
-	        $(SED) -i "1iCONFIG_$${i} = y" $(CONFIG_TPL); \
-	        [ -f $(STAMP_POST_RULE) ] && $(SED) -i "/target-$${i//\//\\/}.*/d" $(STAMP_POST_RULE) || true; \
-	        echo "target-$${i}:; @true" >> $(STAMP_POST_RULE); \
-	    fi; \
-	    $(foreach V, $(CMDLINE_VARS), $(V)="$($(V))") \
-	        bash $(RULE_DIR)/pre-build.sh $${i} makefile-only > /dev/null; \
-	    if [ -d $(OUTPUT_DIR)/$${i} ]; then \
-	        $(MAKE) -s -C $(OUTPUT_DIR)/$${i} modinfo > /dev/null; \
-	        if [ $$? = 0 ]; then \
-	            $(MAKE) --no-print-directory -s -C $(OUTPUT_DIR)/$${i} modinfo >> $(STAMP_BLD_VAR); \
-	        else \
-	            echo ""; \
-	            echo "ERROR detected in '$${i}/$(MAKE_SEGMENT)'..."|grep --color '.*'; \
-	            echo ""; \
-	            rm -f $(STAMP_BLD_VAR) $(STAMP_PRJ_CFG); \
-	            exit 13; \
-	        fi \
-	    fi \
-	done; \
-	sort -o $(STAMP_BLD_VAR) $(STAMP_BLD_VAR); \
-	if [ "$${VERBOSE}" != "" ]; then echo ""; fi; \
-)
-
-pre-build: MOD = $(subst target-,,$(filter-out $@,$(MAKECMDGOALS)))
-pre-build: $(STAMP_BLD_ENV)
-	$(TOP_Q)rm -f $(OUTPUT_DIR)/$(MOD)/$(STAMP_UNPACK)
-	$(if $(filter 0,$(MAKELEVEL)),,@) \
-	$(strip $(foreach V, $(CMDLINE_VARS), $(V)="$($(V))") \
-	    PKG_SOURCE="$(PKG_SOURCE_$(MOD))" \
-	    PKG_BRANCH="$(PKG_BRANCH_$(MOD))" \
-	    PKG_REVISION="$(PKG_REVISION_$(MOD))" \
-	    PKG_UPSTREAM="$(PKG_UPSTREAM_$(MOD))" \
-	    PKG_SWITCH="$(PKG_SWITCH_$(MOD))" \
-	) \
-	$(if $(filter 0,$(MAKELEVEL)),VERBOSE_PRE_BLD=1) \
-	    bash $(RULE_DIR)/pre-build.sh $(subst target-,,$(filter-out $@,$(MAKECMDGOALS)))
-
-.PHONY: $(ALL_SUB_DIRS)
-
-$(ALL_SUB_DIRS): ALL_LOG_OPT = $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG))
-$(ALL_SUB_DIRS): SUB_LOG_OPT = $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$@/$(COMPILE_LOG))
-
-$(ALL_SUB_DIRS): $(if $(filter 0,$(MAKELEVEL)),toolchain) $(STAMP_BLD_VAR)
-	$(TOP_Q)rm -f $(STAMP_PRJ_CFG)
-	$(TOP_Q)$(MAKE) --no-print-directory pre-build target-$@
-ifeq (0,$(MAKELEVEL))
-	$(TOP_Q)$(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$@ clean
-endif
-	$(TOP_Q) \
-	if [ "$$( $(call Require_Build,$@) )" = "TRUE" ]; then \
-	    $(call Build_Depends,$@) && \
-	    $(call Build_CompLib,$@) && \
-	    $(call Update_Extra_Srcs,$(EXTRA_SRCS_$@),$@) && \
-	    $(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$@ all $(SUB_LOG_OPT) $(ALL_LOG_OPT) && \
-	    if [ "$$(echo $(ORIGIN_$@))" != "" ]; then \
-	        touch $(OUTPUT_DIR)/$@/{$(STAMP_UNPACK),$(STAMP_CONFIG),$(STAMP_BUILD),$(STAMP_INSTALL)}; \
-	    fi \
-	else \
-	    echo -ne "\r$$(printf '%40s' '')\r"; \
-	fi
-
-	@mkdir -p $(STAMP_DIR) && touch $(STAMP_DIR)/$$(echo "$@"|$(SED) 's:/:~:g').build.done

+ 0 - 194
iotkit-embedded/build-rules/_rules-top.mk

@@ -1,194 +0,0 @@
-.PHONY: doc detect config reconfig toolchain sub-mods final-out env help
-
-all: detect config toolchain sub-mods final-out
-	$(TOP_Q) \
-	if [ -f $(STAMP_PRJ_CFG) ]; then \
-	    $(RECURSIVE_MAKE) toolchain; \
-	    rm -f $(STAMP_PRJ_CFG); \
-	fi
-	@rm -rf $(STAMP_DIR)
-
-RESET_ENV_VARS := \
-    CROSS_PREFIX \
-    CFLAGS \
-    HOST \
-    LDFLAGS \
-
-help:
-	@echo -e "\033[1;37m[$(RULE_DIR)/docs]\e[0m"
-	@echo ""
-	@cat $(RULE_DIR)/docs/Help.md
-	@echo ""
-
-doc:
-	$(TOP_Q)rm -rf html
-	$(TOP_Q) \
-	$(SED) \
-	    's:^PROJECT_NAME.*:PROJECT_NAME = $(PRJ_NAME):g; s:^PROJECT_NUMBER.*:PROJECT_NUMBER = $(PRJ_VERSION):g' \
-	build-rules/misc/Doxyfile.tpl > $(OUTPUT_DIR)/.doxygen.cfg
-	$(TOP_Q)doxygen $(OUTPUT_DIR)/.doxygen.cfg
-
-detect:
-	@if [ -d .git ]; then \
-	    mkdir -p .git/hooks; \
-	    for i in $(RULE_DIR)/hooks/*; do \
-	        cp -f $$i .git/hooks && chmod a+x .git/hooks/$$(basename $$i); \
-	    done; \
-	fi
-
-unzip: config $(STAMP_BLD_VAR)
-	@echo "Components: "
-	@echo ""
-	@for i in $(ALL_SUB_DIRS); do \
-	    $(MAKE) --no-print-directory pre-build target-$${i} ; \
-	    echo -ne "\r. $${i}"; \
-	    echo -e "                                          "; \
-	done
-	@echo ""
-
-#	@for i in $$(grep "^ *include" $(TOP_DIR)/$(TOP_MAKEFILE)|awk '{ print $$NF }'|$(SED) '/^\$$/d'); do \
-#	    if [ $$i -nt $(CONFIG_TPL) ]; then \
-#	        echo "Re-configure project since '$${i}' updated"|grep --color ".*"; \
-#	        $(RECURSIVE_MAKE) reconfig; \
-#	    fi; \
-#	done
-#
-#	@if [ ! -d $(OUTPUT_DIR) ]; then \
-#	    echo "Re-configure project since '$(OUTPUT_DIR)' non-exist!"|grep --color ".*"; \
-#	    $(RECURSIVE_MAKE) reconfig; \
-#	fi
-
-config:
-
-	@mkdir -p $(OUTPUT_DIR) $(STAMP_DIR) $(INSTALL_DIR)
-	@mkdir -p $(SYSROOT_BIN) $(SYSROOT_INC) $(SYSROOT_LIB)
-
-	$(TOP_Q) \
-	if [ -f $(STAMP_BLD_VAR) ]; then \
-	    if [ "$$($(SED) '/[-_/a-zA-Z0-9]* = ..*/d' $(STAMP_BLD_VAR)|wc -l|$(SED) 's:^  *::g')" != "0" ]; then \
-	        rm -f $(STAMP_BLD_VAR); \
-	    fi \
-	fi
-
-	$(TOP_Q)+( \
-	if [ -f $(CONFIG_TPL) ]; then \
-	    if [ "$(filter comp-lib,$(MAKECMDGOALS))" = "" ]; then \
-	        printf "BUILDING WITH EXISTING CONFIGURATION:\n\n"; \
-	        command grep -m 1 "VENDOR *:" $(CONFIG_TPL)|cut -c 3-; \
-	        command grep -m 1 "MODEL *:" $(CONFIG_TPL)|cut -c 3-; \
-	        echo ""; \
-	    fi \
-	else \
-	    if [ "$(DEFAULT_BLD)" != "" ] && [ -f $(DEFAULT_BLD) ] && \
-	       ([ "$(DEFAULT_BLD)" = "$(RULE_DIR)/misc/config.generic.default" ] || [ "$(MAKECMDGOALS)" = "" ]); then \
-	        printf "# Automatically Generated Section End\n\n" >> $(CONFIG_TPL); \
-	        printf "# %-10s %s\n" "VENDOR :" $$(basename $(DEFAULT_BLD)|cut -d. -f2) >> $(CONFIG_TPL); \
-	        printf "# %-10s %s\n" "MODEL  :" $$(basename $(DEFAULT_BLD)|cut -d. -f3) >> $(CONFIG_TPL); \
-	        cat $(DEFAULT_BLD) >> $(CONFIG_TPL); \
-	    else \
-	        printf "SELECT A CONFIGURATION:\n\n"; \
-	        LIST=$$(for i in $(CONFIG_DIR)/config.*.*; do basename $${i}; done|sort); \
-	        select V in $${LIST}; do \
-	            echo ""; \
-	            printf "# Automatically Generated Section End\n\n" >> $(CONFIG_TPL); \
-	            printf "# %-10s %s\n" "VENDOR :" $$(echo $${V}|cut -d. -f2) >> $(CONFIG_TPL); \
-	            printf "# %-10s %s\n" "MODEL  :" $$(echo $${V}|cut -d. -f3) >> $(CONFIG_TPL); \
-	            cp -f -P $(IMPORT_DIR)/$$(echo $${V}|cut -d. -f2)/$(PREBUILT_LIBDIR)/*.so* $(SYSROOT_LIB) 2>/dev/null; \
-	            cat $(CONFIG_DIR)/$${V} >> $(CONFIG_TPL); \
-	            break; \
-	        done; \
-	    fi && \
-	    printf "SELECTED CONFIGURATION:\n\n" && \
-	    command grep -m 1 "VENDOR *:" $(CONFIG_TPL)|cut -c 3- && \
-	    command grep -m 1 "MODEL *:" $(CONFIG_TPL)|cut -c 3- && \
-	    echo ""; \
-	    if [ "$(MAKECMDGOALS)" = "config" ]; then true; else \
-	        if [ "$(DEFAULT_BLD)" = "" ]; then \
-	            touch $(STAMP_PRJ_CFG); \
-	        fi; \
-	    fi; \
-	    for i in $(RESET_ENV_VARS); do unset $${i}; done; \
-	    $(MAKE) --no-print-directory -f $(TOP_MAKEFILE) $(STAMP_BLD_VAR) unzip; \
-	fi)
-
-toolchain: VSP_TARBALL = $(shell $(SHELL_DBG) basename $(CONFIG_TOOLCHAIN_RPATH))
-toolchain: config
-ifneq ($(CONFIG_TOOLCHAIN_NAME),)
-ifeq (,$(CONFIG_TOOLCHAIN_RPATH))
-	@echo "Error! CONFIG_TOOLCHAIN_NAME defined, but CONFIG_TOOLCHAIN_RPATH undefined!" && exit 1
-else
-	$(TOP_Q) \
-( \
-	if [ -e $(OUTPUT_DIR)/$(CONFIG_TOOLCHAIN_NAME) ]; then \
-	    exit 0; \
-	fi; \
-\
-	if [ ! -d /tmp/$(CONFIG_TOOLCHAIN_NAME) -a -f /tmp/$(VSP_TARBALL) ]; then \
-	    echo "De-compressing Cached ToolChain ..." && \
-	    tar xf /tmp/$(VSP_TARBALL) -C /tmp; \
-	fi; \
-	if [ -d /tmp/$(CONFIG_TOOLCHAIN_NAME) ]; then \
-	    echo "Using Cached ToolChain ..." && \
-	    ln -sf /tmp/$(CONFIG_TOOLCHAIN_NAME) $(OUTPUT_DIR)/$(CONFIG_TOOLCHAIN_NAME); \
-	    exit 0; \
-	fi; \
-\
-	echo "Downloading ToolChain ..." && \
-	wget -O $(OUTPUT_DIR)/$(VSP_TARBALL) $(CONFIG_VSP_WEBSITE)/$(CONFIG_TOOLCHAIN_RPATH) && \
-	echo "De-compressing ToolChain ..." && \
-	tar xf $(OUTPUT_DIR)/$(VSP_TARBALL) -C $(OUTPUT_DIR); \
-	cp -f $(OUTPUT_DIR)/$(VSP_TARBALL) /tmp; \
-	rm -rf /tmp/$(CONFIG_TOOLCHAIN_NAME); \
-	tar xf /tmp/$(VSP_TARBALL) -C /tmp; \
-)
-endif
-endif
-
-reconfig: distclean
-	$(TOP_Q)+( \
-	if [ -d $(CONFIG_DIR) ]; then \
-	    $(RECURSIVE_MAKE) config DEFAULT_BLD=not-exist-actually; \
-	else \
-	    $(RECURSIVE_MAKE) config; \
-	fi)
-	$(TOP_Q)rm -f $(STAMP_PRJ_CFG)
-
-clean:
-	$(TOP_Q) \
-	for i in $(SUBDIRS) $(COMP_LIB_COMPONENTS); do \
-	    if [ -d $(OUTPUT_DIR)/$${i} ]; then \
-	        $(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$${i} clean; \
-	    fi \
-	done
-
-	$(TOP_Q) \
-	rm -rf \
-	        $(LIBOBJ_TMPDIR) \
-	        $(COMPILE_LOG) \
-	        $(DIST_DIR)/* \
-	        $(STAMP_DIR) \
-	        $(SYSROOT_INC)/* $(SYSROOT_LIB)/* $(SYSROOT_LIB)/../bin/* \
-	        $(shell $(SHELL_DBG) find $(OUTPUT_DIR) -name "$(COMPILE_LOG)" \
-	                             -o -name "$(WARNING_LOG)" \
-	                             -o -name "$(STAMP_BUILD)" \
-	                             -o -name "$(STAMP_INSTALL)" \
-	                             -o -name "$(STAMP_POSTINS)" \
-	        2>/dev/null)
-
-distclean:
-	$(TOP_Q) \
-	rm -rf \
-	    $(CONFIG_TPL) $(COMPILE_LOG) \
-	    $(STAMP_PRJ_CFG) $(STAMP_BLD_ENV) $(STAMP_BLD_VAR) $(STAMP_POST_RULE) \
-	    $(DIST_DIR) $(STAMP_DIR) \
-
-	$(TOP_Q) \
-	if [ -d $(OUTPUT_DIR) ]; then \
-	    cd $(OUTPUT_DIR); \
-	    if [ "$(CONFIG_TOOLCHAIN_NAME)" = "" ]; then \
-	        rm -rf *; \
-	    else \
-	        rm -rf $$(ls -I $(CONFIG_TOOLCHAIN_NAME)); \
-	    fi \
-	fi
-

+ 0 - 41
iotkit-embedded/build-rules/docs/Build-System-Config.md

@@ -1,41 +0,0 @@
-# 构建系统配置
-
-## 定制目录排布
-
-默认情况下, 构建系统采用如下的目录排布:
-
-    CONFIG_DIR      ?= $(TOP_DIR)/configs
-    DIST_DIR        ?= $(TOP_DIR)/output
-    FINAL_DIR       ?= $(DIST_DIR)/release
-    IMPORT_DIR      ?= $(TOP_DIR)/import
-    LCOV_DIR        ?= Coverage
-    MAKE_SEGMENT    ?= iot.mk
-    OUTPUT_DIR      ?= $(TOP_DIR)/.O
-    PACKAGE_DIR     ?= $(TOP_DIR)/packages
-    RULE_DIR        ?= $(TOP_DIR)/build-rules
-    TOP_DIR         ?= $(CURDIR)
-
-含义如下:
-
-| 变量名            | 说明                                      |
-|-------------------|-------------------------------------------|
-| `CONFIG_DIR`      | *硬件平台配置文件*的存放目录, 其中的文件需要以`config.XXX.YYY`形式命名, 其中`XXX`一般表示操作系统, `YYY`一般表示具体的硬件型号 |
-| `DIST_DIR`        | 最终的编译产物, 例如可执行程序, SDK的总库等, 存放的顶层目录 |
-| `FINAL_DIR`       | 最终的编译产物摆放时, 会放在`$(FINAL_DIR)`下, 这个变量可以指定最终摆放位置在顶层目录下的子目录路径 |
-| `IMPORT_DIR`      | 输入目录, 用于摆放预编译的二进制库, 以及使用这些预编译库对应的头文件 |
-| `LCOV_DIR`        | 覆盖率文件产生目录, 用于存放`lcov`软件产生的中间文件和最终的`HTML`格式图形化文件 |
-| `MAKE_SEGMENT`    | 构建单元中的片段文件, 开发者唯一需要编辑的文件, 指导构建系统如何编译该文件所在的构建单元 |
-| `OUTPUT_DIR`      | 编译树中间目录 |
-| `PACKAGE_DIR`     | 打包目录, 其中可以存放其它组件, 也可以存放压缩包形式的第三方软件, 例如`openssl-0.9.8.tar.gz`等 |
-| `RULE_DIR`        | 构建系统核心目录, 如果不喜欢`build-rules`存放在自己的工程里, 完全可以通过这个变量把它移出去 |
-| `TOP_DIR`         | 工程的顶级目录, 默认就是顶层`makefile`所在的路径, 极少改动 |
-
-可以完全不对它们做任何改动, 依照上文的含义和默认值来排布自己工程
-
----
-也可以通过顶层目录的`project.mk`, 可以改动它们, 例如:
-
-    $ cat project.mk
-    MAKE_SEGMENT := alink.mk
-
-则表示在每个构建单元中, 指导构建过程的片段文件不再是默认的`iot.mk`, 而是`alink.mk`

+ 0 - 16
iotkit-embedded/build-rules/docs/Build-System-Debug.md

@@ -1,16 +0,0 @@
-# 构建系统调试
-
-## 调试开关
-
-* 在`make ...`命令行中, 设置`TOP_Q`变量为空, 可打印工程顶层的执行逻辑, 例如硬件平台的选择, SDK主库的生成等
-
-        make .... TOP_Q=
-
-* 在`make ...`命令行中, 设置`Q`变量为空, 可打印模块内部的构建过程, 例如目标文件的生成, 头文件搜寻路径的组成等
-
-        make .... Q=
-
-## 对单个构建单元调试
-
-* 可以用`make foo/bar`单独对`foo/bar`进行构建, 不过, 这可能需要先执行`make reconfig`
-* 可以进入`.O/foo/bar`路径, 看到完整的编译临时目录, 有makefile和全部源码, 所以在这里执行`make`, 效果和`make foo/bar`等同

+ 0 - 124
iotkit-embedded/build-rules/docs/Build-System-Introduction.md

@@ -1,124 +0,0 @@
-# 如何获取
-
-* 可访问样板组件`LITE-utils`的仓库: [*git@gitlab.alibaba-inc.com:iot-middleware/LITE-utils.git*](http://gitlab.alibaba-inc.com/iot-middleware/LITE-utils)
-* 从`master`分支的`build-rules`目录复制得到构建系统的最新副本
-* 也可以直接在`LITE-utils`中体验构建系统的工作方式和观察工作过程
-
-# 常用命令
-
-| 命令                  | 解释                                                                              |
-|-----------------------|-----------------------------------------------------------------------------------|
-| `make distclean`      | **清除一切构建过程产生的中间文件, 使当前目录仿佛和刚刚clone下来一样**             |
-| `make [all]`          | **使用默认的平台配置文件开始编译**                                                |
-| `make reconfig`       | **弹出多平台选择菜单, 用户可按数字键选择, 然后根据相应的硬件平台配置开始编译**    |
-| `make config`         | **显示当前被选择的平台配置文件**                                                  |
-| `make help`           | **打印帮助文本**                                                                  |
-| `make <directory>`    | **单独编译被<directory>指定的目录, 或者叫构建单元**                               |
-
-# 如何开发
-
-* 访问[**构建系统配置**](https://code.aliyun.com/edward.yangx/public-docs/wikis/build/build-system-config), 了解如何配置来影响构建系统的行为
-* 访问[**构建工程说明**](https://code.aliyun.com/edward.yangx/public-docs/wikis/build/build-system-proj), 了解如何定制工程全局的编译
-* 访问[**构建单元说明**](https://code.aliyun.com/edward.yangx/public-docs/wikis/build/build-system-units), 了解如何增删改查你自己的构建单元
-* 访问[**构建系统调试**](https://code.aliyun.com/edward.yangx/public-docs/wikis/build/build-system-debug), 了解在定制构建单元时, 如何自己调试
-
-# 高级命令
-
-| 命令                  | 解释                                                                                      |
-|-----------------------|-------------------------------------------------------------------------------------------|
-| `make test`           | **运行指定的测试集程序, 统计显示测试例的通过率和源代码的覆盖率**                          |
-| `make doc`            | **扫描源码目录中以`Doxygen`格式或者`Markdown`格式编写的注释, 在`html`目录产生帮助文档**   |
-| `make repo-list`      | **列出当前工程引用的外部组件和它们的云端仓库地址**                                        |
-| `make repo-update`    | **对所有引用到的外部组件, 用云端仓库更新本地仓库**                                        |
-
-# 组成部分
-
-    LITE-utils$ tree -A -L 1
-    .
-    +-- build-rules     # 构建系统核心
-    +-- example
-    +-- external
-    +-- makefile        # 工程的makefile
-    +-- packages
-    +-- project.mk      # 工程设置文件
-    +-- src
-    +-- testsuites
-
-> 以`LITE-utils`为例, 对整个构建过程需要知道的只有如上三个部分:
-
-| 组成部分      | 说明                                                                          |
-|---------------|-------------------------------------------------------------------------------|
-| `project.mk`  | 本工程的目录排布, 工程名称, 版本信息等, 可选                                  |
-| `makefile`    | 本工程的makefile, 基于`GNU Make`, 通常只含有极少的内容, 指定编译的范围, 必选  |
-| `build-rules` | 构建系统核心, 指定编译的规则, 不需要关注                                      |
-
-# 工作过程
-
-可以从一个简单的`makefile`样例看起
-
-     1  sinclude project.mk
-     2  sinclude $(CONFIG_TPL)
-     3
-     4  SUBDIRS += \
-     5      external/cut \
-     6      src \
-     7      example \
-     8      testsuites \
-     9
-    10  include $(RULE_DIR)/rules.mk
-
-0. 构建系统是基于`GNU Make`的简化系统, 所以工作过程的起点仍然是顶层的`makefile`
-1. 读取`project.mk`, 如果当前工程的目录排布和默认的不一样, 则用当前设置, 可选
-2. 读取`.config`文件, 这个文件其实是构建系统运行时所有输入的集合, 也称为*硬件平台配置文件*, 可选
-3. 读取`SUBDIRS`变量, 这个变量指定了编译的范围, 必选
-4. 读取`CFLAGS`或者`LDFLAGS`等变量, 顶层`makefile`的变量会被应用到每个构建单元的编译和链接, 可选
-5. 读取`.../rules.mk`文件, 开始进入构建系统核心, 必选, 这又可以细分为如下过程
-
-## 详细工作过程
-
-* 产生*硬件平台配置文件*, 这个过程是为了产生顶层的`.config`文件, 也就是所谓的`$(CONFIG_TPL)`
-* 识别构建单元, 所谓构建单元在构建系统看来就是一个又一个包含`iot.mk`的目录, 如果不希望用`iot.mk`作为每个单元的编译片段文件, 在`project.mk`中设置`MAKE_SEGMENT`变量即可
-* 从`$(SUBDIRS)`变量从前往后逐个编译每个构建单元
-* 构建单元如果有依赖到其它构建单元, 则先去编译被依赖的单元; 若后者又有依赖的其它的单元, 则同样, 递归的先去编译其依赖; 以此类推
-
-# 高级命令示例
-
-- **make test: 运行指定的测试集程序, 统计显示测试例的通过率和源代码的覆盖率**
-
-![image](https://yuncodeweb.oss-cn-hangzhou.aliyuncs.com/uploads/edward.yangx/public-docs/52c806dd879f18cd7ea855a8549461f6/image.png)  
-
-- **make doc: 扫描源码目录中以`Doxygen`格式或者`Markdown`格式编写的注释, 在`html`目录产生帮助文档**
-
-        LITE-utils $ make doc
-        ...
-        ...
-        Patching output file 15/16
-        Patching output file 16/16
-        lookup cache used 256/65536 hits=882 misses=258
-        finished...
-
-![image](https://yuncodeweb.oss-cn-hangzhou.aliyuncs.com/uploads/edward.yangx/public-docs/b9ea5662e866913efcaca28549d9f033/image.png)
-
-- **make repo-list: 列出当前工程引用的外部组件和它们的云端仓库地址**
-
-        LITE-utils $ make repo-list
-        [external/log] git@gitlab.alibaba-inc.com:iot-middleware/LITE-log.git
-
-> 以上输出表示在构建单元`external/log`, 引用了云端仓库位于`git@gitlab.alibaba-inc.com:iot-middleware/LITE-log.git`的外部组件`LITE-log`
-
-- **make repo-update: 将所有引用的外部组件用云端仓库更新本地仓库**
-
-        LITE-utils $ make repo-update
-        [ LITE-log.git ] <= : git@gitlab.alibaba-inc.com:iot-middleware/LITE-log.git :: master
-        + cd /home/edward/srcs/iot-middleware/LITE-utils/packages
-        + rm -rf LITE-log.git
-        + git clone -q --bare -b master --single-branch git@gitlab.alibaba-inc.com:iot-middleware/LITE-log.git LITE-log.git
-        + rm -rf LITE-log.git/hooks/
-        + mkdir -p LITE-log.git/hooks/
-        + touch LITE-log.git/hooks/.gitkeep
-        + touch LITE-log.git/refs/heads/.gitkeep LITE-log.git/refs/tags/.gitkeep
-        + rm -rf /home/edward/srcs/iot-middleware/LITE-utils.pkgs/LITE-log
-        + cd /home/edward/srcs/iot-middleware/LITE-utils
-        + set +x
-
-> 以上输出表示从`git@gitlab.alibaba-inc.com:iot-middleware/LITE-log.git`拉取最新的云端仓库, 更新到本地仓库`packages/LITE-log.git`

+ 0 - 39
iotkit-embedded/build-rules/docs/Build-System-Proj.md

@@ -1,39 +0,0 @@
-# 定制工程全局的编译行为
-
-## 增加硬件平台配置文件
-
-在默认的`configs`目录, 或者在指定的`$(CONFIG_DIR)`目录下, 文件名形式为`config.<VENDOR>.<MODEL>`的文本文件, 会被构建系统认为是硬件平台配置文件, 每个文件对应一个嵌入式软硬件平台
-
-* 其中<VENDOR>部分, 一般是指明嵌入式平台的软件OS提供方, 如`mxchip`, `ubuntu`, `win7`等. 另外, 这也会导致构建系统到`$(IMPORT_DIR)/<VENDOR>`目录下寻找预编译库的二进制库文件和头文件
-* 其中<MODEL>部分, 一般是标明嵌入式平台的具体硬件型号, 如`mtk7687`, `qcom4004`等, 不过也可以写上其它信息, 因为构建系统不会去理解它, 比如`mingw32`, `x86-64`等
-
-> 例如`config.mxchip.3080c`文件, 如果在`make reconfig`的时候被选择, 则会导致:
-
-* 构建系统在`import/mxchip/`目录下寻找预编译库的二进制库文件和头文件
-* 构建系统使用该文件内的变量指导编译行为, 具体来说, 可以根据说明使用如下变量
-
-| 变量                  | 说明                                      |
-|-----------------------|-------------------------------------------|
-| `CONFIG_ENV_CFLAGS`   | 指定全局的`CFLAGS`编译选项, 传给`compiler`, 例如`CONFIG_ENV_CFLAGS += -DDEBUG` |
-| `CONFIG_ENV_LDFLAGS`  | 指定全局的`LDFLAGS`链接选项, 传给`linker`, 例如`CONFIG_ENV_LDFLAGS += -lcrypto` |
-| `CROSS_PREFIX`        | 指定交叉编译工具链共有的前缀, 例如`CROSS_PREFIX := arm-none-eabi-`, 会导致构建系统使用`arm-none-eabi-gcc`和`arm-none-eabi-ar`, 以及`arm-none-eabi-strip`等 |
-| `OVERRIDE_CC`         | 当交叉工具链没有共有的前缀或者前缀不符合`prefix+gcc|ar|strip`类型时, 例如`armcc`, 可用`OVERRIDE_CC = armcc`单独指定C编译器 |
-| `OVERRIDE_AR`         | 当交叉工具链没有共有的前缀或者前缀不符合`prefix+gcc|ar|strip`类型时, 例如`armar`, 可用`OVERRIDE_AR = armar`单独指定库压缩器 |
-| `OVERRIDE_STRIP`      | 当交叉工具链没有共有的前缀或者前缀不符合`prefix+gcc|ar|strip`类型时, 例如`armcc`没有对应的strip程序, 可用`OVERRIDE_STRIP = true`单独指定strip程序不执行 |
-
-## 定制单元测试
-
-如果你的工程含有配合构建系统的单元测试用例, 则可以在顶层`makefile`中添写类似如下语句, 告诉构建系统在`make test`命令中执行它们做单元测试, 并统计源码覆盖率
-
-    UTEST_PROG := utils-tests
-
-> 以上面的`LITE-utils`为例, 其中的`utils-tests`就是它的单元测试程序, 这是在构建单元`testsuites`中产生的一个`Linux`下可执行程序
-
-    $ cat testsuites/iot.mk -n
-         1  TARGET      := utils-tests
-         2  DEPENDS     += external/cut src
-         3  HDR_REFS    := src
-         4
-         5  LDFLAGS     += -llite-utils -llite-log -llite-cut
-
-为什么如上的一个简单`iot.mk`片段文件, 就能指导构建系统生成可执行程序`utils-tests`, 可以访问[**构建单元说明**](https://code.aliyun.com/edward.yangx/public-docs/wikis/build/build-system-units)

+ 0 - 130
iotkit-embedded/build-rules/docs/Build-System-Units.md

@@ -1,130 +0,0 @@
-# 构建单元说明
-
-## 定义
-
-* 片段文件: 用来指导某个具体的文件夹下源码应如何获取和编译以及链接的makefile文本片段, 基本只包含变量的赋值
-* 默认的片段文件是名为`iot.mk`的文本文件, 可以在工程顶层目录`project.mk`里, 用`MAKE_SEGMENT := <new>`更改片段文件名
-* 从工程顶层目录以下, 每一个含有`iot.mk`的子目录, 都被构建系统认为是一个构建单元
-
-> 举例来说:
-
-> 假设在/path/to/project/project.mk文件中有
-> 
->     MAKE_SEGEMENT := build.mk
- 
-> 那么, 如下的目录排布
-> 
->     /path/to/project/bar/build.mk
->     /path/to/project/foo/sub1/build.mk
->     /path/to/project/foo/sub2/build.mk
->     /path/to/project/mmm/nnn/ppp/qqq/build.mk
- 
-> 会导致
-> 
->     bar
->     foo/sub1
->     foo/sub2
->     mmm/nnn/ppp/qqq
- 
-> 都被认为是构建单元, 可以用类似`make bar`, `make foo/bar1`这样的命令单独编译, 也可以调试完成后通过修改顶层`makefile`集成到工程中
-
-## 工作过程
-
-对整个工程进行构建的过程基本是遍历每个构建单元逐个构建, 而对每个构建单元的构建过程是:
-
-* 构造编译的临时目录, 例如 `.O/bar` 目录, 对应源码 `bar` 构建单元
-* 在编译的临时目录中动态生成或更新`makefile`和源代码
-* 切换到临时目录中, 编译源代码, 产生目标代码
-
-## 开发过程
-
-增加一个新的构建单元可以按如下步骤进行:
-
-* 创建新单元对应的目录, 比如
-
-        mkdir foo/bar
-
-* 创建该单元的片段文件, 比如
-
-        vi foo/bar/iot.mk
-        1 LIBA_TARGET := libfoobar.a
-
-* 为该单元添加一些源码文件, 比如
-
-        cp .../*.c foo/bar/
-
-* 这时, 在工程文件中运行`make reconfig`, 告诉构建系统新增了一个单元, 这个单元就可以被独立编译了
-
-        make reconfig
-        make foo/bar
-
-* 单独的编译和运行没问题之后, 修改工程的`makefile`, 使这个新单元也加入到工程中
-
-        vi makefile
-        ...
-        ...
-        SUBDIRS += foo/bar
-        ...
-        ...
-
-## 编写片段文件
-
-**简化编译的设计思想就是使每一个模块的开发者, 基本只需要编写片段文件就能构建自己的功能模块**
-
-**而片段文件之所以能够起到简化的效果, 是因为它基本上只是一些"变量赋值"语句的集合, 编写它, 几乎可以不需要学习任何语言的任何语法**
-
----
-以下是在片段文件中可以使用的变量名:
-
-### 输出相关
-
-| 变量名            | 用处                                                                                          |
-|-------------------|-----------------------------------------------------------------------------------------------|
-| ORIGIN            | 如果你的模块希望按自己独特的方式编译, 比如`./configure ...; make; ...`, 需要设置此变量为1 |
-| LIBSO_TARGET      | 设置本单元被编译出的`Linux`动态库文件名, 对它赋值导致系统帮助你产生`*.so`共享库文件 | 
-| LIBA_TARGET       | 设置本单元被编译出的静态库文件名, 对它赋值导致系统帮助你产生`*.a`静态库文件 |
-| TARGET            | 设置本单元被编译出的可执行程序文件名, 对它赋值导致系统帮助你产生`Linux`下的可执行程序 |
-| KMOD_TARGET       | 设置本单元被编译出的内核模块文件名, 对它赋值导致系统帮助你产生`Linux`下的`*.ko`内核模块 |
-
-**以上变量至少要有一个被设置, 这样构建系统才知道构建的输出是什么, 至多则可以同时被设置, 例如同时产生静态库文件和可执行程序, 甚至内核模块等**
-
-### 输入相关
-
-| 变量名            | 用处                                                                                          |
-|-------------------|-----------------------------------------------------------------------------------------------|
-| LIB_SRCS          | 可选, 列出哪些`*.c`文件被编译成`*.a`或者`*.so` |
-| SRCS              | 可选, 列出哪些`*.c`文件被编译成可执行程序 |
-| EXTRA_SRCS        | 可选, 列出哪些源文件需要在开始编译之前被复制到临时的编译目录 |
-| CFLAGS            | 可选, 列出需要特别应用在本模块上的编译选项 |
-| LDFLAGS           | 可选, 列出需要特别应用在本模块上的链接选项 |
-
-### 组合相关
-
-| 变量名            | 用处                                                                                          |
-|-------------------|-----------------------------------------------------------------------------------------------|
-| HDR_REFS          | 可选, 如果你的模块引用了其它模块的头文件, 那么需要设置这个变量, 列出被引用模块在工程里的相对路径 |
-| DEPENDS           | 可选, 如果你的模块需要在其它模块构建完成后才能编译, 那么需要设置这个变量, 列出被依赖模块在工程里的相对路径 |
-
-### 高级用法
-
-| 变量名            | 用处                                                                                          |
-|-------------------|-----------------------------------------------------------------------------------------------|
-| PKG_SOURCE        | 可选, 表示源码来自`*.c`之外的形式, 例如压缩包文件, 或者独立的git仓库等 |
-| PKG_BRANCH        | 可选, 仅在`PKG_SOURCE`是git仓库的时候才有意义, 指定使用该仓库的哪个分支作为源码输入 |
-| PKG_REVISION      | 可选, 仅在`PKG_SOURCE`是git仓库的时候才有意义, 指定使用该仓库的哪个分支上的哪个`commit`或者`tag` |
-| PKG_UPSTREAM      | 可选, 仅在`PKG_SOURCE`是git仓库的时候才有意义, 指定使用哪个云端的git仓库地址来更新本地git仓库 |
-
-
-### 其它
-
-#### 产生多个可执行程序
-
-* 如果你的模块希望产生单个的可执行程序, 那么对变量`TARGET`和`SRCS`赋值就可以了, 但如果希望产生多个可执行程序, 比如
-
-        TARGET = prog1 prog2 prog3
-
-* 那么需要用`SRCS_<name>`变量对这多个可执行程序分别设定他们的源文件, 比如
-
-        SRCS_prog1 = prog1.c
-        SRCS_prog2 = prog2.c library_A.c
-        SRCS_prog3 = prog3.c library_A.c library_B.c

+ 0 - 23
iotkit-embedded/build-rules/docs/Help.md

@@ -1,23 +0,0 @@
-常用命令
----
-
-| 命令                  | 解释                                                                              |
-|-----------------------|-----------------------------------------------------------------------------------|
-| `make distclean`      | **清除一切编译过程产生的中间文件, 使当前目录仿佛和刚刚clone下来一样**             |
-| `make [all]`          | **使用默认的平台配置文件开始编译**                                                |
-| `make reconfig`       | **弹出多平台选择菜单, 用户可按数字键选择, 然后根据相应的硬件平台配置开始编译**    |
-| `make config`         | **显示当前被选择的平台配置文件**                                                  |
-| `make help`           | **打印帮助文本**                                                                  |
-| `make env`            | **打印当前编译的选项和它们的值**                                                  |
-| `make <directory>`    | **单独编译被<directory>指定的目录, 或者叫编译单元**                               |
-
-高级命令
----
-
-| 命令                  | 解释                                                                              |
-|-----------------------|-----------------------------------------------------------------------------------|
-| `make repo-list`      | 列出当前可以更新的组件列表, 所谓组件是跨项目的功能模块, 有独立的`git`仓库         |
-| `make repo-update`    | 根据输入更新所有组件或单个被选择的组件, 从线上获取其最新的`git`仓库               |
-| `make test`           | 如果当前项目有编写单元测试主程序和单元测试例, 则执行UT, 统计通过率和覆盖率        |
-
-o 访问 https://code.aliyun.com/edward.yangx/public-docs/wikis/home 可获得编译系统线上最新和最全的帮助文档

+ 0 - 172
iotkit-embedded/build-rules/funcs.mk

@@ -1,172 +0,0 @@
-define Dump_Var
-	NUM=`echo "$(strip $($(1)))"|awk '{ print NF }'`; \
-	if (( $${NUM} \> 1 )); then \
-	    printf -- "-----------------------------------------------------------------\n"; \
-	    printf "%-24s| %s\n" ". $(1)" `echo "$(strip $($(1)))"|cut -d' ' -f1|$(SED) 's/^ *//'`; \
-	    for i in `echo "$(strip $($(1)))"|cut -d' ' -f2-`; do \
-	        printf "%-24s| %s\n" "" "$${i}"; \
-	    done; \
-	    printf -- "-----------------------------------------------------------------\n"; \
-	else \
-	    printf "%-24s| %s\n" ". $(1)" "$(strip $($(1)))"; \
-	fi;
-endef
-
-ifneq (,$(Q))
-define Inspect_Env
-endef
-else
-define Inspect_Env
-	@printf -- "-----------------------------------------------------------------\n"
-	@printf "%-20s| %s\n" ". BUILDING_TARGET" "$@"
-	@printf -- "-----------------------------------------------------------------\n"
-	@printf "%-20s| %s\n" ". BUILDING_DEPEND" "$(filter-out FORCE,$^)"
-	@printf -- "-----------------------------------------------------------------\n"
-	@$(foreach var,$(1),$(call Dump_Var,$(var)))
-	@printf -- "-----------------------------------------------------------------\n"
-endef
-endif
-
-# 31, red. 32, green. 33, yellow. 34, blue. 35, magenta. 36, cyan. 37, white.
-define Brief_Log
-( \
-	if [ "$1" = "CC" ]; then \
-	    if echo "$@"|grep -q "\.so$$"; then \
-	        COLOR_MARK="\033[1;32m"; \
-	    elif echo "$@"|grep -q "\.ko$$"; then \
-	        COLOR_MARK="\033[1;35m"; \
-	    else \
-	        COLOR_MARK="\033[1;36m"; \
-	    fi \
-	elif [ "$1" = "AR" ]; then \
-	    COLOR_MARK="\033[1;33m"; \
-	elif [ "$1" = "LD" ]; then \
-	    COLOR_MARK="\033[1;31m"; \
-	elif [ "$1" = "ST" ]; then \
-	    COLOR_MARK="\033[0;33m"; \
-	fi; \
-    echo -ne "$${COLOR_MARK}"; \
-	if [ "$2" = "" ]; then \
-	    FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
-	    SPACE_BAR="                                   "; \
-	    if [ "$${FIRST_DEP}" != "" ]; then \
-	        FIRST_DEP="$$(basename $${FIRST_DEP})"; \
-	    fi; \
-	    printf "\r%-32s%s%s\n" "[$1] $$(echo -n "$$(basename $@)" | cut -c1-20)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
-	else \
-	    printf "\r%-32s%s%s\n" "[$1] $$(echo -n "$(2)" | cut -c1-20)" "<= $${FIRST_DEP} $${SPACE_BAR}"; \
-	fi; \
-	for i in $(wordlist 2,100,$(filter-out FORCE,$?)); do \
-	    if [ "$$(echo $${i}|cut -c1)" != "/" ]; then \
-	        printf "%-32s%s\n" "" "   $$(basename $${i})"; \
-	    fi \
-	done; \
-	echo -ne "\033[0m"; \
-)
-endef
-
-define Copy_Headers
-	$(Q) \
-	if [ "$(strip $(1))" != "" ]; then \
-	    mkdir -p $(2)/$(3); \
-	    for hdr in $(1); do \
-	        if [ $${PWD}/$${hdr} -nt $(2)/$(3)/$${hdr} ]; then \
-	            mkdir -p $(2)/$(3)/$$(dirname $${hdr}); \
-	            cp -f $${hdr} $(2)/$(3)/$$(dirname $${hdr}); \
-	        fi; \
-	    done \
-	fi
-endef
-
-define Update_Extra_Srcs
-( \
-	for ELEM in $(strip $(1)); do \
-	    DST=$(OUTPUT_DIR)/$(2)/$$(basename $${ELEM}); \
-	    if [ $${ELEM} -nt $${DST} ]; then \
-	        cp -Lf $${ELEM} $${DST}; \
-	    fi; \
-	done \
-)
-endef
-
-define Require_Build
-( \
-    [ "$(PKG_SWITCH_$(1))" != "y" ] && \
-        echo "FALSE" && exit; \
-\
-    [ "$(LIBA_TARGET_$(1))" != "" ] && \
-    $(foreach L,$(LIBA_TARGET_$(1)),[ -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(L) ] && ) \
-            echo "FALSE" && exit; \
-\
-    [ "$(LIBSO_TARGET_$(1))" != "" ] && \
-    [ -f $(IMPORT_VDRDIR)/$(PREBUILT_LIBDIR)/$(LIBSO_TARGET_$(1)) ] && \
-            echo "FALSE" && exit; \
-\
-    echo "TRUE"; \
-)
-endef
-
-define Build_Depends
-( \
-    set -o pipefail && \
-    for i in $(DEPENDS_$(1)); do \
-        STAMP=$(STAMP_DIR)/$$(echo $${i}|$(SED) 's:/:~:g').build.done; \
-        if [ -f $${STAMP} ]; then \
-            continue; \
-        fi; \
-        $(MAKE) --no-print-directory $${i} \
-            $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$${i}/$(COMPILE_LOG)) \
-            $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG)); \
-        RETVAL=$$?; \
-        if [ $${RETVAL} != 0 ]; then \
-            exit $${RETVAL}; \
-        fi; \
-    done \
-\
-)
-endef
-
-#
-#	    ($(foreach d,$(COMP_LIB_COMPONENTS), \
-#
-#	        $(RECURSIVE_MAKE) pre-build target-$(d) && \
-#	        $(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$(d) $(LIBA_TARGET_$(d)) \
-#	            $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(d)/$(COMPILE_LOG)) \
-#	            $(if $(Q),,2>&1|tee -a $(OUTPUT_DIR)/$(COMPILE_LOG)) \
-#	        ; \
-#
-#	        if [ $$? != 0 ]; then \
-#
-# KEEP SEPA-LIBS:
-#
-# rm -f $(SYSROOT_LIB)/$(firstword $(LIBA_TARGET_$(d))) $(SYSROOT_LIB)/$(firstword $(LIBSO_TARGET_$(d))) 2>/dev/null; \
-#
-
-ifdef COMP_LIB
-define Build_CompLib
-( \
-    if  [ "$(strip $(1))" = "FORCE" ] || \
-        [ "$$(echo $(LDFLAGS_$(strip $(1)))|grep -wo -- '-l$(COMP_LIB_NAME)')" != "" ]; then \
-    ( \
-        $(foreach d,$(COMP_LIB_COMPONENTS), \
-            [ -f $(STAMP_DIR)/$(subst /,~,$(d)).build.done ] || \
-            set -o pipefail && \
-            $(MAKE) --no-print-directory -C $(OUTPUT_DIR)/$(d) $(firstword $(LIBA_TARGET_$(d))) $(firstword $(LIBSO_TARGET_$(d))) && set +x; \
-            RETVAL=$$?; \
-            if [ $${RETVAL} != 0 ]; then \
-                exit $${RETVAL}; \
-            fi; \
-        ) \
-    ); \
-    if  [ ! -f $(SYSROOT_LIB)/$(COMP_LIB) ]; then \
-        $(call Info_CompLib,$(COMP_LIB_NAME),$(COMP_LIB_OBJS)); \
-    fi; \
-    $(call Finalize_CompLib,$(COMP_LIB_OBJS),$(SYSROOT_LIB),$(COMP_LIB_NAME)); \
-    fi \
-)
-endef
-else
-define Build_CompLib
-true
-endef
-endif

+ 0 - 23
iotkit-embedded/build-rules/hooks/pre-commit

@@ -1,23 +0,0 @@
-#!/bin/sh
-#
-# An example hook script to verify what is about to be committed.
-# Called by "git commit" with no arguments.  The hook should
-# exit with non-zero status after issuing an appropriate message if
-# it wants to stop the commit.
-#
-# To enable this hook, rename this file to "pre-commit".
-
-for i in `git status -s | awk '{ print $NF }'`; do
-    j=$(echo $(basename $i)|cut -d'.' -f2)
-    if [ "$j" = "c" -o "$j" = "h" -o "$j" = "md" -o "$j" = "mk" ]; then
-        if [ "$(find $i -perm /111 2>/dev/null)" != "" ]; then
-            chmod a-x $i
-            echo "[chmod] $i"
-            if [ "$(git status --short $i|cut -c1)" = "M" ]; then
-                git add $i
-            fi
-        fi
-    else
-        echo "[skip ] $i"
-    fi
-done

+ 0 - 2426
iotkit-embedded/build-rules/misc/Doxyfile.tpl

@@ -1,2426 +0,0 @@
-# Doxyfile 1.8.11
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME           = TBD
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER         = TBD
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF          =
-
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO           =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = .
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS         = NO
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES    = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF       =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES        = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE               = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES                =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST              =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C  = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN   = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL   = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT       = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT       = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT        = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT            = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT   = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# If one adds a struct or class to a group and this option is enabled, then also
-# any nested class or struct is added to the same group. By default this option
-# is disabled and one has to add nested compounds explicitly via \ingroup.
-# The default value is: NO.
-
-GROUP_NESTED_COMPOUNDS = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING            = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS  = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT   = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE      = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC         = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES       = YES
-
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC  = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES   = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS       = NO
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES       = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING  = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES        = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES             = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES        = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE            =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES         =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS               = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC       = NO
-
-# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
-# a warning is encountered.
-# The default value is: NO.
-
-WARN_AS_ERROR          = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
-# Note: If this tag is empty the current directory is searched.
-
-INPUT                  = .
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# read by doxygen.
-#
-# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
-# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
-# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
-# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
-
-FILE_PATTERNS          = *.h
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE              = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE                =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS       =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES    = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER         = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION    = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = NO
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS        = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS       = YES
-
-# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the
-# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
-# cost of reduced performance. This can be particularly helpful with template
-# rich C++ code for which doxygen's built-in parser lacks the necessary type
-# information.
-# Note: The availability of this option depends on whether or not doxygen was
-# generated with the -Duse-libclang=ON option for CMake.
-# The default value is: NO.
-
-# CLANG_ASSISTED_PARSING = NO
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-# CLANG_OPTIONS          =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX     = YES
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET        =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET  =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES       =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE    = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT    = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA  = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP         = NO
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET        = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME        = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID       = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME  = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP      = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE               =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION           =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI           = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING     =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND             = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP           = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE          = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER     = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION           =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP   = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID         = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX          = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW      = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH         = 250
-
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW    = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE       = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT    = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX            = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT         = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS     =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE       =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE           = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH    = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH        = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL       =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE        = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID     =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS  =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX         = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE             = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. The package can be specified just
-# by its name or with the correct syntax as to be used with the LaTeX
-# \usepackage command. To get the times font for instance you can specify :
-# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
-# To use the option intlimits with the amsmath package you can specify:
-# EXTRA_PACKAGES=[intlimits]{amsmath}
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER           =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER           =
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES      =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS         = YES
-
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX           = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE        = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES     = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE      = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE        = plain
-
-# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_TIMESTAMP        = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE    =
-
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE        = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION          = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR             =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT             = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK       = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT         = docbook
-
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sf.net) file that captures the
-# structure of the code including all documentation. Note that this feature is
-# still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED             =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED      =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
-# The default value is: NO.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS        = YES
-
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES         = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH            =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH               =
-
-# If set to YES the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: YES.
-
-HAVE_DOT               = YES
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS        = 0
-
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME           = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE           = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK               = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS   = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH          = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command. Disabling a call graph can be
-# accomplished by means of the command \hidecallgraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command. Disabling a caller graph can be
-# accomplished by means of the command \hidecallergraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. For an explanation of the image formats see the section
-# output formats in the documentation of the dot tool (Graphviz (see:
-# http://www.graphviz.org/)).
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd,
-# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo,
-# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo,
-# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
-# png:gdiplus:gdiplus.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT       = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG        = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS           =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS           =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS           =
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
-
-PLANTUML_JAR_PATH      =
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH  =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP            = YES

+ 0 - 2
iotkit-embedded/build-rules/misc/config.generic.default

@@ -1,2 +0,0 @@
-CONFIG_ENV_CFLAGS   += -Wall
-CONFIG_ENV_CFLAGS   += --coverage

+ 0 - 159
iotkit-embedded/build-rules/misc/cut.c

@@ -1,159 +0,0 @@
-#include "cut.h"
-
-struct cut_runtime cut;
-
-static void _filter(int argc, char **argv)
-{
-    int i = 0;
-    struct cut_case *c = NULL;
-    if (argc == 2 && 0 == strcmp(argv[1], "all")) {
-        return;
-    }
-
-    for (i = 0; i < cut.ccnt_total; i++) {
-        c = cut.clist[i];
-        if ((argc == 2 && (NULL == strstr(c->sname, argv[1]))) ||
-            (argc == 3 && (NULL == strstr(c->sname, argv[1]) || NULL == strstr(c->cname, argv[2])))) {
-            cut.clist[i]->skip = 1;
-            cut.ccnt_skip++;
-        }
-    }
-}
-
-static void _usage(const char *me)
-{
-    cut_printf("Usage: %s [OPTION] S-FILTER [C-FILTER]\n\n" \
-               "OPTION:\n" \
-               "  --debug:      debug into cases\n" \
-               "  --list:       list cases\n" \
-               "  --count:      print case count\n" \
-               "\n" \
-               "S-FILTER:    suite name filter, e.g. '%s all' means run all suites\n" \
-               "C-FILTER:    case name filter\n", me, me);
-}
-
-static int _debug_opt = 0;
-static int _parse_arg(int argc, char **argv)
-{
-    if (argc >= 2) {
-        if (0 == strcmp(argv[1], "--list")) {
-            int i = 0;
-            int cnt = 0;
-            for (i = 0; i < cut.ccnt_total; i++) {
-                struct cut_case *c = cut.clist[i];
-                if (argc == 2 ||
-                    (argc == 3 && 0 == strcmp(argv[2], "all")) ||
-                    (argc == 3 && NULL != strstr(c->sname, argv[2])) ||
-                    (argc == 4 && NULL != strstr(c->sname, argv[2]) && NULL != strstr(c->cname, argv[3]))) {
-                    cut_printf("  [%02d] %s.%s\n", ++cnt, c->sname, c->cname);
-                }
-            }
-            cut_printf("\n");
-            cut_printf("In total %d case(s), matched %d case(s)\n", cut.ccnt_total, cnt);
-            cut_printf("\n");
-            return 0;
-        }
-        if (0 == strcmp(argv[1], "--count")) {
-            cut_printf("total %d case(s).\n", cut.ccnt_total);
-            return 0;
-        }
-        if (0 == strcmp(argv[1], "--help")) {
-            _usage(argv[0]);
-            return 0;
-        }
-    }
-
-    return 1;
-}
-
-int cut_main(int argc, char **argv)
-{
-    int         i = 0, j = 0, cnt = 0;
-    char        tmpbuf[128];
-    char       *pos;
-
-    if (0 == _parse_arg(argc, argv)) {
-        return 0;
-    }
-
-    if (argc >= 2 && !strcmp(argv[1], "--debug")) {
-        _debug_opt = 1;
-        argc --;
-        argv ++;
-    }
-
-    _filter(argc, argv);
-
-    for (; i < cut.ccnt_total; i++) {
-        pos = tmpbuf;
-
-        cut.ccur = cut.clist[i];
-        if (cut.ccur->skip) {
-            continue;
-        }
-
-        memset(tmpbuf, 0, sizeof(tmpbuf));
-        pos += cut_snprintf(pos,
-                            sizeof(tmpbuf),
-                            "TEST [%02d/%02d] %s.%s ",
-                            ++cnt,
-                            cut.ccnt_total - cut.ccnt_skip,
-                            cut.ccur->sname,
-                            cut.ccur->cname);
-        for (j = 80 - strlen(tmpbuf); j >= 0; --j) {
-            pos += sprintf(pos, "%s", ".");
-        }
-        if (_debug_opt) {
-            pos += sprintf(pos, " [%sEXEC%s]\n", COL_YEL, COL_DEF);
-            cut_printf("%s", tmpbuf);
-            pos -= 19;
-        }
-        TRY {
-            if (cut.ccur->setup)
-            {
-                cut.ccur->setup(cut.ccur->data);
-            }
-            cut.ccur->run((struct cut_case *)(cut.ccur->data));
-            if (cut.ccur->teardown)
-            {
-                cut.ccur->teardown(cut.ccur->data);
-            }
-
-            pos += sprintf(pos, " [%sSUCC%s]\n", COL_GRE, COL_DEF);
-            cut_printf("%s", tmpbuf);
-
-            cut.ccnt_pass++;
-            continue;
-        }
-        EXCEPT {
-
-            pos += sprintf(pos, " [%sFAIL%s]\n", COL_RED, COL_DEF);
-            cut_printf("%s", tmpbuf);
-
-            cut.ccnt_fail++;
-            continue;
-        }
-    }
-
-    cut_printf("===========================================================================\n");
-    if (cut.ccnt_fail > 0) {
-        cut_printf("FAIL LIST:\n");
-        for (i = 0; i < cut.ccnt_fail; i++) {
-            cut_printf("  [%02d] %s\n", i + 1, cut.cerrmsg[i]);
-            cut_free(cut.cerrmsg[i]);
-        }
-        cut_printf("---------------------------------------------------------------------------\n");
-    }
-    cut_printf("SUMMARY:\n" \
-               "     TOTAL:    %d\n" \
-               "   SKIPPED:    %d\n" \
-               "   MATCHED:    %d\n" \
-               "      PASS:    %d\n" \
-               "    FAILED:    %d\n", cut.ccnt_total, cut.ccnt_skip,
-               cut.ccnt_total - cut.ccnt_skip, cut.ccnt_pass, cut.ccnt_fail);
-    cut_printf("===========================================================================\n");
-
-    return cut.ccnt_fail;
-
-}
-

+ 0 - 247
iotkit-embedded/build-rules/misc/cut.h

@@ -1,247 +0,0 @@
-#ifndef __CUT_H__
-#define __CUT_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <setjmp.h>
-#include <string.h>
-#include <assert.h>
-
-#define CUT_CASE_MAX_CNT        (200)
-#define CUT_MSG_MAX_LEN         (256)
-
-#define cut_printf              printf
-#define cut_snprintf            snprintf
-#define cut_malloc              malloc
-#define cut_free                free
-
-extern int cut_main(int argc, char **argv);
-extern struct cut_runtime cut;
-
-struct cut_case {
-    const char *sname;
-    const char *cname;
-    void *data;
-    void (*run)(void *);
-    void (*setup)(void *);
-    void (*teardown)(void *);
-    int skip;
-};
-
-struct cut_runtime {
-    jmp_buf jmpbuf;
-    int     scnt_total;
-    int     ccnt_total;
-    int     ccnt_pass;
-    int     ccnt_fail;
-    int     ccnt_skip;
-    struct  cut_case *clist[CUT_CASE_MAX_CNT];
-    struct  cut_case *ccur;
-    char    *cerrmsg[CUT_CASE_MAX_CNT];
-};
-
-#define CUT_CASE_RUNNER(sname, cname)  cut_##sname##_##cname##_run
-#define CUT_CASE_NAME(sname, cname)    cut_##sname##_##cname
-#define CUT_CASE_DATA(sname)           cut_##sname##_data
-#define CUT_CASE_SETUP(sname)          cut_##sname##_setup
-#define CUT_CASE_TEARDOWN(sname)       cut_##sname##_teardown
-
-#define DATA(sname) \
-    struct CUT_CASE_DATA(sname)
-
-#define SETUP(sname) \
-    static void CUT_CASE_SETUP(sname)(struct CUT_CASE_DATA(sname) *data)
-
-#define TEARDOWN(sname) \
-    static void CUT_CASE_TEARDOWN(sname)(struct CUT_CASE_DATA(sname) *data)
-
-
-/*
- * @brief: construct a test case structor and a test case runner
- * @sname: suite name
- * @cname: case name
- * e.g.
-    CASE(mysuite, mycase1) {
-        // do something here
-        ASSERT_TRUE(1);
-    }
- */
-#define CASE(sname, cname) \
-    static void CUT_CASE_RUNNER(sname, cname)(void *null); \
-    static struct cut_case CUT_CASE_NAME(sname, cname) = \
-            { \
-              #sname, #cname, NULL, CUT_CASE_RUNNER(sname, cname), NULL, NULL, 0}; \
-    static void CUT_CASE_RUNNER(sname, cname)(void *null)
-
-/*
- * @brief: construct a test case structor and a test case runner
- *         with case_data/setup/teardown for each case.
- * @sname: suite name
- * @cname: case name
- * e.g.
-    CASE_DATA(mysuite) {
-        int errmsg;
-        char *errcode;
-    };
-
-    CASE_SETUP(mysuite) {
-        data->errcode = 0;
-        data->errmsg = (char*)malloc(100);
-    }
-
-    CASE_TEARDOWN(mysuite) {
-        if(data->errmsg) {
-            free(data->errmsg);
-            data->errmsg = NULL;
-        }
-    }
-
-    CASEs(mysuite, mycase1) {
-        data->errcode = 1;
-        strcpy(data->errmsg, "timeout error");
-        ASSERT_TRUE(1);
-    }
- */
-#define CASEs(sname, cname)                                                        \
-    static struct CUT_CASE_DATA(sname) CUT_CASE_DATA(sname);                       \
-    static void CUT_CASE_RUNNER(sname, cname)(struct CUT_CASE_DATA(sname) * data); \
-    static struct cut_case CUT_CASE_NAME(sname, cname) = \
-            { \
-              #sname, #cname, &CUT_CASE_DATA(sname), (void(*)(void*))CUT_CASE_RUNNER(sname, cname),      \
-              (void(*)(void*))CUT_CASE_SETUP(sname), (void(*)(void*))CUT_CASE_TEARDOWN(sname), 0}; \
-    \
-    static void CUT_CASE_RUNNER(sname, cname)(struct CUT_CASE_DATA(sname) * data)
-
-/*
- * @brief: construct a test suite by adding test case(s)
- * @sname: suite name
- * e.g.
-    SUITE(mysuite) = {
-        ADD_CASE(mysuite, mycase1),
-        ADD_CASE(mysuite, mycase2),
-        ADD_CASE_NULL
-    };
- */
-#define SUITE(sname) struct cut_case *cut_suite_##sname[]
-
-/*
- * @brief: add a test case into a test suite
- * @sname: suite name
- * @cname: case name
- */
-#define ADD_CASE(sname, cname)   &CUT_CASE_NAME(sname, cname)
-#define ADD_CASE_NULL            (struct cut_case*)(NULL)
-
-/*
- * @brief: add a test suite into case list
- * @sname: suite name
- */
-#define ADD_SUITE(sname)                                  \
-    do {                                                  \
-        int i = 0;                                        \
-        extern struct cut_case *cut_suite_##sname[];      \
-        struct cut_case *c = cut_suite_##sname[i];        \
-        if (cut.ccnt_total >= CUT_CASE_MAX_CNT) {         \
-            cut_printf("reaches maximum case count:%d\n", \
-                       CUT_CASE_MAX_CNT);                 \
-            break;                                        \
-        }                                                 \
-        while (c) {                                       \
-            *(cut.clist + cut.ccnt_total++) = c;          \
-            c = *(cut_suite_##sname + (++i));             \
-        }                                                 \
-    } while (0)
-
-
-#define TRY                if (0 == setjmp(cut.jmpbuf))
-#define EXCEPT             else
-#define RAISE_EXCEPTION_WITH_MSG(msg)                          \
-    do {                                                       \
-        int ret = 0, i = cut.ccnt_fail;                        \
-        cut.cerrmsg[i] = (char*)cut_malloc(CUT_MSG_MAX_LEN);   \
-        assert(cut.cerrmsg[i] != NULL);                        \
-        memset(cut.cerrmsg[i], 0, CUT_MSG_MAX_LEN);            \
-        ret = cut_snprintf(cut.cerrmsg[i],                     \
-                           CUT_MSG_MAX_LEN - 1,                \
-                           "%s.%s in %s(%d) expected %s",      \
-                           cut.ccur->sname, cut.ccur->cname,   \
-                           __FILE__, __LINE__, msg);           \
-        if (ret >= CUT_MSG_MAX_LEN)                            \
-            cut_snprintf(cut.cerrmsg[i] + CUT_MSG_MAX_LEN - 4, \
-                         4, "...");                            \
-        longjmp(cut.jmpbuf, 1);                                \
-    } while (0)
-
-#define ASSERT_TRUE(cond)                       \
-    do {                                        \
-        if (!(cond))                            \
-            RAISE_EXCEPTION_WITH_MSG("[True]"); \
-    } while (0)
-
-#define ASSERT_INT(expected, compare, actual)                                     \
-    do {                                                                          \
-        if (!((expected)compare(actual)))                                         \
-            RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
-    } while (0)
-
-#define ASSERT_STR(expected, compare, actual)                                     \
-    do {                                                                          \
-        if (!(strcmp((expected), (actual)) compare 0))                            \
-            RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
-    } while (0)
-
-#define ASSERT_IN(expected1, actual, expected2)                                       \
-    do {                                                                              \
-        if ((actual) < (expected1) || (actual) > (expected2))                         \
-            RAISE_EXCEPTION_WITH_MSG("[" #expected1 " <= " #actual " <= " #expected2 "]"); \
-    } while (0)
-
-#define ASSERT_NSTR(expected, compare, actual, len)                                     \
-    do {                                                                          \
-        if (!(strncmp((expected), (actual), (len)) compare 0))                            \
-            RAISE_EXCEPTION_WITH_MSG("[" #expected " " #compare " " #actual "]"); \
-    } while (0)
-
-
-#define ASSERT_FAIL()                               RAISE_EXCEPTION_WITH_MSG("[should not be here]")
-#define ASSERT_FALSE(cond)                          ASSERT_TRUE(!(cond))
-#define ASSERT_NULL(ptr)                            ASSERT_INT(ptr, ==, NULL)
-#define ASSERT_NOT_NULL(ptr)                        ASSERT_INT(ptr, !=, NULL)
-#define ASSERT_EQ(actual, expected)                 ASSERT_INT(actual, ==, expected)
-#define ASSERT_NE(actual, expected)                 ASSERT_INT(actual, !=, expected)
-#define ASSERT_GT(actual, expected)                 ASSERT_INT(actual,  >, expected)
-#define ASSERT_GE(actual, expected)                 ASSERT_INT(actual, >=, expected)
-#define ASSERT_LT(actual, expected)                 ASSERT_INT(actual,  <, expected)
-#define ASSERT_LE(actual, expected)                 ASSERT_INT(actual, <=, expected)
-#define ASSERT_STR_EQ(actual, expected)             ASSERT_STR(actual, ==, expected)
-#define ASSERT_STR_NE(actual, expected)             ASSERT_STR(actual, !=, expected)
-#define ASSERT_STR_GT(actual, expected)             ASSERT_STR(actual,  >, expected)
-#define ASSERT_STR_LT(actual, expected)             ASSERT_STR(actual,  <, expected)
-#define ASSERT_NSTR_EQ(actual, expected, len)       ASSERT_NSTR(actual, ==, expected, len)
-#define ASSERT_NSTR_NE(actual, expected, len)       ASSERT_NSTR(actual, !=, expected, len)
-#define ASSERT_NSTR_GT(actual, expected, len)       ASSERT_NSTR(actual,  >, expected, len)
-#define ASSERT_NSTR_LT(actual, expected, len)       ASSERT_NSTR(actual,  <, expected, len)
-
-/*
- * see http://stackoverflow.com/questions/3585846/color-text-in-terminal-applications-in-unix
- */
-#define COL_DEF "\x1B[0m"
-#define COL_RED "\x1B[1;31m"
-#define COL_GRE "\x1B[1;32m"
-#define COL_YEL "\x1B[1;33m"
-#define COL_BLU "\x1B[1;34m"
-#define COL_MAG "\x1B[1;35m"
-#define COL_CYN "\x1B[1;36m"
-#define COL_WHE "\x1B[1;37m"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CUT_H__ */
-

+ 0 - 194
iotkit-embedded/build-rules/pre-build.sh

@@ -1,194 +0,0 @@
-#! /bin/bash
-if [ "$(uname)" = "Darwin" ]; then
-    SED=gsed
-else
-    SED=sed
-fi
-
-function Trace()
-{
-    if [ "${VERBOSE_PRE_BLD}" != "" ]; then
-        echo "$1" 1>&2
-    fi
-}
-
-function Update_Sources()
-{
-    if [ -f ${BLD_DIR}/${STAMP_UNPACK} ]; then
-        Trace "Skipped @ ${BLD_DIR}/${STAMP_UNPACK}"
-        return 0
-    fi
-    if [ "${PKG_SWITCH}" = "" ]; then
-        Trace "Warning @ CONFIG_${MODULE} = '${PKG_SWITCH}'"
-    fi
-
-    Trace "MODULE_NAME:     [${MODULE}]"
-    Trace "SRC_DIR:         [${SRC_DIR}]"
-    Trace "BLD_DIR:         [${BLD_DIR}]"
-    Trace "PACKAGE_DIR:     [${PACKAGE_DIR}]"
-    Trace "PKG_SOURCE:      [${PKG_SOURCE}]"
-    Trace "PKG_BRANCH:      [${PKG_BRANCH}]"
-    Trace "PKG_REVISION:    [${PKG_REVISION}]"
-    Trace "PKG_UPSTREAM:    [${PKG_UPSTREAM}]"
-
-    for i in $(find -L ${MODULE} -type d -not -path "*.git*"|${SED} "s:${MODULE}/*::1"|${SED} '/^$/d'); do
-        mkdir -p ${BLD_DIR}/${i}
-    done
-
-    if [ "${PKG_SOURCE}" != "" ] && [ -d ${PACKAGE_DIR}/${PKG_SOURCE} ]; then
-        GIT_BASENAME=$(basename ${PKG_SOURCE})
-        GIT_NAME_LEN=$(echo -n "${GIT_BASENAME}"|wc -c|awk '{ print $1 }')
-        GIT_OFFSET=$(( GIT_NAME_LEN - 3 ))
-        GIT_MOD_NAME=$(echo "${GIT_BASENAME}" | cut -c"1-$(( GIT_OFFSET-1 ))"|awk '{ print $1 }')
-        GIT_POSTFIX=$(echo "${GIT_BASENAME}" | cut -c"${GIT_OFFSET}-${GIT_NAME_LEN}"|awk '{ print $1 }')
-        Trace "GIT_POSTFIX:     [${GIT_POSTFIX}]"
-        Trace "GIT_MOD_NAME:    [${GIT_MOD_NAME}]"
-    fi
-    set +x
-
-    if [ "${GIT_POSTFIX}" = ".git" ]; then
-        GIT_COPY=${MODULE}/${GIT_MOD_NAME}
-        DEV_COPY_BASE=${TOP_DIR}.pkgs
-        Trace "GIT_COPY:        [${GIT_COPY}]"
-        Trace "DEV_COPY_BASE:   [${DEV_COPY_BASE}]"
-
-        eval "${CMDSET_X}"
-        mkdir -p ${DEV_COPY_BASE}
-        cd ${DEV_COPY_BASE}
-        if [ ! -d ${GIT_MOD_NAME} ]; then
-            git clone ${OPTION_Q} ${PACKAGE_DIR}/${PKG_SOURCE} ${GIT_MOD_NAME} \
-                $([ "${PKG_BRANCH}" = "" ] || echo "-b ${PKG_BRANCH}")
-            if [ "${PKG_UPSTREAM}" != "" ]; then
-                cd ${GIT_MOD_NAME};
-                git remote add upstream ${PKG_UPSTREAM}
-                cd ${OLDPWD};
-            fi
-        fi
-
-        if [ "${PKG_REVISION}" != "" ]; then
-            cd ${GIT_MOD_NAME} && git reset ${OPTION_Q} --hard ${PKG_REVISION} && cd ${OLDPWD}
-        else
-            cd ${GIT_MOD_NAME}
-            git pull ${OPTION_Q} origin ${PKG_BRANCH} || exit 1
-        fi
-
-        cd ${TOP_DIR}
-        rm -fr ${SRC_DIR}/${GIT_MOD_NAME}
-        ln -sf ${DEV_COPY_BASE}/${GIT_MOD_NAME} ${SRC_DIR}/${GIT_MOD_NAME}
-        touch ${BLD_DIR}/${STAMP_UNPACK}
-        PKG_SOURCE=""
-        set +x
-
-        SRC_ELEM=$(ls ${SRC_DIR}|grep -v ${HD_MAKEFILE}|grep -v ${MAKE_SEGMENT})
-        BLD_ELEM=$(ls ${BLD_DIR}|grep -v ${HD_MAKEFILE}|grep -v ${MAKE_SEGMENT})
-        if [ "${BLD_ELEM}" = "" ]; then
-            for iter in ${SRC_ELEM}; do
-                Trace "Bulk [${SRC_DIR}/${iter} => ${BLD_DIR}"
-#                cp -Lrf ${SRC_DIR}/${iter} ${BLD_DIR}
-            done
-            return 0
-        fi
-    fi
-
-#    for FILE in \
-#        $(find -L ${SRC_DIR}/ -type f -o -type l -name "*.[ch]" -o -name "*.mk" -o -name "*.cpp") \
-#        $(find ${SRC_DIR}/ -maxdepth 1 -name "*.patch" -o -name "lib*.a" -o -name "lib*.so") \
-#        $([ "" != "${PKG_SOURCE}" ] && [ -d ${PACKAGE_DIR}/${PKG_SOURCE} ] && find ${PACKAGE_DIR}/${PKG_SOURCE}/ -type f -o -type l) \
-#    ; \
-#    do
-#        if  [ "" != "${PKG_SOURCE}" ] && \
-#            [ -d ${PKG_SOURCE} ] && \
-#            [ "$(dirname ${FILE})" != "${TOP_DIR}/${MODULE}" ]; then
-#            SUBD=$(echo $(dirname ${FILE})|${SED} "s:$(dirname ${PKG_SOURCE})::")
-#            SUBD=$(echo ${SUBD}|${SED} "s:${SRC_DIR}::")
-#        else
-#            SUBD=$(echo $(dirname ${FILE})|${SED} "s:${SRC_DIR}::")
-#            SUBD=$(echo ${SUBD}|${SED} "s:${PACKAGE_DIR}/*::")
-#        fi
-#
-#        COPY_DIR=${OUTPUT_DIR}/${MODULE}/${SUBD}
-#        mkdir -p ${COPY_DIR}
-#        COPY_BASE=$(basename ${FILE})
-#        FILE_COPY=${COPY_DIR}/${COPY_BASE}
-#        # grep -q "\.git" <<< ${FILE} || Trace "Check: ${FILE}: ${FILE_COPY}"
-#
-#        if [ ! -e ${FILE_COPY} -o \
-#             ${FILE} -nt ${FILE_COPY} ]; then
-#             mkdir -p ${BLD_DIR}/${FILE_DIR}
-#             cp -f ${FILE} ${FILE_COPY}
-#        fi
-#    done
-
-}
-
-function Update_Makefile()
-{
-    BLD_MFILE=${BLD_DIR}/${HD_MAKEFILE}
-
-    if  [ ${BLD_MFILE} -nt ${SRC_DIR}/${MAKE_SEGMENT} ] && \
-        [ ${BLD_MFILE} -nt ${STAMP_BLD_ENV} ]; then
-        return 0;
-    fi
-
-    rm -f ${BLD_MFILE}
-
-    echo "MODULE_NAME := ${MODULE}" >> ${BLD_MFILE}
-    cat ${STAMP_BLD_ENV} >> ${BLD_MFILE}
-
-    cat << EOB >> ${BLD_MFILE}
-
-include \$(RULE_DIR)/settings.mk
-include \$(CONFIG_TPL)
-
-all:
-
-EOB
-
-    cp -f ${SRC_DIR}/${MAKE_SEGMENT} ${BLD_DIR}/${MAKE_SEGMENT}
-
-    cat ${BLD_DIR}/${MAKE_SEGMENT} >> ${BLD_MFILE}
-    ${SED} -i 's/clean:/clean : clean-prepare/g' ${BLD_MFILE}
-
-    cat << EOB >> ${BLD_MFILE}
-
-env:
-	@echo ""
-	@printf -- "-----------------------------------------------------------------\n"
-	@\$(foreach var,\$(SHOW_ENV_VARS),\$(call Dump_Var,\$(var)))
-	@printf -- "-----------------------------------------------------------------\n"
-	@echo ""
-
-include \$(RULE_DIR)/rules.mk
-EOB
-
-    Trace "Updated: ${BLD_MFILE}"
-}
-
-if [ "$#" != "1" -a "$#" != "2" ]; then exit 12; fi
-
-MODULE=${1}
-BLD_DIR=${OUTPUT_DIR}/${MODULE}
-SRC_DIR=${TOP_DIR}/${MODULE}
-
-if [ ! -d ${SRC_DIR} ]; then
-    exit 0
-fi
-
-if [ "${VERBOSE_PRE_BLD}" != "" ]; then
-    OPTION_V="-v"
-    CMDSET_X="set -x"
-else
-    OPTION_Q="-q"
-fi
-
-mkdir -p ${BLD_DIR}
-
-MSG=$(printf "%-28s%s" "${MODULE}" "[..]")
-echo -ne "\r                                                    "
-echo -ne "\033[0;37;0;44m""\r[..] o ${MSG}""\033[0;m"
-Trace ""
-
-if [ "$#" = "1" ]; then
-    Update_Sources
-fi
-Update_Makefile

+ 0 - 173
iotkit-embedded/build-rules/rules.mk

@@ -1,173 +0,0 @@
-include  $(RULE_DIR)/settings.mk
-sinclude $(CONFIG_TPL)
-include  $(RULE_DIR)/funcs.mk
-
-TOPDIR_NAME     := $(shell $(SHELL_DBG) basename $(TOP_DIR)|grep -m 1 -o \[-_a-zA-Z\]*[a-zA-Z])
-LIBOBJ_TMPDIR   := $(OUTPUT_DIR)/lib$(TOPDIR_NAME).objs
-
-SYSROOT_BIN     := $(OUTPUT_DIR)${bindir}
-SYSROOT_INC     := $(OUTPUT_DIR)${incdir}
-SYSROOT_LIB     := $(OUTPUT_DIR)${libdir}
-CONFIG_VENDOR   := $(shell grep -m 1 "VENDOR *:" $(CONFIG_TPL) 2>/dev/null|awk '{ print $$NF }')
-IMPORT_VDRDIR   := $(IMPORT_DIR)/$(CONFIG_VENDOR)
-
-HOST_ARCH_BITS  := $(shell [ "$$(uname -m)" = "x86_64" ] && echo -n "64" || echo -n "32")
-PREBUILT_LIBDIR := $(if $(strip $(filter 64,$(HOST_ARCH_BITS)) $(CROSS_PREFIX)),libs,32bit-libs)
-PREBUILT_BINDIR := $(if $(strip $(filter 64,$(HOST_ARCH_BITS)) $(CROSS_PREFIX)),bin,32bit-bin)
-
-CONFIG_VSP_WEBSITE  ?= http://gitlab.alibaba-inc.com/yusheng.yx/alink-vendor-support-package
-
-ifeq ($(shell uname), Linux)
-RPATH_CFLAGS    += -Wl,-rpath='$$''ORIGIN/../lib'
-endif
-
-# CFLAGS contains '$' causes ./configure failure in ORIGIN packages
-#
-# Instead of:
-#
-# ifeq ($(shell uname), Linux)
-# CFLAGS += -Wl,-rpath='$$''ORIGIN/../lib'
-# CFLAGS := $(sort $(CFLAGS))
-# endif
-#
-# Write @ package's makefile:
-#
-# ./configure \
-#     CFLAGS='$(CFLAGS) -Wl,-rpath='\''$$$$'\''ORIGIN/../lib' \
-#     --prefix=...
-#
-# To pass in RPATH related link flags
-
-COMP_LIB_NAME   := $(subst lib,,$(subst .so,,$(subst .a,,$(COMP_LIB))))
-COMP_LIB_OBJS    = $(foreach d,$(COMP_LIB_COMPONENTS),$(LIBOBJ_TMPDIR)/$(d)/*.o)
-RECURSIVE_MAKE  := $(MAKE) $(if $(TOP_Q),-s) -C $(TOP_DIR) -f $(TOP_MAKEFILE)
-ALL_SUB_DIRS    := $(shell find -L $(TOP_DIR) ! -path "$(OUTPUT_DIR)/*" -name "$(MAKE_SEGMENT)" 2>/dev/null \
-                           | $(SED) 's:$(TOP_DIR)[/]*::;s:[/]*$(MAKE_SEGMENT)::')
-
-SHOW_ENV_VARS   := \
-    MODULE_NAME SUBDIRS PKG_NAME PKG_RPATH PKG_SOURCE PKG_SWITCH_V PKG_SWITCH \
-    HOST_ARCH_BITS PREBUILT_LIBDIR RPATH_CFLAGS \
-    CROSS_PREFIX DEPENDS CFLAGS CCLD LDFLAGS \
-    CC LD AR STRIP OBJCOPY COMP_LIB COMP_LIB_COMPONENTS \
-    MAKE_ENV_VARS DEFAULT_BLD \
-    LIBA_TARGET LIBSO_TARGET TARGET KMOD_TARGET \
-    SRCS OBJS LIB_SRCS LIB_OBJS LIB_HDRS_DIR LIB_HEADERS EXTRA_SRCS \
-    $(foreach M,$(LIBA_TARGET),LIB_SRCS_$(subst .a,,$(subst lib,,$(M)))) \
-    INTERNAL_INCLUDES TOP_DIR PRJ_NAME PRJ_VERSION \
-    IMPORT_DIR IMPORT_VDRDIR CONFIG_DIR PACKAGE_DIR EXTERNAL_INCLUDES \
-    CONFIG_LIB_EXPORT OBJCOPY_FLAGS CONFIG_VENDOR COVERAGE_PROGS COVERAGE_CMD \
-
-ifndef CONFIG_LIB_EXPORT
-ifeq (y,$(strip $(CONFIG_EMB_GATEWAY_SDK)))
-CONFIG_LIB_EXPORT := dynamic
-else
-ifeq (y,$(strip $(CONFIG_EMB_BASIC_SDK)))
-CONFIG_LIB_EXPORT := static
-else
-ifeq (y,$(strip $(CONFIG_EMB_ROUTER_SDK)))
-CONFIG_LIB_EXPORT := dynamic
-endif # ROUTER
-endif # BASIC
-endif # GATEWAY
-else
-ifneq (static,$(CONFIG_LIB_EXPORT))
-ifneq (dynamic,$(CONFIG_LIB_EXPORT))
-$(error CONFIG_LIB_EXPORT($(CONFIG_LIB_EXPORT)) is neither 'static' or 'dynamic')
-endif # dynamic
-endif # static
-endif # CONFIG_LIB_EXPORT
-
-ifneq (,$(shell ls $(STAMP_BLD_VAR) 2>/dev/null))
-ifeq (,$(filter reconfig distclean,$(MAKECMDGOALS)))
-ifeq (0,$(strip $(shell $(SED) '/[-_/a-zA-Z0-9]* = ..*/d' $(STAMP_BLD_VAR)|wc -l)))
-include $(STAMP_BLD_VAR)
-endif
-endif
-endif
-
-.PHONY: all clean FORCE
-
-ifdef SUBDIRS
-include $(RULE_DIR)/_rules-top.mk
-include $(RULE_DIR)/_rules-prefix.mk
-include $(RULE_DIR)/_rules-repo.mk
-
-CROSS_CANDIDATES := CC CXX AR LD STRIP OBJCOPY
-export CC       := $(if $(OVERRIDE_CC),     $(OVERRIDE_CC),     $(CROSS_PREFIX)gcc)
-export CXX      := $(if $(OVERRIDE_CXX),    $(OVERRIDE_CXX),    $(CROSS_PREFIX)g++)
-export AR       := $(if $(OVERRIDE_AR),     $(OVERRIDE_AR),     $(CROSS_PREFIX)ar)
-export LD       := $(if $(OVERRIDE_LD),     $(OVERRIDE_LD),     $(CROSS_PREFIX)ld)
-export OBJCOPY  := $(if $(OVERRIDE_OBJCOPY),$(OVERRIDE_OBJCOPY),$(CROSS_PREFIX)objcopy)
-
-ifneq (,$(OVERRIDE_STRIP))
-export STRIP    := $(OVERRIDE_STRIP)
-else
-ifneq (,$(CROSS_PREFIX))
-export STRIP    := $(CROSS_PREFIX)strip
-else
-export STRIP    := true
-endif
-endif
-
-ifeq (gcc,$(strip $(CC)))
-export STRIP    := strip
-endif
-
-ifneq (,$(filter -m32,$(strip $(CFLAGS))))
-PREBUILT_LIBDIR := 32bit-libs
-PREBUILT_BINDIR := 32bit-bin
-endif
-
-include $(RULE_DIR)/_rules-dist.mk
-include $(RULE_DIR)/_rules-complib.mk
-include $(RULE_DIR)/_rules-submods.mk
-
-env:
-	$(Q)echo ""
-	$(Q)printf -- "-----------------------------------------------------------------\n"
-	$(Q)$(foreach var,$(SHOW_ENV_VARS),$(call Dump_Var,$(var)))
-	$(Q)printf -- "-----------------------------------------------------------------\n"
-	$(Q)echo ""
-
-else    # ifdef SUBDIRS
-
-PKG_RPATH   := $(shell echo $(CURDIR)|$(SED) 's:$(OUTPUT_DIR)/*::g')
-PKG_NAME    ?= $(shell basename $(CURDIR))
-PKG_SOURCE  ?= $(shell [ -d $(PACKAGE_DIR) ] && find $(PACKAGE_DIR) -name "$(PKG_NAME)*" | head -1)
-
-DEPENDS     += $(DEPENDS_$(MODULE_NAME))
-DEPENDS     := $(sort $(strip $(DEPENDS)))
-
-ifdef CONFIG_SWITCH
-PKG_SWITCH_V = $(CONFIG_SWITCH)
-else
-PKG_SWITCH_V := CONFIG_$(PKG_RPATH)
-endif
-PKG_SWITCH = $($(PKG_SWITCH_V))
-
-ifdef ORIGIN
-
-include $(RULE_DIR)/_rules-origin.mk
-
-else    # ifdef ORIGIN
-
-ifneq (,$(filter -m32,$(strip $(CFLAGS))))
-PREBUILT_LIBDIR := 32bit-libs
-PREBUILT_BINDIR := 32bit-bin
-endif
-
-include $(RULE_DIR)/_rules-flat.mk
-
-endif   # ifdef ORIGIN
-
-include $(RULE_DIR)/_rules-modinfo.mk
-
-endif   # ifdef SUBDIRS
-
-sinclude $(STAMP_POST_RULE)
-
-ifdef UTEST_PROG
-COVERAGE_LIST += \"./$(strip $(UTEST_PROG) --list)\"
-COVERAGE_LIST += \"./$(strip $(UTEST_PROG))\"
-include $(RULE_DIR)/_rules-coverage.mk
-endif

+ 0 - 40
iotkit-embedded/build-rules/scripts/add_license.sh

@@ -1,40 +0,0 @@
-#! /bin/bash
-
-TEXT=(
-    "Copyright (c) 2014-2016 Alibaba Group. All rights reserved."
-    "License-Identifier: Apache-2.0"
-    ""
-    "Licensed under the Apache License, Version 2.0 (the \"License\"); you may"
-    "not use this file except in compliance with the License."
-    "You may obtain a copy of the License at"
-    ""
-    "http://www.apache.org/licenses/LICENSE-2.0"
-    ""
-    "Unless required by applicable law or agreed to in writing, software"
-    "distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"
-    "WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."
-    "See the License for the specific language governing permissions and"
-    "limitations under the License."
-    ""
-)
-
-TOTAL_LINE=${#TEXT[@]}
-i=$(( TOTAL_LINE - 1 ))
-
-sed -i "1i\ */" $1
-while (( i >= 0 )); do
-    j=$(eval echo '${TEXT['$i']}')
-
-    if [ "$j" = "" ]; then
-        sed -i "1i\ *" $1
-    else
-        if [ "$(echo $j|awk '{ print NF }')" = "1" ] && [ "$(echo $j | cut -c1-7)" = "http://" ]; then
-            sed -i "1i\ *    $j" $1
-        else
-            sed -i "1i\ * $j" $1
-        fi
-    fi
-
-    i=$(( i - 1 ))
-done
-sed -i "1i\/*" $1

+ 0 - 10
iotkit-embedded/build-rules/scripts/del_license.sh

@@ -1,10 +0,0 @@
-#! /bin/bash
-
-START_LINE=$(head -3 $1|grep -n '^ *\/\*'|cut -d':' -f1)
-END_LINE=$(grep -m 1 -n '^ *\*\/' $1|cut -d':' -f1)
-echo "[${START_LINE},${END_LINE}]"
-
-if [ "${START_LINE}" != "" ] && [ "${END_LINE}" != "" ]; then
-    sed -i "${START_LINE},${END_LINE}d" $1
-    echo "LICENSE REMOVED: $1"
-fi

+ 0 - 25
iotkit-embedded/build-rules/scripts/exe_coverage_progs.sh

@@ -1,25 +0,0 @@
-#! /bin/bash
-set -e
-
-if [ "${OUTPUT_DIR}" = "" ] || [ ! -d ${OUTPUT_DIR} ]; then exit 1; fi
-
-cd ${OUTPUT_DIR}/usr/bin
-
-echo ""
-
-iter=0
-while (( iter < ${#PROGS[@]} )); do
-    UT_CMD=$(eval echo '${PROGS['${iter}']}')
-    UT_PROG=$(echo ${UT_CMD}|cut -d' ' -f1)
-
-    echo "[${iter}] RUNNING '${UT_CMD}' with '${UT_PROG}'"|grep --color ".*"
-    echo ""
-
-    if [ -f ${UT_PROG} ]; then
-        ${UT_CMD}
-    else
-        echo "${UT_CMD} SPECIFIED BUT ${UT_PROG} NOT FOUND"|grep --color ".*"
-    fi
-
-    iter=$(( iter + 1 ))
-done

+ 0 - 82
iotkit-embedded/build-rules/scripts/gen_lcov_report.sh

@@ -1,82 +0,0 @@
-#! /bin/bash
-set -e
-
-if [ $# != 1 ]; then exit 1; fi
-if [ "$(uname)" = "Darwin" ]; then
-    SED=gsed
-else
-    SED=sed
-fi
-
-LCOV_DIR=$1
-SRC_NAME_LENGTH=28
-DIR_NAME_LENGTH=16
-COVERAGE_HIGH=90
-COVERAGE_MID=75
-
-echo ""
-echo "Processing [${LCOV_DIR}] for Coverage Brief"
-echo ""
-#
-#      sdk-example / example.c               : [100.00%]  (7/7)            [100.00%]  (1/1)
-#
-echo -ne "\033[1;36m"
-printf "%${DIR_NAME_LENGTH}s   %-${SRC_NAME_LENGTH}s: %-24s %-20s\n\n" \
-    "Directory" \
-    "Source File" \
-    "Line Coverage" \
-    "Function Coverage"
-echo -ne "\033[0m"
-
-REPORT_LIST=$(find ${LCOV_DIR} -mindepth 2 -name "index.html")
-for R in ${REPORT_LIST}; do
-    SOURCE_LIST=$(grep "coverFile" ${R} | awk -F '<' '{ print $3 }' | cut -d'>' -f2)
-    for S in ${SOURCE_LIST}; do
-        STATS=$(grep -A 7 "${S}</a>" ${R} | ${SED} -n '6p;8p'|grep -o -E '[0-9]+')
-        DIR_NAME=$(echo "$(dirname ${R}|xargs basename)" | cut -c1-15)
-        SRC_NAME=$(echo "${S}" | cut -c"1-$(( SRC_NAME_LENGTH -1 ))")
-        COVER_LINE=$(echo ${STATS}|cut -d' ' -f1)
-        TOTAL_LINE=$(echo ${STATS}|cut -d' ' -f2)
-        COVER_FUNC=$(echo ${STATS}|cut -d' ' -f3)
-        TOTAL_FUNC=$(echo ${STATS}|cut -d' ' -f4)
-
-        LINE_PERCENT="$(echo "scale=2; ${COVER_LINE} * 100 / ${TOTAL_LINE}"|bc -l)%"
-        FUNC_PERCENT="$(echo "scale=2; ${COVER_FUNC} * 100 / ${TOTAL_FUNC}"|bc -l)%"
-
-        printf \
-            "%-8s %${DIR_NAME_LENGTH}s / %-${SRC_NAME_LENGTH}s: [ %s ] (%s/%s) \t [ %s ] (%s/%s)\n" \
-            ${LINE_PERCENT} \
-            ${DIR_NAME} \
-            ${SRC_NAME} \
-            ${LINE_PERCENT} \
-            ${COVER_LINE} \
-            ${TOTAL_LINE} \
-            ${FUNC_PERCENT} \
-            ${COVER_FUNC} \
-            ${TOTAL_FUNC}
-    done
-done \
-    | sort -nr \
-    | cut -d' ' -f2- \
-    | awk -v SRC_LEN=${SRC_NAME_LENGTH} -v DIR_LEN=${DIR_NAME_LENGTH} \
-          -v HIGH=${COVERAGE_HIGH} -v MID=${COVERAGE_MID} \
-            '{
-                split($6, arr, ".");
-
-                if (arr[1] >= HIGH)
-                    printf("\033[1;32m");
-                else if (arr[1] >= MID)
-                    printf("\033[1;35m");
-                else
-                    printf("\033[1;31m");
-
-                printf("%" DIR_LEN "s / %-" SRC_LEN "s: [ %-8s] %-12s [ %-8s] %-12s\n",
-                       $1, $3, $6, $8, $10, $12);
-            }'
-
-#
-# 1           2 3         4 5 6       7 8     9 10      11 12
-# sdk-example / example.c : [ 100.00% ] (7/7) [ 100.00% ]  (1/1)
-#
-echo ""
-exit 0

+ 0 - 65
iotkit-embedded/build-rules/scripts/ops_repository.sh

@@ -1,65 +0,0 @@
-#! /bin/bash
-
-if [ $# != 2 ]; then echo "$# != 2"; exit 1; fi
-if [ ! -f $1 ]; then echo "$1 not exist"; exit 2; fi
-
-if [ "$(uname)" = "Darwin" ]; then
-    SED=gsed
-else
-    SED=sed
-fi
-
-BLDV=$1
-CMDV=$2
-
-if [ "${CMDV}" = "list" ]; then
-    grep "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV} \
-        | ${SED} 's/^PKG_UPSTREAM_\([^ ]*\) = \(.*\)$/[\1] \2/g'
-fi
-
-REPO_LIST=$( \
-    grep "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV} \
-        | ${SED} 's/^PKG_UPSTREAM_\([^ ]*\) = \(.*\)$/[\1] \2/g' \
-        | cut -d' ' -f1 \
-        | ${SED} 's/\[//g;s/\]//g;' \
-)
-
-if [ "${CMDV}" = "update" ]; then
-    echo "Select repository to be updated, type 1 to update all repositories"|grep --color ".*"
-    echo ""
-    select O in "ALL REPOS" ${REPO_LIST}; do
-        echo ""
-        echo "Updating $O ..."|grep --color ".*"
-        echo ""
-        break
-    done
-
-    if [ "${O}" = "ALL REPOS" ]; then
-        O=""
-    fi
-    REPOS=$(grep -o "^PKG_UPSTREAM_[-/_a-zA-Z0-9]*" ${BLDV}|grep "${O}"|sort -u|${SED} 's:PKG_UPSTREAM_::')
-    for R in ${REPOS}; do
-        UPSTREAM=$(grep -m 1 "^PKG_UPSTREAM_${R}" ${BLDV}|awk '{ print $NF }')
-        SOURCE=$(grep -m 1 "^PKG_SOURCE_${R}" ${BLDV}|awk '{ print $NF }')
-        BRANCH=$(grep -m 1 "^PKG_BRANCH_${R}" ${BLDV}|awk '{ print $NF }')
-        [ "${BRANCH}" = "" ] && BRANCH="master"
-
-        echo "[ ${SOURCE} ] <= : ${UPSTREAM} :: ${BRANCH}"
-        set -x
-        cd ${PACKAGE_DIR}
-        rm -rf ${SOURCE}
-
-        # --single-branch might doesn't exist for git <= 1.7.9.5
-        #
-        # git clone -q --bare -b ${BRANCH} --single-branch ${UPSTREAM} ${SOURCE}
-        git clone -q --bare -b ${BRANCH} ${UPSTREAM} ${SOURCE}
-        rm -rf ${SOURCE}/hooks/
-        mkdir -p ${SOURCE}/hooks/
-        touch ${SOURCE}/hooks/.gitkeep
-        touch ${SOURCE}/refs/{heads,tags}/.gitkeep
-
-        rm -rf ${TOP_DIR}.pkgs/${SOURCE/.git}
-        cd ${OLDPWD}
-        set +x
-    done
-fi

+ 0 - 64
iotkit-embedded/build-rules/scripts/stats_static_lib.sh

@@ -1,64 +0,0 @@
-#! /bin/bash
-
-TARGET=$1
-TEMPD=$(mktemp -d -t STATD-XXXX)
-TEMPF=$(mktemp -t STATF-XXXX)
-
-# echo "TARGET = ${TARGET}"
-# echo "STAGED = ${STAGED}"
-# echo "TEMPD = ${TEMPD}"
-
-if [ ! -f ${TARGET} ] || [ ! -d ${STAGED} ]; then
-    echo "Invalid Env"
-    exit 1
-fi
-
-cp ${TARGET} ${TEMPD}
-cd ${TEMPD}
-ar xf $(basename ${TARGET})
-rm -f $(basename ${TARGET})
-${STRIP} -S *.o > /dev/null 2>&1
-
-for obj in $(ls *.o); do
-    dir=$(find ${STAGED} -name ${obj}|xargs dirname|xargs basename)
-    printf "%-12s %-32s %s\n" ${dir} ${obj} $(du -b ${obj}|awk '{ print $1 }')
-done | sort > ${TEMPF}
-
-MODS=$(cat ${TEMPF}|awk '{ print $1 }'|sort -u)
-
-TOTAL=$(cat ${TEMPF}|awk '{ sum += $3 } END { print sum }')
-# echo "TOTAL = ${TOTAL}"
-
-SMODS=$( \
-for mod in ${MODS}; do \
-    MSIZE=$(grep "^${mod}" ${TEMPF}|awk '{ sum += $3 } END { print sum }'); \
-    printf "%-8s %s\n" \
-        $(awk -v a=${MSIZE} -v b=${TOTAL} 'BEGIN { printf("%.2f%%\n", a/b*100); }') \
-        "${mod}"; \
-done | sort -nr | awk '{ print $2 }' \
-)
-
-echo ""
-for mod in ${SMODS}; do
-    MSIZE=$(grep "^${mod}" ${TEMPF}|awk '{ sum += $3 } END { print sum }')
-    OBJS=$(grep "^${mod}" ${TEMPF}|awk '{ print $2 }')
-    for obj in ${OBJS}; do
-        FSIZE=$(grep "\<${obj}\>" ${TEMPF}|awk '{ print $3 }')
-        printf "     %-8s %28s | %-8s %8s %-8s\n" \
-            $(awk -v a=${FSIZE} -v b=${MSIZE} 'BEGIN { printf("%.2f%%\n", a/b*100); }') \
-            "${obj}" "${mod}" "${FSIZE} /" "${MSIZE}"
-    done | sort -nr
-    echo "    -----------------------------------------------------------------"
-done
-
-echo ""
-for mod in ${MODS}; do
-    MSIZE=$(grep "^${mod}" ${TEMPF}|awk '{ sum += $3 } END { print sum }')
-    printf "     %-8s %-32s %16s\n" \
-        $(awk -v a=${MSIZE} -v b=${TOTAL} 'BEGIN { printf("%.2f%%\n", a/b*100); }') \
-        "[ ${mod} ]" "${MSIZE} Bytes"
-done | sort -nr
-
-cd ${OLDPWD}
-rm -rf ${TEMPD}
-rm -f ${TEMPF}

+ 0 - 83
iotkit-embedded/build-rules/settings.mk

@@ -1,83 +0,0 @@
-# Basic Settings
-#
-SHELL           := /bin/bash
-TOP_DIR         ?= $(CURDIR)
-
-ifeq (Darwin,$(strip $(shell uname)))
-SED             := gsed
-STRIP_DBGOPT    :=
-else
-SED             := sed
-STRIP_DBGOPT    := --strip-debug
-endif
-
-# Settings of input directory and file
-#
-RULE_DIR        ?= $(TOP_DIR)/build-rules
-CONFIG_DIR      ?= $(TOP_DIR)/configs
-SCRIPT_DIR      ?= $(TOP_DIR)/scripts
-PACKAGE_DIR     ?= $(TOP_DIR)/packages
-IMPORT_DIR      ?= $(TOP_DIR)/import
-MAKE_SEGMENT    ?= iot.mk
-
-ifeq ($(shell [ ! -d $(CONFIG_DIR) ] && echo y),y)
-DEFAULT_BLD     := $(RULE_DIR)/misc/config.generic.default
-endif
-
-# Settings of project information
-PRJ_NAME        ?= LITE-build.prj
-PRJ_VERSION     ?= LITE-build.ver
-
-# Settings of output directory
-#
-CONFIG_TPL      := $(TOP_DIR)/.config
-OUTPUT_DIR      ?= $(TOP_DIR)/.O
-DIST_DIR        ?= $(TOP_DIR)/output
-LCOV_DIR        ?= Coverage
-FINAL_DIR       ?= $(DIST_DIR)/release
-
-# Setting of directory for flat modules
-#
-bindir          = /usr/bin
-libdir          = /usr/lib
-incdir          = /usr/include
-
-# Setting of build process control
-#
-COMPILE_LOG     := compile.log
-WARNING_LOG     := warnings.log
-HD_MAKEFILE     := makefile
-TOP_MAKEFILE    := makefile
-
-STAMP_PRJ_CFG   := $(OUTPUT_DIR)/.just.configured
-STAMP_BLD_ENV   := $(OUTPUT_DIR)/.sub-build.env
-STAMP_BLD_VAR   := $(OUTPUT_DIR)/.sub-build.vars
-STAMP_UNPACK    := .unpack.done
-STAMP_CONFIG    := .config.done
-STAMP_BUILD     := .build.done
-STAMP_INSTALL   := .install.done
-STAMP_POSTINS   := .post.install.done
-STAMP_SHIELD    := .shield.done
-STAMP_POST_RULE := $(OUTPUT_DIR)/.post-rules.mk
-STAMP_DIR       := $(OUTPUT_DIR)/stamps
-
-ifdef DEBUG
-AUTO_HEADER_Q   :=
-ORIGIN_Q        :=
-SHELL_DBG       := set -x;
-Q               :=
-TOP_Q           :=
-else
-Q               := @
-TOP_Q           := @
-endif
-
-ifdef DEBUG_SHELL
-SHELL_DBG       := set -x;
-endif
-
-# Setting of directory for origin modules
-#
-export INSTALL_DIR     = $(OUTPUT_DIR)/usr
-export INSTALL_BIN_DIR = $(INSTALL_DIR)/bin
-export INSTALL_LIB_DIR = $(INSTALL_DIR)/lib

+ 0 - 6
iotkit-embedded/cmake/modules/iotx-sdk-version.cmake

@@ -1,6 +0,0 @@
-set(iotx_sdk_version_major 1)
-set(iotx_sdk_version_minor 1)
-set(iotx_sdk_version_patch 0)
-
-set(iotx_sdk_version "${iotx_sdk_version_major}.${iotx_sdk_version_minor}.${iotx_sdk_version_patch}")
-

+ 0 - 21
iotkit-embedded/doc/config.mdm9206.sim7000c

@@ -1,21 +0,0 @@
-CONFIG_ENV_CFLAGS += \
-    --cpu=Cortex-A7 \
-    -O1 \
-    --diag_suppress=9931 \
-    --gnu \
-    --arm_only \
-    --diag_error=warning \
-    --protect_stack \
-    --apcs=/interwork \
-    -DSIM7000C_DAM
-
-OVERRIDE_CC             := armcc
-OVERRIDE_AR             := armar
-
-CONFIG_src/shadow       :=
-CONFIG_src/coap         :=
-CONFIG_src/ota          :=
-CONFIG_src/tls          :=
-CONFIG_src/sdk-tests    :=
-CONFIG_sample           :=
-CONFIG_src/platform     :=

+ 0 - 6
iotkit-embedded/doc/export.sdk.demo/coap.mk

@@ -1,6 +0,0 @@
-all ::
-	$(CC) $(CFLAGS) -o ext.coap coap-example.c $(LDFLAGS)
-
-clean ::
-	rm -vf ext.coap
-

+ 0 - 13
iotkit-embedded/doc/export.sdk.demo/head.mk

@@ -1,13 +0,0 @@
-.PHONY: all
-
-CC          := gcc
-
-CFLAGS      := -I../include
-CFLAGS      += -I../include/iot-sdk
-CFLAGS      += -I../include/mbedtls
-
-LDFLAGS     := -L../lib
-LDFLAGS     += -liot_sdk -liot_platform
-LDFLAGS     += -Bstatic -liot_tls
-LDFLAGS     += -lgcov
-

+ 0 - 16
iotkit-embedded/doc/export.sdk.demo/head_id2.mk

@@ -1,16 +0,0 @@
-.PHONY: all
-
-CC          := gcc
-
-CFLAGS      := -I../include
-CFLAGS      += -I../include/iot-sdk
-CFLAGS      += -I../include/mbedtls
-CFLAGS      += -DMQTT_ID2_AUTH
-
-LDFLAGS     := -L../lib
-LDFLAGS     += -liot_sdk -liot_platform
-LDFLAGS     += -ltfs_online -liot-tfs
-LDFLAGS     += -Bstatic -liot_tls
-LDFLAGS     += -liot_sdk -liot_platform
-LDFLAGS     += -lgcov
-

+ 0 - 6
iotkit-embedded/doc/export.sdk.demo/http.mk

@@ -1,6 +0,0 @@
-all ::
-	$(CC) $(CFLAGS) -o ext.http http-example.c $(LDFLAGS)
-
-clean ::
-	rm -vf ext.http
-

+ 0 - 6
iotkit-embedded/doc/export.sdk.demo/mqtt.mk

@@ -1,6 +0,0 @@
-all ::
-	$(CC) $(CFLAGS) -o ext.mqtt mqtt-example.c $(LDFLAGS)
-
-clean ::
-	rm -vf ext.mqtt
-

+ 0 - 16
iotkit-embedded/doc/make.settings.sections/README.md

@@ -1,16 +0,0 @@
-文件说明
----
-
-	文件名 | 说明
-	-------|-----
-	section.$i.$j | 输入文件, 记录 make.settings 中的开关段落
-	make.settings.sample.$x.$y.$z | 输出文件, 组合 make.settings 的开关段落到完整配置
-	enum_config.sh | 工作脚本, 从输入文件产生输出文件
-
-使用方法
----
-	for iter in doc/make.settings.sections/make.settings.sample.*; do
-		cp ${iter} make.settings
-		make
-	done
-

+ 0 - 35
iotkit-embedded/doc/make.settings.sections/enum_config.sh

@@ -1,35 +0,0 @@
-#! /bin/bash
-
-M=$(ls section.*.*|cut -d. -f2|sort -nr|head -1)
-iter=1
-while (( iter <= M )); do
-    PARA[${iter}]="$(ls -1 section.${iter}.*|xargs)"
-#   echo "PARA[${iter}] = ${PARA[${iter}]}"
-    iter=$(( iter + 1 ))
-done
-
-X=1
-Y=1
-Z=1
-while (( X <= $(echo "${PARA[1]}"|awk '{ print NF }') )); do
-    while (( Y <= $(echo "${PARA[2]}"|awk '{ print NF }') )); do
-        while (( Z <= $(echo "${PARA[3]}"|awk '{ print NF }') )); do
-            echo "$X:$Y:$Z"
-#           cat << EOB > make.settings.sample.$X.$Y
-            cat << EOB > make.settings.sample.$X.$Y.$Z
-EOB
-            PART_A=$(echo "${PARA[1]}"|awk "{ print \$${X} }")
-            PART_B=$(echo "${PARA[2]}"|awk "{ print \$${Y} }")
-            PART_C=$(echo "${PARA[3]}"|awk "{ print \$${Z} }")
-            CMD="cat ${PART_A} ${PART_B} ${PART_C} >> make.settings.sample.$X.$Y.$Z"
-#           CMD="cat ${PART_A} ${PART_B} >> make.settings.sample.$X.$Y"
-            echo "CMD: ${CMD}"
-            eval $CMD
-            Z=$(( Z + 1 ))
-        done
-        Y=$(( Y + 1 ))
-        Z=1
-    done    
-    X=$(( X + 1 ))
-    Y=1
-done

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.1.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.1.2.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.1.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.2.2.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.1.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.3.2.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.1.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = n
-FEATURE_OTA_ENABLED         = n

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.1

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 11
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.2

@@ -1,11 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 10
iotkit-embedded/doc/make.settings.sections/make.settings.sample.4.2.3

@@ -1,10 +0,0 @@
-BUILD_TYPE                  = debug
-
-PLATFORM_CC                 = gcc
-PLATFORM_AR                 = ar
-
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n
-FEATURE_COAP_COMM_ENABLED   = y
-FEATURE_OTA_ENABLED         = n

+ 0 - 3
iotkit-embedded/doc/make.settings.sections/section.1.1

@@ -1,3 +0,0 @@
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n

+ 0 - 3
iotkit-embedded/doc/make.settings.sections/section.1.2

@@ -1,3 +0,0 @@
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = n

+ 0 - 3
iotkit-embedded/doc/make.settings.sections/section.1.3

@@ -1,3 +0,0 @@
-FEATURE_MQTT_COMM_ENABLED   = y
-FEATURE_MQTT_DIRECT         = y
-FEATURE_MQTT_DIRECT_NOTLS   = y

+ 0 - 3
iotkit-embedded/doc/make.settings.sections/section.1.4

@@ -1,3 +0,0 @@
-FEATURE_MQTT_COMM_ENABLED   = n
-FEATURE_MQTT_DIRECT         = n
-FEATURE_MQTT_DIRECT_NOTLS   = n

+ 0 - 1
iotkit-embedded/doc/make.settings.sections/section.2.1

@@ -1 +0,0 @@
-FEATURE_COAP_COMM_ENABLED   = n

+ 0 - 1
iotkit-embedded/doc/make.settings.sections/section.2.2

@@ -1 +0,0 @@
-FEATURE_COAP_COMM_ENABLED   = y

+ 0 - 2
iotkit-embedded/doc/make.settings.sections/section.3.1

@@ -1,2 +0,0 @@
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = MQTT

+ 0 - 2
iotkit-embedded/doc/make.settings.sections/section.3.2

@@ -1,2 +0,0 @@
-FEATURE_OTA_ENABLED         = y
-FEATURE_OTA_SIGNAL_CHANNEL  = COAP

+ 0 - 1
iotkit-embedded/doc/make.settings.sections/section.3.3

@@ -1 +0,0 @@
-FEATURE_OTA_ENABLED         = n

+ 0 - 9
iotkit-embedded/doc/website.documents/Board_List.md

@@ -1,9 +0,0 @@
-# 物联网通信模组
-与阿里云物联网套件深度合作的通信模组, 已具备连接阿里云物联网平台的能力, 客户可以很方便进行应用场景业务开发.
-
-## 广域网通信模组
-|  厂商  |  型号  |  模组类型  |  模块链接  |  开发板链接  |  支持协议  |  物联网套件AT指令接口  |
-|--------|--------|------------|------------|--------------|------------|------------------------|
-| 合宙(Luat) | Air202  | GPRS |  [点击查看](https://market.aliyun.com/products/201200001/cmgj022498.html)  | [点击查看](https://market.aliyun.com/products/201200001/cmgj022238.html) | MQTT+TLS |  不支持  |
-| 合宙(Luat) | Air800  | GPRS |  [点击查看](https://market.aliyun.com/products/201200001/cmgj022245.html)  | [点击查看](https://market.aliyun.com/products/201196001/cmgj022500.html) | MQTT+TLS |  不支持  |
-| 有方(Neoway) |  N10  | GPRS |   [点击查看](https://market.aliyun.com/products/201200001/cmgj022169.html)  | [点击查看](https://market.aliyun.com/products/201200001/cmgj022169.html) | MQTT+TLS |  支持  |

+ 0 - 301
iotkit-embedded/doc/website.documents/C-SDK_Usage.md

@@ -1,301 +0,0 @@
-## 详细技术说明文档, 请访问[官方WiKi](https://github.com/aliyun/iotkit-embedded/wiki)
-
-## 编译配置项说明
-
-**请先下载最新版本设备端C语言SDK** [SDK下载](https://help.aliyun.com/document_detail/42648.html)
-
-解压之后, 打开编译配置文件`make.settings`, 根据需要编辑配置项:
-
-    FEATURE_MQTT_COMM_ENABLED    = y          # 是否打开MQTT通道的总开关
-    FEATURE_MQTT_DIRECT          = y          # 是否打开MQTT直连的分开关
-    FEATURE_MQTT_DIRECT_NOTLS    = n          # 是否打开MQTT直连无TLS的分开关
-    FEATURE_COAP_COMM_ENABLED    = y          # 是否打开CoAP通道的总开关
-    FEATURE_HTTP_COMM_ENABLED    = y          # 是否打开HTTP通道的总开关
-    FEATURE_SUBDEVICE_ENABLED    = n          # 是否打开主子设备功能的总开关
-    FEATURE_SUBDEVICE_STATUS     = gateway    # 主子设备功能所处的功能状态
-    FEATURE_CMP_ENABLED          = y          # 是否打开CMP功能的总开关
-    FEATURE_CMP_VIA_MQTT_DIRECT  = y          # CMP功能连云部分是否直接使用MQTT的开关
-    FEATURE_MQTT_DIRECT_NOITLS   = y          # 是否打开MQTT直连无ITLS的分开关 目前itls只在id2模式支持
-    FEATURE_DM_ENABLED           = y          # 是否打开DM功能的总开关
-    FEATURE_SERVICE_OTA_ENABLED  = y          # 是否打开linkit中OTA功能的分开关
-
-具体含义参见下表:
-
-| 配置选项                    | 含义                                                            |
-|-----------------------------|-----------------------------------------------------------------|
-| FEATURE_MQTT_COMM_ENABLED   | 是否使能MQTT通道功能的总开关                                    |
-| FEATURE_MQTT_DIRECT         | 是否用MQTT直连模式代替HTTPS三方认证模式做设备认证               |
-| FEATURE_MQTT_DIRECT_NOTLS   | 使用MQTT直连模式做设备认证时, 是否要关闭MQTT over TLS           |
-| FEATURE_COAP_COMM_ENABLED   | 是否使能CoAP通道功能的总开关                                    |
-| FEATURE_HTTP_COMM_ENABLED   | 是否使能Https通道功能的总开关                                   |
-| FEATURE_SUBDEVICE_ENABLED   | 是否使能主子设备通道功能的总开关                                    |
-| FEATURE_SUBDEVICE_STATUS    | 主子设备功能所处的功能状态,取值有网关gateway(gw=1)和子设备subdevice(gw=0) |
-| FEATURE_CMP_ENABLED         | 是否打开CMP功能的总开关,CMP: connectivity management platform |
-| FEATURE_CMP_VIA_CLOUD_CONN  | CMP功能连云部分选择使用CLOUD_CONN,该开关选择具体协议:MQTT/CoAP/HTTP|
-| FEATURE_MQTT_ID2_AUTH       | ID2功能需打开ITLS开关支持|
-| FEATURE_SERVICE_COTA_ENABLED| 是否打开linkit中COTA功能的分开关,需打开FEATURE_SERVICE_OTA_ENABLED支持|
-|FEATURE_SUPPORT_PRODUCT_SECRET| 是否打开一型一密开关,与id2互斥 |
-
-
-## 编译 & 运行
-请参考[README.md](https://github.com/aliyun/iotkit-embedded/blob/master/README.md)
-
-## C-SDK提供的功能API说明
-
-以下为华东2站点V2.0+版本的C-SDK提供的功能和对应的API, 用于让用户编写业务逻辑, 封装AT命令时, 也是基于这些API
-
-更加准确详细和权威的描述, 以代码`src/sdk-impl/iot_export.h`, 以及`src/sdk-impl/exports/*.h`中的注释为准
-
-如何使用这些API编写应用逻辑, 以代码`sample/*/*.c`的示例程序为准
-
-### **API列表**
-用如下命令, 可以列出当前SDK代码提供的所有面向用户的API函数:
-
-    $ cd src/sdk-impl
-    $ grep -o "IOT_[A-Z][_a-zA-Z]*[^_]\> *(" iot_export.h exports/*.h|sed 's!.*:\(.*\)(!\1!'|cat -n
-
-     1  IOT_OpenLog
-     2  IOT_CloseLog
-     3  IOT_SetLogLevel
-     4  IOT_DumpMemoryStats
-     5  IOT_SetupConnInfo
-     6  IOT_SetupConnInfoSecure
-     7  IOT_Cloud_Connection_Init
-     8  IOT_Cloud_Connection_Deinit
-     9  IOT_Cloud_Connection_Send_Message
-    10  IOT_Cloud_Connection_Yield
-    11  IOT_CMP_Init
-    12  IOT_CMP_OTA_Start
-    13  IOT_CMP_OTA_Set_Callback
-    14  IOT_CMP_OTA_Get_Config
-    15  IOT_CMP_OTA_Request_Image
-    16  IOT_CMP_Register
-    17  IOT_CMP_Unregister
-    18  IOT_CMP_Send
-    19  IOT_CMP_Send_Sync
-    20  IOT_CMP_Yield
-    21  IOT_CMP_Deinit
-    22  IOT_CMP_OTA_Yield
-    23  IOT_CoAP_Init
-    24  IOT_CoAP_Deinit
-    25  IOT_CoAP_DeviceNameAuth
-    26  IOT_CoAP_Yield
-    27  IOT_CoAP_SendMessage
-    28  IOT_CoAP_GetMessagePayload
-    29  IOT_CoAP_GetMessageCode
-    30  IOT_HTTP_Init
-    31  IOT_HTTP_DeInit
-    32  IOT_HTTP_DeviceNameAuth
-    33  IOT_HTTP_SendMessage
-    34  IOT_HTTP_Disconnect
-    35  IOT_MQTT_Construct
-    36  IOT_MQTT_ConstructSecure
-    37  IOT_MQTT_Destroy
-    38  IOT_MQTT_Yield
-    39  IOT_MQTT_CheckStateNormal
-    40  IOT_MQTT_Disable_Reconnect
-    41  IOT_MQTT_Subscribe
-    42  IOT_MQTT_Unsubscribe
-    43  IOT_MQTT_Publish
-    44  IOT_OTA_Init
-    45  IOT_OTA_Deinit
-    46  IOT_OTA_ReportVersion
-    47  IOT_OTA_RequestImage
-    48  IOT_OTA_ReportProgress
-    49  IOT_OTA_GetConfig
-    50  IOT_OTA_IsFetching
-    51  IOT_OTA_IsFetchFinish
-    52  IOT_OTA_FetchYield
-    53  IOT_OTA_Ioctl
-    54  IOT_OTA_GetLastError
-    55  IOT_Shadow_Construct
-    56  IOT_Shadow_Destroy
-    57  IOT_Shadow_Yield
-    58  IOT_Shadow_RegisterAttribute
-    59  IOT_Shadow_DeleteAttribute
-    60  IOT_Shadow_PushFormat_Init
-    61  IOT_Shadow_PushFormat_Add
-    62  IOT_Shadow_PushFormat_Finalize
-    63  IOT_Shadow_Push
-    64  IOT_Shadow_Push_Async
-    65  IOT_Shadow_Pull
-    66  IOT_Gateway_Generate_Message_ID
-    67  IOT_Gateway_Construct
-    68  IOT_Gateway_Destroy
-    69  IOT_Subdevice_Register
-    70  IOT_Subdevice_Unregister
-    71  IOT_Subdevice_Login
-    72  IOT_Subdevice_Logout
-    73  IOT_Gateway_Get_TOPO
-    74  IOT_Gateway_Get_Config
-    75  IOT_Gateway_Publish_Found_List
-    76  IOT_Gateway_Yield
-    77  IOT_Gateway_Subscribe
-    78  IOT_Gateway_Unsubscribe
-    79  IOT_Gateway_Publish
-    80  IOT_Gateway_RRPC_Register
-    81  IOT_Gateway_RRPC_Response
-    82  linkkit_start
-    83  linkkit_end
-    84  linkkit_dispatch
-    85  linkkit_yield
-    86  linkkit_set_value
-    87  linkkit_get_value
-    88  linkkit_set_tsl
-    89  linkkit_answer_service
-    90  linkkit_invoke_raw_service
-    91  linkkit_trigger_event
-    92  linkkit_fota_init
-    93  linkkit_invoke_fota_service
-    94  linkkit_fota_init
-    95  linkkit_invoke_cota_get_config
-    96  linkkit_invoke_cota_service
-
-
-
-
-### **必选API**
-
-| 序号  | 函数名                       | 说明                                                               |
-|-------|------------------------------|--------------------------------------------------------------------|
-|  1    | IOT_OpenLog                  | 开始打印日志信息(log), 接受一个const char *为入参, 表示模块名字    |
-|  2    | IOT_CloseLog                 | 停止打印日志信息(log), 入参为空                                    |
-|  3    | IOT_SetLogLevel              | 设置打印的日志等级, 接受入参从1到5, 数字越大, 打印越详细           |
-|  4    | IOT_DumpMemoryStats          | 调试函数, 打印内存的使用统计情况, 入参为1-5, 数字越大, 打印越详细  |
-
-### **CoAP功能相关**
-
-| 序号  | 函数名                       | 说明                                                                           |
-|-------|------------------------------|--------------------------------------------------------------------------------|
-|  1    | IOT_CoAP_Init                | CoAP实例的构造函数, 入参为`iotx_coap_config_t`结构体, 返回创建的CoAP会话句柄   |
-|  2    | IOT_CoAP_Deinit              | CoAP实例的摧毁函数, 入参为`IOT_CoAP_Init()`所创建的句柄                        |
-|  3    | IOT_CoAP_DeviceNameAuth      | 基于控制台申请的`DeviceName`, `DeviceSecret`, `ProductKey`做设备认证           |
-|  4    | IOT_CoAP_GetMessageCode      | CoAP会话阶段, 从服务器的`CoAP Response`报文中获取`Respond Code`                |
-|  5    | IOT_CoAP_GetMessagePayload   | CoAP会话阶段, 从服务器的`CoAP Response`报文中获取报文负载                      |
-|  6    | IOT_CoAP_SendMessage         | CoAP会话阶段, 连接已成功建立后调用, 组织一个完整的CoAP报文向服务器发送         |
-|  7    | IOT_CoAP_Yield               | CoAP会话阶段, 连接已成功建立后调用, 检查和收取服务器对`CoAP Request`的回复报文 |
-
-### ** 云端连接Cloud Connection功能相关**
-
-| 序号  | 函数名                       | 说明                                                                           |
-|-------|------------------------------|--------------------------------------------------------------------------------|
-|  1    | IOT_Cloud_Connection_Init    | 云端连接实例的构造函数, 入参为`iotx_cloud_connection_param_pt`结构体, 返回创建的云端连接会话句柄   |
-|  2    | IOT_Cloud_Connection_Deinit  | 云端连接实例的摧毁函数, 入参为`IOT_Cloud_Connection_Init()`所创建的句柄                        |
-|  3    | IOT_Cloud_Connection_Send_Message      | 发送数据给云端           |
-|  4    | IOT_Cloud_Connection_Yield   | 云端连接成功建立后,收取服务器发送的报文                |
-
-### ** CMP功能相关**
-
-| 序号  | 函数名                       | 说明                                                                           |
-|-------|------------------------------|--------------------------------------------------------------------------------|
-|  1    | IOT_CMP_Init                 | CMP实例的构造函数, 入参为`iotx_cmp_init_param_pt`结构体,只存在一个CMP实例     |
-|  2    | IOT_CMP_Register             | 通过CMP订阅服务                                                                |
-|  3    | IOT_CMP_Unregister           | 通过CMP取消服务订阅                                                            |
-|  4    | IOT_CMP_Send                 | 通过CMP发送数据,可以送给云端,也可以送给本地设备                              |
-|  5    | IOT_CMP_Send_Sync            | 通过CMP同步发送数据   ,暂不支持                                               |
-|  6    | IOT_CMP_Yield                | 通过CMP接收数据,单线程情况下才支持                                            |
-|  7    | IOT_CMP_Deinit               | CMP示例的摧毁函数                                                              |
-|  8    | IOT_CMP_OTA_Start            | 初始化ota功能,上报版本                                                        |
-|  9    | IOT_CMP_OTA_Set_Callback     | 设置OTA回调函数                                                                |
-|  10   | IOT_CMP_OTA_Get_Config       | 获取远程配置                                                                   |
-|  11   | IOT_CMP_OTA_Request_Image    | 获取固件                                                                       |
-|  12   | IOT_CMP_OTA_Yield            | 通过CMP完成OTA功能                                                             |
-
-
-
-### **MQTT功能相关**
-
-| 序号  | 函数名                       | 说明                                                                           |
-|-------|------------------------------|--------------------------------------------------------------------------------|
-|  1    | IOT_SetupConnInfo            | MQTT连接前的准备, 基于`DeviceName + DeviceSecret + ProductKey`产生MQTT连接的用户名和密码等 |
-|  2    | IOT_SetupConnInfoSecure      | MQTT连接前的准备, 基于`ID2 + DeviceSecret + ProductKey`产生MQTT连接的用户名和密码等,ID2模式启用|
-|  3    | IOT_MQTT_CheckStateNormal    | MQTT连接后, 调用此函数检查长连接是否正常                                       |
-|  4    | IOT_MQTT_Construct           | MQTT实例的构造函数, 入参为`iotx_mqtt_param_t`结构体, 连接MQTT服务器, 并返回被创建句柄 |
-|  5    | IOT_MQTT_ConstructSecure     | MQTT实例的构造函数, 入参为`iotx_mqtt_param_t`结构体, 连接MQTT服务器, 并返回被创建句柄 ,ID2模式启用|
-|  6    | IOT_MQTT_Destroy             | MQTT实例的摧毁函数, 入参为`IOT_MQTT_Construct()`创建的句柄                     |
-|  7    | IOT_MQTT_Publish             | MQTT会话阶段, 组织一个完整的`MQTT Publish`报文, 向服务端发送消息发布报文       |
-|  8    | IOT_MQTT_Subscribe           | MQTT会话阶段, 组织一个完整的`MQTT Subscribe`报文, 向服务端发送订阅请求         |
-|  9    | IOT_MQTT_Unsubscribe         | MQTT会话阶段, 组织一个完整的`MQTT UnSubscribe`报文, 向服务端发送取消订阅请求   |
-|  10   | IOT_MQTT_Yield               | MQTT会话阶段, MQTT主循环函数, 内含了心跳的维持, 服务器下行报文的收取等         |
-
-### **OTA功能相关(模组实现时的可选功能)**
-
-| 序号  | 函数名                       | 说明                                                                                   |
-|-------|------------------------------|----------------------------------------------------------------------------------------|
-|  1    | IOT_OTA_Init                 | OTA实例的构造函数, 创建一个OTA会话的句柄并返回                                         |
-|  2    | IOT_OTA_Deinit               | OTA实例的摧毁函数, 销毁所有相关的数据结构                                              |
-|  3    | IOT_OTA_Ioctl                | OTA实例的输入输出函数, 根据不同的命令字可以设置OTA会话的属性, 或者获取OTA会话的状态    |
-|  4    | IOT_OTA_GetLastError         | OTA会话阶段, 若某个`IOT_OTA_*()`函数返回错误, 调用此接口可获得最近一次的详细错误码     |
-|  5    | IOT_OTA_ReportVersion        | OTA会话阶段, 向服务端汇报当前的固件版本号                                              |
-|  6    | IOT_OTA_FetchYield           | OTA下载阶段, 在指定的`timeout`时间内, 从固件服务器下载一段固件内容, 保存在入参buffer中 |
-|  7    | IOT_OTA_IsFetchFinish        | OTA下载阶段, 判断迭代调用`IOT_OTA_FetchYield()`是否已经下载完所有的固件内容            |
-|  8    | IOT_OTA_IsFetching           | OTA下载阶段, 判断固件下载是否仍在进行中, 尚未完成全部固件内容的下载                    |
-|  9    | IOT_OTA_ReportProgress       | 可选API, OTA下载阶段, 调用此函数向服务端汇报已经下载了全部固件内容的百分之多少         |
-|  10   | IOT_OTA_RequestImage         | 可选API,向服务端请求固件下载                                                          |
-|  11   | IOT_OTA_GetConfig            | 可选API,向服务端请求远程配置                                                          |
-
-
-### **HTTP功能相关**
-
-| 序号  | 函数名                       | 说明                                                                                   |
-|-------|------------------------------|----------------------------------------------------------------------------------------|
-|  1    | IOT_HTTP_Init                | Https实例的构造函数, 创建一个HTTP会话的句柄并返回                                      |
-|  2    | IOT_HTTP_DeInit              | Https实例的摧毁函数, 销毁所有相关的数据结构                                            |
-|  3    | IOT_HTTP_DeviceNameAuth      | 基于控制台申请的`DeviceName`, `DeviceSecret`, `ProductKey`做设备认证                   |
-|  4    | IOT_HTTP_SendMessage         | Https会话阶段, 组织一个完整的HTTP报文向服务器发送,并同步获取HTTP回复报文               |
-|  5    | IOT_HTTP_Disconnect          | Https会话阶段, 关闭HTTP层面的连接, 但是仍然保持TLS层面的连接                           |
-
-### **设备影子相关(模组实现时的可选功能)**
-
-| 序号  | 函数名                          | 说明                                                                            |
-|-------|---------------------------------|---------------------------------------------------------------------------------|
-|  1    | IOT_Shadow_Construct            | 建立一个设备影子的MQTT连接, 并返回被创建的会话句柄                              |
-|  2    | IOT_Shadow_Destroy              | 摧毁一个设备影子的MQTT连接, 销毁所有相关的数据结构, 释放内存, 断开连接          |
-|  3    | IOT_Shadow_Pull                 | 把服务器端被缓存的JSON数据下拉到本地, 更新本地的数据属性                        |
-|  4    | IOT_Shadow_Push                 | 把本地的数据属性上推到服务器缓存的JSON数据, 更新服务端的数据属性                |
-|  5    | IOT_Shadow_Push_Async           | 和`IOT_Shadow_Push()`接口类似, 但是异步的, 上推后便返回, 不等待服务端回应       |
-|  6    | IOT_Shadow_PushFormat_Add       | 向已创建的数据类型格式中增添成员属性                                            |
-|  7    | IOT_Shadow_PushFormat_Finalize  | 完成一个数据类型格式的构造过程                                                  |
-|  8    | IOT_Shadow_PushFormat_Init      | 开始一个数据类型格式的构造过程                                                  |
-|  9    | IOT_Shadow_RegisterAttribute    | 创建一个数据类型注册到服务端, 注册时需要`*PushFormat*()`接口创建的数据类型格式  |
-| 10    | IOT_Shadow_DeleteAttribute      | 删除一个已被成功注册的数据属性                                                  |
-| 11    | IOT_Shadow_Yield                | MQTT的主循环函数, 调用后接受服务端的下推消息, 更新本地的数据属性                |
-
-### **主子设备相关(模组实现时的可选功能)**
-
-| 序号  | 函数名                          | 说明                                                                            |
-|-------|---------------------------------|---------------------------------------------------------------------------------|
-|  1    | IOT_Gateway_Construct           | 建立一个主设备,建立MQTT连接, 并返回被创建的会话句柄                            |
-|  2    | IOT_Gateway_Destroy             | 摧毁一个主设备的MQTT连接, 销毁所有相关的数据结构, 释放内存, 断开连接            |
-|  3    | IOT_Subdevice_Login             | 子设备上线,通知云端建立子设备session                                           |
-|  4    | IOT_Subdevice_Logout            | 子设备下线,销毁云端建立子设备session及所有相关的数据结构, 释放内存             |
-|  5    | IOT_Gateway_Yield               | MQTT的主循环函数, 调用后接受服务端的下推消息                                    |
-|  6    | IOT_Gateway_Subscribe           | 通过MQTT连接向服务端发送订阅请求                                                |
-|  7    | IOT_Gateway_Unsubscribe         | 通过MQTT连接向服务端发送取消订阅请求                                            |
-|  8    | IOT_Gateway_Publish             | 通过MQTT连接服务端发送消息发布报文                                              |
-|  9    | IOT_Gateway_RRPC_Register       | 注册设备的RRPC回调函数,接收云端发起的RRPC请求                                  |
-| 10    | IOT_Gateway_RRPC_Response       | 对云端的RRPC请求进行应答                                                        |
-| 11    | IOT_Gateway_Generate_Message_ID | 生成消息id                                                                      |
-| 12    | IOT_Gateway_Get_TOPO            | 向topo/get topic发送包并等待回复(TOPIC_GET_REPLY 回复)                        |
-| 13    | IOT_Gateway_Get_Config          | 向conifg/get topic发送包并等待回复(TOPIC_CONFIG_REPLY 回复)                   |
-| 14    | IOT_Gateway_Publish_Found_List  | 发现设备列表上报                                                                |
-
-### **linkkit()**
-
-| 序号  | 函数名                          | 说明                                                                            |
-|-------|---------------------------------|---------------------------------------------------------------------------------|
-|  1    | linkkit_start                   | 启动 linkkit 服务,与云端建立连接并安装回调函数                                 |
-|  2    | linkkit_end                     | 停止 linkkit 服务,与云端断开连接并回收资源                                     |
-|  3    | linkkit_dispatch                | 事件分发函数,触发 linkkit_start 安装的回调                                      |
-|  4    | linkkit_yield                   | linkkit 主循环函数,内含了心跳的维持, 服务器下行报文的收取等;如果允许多线程,请不要调用此函数     |
-|  5    | linkkit_set_value               | 根据identifier设置物对象的 TSL 属性,如果标识符为struct类型、event output类型或者service output类型,使用点'.'分隔字段;例如"identifier1.identifier2"指向特定的项    |
-|  6    | linkkit_get_value               | 根据identifier获取物对象的 TSL 属性                                             |
-|  7    | linkkit_set_tsl                 | 从本地读取 TSL 文件,生成物的对象并添加到 linkkit 中                             |
-|  8    | linkkit_answer_service          | 对云端服务请求进行回应                                                          |
-|  9    | linkkit_invoke_raw_service      | 向云端发送裸数据                                                                |
-| 10    | linkkit_trigger_event           | 上报设备事件到云端                                                              |
-| 11    | linkkit_fota_init               | 初始化 OTA-fota 服务,并安装回调函数(需编译设置宏 SERVICE_OTA_ENABLED )              |
-| 12    | linkkit_invoke_fota_service     | 执行fota服务                                                                    |
-| 13    | linkkit_fota_init               | 初始化 OTA-cota 服务,并安装回调函数(需编译设置宏 SERVICE_OTA_ENABLED SERVICE_COTA_ENABLED )     |
-| 14    | linkkit_invoke_cota_get_config  | 设备请求远程配置                                                                    |
-| 15    | linkkit_invoke_cota_service     | 执行cota服务                                                                    |

+ 0 - 234
iotkit-embedded/doc/website.documents/Porting_Guider.md

@@ -1,234 +0,0 @@
-**以下描述如何将华东2节点设备端V2.0+版本C-SDK移植到目标硬件平台.**
-
-## 详细技术文档请访问[官方WiKi](https://github.com/aliyun/iotkit-embedded/wiki)
-
-#### IoT套件后续会逐渐增加已适配的平台, 如果您使用的平台未被适配, 请访问[官方Github](https://github.com/aliyun/iotkit-embedded/issues), 给我们提出Issue
-
-## V2.0+设备端C-SDK概述
-
-        +---------------------------+         +---------------------------+
-        |                           |         |                           | =>  构建完成后产生:
-        |  IoT SDK Example Program  |         | sample/mqtt|coap|ota/*.c  |
-        |                           |         |                           |     output/release/bin/*-example
-        +---------------------------+         +---------------------------+
-        |                           |         |                           | =>  SDK提供功能的API, 都在这里声明
-        |  IoT SDK Interface Layer  |         | src/sdk-impl/iot_export.h | =>  构建完成后产生:
-        |                           |         |                           |
-        |     IOT_XXX_YYY() APIs    |         |  Has all APIs' prototype  |     output/release/include/
-        |                           |         |                           |         iot-sdk/iot_export.h
-        |                           |         |                           |         iot-sdk/exports/*.h
-        +---------------------------+         +---------------------------+
-        |                           |         |                           | =>  SDK提供功能的API, 都在这里实现
-        |                           |         | src/utils: utilities      | =>  构建完成后产生:
-        |                           |  +--->  | src/log: logging          |
-        |                           |         | src/tls: security         |
-        |  IoT SDK Core Implements  |         | src/guider: authenticate  |     output/release/lib/
-        |  : =>                     |  <---+  | src/system: device mgmt   |         libiot_sdk.a
-        |  : You SHOULD NOT Focus   |         | src/mqtt: MQTT client     |
-        |  : on this unless         |         | src/coap: CoAP client     |
-        |  : you're debugging bugs  |         | src/http: HTTP client     |
-        |                           |         | src/shadow: device shadow |
-        |                           |         | src/ota: OTA channel      |
-        |                           |         |                           |
-        +---------------------------+         +---------------------------+
-        |                           |         |                           | =>  SDK仅含有示例代码, 移植时需二次开发
-        |  Hardware Abstract Layer  |         | src/sdk-impl/iot_import.h | =>  构建完成后产生:
-        |                           |         | : =>                      |
-        |     HAL_XXX_YYY() APIs    |         | : HAL_*() declarations    |     output/release/lib/
-        |                           |         |                           |         libiot_platform.a
-        |  : You MUST Implement     |         | src/platform/*/*/*.c      |     output/release/include/
-        |  : this part for your     |         | : =>                      |         iot-sdk/iot_import.h
-        |  : target device first    |         | : HAL_*() example impls   |         iot-sdk/imports/*.h
-        +---------------------------+         +---------------------------+
-
-2.0版本相对1.0.1版本在结构性方面, 升级了编译系统, 支持后续功能模块的灵活迭代和裁剪, 但是在代码架构方面, 和1.0.1版本保持恒定, 也是分为三层的, 如上图
-
-* 最底层称为"硬件平台抽象层", 也简称`HAL层`, 对应上图的 `Hardware Abstract Layer`
-    - 这里是抽象不同的嵌入式目标板上操作系统对我们SDK的支撑函数
-    - 举例来说, 包括网络收发, TLS/DTLS通道建立和读写, 内存申请是否, 互斥量加锁解锁等
-    - **注意: 在任何跨平台移植时, 实现这部分是需要完成的第一步工作**
-    - **注意: 阿里的SDK里, 并不含有多平台的HAL层实现, 但我们提供了Linux桌面OS(Ubuntu16.04)上的参考实现, 移植时可以作为参考**
-
-* 中间层称为"SDK内核实现层", 对应上图的 `IoT SDK Core Implements`
-    - 这里是IoT套件C-SDK的核心实现部分, 它基于HAL层接口完成了MQTT/CoAP通道等的功能封装
-    - 举例来说, 包括MQTT的连接建立, 报文收发, CoAP的连接建立, 报文收发, OTA的固件状态查询, OTA的固件下载等
-    - **注意: 如果HAL层实现的好, 这一层在跨平台移植时, 理想情况不需要做任何修改**
-
-* 最上层称为"SDK接口声明层", 对应上图的 `IoT SDK Interface Layer`
-    - 这里没有实现, 只有一系列C函数的原型声明, 也就是SDK跨平台移植完成之后, 可以用于编写业务逻辑, 和阿里云服务器通信的API
-    - 举例来说, 怎么去使用这些API做业务逻辑, 我们在`sample`目录提供了丰富的示例程序, 并且只要填入了设备信息, 就可以在Linux主机上运行体验
-
-以下按照从下到上的顺序, 逐个对每个层次做更加详细的说明
-
-## 硬件平台抽象层(HAL层)
-
-* 所有HAL层函数的声明都在 `src/sdk-impl/iot_import.h` 这个头文件中列出
-* 各功能点引入的HAL层接口依赖在`src/sdk-impl/imports/iot_import_*.h`中列出
-* 这些`imports`目录下的子文件, 都被`src/sdk-impl/iot_import.h`包含
-* 在V2.0+版本的编译系统中, 这个部分会被编译成`output/release/lib/libiot_platform.a`
-
-以下可以列出所有跨平台移植时需要实现的HAL层接口
-
-    src/sdk-impl$ grep -ro "HAL_[_A-Za-z0-9]*" *|cut -d':' -f2|sort -u|cat -n
-
-     1  HAL_DTLSSession_create
-     2  HAL_DTLSSession_free
-     3  HAL_DTLSSession_read
-     4  HAL_DTLSSession_write
-     5  HAL_Free
-     6  HAL_GetModuleID
-     7  HAL_GetPartnerID
-     8  HAL_Malloc
-     9  HAL_MutexCreate
-    10  HAL_MutexDestroy
-    11  HAL_MutexLock
-    12  HAL_MutexUnlock
-    13  HAL_Printf
-    14  HAL_Random
-    15  HAL_SleepMs
-    16  HAL_Snprintf
-    17  HAL_Srandom
-    18  HAL_SSL_Destroy
-    19  HAL_SSL_Establish
-    20  HAL_SSL_Read
-    21  HAL_SSL_Write
-    22  HAL_TCP_Destroy
-    23  HAL_TCP_Establish
-    24  HAL_TCP_Read
-    25  HAL_TCP_Write
-    26  HAL_UDP_close
-    27  HAL_UDP_create
-    28  HAL_UDP_read
-    29  HAL_UDP_readTimeout
-    30  HAL_UDP_write
-    31  HAL_UptimeMs
-    32  HAL_Vsnprintf
-
-对这些函数做实现的时候, 可以参考`src/platform`下已经写好的示例, 这些示例在`Ubuntu16.04`主机和`Win7`主机上被完善的编写和测试过
-
-    src/platform$ tree
-    .
-    +-- iot.mk
-    +-- os
-    |   +-- linux
-    |   |   +-- HAL_OS_linux.c
-    |   |   +-- HAL_TCP_linux.c
-    |   |   +-- HAL_UDP_linux.c
-    |   +-- ubuntu -> linux
-    |   +-- win7
-    |       +-- HAL_OS_win7.c
-    |       +-- HAL_TCP_win7.c
-    +-- ssl
-        +-- mbedtls
-        |   +-- HAL_DTLS_mbedtls.c
-        |   +-- HAL_TLS_mbedtls.c
-        +-- openssl
-            +-- HAL_TLS_openssl.c
-
-以下是这些函数的一个说明表格, 更多详细信息, 请查阅代码中的注释, 或关注[官方WiKi](https://github.com/aliyun/iotkit-embedded/wiki)
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_DTLSSession_create   | 初始化DTLS资源并建立一个DTLS会话, 用于CoAP功能                          |
-| HAL_DTLSSession_free     | 销毁一个DTLS会话并释放DTLS资源, 用于CoAP功能                            |
-| HAL_DTLSSession_read     | 从DTLS会话中读数据, 用于CoAP功能                                        |
-| HAL_DTLSSession_write    | 向DTLS会话中写数据, 用于CoAP功能                                        |
-| HAL_Free                 | 释放一片堆上内存                                                        |
-| HAL_GetModuleID          | 用于紧密合作伙伴, 一般客户只需要在此可实现为空函数                      |
-| HAL_GetPartnerID         | 用于紧密合作伙伴, 一般客户只需要在此可实现为空函数                      |
-| HAL_Malloc               | 申请一片堆上内存                                                        |
-| HAL_MutexCreate          | 创建一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexDestroy         | 销毁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexLock            | 加锁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexUnlock          | 解锁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_Printf               | 打印函数, 用于向串口或其它标准输出打印日志或调试信息                    |
-| HAL_Random               | 随机数函数, 接受一个无符号数作为范围, 返回0到该数值范围内的随机无符号数 |
-| HAL_SleepMs              | 睡眠函数, 使当前执行线程睡眠指定的毫秒数                                |
-| HAL_Snprintf             | 打印函数, 向内存缓冲区格式化构建一个字符串, 参考C99标准库函数`snprintf` |
-| HAL_Srandom              | 随机数播种函数, 使`HAL_Random`的返回值每个执行序列各不相同, 类似`srand` |
-| HAL_SSL_Destroy          | 销毁一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_SSL_Establish        | 建立一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_SSL_Read             | 从一个TLS连接中读数据, 用于MQTT功能, HTTPS功能                          |
-| HAL_SSL_Write            | 向一个TLS连接中写数据, 用于MQTT功能, HTTPS功能                          |
-| HAL_TCP_Destroy          | 销毁一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_TCP_Establish        | 建立一个TCP连接, 包含了域名解析的动作和TCP连接的建立                    |
-| HAL_TCP_Read             | 在指定时间内, 从TCP连接读取流数据, 并返回读到的字节数                   |
-| HAL_TCP_Write            | 在指定时间内, 向TCP连接发送流数据, 并返回发送的字节数                   |
-| HAL_UDP_close            | 关闭一个UDP socket                                                      |
-| HAL_UDP_create           | 创建一个UDP socket                                                      |
-| HAL_UDP_read             | 阻塞的从一个UDP socket中读取数据包, 并返回读到的字节数                  |
-| HAL_UDP_readTimeout      | 在指定时间内, 从一个UDP socket中读取数据包, 返回读到的字节数            |
-| HAL_UDP_write            | 阻塞的向一个UDP socket中发送数据包, 并返回发送的字节数                  |
-| HAL_UptimeMs             | 时钟函数, 获取本设备从加电以来到目前时间点已经过去的毫秒数              |
-| HAL_Vsnprintf            | 字符串打印函数, 将`va_list`类型的变量, 打印到指定目标字符串             |
-
-在这些HAL接口中
-
-**必选实现**
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_Malloc               | 申请一片堆上内存                                                        |
-| HAL_Free                 | 释放一片堆上内存                                                        |
-| HAL_SleepMs              | 睡眠函数, 使当前执行线程睡眠指定的毫秒数                                |
-| HAL_Snprintf             | 打印函数, 向内存缓冲区格式化构建一个字符串, 参考C99标准库函数`snprintf` |
-| HAL_Printf               | 打印函数, 用于向串口或其它标准输出打印日志或调试信息                    |
-| HAL_Vsnprintf            | 字符串打印函数, 将`va_list`类型的变量, 打印到指定目标字符串             |
-| HAL_UptimeMs             | 时钟函数, 获取本设备从加电以来到目前时间点已经过去的毫秒数              |
-
-
-**可实现为空**
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_GetPartnerID         | 用于紧密合作伙伴, 一般客户只需要在此可实现为空函数                      |
-| HAL_GetModuleID          | 用于紧密合作伙伴, 一般客户只需要在此可实现为空函数                      |
-| HAL_MutexCreate          | 创建一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexDestroy         | 销毁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexLock            | 加锁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-| HAL_MutexUnlock          | 解锁一个互斥量, 用于同步控制, 目前SDK仅支持单线程应用, 可实现为空函数   |
-
-**没有MQTT时可实现为空**
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_SSL_Destroy          | 销毁一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_SSL_Establish        | 建立一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_SSL_Read             | 从一个TLS连接中读数据, 用于MQTT功能, HTTPS功能                          |
-| HAL_SSL_Write            | 向一个TLS连接中写数据, 用于MQTT功能, HTTPS功能                          |
-| HAL_TCP_Destroy          | 销毁一个TLS连接, 用于MQTT功能, HTTPS功能                                |
-| HAL_TCP_Establish        | 建立一个TCP连接, 包含了域名解析的动作和TCP连接的建立                    |
-| HAL_TCP_Read             | 在指定时间内, 从TCP连接读取流数据, 并返回读到的字节数                   |
-| HAL_TCP_Write            | 在指定时间内, 向TCP连接发送流数据, 并返回发送的字节数                   |
-| HAL_Random               | 随机数函数, 接受一个无符号数作为范围, 返回0到该数值范围内的随机无符号数 |
-| HAL_Srandom              | 随机数播种函数, 使`HAL_Random`的返回值每个执行序列各不相同, 类似`srand` |
-
-**没有CoAP时可实现为空**
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_DTLSSession_create   | 初始化DTLS资源并建立一个DTLS会话, 用于CoAP功能                          |
-| HAL_DTLSSession_free     | 销毁一个DTLS会话并释放DTLS资源, 用于CoAP功能                            |
-| HAL_DTLSSession_read     | 从DTLS连接中读数据, 用于CoAP功能                                        |
-| HAL_DTLSSession_write    | 向DTLS连接中写数据, 用于CoAP功能                                        |
-
-**没有ID2时可实现为空**
-
-| 函数名                   | 说明                                                                    |
-|--------------------------|-------------------------------------------------------------------------|
-| HAL_UDP_close            | 关闭一个UDP socket                                                      |
-| HAL_UDP_create           | 创建一个UDP socket                                                      |
-| HAL_UDP_read             | 阻塞的从一个UDP socket中读取数据包, 并返回读到的字节数                  |
-| HAL_UDP_readTimeout      | 在指定时间内, 从一个UDP socket中读取数据包, 返回读到的字节数            |
-| HAL_UDP_write            | 阻塞的向一个UDP socket中发送数据包, 并返回发送的字节数                  |
-
-## SDK内核实现层
-
-* 所有被提供的函数的声明都在 `src/sdk-impl/iot_export.h` 这个头文件中列出
-* 各功能点提供的接口在`src/sdk-impl/exports/iot_export_*.h`中列出
-* 这些`exports`目录下的子文件, 都被`src/sdk-impl/iot_export.h`包含
-* 在V2.0+版本的编译系统中, 这个部分会被编译成`output/release/lib/libiot_sdk.a`
-
-## SDK接口声明层 + 例程
-
-请参考[快速接入页面](https://help.aliyun.com/document_detail/30530.html)和[官方SDK首页](https://github.com/aliyun/iotkit-embedded)

+ 0 - 102
iotkit-embedded/doc/website.documents/Quick_Start.md

@@ -1,102 +0,0 @@
-本文以Linux下C语言版SDK为例, 演示如何快速体验让设备连接到阿里云IoT, 并通过MQTT协议的PUB/SUB实现一个简单的M2M通信过程.
-
-## 详细说明请访问[官方WiKi](https://github.com/aliyun/iotkit-embedded/wiki)和[官方SDK首页](https://github.com/aliyun/iotkit-embedded)
-
-## 第一步: 在控制台中创建设备
-
-登录[IoT控制台](http://iot.console.aliyun.com), 创建产品及在产品下创建设备和Topic类, 具体步骤如下:
-
-   + 创建产品, 可得到`ProductKey`
-   + 在产品下创建设备, 可得到`DeviceName`, `DeviceSecret`
-   + 定义Topic: `$(PRODUCT_KEY)/$(DEVICE_NAME)/data`, 并设置权限为: 设备具有发布与订阅 **(此步骤非常重要)**
-
-具体请参考[控制台使用手册](https://help.aliyun.com/document_detail/42714.html)文档中的`创建产品`, `添加设备`以及`获取设备Topic`部分.
-
-## 第二步: 填充设备参数
-
-> **备注:**
-> 如果您还没有SDK源码, 请到[SDK下载](https://help.aliyun.com/document_detail/42648.html)页面, 下载最新版本.
-
-将sample程序文件中的设备参数替换为您在控制台申请到的设备参数.
-
-将 `sample/mqtt/mqtt-example.c` 中以下星号字符串表示的设备参数替换为第一步中获得的值:
-
-    #if defined(MQTT_ID2_AUTH) && defined(TEST_ID2_DAILY)
-        #define PRODUCT_KEY             "*******************"
-        #define DEVICE_NAME             "*******************"
-        #define DEVICE_SECRET           "*******************"
-    #else
-        // TODO: 在以下段落替换下列宏定义为你在IoT控制台申请到的设备信息
-        #define PRODUCT_KEY             "*******************"
-        #define DEVICE_NAME             "*******************"
-        #define DEVICE_SECRET           "*******************"
-    #endif
-
-完成编辑并保存后, 进行下一步
-
-## 第三步: 编译SDK
-
-* 返回顶层目录
-* 执行make指令, 编译SDK, 命令如下
-
-        make distclean
-        make
-
-编译成功后, 在相应目录生成样例可执行程序.
-
-## 第四步: 执行样例程序
-
-执行目录 `output/release/bin/` 下的可执行程序:
-
-    cd output/release/bin
-    ./mqtt-example
-
-样例程序的基本逻辑流程为:
-
-1. 创建一个MQTT客户端
-2. 订阅主题 `$(PRODUCT_KEY)/$(DEVICE_NAME)/data`
-3. 向该主题发布消息
-
-## 其它
-### 编译输出的说明
-
-编译顺利完成后, 输出在 `output/release/` 目录:
-
-    +-- bin
-    |   +-- coap-example
-    |   +-- ...
-    |   +-- mqtt-example
-    +-- include
-    |   +-- exports
-    |   |   +-- iot_export_coap.h
-    |   |   +-- ...
-    |   |   +-- iot_export_shadow.h
-    |   +-- imports
-    |   |   +-- iot_import_coap.h
-    |   |   +-- ...
-    |   |   +-- iot_import_ota.h
-    |   +-- iot_export.h
-    |   +-- iot_import.h
-    +-- lib
-    |   +-- libiot_platform.a
-    |   +-- libiot_sdk.a
-    |   +-- libiot_tls.a
-    +-- src
-        +-- coap-example.c
-        +-- http-example.c
-        +-- Makefile
-        +-- mqtt-example.c
-
-说明如下:
-
-| 文件/目录               | 说明                                                     |
-|-------------------------|----------------------------------------------------------|
-| bin/mqtt-example        | 用MQTT协议连接阿里云IoT的样例程序                        |
-| include/                | 使用`libiot_sdk.a`时需要的头文件, 存放在这个目录         |
-| lib/libiot_platform.a   | 硬件平台抽象层, `libiot_sdk.a`的工作是建立在它的基础上的 |
-| lib/libiot_sdk.a        | SDK的核心层, 基于`libiot_platform.a`提供连接云端的能力   |
-| src/Makefile            | 示例用Makefile, 演示如何在SDK之外链接本SDK提供的库文件   |
-| src/mqtt-example.c      | 样例对应C代码, 可在此目录下输入make, 编译生成可执行程序  |
-
-### Java版本
-Java版请参考 [JAVA-SDK使用(MQTT)](https://help.aliyun.com/document_detail/42693.html)

+ 0 - 106
iotkit-embedded/doc/website.documents/SDK_Download.md

@@ -1,106 +0,0 @@
-> 杭州节点的设备端SDK请见[历史文档](~~58809~~)
-
-# 设备端SDK代码托管
-- 设备端SDK代码托管迁移到Github, 主页为
-
-    **[https://github.com/aliyun/iotkit-embedded](https://github.com/aliyun/iotkit-embedded)**
-
-    **[https://github.com/aliyun/iotkit-embedded/wiki](https://github.com/aliyun/iotkit-embedded/wiki)**
-
-- 我们尝试用更开放的方式建设这份参考实现代码, 欢迎广大开发者在Github上:
-
-    - 提交改进的Patch/Pull Request
-    - 汇报缺陷的Issue/Bug Ticket
-    - 或者Fork我们的项目
-
-- IoT套件后续会逐渐增加已适配的平台, 如果您使用的平台未被适配, 请访问[官方Github主页](https://github.com/aliyun/iotkit-embedded/issues), 给我们提出Issue
-
-**已适配平台**
-
-| 开发板            | 网络支持          | 厂商SDK链接       | 开发板购买链接    | 阿里云SDK版本     |
-|-------------------|-------------------|-------------------|-------------------|-------------------|
-| ESP32 | Wi-Fi | [esp32-aliyun](https://github.com/espressif/esp32-aliyun) | [乐鑫信息科技](https://espressif.taobao.com/) | V2.01 |
-| ESP8266 | Wi-Fi | [esp8266-aliyun](https://github.com/espressif/esp8266-aliyun) | [乐鑫信息科技](https://espressif.taobao.com/) | V2.01 |
-
-**希望能够看到更多的Contributor, 共同开发设备端SDK的后续版本!**
-
-# 版本V2.10
-- 发布日期: 2018/03/31
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: RELEASED_V2_10_20180331.zip
-- 更新内容:
-  - **支持cmake:** 支持cmake编译方式,可以直接在linux和windows下使用QT或者VS2017打开工程进行编译运行
-  - **支持云端对物模型的抽象**: 设置`FEATURE_CMP_ENABLED = y`和`FEATURE_DM_ENABLED`, 可以支持物模型抽象,提供属性,服务和事件的接口
-  - **支持一型一密**: 设置`FEATURE_SUPPORT_PRODUCT_SECRET = y`可以支持一型一密功能,优化产线流程
-  - **支持iTLS功能**: 设置`FEATURE_MQTT_ID2_AUTH = y`可以支持ID2加密方式,使用iTLS进行数据建连,增加安全性,降低内存消耗
-  - **支持远程配置**: 设置`FEATURE_SERVICE_OTA_ENABLED = y`,可以支持云端推送配置信息到设备
-  - **优化主子设备功能**:主子设备添加部分功能
-
-# 版本V2.03
-
-- 发布日期: 2018/01/31
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: [RELEASED_V2_03_20180131.zip](http://aliyun-iot.oss-cn-hangzhou.aliyuncs.com/iot-sdk-c/RELEASED_V2_03_20180130.7z)
-- 更新内容:
-    - **支持主子设备功能:** 设置`FEATURE_SUBDEVICE_ENABLED = y`,可以支持子设备通过主设备(网关设备)进行数据交互
-    - **升级HTTP通道:** 优化HTTP流程
-    - **优化TLS:** 修复内存泄漏问题
-    - **优化OTA的配置:** 可以更合理的开关OTA功能
-    - **升级MQTT通道:** 支持topic更长,更多的订阅请求;MQTT支持多线程
-
-# 版本V2.02
-
-- 发布日期: 2017/11/30
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: [RELEASED_V2_02_20171130.zip](https://github.com/aliyun/iotkit-embedded/archive/RELEASED_V2_02_20171130.zip)
-- 更新内容:
-    - **正式的多平台支持:** 使用`make reconfig`可弹出和选择`Ubuntu16.04`以外的已适配平台
-    - **新增Windows版本:** 支持用mingw32工具链编译`Win7`版本的库和例程
-    - **新增OpenSSL适配:** 新增了配合`openssl-0.9.x`+`Windows`版本的HAL参考实现
-    - **优化HTTP接口:** HTTP通道方面接口优化, 支持发送报文而不断开TLS连接
-    - **自包含的安全库:** 新增裁剪版本的安全库`mbedtls`, 目前可适配Linux/Windows平台
-
-# 版本V2.01
-
-- 发布日期: 2017/10/10
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: [RELEASED_V2_01_20171010.zip](https://github.com/aliyun/iotkit-embedded/archive/RELEASED_V2_01_20171010.zip)
-- 更新内容:
-    - **新增CoAP+OTA:** 允许配置成基于CoAP通知方式的OTA
-    - **新增HTTP+TLS:** 在MQTT/CoAP之外, 新增HTTP的通道
-    - **细化OTA状态:** 优化OTA部分代码, 使云端可以更细化的区分设备的OTA固件下载状态
-    - **ArmCC支持:** 修正了SDK在ArmCC编译器编译时会出现的报错
-
-# 版本V2.00
-
-- 发布日期: 2017/08/21
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: [RELEASED_V2_00_20170818.zip](https://github.com/aliyun/iotkit-embedded/archive/RELEASED_V2_00_20170818.zip)
-- 更新内容:
-    - **新增MQTT直连:** 支持更快更轻的连接IoT套件, 去掉对HTTPS/HTTP的依赖, 可看[公告](https://help.aliyun.com/document_detail/57164.html)
-    - **新增CoAP通道:** 基于UDP, 在纯上报数据场景更节省资源, 可看[公告](https://help.aliyun.com/document_detail/57566.html)
-    - **新增OTA通道:** 提供一系列OTA相关的API, 可查询/触发/下载用户自主上传的固件
-    - **升级构建系统:** 支持更灵活的组织和配置SDK
-
-
-# 版本V1.0.1
-
-- 发布日期: 2017/06/29
-- 开发语言: C语言
-- 开发环境: 64位Linux, GNU Make
-- 下载链接: [RELEASED_V1_0_1_20170629.zip](https://github.com/aliyun/iotkit-embedded/archive/RELEASED_V1_0_1_20170629.zip)
-- 更新内容:
-    - **华东2站点:** 第一个正式配合华东2站点的设备端SDK, 全源码发布
-    - **新增设备影子功能:** 具体可参看[设备影子介绍页面](https://help.aliyun.com/document_detail/53930.html)
-
-# JAVA版本
-
-| 支持协议 | 更新历史 | 下载链接 |
-|:-------|:-------|:-------|
-| MQTT | **2017-05-27:**<br/>支持华东2节点的设备认证流程,同时添加java端设备影子demo|[iotx-sdk-mqtt-java](http://aliyun-iot.oss-cn-hangzhou.aliyuncs.com/iotx-sdk-java/iotx-sdk-mqtt-java-20170526.zip "iotx-sdk-mqtt-java") MQTT的JAVA版只是使用开源库实现的一个demo,仅用于参考|
-

+ 0 - 498
iotkit-embedded/src/import/mdm9206/example/iotkit_demo.c

@@ -1,498 +0,0 @@
-#include <string.h>
-
-#include "qcli_api.h"
-#include "iot_import.h"
-#include "iot_export.h"
-
-QCLI_Group_Handle_t qcli_iotkit_handle;     /* Handle for IOT Command Group. */
-
-/******************************************************/
-/**********************HTTP****************************/
-#define HTTP_PRODUCT_KEY            "******************"
-#define HTTP_DEVICE_NAME            "******************"
-#define HTTP_DEVICE_SECRET          "******************"
-#define HTTP_DEVICE_ID              "******************"
-/**********************END HTTP************************/
-
-/******************************************************/
-/**********************MQTT****************************/
-
-#define MQTT_PRODUCT_KEY            "******************"
-#define MQTT_DEVICE_NAME            "******************"
-#define MQTT_DEVICE_SECRET          "******************"
-
-static void _demo_message_arrive(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
-{
-    iotx_mqtt_topic_info_pt ptopic_info = (iotx_mqtt_topic_info_pt) msg->msg;
-    QCLI_Printf(qcli_iotkit_handle, "Topic:%s,Payload:%s\n", ptopic_info->ptopic, ptopic_info->payload);
-}
-
-static void event_handle(void *pcontext, void *pclient, iotx_mqtt_event_msg_pt msg)
-{
-    uintptr_t packet_id = (uintptr_t)msg->msg;
-    iotx_mqtt_topic_info_pt topic_info = (iotx_mqtt_topic_info_pt)msg->msg;
-
-    switch (msg->event_type) {
-        case IOTX_MQTT_EVENT_UNDEF:
-            QCLI_Printf(qcli_iotkit_handle, "undefined event occur.\n");
-            break;
-
-        case IOTX_MQTT_EVENT_DISCONNECT:
-            QCLI_Printf(qcli_iotkit_handle, "MQTT disconnect.\n");
-            break;
-
-        case IOTX_MQTT_EVENT_RECONNECT:
-            QCLI_Printf(qcli_iotkit_handle, "MQTT reconnect.\n");
-            break;
-
-        case IOTX_MQTT_EVENT_SUBCRIBE_SUCCESS:
-            QCLI_Printf(qcli_iotkit_handle, "subscribe success, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_SUBCRIBE_TIMEOUT:
-            QCLI_Printf(qcli_iotkit_handle, "subscribe wait ack timeout, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_SUBCRIBE_NACK:
-            QCLI_Printf(qcli_iotkit_handle, "subscribe nack, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_UNSUBCRIBE_SUCCESS:
-            QCLI_Printf(qcli_iotkit_handle, "unsubscribe success, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_UNSUBCRIBE_TIMEOUT:
-            QCLI_Printf(qcli_iotkit_handle, "unsubscribe timeout, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_UNSUBCRIBE_NACK:
-            QCLI_Printf(qcli_iotkit_handle, "unsubscribe nack, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_PUBLISH_SUCCESS:
-            QCLI_Printf(qcli_iotkit_handle, "publish success, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_PUBLISH_TIMEOUT:
-            QCLI_Printf(qcli_iotkit_handle, "publish timeout, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_PUBLISH_NACK:
-            QCLI_Printf(qcli_iotkit_handle, "publish nack, packet-id=%u\n", (unsigned int)packet_id);
-            break;
-
-        case IOTX_MQTT_EVENT_PUBLISH_RECVEIVED:
-            QCLI_Printf(qcli_iotkit_handle, "topic message arrived but without any related handle: topic=%.*s, topic_msg=%.*s\n",
-                          topic_info->topic_len,
-                          topic_info->ptopic,
-                          topic_info->payload_len,
-                          topic_info->payload);
-            break;
-
-        default:
-            QCLI_Printf(qcli_iotkit_handle, "Should NOT arrive here.\n");
-            break;
-    }
-}
-
-
-/*****************END MQTT**********************************/
-
-static QCLI_Command_Status_t mqtt(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List);
-static QCLI_Command_Status_t http(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List);
-
-static const QCLI_Command_t iot_cmd_list[] =
-{
-    /* Command_Function, Start_Thread, Command_String, Usage_String, Description */
-    {mqtt, false, "mqtt", "a <key> <name> <secret> or a #auth\n"
-        "       c <keepalive> <clean> <timeout> or c #config\n"
-            "       p <topic> <message>  #publish\n"
-            "       s <topic> #subscribe\n"
-            "       u <topic> #unsubscribe\n"
-            "       y <timeout> or y#yield\n"
-            "       d #destroy", "test mqtt function",NULL},
-
-    {http, false, "http", "#i <key><secret><name><id> or i#init\n"
-        "       a #auth\n"
-            "       p <message> #post\n"
-            "       d #deinit","test http function",NULL},
-};
-
-static const QCLI_Command_Group_t iot_cmd_group =
-{
-    "IoTKit",              /* Group_String: will display cmd prompt as "IOT> " */
-    sizeof(iot_cmd_list)/sizeof(iot_cmd_list[0]),   /* Command_Count */
-    iot_cmd_list        /* Command_List */
-};
-
-/*****************************************************************************
- * This function is used to register the IOT Command Group with QCLI.
- *****************************************************************************/
-void Initialize_IoTKit_Demo(void)
-{
-    /* Attempt to reqister the Command Groups with the qcli framework.*/
-    qcli_iotkit_handle = QCLI_Register_Command_Group(NULL, &iot_cmd_group);
-    if (qcli_iotkit_handle)
-    {
-      QCLI_Printf(qcli_iotkit_handle, "IOT Registered\n");
-    }
-    return;
-}
-
-static QCLI_Command_Status_t mqtt(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List)
-{
-
-#define MSG_LEN_MAX                 (1024)
-#define MQTT_PRODUCT_KEY_LEN        (32)
-#define MQTT_DEVICE_NAME_LEN        (32)
-#define MQTT_DEVICE_SECRET_LEN      (64)
-
-    static char isInit = 0;
-    static char msg_buf[MSG_LEN_MAX];
-    static char msg_readbuf[MSG_LEN_MAX] ;
-
-    static iotx_conn_info_pt pconn_info = NULL;
-    static iotx_mqtt_param_t mqtt_params;
-    static void *pclient=NULL;
-    char command = '0';
-
-    static char product_key[MQTT_PRODUCT_KEY_LEN];
-    static char device_name[MQTT_DEVICE_NAME_LEN];
-    static char device_secret[MQTT_DEVICE_SECRET_LEN];
-
-    if(Parameter_Count < 1){
-        return QCLI_STATUS_USAGE_E;
-    }
-
-    if(isInit == 0){
-        memset(msg_buf, 0, sizeof(msg_buf));
-        memset(msg_readbuf, 0, sizeof(msg_readbuf));
-        memset(&mqtt_params, 0, sizeof(mqtt_params));
-        memset(product_key, 0, sizeof(product_key));
-        memset(device_name, 0, sizeof(device_name));
-        memset(device_secret, 0, sizeof(device_secret));
-        isInit = 1;
-    }
-
-    command = (char)Parameter_List[0].String_Value[0];
-
-    switch ( command ) {
-        case 's':
-        case 'S':
-            {
-                int rc = 0;
-                char topic_data[100]={0};
-                if ( NULL == pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "need constructed first\n");
-                    break;
-                }
-                if(Parameter_Count != 2){
-                    return QCLI_STATUS_USAGE_E;
-                }
-                sprintf(topic_data, "/%s/%s/%s", product_key, device_name, Parameter_List[1].String_Value);
-                rc = IOT_MQTT_Subscribe(pclient, topic_data, IOTX_MQTT_QOS1, _demo_message_arrive, NULL);
-                if (rc < 0) {
-                    IOT_MQTT_Destroy(&pclient);
-                    pclient = NULL;
-                    QCLI_Printf(qcli_iotkit_handle, "subscribe command error\n");
-                }
-                else{
-                    QCLI_Printf(qcli_iotkit_handle, "subscribe %s \n", topic_data);
-                }
-            }
-            break;
-
-        case 'a':
-        case 'A':
-            {
-                if (pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "mqtt initialized\n");
-                    break;
-                }
-
-                IOT_OpenLog("mqtt");
-                IOT_SetLogLevel(IOT_LOG_DEBUG);
-
-                if(Parameter_Count == 1){
-                    strncpy(product_key, MQTT_PRODUCT_KEY, sizeof(product_key) - 1);
-                    strncpy(device_name, MQTT_DEVICE_NAME, sizeof(device_name) - 1);
-                    strncpy(device_secret, MQTT_DEVICE_SECRET, sizeof(device_secret) - 1);
-                }
-                else if(Parameter_Count == 4){
-                    strncpy(product_key, (char *)Parameter_List[1].String_Value, sizeof(product_key) - 1);
-                    strncpy(device_name, (char *)Parameter_List[2].String_Value, sizeof(device_name) - 1);
-                    strncpy(device_secret, (char *)Parameter_List[3].String_Value, sizeof(device_secret) - 1);
-                }
-                else{
-                    return QCLI_STATUS_USAGE_E;
-                }
-
-                if (0 != IOT_SetupConnInfo(product_key, device_name, device_secret, (void **)&pconn_info)) {
-                    QCLI_Printf(qcli_iotkit_handle, "auth request failed\n");
-                }
-
-                QCLI_Printf(qcli_iotkit_handle, "auth command ok\n");
-            }
-            break;
-
-        case 'c':
-        case 'C':
-            {
-                int  keepalive,clean,timeout;
-                if ( pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "had constructed\n");
-                    break;
-                }
-                if ((NULL == pconn_info) || (0 == pconn_info->client_id)){
-                    QCLI_Printf(qcli_iotkit_handle, "please auth first\n");
-                    break;
-                }
-                if(Parameter_Count == 1){
-                    keepalive=60000;
-                    clean=0;
-                    timeout=2000;
-                }
-                else if(Parameter_Count == 4){
-                    keepalive=Parameter_List[1].Integer_Value;;
-                    clean=Parameter_List[2].Integer_Value;
-                    timeout=Parameter_List[3].Integer_Value;
-                }
-                else{
-                    return QCLI_STATUS_USAGE_E;
-                }
-                memset(&mqtt_params, 0x0, sizeof(mqtt_params));
-                mqtt_params.port = pconn_info->port;
-                mqtt_params.host = pconn_info->host_name;
-                mqtt_params.client_id = pconn_info->client_id;
-                mqtt_params.username = pconn_info->username;
-                mqtt_params.password = pconn_info->password;
-                mqtt_params.pub_key = pconn_info->pub_key;
-
-                mqtt_params.request_timeout_ms = timeout;
-                mqtt_params.clean_session = clean;
-                mqtt_params.keepalive_interval_ms = keepalive;
-                mqtt_params.pread_buf = msg_readbuf;
-                mqtt_params.read_buf_size = MSG_LEN_MAX;
-                mqtt_params.pwrite_buf = msg_buf;
-                mqtt_params.write_buf_size = MSG_LEN_MAX;
-
-                mqtt_params.handle_event.h_fp = event_handle;
-                mqtt_params.handle_event.pcontext = NULL;
-
-                pclient = IOT_MQTT_Construct(&mqtt_params);
-                if (NULL == pclient)
-                    QCLI_Printf(qcli_iotkit_handle, "MQTT construct failed\n");
-                else
-                    QCLI_Printf(qcli_iotkit_handle, "MQTT construct success\n");
-            }
-            break;
-
-        case 'p':
-        case 'P':
-            {
-                int rc=0;
-                iotx_mqtt_topic_info_t topic_msg;
-                char topic_data[100]={0};
-                if ( NULL == pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "need constructed first\n");
-                    break;
-                }
-                if(Parameter_Count != 3 ){
-                    return QCLI_STATUS_USAGE_E;
-                }
-                memset(&topic_msg, 0x0, sizeof(iotx_mqtt_topic_info_t));
-                topic_msg.qos = IOTX_MQTT_QOS1;
-                topic_msg.retain = 0;
-                topic_msg.dup = 0;
-                topic_msg.payload = (void *)Parameter_List[2].String_Value;
-                topic_msg.payload_len = strlen(topic_msg.payload);
-                sprintf(topic_data, "/%s/%s/%s", product_key, device_name, Parameter_List[1].String_Value);
-
-                rc = IOT_MQTT_Publish(pclient, topic_data, &topic_msg);
-                QCLI_Printf(qcli_iotkit_handle, "topic_data:%s rc = IOT_MQTT_Publish() = %d", topic_data, rc);
-            }
-            break;
-
-        case 'u':
-        case 'U':
-            {
-                char topic_data[100]={0};
-                if ( NULL == pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "need constructed first\n");
-                    break;
-                }
-                if(Parameter_Count != 2){
-                    return QCLI_STATUS_USAGE_E;
-                }
-                sprintf(topic_data, "/%s/%s/%s", product_key, device_name, Parameter_List[1].String_Value);
-                IOT_MQTT_Unsubscribe(pclient, topic_data);
-                QCLI_Printf(qcli_iotkit_handle, "unsubscribe command\n");
-            }
-            break;
-
-        case 'y':
-        case 'Y':
-            {
-                int yield = 0;
-                if ( NULL == pclient) {
-                    QCLI_Printf(qcli_iotkit_handle, "need constructed first\n");
-                    break;
-                }
-                if(Parameter_Count == 1){
-                    yield = 2000;
-                }
-                else if(Parameter_Count == 2){
-                    yield = Parameter_List[1].Integer_Value;
-                }
-                else {
-                    return QCLI_STATUS_USAGE_E;
-                }
-                IOT_MQTT_Yield(pclient,yield);
-                QCLI_Printf(qcli_iotkit_handle, "yield command\n");
-            }
-            break;
-
-        case 'd':
-        case 'D':
-            if ( NULL == pclient) {
-                QCLI_Printf(qcli_iotkit_handle, "need constructed first\n");
-                break;
-            }
-            IOT_MQTT_Destroy(&pclient);
-            IOT_CloseLog();
-            pclient = NULL;
-            QCLI_Printf(qcli_iotkit_handle, "destroy command\n");
-            break;
-
-        default:
-            break;
-    }				/* -----  end switch  ----- */
-
-    return QCLI_STATUS_SUCCESS_E;
-}
-
-static QCLI_Command_Status_t http(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List)
-{
-    static void *http_handle = NULL;
-
-    static char isInit = 0;
-    static iotx_device_info_t device_info;
-    static iotx_http_param_t http_param;
-
-    char command = '0';
-
-    if(Parameter_Count < 1){
-        return QCLI_STATUS_USAGE_E;
-    }
-
-    if(0 == isInit){
-        memset(&device_info, 0, sizeof(device_info));
-        memset(&http_param, 0 ,sizeof(http_param));
-        isInit = 1;
-    }
-
-    command = (char)Parameter_List[0].String_Value[0];
-
-    switch ( command ) {
-       case 'i':
-       case 'I':
-           {
-                if(http_handle){
-                    QCLI_Printf(qcli_iotkit_handle, "HTTP had initiled\n");
-                    break;
-                }
-                memset(&device_info , 0x00, sizeof(iotx_device_info_t));
-                memset(&http_param , 0x00, sizeof(iotx_http_param_t));
-                if(Parameter_Count == 1){
-                    strncpy(device_info.product_key, HTTP_PRODUCT_KEY, sizeof(device_info.product_key) - 1);
-                    strncpy(device_info.device_secret, HTTP_DEVICE_SECRET, sizeof(device_info.device_secret) - 1);
-                    strncpy(device_info.device_name, HTTP_DEVICE_NAME, sizeof(device_info.device_name) - 1);
-                    strncpy(device_info.device_id, HTTP_DEVICE_ID, sizeof(device_info.device_id) - 1);
-                }
-                else if(Parameter_Count == 5){
-                    strncpy(device_info.product_key, (char*)Parameter_List[1].String_Value, sizeof(device_info.product_key) - 1);
-                    strncpy(device_info.device_secret, (char*)Parameter_List[2].String_Value, sizeof(device_info.device_secret) - 1);
-                    strncpy(device_info.device_name, (char*)Parameter_List[3].String_Value, sizeof(device_info.device_name) - 1);
-                    strncpy(device_info.device_id, (char*)Parameter_List[4].String_Value, sizeof(device_info.device_id) - 1);
-                }
-                else{
-                    return QCLI_STATUS_USAGE_E;
-                }
-
-                IOT_OpenLog("http");
-                IOT_SetLogLevel(IOT_LOG_DEBUG);
-
-                http_param.device_info = &device_info;
-
-                http_handle = IOT_HTTP_Init(&http_param);
-                if(NULL == http_handle)
-                     QCLI_Printf(qcli_iotkit_handle,"http construct failed\n");
-                else
-                    QCLI_Printf(qcli_iotkit_handle, "construct command ok\n");
-
-            }
-           break;
-        case 'a':
-        case 'A':
-            {
-                if(NULL == http_handle){
-                    QCLI_Printf(qcli_iotkit_handle, "http uninitialized\n");
-                    break;
-                }
-                if(0 != IOT_HTTP_DeviceNameAuth(http_handle)){
-                    QCLI_Printf(qcli_iotkit_handle, "http auth failed\n");
-                }
-                else{
-                    QCLI_Printf(qcli_iotkit_handle, "http auth success\n");
-                }
-            }
-            break;
-        case 'p':
-        case 'P':
-            {
-                char path[IOTX_URI_MAX_LEN + 1] = {0};
-                char request_buf[1024];
-                iotx_http_message_param_t msg_param;
-
-                if(NULL == http_handle){
-                    QCLI_Printf(qcli_iotkit_handle, "http uninitialized\n");
-                    break;
-                }
-
-                if(Parameter_Count !=2 ){
-                    return QCLI_STATUS_USAGE_E;
-                }
-
-                msg_param.request_payload = (char*)Parameter_List[1].String_Value;
-                msg_param.response_payload = request_buf;
-                msg_param.timeout_ms = 5000;
-                msg_param.request_payload_len = strlen(msg_param.request_payload) + 1;
-                msg_param.response_payload_len = 1024;
-                msg_param.topic_path = path;
-
-                snprintf(msg_param.topic_path, IOTX_URI_MAX_LEN, "/topic/%s/%s/update", (char *)device_info.product_key,
-                 (char *)device_info.device_name);
-                if (0 == IOT_HTTP_SendMessage(http_handle, &msg_param))
-                    QCLI_Printf(qcli_iotkit_handle, "message response is %s\r\n", msg_param.response_payload);
-                else
-                    QCLI_Printf(qcli_iotkit_handle, "IOT_HTTP_SendMessage error\r\n");
-
-            }
-            break;
-        case 'd':
-        case 'D':
-            {
-                IOT_HTTP_Disconnect(http_handle);
-                IOT_HTTP_DeInit(&http_handle);
-                http_handle = NULL;
-                IOT_DumpMemoryStats(IOT_LOG_DEBUG);
-                IOT_CloseLog();
-                QCLI_Printf(qcli_iotkit_handle, "destroy command\n");
-            }
-            break;
-        default:
-            break;
-    }
-    return QCLI_STATUS_SUCCESS_E;
-}
-

+ 0 - 70
iotkit-embedded/src/import/mdm9206/example/iotkit_hal.c

@@ -1,70 +0,0 @@
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include "qcli_api.h"
-
-#define _IN_
-#define _OU_
-
-#define LOG_BUFFER_SIZE 256
-
-extern QCLI_Group_Handle_t qcli_iotkit_handle;     /* Handle for IOT Command Group. */
-
-int HAL_Vsnprintf(_IN_ char *str, _IN_ const int len, _IN_ const char *format, va_list ap)
-{
-    return vsnprintf(str, len, format, ap);
-}
-
-void HAL_Printf(_IN_ const char *fmt, ...)
-{
-    static char str_tmp[LOG_BUFFER_SIZE];
-    va_list list;
-
-    memset(str_tmp, 0, LOG_BUFFER_SIZE);
-
-    va_start(list, fmt);
-    HAL_Vsnprintf(str_tmp, LOG_BUFFER_SIZE - 1, fmt, list);
-    va_end(list);
-    QCLI_Printf(qcli_iotkit_handle, "%s", str_tmp);
-}
-
-int HAL_Snprintf(_IN_ char *str, const int len, const char *fmt, ...)
-{
-    va_list args;
-    int     rc;
-
-    va_start(args, fmt);
-    rc = vsnprintf(str, len, fmt, args);
-    va_end(args);
-
-    return rc;
-}
-
-char *HAL_GetModuleID(char mid_str[])
-{
-    strcpy(mid_str, "xyz");
-    return "xyz";
-}
-
-
-void HAL_Srandom(uint32_t seed)
-{
-    srand(seed);
-}
-
-uint32_t HAL_Random(uint32_t region)
-{
-    return (region > 0) ? (rand() % region) : 0;
-}
-
-int HAL_Atoi(const char *str)
-{
-    int res = 0, i;
-    for (i = 0 ; str[i] <= '9' && str[i] >= '0'; ++i) {
-        res = res * 10 + str[i] - '0';
-    }
-    return res;
-}
-

+ 0 - 334
iotkit-embedded/src/import/mdm9206/include/qapi_ali_iot.h

@@ -1,334 +0,0 @@
-#ifndef QAPI_ALI_IOT_H
-#define QAPI_ALI_IOT_H
-
-#include "qapi_ali_iot_txm_base.h"
-/*============================================================================
-                USER_Mode_DEFS
-============================================================================*/
-
-/* Driver ID defines */
-
-#define  TXM_QAPI_IOT_COAP_INIT                              TXM_QAPI_IOT_BASE
-#define  TXM_QAPI_IOT_COAP_DEINIT                            TXM_QAPI_IOT_BASE + 1
-#define  TXM_QAPI_IOT_COAP_DEVICE_NAME_AUTH                  TXM_QAPI_IOT_BASE + 2
-#define  TXM_QAPI_IOT_COAP_YIELD                             TXM_QAPI_IOT_BASE + 3
-#define  TXM_QAPI_IOT_COAP_SEND_MESSAGE                      TXM_QAPI_IOT_BASE + 4
-#define  TXM_QAPI_IOT_COAP_GET_MESSAGE_PAYLOAD               TXM_QAPI_IOT_BASE + 5
-#define  TXM_QAPI_IOT_COAP_GET_MESSAGE_CODE                  TXM_QAPI_IOT_BASE + 6
-
-#define  TXM_QAPI_IOT_MQTT_CONSTRUCT                         TXM_QAPI_IOT_BASE + 7
-#define  TXM_QAPI_IOT_MQTT_DESTROY                           TXM_QAPI_IOT_BASE + 8
-#define  TXM_QAPI_IOT_MQTT_YIELD                             TXM_QAPI_IOT_BASE + 9
-#define  TXM_QAPI_IOT_MQTT_CHECK_STATE_NORMAL                TXM_QAPI_IOT_BASE + 10
-#define  TXM_QAPI_IOT_MQTT_SUBSCRIBE                         TXM_QAPI_IOT_BASE + 11
-#define  TXM_QAPI_IOT_MQTT_UNSUBSCRIBE                       TXM_QAPI_IOT_BASE + 12
-#define  TXM_QAPI_IOT_MQTT_PUBLISH                           TXM_QAPI_IOT_BASE + 13
-#define  TXM_QAPI_IOT_SETUP_CONNINFO                         TXM_QAPI_IOT_BASE + 14
-#define  TXM_QAPI_IOT_OPEN_LOG                               TXM_QAPI_IOT_BASE + 15
-#define  TXM_QAPI_IOT_CLOSE_LOG                              TXM_QAPI_IOT_BASE + 16
-#define  TXM_QAPI_IOT_SET_LOG_LEVEL                          TXM_QAPI_IOT_BASE + 17
-#define  TXM_QAPI_IOT_DUMP_MEMORY_STATS                      TXM_QAPI_IOT_BASE + 18
-#define  TXM_QAPI_IOT_VISUAL_AT_OUTPUT                       TXM_QAPI_IOT_BASE + 19
-#define  TXM_QAPI_IOT_VISUAL_AT_INPUT                        TXM_QAPI_IOT_BASE + 20
-
-/*SIMCOM zhangwei 2017-10-26 add ota qapi and HAL base index  begin*/
-#define   TXM_QAPI_IOT_OTA_INIT                             TXM_QAPI_IOT_BASE + 21
-#define   TXM_QAPI_IOT_OTA_DEINIT                           TXM_QAPI_IOT_BASE + 22
-#define   TXM_QAPI_IOT_OTA_REPORTVERSION                    TXM_QAPI_IOT_BASE + 23
-#define   TXM_QAPI_IOT_OTA_REPORTPROGRESS                   TXM_QAPI_IOT_BASE + 24
-#define   TXM_QAPI_IOT_OTA_ISFETCHING                       TXM_QAPI_IOT_BASE + 25
-#define   TXM_QAPI_IOT_OTA_ISFETCHFINISH                    TXM_QAPI_IOT_BASE + 26
-#define   TXM_QAPI_IOT_OTA_FETCHYIELD                       TXM_QAPI_IOT_BASE + 27
-#define   TXM_QAPI_IOT_OTA_IOCTL                            TXM_QAPI_IOT_BASE + 28
-#define   TXM_QAPI_IOT_OTA_GETLASTERROR                     TXM_QAPI_IOT_BASE + 29
-
-#define  TXM_QAPI_IOT_HAL_BASE                               TXM_QAPI_IOT_BASE+ 30
-/*SIMCOM zhangwei 2017-10-19 fixed bug begin*/
-#define TXM_QAPI_IOT_HAL_MUTEXCREATEP                        TXM_QAPI_IOT_HAL_BASE+ 0
-#define TXM_QAPI_IOT_HAL_MUTEXDESTROY                        TXM_QAPI_IOT_HAL_BASE+ 1
-#define TXM_QAPI_IOT_HAL_MUTEXLOCK                           TXM_QAPI_IOT_HAL_BASE+ 2
-#define TXM_QAPI_IOT_HAL_MUTEXUNLOCK                         TXM_QAPI_IOT_HAL_BASE+ 3
-#define TXM_QAPI_IOT_HAL_MALLOC                              TXM_QAPI_IOT_HAL_BASE+ 4
-#define TXM_QAPI_IOT_HAL_FREE                                TXM_QAPI_IOT_HAL_BASE+ 5
-#define TXM_QAPI_IOT_HAL_UPTIMEMS                            TXM_QAPI_IOT_HAL_BASE+ 6
-#define TXM_QAPI_IOT_HAL_SLEEPMS                             TXM_QAPI_IOT_HAL_BASE+ 7
-#define TXM_QAPI_IOT_HAL_GETPARTNERID                        TXM_QAPI_IOT_HAL_BASE+ 8
-#define TXM_QAPI_IOT_HAL_TCP_ESTABLISH                       TXM_QAPI_IOT_HAL_BASE+ 9
-#define TXM_QAPI_IOT_HAL_TCP_DESTROY                         TXM_QAPI_IOT_HAL_BASE+ 10
-#define TXM_QAPI_IOT_HAL_TCP_WRITE                           TXM_QAPI_IOT_HAL_BASE+ 11
-#define TXM_QAPI_IOT_HAL_TCP_READ                            TXM_QAPI_IOT_HAL_BASE+ 12
-#define TXM_QAPI_IOT_HAL_SSL_ESTABLISH                       TXM_QAPI_IOT_HAL_BASE+ 13
-#define TXM_QAPI_IOT_HAL_SSL_DESTROY                         TXM_QAPI_IOT_HAL_BASE+ 14
-#define TXM_QAPI_IOT_HAL_SSL_WRITE                           TXM_QAPI_IOT_HAL_BASE+ 15
-#define TXM_QAPI_IOT_HAL_SSL_READ                            TXM_QAPI_IOT_HAL_BASE+ 16
-#define TXM_QAPI_IOT_HAL_UDP_CREATE                          TXM_QAPI_IOT_HAL_BASE+ 17
-#define TXM_QAPI_IOT_HAL_UDP_CLOSE                           TXM_QAPI_IOT_HAL_BASE+ 18
-#define TXM_QAPI_IOT_HAL_UDP_WRITE                           TXM_QAPI_IOT_HAL_BASE+ 19
-#define TXM_QAPI_IOT_HAL_UDP_READ                            TXM_QAPI_IOT_HAL_BASE+ 20
-#define TXM_QAPI_IOT_HAL_UDP_READTIMEOUT                     TXM_QAPI_IOT_HAL_BASE+ 21
-#define TXM_QAPI_IOT_HAL_UDP_RESOLVEADDRESS                  TXM_QAPI_IOT_HAL_BASE+ 22
-#define TXM_QAPI_IOT_HAL_DTLSSESSION_FREE                    TXM_QAPI_IOT_HAL_BASE+ 23
-#define TXM_QAPI_IOT_HAL_DTLSSESSION_INIT                    TXM_QAPI_IOT_HAL_BASE+ 24
-#define TXM_QAPI_IOT_HAL_DTLSSESSION_CREATE                  TXM_QAPI_IOT_HAL_BASE+ 25
-#define TXM_QAPI_IOT_HAL_DTLSSESSION_WRITE                   TXM_QAPI_IOT_HAL_BASE+ 26
-#define TXM_QAPI_IOT_HAL_DTLSSESSION_READ                    TXM_QAPI_IOT_HAL_BASE+ 27
-/*SIMCOM zhangwei 2017-10-19 fixed bug end*/
-/*SIMCOM zhangwei 2017-10-26 add ota qapi and HAL base index  end*/
-#if 0
-
-#define IOT_SetupConnInfo(product_key, device_name, device_secret, info_ptr)\
-    ((int) (_txm_module_system_call12)(TXM_QAPI_IOT_SETUP_CONNINFO,\
-                                       (ULONG) product_key,(ULONG) device_name, (ULONG) device_secret, (ULONG) info_ptr,(ULONG) 0,\
-                                       (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                       (ULONG) 0))
-
-#define IOT_OpenLog(ident)\
-    ( (void)(_txm_module_system_call12)(TXM_QAPI_IOT_OPEN_LOG,\
-                                        ((const char *)) ident,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                        (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                        (ULONG) 0))
-
-#define IOT_CloseLog()\
-    ( (void)(_txm_module_system_call12)(TXM_QAPI_IOT_CLOSE_LOG,\
-                                        (ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                        (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                        (ULONG) 0))
-
-#define IOT_SetLogLevel(level)\
-    ( (void)(_txm_module_system_call12)(TXM_QAPI_IOT_SET_LOG_LEVEL,\
-                                        (ULONG) level,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                        (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                        (ULONG) 0))
-
-#define IOT_DumpMemoryStats(level)\
-    ( (void)(_txm_module_system_call12)(TXM_QAPI_IOT_DUMP_MEMORY_STATS,\
-                                        (ULONG) level,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                        (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                        (ULONG) 0))
-
-#define IOT_Visual_AT_Output(data, length)\
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_VISUAL_AT_OUTPUT,\
-                                  (ULONG) data,(ULONG) length, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define IOT_Visual_AT_Input(data, length)\
-    ((unsigned short) (_txm_module_system_call12)(TXM_QAPI_IOT_VISUAL_AT_INPUT,\
-            (ULONG) data,(ULONG) length, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-            (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-            (ULONG) 0))
-#endif
-
-
-#define   HAL_MutexCreate()  \
-    ( (void*)(_txm_module_system_call12)(TXM_QAPI_IOT_HAL_MUTEXCREATEP,\
-                                         (ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                         (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                         (ULONG) 0))
-
-#define     HAL_MutexDestroy(mutex)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_MUTEXDESTROY,\
-                                  (ULONG) mutex,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define      HAL_MutexLock(mutex) \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_MUTEXLOCK,\
-                                  (ULONG) mutex,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define    HAL_MutexUnlock(mutex) \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_MUTEXUNLOCK,\
-                                  (ULONG) mutex,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_Malloc(size) \
-    ((CHAR*) (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_MALLOC,\
-                                         (ULONG) size,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                         (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                         (ULONG) 0))
-
-#define     HAL_Free(ptr)  \
-    ( (_txm_module_system_call12)( TXM_QAPI_IOT_HAL_FREE,\
-                                   (ULONG) ptr,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                   (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                   (ULONG) 0))
-
-#define      HAL_UptimeMs()  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UPTIMEMS,\
-                                  (ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_SleepMs(ms) \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_SLEEPMS ,\
-                                  (ULONG) ms,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_GetPartnerID(pid_str)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_GETPARTNERID ,\
-                                  (ULONG) pid_str,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_TCP_Establish(host, port)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_TCP_ESTABLISH ,\
-                                  (ULONG) host,(ULONG) port, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define   HAL_TCP_Destroy( fd )     \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_TCP_DESTROY,\
-                                  (ULONG) fd,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define   HAL_TCP_Write(fd,buf,len,timeout_ms) \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_TCP_WRITE,\
-                                  (ULONG) fd,(ULONG) buf, (ULONG) len, (ULONG) timeout_ms,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define   HAL_TCP_Read( fd,buf,len,timeout_ms)    \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_TCP_READ ,\
-                                  (ULONG) fd,(ULONG) buf, (ULONG) len, (ULONG) timeout_ms,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_SSL_Establish(host,port,ca_crt,ca_crt_len)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_SSL_ESTABLISH ,\
-                                  (ULONG) host,(ULONG) port, (ULONG) ca_crt, (ULONG) ca_crt_len,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define   HAL_SSL_Destroy( handle)   \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_SSL_DESTROY,\
-                                  (ULONG) handle,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define    HAL_SSL_Write(handle, buf,len,timeout_ms) \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_SSL_WRITE,\
-                                  (ULONG) handle,(ULONG) buf, (ULONG) len, (ULONG) timeout_ms,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define     HAL_SSL_Read(handle, buf, len,timeout_ms)       \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_SSL_READ,\
-                                  (ULONG) handle,(ULONG)buf, (ULONG) len, (ULONG) timeout_ms,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-/*
-*HAL_UDP of SDK 2.0 not compatible with latest version
-*/
-#define HAL_UDP_create(host, port) \
-    ( (void*)(_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_CLOSE,\
-                                         (ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                         (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                         (ULONG) 0))
-
-#if 0
-#define    HAL_UDP_create(p_socket)       \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_CREATE,\
-                                  (ULONG) p_socket,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-#endif
-
-#define     HAL_UDP_close(p_socket)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_CLOSE,\
-                                  (ULONG) p_socket,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define    HAL_UDP_write(p_socket,p_data,datalen)    \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_WRITE,\
-                                  (ULONG) p_socket,(ULONG) 0, (ULONG) p_data, (ULONG) datalen,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#if 0
-#define    HAL_UDP_write(p_socket,p_remote,p_data,datalen)    \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_WRITE,\
-                                  (ULONG) p_socket,(ULONG) p_remote, (ULONG) p_data, (ULONG) datalen,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-#endif
-
-#define  HAL_UDP_read(p_socket,p_remote,p_data,datalen)            \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_READ,\
-                                  (ULONG) p_socket,(ULONG) p_remote, (ULONG)p_remote, (ULONG) datalen,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define  HAL_UDP_readTimeout(p_socket,p_data,datalen,timeout )   \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_READTIMEOUT,\
-                                  (ULONG) p_socket,(ULONG) 0, (ULONG) p_data, (ULONG) datalen,(ULONG) timeout,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-#if 0
-#define  HAL_UDP_readTimeout(p_socket,p_remote,p_data,datalen,timeout )   \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_READTIMEOUT,\
-                                  (ULONG) p_socket,(ULONG) p_remote, (ULONG) p_data, (ULONG) datalen,(ULONG) timeout,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-#endif
-
-#define      HAL_UDP_resolveAddress(p_host,addr)       \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_UDP_RESOLVEADDRESS,\
-                                  (ULONG) p_host,(ULONG) addr, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define       HAL_DTLSSession_free(context)    \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_DTLSSESSION_FREE,\
-                                  (ULONG) context,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define    HAL_DTLSSession_init() \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_DTLSSESSION_INIT,\
-                                  (ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define       HAL_DTLSSession_create(context, p_options)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_DTLSSESSION_CREATE,\
-                                  (ULONG) context,(ULONG) p_options, (ULONG) 0, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define       HAL_DTLSSession_write(context,p_data,p_datalen)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_DTLSSESSION_WRITE,\
-                                  (ULONG) context,(ULONG) p_data, (ULONG) p_datalen, (ULONG) 0,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-#define   HAL_DTLSSession_read(context,p_data,p_datalen,timeout)  \
-    ( (_txm_module_system_call12)(TXM_QAPI_IOT_HAL_DTLSSESSION_READ,\
-                                  (ULONG) context,(ULONG) p_data, (ULONG) p_datalen, (ULONG) timeout,(ULONG) 0,\
-                                  (ULONG) 0,(ULONG) 0,(ULONG) 0, (ULONG) 0, (ULONG) 0, (ULONG) 0, \
-                                  (ULONG) 0))
-
-int HAL_Snprintf(_IN_ char *str, const int len, const char *fmt, ...);
-
-int HAL_Vsnprintf(_IN_ char *str, _IN_ const int len, _IN_ const char *format, va_list ap);
-
-void HAL_Printf(_IN_ const char *fmt, ...);
-
-char *HAL_GetModuleID(char mid_str[]);
-
-uint32_t HAL_Random(uint32_t region);
-
-void HAL_Srandom(uint32_t seed);
-
-int HAL_Atoi(const char *str);
-
-#define atoi(str)  HAL_Atoi(str)
-
-#endif
-

+ 0 - 20
iotkit-embedded/src/import/mdm9206/include/qapi_ali_iot_txm_base.h

@@ -1,20 +0,0 @@
-#ifndef QAPI_ALI_IOT_TXM_BASE_H
-#define QAPI_ALI_IOT_TXM_BASE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "qapi_txm_base.h"
-
-/*** Maximum IDs for dataservices is defined by macro TXM_QAPI_DATA_SERVICES_NUM_IDS ***/
-
-#define  TXM_QAPI_IOT_BASE                        TXM_QAPI_FS_BASE + 30
-#define  TXM_QAPI_IOT_NUM_IDS                     14
-
-
-#ifdef __cplusplus
-} /* closing brace for extern "C" */
-#endif
-
-#endif

+ 0 - 105
iotkit-embedded/src/import/mdm9206/include/qapi_txm_base.h

@@ -1,105 +0,0 @@
-#ifndef QAPI_TXM_BASE_H
-#define QAPI_TXM_BASE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "txm_module.h"
-
-/* this is used when no extra arguments need to be passed through kernel dispatcher*/
-#define QAPI_NULL_EXTRA_ARG 0x4E415247
-
-#define  TXM_QAPI_ID_START                        TXM_APPLICATION_REQUEST_ID_BASE
-// this can be discussed for a proper name
-#define  TXM_QAPI_ID_END                          TXM_QAPI_ID_START + TXM_QAPI_MAX_NUM_IDS
-
-// *NOT TO BE CHANGED* or else it may impact system functionality
-// API ID base and limit definitions for OEM APIs
-#define  TXM_QC_OEM_API_BASE        TXM_APPLICATION_REQUEST_ID_BASE + 0x10000
-#define  TXM_QC_OEM_API_MAX_IDS     0x10000
-#define  TXM_QC_OEM_API_END         TXM_QC_OEM_API_BASE + TXM_QC_OEM_API_MAX_IDS
-// OEM API ID base and limit definition ends
-
-/*** DO NOT MODIFY anything above this line ***/
-
-#define  TXM_QAPI_MAX_NUM_IDS                     (TXM_QAPI_LOCATION_NUM_IDS + \
-        TXM_QAPI_QCCI_NUM_IDS + \
-        TXM_QAPI_DIAG_NUM_IDS + \
-        TXM_QAPI_TIMERS_NUM_IDS + \
-        TXM_QAPI_FS_NUM_IDS + \
-        TXM_QAPI_TLMM_NUM_IDS + \
-        TXM_QAPI_GPIO_INT_NUM_IDS + \
-        TXM_QAPI_ADC_NUM_IDS + \
-        TXM_QAPI_TSENS_NUM_IDS + \
-        TXM_QAPI_DATA_SERVICES_NUM_IDS + \
-        TXM_QAPI_BUSES_NUM_IDS + \
-        TXM_QAPI_FTL_NUM_IDS + \
-        TXM_QAPI_USB_NUM_IDS + \
-        TXM_QAPI_RIL_NUM_IDS + \
-        TXM_QAPI_PMIC_NUM_IDS + \
-        TXM_QURT_TIMETICK_NUM_IDS)
-
-#define  TXM_QAPI_LOCATION_BASE                   TXM_QAPI_ID_START
-#define  TXM_QAPI_LOCATION_NUM_IDS                50
-
-#define  TXM_QAPI_QCCI_BASE                       TXM_QAPI_LOCATION_BASE + TXM_QAPI_LOCATION_NUM_IDS
-#define  TXM_QAPI_QCCI_NUM_IDS                    100
-
-#define  TXM_QAPI_DIAG_BASE                       TXM_QAPI_QCCI_BASE + TXM_QAPI_QCCI_NUM_IDS
-#define  TXM_QAPI_DIAG_NUM_IDS                    100
-
-#define  TXM_QAPI_TIMERS_BASE                     TXM_QAPI_DIAG_BASE + TXM_QAPI_DIAG_NUM_IDS
-#define  TXM_QAPI_TIMERS_NUM_IDS                  50
-
-#define  TXM_QAPI_FS_BASE                         TXM_QAPI_TIMERS_BASE + TXM_QAPI_TIMERS_NUM_IDS
-#define  TXM_QAPI_FS_NUM_IDS                      100
-
-#define  TXM_QAPI_TLMM_BASE                       TXM_QAPI_FS_BASE + TXM_QAPI_FS_NUM_IDS
-#define  TXM_QAPI_TLMM_NUM_IDS                    50
-
-#define  TXM_QAPI_GPIO_INT_BASE                   TXM_QAPI_TLMM_BASE + TXM_QAPI_TLMM_NUM_IDS
-#define  TXM_QAPI_GPIO_INT_NUM_IDS                50
-
-#define  TXM_QAPI_ADC_BASE                        TXM_QAPI_GPIO_INT_BASE + TXM_QAPI_GPIO_INT_NUM_IDS
-#define  TXM_QAPI_ADC_NUM_IDS                     50
-
-#define  TXM_QAPI_TSENS_BASE                      TXM_QAPI_ADC_BASE + TXM_QAPI_ADC_NUM_IDS
-#define  TXM_QAPI_TSENS_NUM_IDS                   50
-
-#define  TXM_QAPI_DATA_SERVICES_BASE              TXM_QAPI_TSENS_BASE + TXM_QAPI_TSENS_NUM_IDS
-#define  TXM_QAPI_DATA_SERVICES_NUM_IDS           300
-
-#define  TXM_QAPI_BUSES_BASE                      TXM_QAPI_DATA_SERVICES_BASE + TXM_QAPI_DATA_SERVICES_NUM_IDS
-#define  TXM_QAPI_BUSES_NUM_IDS                   100
-
-#define  TXM_QAPI_FTL_BASE                        TXM_QAPI_BUSES_BASE + TXM_QAPI_BUSES_NUM_IDS
-#define  TXM_QAPI_FTL_NUM_IDS                     25
-
-#define  TXM_QAPI_USB_BASE                        TXM_QAPI_FTL_BASE + TXM_QAPI_FTL_NUM_IDS
-#define  TXM_QAPI_USB_NUM_IDS                     25
-
-#define  TXM_QAPI_RIL_BASE                        TXM_QAPI_USB_BASE + TXM_QAPI_USB_NUM_IDS
-#define  TXM_QAPI_RIL_NUM_IDS                     50
-
-#define  TXM_QAPI_PMIC_BASE                       TXM_QAPI_RIL_BASE + TXM_QAPI_RIL_NUM_IDS
-#define  TXM_QAPI_PMIC_NUM_IDS                    25
-
-#define  TXM_QURT_TIMETICK_BASE                   TXM_QAPI_PMIC_BASE + TXM_QAPI_PMIC_NUM_IDS
-#define  TXM_QURT_TIMETICK_NUM_IDS                10
-
-/*SIMCOM mengxiangning added for qapi function begin 20170829*/
-#if defined __SIMCOM_PUB__
-#define  TXM_QAPI_IOT_ALIBABA_BASE                TXM_QURT_TIMETICK_BASE + TXM_QURT_TIMETICK_NUM_IDS
-#define  TXM_QAPI_IOT_ALIBABA_NUM_IDS             100
-#endif
-/*SIMCOM mengxiangning added for qapi function end 20170829*/
-
-
-
-#ifdef __cplusplus
-} /* closing brace for extern "C" */
-#endif
-
-#endif
-

+ 0 - 43
iotkit-embedded/src/import/mdm9206/include/txm_module.h

@@ -1,43 +0,0 @@
-#ifndef TXM_MODULE_H
-#define TXM_MODULE_H
-
-
-#define TXM_APPLICATION_REQUEST_ID_BASE                     0x10000
-
-/* Define the Module ID, which is used to indicate a module is valid.  */
-
-#define TXM_MODULE_ID                                       0x4D4F4455
-
-
-#define VOID                                    void
-typedef char                                    CHAR;
-typedef unsigned char                           UCHAR;
-typedef int                                     INT;
-typedef unsigned int                            UINT;
-typedef long                                    LONG;
-typedef unsigned long                           ULONG;
-typedef short                                   SHORT;
-typedef unsigned short                          USHORT;
-
-ULONG  _txm_module_system_call4(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4);
-ULONG  _txm_module_system_call5(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                ULONG param_5);
-ULONG  _txm_module_system_call6(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                ULONG param_5, ULONG param_6);
-ULONG  _txm_module_system_call7(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                ULONG param_5, ULONG param_6, ULONG param_7);
-ULONG  _txm_module_system_call8(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                ULONG param_5, ULONG param_6, ULONG param_7, ULONG param_8);
-ULONG  _txm_module_system_call9(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                ULONG param_5, ULONG param_6, ULONG param_7, ULONG param_8, ULONG param_9);
-ULONG  _txm_module_system_call10(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                 ULONG param_5, ULONG param_6, ULONG param_7, ULONG param_8, ULONG param_9, ULONG param_10);
-ULONG  _txm_module_system_call11(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                 ULONG param_5, ULONG param_6, ULONG param_7, ULONG param_8, ULONG param_9, ULONG param_10, ULONG param_11);
-ULONG  _txm_module_system_call12(ULONG request, ULONG param_1, ULONG param_2, ULONG param_3, ULONG param_4,
-                                 ULONG param_5, ULONG param_6, ULONG param_7, ULONG param_8, ULONG param_9, ULONG param_10, ULONG param_11,
-                                 ULONG param12);
-
-
-#endif
-

+ 0 - 669
iotkit-embedded/src/import/ubuntu/include/itls/check_config.h

@@ -1,669 +0,0 @@
-/**
- * \file check_config.h
- *
- * \brief Consistency checks for configuration options
- *
- *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-
-/*
- * It is recommended to include this file from your config.h
- * in order to catch dependency issues early.
- */
-
-#ifndef MBEDTLS_CHECK_CONFIG_H
-#define MBEDTLS_CHECK_CONFIG_H
-
-/*
- * We assume CHAR_BIT is 8 in many places. In practice, this is true on our
- * target platforms, so not an issue, but let's just be extra sure.
- */
-#include <limits.h>
-#if CHAR_BIT != 8
-#error "mbed TLS requires a platform with 8-bit chars"
-#endif
-
-#if defined(_WIN32)
-#if !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_C is required on Windows"
-#endif
-
-/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
- * it would confuse config.pl. */
-#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
-    !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
-#define MBEDTLS_PLATFORM_SNPRINTF_ALT
-#endif
-#endif /* _WIN32 */
-
-#if defined(TARGET_LIKE_MBED) && \
-    ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) )
-#error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS"
-#endif
-
-#if defined(MBEDTLS_DEPRECATED_WARNING) && \
-    !defined(__GNUC__) && !defined(__clang__)
-#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
-#endif
-
-#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME)
-#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense"
-#endif
-
-#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM)
-#error "MBEDTLS_AESNI_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
-#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C)
-#error "MBEDTLS_DHM_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_CMAC_C) && \
-    !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C)
-#error "MBEDTLS_CMAC_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C)
-#error "MBEDTLS_ECDH_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECDSA_C) &&            \
-    ( !defined(MBEDTLS_ECP_C) ||           \
-      !defined(MBEDTLS_ASN1_PARSE_C) ||    \
-      !defined(MBEDTLS_ASN1_WRITE_C) )
-#error "MBEDTLS_ECDSA_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECJPAKE_C) &&           \
-    ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) )
-#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C)
-#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || (   \
-    !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)   &&                  \
-    !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)   &&                  \
-    !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)   &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) &&                  \
-    !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) ) )
-#error "MBEDTLS_ECP_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) &&      \
-                                    !defined(MBEDTLS_SHA256_C))
-#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites"
-#endif
-#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) &&         \
-    defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64)
-#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
-#endif
-#if defined(MBEDTLS_ENTROPY_C) &&                                            \
-    ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \
-    && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32)
-#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high"
-#endif
-#if defined(MBEDTLS_ENTROPY_C) && \
-    defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C)
-#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
-    ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) )
-#error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites"
-#endif
-#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \
-     ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \
-    defined(MBEDTLS_HAVEGE_C) )
-#error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too"
-#endif
-
-#if defined(MBEDTLS_GCM_C) && (                                        \
-        !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) )
-#error "MBEDTLS_GCM_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
-#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
-#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C)
-#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) &&                 \
-    ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
-#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) &&                 \
-    ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) )
-#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C)
-#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) &&                     \
-    !defined(MBEDTLS_ECDH_C)
-#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) &&                   \
-    ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) ||           \
-      !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
-#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) &&                 \
-    ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) ||          \
-      !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) )
-#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) &&                 \
-    ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) ||          \
-      !defined(MBEDTLS_X509_CRT_PARSE_C) )
-#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) &&                   \
-    ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
-      !defined(MBEDTLS_PKCS1_V15) )
-#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) &&                       \
-    ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
-      !defined(MBEDTLS_PKCS1_V15) )
-#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) &&                    \
-    ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) ||      \
-      !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) )
-#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) &&                          \
-    ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
-#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM)
-#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C)
-#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C)
-#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PK_C) && \
-    ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) )
-#error "MBEDTLS_PK_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C)
-#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C)
-#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C)
-#error "MBEDTLS_PKCS11_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\
-        defined(MBEDTLS_PLATFORM_EXIT_ALT) )
-#error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) ||\
-        !defined(MBEDTLS_HAVE_TIME) )
-#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) ||\
-        !defined(MBEDTLS_HAVE_TIME) )
-#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) ||\
-        !defined(MBEDTLS_HAVE_TIME) )
-#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
-        defined(MBEDTLS_PLATFORM_TIME_ALT) )
-#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\
-        defined(MBEDTLS_PLATFORM_TIME_ALT) )
-#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\
-        defined(MBEDTLS_PLATFORM_FPRINTF_ALT) )
-#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
-#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\
-    defined(MBEDTLS_PLATFORM_STD_FREE)
-#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
-#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) )
-#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\
-    defined(MBEDTLS_PLATFORM_STD_CALLOC)
-#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO)
-#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\
-        defined(MBEDTLS_PLATFORM_PRINTF_ALT) )
-#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
-#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\
-        defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) )
-#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\
-    !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
-#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
-#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY)
-#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY)
-#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\
-    !defined(MBEDTLS_PLATFORM_EXIT_ALT)
-#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\
-    ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\
-        !defined(MBEDTLS_HAVE_TIME) )
-#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\
-    !defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
-#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\
-    !defined(MBEDTLS_PLATFORM_PRINTF_ALT)
-#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\
-    !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
-#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_ENTROPY_NV_SEED) &&\
-    ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) )
-#error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\
-    !defined(MBEDTLS_ENTROPY_NV_SEED)
-#error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\
-    !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
-#error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\
-    !defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
-#error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\
-      defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
-#error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\
-    ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\
-      defined(MBEDTLS_PLATFORM_NV_SEED_ALT) )
-#error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously"
-#endif
-
-#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) ||         \
-    !defined(MBEDTLS_OID_C) )
-#error "MBEDTLS_RSA_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) &&         \
-    !defined(MBEDTLS_PKCS1_V15) )
-#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
-#endif
-
-#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) &&                        \
-    ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) )
-#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) ||     \
-    !defined(MBEDTLS_SHA1_C) )
-#error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) ||     \
-    !defined(MBEDTLS_SHA1_C) )
-#error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) ||     \
-    !defined(MBEDTLS_SHA1_C) )
-#error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) &&     \
-    !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) )
-#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_DTLS)     && \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_1)  && \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_2)
-#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C)
-#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) ||     \
-    !defined(MBEDTLS_MD_C) )
-#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C)
-#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \
-    !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_2))
-#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active"
-#endif
-
-#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
-    defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1))
-#error "Illegal protocol selection"
-#endif
-
-#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \
-    defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1))
-#error "Illegal protocol selection"
-#endif
-
-#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \
-    defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_1)))
-#error "Illegal protocol selection"
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS)
-#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY  defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \
-    !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY)
-#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE  defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) &&                              \
-    ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
-#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY  defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) &&                              \
-    ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) )
-#error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT  defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) &&   \
-    !defined(MBEDTLS_SSL_PROTO_TLS1)   &&      \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_1) &&      \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_2)
-#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites"
-#endif
-
-#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \
-    !defined(MBEDTLS_SSL_PROTO_TLS1)   &&          \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_1) &&          \
-    !defined(MBEDTLS_SSL_PROTO_TLS1_2)
-#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites"
-#endif
-
-#if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C)
-#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \
-    !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1)
-#error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \
-        !defined(MBEDTLS_X509_CRT_PARSE_C)
-#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_THREADING_PTHREAD)
-#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
-#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites"
-#endif
-#define MBEDTLS_THREADING_IMPL
-#endif
-
-#if defined(MBEDTLS_THREADING_ALT)
-#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL)
-#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites"
-#endif
-#define MBEDTLS_THREADING_IMPL
-#endif
-
-#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL)
-#error "MBEDTLS_THREADING_C defined, single threading implementation required"
-#endif
-#undef MBEDTLS_THREADING_IMPL
-
-#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C)
-#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) ||  \
-    !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) ||      \
-    !defined(MBEDTLS_PK_PARSE_C) )
-#error "MBEDTLS_X509_USE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) ||  \
-    !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) ||       \
-    !defined(MBEDTLS_PK_WRITE_C) )
-#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
-#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
-#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) )
-#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
-#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) )
-#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites"
-#endif
-
-#if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64)
-#error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously"
-#endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */
-
-#if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \
-    defined(MBEDTLS_HAVE_ASM)
-#error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously"
-#endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */
-
-/*
- * Avoid warning from -pedantic. This is a convenient place for this
- * workaround since this is included by every single file before the
- * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units.
- */
-typedef int mbedtls_iso_c_forbids_empty_translation_units;
-
-#endif /* MBEDTLS_CHECK_CONFIG_H */

+ 0 - 709
iotkit-embedded/src/import/ubuntu/include/itls/cipher.h

@@ -1,709 +0,0 @@
-/**
- * \file cipher.h
- *
- * \brief Generic cipher wrapper.
- *
- * \author Adriaan de Jong <dejong@fox-it.com>
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-
-#ifndef MBEDTLS_CIPHER_H
-#define MBEDTLS_CIPHER_H
-
-#if !defined(MBEDTLS_CONFIG_FILE)
-#include "config.h"
-#else
-#include MBEDTLS_CONFIG_FILE
-#endif
-
-#include <stddef.h>
-
-#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C)
-#define MBEDTLS_CIPHER_MODE_AEAD
-#endif
-
-#if defined(MBEDTLS_CIPHER_MODE_CBC)
-#define MBEDTLS_CIPHER_MODE_WITH_PADDING
-#endif
-
-#if defined(MBEDTLS_ARC4_C)
-#define MBEDTLS_CIPHER_MODE_STREAM
-#endif
-
-#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
-    !defined(inline) && !defined(__cplusplus)
-#define inline __inline
-#endif
-
-#define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE            -0x6080  /**< The selected feature is not available. */
-#define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA                 -0x6100  /**< Bad input parameters to function. */
-#define MBEDTLS_ERR_CIPHER_ALLOC_FAILED                   -0x6180  /**< Failed to allocate memory. */
-#define MBEDTLS_ERR_CIPHER_INVALID_PADDING                -0x6200  /**< Input data contains invalid padding and is rejected. */
-#define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED            -0x6280  /**< Decryption of block requires a full block. */
-#define MBEDTLS_ERR_CIPHER_AUTH_FAILED                    -0x6300  /**< Authentication failed (for AEAD modes). */
-#define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT              -0x6380  /**< The context is invalid, eg because it was free()ed. */
-
-#define MBEDTLS_CIPHER_VARIABLE_IV_LEN     0x01    /**< Cipher accepts IVs of variable length */
-#define MBEDTLS_CIPHER_VARIABLE_KEY_LEN    0x02    /**< Cipher accepts keys of variable length */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    MBEDTLS_CIPHER_ID_NONE = 0,
-    MBEDTLS_CIPHER_ID_NULL,
-    MBEDTLS_CIPHER_ID_AES,
-    MBEDTLS_CIPHER_ID_DES,
-    MBEDTLS_CIPHER_ID_3DES,
-    MBEDTLS_CIPHER_ID_CAMELLIA,
-    MBEDTLS_CIPHER_ID_BLOWFISH,
-    MBEDTLS_CIPHER_ID_ARC4,
-} mbedtls_cipher_id_t;
-
-typedef enum {
-    MBEDTLS_CIPHER_NONE = 0,
-    MBEDTLS_CIPHER_NULL,
-    MBEDTLS_CIPHER_AES_128_ECB,
-    MBEDTLS_CIPHER_AES_192_ECB,
-    MBEDTLS_CIPHER_AES_256_ECB,
-    MBEDTLS_CIPHER_AES_128_CBC,
-    MBEDTLS_CIPHER_AES_192_CBC,
-    MBEDTLS_CIPHER_AES_256_CBC,
-    MBEDTLS_CIPHER_AES_128_CFB128,
-    MBEDTLS_CIPHER_AES_192_CFB128,
-    MBEDTLS_CIPHER_AES_256_CFB128,
-    MBEDTLS_CIPHER_AES_128_CTR,
-    MBEDTLS_CIPHER_AES_192_CTR,
-    MBEDTLS_CIPHER_AES_256_CTR,
-    MBEDTLS_CIPHER_AES_128_GCM,
-    MBEDTLS_CIPHER_AES_192_GCM,
-    MBEDTLS_CIPHER_AES_256_GCM,
-    MBEDTLS_CIPHER_CAMELLIA_128_ECB,
-    MBEDTLS_CIPHER_CAMELLIA_192_ECB,
-    MBEDTLS_CIPHER_CAMELLIA_256_ECB,
-    MBEDTLS_CIPHER_CAMELLIA_128_CBC,
-    MBEDTLS_CIPHER_CAMELLIA_192_CBC,
-    MBEDTLS_CIPHER_CAMELLIA_256_CBC,
-    MBEDTLS_CIPHER_CAMELLIA_128_CFB128,
-    MBEDTLS_CIPHER_CAMELLIA_192_CFB128,
-    MBEDTLS_CIPHER_CAMELLIA_256_CFB128,
-    MBEDTLS_CIPHER_CAMELLIA_128_CTR,
-    MBEDTLS_CIPHER_CAMELLIA_192_CTR,
-    MBEDTLS_CIPHER_CAMELLIA_256_CTR,
-    MBEDTLS_CIPHER_CAMELLIA_128_GCM,
-    MBEDTLS_CIPHER_CAMELLIA_192_GCM,
-    MBEDTLS_CIPHER_CAMELLIA_256_GCM,
-    MBEDTLS_CIPHER_DES_ECB,
-    MBEDTLS_CIPHER_DES_CBC,
-    MBEDTLS_CIPHER_DES_EDE_ECB,
-    MBEDTLS_CIPHER_DES_EDE_CBC,
-    MBEDTLS_CIPHER_DES_EDE3_ECB,
-    MBEDTLS_CIPHER_DES_EDE3_CBC,
-    MBEDTLS_CIPHER_BLOWFISH_ECB,
-    MBEDTLS_CIPHER_BLOWFISH_CBC,
-    MBEDTLS_CIPHER_BLOWFISH_CFB64,
-    MBEDTLS_CIPHER_BLOWFISH_CTR,
-    MBEDTLS_CIPHER_ARC4_128,
-    MBEDTLS_CIPHER_AES_128_CCM,
-    MBEDTLS_CIPHER_AES_192_CCM,
-    MBEDTLS_CIPHER_AES_256_CCM,
-    MBEDTLS_CIPHER_CAMELLIA_128_CCM,
-    MBEDTLS_CIPHER_CAMELLIA_192_CCM,
-    MBEDTLS_CIPHER_CAMELLIA_256_CCM,
-} mbedtls_cipher_type_t;
-
-typedef enum {
-    MBEDTLS_MODE_NONE = 0,
-    MBEDTLS_MODE_ECB,
-    MBEDTLS_MODE_CBC,
-    MBEDTLS_MODE_CFB,
-    MBEDTLS_MODE_OFB, /* Unused! */
-    MBEDTLS_MODE_CTR,
-    MBEDTLS_MODE_GCM,
-    MBEDTLS_MODE_STREAM,
-    MBEDTLS_MODE_CCM,
-} mbedtls_cipher_mode_t;
-
-typedef enum {
-    MBEDTLS_PADDING_PKCS7 = 0,     /**< PKCS7 padding (default)        */
-    MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding         */
-    MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding             */
-    MBEDTLS_PADDING_ZEROS,         /**< zero padding (not reversible!) */
-    MBEDTLS_PADDING_NONE,          /**< never pad (full blocks only)   */
-} mbedtls_cipher_padding_t;
-
-typedef enum {
-    MBEDTLS_OPERATION_NONE = -1,
-    MBEDTLS_DECRYPT = 0,
-    MBEDTLS_ENCRYPT,
-} mbedtls_operation_t;
-
-enum {
-    /** Undefined key length */
-    MBEDTLS_KEY_LENGTH_NONE = 0,
-    /** Key length, in bits (including parity), for DES keys */
-    MBEDTLS_KEY_LENGTH_DES  = 64,
-    /** Key length, in bits (including parity), for DES in two key EDE */
-    MBEDTLS_KEY_LENGTH_DES_EDE = 128,
-    /** Key length, in bits (including parity), for DES in three-key EDE */
-    MBEDTLS_KEY_LENGTH_DES_EDE3 = 192,
-};
-
-/** Maximum length of any IV, in bytes */
-#define MBEDTLS_MAX_IV_LENGTH      16
-/** Maximum block size of any cipher, in bytes */
-#define MBEDTLS_MAX_BLOCK_LENGTH   16
-
-/**
- * Base cipher information (opaque struct).
- */
-typedef struct mbedtls_cipher_base_t mbedtls_cipher_base_t;
-
-/**
- * CMAC context (opaque struct).
- */
-typedef struct mbedtls_cmac_context_t mbedtls_cmac_context_t;
-
-/**
- * Cipher information. Allows cipher functions to be called in a generic way.
- */
-typedef struct {
-    /** Full cipher identifier (e.g. MBEDTLS_CIPHER_AES_256_CBC) */
-    mbedtls_cipher_type_t type;
-
-    /** Cipher mode (e.g. MBEDTLS_MODE_CBC) */
-    mbedtls_cipher_mode_t mode;
-
-    /** Cipher key length, in bits (default length for variable sized ciphers)
-     *  (Includes parity bits for ciphers like DES) */
-    unsigned int key_bitlen;
-
-    /** Name of the cipher */
-    const char * name;
-
-    /** IV/NONCE size, in bytes.
-     *  For cipher that accept many sizes: recommended size */
-    unsigned int iv_size;
-
-    /** Flags for variable IV size, variable key size, etc. */
-    int flags;
-
-    /** block size, in bytes */
-    unsigned int block_size;
-
-    /** Base cipher information and functions */
-    const mbedtls_cipher_base_t *base;
-
-} mbedtls_cipher_info_t;
-
-/**
- * Generic cipher context.
- */
-typedef struct {
-    /** Information about the associated cipher */
-    const mbedtls_cipher_info_t *cipher_info;
-
-    /** Key length to use */
-    int key_bitlen;
-
-    /** Operation that the context's key has been initialised for */
-    mbedtls_operation_t operation;
-
-#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
-    /** Padding functions to use, if relevant for cipher mode */
-    void (*add_padding)( unsigned char *output, size_t olen, size_t data_len );
-    int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len );
-#endif
-
-    /** Buffer for data that hasn't been encrypted yet */
-    unsigned char unprocessed_data[MBEDTLS_MAX_BLOCK_LENGTH];
-
-    /** Number of bytes that still need processing */
-    size_t unprocessed_len;
-
-    /** Current IV or NONCE_COUNTER for CTR-mode */
-    unsigned char iv[MBEDTLS_MAX_IV_LENGTH];
-
-    /** IV size in bytes (for ciphers with variable-length IVs) */
-    size_t iv_size;
-
-    /** Cipher-specific context */
-    void *cipher_ctx;
-
-#if defined(MBEDTLS_CMAC_C)
-    /** CMAC Specific context */
-    mbedtls_cmac_context_t *cmac_ctx;
-#endif
-} mbedtls_cipher_context_t;
-
-/**
- * \brief Returns the list of ciphers supported by the generic cipher module.
- *
- * \return              a statically allocated array of ciphers, the last entry
- *                      is 0.
- */
-const int *mbedtls_cipher_list( void );
-
-/**
- * \brief               Returns the cipher information structure associated
- *                      with the given cipher name.
- *
- * \param cipher_name   Name of the cipher to search for.
- *
- * \return              the cipher information structure associated with the
- *                      given cipher_name, or NULL if not found.
- */
-const mbedtls_cipher_info_t *mbedtls_cipher_info_from_string( const char *cipher_name );
-
-/**
- * \brief               Returns the cipher information structure associated
- *                      with the given cipher type.
- *
- * \param cipher_type   Type of the cipher to search for.
- *
- * \return              the cipher information structure associated with the
- *                      given cipher_type, or NULL if not found.
- */
-const mbedtls_cipher_info_t *mbedtls_cipher_info_from_type( const mbedtls_cipher_type_t cipher_type );
-
-/**
- * \brief               Returns the cipher information structure associated
- *                      with the given cipher id, key size and mode.
- *
- * \param cipher_id     Id of the cipher to search for
- *                      (e.g. MBEDTLS_CIPHER_ID_AES)
- * \param key_bitlen    Length of the key in bits
- * \param mode          Cipher mode (e.g. MBEDTLS_MODE_CBC)
- *
- * \return              the cipher information structure associated with the
- *                      given cipher_type, or NULL if not found.
- */
-const mbedtls_cipher_info_t *mbedtls_cipher_info_from_values( const mbedtls_cipher_id_t cipher_id,
-                                              int key_bitlen,
-                                              const mbedtls_cipher_mode_t mode );
-
-/**
- * \brief               Initialize a cipher_context (as NONE)
- */
-void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx );
-
-/**
- * \brief               Free and clear the cipher-specific context of ctx.
- *                      Freeing ctx itself remains the responsibility of the
- *                      caller.
- */
-void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx );
-
-/**
- * \brief               Initialises and fills the cipher context structure with
- *                      the appropriate values.
- *
- * \note                Currently also clears structure. In future versions you
- *                      will be required to call mbedtls_cipher_init() on the structure
- *                      first.
- *
- * \param ctx           context to initialise. May not be NULL.
- * \param cipher_info   cipher to use.
- *
- * \return              0 on success,
- *                      MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on parameter failure,
- *                      MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the
- *                      cipher-specific context failed.
- */
-int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, const mbedtls_cipher_info_t *cipher_info );
-
-/**
- * \brief               Returns the block size of the given cipher.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              size of the cipher's blocks, or 0 if ctx has not been
- *                      initialised.
- */
-static inline unsigned int mbedtls_cipher_get_block_size( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return 0;
-
-    return ctx->cipher_info->block_size;
-}
-
-/**
- * \brief               Returns the mode of operation for the cipher.
- *                      (e.g. MBEDTLS_MODE_CBC)
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              mode of operation, or MBEDTLS_MODE_NONE if ctx
- *                      has not been initialised.
- */
-static inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return MBEDTLS_MODE_NONE;
-
-    return ctx->cipher_info->mode;
-}
-
-/**
- * \brief               Returns the size of the cipher's IV/NONCE in bytes.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              If IV has not been set yet: (recommended) IV size
- *                      (0 for ciphers not using IV/NONCE).
- *                      If IV has already been set: actual size.
- */
-static inline int mbedtls_cipher_get_iv_size( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return 0;
-
-    if( ctx->iv_size != 0 )
-        return (int) ctx->iv_size;
-
-    return (int) ctx->cipher_info->iv_size;
-}
-
-/**
- * \brief               Returns the type of the given cipher.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              type of the cipher, or MBEDTLS_CIPHER_NONE if ctx has
- *                      not been initialised.
- */
-static inline mbedtls_cipher_type_t mbedtls_cipher_get_type( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return MBEDTLS_CIPHER_NONE;
-
-    return ctx->cipher_info->type;
-}
-
-/**
- * \brief               Returns the name of the given cipher, as a string.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              name of the cipher, or NULL if ctx was not initialised.
- */
-static inline const char *mbedtls_cipher_get_name( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return 0;
-
-    return ctx->cipher_info->name;
-}
-
-/**
- * \brief               Returns the key length of the cipher.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              cipher's key length, in bits, or
- *                      MBEDTLS_KEY_LENGTH_NONE if ctx has not been
- *                      initialised.
- */
-static inline int mbedtls_cipher_get_key_bitlen( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return MBEDTLS_KEY_LENGTH_NONE;
-
-    return (int) ctx->cipher_info->key_bitlen;
-}
-
-/**
- * \brief               Returns the operation of the given cipher.
- *
- * \param ctx           cipher's context. Must have been initialised.
- *
- * \return              operation (MBEDTLS_ENCRYPT or MBEDTLS_DECRYPT),
- *                      or MBEDTLS_OPERATION_NONE if ctx has not been
- *                      initialised.
- */
-static inline mbedtls_operation_t mbedtls_cipher_get_operation( const mbedtls_cipher_context_t *ctx )
-{
-    if( NULL == ctx || NULL == ctx->cipher_info )
-        return MBEDTLS_OPERATION_NONE;
-
-    return ctx->operation;
-}
-
-/**
- * \brief               Set the key to use with the given context.
- *
- * \param ctx           generic cipher context. May not be NULL. Must have been
- *                      initialised using cipher_context_from_type or
- *                      cipher_context_from_string.
- * \param key           The key to use.
- * \param key_bitlen    key length to use, in bits.
- * \param operation     Operation that the key will be used for, either
- *                      MBEDTLS_ENCRYPT or MBEDTLS_DECRYPT.
- *
- * \returns             0 on success, MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if
- *                      parameter verification fails or a cipher specific
- *                      error code.
- */
-int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx, const unsigned char *key,
-                   int key_bitlen, const mbedtls_operation_t operation );
-
-#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
-/**
- * \brief               Set padding mode, for cipher modes that use padding.
- *                      (Default: PKCS7 padding.)
- *
- * \param ctx           generic cipher context
- * \param mode          padding mode
- *
- * \returns             0 on success, MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
- *                      if selected padding mode is not supported, or
- *                      MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if the cipher mode
- *                      does not support padding.
- */
-int mbedtls_cipher_set_padding_mode( mbedtls_cipher_context_t *ctx, mbedtls_cipher_padding_t mode );
-#endif /* MBEDTLS_CIPHER_MODE_WITH_PADDING */
-
-/**
- * \brief               Set the initialization vector (IV) or nonce
- *
- * \param ctx           generic cipher context
- * \param iv            IV to use (or NONCE_COUNTER for CTR-mode ciphers)
- * \param iv_len        IV length for ciphers with variable-size IV;
- *                      discarded by ciphers with fixed-size IV.
- *
- * \returns             0 on success, or MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
- *
- * \note                Some ciphers don't use IVs nor NONCE. For these
- *                      ciphers, this function has no effect.
- */
-int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx,
-                   const unsigned char *iv, size_t iv_len );
-
-/**
- * \brief               Finish preparation of the given context
- *
- * \param ctx           generic cipher context
- *
- * \returns             0 on success, MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA
- *                      if parameter verification fails.
- */
-int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx );
-
-#if defined(MBEDTLS_GCM_C)
-/**
- * \brief               Add additional data (for AEAD ciphers).
- *                      Currently only supported with GCM.
- *                      Must be called exactly once, after mbedtls_cipher_reset().
- *
- * \param ctx           generic cipher context
- * \param ad            Additional data to use.
- * \param ad_len        Length of ad.
- *
- * \return              0 on success, or a specific error code.
- */
-int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx,
-                      const unsigned char *ad, size_t ad_len );
-#endif /* MBEDTLS_GCM_C */
-
-/**
- * \brief               Generic cipher update function. Encrypts/decrypts
- *                      using the given cipher context. Writes as many block
- *                      size'd blocks of data as possible to output. Any data
- *                      that cannot be written immediately will either be added
- *                      to the next block, or flushed when cipher_final is
- *                      called.
- *                      Exception: for MBEDTLS_MODE_ECB, expects single block
- *                                 in size (e.g. 16 bytes for AES)
- *
- * \param ctx           generic cipher context
- * \param input         buffer holding the input data
- * \param ilen          length of the input data
- * \param output        buffer for the output data. Should be able to hold at
- *                      least ilen + block_size. Cannot be the same buffer as
- *                      input!
- * \param olen          length of the output data, will be filled with the
- *                      actual number of bytes written.
- *
- * \returns             0 on success, MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if
- *                      parameter verification fails,
- *                      MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE on an
- *                      unsupported mode for a cipher or a cipher specific
- *                      error code.
- *
- * \note                If the underlying cipher is GCM, all calls to this
- *                      function, except the last one before mbedtls_cipher_finish(),
- *                      must have ilen a multiple of the block size.
- */
-int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *input,
-                   size_t ilen, unsigned char *output, size_t *olen );
-
-/**
- * \brief               Generic cipher finalisation function. If data still
- *                      needs to be flushed from an incomplete block, data
- *                      contained within it will be padded with the size of
- *                      the last block, and written to the output buffer.
- *
- * \param ctx           Generic cipher context
- * \param output        buffer to write data to. Needs block_size available.
- * \param olen          length of the data written to the output buffer.
- *
- * \returns             0 on success, MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if
- *                      parameter verification fails,
- *                      MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED if decryption
- *                      expected a full block but was not provided one,
- *                      MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding
- *                      while decrypting or a cipher specific error code.
- */
-int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx,
-                   unsigned char *output, size_t *olen );
-
-#if defined(MBEDTLS_GCM_C)
-/**
- * \brief               Write tag for AEAD ciphers.
- *                      Currently only supported with GCM.
- *                      Must be called after mbedtls_cipher_finish().
- *
- * \param ctx           Generic cipher context
- * \param tag           buffer to write the tag
- * \param tag_len       Length of the tag to write
- *
- * \return              0 on success, or a specific error code.
- */
-int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx,
-                      unsigned char *tag, size_t tag_len );
-
-/**
- * \brief               Check tag for AEAD ciphers.
- *                      Currently only supported with GCM.
- *                      Must be called after mbedtls_cipher_finish().
- *
- * \param ctx           Generic cipher context
- * \param tag           Buffer holding the tag
- * \param tag_len       Length of the tag to check
- *
- * \return              0 on success, or a specific error code.
- */
-int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx,
-                      const unsigned char *tag, size_t tag_len );
-#endif /* MBEDTLS_GCM_C */
-
-/**
- * \brief               Generic all-in-one encryption/decryption
- *                      (for all ciphers except AEAD constructs).
- *
- * \param ctx           generic cipher context
- * \param iv            IV to use (or NONCE_COUNTER for CTR-mode ciphers)
- * \param iv_len        IV length for ciphers with variable-size IV;
- *                      discarded by ciphers with fixed-size IV.
- * \param input         buffer holding the input data
- * \param ilen          length of the input data
- * \param output        buffer for the output data. Should be able to hold at
- *                      least ilen + block_size. Cannot be the same buffer as
- *                      input!
- * \param olen          length of the output data, will be filled with the
- *                      actual number of bytes written.
- *
- * \note                Some ciphers don't use IVs nor NONCE. For these
- *                      ciphers, use iv = NULL and iv_len = 0.
- *
- * \returns             0 on success, or
- *                      MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA, or
- *                      MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED if decryption
- *                      expected a full block but was not provided one, or
- *                      MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding
- *                      while decrypting, or
- *                      a cipher specific error code.
- */
-int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx,
-                  const unsigned char *iv, size_t iv_len,
-                  const unsigned char *input, size_t ilen,
-                  unsigned char *output, size_t *olen );
-
-#if defined(MBEDTLS_CIPHER_MODE_AEAD)
-/**
- * \brief               Generic autenticated encryption (AEAD ciphers).
- *
- * \param ctx           generic cipher context
- * \param iv            IV to use (or NONCE_COUNTER for CTR-mode ciphers)
- * \param iv_len        IV length for ciphers with variable-size IV;
- *                      discarded by ciphers with fixed-size IV.
- * \param ad            Additional data to authenticate.
- * \param ad_len        Length of ad.
- * \param input         buffer holding the input data
- * \param ilen          length of the input data
- * \param output        buffer for the output data.
- *                      Should be able to hold at least ilen.
- * \param olen          length of the output data, will be filled with the
- *                      actual number of bytes written.
- * \param tag           buffer for the authentication tag
- * \param tag_len       desired tag length
- *
- * \returns             0 on success, or
- *                      MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA, or
- *                      a cipher specific error code.
- */
-int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx,
-                         const unsigned char *iv, size_t iv_len,
-                         const unsigned char *ad, size_t ad_len,
-                         const unsigned char *input, size_t ilen,
-                         unsigned char *output, size_t *olen,
-                         unsigned char *tag, size_t tag_len );
-
-/**
- * \brief               Generic autenticated decryption (AEAD ciphers).
- *
- * \param ctx           generic cipher context
- * \param iv            IV to use (or NONCE_COUNTER for CTR-mode ciphers)
- * \param iv_len        IV length for ciphers with variable-size IV;
- *                      discarded by ciphers with fixed-size IV.
- * \param ad            Additional data to be authenticated.
- * \param ad_len        Length of ad.
- * \param input         buffer holding the input data
- * \param ilen          length of the input data
- * \param output        buffer for the output data.
- *                      Should be able to hold at least ilen.
- * \param olen          length of the output data, will be filled with the
- *                      actual number of bytes written.
- * \param tag           buffer holding the authentication tag
- * \param tag_len       length of the authentication tag
- *
- * \returns             0 on success, or
- *                      MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA, or
- *                      MBEDTLS_ERR_CIPHER_AUTH_FAILED if data isn't authentic,
- *                      or a cipher specific error code.
- *
- * \note                If the data is not authentic, then the output buffer
- *                      is zeroed out to prevent the unauthentic plaintext to
- *                      be used by mistake, making this interface safer.
- */
-int mbedtls_cipher_auth_decrypt( mbedtls_cipher_context_t *ctx,
-                         const unsigned char *iv, size_t iv_len,
-                         const unsigned char *ad, size_t ad_len,
-                         const unsigned char *input, size_t ilen,
-                         unsigned char *output, size_t *olen,
-                         const unsigned char *tag, size_t tag_len );
-#endif /* MBEDTLS_CIPHER_MODE_AEAD */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MBEDTLS_CIPHER_H */

+ 0 - 82
iotkit-embedded/src/import/ubuntu/include/itls/config.h

@@ -1,82 +0,0 @@
-/**
- * \file config.h
- *
- * \brief Configuration options (set of defines)
- *
- *  This set of compile-time options may be used to enable
- *  or disable features selectively, and reduce the global
- *  memory footprint.
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-
-#ifndef MBEDTLS_CONFIG_H
-#define MBEDTLS_CONFIG_H
-
-/* System support */
-#define MBEDTLS_HAVE_ASM
-#define MBEDTLS_HAVE_TIME
-#define MBEDTLS_PLATFORM_C
-#define MBEDTLS_PLATFORM_ALT
-
-/* mbed TLS feature support */
-#define MBEDTLS_CIPHER_MODE_CBC
-#define MBEDTLS_SSL_PROTO_TLS1_2
-#define MBEDTLS_THREADING_C
-#define MBEDTLS_THREADING_PTHREAD
-//#define MBEDTLS_THREADING_ALT
-
-/* mbed TLS modules */
-#define MBEDTLS_AES_C
-#define MBEDTLS_CIPHER_C
-#define MBEDTLS_MD_C
-#define MBEDTLS_MD5_C
-#define MBEDTLS_NET_C
-#define MBEDTLS_SHA1_C
-#define MBEDTLS_SHA256_C
-#define MBEDTLS_SSL_CLI_C
-#define MBEDTLS_SSL_TLS_C
-
-/* mbed DTLS modules */
-#define MBEDTLS_TIMING_C
-#define MBEDTLS_SSL_COOKIE_C
-#define MBEDTLS_SSL_PROTO_DTLS
-#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
-
-/* iTLS modules */
-#define MBEDTLS_SSL_PROTO_ITLS
-#define MBEDTLS_KEY_EXCHANGE_ID2_ENABLED
-
-/* mbed TLS debug */
-#define MBEDTLS_DEBUG_C
-
-/* OEM configure */
-//#define MBEDTLS_AES_ALT
-//#define MBEDTLS_NET_ALT
-
-/* iTLS Test */
-//#define MBEDTLS_MEM_TEST
-//#define MBEDTLS_TIME_TEST
-//#define MBEDTLS_SSL_PROTO_ITLS_TEST
-//#define MBEDTLS_SSL_PROTO_ITLS_TEST_EXT
-
-#define MBEDTLS_SSL_MAX_CONTENT_LEN    (4 * 512)    /* Size of the input / output buffer */
-
-#include "itls/check_config.h"
-
-#endif /* MBEDTLS_CONFIG_H */

+ 0 - 228
iotkit-embedded/src/import/ubuntu/include/itls/debug.h

@@ -1,228 +0,0 @@
-/**
- * \file debug.h
- *
- * \brief Functions for controlling and providing debug output from the library.
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_DEBUG_H
-#define MBEDTLS_DEBUG_H
-
-#if !defined(MBEDTLS_CONFIG_FILE)
-#include "config.h"
-#else
-#include MBEDTLS_CONFIG_FILE
-#endif
-
-#include "ssl.h"
-
-#if defined(MBEDTLS_ECP_C)
-#include "ecp.h"
-#endif
-
-#if defined(MBEDTLS_DEBUG_C)
-
-#define MBEDTLS_DEBUG_STRIP_PARENS( ... )   __VA_ARGS__
-
-#define MBEDTLS_SSL_DEBUG_MSG( level, args )                    \
-    mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__,    \
-                             MBEDTLS_DEBUG_STRIP_PARENS args )
-
-#define MBEDTLS_SSL_DEBUG_RET( level, text, ret )                \
-    mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )
-
-#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len )           \
-    mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )
-
-#if defined(MBEDTLS_BIGNUM_C)
-#define MBEDTLS_SSL_DEBUG_MPI( level, text, X )                  \
-    mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )
-#endif
-
-#if defined(MBEDTLS_ECP_C)
-#define MBEDTLS_SSL_DEBUG_ECP( level, text, X )                  \
-    mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt )                \
-    mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )
-#endif
-
-#else /* MBEDTLS_DEBUG_C */
-
-#define MBEDTLS_SSL_DEBUG_MSG( level, args )            do { } while( 0 )
-#define MBEDTLS_SSL_DEBUG_RET( level, text, ret )       do { } while( 0 )
-#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len )  do { } while( 0 )
-#define MBEDTLS_SSL_DEBUG_MPI( level, text, X )         do { } while( 0 )
-#define MBEDTLS_SSL_DEBUG_ECP( level, text, X )         do { } while( 0 )
-#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt )       do { } while( 0 )
-
-#endif /* MBEDTLS_DEBUG_C */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \brief   Set the threshold error level to handle globally all debug output.
- *          Debug messages that have a level over the threshold value are
- *          discarded.
- *          (Default value: 0 = No debug )
- *
- * \param threshold     theshold level of messages to filter on. Messages at a
- *                      higher level will be discarded.
- *                          - Debug levels
- *                              - 0 No debug
- *                              - 1 Error
- *                              - 2 State change
- *                              - 3 Informational
- *                              - 4 Verbose
- */
-void mbedtls_debug_set_threshold( int threshold );
-
-/**
- * \brief    Print a message to the debug output. This function is always used
- *          through the MBEDTLS_SSL_DEBUG_MSG() macro, which supplies the ssl
- *          context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the message has occurred in
- * \param line      line number the message has occurred at
- * \param format    format specifier, in printf format
- * \param ...       variables used by the format specifier
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level,
-                              const char *file, int line,
-                              const char *format, ... );
-
-/**
- * \brief   Print the return value of a function to the debug output. This
- *          function is always used through the MBEDTLS_SSL_DEBUG_RET() macro,
- *          which supplies the ssl context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the error has occurred in
- * \param line      line number the error has occurred in
- * \param text      the name of the function that returned the error
- * \param ret       the return code value
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
-                      const char *file, int line,
-                      const char *text, int ret );
-
-/**
- * \brief   Output a buffer of size len bytes to the debug output. This function
- *          is always used through the MBEDTLS_SSL_DEBUG_BUF() macro,
- *          which supplies the ssl context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the error has occurred in
- * \param line      line number the error has occurred in
- * \param text      a name or label for the buffer being dumped. Normally the
- *                  variable or buffer name
- * \param buf       the buffer to be outputted
- * \param len       length of the buffer
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level,
-                      const char *file, int line, const char *text,
-                      const unsigned char *buf, size_t len );
-
-#if defined(MBEDTLS_BIGNUM_C)
-/**
- * \brief   Print a MPI variable to the debug output. This function is always
- *          used through the MBEDTLS_SSL_DEBUG_MPI() macro, which supplies the
- *          ssl context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the error has occurred in
- * \param line      line number the error has occurred in
- * \param text      a name or label for the MPI being output. Normally the
- *                  variable name
- * \param X         the MPI variable
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level,
-                      const char *file, int line,
-                      const char *text, const mbedtls_mpi *X );
-#endif
-
-#if defined(MBEDTLS_ECP_C)
-/**
- * \brief   Print an ECP point to the debug output. This function is always
- *          used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the
- *          ssl context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the error has occurred in
- * \param line      line number the error has occurred in
- * \param text      a name or label for the ECP point being output. Normally the
- *                  variable name
- * \param X         the ECP point
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level,
-                      const char *file, int line,
-                      const char *text, const mbedtls_ecp_point *X );
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-/**
- * \brief   Print a X.509 certificate structure to the debug output. This
- *          function is always used through the MBEDTLS_SSL_DEBUG_CRT() macro,
- *          which supplies the ssl context, file and line number parameters.
- *
- * \param ssl       SSL context
- * \param level     error level of the debug message
- * \param file      file the error has occurred in
- * \param line      line number the error has occurred in
- * \param text      a name or label for the certificate being output
- * \param crt       X.509 certificate structure
- *
- * \attention       This function is intended for INTERNAL usage within the
- *                  library only.
- */
-void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level,
-                      const char *file, int line,
-                      const char *text, const mbedtls_x509_crt *crt );
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* debug.h */
-

+ 0 - 37
iotkit-embedded/src/import/ubuntu/include/itls/mbedtls_auth.h

@@ -1,37 +0,0 @@
-/**
- * Copyright (C) 2017 The YunOS IoT Project. All rights reserved.
- */
-
-#ifndef MBEDTLS_AUTH_H
-#define MBEDTLS_AUTH_H
-
-#include <stdint.h>
-#include <stdio.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Key Groups */
-#define MBEDTLS_KEY_GROUP_ALIBABA_ID2    (0x10001000)
-
-int mbedtls_write_auth_extra_ext(
-        mbedtls_ssl_context *ssl, unsigned char *buf, size_t *olen);
-
-int mbedtls_write_key_id_ext(
-        mbedtls_ssl_context *ssl, unsigned char *buf, size_t *olen);
-
-int mbedtls_write_auth_code_ext(
-        mbedtls_ssl_context *ssl, unsigned char *buf, size_t *olen);
-
-int mbedtls_parse_auth_code_ext(
-        mbedtls_ssl_context *ssl, unsigned char *buf, size_t len);
-
-int mbedtls_parse_pre_master_secret_ext(
-        mbedtls_ssl_context *ssl, unsigned char *buf, size_t len);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MBEDTLS_AUTH_H */

+ 0 - 354
iotkit-embedded/src/import/ubuntu/include/itls/md.h

@@ -1,354 +0,0 @@
-/**
- * \file md.h
- *
- * \brief Generic message digest wrapper
- *
- * \author Adriaan de Jong <dejong@fox-it.com>
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_MD_H
-#define MBEDTLS_MD_H
-
-#include <stddef.h>
-
-#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE                -0x5080  /**< The selected feature is not available. */
-#define MBEDTLS_ERR_MD_BAD_INPUT_DATA                     -0x5100  /**< Bad input parameters to function. */
-#define MBEDTLS_ERR_MD_ALLOC_FAILED                       -0x5180  /**< Failed to allocate memory. */
-#define MBEDTLS_ERR_MD_FILE_IO_ERROR                      -0x5200  /**< Opening or reading of file failed. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-    MBEDTLS_MD_NONE=0,
-    MBEDTLS_MD_MD2,
-    MBEDTLS_MD_MD4,
-    MBEDTLS_MD_MD5,
-    MBEDTLS_MD_SHA1,
-    MBEDTLS_MD_SHA224,
-    MBEDTLS_MD_SHA256,
-    MBEDTLS_MD_SHA384,
-    MBEDTLS_MD_SHA512,
-    MBEDTLS_MD_RIPEMD160,
-} mbedtls_md_type_t;
-
-#if defined(MBEDTLS_SHA512_C)
-#define MBEDTLS_MD_MAX_SIZE         64  /* longest known is SHA512 */
-#else
-#define MBEDTLS_MD_MAX_SIZE         32  /* longest known is SHA256 or less */
-#endif
-
-/**
- * Opaque struct defined in md_internal.h
- */
-typedef struct mbedtls_md_info_t mbedtls_md_info_t;
-
-/**
- * Generic message digest context.
- */
-typedef struct {
-    /** Information about the associated message digest */
-    const mbedtls_md_info_t *md_info;
-
-    /** Digest-specific context */
-    void *md_ctx;
-
-    /** HMAC part of the context */
-    void *hmac_ctx;
-} mbedtls_md_context_t;
-
-/**
- * \brief Returns the list of digests supported by the generic digest module.
- *
- * \return          a statically allocated array of digests, the last entry
- *                  is 0.
- */
-const int *mbedtls_md_list( void );
-
-/**
- * \brief           Returns the message digest information associated with the
- *                  given digest name.
- *
- * \param md_name   Name of the digest to search for.
- *
- * \return          The message digest information associated with md_name or
- *                  NULL if not found.
- */
-const mbedtls_md_info_t *mbedtls_md_info_from_string( const char *md_name );
-
-/**
- * \brief           Returns the message digest information associated with the
- *                  given digest type.
- *
- * \param md_type   type of digest to search for.
- *
- * \return          The message digest information associated with md_type or
- *                  NULL if not found.
- */
-const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type );
-
-/**
- * \brief           Initialize a md_context (as NONE)
- *                  This should always be called first.
- *                  Prepares the context for mbedtls_md_setup() or mbedtls_md_free().
- */
-void mbedtls_md_init( mbedtls_md_context_t *ctx );
-
-/**
- * \brief           Free and clear the internal structures of ctx.
- *                  Can be called at any time after mbedtls_md_init().
- *                  Mandatory once mbedtls_md_setup() has been called.
- */
-void mbedtls_md_free( mbedtls_md_context_t *ctx );
-
-#if ! defined(MBEDTLS_DEPRECATED_REMOVED)
-#if defined(MBEDTLS_DEPRECATED_WARNING)
-#define MBEDTLS_DEPRECATED    __attribute__((deprecated))
-#else
-#define MBEDTLS_DEPRECATED
-#endif
-/**
- * \brief           Select MD to use and allocate internal structures.
- *                  Should be called after mbedtls_md_init() or mbedtls_md_free().
- *                  Makes it necessary to call mbedtls_md_free() later.
- *
- * \deprecated      Superseded by mbedtls_md_setup() in 2.0.0
- *
- * \param ctx       Context to set up.
- * \param md_info   Message digest to use.
- *
- * \returns         \c 0 on success,
- *                  \c MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter failure,
- *                  \c MBEDTLS_ERR_MD_ALLOC_FAILED memory allocation failure.
- */
-int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPRECATED;
-#undef MBEDTLS_DEPRECATED
-#endif /* MBEDTLS_DEPRECATED_REMOVED */
-
-/**
- * \brief           Select MD to use and allocate internal structures.
- *                  Should be called after mbedtls_md_init() or mbedtls_md_free().
- *                  Makes it necessary to call mbedtls_md_free() later.
- *
- * \param ctx       Context to set up.
- * \param md_info   Message digest to use.
- * \param hmac      0 to save some memory if HMAC will not be used,
- *                  non-zero is HMAC is going to be used with this context.
- *
- * \returns         \c 0 on success,
- *                  \c MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter failure,
- *                  \c MBEDTLS_ERR_MD_ALLOC_FAILED memory allocation failure.
- */
-int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
-
-/**
- * \brief           Clone the state of an MD context
- *
- * \note            The two contexts must have been setup to the same type
- *                  (cloning from SHA-256 to SHA-512 make no sense).
- *
- * \warning         Only clones the MD state, not the HMAC state! (for now)
- *
- * \param dst       The destination context
- * \param src       The context to be cloned
- *
- * \return          \c 0 on success,
- *                  \c MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter failure.
- */
-int mbedtls_md_clone( mbedtls_md_context_t *dst,
-                      const mbedtls_md_context_t *src );
-
-/**
- * \brief           Returns the size of the message digest output.
- *
- * \param md_info   message digest info
- *
- * \return          size of the message digest output in bytes.
- */
-unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
-
-/**
- * \brief           Returns the type of the message digest output.
- *
- * \param md_info   message digest info
- *
- * \return          type of the message digest output.
- */
-mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
-
-/**
- * \brief           Returns the name of the message digest output.
- *
- * \param md_info   message digest info
- *
- * \return          name of the message digest output.
- */
-const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
-
-/**
- * \brief           Prepare the context to digest a new message.
- *                  Generally called after mbedtls_md_setup() or mbedtls_md_finish().
- *                  Followed by mbedtls_md_update().
- *
- * \param ctx       generic message digest context.
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_starts( mbedtls_md_context_t *ctx );
-
-/**
- * \brief           Generic message digest process buffer
- *                  Called between mbedtls_md_starts() and mbedtls_md_finish().
- *                  May be called repeatedly.
- *
- * \param ctx       Generic message digest context
- * \param input     buffer holding the  datal
- * \param ilen      length of the input data
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen );
-
-/**
- * \brief           Generic message digest final digest
- *                  Called after mbedtls_md_update().
- *                  Usually followed by mbedtls_md_free() or mbedtls_md_starts().
- *
- * \param ctx       Generic message digest context
- * \param output    Generic message digest checksum result
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_finish( mbedtls_md_context_t *ctx, unsigned char *output );
-
-/**
- * \brief          Output = message_digest( input buffer )
- *
- * \param md_info  message digest info
- * \param input    buffer holding the  data
- * \param ilen     length of the input data
- * \param output   Generic message digest checksum result
- *
- * \returns        0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                 verification fails.
- */
-int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
-        unsigned char *output );
-
-#if defined(MBEDTLS_FS_IO)
-/**
- * \brief          Output = message_digest( file contents )
- *
- * \param md_info  message digest info
- * \param path     input file name
- * \param output   generic message digest checksum result
- *
- * \return         0 if successful,
- *                 MBEDTLS_ERR_MD_FILE_IO_ERROR if file input failed,
- *                 MBEDTLS_ERR_MD_BAD_INPUT_DATA if md_info was NULL.
- */
-int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
-                     unsigned char *output );
-#endif /* MBEDTLS_FS_IO */
-
-/**
- * \brief           Set HMAC key and prepare to authenticate a new message.
- *                  Usually called after mbedtls_md_setup() or mbedtls_md_hmac_finish().
- *
- * \param ctx       HMAC context
- * \param key       HMAC secret key
- * \param keylen    length of the HMAC key in bytes
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key,
-                    size_t keylen );
-
-/**
- * \brief           Generic HMAC process buffer.
- *                  Called between mbedtls_md_hmac_starts() or mbedtls_md_hmac_reset()
- *                  and mbedtls_md_hmac_finish().
- *                  May be called repeatedly.
- *
- * \param ctx       HMAC context
- * \param input     buffer holding the  data
- * \param ilen      length of the input data
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input,
-                    size_t ilen );
-
-/**
- * \brief           Output HMAC.
- *                  Called after mbedtls_md_hmac_update().
- *                  Usually followed by mbedtls_md_hmac_reset(),
- *                  mbedtls_md_hmac_starts(), or mbedtls_md_free().
- *
- * \param ctx       HMAC context
- * \param output    Generic HMAC checksum result
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_hmac_finish( mbedtls_md_context_t *ctx, unsigned char *output);
-
-/**
- * \brief           Prepare to authenticate a new message with the same key.
- *                  Called after mbedtls_md_hmac_finish() and before
- *                  mbedtls_md_hmac_update().
- *
- * \param ctx       HMAC context to be reset
- *
- * \returns         0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                  verification fails.
- */
-int mbedtls_md_hmac_reset( mbedtls_md_context_t *ctx );
-
-/**
- * \brief          Output = Generic_HMAC( hmac key, input buffer )
- *
- * \param md_info  message digest info
- * \param key      HMAC secret key
- * \param keylen   length of the HMAC key in bytes
- * \param input    buffer holding the  data
- * \param ilen     length of the input data
- * \param output   Generic HMAC-result
- *
- * \returns        0 on success, MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter
- *                 verification fails.
- */
-int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
-                const unsigned char *input, size_t ilen,
-                unsigned char *output );
-
-/* Internal use */
-int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MBEDTLS_MD_H */

+ 0 - 31
iotkit-embedded/src/import/ubuntu/include/itls/net.h

@@ -1,31 +0,0 @@
-/**
- * \file net.h
- *
- * \brief Deprecated header file that includes itls/net_sockets.h
- *
- *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- *
- * \deprecated Superseded by itls/net_sockets.h
- */
-
-#if !defined(MBEDTLS_DEPRECATED_REMOVED)
-#include "itls/net_sockets.h"
-#if defined(MBEDTLS_DEPRECATED_WARNING)
-#warning "Deprecated header file: Superseded by itls/net_sockets.h"
-#endif /* MBEDTLS_DEPRECATED_WARNING */
-#endif /* !MBEDTLS_DEPRECATED_REMOVED */

+ 0 - 225
iotkit-embedded/src/import/ubuntu/include/itls/net_sockets.h

@@ -1,225 +0,0 @@
-/**
- * \file net_sockets.h
- *
- * \brief Network communication functions
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_NET_SOCKETS_H
-#define MBEDTLS_NET_SOCKETS_H
-
-#if !defined(MBEDTLS_CONFIG_FILE)
-#include "config.h"
-#else
-#include MBEDTLS_CONFIG_FILE
-#endif
-
-#include "ssl.h"
-
-#include <stddef.h>
-#include <stdint.h>
-
-#define MBEDTLS_ERR_NET_SOCKET_FAILED                     -0x0042  /**< Failed to open a socket. */
-#define MBEDTLS_ERR_NET_CONNECT_FAILED                    -0x0044  /**< The connection to the given server / port failed. */
-#define MBEDTLS_ERR_NET_BIND_FAILED                       -0x0046  /**< Binding of the socket failed. */
-#define MBEDTLS_ERR_NET_LISTEN_FAILED                     -0x0048  /**< Could not listen on the socket. */
-#define MBEDTLS_ERR_NET_ACCEPT_FAILED                     -0x004A  /**< Could not accept the incoming connection. */
-#define MBEDTLS_ERR_NET_RECV_FAILED                       -0x004C  /**< Reading information from the socket failed. */
-#define MBEDTLS_ERR_NET_SEND_FAILED                       -0x004E  /**< Sending information through the socket failed. */
-#define MBEDTLS_ERR_NET_CONN_RESET                        -0x0050  /**< Connection was reset by peer. */
-#define MBEDTLS_ERR_NET_UNKNOWN_HOST                      -0x0052  /**< Failed to get an IP address for the given hostname. */
-#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                  -0x0043  /**< Buffer is too small to hold the data. */
-#define MBEDTLS_ERR_NET_INVALID_CONTEXT                   -0x0045  /**< The context is invalid, eg because it was free()ed. */
-
-#define MBEDTLS_NET_LISTEN_BACKLOG         10 /**< The backlog that listen() should use. */
-
-#define MBEDTLS_NET_PROTO_TCP 0 /**< The TCP transport protocol */
-#define MBEDTLS_NET_PROTO_UDP 1 /**< The UDP transport protocol */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Wrapper type for sockets.
- *
- * Currently backed by just a file descriptor, but might be more in the future
- * (eg two file descriptors for combined IPv4 + IPv6 support, or additional
- * structures for hand-made UDP demultiplexing).
- */
-typedef struct
-{
-    int fd;             /**< The underlying file descriptor                 */
-}
-mbedtls_net_context;
-
-/**
- * \brief          Initialize a context
- *                 Just makes the context ready to be used or freed safely.
- *
- * \param ctx      Context to initialize
- */
-void mbedtls_net_init( mbedtls_net_context *ctx );
-
-/**
- * \brief          Initiate a connection with host:port in the given protocol
- *
- * \param ctx      Socket to use
- * \param host     Host to connect to
- * \param port     Port to connect to
- * \param proto    Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP
- *
- * \return         0 if successful, or one of:
- *                      MBEDTLS_ERR_NET_SOCKET_FAILED,
- *                      MBEDTLS_ERR_NET_UNKNOWN_HOST,
- *                      MBEDTLS_ERR_NET_CONNECT_FAILED
- *
- * \note           Sets the socket in connected mode even with UDP.
- */
-int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto );
-
-/**
- * \brief          Create a receiving socket on bind_ip:port in the chosen
- *                 protocol. If bind_ip == NULL, all interfaces are bound.
- *
- * \param ctx      Socket to use
- * \param bind_ip  IP to bind to, can be NULL
- * \param port     Port number to use
- * \param proto    Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP
- *
- * \return         0 if successful, or one of:
- *                      MBEDTLS_ERR_NET_SOCKET_FAILED,
- *                      MBEDTLS_ERR_NET_BIND_FAILED,
- *                      MBEDTLS_ERR_NET_LISTEN_FAILED
- *
- * \note           Regardless of the protocol, opens the sockets and binds it.
- *                 In addition, make the socket listening if protocol is TCP.
- */
-int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto );
-
-/**
- * \brief           Accept a connection from a remote client
- *
- * \param bind_ctx  Relevant socket
- * \param client_ctx Will contain the connected client socket
- * \param client_ip Will contain the client IP address
- * \param buf_size  Size of the client_ip buffer
- * \param ip_len    Will receive the size of the client IP written
- *
- * \return          0 if successful, or
- *                  MBEDTLS_ERR_NET_ACCEPT_FAILED, or
- *                  MBEDTLS_ERR_NET_BUFFER_TOO_SMALL if buf_size is too small,
- *                  MBEDTLS_ERR_SSL_WANT_READ if bind_fd was set to
- *                  non-blocking and accept() would block.
- */
-int mbedtls_net_accept( mbedtls_net_context *bind_ctx,
-                        mbedtls_net_context *client_ctx,
-                        void *client_ip, size_t buf_size, size_t *ip_len );
-
-/**
- * \brief          Set the socket blocking
- *
- * \param ctx      Socket to set
- *
- * \return         0 if successful, or a non-zero error code
- */
-int mbedtls_net_set_block( mbedtls_net_context *ctx );
-
-/**
- * \brief          Set the socket non-blocking
- *
- * \param ctx      Socket to set
- *
- * \return         0 if successful, or a non-zero error code
- */
-int mbedtls_net_set_nonblock( mbedtls_net_context *ctx );
-
-/**
- * \brief          Portable usleep helper
- *
- * \param usec     Amount of microseconds to sleep
- *
- * \note           Real amount of time slept will not be less than
- *                 select()'s timeout granularity (typically, 10ms).
- */
-void mbedtls_net_usleep( unsigned long usec );
-
-/**
- * \brief          Read at most 'len' characters. If no error occurs,
- *                 the actual amount read is returned.
- *
- * \param ctx      Socket
- * \param buf      The buffer to write to
- * \param len      Maximum length of the buffer
- *
- * \return         the number of bytes received,
- *                 or a non-zero error code; with a non-blocking socket,
- *                 MBEDTLS_ERR_SSL_WANT_READ indicates read() would block.
- */
-int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len );
-
-/**
- * \brief          Write at most 'len' characters. If no error occurs,
- *                 the actual amount read is returned.
- *
- * \param ctx      Socket
- * \param buf      The buffer to read from
- * \param len      The length of the buffer
- *
- * \return         the number of bytes sent,
- *                 or a non-zero error code; with a non-blocking socket,
- *                 MBEDTLS_ERR_SSL_WANT_WRITE indicates write() would block.
- */
-int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len );
-
-/**
- * \brief          Read at most 'len' characters, blocking for at most
- *                 'timeout' seconds. If no error occurs, the actual amount
- *                 read is returned.
- *
- * \param ctx      Socket
- * \param buf      The buffer to write to
- * \param len      Maximum length of the buffer
- * \param timeout  Maximum number of milliseconds to wait for data
- *                 0 means no timeout (wait forever)
- *
- * \return         the number of bytes received,
- *                 or a non-zero error code:
- *                 MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out,
- *                 MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.
- *
- * \note           This function will block (until data becomes available or
- *                 timeout is reached) even if the socket is set to
- *                 non-blocking. Handling timeouts with non-blocking reads
- *                 requires a different strategy.
- */
-int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len,
-                      uint32_t timeout );
-
-/**
- * \brief          Gracefully shutdown the connection and free associated data
- *
- * \param ctx      The context to free
- */
-void mbedtls_net_free( mbedtls_net_context *ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* net_sockets.h */

+ 0 - 351
iotkit-embedded/src/import/ubuntu/include/itls/platform.h

@@ -1,351 +0,0 @@
-/**
- * \file platform.h
- *
- * \brief mbed TLS Platform abstraction layer
- *
- *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_PLATFORM_H
-#define MBEDTLS_PLATFORM_H
-
-#if !defined(MBEDTLS_CONFIG_FILE)
-#include "config.h"
-#else
-#include MBEDTLS_CONFIG_FILE
-#endif
-
-#if !defined(MBEDTLS_PLATFORM_ALT)
-
-#if defined(MBEDTLS_HAVE_TIME)
-#include "itls/platform_time.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \name SECTION: Module settings
- *
- * The configuration options you can set for this module are in this section.
- * Either change them in config.h or define them on the compiler command line.
- * \{
- */
-
-#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS)
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF)
-#if defined(_WIN32)
-#define MBEDTLS_PLATFORM_STD_SNPRINTF   mbedtls_platform_win32_snprintf /**< Default snprintf to use  */
-#else
-#define MBEDTLS_PLATFORM_STD_SNPRINTF   snprintf /**< Default snprintf to use  */
-#endif
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_PRINTF)
-#define MBEDTLS_PLATFORM_STD_PRINTF   printf /**< Default printf to use  */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF)
-#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
-#define MBEDTLS_PLATFORM_STD_CALLOC   calloc /**< Default allocator to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_FREE)
-#define MBEDTLS_PLATFORM_STD_FREE       free /**< Default free to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_EXIT)
-#define MBEDTLS_PLATFORM_STD_EXIT      exit /**< Default exit to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_TIME)
-#define MBEDTLS_PLATFORM_STD_TIME       time    /**< Default time to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS)
-#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS  EXIT_SUCCESS /**< Default exit value to use */
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE)
-#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE  EXIT_FAILURE /**< Default exit value to use */
-#endif
-#if defined(MBEDTLS_FS_IO)
-#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ)
-#define MBEDTLS_PLATFORM_STD_NV_SEED_READ   mbedtls_platform_std_nv_seed_read
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE)
-#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE  mbedtls_platform_std_nv_seed_write
-#endif
-#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE)
-#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE   "seedfile"
-#endif
-#endif /* MBEDTLS_FS_IO */
-#else /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */
-#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR)
-#include MBEDTLS_PLATFORM_STD_MEM_HDR
-#endif
-#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */
-
-
-/* \} name SECTION: Module settings */
-
-/*
- * The function pointers for calloc and free
- */
-#if defined(MBEDTLS_PLATFORM_MEMORY)
-#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && \
-    defined(MBEDTLS_PLATFORM_CALLOC_MACRO)
-#define mbedtls_free       MBEDTLS_PLATFORM_FREE_MACRO
-#define mbedtls_calloc     MBEDTLS_PLATFORM_CALLOC_MACRO
-#else
-/* For size_t */
-#include <stddef.h>
-extern void * (*mbedtls_calloc)( size_t n, size_t size );
-extern void (*mbedtls_free)( void *ptr );
-
-/**
- * \brief   Set your own memory implementation function pointers
- *
- * \param calloc_func   the calloc function implementation
- * \param free_func     the free function implementation
- *
- * \return              0 if successful
- */
-int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ),
-                              void (*free_func)( void * ) );
-#endif /* MBEDTLS_PLATFORM_FREE_MACRO && MBEDTLS_PLATFORM_CALLOC_MACRO */
-#else /* !MBEDTLS_PLATFORM_MEMORY */
-#define mbedtls_free       free
-#define mbedtls_calloc     calloc
-#endif /* MBEDTLS_PLATFORM_MEMORY && !MBEDTLS_PLATFORM_{FREE,CALLOC}_MACRO */
-
-/*
- * The function pointers for fprintf
- */
-#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT)
-/* We need FILE * */
-#include <stdio.h>
-extern int (*mbedtls_fprintf)( FILE *stream, const char *format, ... );
-
-/**
- * \brief   Set your own fprintf function pointer
- *
- * \param fprintf_func   the fprintf function implementation
- *
- * \return              0
- */
-int mbedtls_platform_set_fprintf( int (*fprintf_func)( FILE *stream, const char *,
-                                               ... ) );
-#else
-#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO)
-#define mbedtls_fprintf    MBEDTLS_PLATFORM_FPRINTF_MACRO
-#else
-#define mbedtls_fprintf    fprintf
-#endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */
-#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */
-
-/*
- * The function pointers for printf
- */
-#if defined(MBEDTLS_PLATFORM_PRINTF_ALT)
-extern int (*mbedtls_printf)( const char *format, ... );
-
-/**
- * \brief   Set your own printf function pointer
- *
- * \param printf_func   the printf function implementation
- *
- * \return              0
- */
-int mbedtls_platform_set_printf( int (*printf_func)( const char *, ... ) );
-#else /* !MBEDTLS_PLATFORM_PRINTF_ALT */
-#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO)
-#define mbedtls_printf     MBEDTLS_PLATFORM_PRINTF_MACRO
-#else
-#define mbedtls_printf     printf
-#endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */
-#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */
-
-/*
- * The function pointers for snprintf
- *
- * The snprintf implementation should conform to C99:
- * - it *must* always correctly zero-terminate the buffer
- *   (except when n == 0, then it must leave the buffer untouched)
- * - however it is acceptable to return -1 instead of the required length when
- *   the destination buffer is too short.
- */
-#if defined(_WIN32)
-/* For Windows (inc. MSYS2), we provide our own fixed implementation */
-int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... );
-#endif
-
-#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT)
-extern int (*mbedtls_snprintf)( char * s, size_t n, const char * format, ... );
-
-/**
- * \brief   Set your own snprintf function pointer
- *
- * \param snprintf_func   the snprintf function implementation
- *
- * \return              0
- */
-int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n,
-                                                 const char * format, ... ) );
-#else /* MBEDTLS_PLATFORM_SNPRINTF_ALT */
-#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
-#define mbedtls_snprintf   MBEDTLS_PLATFORM_SNPRINTF_MACRO
-#else
-#define mbedtls_snprintf   snprintf
-#endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */
-#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */
-
-/*
- * The function pointers for exit
- */
-#if defined(MBEDTLS_PLATFORM_EXIT_ALT)
-extern void (*mbedtls_exit)( int status );
-
-/**
- * \brief   Set your own exit function pointer
- *
- * \param exit_func   the exit function implementation
- *
- * \return              0
- */
-int mbedtls_platform_set_exit( void (*exit_func)( int status ) );
-#else
-#if defined(MBEDTLS_PLATFORM_EXIT_MACRO)
-#define mbedtls_exit   MBEDTLS_PLATFORM_EXIT_MACRO
-#else
-#define mbedtls_exit   exit
-#endif /* MBEDTLS_PLATFORM_EXIT_MACRO */
-#endif /* MBEDTLS_PLATFORM_EXIT_ALT */
-
-/*
- * The default exit values
- */
-#if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS)
-#define MBEDTLS_EXIT_SUCCESS MBEDTLS_PLATFORM_STD_EXIT_SUCCESS
-#else
-#define MBEDTLS_EXIT_SUCCESS 0
-#endif
-#if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE)
-#define MBEDTLS_EXIT_FAILURE MBEDTLS_PLATFORM_STD_EXIT_FAILURE
-#else
-#define MBEDTLS_EXIT_FAILURE 1
-#endif
-
-/*
- * The function pointers for reading from and writing a seed file to
- * Non-Volatile storage (NV) in a platform-independent way
- *
- * Only enabled when the NV seed entropy source is enabled
- */
-#if defined(MBEDTLS_ENTROPY_NV_SEED)
-#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO)
-/* Internal standard platform definitions */
-int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len );
-int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len );
-#endif
-
-#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT)
-extern int (*mbedtls_nv_seed_read)( unsigned char *buf, size_t buf_len );
-extern int (*mbedtls_nv_seed_write)( unsigned char *buf, size_t buf_len );
-
-/**
- * \brief   Set your own seed file writing/reading functions
- *
- * \param   nv_seed_read_func   the seed reading function implementation
- * \param   nv_seed_write_func  the seed writing function implementation
- *
- * \return              0
- */
-int mbedtls_platform_set_nv_seed(
-            int (*nv_seed_read_func)( unsigned char *buf, size_t buf_len ),
-            int (*nv_seed_write_func)( unsigned char *buf, size_t buf_len )
-            );
-#else
-#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) && \
-    defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO)
-#define mbedtls_nv_seed_read    MBEDTLS_PLATFORM_NV_SEED_READ_MACRO
-#define mbedtls_nv_seed_write   MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO
-#else
-#define mbedtls_nv_seed_read    mbedtls_platform_std_nv_seed_read
-#define mbedtls_nv_seed_write   mbedtls_platform_std_nv_seed_write
-#endif
-#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */
-#endif /* MBEDTLS_ENTROPY_NV_SEED */
-
-#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT)
-
-/**
- * \brief   Platform context structure
- *
- * \note    This structure may be used to assist platform-specific
- *          setup/teardown operations.
- */
-typedef struct {
-    char dummy; /**< Placeholder member as empty structs are not portable */
-}
-mbedtls_platform_context;
-
-#else
-#include "platform_alt.h"
-#endif /* !MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */
-
-/**
- * \brief   Perform any platform initialisation operations
- *
- * \param   ctx     mbed TLS context
- *
- * \return  0 if successful
- *
- * \note    This function is intended to allow platform specific initialisation,
- *          and should be called before any other library functions. Its
- *          implementation is platform specific, and by default, unless platform
- *          specific code is provided, it does nothing.
- *
- *          Its use and whether its necessary to be called is dependent on the
- *          platform.
- */
-int mbedtls_platform_setup( mbedtls_platform_context *ctx );
-/**
- * \brief   Perform any platform teardown operations
- *
- * \param   ctx     mbed TLS context
- *
- * \note    This function should be called after every other mbed TLS module has
- *          been correctly freed using the appropriate free function.
- *          Its implementation is platform specific, and by default, unless
- *          platform specific code is provided, it does nothing.
- *
- *          Its use and whether its necessary to be called is dependent on the
- *          platform.
- */
-void mbedtls_platform_teardown( mbedtls_platform_context *ctx );
-
-#ifdef __cplusplus
-}
-#endif
-
-#else  /* MBEDTLS_PLATFORM_ALT */
-
-#include "platform_alt.h"
-
-#endif /* MBEDTLS_PLATFORM_ALT */
-
-#endif /* platform.h */

+ 0 - 27
iotkit-embedded/src/import/ubuntu/include/itls/platform_alt.h

@@ -1,27 +0,0 @@
-/**
- * Copyright (C) 2018 The YunOS IoT Project. All rights reserved.
- */
-
-#ifndef MBEDTLS_PLATFORM_ALT_H
-#define MBEDTLS_PLATFORM_ALT_H
-
-#include <stdlib.h>
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define mbedtls_time       time
-#define mbedtls_snprintf   snprintf
-
-typedef time_t mbedtls_time_t;
-
-void *mbedtls_calloc( size_t n, size_t size );
-void mbedtls_free( void *ptr );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MBEDTLS_PLATFORM_ALT_H */

+ 0 - 2622
iotkit-embedded/src/import/ubuntu/include/itls/ssl.h

@@ -1,2622 +0,0 @@
-/**
- * \file ssl.h
- *
- * \brief SSL/TLS functions.
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_SSL_H
-#define MBEDTLS_SSL_H
-
-#if !defined(MBEDTLS_CONFIG_FILE)
-#include "config.h"
-#else
-#include MBEDTLS_CONFIG_FILE
-#endif
-
-#if defined(MBEDTLS_BIGNUM_C)
-#include "bignum.h"
-#include "ecp.h"
-#else
-#include <stddef.h>
-#include <stdint.h>
-#endif
-
-#include "ssl_ciphersuites.h"
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-#include "x509_crt.h"
-#include "x509_crl.h"
-#endif
-
-#if defined(MBEDTLS_DHM_C)
-#include "dhm.h"
-#endif
-
-#if defined(MBEDTLS_ECDH_C)
-#include "ecdh.h"
-#endif
-
-#if defined(MBEDTLS_ZLIB_SUPPORT)
-#include "zlib.h"
-#endif
-
-#if defined(MBEDTLS_HAVE_TIME)
-#include "itls/platform.h"
-#endif
-
-/*
- * SSL Error codes
- */
-#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE               -0x7080  /**< The requested feature is not available. */
-#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA                    -0x7100  /**< Bad input parameters to function. */
-#define MBEDTLS_ERR_SSL_INVALID_MAC                       -0x7180  /**< Verification of the message MAC failed. */
-#define MBEDTLS_ERR_SSL_INVALID_RECORD                    -0x7200  /**< An invalid SSL record was received. */
-#define MBEDTLS_ERR_SSL_CONN_EOF                          -0x7280  /**< The connection indicated an EOF. */
-#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER                    -0x7300  /**< An unknown cipher was received. */
-#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN                  -0x7380  /**< The server has no ciphersuites in common with the client. */
-#define MBEDTLS_ERR_SSL_NO_RNG                            -0x7400  /**< No RNG was provided to the SSL module. */
-#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE             -0x7480  /**< No client certification received from the client, but required by the authentication mode. */
-#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE             -0x7500  /**< Our own certificate(s) is/are too large to send in an SSL message. */
-#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED              -0x7580  /**< The own certificate is not set, but needed by the server. */
-#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED              -0x7600  /**< The own private key or pre-shared key is not set, but needed. */
-#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED                 -0x7680  /**< No CA Chain is set, but required to operate. */
-#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE                -0x7700  /**< An unexpected message was received from our peer. */
-#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE               -0x7780  /**< A fatal alert message was received from our peer. */
-#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED                -0x7800  /**< Verification of our peer failed. */
-#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY                 -0x7880  /**< The peer notified us that the connection is going to be closed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO               -0x7900  /**< Processing of the ClientHello handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO               -0x7980  /**< Processing of the ServerHello handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE                -0x7A00  /**< Processing of the Certificate handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST        -0x7A80  /**< Processing of the CertificateRequest handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE        -0x7B00  /**< Processing of the ServerKeyExchange handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE          -0x7B80  /**< Processing of the ServerHelloDone handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE        -0x7C00  /**< Processing of the ClientKeyExchange handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP     -0x7C80  /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS     -0x7D00  /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY         -0x7D80  /**< Processing of the CertificateVerify handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC         -0x7E00  /**< Processing of the ChangeCipherSpec handshake message failed. */
-#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED                   -0x7E80  /**< Processing of the Finished handshake message failed. */
-#define MBEDTLS_ERR_SSL_ALLOC_FAILED                      -0x7F00  /**< Memory allocation failed */
-#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED                   -0x7F80  /**< Hardware acceleration function returned with error */
-#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH              -0x6F80  /**< Hardware acceleration function skipped / left alone data */
-#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED                -0x6F00  /**< Processing of the compression / decompression failed */
-#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION           -0x6E80  /**< Handshake protocol not within min/max boundaries */
-#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET         -0x6E00  /**< Processing of the NewSessionTicket handshake message failed. */
-#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED            -0x6D80  /**< Session ticket has expired. */
-#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH                  -0x6D00  /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */
-#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY                  -0x6C80  /**< Unknown identity received (eg, PSK identity) */
-#define MBEDTLS_ERR_SSL_INTERNAL_ERROR                    -0x6C00  /**< Internal error (eg, unexpected failure in lower-level module) */
-#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING                  -0x6B80  /**< A counter would wrap (eg, too many messages exchanged). */
-#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO       -0x6B00  /**< Unexpected message at ServerHello in renegotiation. */
-#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED             -0x6A80  /**< DTLS client must retry for hello verification */
-#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL                  -0x6A00  /**< A buffer is too small to receive or write a message */
-#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE             -0x6980  /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */
-#define MBEDTLS_ERR_SSL_WANT_READ                         -0x6900  /**< Connection requires a read call. */
-#define MBEDTLS_ERR_SSL_WANT_WRITE                        -0x6880  /**< Connection requires a write call. */
-#define MBEDTLS_ERR_SSL_TIMEOUT                           -0x6800  /**< The operation timed out. */
-#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT                  -0x6780  /**< The client initiated a reconnect from the same port. */
-#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD                 -0x6700  /**< Record header looks valid but is not expected. */
-#define MBEDTLS_ERR_SSL_NON_FATAL                         -0x6680  /**< The alert message received indicates a non-fatal error. */
-#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH               -0x6600  /**< Couldn't set the hash for verifying CertificateVerify */
-
-/*
- * Various constants
- */
-#define MBEDTLS_SSL_MAJOR_VERSION_3             3
-#define MBEDTLS_SSL_MINOR_VERSION_0             0   /*!< SSL v3.0 */
-#define MBEDTLS_SSL_MINOR_VERSION_1             1   /*!< TLS v1.0 */
-#define MBEDTLS_SSL_MINOR_VERSION_2             2   /*!< TLS v1.1 */
-#define MBEDTLS_SSL_MINOR_VERSION_3             3   /*!< TLS v1.2 */
-
-#define MBEDTLS_SSL_TRANSPORT_STREAM            0   /*!< TLS      */
-#define MBEDTLS_SSL_TRANSPORT_DATAGRAM          1   /*!< DTLS     */
-
-#define MBEDTLS_SSL_MAX_HOST_NAME_LEN           255 /*!< Maximum host name defined in RFC 1035 */
-
-/* RFC 6066 section 4, see also mfl_code_to_length in ssl_tls.c
- * NONE must be zero so that memset()ing structure to zero works */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_NONE           0   /*!< don't use this extension   */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_512            1   /*!< MaxFragmentLength 2^9      */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_1024           2   /*!< MaxFragmentLength 2^10     */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_2048           3   /*!< MaxFragmentLength 2^11     */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_4096           4   /*!< MaxFragmentLength 2^12     */
-#define MBEDTLS_SSL_MAX_FRAG_LEN_INVALID        5   /*!< first invalid value        */
-
-#define MBEDTLS_SSL_IS_CLIENT                   0
-#define MBEDTLS_SSL_IS_SERVER                   1
-
-#define MBEDTLS_SSL_IS_NOT_FALLBACK             0
-#define MBEDTLS_SSL_IS_FALLBACK                 1
-
-#define MBEDTLS_SSL_EXTENDED_MS_DISABLED        0
-#define MBEDTLS_SSL_EXTENDED_MS_ENABLED         1
-
-#define MBEDTLS_SSL_ETM_DISABLED                0
-#define MBEDTLS_SSL_ETM_ENABLED                 1
-
-#define MBEDTLS_SSL_COMPRESS_NULL               0
-#define MBEDTLS_SSL_COMPRESS_DEFLATE            1
-
-#define MBEDTLS_SSL_VERIFY_NONE                 0
-#define MBEDTLS_SSL_VERIFY_OPTIONAL             1
-#define MBEDTLS_SSL_VERIFY_REQUIRED             2
-#define MBEDTLS_SSL_VERIFY_UNSET                3 /* Used only for sni_authmode */
-
-#define MBEDTLS_SSL_LEGACY_RENEGOTIATION        0
-#define MBEDTLS_SSL_SECURE_RENEGOTIATION        1
-
-#define MBEDTLS_SSL_RENEGOTIATION_DISABLED      0
-#define MBEDTLS_SSL_RENEGOTIATION_ENABLED       1
-
-#define MBEDTLS_SSL_ANTI_REPLAY_DISABLED        0
-#define MBEDTLS_SSL_ANTI_REPLAY_ENABLED         1
-
-#define MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED  -1
-#define MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT  16
-
-#define MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION     0
-#define MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION  1
-#define MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE      2
-
-#define MBEDTLS_SSL_TRUNC_HMAC_DISABLED         0
-#define MBEDTLS_SSL_TRUNC_HMAC_ENABLED          1
-#define MBEDTLS_SSL_TRUNCATED_HMAC_LEN          10  /* 80 bits, rfc 6066 section 7 */
-
-#define MBEDTLS_SSL_SESSION_TICKETS_DISABLED     0
-#define MBEDTLS_SSL_SESSION_TICKETS_ENABLED      1
-
-#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED    0
-#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED     1
-
-#define MBEDTLS_SSL_ARC4_ENABLED                0
-#define MBEDTLS_SSL_ARC4_DISABLED               1
-
-#define MBEDTLS_SSL_PRESET_DEFAULT              0
-#define MBEDTLS_SSL_PRESET_SUITEB               2
-
-#define MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED       1
-#define MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED      0
-
-/*
- * Default range for DTLS retransmission timer value, in milliseconds.
- * RFC 6347 4.2.4.1 says from 1 second to 60 seconds.
- */
-#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN    1000
-#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX   60000
-
-/**
- * \name SECTION: Module settings
- *
- * The configuration options you can set for this module are in this section.
- * Either change them in config.h or define them on the compiler command line.
- * \{
- */
-
-#if !defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME)
-#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME     86400 /**< Lifetime of session tickets (if enabled) */
-#endif
-
-/*
- * Maxium fragment length in bytes,
- * determines the size of each of the two internal I/O buffers.
- *
- * Note: the RFC defines the default size of SSL / TLS messages. If you
- * change the value here, other clients / servers may not be able to
- * communicate with you anymore. Only change this value if you control
- * both sides of the connection and have it reduced at both sides, or
- * if you're using the Max Fragment Length extension and you know all your
- * peers are using it too!
- */
-#if !defined(MBEDTLS_SSL_MAX_CONTENT_LEN)
-#define MBEDTLS_SSL_MAX_CONTENT_LEN         16384   /**< Size of the input / output buffer */
-#endif
-
-/* \} name SECTION: Module settings */
-
-/*
- * Length of the verify data for secure renegotiation
- */
-#if defined(MBEDTLS_SSL_PROTO_SSL3)
-#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 36
-#else
-#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 12
-#endif
-
-/*
- * Signaling ciphersuite values (SCSV)
- */
-#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO    0xFF   /**< renegotiation info ext */
-#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE         0x5600 /**< RFC 7507 section 2 */
-
-/*
- * Supported Signature and Hash algorithms (For TLS 1.2)
- * RFC 5246 section 7.4.1.4.1
- */
-#define MBEDTLS_SSL_HASH_NONE                0
-#define MBEDTLS_SSL_HASH_MD5                 1
-#define MBEDTLS_SSL_HASH_SHA1                2
-#define MBEDTLS_SSL_HASH_SHA224              3
-#define MBEDTLS_SSL_HASH_SHA256              4
-#define MBEDTLS_SSL_HASH_SHA384              5
-#define MBEDTLS_SSL_HASH_SHA512              6
-
-#define MBEDTLS_SSL_SIG_ANON                 0
-#define MBEDTLS_SSL_SIG_RSA                  1
-#define MBEDTLS_SSL_SIG_ECDSA                3
-
-/*
- * Client Certificate Types
- * RFC 5246 section 7.4.4 plus RFC 4492 section 5.5
- */
-#define MBEDTLS_SSL_CERT_TYPE_RSA_SIGN       1
-#define MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN    64
-
-/*
- * Message, alert and handshake types
- */
-#define MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC     20
-#define MBEDTLS_SSL_MSG_ALERT                  21
-#define MBEDTLS_SSL_MSG_HANDSHAKE              22
-#define MBEDTLS_SSL_MSG_APPLICATION_DATA       23
-
-#define MBEDTLS_SSL_ALERT_LEVEL_WARNING         1
-#define MBEDTLS_SSL_ALERT_LEVEL_FATAL           2
-
-#define MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY           0  /* 0x00 */
-#define MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE    10  /* 0x0A */
-#define MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC        20  /* 0x14 */
-#define MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED     21  /* 0x15 */
-#define MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW       22  /* 0x16 */
-#define MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE 30  /* 0x1E */
-#define MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE     40  /* 0x28 */
-#define MBEDTLS_SSL_ALERT_MSG_NO_CERT               41  /* 0x29 */
-#define MBEDTLS_SSL_ALERT_MSG_BAD_CERT              42  /* 0x2A */
-#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT      43  /* 0x2B */
-#define MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED          44  /* 0x2C */
-#define MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED          45  /* 0x2D */
-#define MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN          46  /* 0x2E */
-#define MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER     47  /* 0x2F */
-#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA            48  /* 0x30 */
-#define MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED         49  /* 0x31 */
-#define MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR          50  /* 0x32 */
-#define MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR         51  /* 0x33 */
-#define MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION    60  /* 0x3C */
-#define MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION      70  /* 0x46 */
-#define MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY 71  /* 0x47 */
-#define MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR        80  /* 0x50 */
-#define MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK 86  /* 0x56 */
-#define MBEDTLS_SSL_ALERT_MSG_USER_CANCELED         90  /* 0x5A */
-#define MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION     100  /* 0x64 */
-#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT      110  /* 0x6E */
-#define MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME    112  /* 0x70 */
-#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY 115  /* 0x73 */
-#define MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL 120 /* 0x78 */
-
-#define MBEDTLS_SSL_HS_HELLO_REQUEST            0
-#define MBEDTLS_SSL_HS_CLIENT_HELLO             1
-#define MBEDTLS_SSL_HS_SERVER_HELLO             2
-#define MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST     3
-#define MBEDTLS_SSL_HS_NEW_SESSION_TICKET       4
-#define MBEDTLS_SSL_HS_CERTIFICATE             11
-#define MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE     12
-#define MBEDTLS_SSL_HS_CERTIFICATE_REQUEST     13
-#define MBEDTLS_SSL_HS_SERVER_HELLO_DONE       14
-#define MBEDTLS_SSL_HS_CERTIFICATE_VERIFY      15
-#define MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE     16
-#define MBEDTLS_SSL_HS_FINISHED                20
-
-/*
- * TLS extensions
- */
-#define MBEDTLS_TLS_EXT_SERVERNAME                   0
-#define MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME          0
-
-#define MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH          1
-
-#define MBEDTLS_TLS_EXT_TRUNCATED_HMAC               4
-
-#define MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES   10
-#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS     11
-
-#define MBEDTLS_TLS_EXT_SIG_ALG                     13
-
-#define MBEDTLS_TLS_EXT_ALPN                        16
-
-#define MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC            22 /* 0x16 */
-#define MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET  0x0017 /* 23 */
-
-#define MBEDTLS_TLS_EXT_SESSION_TICKET              35
-
-#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP               256 /* experimental */
-
-/* iTLS extensions */
-#define MBEDTLS_TLS_EXT_AUTH_EXTRA              0x2000
-#define MBEDTLS_TLS_EXT_KEY_ID                  0x2001
-#define MBEDTLS_TLS_EXT_AUTH_CODE               0x2002
-#define MBEDTLS_TLS_EXT_PRE_MASTER_SECRET       0x2003
-
-#define MBEDTLS_TLS_EXT_RENEGOTIATION_INFO      0xFF01
-
-/*
- * Size defines
- */
-#if !defined(MBEDTLS_PSK_MAX_LEN)
-#define MBEDTLS_PSK_MAX_LEN            32 /* 256 bits */
-#endif
-
-#if defined(MBEDTLS_SSL_PROTO_ITLS)
-#define MBEDTLS_AUTH_EXTRA_MAX_LEN     256
-#define MBEDTLS_KEY_ID_MAX_LEN         256
-#endif
-
-/* Dummy type used only for its size */
-union mbedtls_ssl_premaster_secret
-{
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)
-    unsigned char _pms_rsa[48];                         /* RFC 5246 8.1.1 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_ID2_ENABLED)
-    unsigned char _pms_id2[48];
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)
-    unsigned char _pms_dhm[MBEDTLS_MPI_MAX_SIZE];      /* RFC 5246 8.1.2 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)    || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)  || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
-    unsigned char _pms_ecdh[MBEDTLS_ECP_MAX_BYTES];    /* RFC 4492 5.10 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)
-    unsigned char _pms_psk[4 + 2 * MBEDTLS_PSK_MAX_LEN];       /* RFC 4279 2 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
-    unsigned char _pms_dhe_psk[4 + MBEDTLS_MPI_MAX_SIZE
-                                 + MBEDTLS_PSK_MAX_LEN];       /* RFC 4279 3 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)
-    unsigned char _pms_rsa_psk[52 + MBEDTLS_PSK_MAX_LEN];      /* RFC 4279 4 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
-    unsigned char _pms_ecdhe_psk[4 + MBEDTLS_ECP_MAX_BYTES
-                                   + MBEDTLS_PSK_MAX_LEN];     /* RFC 5489 2 */
-#endif
-#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
-    unsigned char _pms_ecjpake[32];     /* Thread spec: SHA-256 output */
-#endif
-};
-
-#define MBEDTLS_PREMASTER_SIZE     sizeof( union mbedtls_ssl_premaster_secret )
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * SSL state machine
- */
-typedef enum
-{
-    MBEDTLS_SSL_HELLO_REQUEST,
-    MBEDTLS_SSL_CLIENT_HELLO,
-    MBEDTLS_SSL_SERVER_HELLO,
-    MBEDTLS_SSL_SERVER_CERTIFICATE,
-    MBEDTLS_SSL_SERVER_KEY_EXCHANGE,
-    MBEDTLS_SSL_CERTIFICATE_REQUEST,
-    MBEDTLS_SSL_SERVER_HELLO_DONE,
-    MBEDTLS_SSL_CLIENT_CERTIFICATE,
-    MBEDTLS_SSL_CLIENT_KEY_EXCHANGE,
-    MBEDTLS_SSL_CERTIFICATE_VERIFY,
-    MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC,
-    MBEDTLS_SSL_CLIENT_FINISHED,
-    MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC,
-    MBEDTLS_SSL_SERVER_FINISHED,
-    MBEDTLS_SSL_FLUSH_BUFFERS,
-    MBEDTLS_SSL_HANDSHAKE_WRAPUP,
-    MBEDTLS_SSL_HANDSHAKE_OVER,
-    MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET,
-    MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT,
-}
-mbedtls_ssl_states;
-
-/**
- * \brief          Callback type: send data on the network.
- *
- * \note           That callback may be either blocking or non-blocking.
- *
- * \param ctx      Context for the send callback (typically a file descriptor)
- * \param buf      Buffer holding the data to send
- * \param len      Length of the data to send
- *
- * \return         The callback must return the number of bytes sent if any,
- *                 or a non-zero error code.
- *                 If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_WRITE
- *                 must be returned when the operation would block.
- *
- * \note           The callback is allowed to send fewer bytes than requested.
- *                 It must always return the number of bytes actually sent.
- */
-typedef int mbedtls_ssl_send_t( void *ctx,
-                                const unsigned char *buf,
-                                size_t len );
-
-/**
- * \brief          Callback type: receive data from the network.
- *
- * \note           That callback may be either blocking or non-blocking.
- *
- * \param ctx      Context for the receive callback (typically a file
- *                 descriptor)
- * \param buf      Buffer to write the received data to
- * \param len      Length of the receive buffer
- *
- * \return         The callback must return the number of bytes received,
- *                 or a non-zero error code.
- *                 If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ
- *                 must be returned when the operation would block.
- *
- * \note           The callback may receive fewer bytes than the length of the
- *                 buffer. It must always return the number of bytes actually
- *                 received and written to the buffer.
- */
-typedef int mbedtls_ssl_recv_t( void *ctx,
-                                unsigned char *buf,
-                                size_t len );
-
-/**
- * \brief          Callback type: receive data from the network, with timeout
- *
- * \note           That callback must block until data is received, or the
- *                 timeout delay expires, or the operation is interrupted by a
- *                 signal.
- *
- * \param ctx      Context for the receive callback (typically a file descriptor)
- * \param buf      Buffer to write the received data to
- * \param len      Length of the receive buffer
- * \param timeout  Maximum nomber of millisecondes to wait for data
- *                 0 means no timeout (potentially waiting forever)
- *
- * \return         The callback must return the number of bytes received,
- *                 or a non-zero error code:
- *                 \c MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out,
- *                 \c MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.
- *
- * \note           The callback may receive fewer bytes than the length of the
- *                 buffer. It must always return the number of bytes actually
- *                 received and written to the buffer.
- */
-typedef int mbedtls_ssl_recv_timeout_t( void *ctx,
-                                        unsigned char *buf,
-                                        size_t len,
-                                        uint32_t timeout );
-/**
- * \brief          Callback type: set a pair of timers/delays to watch
- *
- * \param ctx      Context pointer
- * \param int_ms   Intermediate delay in milliseconds
- * \param fin_ms   Final delay in milliseconds
- *                 0 cancels the current timer.
- *
- * \note           This callback must at least store the necessary information
- *                 for the associated \c mbedtls_ssl_get_timer_t callback to
- *                 return correct information.
- *
- * \note           If using a event-driven style of programming, an event must
- *                 be generated when the final delay is passed. The event must
- *                 cause a call to \c mbedtls_ssl_handshake() with the proper
- *                 SSL context to be scheduled. Care must be taken to ensure
- *                 that at most one such call happens at a time.
- *
- * \note           Only one timer at a time must be running. Calling this
- *                 function while a timer is running must cancel it. Cancelled
- *                 timers must not generate any event.
- */
-typedef void mbedtls_ssl_set_timer_t( void * ctx,
-                                      uint32_t int_ms,
-                                      uint32_t fin_ms );
-
-/**
- * \brief          Callback type: get status of timers/delays
- *
- * \param ctx      Context pointer
- *
- * \return         This callback must return:
- *                 -1 if cancelled (fin_ms == 0),
- *                  0 if none of the delays have passed,
- *                  1 if only the intermediate delay has passed,
- *                  2 if the final delay has passed.
- */
-typedef int mbedtls_ssl_get_timer_t( void * ctx );
-
-
-/* Defined below */
-typedef struct mbedtls_ssl_session mbedtls_ssl_session;
-typedef struct mbedtls_ssl_context mbedtls_ssl_context;
-typedef struct mbedtls_ssl_config  mbedtls_ssl_config;
-
-/* Defined in ssl_internal.h */
-typedef struct mbedtls_ssl_transform mbedtls_ssl_transform;
-typedef struct mbedtls_ssl_handshake_params mbedtls_ssl_handshake_params;
-typedef struct mbedtls_ssl_sig_hash_set_t mbedtls_ssl_sig_hash_set_t;
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-typedef struct mbedtls_ssl_key_cert mbedtls_ssl_key_cert;
-#endif
-#if defined(MBEDTLS_SSL_PROTO_DTLS)
-typedef struct mbedtls_ssl_flight_item mbedtls_ssl_flight_item;
-#endif
-
-/*
- * This structure is used for storing current session data.
- */
-struct mbedtls_ssl_session
-{
-#if defined(MBEDTLS_HAVE_TIME)
-    mbedtls_time_t start;       /*!< starting time      */
-#endif
-    int ciphersuite;            /*!< chosen ciphersuite */
-    int compression;            /*!< chosen compression */
-    size_t id_len;              /*!< session id length  */
-    unsigned char id[32];       /*!< session identifier */
-    unsigned char master[48];   /*!< the master secret  */
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-    mbedtls_x509_crt *peer_cert;        /*!< peer X.509 cert chain */
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-    uint32_t verify_result;          /*!<  verification result     */
-
-#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C)
-    unsigned char *ticket;      /*!< RFC 5077 session ticket */
-    size_t ticket_len;          /*!< session ticket length   */
-    uint32_t ticket_lifetime;   /*!< ticket lifetime hint    */
-#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */
-
-#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
-    unsigned char mfl_code;     /*!< MaxFragmentLength negotiated by peer */
-#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
-
-#if defined(MBEDTLS_SSL_TRUNCATED_HMAC)
-    int trunc_hmac;             /*!< flag for truncated hmac activation   */
-#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */
-
-#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
-    int encrypt_then_mac;       /*!< flag for EtM activation                */
-#endif
-};
-
-/**
- * SSL/TLS configuration to be shared between mbedtls_ssl_context structures.
- */
-struct mbedtls_ssl_config
-{
-    /* Group items by size (largest first) to minimize padding overhead */
-
-    /*
-     * Pointers
-     */
-
-    const int *ciphersuite_list[4]; /*!< allowed ciphersuites per version   */
-
-    /** Callback for printing debug output                                  */
-    void (*f_dbg)(void *, int, const char *, int, const char *);
-    void *p_dbg;                    /*!< context for the debug function     */
-
-    /** Callback for getting (pseudo-)random numbers                        */
-    int  (*f_rng)(void *, unsigned char *, size_t);
-    void *p_rng;                    /*!< context for the RNG function       */
-
-    /** Callback to retrieve a session from the cache                       */
-    int (*f_get_cache)(void *, mbedtls_ssl_session *);
-    /** Callback to store a session into the cache                          */
-    int (*f_set_cache)(void *, const mbedtls_ssl_session *);
-    void *p_cache;                  /*!< context for cache callbacks        */
-
-#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
-    /** Callback for setting cert according to SNI extension                */
-    int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *, size_t);
-    void *p_sni;                    /*!< context for SNI callback           */
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-    /** Callback to customize X.509 certificate chain verification          */
-    int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *);
-    void *p_vrfy;                   /*!< context for X.509 verify calllback */
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
-    /** Callback to retrieve PSK key from identity                          */
-    int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *, size_t);
-    void *p_psk;                    /*!< context for PSK callback           */
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C)
-    /** Callback to create & write a cookie for ClientHello veirifcation    */
-    int (*f_cookie_write)( void *, unsigned char **, unsigned char *,
-                           const unsigned char *, size_t );
-    /** Callback to verify validity of a ClientHello cookie                 */
-    int (*f_cookie_check)( void *, const unsigned char *, size_t,
-                           const unsigned char *, size_t );
-    void *p_cookie;                 /*!< context for the cookie callbacks   */
-#endif
-
-#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C)
-    /** Callback to create & write a session ticket                         */
-    int (*f_ticket_write)( void *, const mbedtls_ssl_session *,
-            unsigned char *, const unsigned char *, size_t *, uint32_t * );
-    /** Callback to parse a session ticket into a session structure         */
-    int (*f_ticket_parse)( void *, mbedtls_ssl_session *, unsigned char *, size_t);
-    void *p_ticket;                 /*!< context for the ticket callbacks   */
-#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */
-
-#if defined(MBEDTLS_SSL_EXPORT_KEYS)
-    /** Callback to export key block and master secret                      */
-    int (*f_export_keys)( void *, const unsigned char *,
-            const unsigned char *, size_t, size_t, size_t );
-    void *p_export_keys;            /*!< context for key export callback    */
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-    const mbedtls_x509_crt_profile *cert_profile; /*!< verification profile */
-    mbedtls_ssl_key_cert *key_cert; /*!< own certificate/key pair(s)        */
-    mbedtls_x509_crt *ca_chain;     /*!< trusted CAs                        */
-    mbedtls_x509_crl *ca_crl;       /*!< trusted CAs CRLs                   */
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
-    const int *sig_hashes;          /*!< allowed signature hashes           */
-#endif
-
-#if defined(MBEDTLS_ECP_C)
-    const mbedtls_ecp_group_id *curve_list; /*!< allowed curves             */
-#endif
-
-#if defined(MBEDTLS_DHM_C)
-    mbedtls_mpi dhm_P;              /*!< prime modulus for DHM              */
-    mbedtls_mpi dhm_G;              /*!< generator for DHM                  */
-#endif
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
-    unsigned char *psk;             /*!< pre-shared key                     */
-    size_t         psk_len;         /*!< length of the pre-shared key       */
-    unsigned char *psk_identity;    /*!< identity for PSK negotiation       */
-    size_t         psk_identity_len;/*!< length of identity                 */
-#endif
-
-#if defined(MBEDTLS_SSL_ALPN)
-    const char **alpn_list;         /*!< ordered list of protocols          */
-#endif
-
-    /*
-     * Numerical settings (int then char)
-     */
-
-    uint32_t read_timeout;          /*!< timeout for mbedtls_ssl_read (ms)  */
-
-#if defined(MBEDTLS_SSL_PROTO_DTLS)
-    uint32_t hs_timeout_min;        /*!< initial value of the handshake
-                                         retransmission timeout (ms)        */
-    uint32_t hs_timeout_max;        /*!< maximum value of the handshake
-                                         retransmission timeout (ms)        */
-#endif
-
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-    int renego_max_records;         /*!< grace period for renegotiation     */
-    unsigned char renego_period[8]; /*!< value of the record counters
-                                         that triggers renegotiation        */
-#endif
-
-#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
-    unsigned int badmac_limit;      /*!< limit of records with a bad MAC    */
-#endif
-
-#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C)
-    unsigned int dhm_min_bitlen;    /*!< min. bit length of the DHM prime   */
-#endif
-
-    unsigned char max_major_ver;    /*!< max. major version used            */
-    unsigned char max_minor_ver;    /*!< max. minor version used            */
-    unsigned char min_major_ver;    /*!< min. major version used            */
-    unsigned char min_minor_ver;    /*!< min. minor version used            */
-
-    /*
-     * Flags (bitfields)
-     */
-
-    unsigned int endpoint : 1;      /*!< 0: client, 1: server               */
-    unsigned int transport : 1;     /*!< stream (TLS) or datagram (DTLS)    */
-    unsigned int authmode : 2;      /*!< MBEDTLS_SSL_VERIFY_XXX             */
-    /* needed even with renego disabled for LEGACY_BREAK_HANDSHAKE          */
-    unsigned int allow_legacy_renegotiation : 2 ; /*!< MBEDTLS_LEGACY_XXX   */
-#if defined(MBEDTLS_ARC4_C)
-    unsigned int arc4_disabled : 1; /*!< blacklist RC4 ciphersuites?        */
-#endif
-#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
-    unsigned int mfl_code : 3;      /*!< desired fragment length            */
-#endif
-#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
-    unsigned int encrypt_then_mac : 1 ; /*!< negotiate encrypt-then-mac?    */
-#endif
-#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
-    unsigned int extended_ms : 1;   /*!< negotiate extended master secret?  */
-#endif
-#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
-    unsigned int anti_replay : 1;   /*!< detect and prevent replay?         */
-#endif
-#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
-    unsigned int cbc_record_splitting : 1;  /*!< do cbc record splitting    */
-#endif
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-    unsigned int disable_renegotiation : 1; /*!< disable renegotiation?     */
-#endif
-#if defined(MBEDTLS_SSL_TRUNCATED_HMAC)
-    unsigned int trunc_hmac : 1;    /*!< negotiate truncated hmac?          */
-#endif
-#if defined(MBEDTLS_SSL_SESSION_TICKETS)
-    unsigned int session_tickets : 1;   /*!< use session tickets?           */
-#endif
-#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C)
-    unsigned int fallback : 1;      /*!< is this a fallback?                */
-#endif
-#if defined(MBEDTLS_SSL_SRV_C)
-    unsigned int cert_req_ca_list : 1;  /*!< enable sending CA list in
-                                          Certificate Request messages?     */
-#endif
-#if defined(MBEDTLS_SSL_PROTO_ITLS)
-    unsigned char *auth_extra;         /* optional */
-    unsigned int   auth_extra_len;
-#endif
-};
-
-
-struct mbedtls_ssl_context
-{
-    const mbedtls_ssl_config *conf; /*!< configuration information          */
-
-    /*
-     * Miscellaneous
-     */
-    int state;                  /*!< SSL handshake: current state     */
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-    int renego_status;          /*!< Initial, in progress, pending?   */
-    int renego_records_seen;    /*!< Records since renego request, or with DTLS,
-                                  number of retransmissions of request if
-                                  renego_max_records is < 0           */
-#endif
-
-    int major_ver;              /*!< equal to  MBEDTLS_SSL_MAJOR_VERSION_3    */
-    int minor_ver;              /*!< either 0 (SSL3) or 1 (TLS1.0)    */
-
-#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
-    unsigned badmac_seen;       /*!< records with a bad MAC received    */
-#endif
-
-    mbedtls_ssl_send_t *f_send; /*!< Callback for network send */
-    mbedtls_ssl_recv_t *f_recv; /*!< Callback for network receive */
-    mbedtls_ssl_recv_timeout_t *f_recv_timeout;
-                                /*!< Callback for network receive with timeout */
-
-    void *p_bio;                /*!< context for I/O operations   */
-
-    /*
-     * Session layer
-     */
-    mbedtls_ssl_session *session_in;            /*!<  current session data (in)   */
-    mbedtls_ssl_session *session_out;           /*!<  current session data (out)  */
-    mbedtls_ssl_session *session;               /*!<  negotiated session data     */
-    mbedtls_ssl_session *session_negotiate;     /*!<  session data in negotiation */
-
-    mbedtls_ssl_handshake_params *handshake;    /*!<  params required only during
-                                              the handshake process        */
-
-    /*
-     * Record layer transformations
-     */
-    mbedtls_ssl_transform *transform_in;        /*!<  current transform params (in)   */
-    mbedtls_ssl_transform *transform_out;       /*!<  current transform params (in)   */
-    mbedtls_ssl_transform *transform;           /*!<  negotiated transform params     */
-    mbedtls_ssl_transform *transform_negotiate; /*!<  transform params in negotiation */
-
-    /*
-     * Timers
-     */
-    void *p_timer;              /*!< context for the timer callbacks */
-
-    mbedtls_ssl_set_timer_t *f_set_timer;       /*!< set timer callback */
-    mbedtls_ssl_get_timer_t *f_get_timer;       /*!< get timer callback */
-
-    /*
-     * Record layer (incoming data)
-     */
-    unsigned char *in_buf;      /*!< input buffer                     */
-    unsigned char *in_ctr;      /*!< 64-bit incoming message counter
-                                     TLS: maintained by us
-                                     DTLS: read from peer             */
-    unsigned char *in_hdr;      /*!< start of record header           */
-    unsigned char *in_len;      /*!< two-bytes message length field   */
-    unsigned char *in_iv;       /*!< ivlen-byte IV                    */
-    unsigned char *in_msg;      /*!< message contents (in_iv+ivlen)   */
-    unsigned char *in_offt;     /*!< read offset in application data  */
-
-    int in_msgtype;             /*!< record header: message type      */
-    size_t in_msglen;           /*!< record header: message length    */
-    size_t in_left;             /*!< amount of data read so far       */
-#if defined(MBEDTLS_SSL_PROTO_DTLS)
-    uint16_t in_epoch;          /*!< DTLS epoch for incoming records  */
-    size_t next_record_offset;  /*!< offset of the next record in datagram
-                                     (equal to in_left if none)       */
-#endif
-#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
-    uint64_t in_window_top;     /*!< last validated record seq_num    */
-    uint64_t in_window;         /*!< bitmask for replay detection     */
-#endif
-
-    size_t in_hslen;            /*!< current handshake message length,
-                                     including the handshake header   */
-    int nb_zero;                /*!< # of 0-length encrypted messages */
-
-    int keep_current_message;   /*!< drop or reuse current message
-                                     on next call to record layer? */
-
-    /*
-     * Record layer (outgoing data)
-     */
-    unsigned char *out_buf;     /*!< output buffer                    */
-    unsigned char *out_ctr;     /*!< 64-bit outgoing message counter  */
-    unsigned char *out_hdr;     /*!< start of record header           */
-    unsigned char *out_len;     /*!< two-bytes message length field   */
-    unsigned char *out_iv;      /*!< ivlen-byte IV                    */
-    unsigned char *out_msg;     /*!< message contents (out_iv+ivlen)  */
-
-    int out_msgtype;            /*!< record header: message type      */
-    size_t out_msglen;          /*!< record header: message length    */
-    size_t out_left;            /*!< amount of data not yet written   */
-
-#if defined(MBEDTLS_ZLIB_SUPPORT)
-    unsigned char *compress_buf;        /*!<  zlib data buffer        */
-#endif
-#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
-    signed char split_done;     /*!< current record already splitted? */
-#endif
-
-    /*
-     * PKI layer
-     */
-    int client_auth;                    /*!<  flag for client auth.   */
-
-    /*
-     * User settings
-     */
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-    char *hostname;             /*!< expected peer CN for verification
-                                     (and SNI if available)                 */
-#endif
-
-#if defined(MBEDTLS_SSL_ALPN)
-    const char *alpn_chosen;    /*!<  negotiated protocol                   */
-#endif
-
-    /*
-     * Information for DTLS hello verify
-     */
-#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C)
-    unsigned char  *cli_id;         /*!<  transport-level ID of the client  */
-    size_t          cli_id_len;     /*!<  length of cli_id                  */
-#endif
-
-    /*
-     * Secure renegotiation
-     */
-    /* needed to know when to send extension on server */
-    int secure_renegotiation;           /*!<  does peer support legacy or
-                                              secure renegotiation           */
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-    size_t verify_data_len;             /*!<  length of verify data stored   */
-    char own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!<  previous handshake verify data */
-    char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!<  previous handshake verify data */
-#endif
-};
-
-#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL)
-
-#define MBEDTLS_SSL_CHANNEL_OUTBOUND    0
-#define MBEDTLS_SSL_CHANNEL_INBOUND     1
-
-extern int (*mbedtls_ssl_hw_record_init)(mbedtls_ssl_context *ssl,
-                const unsigned char *key_enc, const unsigned char *key_dec,
-                size_t keylen,
-                const unsigned char *iv_enc,  const unsigned char *iv_dec,
-                size_t ivlen,
-                const unsigned char *mac_enc, const unsigned char *mac_dec,
-                size_t maclen);
-extern int (*mbedtls_ssl_hw_record_activate)(mbedtls_ssl_context *ssl, int direction);
-extern int (*mbedtls_ssl_hw_record_reset)(mbedtls_ssl_context *ssl);
-extern int (*mbedtls_ssl_hw_record_write)(mbedtls_ssl_context *ssl);
-extern int (*mbedtls_ssl_hw_record_read)(mbedtls_ssl_context *ssl);
-extern int (*mbedtls_ssl_hw_record_finish)(mbedtls_ssl_context *ssl);
-#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */
-
-/**
- * \brief Returns the list of ciphersuites supported by the SSL/TLS module.
- *
- * \return              a statically allocated array of ciphersuites, the last
- *                      entry is 0.
- */
-const int *mbedtls_ssl_list_ciphersuites( void );
-
-/**
- * \brief               Return the name of the ciphersuite associated with the
- *                      given ID
- *
- * \param ciphersuite_id SSL ciphersuite ID
- *
- * \return              a string containing the ciphersuite name
- */
-const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id );
-
-/**
- * \brief               Return the ID of the ciphersuite associated with the
- *                      given name
- *
- * \param ciphersuite_name SSL ciphersuite name
- *
- * \return              the ID with the ciphersuite or 0 if not found
- */
-int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name );
-
-/**
- * \brief          Initialize an SSL context
- *                 Just makes the context ready for mbedtls_ssl_setup() or
- *                 mbedtls_ssl_free()
- *
- * \param ssl      SSL context
- */
-void mbedtls_ssl_init( mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Set up an SSL context for use
- *
- * \note           No copy of the configuration context is made, it can be
- *                 shared by many mbedtls_ssl_context structures.
- *
- * \warning        Modifying the conf structure after it has been used in this
- *                 function is unsupported!
- *
- * \param ssl      SSL context
- * \param conf     SSL configuration to use
- *
- * \return         0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED if
- *                 memory allocation failed
- */
-int mbedtls_ssl_setup( mbedtls_ssl_context *ssl,
-                       const mbedtls_ssl_config *conf );
-
-/**
- * \brief          Reset an already initialized SSL context for re-use
- *                 while retaining application-set variables, function
- *                 pointers and data.
- *
- * \param ssl      SSL context
- * \return         0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED,
-                   MBEDTLS_ERR_SSL_HW_ACCEL_FAILED or
- *                 MBEDTLS_ERR_SSL_COMPRESSION_FAILED
- */
-int mbedtls_ssl_session_reset( mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Set the current endpoint type
- *
- * \param conf     SSL configuration
- * \param endpoint must be MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER
- */
-void mbedtls_ssl_conf_endpoint( mbedtls_ssl_config *conf, int endpoint );
-
-/**
- * \brief           Set the transport type (TLS or DTLS).
- *                  Default: TLS
- *
- * \note            For DTLS, you must either provide a recv callback that
- *                  doesn't block, or one that handles timeouts, see
- *                  \c mbedtls_ssl_set_bio(). You also need to provide timer
- *                  callbacks with \c mbedtls_ssl_set_timer_cb().
- *
- * \param conf      SSL configuration
- * \param transport transport type:
- *                  MBEDTLS_SSL_TRANSPORT_STREAM for TLS,
- *                  MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS.
- */
-void mbedtls_ssl_conf_transport( mbedtls_ssl_config *conf, int transport );
-
-/**
- * \brief          Set the certificate verification mode
- *                 Default: NONE on server, REQUIRED on client
- *
- * \param conf     SSL configuration
- * \param authmode can be:
- *
- *  MBEDTLS_SSL_VERIFY_NONE:      peer certificate is not checked
- *                        (default on server)
- *                        (insecure on client)
- *
- *  MBEDTLS_SSL_VERIFY_OPTIONAL:  peer certificate is checked, however the
- *                        handshake continues even if verification failed;
- *                        mbedtls_ssl_get_verify_result() can be called after the
- *                        handshake is complete.
- *
- *  MBEDTLS_SSL_VERIFY_REQUIRED:  peer *must* present a valid certificate,
- *                        handshake is aborted if verification failed.
- *                        (default on client)
- *
- * \note On client, MBEDTLS_SSL_VERIFY_REQUIRED is the recommended mode.
- * With MBEDTLS_SSL_VERIFY_OPTIONAL, the user needs to call mbedtls_ssl_get_verify_result() at
- * the right time(s), which may not be obvious, while REQUIRED always perform
- * the verification as soon as possible. For example, REQUIRED was protecting
- * against the "triple handshake" attack even before it was found.
- */
-void mbedtls_ssl_conf_authmode( mbedtls_ssl_config *conf, int authmode );
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-/**
- * \brief          Set the verification callback (Optional).
- *
- *                 If set, the verify callback is called for each
- *                 certificate in the chain. For implementation
- *                 information, please see \c mbedtls_x509_crt_verify()
- *
- * \param conf     SSL configuration
- * \param f_vrfy   verification function
- * \param p_vrfy   verification parameter
- */
-void mbedtls_ssl_conf_verify( mbedtls_ssl_config *conf,
-                     int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
-                     void *p_vrfy );
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-
-/**
- * \brief          Set the random number generator callback
- *
- * \param conf     SSL configuration
- * \param f_rng    RNG function
- * \param p_rng    RNG parameter
- */
-void mbedtls_ssl_conf_rng( mbedtls_ssl_config *conf,
-                  int (*f_rng)(void *, unsigned char *, size_t),
-                  void *p_rng );
-
-/**
- * \brief          Set the debug callback
- *
- *                 The callback has the following argument:
- *                 void *           opaque context for the callback
- *                 int              debug level
- *                 const char *     file name
- *                 int              line number
- *                 const char *     message
- *
- * \param conf     SSL configuration
- * \param f_dbg    debug function
- * \param p_dbg    debug parameter
- */
-void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf,
-                  void (*f_dbg)(void *, int, const char *, int, const char *),
-                  void  *p_dbg );
-
-/**
- * \brief          Set the underlying BIO callbacks for write, read and
- *                 read-with-timeout.
- *
- * \param ssl      SSL context
- * \param p_bio    parameter (context) shared by BIO callbacks
- * \param f_send   write callback
- * \param f_recv   read callback
- * \param f_recv_timeout blocking read callback with timeout.
- *
- * \note           One of f_recv or f_recv_timeout can be NULL, in which case
- *                 the other is used. If both are non-NULL, f_recv_timeout is
- *                 used and f_recv is ignored (as if it were NULL).
- *
- * \note           The two most common use cases are:
- *                 - non-blocking I/O, f_recv != NULL, f_recv_timeout == NULL
- *                 - blocking I/O, f_recv == NULL, f_recv_timout != NULL
- *
- * \note           For DTLS, you need to provide either a non-NULL
- *                 f_recv_timeout callback, or a f_recv that doesn't block.
- *
- * \note           See the documentations of \c mbedtls_ssl_sent_t,
- *                 \c mbedtls_ssl_recv_t and \c mbedtls_ssl_recv_timeout_t for
- *                 the conventions those callbacks must follow.
- *
- * \note           On some platforms, net_sockets.c provides
- *                 \c mbedtls_net_send(), \c mbedtls_net_recv() and
- *                 \c mbedtls_net_recv_timeout() that are suitable to be used
- *                 here.
- */
-void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl,
-                          void *p_bio,
-                          mbedtls_ssl_send_t *f_send,
-                          mbedtls_ssl_recv_t *f_recv,
-                          mbedtls_ssl_recv_timeout_t *f_recv_timeout );
-
-/**
- * \brief          Set the timeout period for mbedtls_ssl_read()
- *                 (Default: no timeout.)
- *
- * \param conf     SSL configuration context
- * \param timeout  Timeout value in milliseconds.
- *                 Use 0 for no timeout (default).
- *
- * \note           With blocking I/O, this will only work if a non-NULL
- *                 \c f_recv_timeout was set with \c mbedtls_ssl_set_bio().
- *                 With non-blocking I/O, this will only work if timer
- *                 callbacks were set with \c mbedtls_ssl_set_timer_cb().
- *
- * \note           With non-blocking I/O, you may also skip this function
- *                 altogether and handle timeouts at the application layer.
- */
-void mbedtls_ssl_conf_read_timeout( mbedtls_ssl_config *conf, uint32_t timeout );
-
-/**
- * \brief          Set the timer callbacks (Mandatory for DTLS.)
- *
- * \param ssl      SSL context
- * \param p_timer  parameter (context) shared by timer callbacks
- * \param f_set_timer   set timer callback
- * \param f_get_timer   get timer callback. Must return:
- *
- * \note           See the documentation of \c mbedtls_ssl_set_timer_t and
- *                 \c mbedtls_ssl_get_timer_t for the conventions this pair of
- *                 callbacks must follow.
- *
- * \note           On some platforms, timing.c provides
- *                 \c mbedtls_timing_set_delay() and
- *                 \c mbedtls_timing_get_delay() that are suitable for using
- *                 here, except if using an event-driven style.
- *
- * \note           See also the "DTLS tutorial" article in our knowledge base.
- *                 https://tls.mbed.org/kb/how-to/dtls-tutorial
- */
-void mbedtls_ssl_set_timer_cb( mbedtls_ssl_context *ssl,
-                               void *p_timer,
-                               mbedtls_ssl_set_timer_t *f_set_timer,
-                               mbedtls_ssl_get_timer_t *f_get_timer );
-
-/**
- * \brief           Callback type: generate and write session ticket
- *
- * \note            This describes what a callback implementation should do.
- *                  This callback should generate an encrypted and
- *                  authenticated ticket for the session and write it to the
- *                  output buffer. Here, ticket means the opaque ticket part
- *                  of the NewSessionTicket structure of RFC 5077.
- *
- * \param p_ticket  Context for the callback
- * \param session   SSL session to be written in the ticket
- * \param start     Start of the output buffer
- * \param end       End of the output buffer
- * \param tlen      On exit, holds the length written
- * \param lifetime  On exit, holds the lifetime of the ticket in seconds
- *
- * \return          0 if successful, or
- *                  a specific MBEDTLS_ERR_XXX code.
- */
-typedef int mbedtls_ssl_ticket_write_t( void *p_ticket,
-                                        const mbedtls_ssl_session *session,
-                                        unsigned char *start,
-                                        const unsigned char *end,
-                                        size_t *tlen,
-                                        uint32_t *lifetime );
-
-#if defined(MBEDTLS_SSL_EXPORT_KEYS)
-/**
- * \brief           Callback type: Export key block and master secret
- *
- * \note            This is required for certain uses of TLS, e.g. EAP-TLS
- *                  (RFC 5216) and Thread. The key pointers are ephemeral and
- *                  therefore must not be stored. The master secret and keys
- *                  should not be used directly except as an input to a key
- *                  derivation function.
- *
- * \param p_expkey  Context for the callback
- * \param ms        Pointer to master secret (fixed length: 48 bytes)
- * \param kb        Pointer to key block, see RFC 5246 section 6.3
- *                  (variable length: 2 * maclen + 2 * keylen + 2 * ivlen).
- * \param maclen    MAC length
- * \param keylen    Key length
- * \param ivlen     IV length
- *
- * \return          0 if successful, or
- *                  a specific MBEDTLS_ERR_XXX code.
- */
-typedef int mbedtls_ssl_export_keys_t( void *p_expkey,
-                                const unsigned char *ms,
-                                const unsigned char *kb,
-                                size_t maclen,
-                                size_t keylen,
-                                size_t ivlen );
-#endif /* MBEDTLS_SSL_EXPORT_KEYS */
-
-/**
- * \brief           Callback type: parse and load session ticket
- *
- * \note            This describes what a callback implementation should do.
- *                  This callback should parse a session ticket as generated
- *                  by the corresponding mbedtls_ssl_ticket_write_t function,
- *                  and, if the ticket is authentic and valid, load the
- *                  session.
- *
- * \note            The implementation is allowed to modify the first len
- *                  bytes of the input buffer, eg to use it as a temporary
- *                  area for the decrypted ticket contents.
- *
- * \param p_ticket  Context for the callback
- * \param session   SSL session to be loaded
- * \param buf       Start of the buffer containing the ticket
- * \param len       Length of the ticket.
- *
- * \return          0 if successful, or
- *                  MBEDTLS_ERR_SSL_INVALID_MAC if not authentic, or
- *                  MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED if expired, or
- *                  any other non-zero code for other failures.
- */
-typedef int mbedtls_ssl_ticket_parse_t( void *p_ticket,
-                                        mbedtls_ssl_session *session,
-                                        unsigned char *buf,
-                                        size_t len );
-
-#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C)
-/**
- * \brief           Configure SSL session ticket callbacks (server only).
- *                  (Default: none.)
- *
- * \note            On server, session tickets are enabled by providing
- *                  non-NULL callbacks.
- *
- * \note            On client, use \c mbedtls_ssl_conf_session_tickets().
- *
- * \param conf      SSL configuration context
- * \param f_ticket_write    Callback for writing a ticket
- * \param f_ticket_parse    Callback for parsing a ticket
- * \param p_ticket          Context shared by the two callbacks
- */
-void mbedtls_ssl_conf_session_tickets_cb( mbedtls_ssl_config *conf,
-        mbedtls_ssl_ticket_write_t *f_ticket_write,
-        mbedtls_ssl_ticket_parse_t *f_ticket_parse,
-        void *p_ticket );
-#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */
-
-#if defined(MBEDTLS_SSL_EXPORT_KEYS)
-/**
- * \brief           Configure key export callback.
- *                  (Default: none.)
- *
- * \note            See \c mbedtls_ssl_export_keys_t.
- *
- * \param conf      SSL configuration context
- * \param f_export_keys     Callback for exporting keys
- * \param p_export_keys     Context for the callback
- */
-void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf,
-        mbedtls_ssl_export_keys_t *f_export_keys,
-        void *p_export_keys );
-#endif /* MBEDTLS_SSL_EXPORT_KEYS */
-
-/**
- * \brief          Callback type: generate a cookie
- *
- * \param ctx      Context for the callback
- * \param p        Buffer to write to,
- *                 must be updated to point right after the cookie
- * \param end      Pointer to one past the end of the output buffer
- * \param info     Client ID info that was passed to
- *                 \c mbedtls_ssl_set_client_transport_id()
- * \param ilen     Length of info in bytes
- *
- * \return         The callback must return 0 on success,
- *                 or a negative error code.
- */
-typedef int mbedtls_ssl_cookie_write_t( void *ctx,
-                                unsigned char **p, unsigned char *end,
-                                const unsigned char *info, size_t ilen );
-
-/**
- * \brief          Callback type: verify a cookie
- *
- * \param ctx      Context for the callback
- * \param cookie   Cookie to verify
- * \param clen     Length of cookie
- * \param info     Client ID info that was passed to
- *                 \c mbedtls_ssl_set_client_transport_id()
- * \param ilen     Length of info in bytes
- *
- * \return         The callback must return 0 if cookie is valid,
- *                 or a negative error code.
- */
-typedef int mbedtls_ssl_cookie_check_t( void *ctx,
-                                const unsigned char *cookie, size_t clen,
-                                const unsigned char *info, size_t ilen );
-
-#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C)
-/**
- * \brief           Register callbacks for DTLS cookies
- *                  (Server only. DTLS only.)
- *
- *                  Default: dummy callbacks that fail, in order to force you to
- *                  register working callbacks (and initialize their context).
- *
- *                  To disable HelloVerifyRequest, register NULL callbacks.
- *
- * \warning         Disabling hello verification allows your server to be used
- *                  for amplification in DoS attacks against other hosts.
- *                  Only disable if you known this can't happen in your
- *                  particular environment.
- *
- * \note            See comments on \c mbedtls_ssl_handshake() about handling
- *                  the MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED that is expected
- *                  on the first handshake attempt when this is enabled.
- *
- * \note            This is also necessary to handle client reconnection from
- *                  the same port as described in RFC 6347 section 4.2.8 (only
- *                  the variant with cookies is supported currently). See
- *                  comments on \c mbedtls_ssl_read() for details.
- *
- * \param conf              SSL configuration
- * \param f_cookie_write    Cookie write callback
- * \param f_cookie_check    Cookie check callback
- * \param p_cookie          Context for both callbacks
- */
-void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf,
-                           mbedtls_ssl_cookie_write_t *f_cookie_write,
-                           mbedtls_ssl_cookie_check_t *f_cookie_check,
-                           void *p_cookie );
-
-/**
- * \brief          Set client's transport-level identification info.
- *                 (Server only. DTLS only.)
- *
- *                 This is usually the IP address (and port), but could be
- *                 anything identify the client depending on the underlying
- *                 network stack. Used for HelloVerifyRequest with DTLS.
- *                 This is *not* used to route the actual packets.
- *
- * \param ssl      SSL context
- * \param info     Transport-level info identifying the client (eg IP + port)
- * \param ilen     Length of info in bytes
- *
- * \note           An internal copy is made, so the info buffer can be reused.
- *
- * \return         0 on success,
- *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used on client,
- *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if out of memory.
- */
-int mbedtls_ssl_set_client_transport_id( mbedtls_ssl_context *ssl,
-                                 const unsigned char *info,
-                                 size_t ilen );
-
-#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */
-
-#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY)
-/**
- * \brief          Enable or disable anti-replay protection for DTLS.
- *                 (DTLS only, no effect on TLS.)
- *                 Default: enabled.
- *
- * \param conf     SSL configuration
- * \param mode     MBEDTLS_SSL_ANTI_REPLAY_ENABLED or MBEDTLS_SSL_ANTI_REPLAY_DISABLED.
- *
- * \warning        Disabling this is a security risk unless the application
- *                 protocol handles duplicated packets in a safe way. You
- *                 should not disable this without careful consideration.
- *                 However, if your application already detects duplicated
- *                 packets and needs information about them to adjust its
- *                 transmission strategy, then you'll want to disable this.
- */
-void mbedtls_ssl_conf_dtls_anti_replay( mbedtls_ssl_config *conf, char mode );
-#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */
-
-#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT)
-/**
- * \brief          Set a limit on the number of records with a bad MAC
- *                 before terminating the connection.
- *                 (DTLS only, no effect on TLS.)
- *                 Default: 0 (disabled).
- *
- * \param conf     SSL configuration
- * \param limit    Limit, or 0 to disable.
- *
- * \note           If the limit is N, then the connection is terminated when
- *                 the Nth non-authentic record is seen.
- *
- * \note           Records with an invalid header are not counted, only the
- *                 ones going through the authentication-decryption phase.
- *
- * \note           This is a security trade-off related to the fact that it's
- *                 often relatively easy for an active attacker ot inject UDP
- *                 datagrams. On one hand, setting a low limit here makes it
- *                 easier for such an attacker to forcibly terminated a
- *                 connection. On the other hand, a high limit or no limit
- *                 might make us waste resources checking authentication on
- *                 many bogus packets.
- */
-void mbedtls_ssl_conf_dtls_badmac_limit( mbedtls_ssl_config *conf, unsigned limit );
-#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */
-
-#if defined(MBEDTLS_SSL_PROTO_DTLS)
-/**
- * \brief          Set retransmit timeout values for the DTLS handshake.
- *                 (DTLS only, no effect on TLS.)
- *
- * \param conf     SSL configuration
- * \param min      Initial timeout value in milliseconds.
- *                 Default: 1000 (1 second).
- * \param max      Maximum timeout value in milliseconds.
- *                 Default: 60000 (60 seconds).
- *
- * \note           Default values are from RFC 6347 section 4.2.4.1.
- *
- * \note           The 'min' value should typically be slightly above the
- *                 expected round-trip time to your peer, plus whatever time
- *                 it takes for the peer to process the message. For example,
- *                 if your RTT is about 600ms and you peer needs up to 1s to
- *                 do the cryptographic operations in the handshake, then you
- *                 should set 'min' slightly above 1600. Lower values of 'min'
- *                 might cause spurious resends which waste network resources,
- *                 while larger value of 'min' will increase overall latency
- *                 on unreliable network links.
- *
- * \note           The more unreliable your network connection is, the larger
- *                 your max / min ratio needs to be in order to achieve
- *                 reliable handshakes.
- *
- * \note           Messages are retransmitted up to log2(ceil(max/min)) times.
- *                 For example, if min = 1s and max = 5s, the retransmit plan
- *                 goes: send ... 1s -> resend ... 2s -> resend ... 4s ->
- *                 resend ... 5s -> give up and return a timeout error.
- */
-void mbedtls_ssl_conf_handshake_timeout( mbedtls_ssl_config *conf, uint32_t min, uint32_t max );
-#endif /* MBEDTLS_SSL_PROTO_DTLS */
-
-#if defined(MBEDTLS_SSL_SRV_C)
-/**
- * \brief          Set the session cache callbacks (server-side only)
- *                 If not set, no session resuming is done (except if session
- *                 tickets are enabled too).
- *
- *                 The session cache has the responsibility to check for stale
- *                 entries based on timeout. See RFC 5246 for recommendations.
- *
- *                 Warning: session.peer_cert is cleared by the SSL/TLS layer on
- *                 connection shutdown, so do not cache the pointer! Either set
- *                 it to NULL or make a full copy of the certificate.
- *
- *                 The get callback is called once during the initial handshake
- *                 to enable session resuming. The get function has the
- *                 following parameters: (void *parameter, mbedtls_ssl_session *session)
- *                 If a valid entry is found, it should fill the master of
- *                 the session object with the cached values and return 0,
- *                 return 1 otherwise. Optionally peer_cert can be set as well
- *                 if it is properly present in cache entry.
- *
- *                 The set callback is called once during the initial handshake
- *                 to enable session resuming after the entire handshake has
- *                 been finished. The set function has the following parameters:
- *                 (void *parameter, const mbedtls_ssl_session *session). The function
- *                 should create a cache entry for future retrieval based on
- *                 the data in the session structure and should keep in mind
- *                 that the mbedtls_ssl_session object presented (and all its referenced
- *                 data) is cleared by the SSL/TLS layer when the connection is
- *                 terminated. It is recommended to add metadata to determine if
- *                 an entry is still valid in the future. Return 0 if
- *                 successfully cached, return 1 otherwise.
- *
- * \param conf           SSL configuration
- * \param p_cache        parmater (context) for both callbacks
- * \param f_get_cache    session get callback
- * \param f_set_cache    session set callback
- */
-void mbedtls_ssl_conf_session_cache( mbedtls_ssl_config *conf,
-        void *p_cache,
-        int (*f_get_cache)(void *, mbedtls_ssl_session *),
-        int (*f_set_cache)(void *, const mbedtls_ssl_session *) );
-#endif /* MBEDTLS_SSL_SRV_C */
-
-#if defined(MBEDTLS_SSL_CLI_C)
-/**
- * \brief          Request resumption of session (client-side only)
- *                 Session data is copied from presented session structure.
- *
- * \param ssl      SSL context
- * \param session  session context
- *
- * \return         0 if successful,
- *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed,
- *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or
- *                 arguments are otherwise invalid
- *
- * \sa             mbedtls_ssl_get_session()
- */
-int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session *session );
-#endif /* MBEDTLS_SSL_CLI_C */
-
-/**
- * \brief               Set the list of allowed ciphersuites and the preference
- *                      order. First in the list has the highest preference.
- *                      (Overrides all version-specific lists)
- *
- *                      The ciphersuites array is not copied, and must remain
- *                      valid for the lifetime of the ssl_config.
- *
- *                      Note: The server uses its own preferences
- *                      over the preference of the client unless
- *                      MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE is defined!
- *
- * \param conf          SSL configuration
- * \param ciphersuites  0-terminated list of allowed ciphersuites
- */
-void mbedtls_ssl_conf_ciphersuites( mbedtls_ssl_config *conf,
-                                   const int *ciphersuites );
-
-/**
- * \brief               Set the list of allowed ciphersuites and the
- *                      preference order for a specific version of the protocol.
- *                      (Only useful on the server side)
- *
- *                      The ciphersuites array is not copied, and must remain
- *                      valid for the lifetime of the ssl_config.
- *
- * \param conf          SSL configuration
- * \param ciphersuites  0-terminated list of allowed ciphersuites
- * \param major         Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3
- *                      supported)
- * \param minor         Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
- *                      MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
- *                      MBEDTLS_SSL_MINOR_VERSION_3 supported)
- *
- * \note                With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0
- *                      and MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
- */
-void mbedtls_ssl_conf_ciphersuites_for_version( mbedtls_ssl_config *conf,
-                                       const int *ciphersuites,
-                                       int major, int minor );
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-/**
- * \brief          Set the X.509 security profile used for verification
- *
- * \note           The restrictions are enforced for all certificates in the
- *                 chain. However, signatures in the handshake are not covered
- *                 by this setting but by \b mbedtls_ssl_conf_sig_hashes().
- *
- * \param conf     SSL configuration
- * \param profile  Profile to use
- */
-void mbedtls_ssl_conf_cert_profile( mbedtls_ssl_config *conf,
-                                    const mbedtls_x509_crt_profile *profile );
-
-/**
- * \brief          Set the data required to verify peer certificate
- *
- * \param conf     SSL configuration
- * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs)
- * \param ca_crl   trusted CA CRLs
- */
-void mbedtls_ssl_conf_ca_chain( mbedtls_ssl_config *conf,
-                               mbedtls_x509_crt *ca_chain,
-                               mbedtls_x509_crl *ca_crl );
-
-/**
- * \brief          Set own certificate chain and private key
- *
- * \note           own_cert should contain in order from the bottom up your
- *                 certificate chain. The top certificate (self-signed)
- *                 can be omitted.
- *
- * \note           On server, this function can be called multiple times to
- *                 provision more than one cert/key pair (eg one ECDSA, one
- *                 RSA with SHA-256, one RSA with SHA-1). An adequate
- *                 certificate will be selected according to the client's
- *                 advertised capabilities. In case mutliple certificates are
- *                 adequate, preference is given to the one set by the first
- *                 call to this function, then second, etc.
- *
- * \note           On client, only the first call has any effect. That is,
- *                 only one client certificate can be provisioned. The
- *                 server's preferences in its CertficateRequest message will
- *                 be ignored and our only cert will be sent regardless of
- *                 whether it matches those preferences - the server can then
- *                 decide what it wants to do with it.
- *
- * \param conf     SSL configuration
- * \param own_cert own public certificate chain
- * \param pk_key   own private key
- *
- * \return         0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_conf_own_cert( mbedtls_ssl_config *conf,
-                              mbedtls_x509_crt *own_cert,
-                              mbedtls_pk_context *pk_key );
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED)
-/**
- * \brief          Set the Pre Shared Key (PSK) and the expected identity name
- *
- * \note           This is mainly useful for clients. Servers will usually
- *                 want to use \c mbedtls_ssl_conf_psk_cb() instead.
- *
- * \note           Currently clients can only register one pre-shared key.
- *                 In other words, the servers' identity hint is ignored.
- *                 Support for setting multiple PSKs on clients and selecting
- *                 one based on the identity hint is not a planned feature but
- *                 feedback is welcomed.
- *
- * \param conf     SSL configuration
- * \param psk      pointer to the pre-shared key
- * \param psk_len  pre-shared key length
- * \param psk_identity      pointer to the pre-shared key identity
- * \param psk_identity_len  identity key length
- *
- * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_conf_psk( mbedtls_ssl_config *conf,
-                const unsigned char *psk, size_t psk_len,
-                const unsigned char *psk_identity, size_t psk_identity_len );
-
-
-/**
- * \brief          Set the Pre Shared Key (PSK) for the current handshake
- *
- * \note           This should only be called inside the PSK callback,
- *                 ie the function passed to \c mbedtls_ssl_conf_psk_cb().
- *
- * \param ssl      SSL context
- * \param psk      pointer to the pre-shared key
- * \param psk_len  pre-shared key length
- *
- * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl,
-                            const unsigned char *psk, size_t psk_len );
-
-/**
- * \brief          Set the PSK callback (server-side only).
- *
- *                 If set, the PSK callback is called for each
- *                 handshake where a PSK ciphersuite was negotiated.
- *                 The caller provides the identity received and wants to
- *                 receive the actual PSK data and length.
- *
- *                 The callback has the following parameters: (void *parameter,
- *                 mbedtls_ssl_context *ssl, const unsigned char *psk_identity,
- *                 size_t identity_len)
- *                 If a valid PSK identity is found, the callback should use
- *                 \c mbedtls_ssl_set_hs_psk() on the ssl context to set the
- *                 correct PSK and return 0.
- *                 Any other return value will result in a denied PSK identity.
- *
- * \note           If you set a PSK callback using this function, then you
- *                 don't need to set a PSK key and identity using
- *                 \c mbedtls_ssl_conf_psk().
- *
- * \param conf     SSL configuration
- * \param f_psk    PSK identity function
- * \param p_psk    PSK identity parameter
- */
-void mbedtls_ssl_conf_psk_cb( mbedtls_ssl_config *conf,
-                     int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *,
-                                  size_t),
-                     void *p_psk );
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED */
-
-#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C)
-/**
- * \brief          Set the Diffie-Hellman public P and G values,
- *                 read as hexadecimal strings (server-side only)
- *                 (Default: MBEDTLS_DHM_RFC5114_MODP_2048_[PG])
- *
- * \param conf     SSL configuration
- * \param dhm_P    Diffie-Hellman-Merkle modulus
- * \param dhm_G    Diffie-Hellman-Merkle generator
- *
- * \return         0 if successful
- */
-int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf, const char *dhm_P, const char *dhm_G );
-
-/**
- * \brief          Set the Diffie-Hellman public P and G values,
- *                 read from existing context (server-side only)
- *
- * \param conf     SSL configuration
- * \param dhm_ctx  Diffie-Hellman-Merkle context
- *
- * \return         0 if successful
- */
-int mbedtls_ssl_conf_dh_param_ctx( mbedtls_ssl_config *conf, mbedtls_dhm_context *dhm_ctx );
-#endif /* MBEDTLS_DHM_C && defined(MBEDTLS_SSL_SRV_C) */
-
-#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C)
-/**
- * \brief          Set the minimum length for Diffie-Hellman parameters.
- *                 (Client-side only.)
- *                 (Default: 1024 bits.)
- *
- * \param conf     SSL configuration
- * \param bitlen   Minimum bit length of the DHM prime
- */
-void mbedtls_ssl_conf_dhm_min_bitlen( mbedtls_ssl_config *conf,
-                                      unsigned int bitlen );
-#endif /* MBEDTLS_DHM_C && MBEDTLS_SSL_CLI_C */
-
-#if defined(MBEDTLS_ECP_C)
-/**
- * \brief          Set the allowed curves in order of preference.
- *                 (Default: all defined curves.)
- *
- *                 On server: this only affects selection of the ECDHE curve;
- *                 the curves used for ECDH and ECDSA are determined by the
- *                 list of available certificates instead.
- *
- *                 On client: this affects the list of curves offered for any
- *                 use. The server can override our preference order.
- *
- *                 Both sides: limits the set of curves accepted for use in
- *                 ECDHE and in the peer's end-entity certificate.
- *
- * \note           This has no influence on which curves are allowed inside the
- *                 certificate chains, see \c mbedtls_ssl_conf_cert_profile()
- *                 for that. For the end-entity certificate however, the key
- *                 will be accepted only if it is allowed both by this list
- *                 and by the cert profile.
- *
- * \note           This list should be ordered by decreasing preference
- *                 (preferred curve first).
- *
- * \param conf     SSL configuration
- * \param curves   Ordered list of allowed curves,
- *                 terminated by MBEDTLS_ECP_DP_NONE.
- */
-void mbedtls_ssl_conf_curves( mbedtls_ssl_config *conf,
-                              const mbedtls_ecp_group_id *curves );
-#endif /* MBEDTLS_ECP_C */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED)
-/**
- * \brief          Set the allowed hashes for signatures during the handshake.
- *                 (Default: all available hashes except MD5.)
- *
- * \note           This only affects which hashes are offered and can be used
- *                 for signatures during the handshake. Hashes for message
- *                 authentication and the TLS PRF are controlled by the
- *                 ciphersuite, see \c mbedtls_ssl_conf_ciphersuites(). Hashes
- *                 used for certificate signature are controlled by the
- *                 verification profile, see \c mbedtls_ssl_conf_cert_profile().
- *
- * \note           This list should be ordered by decreasing preference
- *                 (preferred hash first).
- *
- * \param conf     SSL configuration
- * \param hashes   Ordered list of allowed signature hashes,
- *                 terminated by \c MBEDTLS_MD_NONE.
- */
-void mbedtls_ssl_conf_sig_hashes( mbedtls_ssl_config *conf,
-                                  const int *hashes );
-#endif /* MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED */
-
-#if defined(MBEDTLS_SSL_PROTO_ITLS)
-/**
- * \brief                 Set the optional auth code extra data.
- *                        (client-side only)
- *
- * \param ssl             SSL context
- * \param auth_extra      pointer to the auth extra
- * \param auth_extra_len  auth extra length
- *
- * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_conf_auth_extra( mbedtls_ssl_config *conf,
-                const char *auth_extra, size_t auth_extra_len );
-
-#endif
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-/**
- * \brief          Set the hostname to check against the received server
- *                 certificate. It sets the ServerName TLS extension too,
- *                 if the extension is enabled.
- *                 (client-side only)
- *
- * \param ssl      SSL context
- * \param hostname the server hostname
- *
- * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_set_hostname( mbedtls_ssl_context *ssl, const char *hostname );
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-
-#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION)
-/**
- * \brief          Set own certificate and key for the current handshake
- *
- * \note           Same as \c mbedtls_ssl_conf_own_cert() but for use within
- *                 the SNI callback.
- *
- * \param ssl      SSL context
- * \param own_cert own public certificate chain
- * \param pk_key   own private key
- *
- * \return         0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED
- */
-int mbedtls_ssl_set_hs_own_cert( mbedtls_ssl_context *ssl,
-                                 mbedtls_x509_crt *own_cert,
-                                 mbedtls_pk_context *pk_key );
-
-/**
- * \brief          Set the data required to verify peer certificate for the
- *                 current handshake
- *
- * \note           Same as \c mbedtls_ssl_conf_ca_chain() but for use within
- *                 the SNI callback.
- *
- * \param ssl      SSL context
- * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs)
- * \param ca_crl   trusted CA CRLs
- */
-void mbedtls_ssl_set_hs_ca_chain( mbedtls_ssl_context *ssl,
-                                  mbedtls_x509_crt *ca_chain,
-                                  mbedtls_x509_crl *ca_crl );
-
-/**
- * \brief          Set authmode for the current handshake.
- *
- * \note           Same as \c mbedtls_ssl_conf_authmode() but for use within
- *                 the SNI callback.
- *
- * \param ssl      SSL context
- * \param authmode MBEDTLS_SSL_VERIFY_NONE, MBEDTLS_SSL_VERIFY_OPTIONAL or
- *                 MBEDTLS_SSL_VERIFY_REQUIRED
- */
-void mbedtls_ssl_set_hs_authmode( mbedtls_ssl_context *ssl,
-                                  int authmode );
-
-/**
- * \brief          Set server side ServerName TLS extension callback
- *                 (optional, server-side only).
- *
- *                 If set, the ServerName callback is called whenever the
- *                 server receives a ServerName TLS extension from the client
- *                 during a handshake. The ServerName callback has the
- *                 following parameters: (void *parameter, mbedtls_ssl_context *ssl,
- *                 const unsigned char *hostname, size_t len). If a suitable
- *                 certificate is found, the callback must set the
- *                 certificate(s) and key(s) to use with \c
- *                 mbedtls_ssl_set_hs_own_cert() (can be called repeatedly),
- *                 and may optionally adjust the CA and associated CRL with \c
- *                 mbedtls_ssl_set_hs_ca_chain() as well as the client
- *                 authentication mode with \c mbedtls_ssl_set_hs_authmode(),
- *                 then must return 0. If no matching name is found, the
- *                 callback must either set a default cert, or
- *                 return non-zero to abort the handshake at this point.
- *
- * \param conf     SSL configuration
- * \param f_sni    verification function
- * \param p_sni    verification parameter
- */
-void mbedtls_ssl_conf_sni( mbedtls_ssl_config *conf,
-                  int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *,
-                               size_t),
-                  void *p_sni );
-#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */
-
-#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
-/**
- * \brief          Set the EC J-PAKE password for current handshake.
- *
- * \note           An internal copy is made, and destroyed as soon as the
- *                 handshake is completed, or when the SSL context is reset or
- *                 freed.
- *
- * \note           The SSL context needs to be already set up. The right place
- *                 to call this function is between \c mbedtls_ssl_setup() or
- *                 \c mbedtls_ssl_reset() and \c mbedtls_ssl_handshake().
- *
- * \param ssl      SSL context
- * \param pw       EC J-PAKE password (pre-shared secret)
- * \param pw_len   length of pw in bytes
- *
- * \return         0 on success, or a negative error code.
- */
-int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl,
-                                         const unsigned char *pw,
-                                         size_t pw_len );
-#endif /*MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
-
-#if defined(MBEDTLS_SSL_ALPN)
-/**
- * \brief          Set the supported Application Layer Protocols.
- *
- * \param conf     SSL configuration
- * \param protos   Pointer to a NULL-terminated list of supported protocols,
- *                 in decreasing preference order. The pointer to the list is
- *                 recorded by the library for later reference as required, so
- *                 the lifetime of the table must be atleast as long as the
- *                 lifetime of the SSL configuration structure.
- *
- * \return         0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA.
- */
-int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **protos );
-
-/**
- * \brief          Get the name of the negotiated Application Layer Protocol.
- *                 This function should be called after the handshake is
- *                 completed.
- *
- * \param ssl      SSL context
- *
- * \return         Protcol name, or NULL if no protocol was negotiated.
- */
-const char *mbedtls_ssl_get_alpn_protocol( const mbedtls_ssl_context *ssl );
-#endif /* MBEDTLS_SSL_ALPN */
-
-/**
- * \brief          Set the maximum supported version sent from the client side
- *                 and/or accepted at the server side
- *                 (Default: MBEDTLS_SSL_MAX_MAJOR_VERSION, MBEDTLS_SSL_MAX_MINOR_VERSION)
- *
- * \note           This ignores ciphersuites from higher versions.
- *
- * \note           With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and
- *                 MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
- *
- * \param conf     SSL configuration
- * \param major    Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported)
- * \param minor    Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
- *                 MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
- *                 MBEDTLS_SSL_MINOR_VERSION_3 supported)
- */
-void mbedtls_ssl_conf_max_version( mbedtls_ssl_config *conf, int major, int minor );
-
-/**
- * \brief          Set the minimum accepted SSL/TLS protocol version
- *                 (Default: TLS 1.0)
- *
- * \note           Input outside of the SSL_MAX_XXXXX_VERSION and
- *                 SSL_MIN_XXXXX_VERSION range is ignored.
- *
- * \note           MBEDTLS_SSL_MINOR_VERSION_0 (SSL v3) should be avoided.
- *
- * \note           With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and
- *                 MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
- *
- * \param conf     SSL configuration
- * \param major    Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported)
- * \param minor    Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
- *                 MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
- *                 MBEDTLS_SSL_MINOR_VERSION_3 supported)
- */
-void mbedtls_ssl_conf_min_version( mbedtls_ssl_config *conf, int major, int minor );
-
-#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C)
-/**
- * \brief          Set the fallback flag (client-side only).
- *                 (Default: MBEDTLS_SSL_IS_NOT_FALLBACK).
- *
- * \note           Set to MBEDTLS_SSL_IS_FALLBACK when preparing a fallback
- *                 connection, that is a connection with max_version set to a
- *                 lower value than the value you're willing to use. Such
- *                 fallback connections are not recommended but are sometimes
- *                 necessary to interoperate with buggy (version-intolerant)
- *                 servers.
- *
- * \warning        You should NOT set this to MBEDTLS_SSL_IS_FALLBACK for
- *                 non-fallback connections! This would appear to work for a
- *                 while, then cause failures when the server is upgraded to
- *                 support a newer TLS version.
- *
- * \param conf     SSL configuration
- * \param fallback MBEDTLS_SSL_IS_NOT_FALLBACK or MBEDTLS_SSL_IS_FALLBACK
- */
-void mbedtls_ssl_conf_fallback( mbedtls_ssl_config *conf, char fallback );
-#endif /* MBEDTLS_SSL_FALLBACK_SCSV && MBEDTLS_SSL_CLI_C */
-
-#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC)
-/**
- * \brief           Enable or disable Encrypt-then-MAC
- *                  (Default: MBEDTLS_SSL_ETM_ENABLED)
- *
- * \note            This should always be enabled, it is a security
- *                  improvement, and should not cause any interoperability
- *                  issue (used only if the peer supports it too).
- *
- * \param conf      SSL configuration
- * \param etm       MBEDTLS_SSL_ETM_ENABLED or MBEDTLS_SSL_ETM_DISABLED
- */
-void mbedtls_ssl_conf_encrypt_then_mac( mbedtls_ssl_config *conf, char etm );
-#endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */
-
-#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET)
-/**
- * \brief           Enable or disable Extended Master Secret negotiation.
- *                  (Default: MBEDTLS_SSL_EXTENDED_MS_ENABLED)
- *
- * \note            This should always be enabled, it is a security fix to the
- *                  protocol, and should not cause any interoperability issue
- *                  (used only if the peer supports it too).
- *
- * \param conf      SSL configuration
- * \param ems       MBEDTLS_SSL_EXTENDED_MS_ENABLED or MBEDTLS_SSL_EXTENDED_MS_DISABLED
- */
-void mbedtls_ssl_conf_extended_master_secret( mbedtls_ssl_config *conf, char ems );
-#endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */
-
-#if defined(MBEDTLS_ARC4_C)
-/**
- * \brief          Disable or enable support for RC4
- *                 (Default: MBEDTLS_SSL_ARC4_DISABLED)
- *
- * \warning        Use of RC4 in DTLS/TLS has been prohibited by RFC 7465
- *                 for security reasons. Use at your own risk.
- *
- * \note           This function is deprecated and will likely be removed in
- *                 a future version of the library.
- *                 RC4 is disabled by default at compile time and needs to be
- *                 actively enabled for use with legacy systems.
- *
- * \param conf     SSL configuration
- * \param arc4     MBEDTLS_SSL_ARC4_ENABLED or MBEDTLS_SSL_ARC4_DISABLED
- */
-void mbedtls_ssl_conf_arc4_support( mbedtls_ssl_config *conf, char arc4 );
-#endif /* MBEDTLS_ARC4_C */
-
-#if defined(MBEDTLS_SSL_SRV_C)
-/**
- * \brief          Whether to send a list of acceptable CAs in
- *                 CertificateRequest messages.
- *                 (Default: do send)
- *
- * \param conf     SSL configuration
- * \param cert_req_ca_list   MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED or
- *                          MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED
- */
-void mbedtls_ssl_conf_cert_req_ca_list( mbedtls_ssl_config *conf,
-                                          char cert_req_ca_list );
-#endif /* MBEDTLS_SSL_SRV_C */
-
-#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
-/**
- * \brief          Set the maximum fragment length to emit and/or negotiate
- *                 (Default: MBEDTLS_SSL_MAX_CONTENT_LEN, usually 2^14 bytes)
- *                 (Server: set maximum fragment length to emit,
- *                 usually negotiated by the client during handshake
- *                 (Client: set maximum fragment length to emit *and*
- *                 negotiate with the server during handshake)
- *
- * \param conf     SSL configuration
- * \param mfl_code Code for maximum fragment length (allowed values:
- *                 MBEDTLS_SSL_MAX_FRAG_LEN_512,  MBEDTLS_SSL_MAX_FRAG_LEN_1024,
- *                 MBEDTLS_SSL_MAX_FRAG_LEN_2048, MBEDTLS_SSL_MAX_FRAG_LEN_4096)
- *
- * \return         0 if successful or MBEDTLS_ERR_SSL_BAD_INPUT_DATA
- */
-int mbedtls_ssl_conf_max_frag_len( mbedtls_ssl_config *conf, unsigned char mfl_code );
-#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
-
-#if defined(MBEDTLS_SSL_TRUNCATED_HMAC)
-/**
- * \brief          Activate negotiation of truncated HMAC
- *                 (Default: MBEDTLS_SSL_TRUNC_HMAC_DISABLED)
- *
- * \param conf     SSL configuration
- * \param truncate Enable or disable (MBEDTLS_SSL_TRUNC_HMAC_ENABLED or
- *                                    MBEDTLS_SSL_TRUNC_HMAC_DISABLED)
- */
-void mbedtls_ssl_conf_truncated_hmac( mbedtls_ssl_config *conf, int truncate );
-#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */
-
-#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING)
-/**
- * \brief          Enable / Disable 1/n-1 record splitting
- *                 (Default: MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED)
- *
- * \note           Only affects SSLv3 and TLS 1.0, not higher versions.
- *                 Does not affect non-CBC ciphersuites in any version.
- *
- * \param conf     SSL configuration
- * \param split    MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED or
- *                 MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED
- */
-void mbedtls_ssl_conf_cbc_record_splitting( mbedtls_ssl_config *conf, char split );
-#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */
-
-#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C)
-/**
- * \brief          Enable / Disable session tickets (client only).
- *                 (Default: MBEDTLS_SSL_SESSION_TICKETS_ENABLED.)
- *
- * \note           On server, use \c mbedtls_ssl_conf_session_tickets_cb().
- *
- * \param conf     SSL configuration
- * \param use_tickets   Enable or disable (MBEDTLS_SSL_SESSION_TICKETS_ENABLED or
- *                                         MBEDTLS_SSL_SESSION_TICKETS_DISABLED)
- */
-void mbedtls_ssl_conf_session_tickets( mbedtls_ssl_config *conf, int use_tickets );
-#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */
-
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-/**
- * \brief          Enable / Disable renegotiation support for connection when
- *                 initiated by peer
- *                 (Default: MBEDTLS_SSL_RENEGOTIATION_DISABLED)
- *
- * \warning        It is recommended to always disable renegotation unless you
- *                 know you need it and you know what you're doing. In the
- *                 past, there have been several issues associated with
- *                 renegotiation or a poor understanding of its properties.
- *
- * \note           Server-side, enabling renegotiation also makes the server
- *                 susceptible to a resource DoS by a malicious client.
- *
- * \param conf    SSL configuration
- * \param renegotiation     Enable or disable (MBEDTLS_SSL_RENEGOTIATION_ENABLED or
- *                                             MBEDTLS_SSL_RENEGOTIATION_DISABLED)
- */
-void mbedtls_ssl_conf_renegotiation( mbedtls_ssl_config *conf, int renegotiation );
-#endif /* MBEDTLS_SSL_RENEGOTIATION */
-
-/**
- * \brief          Prevent or allow legacy renegotiation.
- *                 (Default: MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION)
- *
- *                 MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION allows connections to
- *                 be established even if the peer does not support
- *                 secure renegotiation, but does not allow renegotiation
- *                 to take place if not secure.
- *                 (Interoperable and secure option)
- *
- *                 MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION allows renegotiations
- *                 with non-upgraded peers. Allowing legacy renegotiation
- *                 makes the connection vulnerable to specific man in the
- *                 middle attacks. (See RFC 5746)
- *                 (Most interoperable and least secure option)
- *
- *                 MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE breaks off connections
- *                 if peer does not support secure renegotiation. Results
- *                 in interoperability issues with non-upgraded peers
- *                 that do not support renegotiation altogether.
- *                 (Most secure option, interoperability issues)
- *
- * \param conf     SSL configuration
- * \param allow_legacy  Prevent or allow (SSL_NO_LEGACY_RENEGOTIATION,
- *                                        SSL_ALLOW_LEGACY_RENEGOTIATION or
- *                                        MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE)
- */
-void mbedtls_ssl_conf_legacy_renegotiation( mbedtls_ssl_config *conf, int allow_legacy );
-
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-/**
- * \brief          Enforce renegotiation requests.
- *                 (Default: enforced, max_records = 16)
- *
- *                 When we request a renegotiation, the peer can comply or
- *                 ignore the request. This function allows us to decide
- *                 whether to enforce our renegotiation requests by closing
- *                 the connection if the peer doesn't comply.
- *
- *                 However, records could already be in transit from the peer
- *                 when the request is emitted. In order to increase
- *                 reliability, we can accept a number of records before the
- *                 expected handshake records.
- *
- *                 The optimal value is highly dependent on the specific usage
- *                 scenario.
- *
- * \note           With DTLS and server-initiated renegotiation, the
- *                 HelloRequest is retransmited every time mbedtls_ssl_read() times
- *                 out or receives Application Data, until:
- *                 - max_records records have beens seen, if it is >= 0, or
- *                 - the number of retransmits that would happen during an
- *                 actual handshake has been reached.
- *                 Please remember the request might be lost a few times
- *                 if you consider setting max_records to a really low value.
- *
- * \warning        On client, the grace period can only happen during
- *                 mbedtls_ssl_read(), as opposed to mbedtls_ssl_write() and mbedtls_ssl_renegotiate()
- *                 which always behave as if max_record was 0. The reason is,
- *                 if we receive application data from the server, we need a
- *                 place to write it, which only happens during mbedtls_ssl_read().
- *
- * \param conf     SSL configuration
- * \param max_records Use MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED if you don't want to
- *                 enforce renegotiation, or a non-negative value to enforce
- *                 it but allow for a grace period of max_records records.
- */
-void mbedtls_ssl_conf_renegotiation_enforced( mbedtls_ssl_config *conf, int max_records );
-
-/**
- * \brief          Set record counter threshold for periodic renegotiation.
- *                 (Default: 2^48 - 1)
- *
- *                 Renegotiation is automatically triggered when a record
- *                 counter (outgoing or ingoing) crosses the defined
- *                 threshold. The default value is meant to prevent the
- *                 connection from being closed when the counter is about to
- *                 reached its maximal value (it is not allowed to wrap).
- *
- *                 Lower values can be used to enforce policies such as "keys
- *                 must be refreshed every N packets with cipher X".
- *
- *                 The renegotiation period can be disabled by setting
- *                 conf->disable_renegotiation to
- *                 MBEDTLS_SSL_RENEGOTIATION_DISABLED.
- *
- * \note           When the configured transport is
- *                 MBEDTLS_SSL_TRANSPORT_DATAGRAM the maximum renegotiation
- *                 period is 2^48 - 1, and for MBEDTLS_SSL_TRANSPORT_STREAM,
- *                 the maximum renegotiation period is 2^64 - 1.
- *
- * \param conf     SSL configuration
- * \param period   The threshold value: a big-endian 64-bit number.
- */
-void mbedtls_ssl_conf_renegotiation_period( mbedtls_ssl_config *conf,
-                                   const unsigned char period[8] );
-#endif /* MBEDTLS_SSL_RENEGOTIATION */
-
-/**
- * \brief          Return the number of data bytes available to read
- *
- * \param ssl      SSL context
- *
- * \return         how many bytes are available in the read buffer
- */
-size_t mbedtls_ssl_get_bytes_avail( const mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Return the result of the certificate verification
- *
- * \param ssl      SSL context
- *
- * \return         0 if successful,
- *                 -1 if result is not available (eg because the handshake was
- *                 aborted too early), or
- *                 a combination of BADCERT_xxx and BADCRL_xxx flags, see
- *                 x509.h
- */
-uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Return the name of the current ciphersuite
- *
- * \param ssl      SSL context
- *
- * \return         a string containing the ciphersuite name
- */
-const char *mbedtls_ssl_get_ciphersuite( const mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Return the current SSL version (SSLv3/TLSv1/etc)
- *
- * \param ssl      SSL context
- *
- * \return         a string containing the SSL version
- */
-const char *mbedtls_ssl_get_version( const mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Return the (maximum) number of bytes added by the record
- *                 layer: header + encryption/MAC overhead (inc. padding)
- *
- * \param ssl      SSL context
- *
- * \return         Current maximum record expansion in bytes, or
- *                 MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE if compression is
- *                 enabled, which makes expansion much less predictable
- */
-int mbedtls_ssl_get_record_expansion( const mbedtls_ssl_context *ssl );
-
-#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH)
-/**
- * \brief          Return the maximum fragment length (payload, in bytes).
- *                 This is the value negotiated with peer if any,
- *                 or the locally configured value.
- *
- * \note           With DTLS, \c mbedtls_ssl_write() will return an error if
- *                 called with a larger length value.
- *                 With TLS, \c mbedtls_ssl_write() will fragment the input if
- *                 necessary and return the number of bytes written; it is up
- *                 to the caller to call \c mbedtls_ssl_write() again in
- *                 order to send the remaining bytes if any.
- *
- * \param ssl      SSL context
- *
- * \return         Current maximum fragment length.
- */
-size_t mbedtls_ssl_get_max_frag_len( const mbedtls_ssl_context *ssl );
-#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */
-
-#if defined(MBEDTLS_X509_CRT_PARSE_C)
-/**
- * \brief          Return the peer certificate from the current connection
- *
- *                 Note: Can be NULL in case no certificate was sent during
- *                 the handshake. Different calls for the same connection can
- *                 return the same or different pointers for the same
- *                 certificate and even a different certificate altogether.
- *                 The peer cert CAN change in a single connection if
- *                 renegotiation is performed.
- *
- * \param ssl      SSL context
- *
- * \return         the current peer certificate
- */
-const mbedtls_x509_crt *mbedtls_ssl_get_peer_cert( const mbedtls_ssl_context *ssl );
-#endif /* MBEDTLS_X509_CRT_PARSE_C */
-
-#if defined(MBEDTLS_SSL_CLI_C)
-/**
- * \brief          Save session in order to resume it later (client-side only)
- *                 Session data is copied to presented session structure.
- *
- * \warning        Currently, peer certificate is lost in the operation.
- *
- * \param ssl      SSL context
- * \param session  session context
- *
- * \return         0 if successful,
- *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed,
- *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or
- *                 arguments are otherwise invalid
- *
- * \sa             mbedtls_ssl_set_session()
- */
-int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl, mbedtls_ssl_session *session );
-#endif /* MBEDTLS_SSL_CLI_C */
-
-/**
- * \brief          Perform the SSL handshake
- *
- * \param ssl      SSL context
- *
- * \return         0 if successful, or
- *                 MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, or
- *                 MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED (see below), or
- *                 a specific SSL error code.
- *
- * \note           If this function returns something other than 0 or
- *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- *
- * \note           If DTLS is in use, then you may choose to handle
- *                 MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED specially for logging
- *                 purposes, as it is an expected return value rather than an
- *                 actual error, but you still need to reset/free the context.
- */
-int mbedtls_ssl_handshake( mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Perform a single step of the SSL handshake
- *
- * \note           The state of the context (ssl->state) will be at
- *                 the next state after execution of this function. Do not
- *                 call this function if state is MBEDTLS_SSL_HANDSHAKE_OVER.
- *
- * \note           If this function returns something other than 0 or
- *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- *
- * \param ssl      SSL context
- *
- * \return         0 if successful, or
- *                 MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, or
- *                 a specific SSL error code.
- */
-int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl );
-
-#if defined(MBEDTLS_SSL_RENEGOTIATION)
-/**
- * \brief          Initiate an SSL renegotiation on the running connection.
- *                 Client: perform the renegotiation right now.
- *                 Server: request renegotiation, which will be performed
- *                 during the next call to mbedtls_ssl_read() if honored by
- *                 client.
- *
- * \param ssl      SSL context
- *
- * \return         0 if successful, or any mbedtls_ssl_handshake() return
- *                 value.
- *
- * \note           If this function returns something other than 0 or
- *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- */
-int mbedtls_ssl_renegotiate( mbedtls_ssl_context *ssl );
-#endif /* MBEDTLS_SSL_RENEGOTIATION */
-
-/**
- * \brief          Read at most 'len' application data bytes
- *
- * \param ssl      SSL context
- * \param buf      buffer that will hold the data
- * \param len      maximum number of bytes to read
- *
- * \return         the number of bytes read, or
- *                 0 for EOF, or
- *                 MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE, or
- *                 MBEDTLS_ERR_SSL_CLIENT_RECONNECT (see below), or
- *                 another negative error code.
- *
- * \note           If this function returns something other than a positive
- *                 value or MBEDTLS_ERR_SSL_WANT_READ/WRITE or
- *                 MBEDTLS_ERR_SSL_CLIENT_RECONNECT, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- *
- * \note           When this function return MBEDTLS_ERR_SSL_CLIENT_RECONNECT
- *                 (which can only happen server-side), it means that a client
- *                 is initiating a new connection using the same source port.
- *                 You can either treat that as a connection close and wait
- *                 for the client to resend a ClientHello, or directly
- *                 continue with \c mbedtls_ssl_handshake() with the same
- *                 context (as it has beeen reset internally). Either way, you
- *                 should make sure this is seen by the application as a new
- *                 connection: application state, if any, should be reset, and
- *                 most importantly the identity of the client must be checked
- *                 again. WARNING: not validating the identity of the client
- *                 again, or not transmitting the new identity to the
- *                 application layer, would allow authentication bypass!
- */
-int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len );
-
-/**
- * \brief          Try to write exactly 'len' application data bytes
- *
- * \warning        This function will do partial writes in some cases. If the
- *                 return value is non-negative but less than length, the
- *                 function must be called again with updated arguments:
- *                 buf + ret, len - ret (if ret is the return value) until
- *                 it returns a value equal to the last 'len' argument.
- *
- * \param ssl      SSL context
- * \param buf      buffer holding the data
- * \param len      how many bytes must be written
- *
- * \return         the number of bytes actually written (may be less than len),
- *                 or MBEDTLS_ERR_SSL_WANT_WRITE or MBEDTLS_ERR_SSL_WANT_READ,
- *                 or another negative error code.
- *
- * \note           If this function returns something other than a positive
- *                 value or MBEDTLS_ERR_SSL_WANT_READ/WRITE, the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- *
- * \note           When this function returns MBEDTLS_ERR_SSL_WANT_WRITE/READ,
- *                 it must be called later with the *same* arguments,
- *                 until it returns a positive value.
- *
- * \note           If the requested length is greater than the maximum
- *                 fragment length (either the built-in limit or the one set
- *                 or negotiated with the peer), then:
- *                 - with TLS, less bytes than requested are written.
- *                 - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned.
- *                 \c mbedtls_ssl_get_max_frag_len() may be used to query the
- *                 active maximum fragment length.
- */
-int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len );
-
-/**
- * \brief           Send an alert message
- *
- * \param ssl       SSL context
- * \param level     The alert level of the message
- *                  (MBEDTLS_SSL_ALERT_LEVEL_WARNING or MBEDTLS_SSL_ALERT_LEVEL_FATAL)
- * \param message   The alert message (SSL_ALERT_MSG_*)
- *
- * \return          0 if successful, or a specific SSL error code.
- *
- * \note           If this function returns something other than 0 or
- *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- */
-int mbedtls_ssl_send_alert_message( mbedtls_ssl_context *ssl,
-                            unsigned char level,
-                            unsigned char message );
-/**
- * \brief          Notify the peer that the connection is being closed
- *
- * \param ssl      SSL context
- *
- * \return          0 if successful, or a specific SSL error code.
- *
- * \note           If this function returns something other than 0 or
- *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, then the ssl context
- *                 becomes unusable, and you should either free it or call
- *                 \c mbedtls_ssl_session_reset() on it before re-using it for
- *                 a new connection; the current connection must be closed.
- */
-int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Free referenced items in an SSL context and clear memory
- *
- * \param ssl      SSL context
- */
-void mbedtls_ssl_free( mbedtls_ssl_context *ssl );
-
-/**
- * \brief          Initialize an SSL configuration context
- *                 Just makes the context ready for
- *                 mbedtls_ssl_config_defaults() or mbedtls_ssl_config_free().
- *
- * \note           You need to call mbedtls_ssl_config_defaults() unless you
- *                 manually set all of the relevent fields yourself.
- *
- * \param conf     SSL configuration context
- */
-void mbedtls_ssl_config_init( mbedtls_ssl_config *conf );
-
-/**
- * \brief          Load reasonnable default SSL configuration values.
- *                 (You need to call mbedtls_ssl_config_init() first.)
- *
- * \param conf     SSL configuration context
- * \param endpoint MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER
- * \param transport MBEDTLS_SSL_TRANSPORT_STREAM for TLS, or
- *                  MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS
- * \param preset   a MBEDTLS_SSL_PRESET_XXX value
- *
- * \note           See \c mbedtls_ssl_conf_transport() for notes on DTLS.
- *
- * \return         0 if successful, or
- *                 MBEDTLS_ERR_XXX_ALLOC_FAILED on memory allocation error.
- */
-int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
-                                 int endpoint, int transport, int preset );
-
-/**
- * \brief          Free an SSL configuration context
- *
- * \param conf     SSL configuration context
- */
-void mbedtls_ssl_config_free( mbedtls_ssl_config *conf );
-
-/**
- * \brief          Initialize SSL session structure
- *
- * \param session  SSL session
- */
-void mbedtls_ssl_session_init( mbedtls_ssl_session *session );
-
-/**
- * \brief          Free referenced items in an SSL session including the
- *                 peer certificate and clear memory
- *
- * \param session  SSL session
- */
-void mbedtls_ssl_session_free( mbedtls_ssl_session *session );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ssl.h */

+ 0 - 494
iotkit-embedded/src/import/ubuntu/include/itls/ssl_ciphersuites.h

@@ -1,494 +0,0 @@
-/**
- * \file ssl_ciphersuites.h
- *
- * \brief SSL Ciphersuites for mbed TLS
- *
- *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- *
- *  This file is part of mbed TLS (https://tls.mbed.org)
- */
-#ifndef MBEDTLS_SSL_CIPHERSUITES_H
-#define MBEDTLS_SSL_CIPHERSUITES_H
-
-#include "cipher.h"
-#include "md.h"
-
-#if defined(MBEDTLS_PK_C)
-#include "pk.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Supported ciphersuites (Official IANA names)
- */
-#define MBEDTLS_TLS_RSA_WITH_NULL_MD5                    0x01   /**< Weak! */
-#define MBEDTLS_TLS_RSA_WITH_NULL_SHA                    0x02   /**< Weak! */
-
-#define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5                 0x04
-#define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA                 0x05
-#define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA                 0x09   /**< Weak! Not in TLS 1.2 */
-
-#define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA            0x0A
-
-#define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA             0x15   /**< Weak! Not in TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA        0x16
-
-#define MBEDTLS_TLS_PSK_WITH_NULL_SHA                    0x2C   /**< Weak! */
-#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA                0x2D   /**< Weak! */
-#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA                0x2E   /**< Weak! */
-#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA             0x2F
-
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA         0x33
-#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA             0x35
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA         0x39
-
-#define MBEDTLS_TLS_RSA_WITH_NULL_SHA256                 0x3B   /**< Weak! */
-#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256          0x3C   /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256          0x3D   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA        0x41
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA    0x45
-
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256      0x67   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256      0x6B   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA        0x84
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA    0x88
-
-#define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA                 0x8A
-#define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA            0x8B
-#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA             0x8C
-#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA             0x8D
-
-#define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA             0x8E
-#define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA        0x8F
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA         0x90
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA         0x91
-
-#define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA             0x92
-#define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA        0x93
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA         0x94
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA         0x95
-
-#define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256          0x9C   /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384          0x9D   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256      0x9E   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384      0x9F   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256          0xA8   /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384          0xA9   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256      0xAA   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384      0xAB   /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256      0xAC   /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384      0xAD   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256          0xAE
-#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384          0xAF
-#define MBEDTLS_TLS_PSK_WITH_NULL_SHA256                 0xB0   /**< Weak! */
-#define MBEDTLS_TLS_PSK_WITH_NULL_SHA384                 0xB1   /**< Weak! */
-
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256      0xB2
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384      0xB3
-#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256             0xB4   /**< Weak! */
-#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384             0xB5   /**< Weak! */
-
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256      0xB6
-#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384      0xB7
-#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256             0xB8   /**< Weak! */
-#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384             0xB9   /**< Weak! */
-
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256     0xBA   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256     0xC0   /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4   /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA             0xC001 /**< Weak! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA          0xC002 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA     0xC003 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA      0xC004 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA      0xC005 /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA            0xC006 /**< Weak! */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA         0xC007 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC008 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA     0xC009 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA     0xC00A /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA               0xC00B /**< Weak! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA            0xC00C /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA       0xC00D /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA        0xC00E /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA        0xC00F /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA              0xC010 /**< Weak! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA           0xC011 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA      0xC012 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA       0xC013 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA       0xC014 /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256  0xC023 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384  0xC024 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256   0xC025 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384   0xC026 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256    0xC027 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384    0xC028 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256     0xC029 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384     0xC02A /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256  0xC02B /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384  0xC02C /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256   0xC02D /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384   0xC02E /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256    0xC02F /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384    0xC030 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256     0xC031 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384     0xC032 /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA           0xC033 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA      0xC034 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA       0xC035 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA       0xC036 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256    0xC037 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384    0xC038 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA              0xC039 /**< Weak! No SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256           0xC03A /**< Weak! No SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384           0xC03B /**< Weak! No SSL3! */
-
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256  0xC074 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384  0xC075 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256   0xC076 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384   0xC077 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256    0xC078 /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384    0xC079 /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256         0xC07A /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384         0xC07B /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256     0xC07C /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384     0xC07D /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256  0xC088 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384  0xC089 /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256   0xC08A /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384   0xC08B /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256    0xC08C /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384    0xC08D /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256       0xC08E /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384       0xC08F /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC090 /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC091 /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256   0xC092 /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384   0xC093 /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256       0xC094
-#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384       0xC095
-#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256   0xC096
-#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC097
-#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256   0xC098
-#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384   0xC099
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */
-#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */
-
-#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM                0xC09C  /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM                0xC09D  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM            0xC09E  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM            0xC09F  /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8              0xC0A0  /**< TLS 1.2 */
-#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8              0xC0A1  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8          0xC0A2  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8          0xC0A3  /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM                0xC0A4  /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM                0xC0A5  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM            0xC0A6  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM            0xC0A7  /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8              0xC0A8  /**< TLS 1.2 */
-#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8              0xC0A9  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8          0xC0AA  /**< TLS 1.2 */
-#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8          0xC0AB  /**< TLS 1.2 */
-/* The last two are named with PSK_DHE in the RFC, which looks like a typo */
-
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM        0xC0AC  /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM        0xC0AD  /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8      0xC0AE  /**< TLS 1.2 */
-#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8      0xC0AF  /**< TLS 1.2 */
-
-#define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8          0xC0FF  /**< experimental */
-
-#define MBEDTLS_TLS_ID2_WITH_AES_128_CBC_SHA            0xD001
-#define MBEDTLS_TLS_ID2_WITH_AES_256_CBC_SHA            0xD002
-#define MBEDTLS_TLS_ID2_WITH_AES_128_CBC_SHA256         0xD003
-#define MBEDTLS_TLS_ID2_WITH_AES_256_CBC_SHA256         0xD004
-
-/* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange.
- * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below
- */
-typedef enum {
-    MBEDTLS_KEY_EXCHANGE_NONE = 0,
-    MBEDTLS_KEY_EXCHANGE_RSA,
-    MBEDTLS_KEY_EXCHANGE_DHE_RSA,
-    MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
-    MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
-    MBEDTLS_KEY_EXCHANGE_PSK,
-    MBEDTLS_KEY_EXCHANGE_DHE_PSK,
-    MBEDTLS_KEY_EXCHANGE_RSA_PSK,
-    MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
-    MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
-    MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
-    MBEDTLS_KEY_EXCHANGE_ECJPAKE,
-    MBEDTLS_KEY_EXCHANGE_ID2 = 0xF,
-} mbedtls_key_exchange_type_t;
-
-/* Key exchanges using a certificate */
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)           || \
-    defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)   || \
-    defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)      || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED
-#endif
-
-/* Key exchanges allowing client certificate requests */
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)           ||       \
-    defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)       ||       \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)      ||       \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)     ||       \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)    ||       \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) 
-#define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED
-#endif
-
-/* Key exchanges involving server signature in ServerKeyExchange */
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED
-#endif
-
-/* Key exchanges using ECDH */
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED)      || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED
-#endif
-
-/* Key exchanges that don't involve ephemeral keys */
-#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED)           || \
-    defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)           || \
-    defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED
-#endif
-
-/* Key exchanges that involve ephemeral keys */
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)   || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED
-#endif
-
-/* Key exchanges using a PSK */
-#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED)           || \
-    defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
-#endif
-
-/* Key exchanges using DHE */
-#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED)       || \
-    defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED
-#endif
-
-/* Key exchanges using ECDHE */
-#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED)     || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED)   || \
-    defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED)
-#define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED
-#endif
-
-typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t;
-
-#define MBEDTLS_CIPHERSUITE_WEAK       0x01    /**< Weak ciphersuite flag  */
-#define MBEDTLS_CIPHERSUITE_SHORT_TAG  0x02    /**< Short authentication tag,
-                                                     eg for CCM_8 */
-#define MBEDTLS_CIPHERSUITE_NODTLS     0x04    /**< Can't be used with DTLS */
-
-/**
- * \brief   This structure is used for storing ciphersuite information
- */
-struct mbedtls_ssl_ciphersuite_t
-{
-    int id;
-    const char * name;
-
-    mbedtls_cipher_type_t cipher;
-    mbedtls_md_type_t mac;
-    mbedtls_key_exchange_type_t key_exchange;
-
-    int min_major_ver;
-    int min_minor_ver;
-    int max_major_ver;
-    int max_minor_ver;
-
-    unsigned char flags;
-};
-
-const int *mbedtls_ssl_list_ciphersuites( void );
-
-const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name );
-const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id );
-
-#if defined(MBEDTLS_PK_C)
-mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info );
-mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info );
-#endif
-
-int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info );
-int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info );
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED)
-static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
-        case MBEDTLS_KEY_EXCHANGE_ECJPAKE:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED)
-static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
-        case MBEDTLS_KEY_EXCHANGE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_PSK:
-        case MBEDTLS_KEY_EXCHANGE_RSA_PSK:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED)
-static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED */
-
-static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDH_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED)
-static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_DHE_PSK:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED) */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED)
-static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED) */
-
-#if defined(MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED)
-static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info )
-{
-    switch( info->key_exchange )
-    {
-        case MBEDTLS_KEY_EXCHANGE_DHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA:
-        case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA:
-            return( 1 );
-
-        default:
-            return( 0 );
-    }
-}
-#endif /* MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ssl_ciphersuites.h */

+ 0 - 200
iotkit-embedded/src/import/ubuntu/include/tfs/tfs.h

@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2014-2016 Alibaba Group. All rights reserved.
- * License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-
-#ifndef __TFS_ID2_H
-#define __TFS_ID2_H
-
-#include <stdint.h>
-
-/* ID2 length */
-#define TFS_ID2_LEN           24
-/* for 3DES sign len is 16 + 8, for rsa sign len is 128 */
-#define TFS_ID2_SIGN_SIZE     128
-
-/* AES padding type*/
-#define TFS_AES_PKCS7_PADDING 0X01
-#define TFS_AES_ZERO_PADDING  0X02
-#define TFS_AES_NO_PADDING    0X03
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @brief get ID2 informaiton
- *
- * @param[out] id2: the mem must >= TFS_ID2_LEN.
- * @param[inout] len: TFS_ID2_LEN.
- * @return: 0~OK, other~ERROR.
- * @note None.
- */
-int tfs_get_ID2(uint8_t *id2, uint32_t *len);
-
-/**
- * @brief decrypt cipher text with ID2 key
- *
- * @param[in] in: input data.
- * @param[in] in_len: length of intput data, which must <= 4096 bytes.
- * @param[out] out: decrypted data.
- * @param[inout] out_len: the length of decrypted data.
- * @return: 0~OK, other~ERROR.
- * @note None.
- */
-int tfs_id2_decrypt(const uint8_t *in, uint32_t in_len,
-                    uint8_t *out, uint32_t *out_len);
-
-/**
- * @brief get auth code, challenge mode
- *
- * @param[in] challenge: sRandom from ID2 server.
- * @param[in] extra: extra data, optional, no more than 512 bytes.
- * @param[in] extra_len: length of extra data, which must <= 512 bytes.
- * @param[out] auth_code: auth code.
- * @param[out] len: length of auth code.
- * @return: 0~OK, other~ERROR.
- * @note None.
- */
-int tfs_id2_get_challenge_auth_code(const uint8_t *challenge,
-                                    const uint8_t *extra, uint32_t extra_len,
-                                    uint8_t *auth_code, uint32_t *len);
-
-/**
- * @brief get auth code, timestemp mode
- *
- * @param[in] timestamp: timestamp from caller, the number of milliseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).
- * @param[in] extra: extra data, optional, no more than 512 bytes.
- * @param[in] extra_len: length of extra data, which must <= 512 bytes.
- * @param[out] auth_code: auth code.
- * @param[out] len: length of auth code.
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_id2_get_timestamp_auth_code(const uint8_t *timestamp,
-                                    const uint8_t *extra, uint32_t extra_len,
-                                    uint8_t *auth_code, uint32_t *len);
-
-/**
- * @brief write key value
- *
- * @param[in] key: key
- * @param[in] key_len: length of key
- * @param[in] value: value
- * @param[in] value_len: length of value
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_write_key_value(uint8_t *key, uint32_t key_len,
-                        uint8_t *value, uint32_t value_len);
-
-/**
- * @brief read key value
- *
- * @param[in] key: key
- * @param[in] key_len: length of key
- * @param[out] value: value
- * @param[out] value_len: length of value
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_read_key_value(uint8_t *key, uint32_t key_len,
-                       uint8_t *value, uint32_t *value_len);
-
-/**
- * @brief remove key value
- *
- * @param[in] key: key
- * @param[in] key_len: length of key
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_remove_key_value(uint8_t *key, uint32_t key_len);
-
-/**
- * @brief get device challenge
- *
- * @param[out] device_challenge: device challenge
- * @param[in/out] device_challenge_len: length of device challenge
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_id2_get_device_challenge(uint8_t *device_challenge, uint32_t *device_challenge_len);
-/**
- * @brief verify server
- *
- * @param[in] server_auth_code: authcode of server
- * @param[in] server_auth_code_len: authcode length of server
- * @param[in] device_challenge: device challenge, may be NULL if use tfs_id2_get_device_challenge
- * @param[in] device_challenge_len: the length of device_challenge, must 0 if device_challenge = NULL
- * @param[in] server_extra: extra data of server
- * @param[in] server_extra_len: extra data length of server
- * @return: 0~OK, other~ERROR
- * @note None.
- */
-int tfs_id2_verify_server(const uint8_t *server_auth_code, uint32_t server_auth_code_len,
-                          const uint8_t *device_challenge, uint32_t device_challenge_len,
-                          const uint8_t *server_extra, uint32_t server_extra_len);
-
-/**
- * @brief aes128 cbc encryption
- *
- * @param[in] key: key for aes128, key length should be 16 bytes.
- * @param[in/out] iv: initial vector for cbc, iv length should be 16 bytes. iv will be update.
- * @param[in] input_len:input data length, when padding type is nopadding, it should be multiple of 16, which must <= 2MB.
- * @param[in] input: input data for encryption.
- * @param[out] out_len:output data length.
- * @param[out] output: output data for encryption.
- * @param[in] padding: padding type, support pkcs7 padding, zero padding and no padding now.
- * @return: 0~OK, other~ERROR.
- * @note None.
- */
-int32_t tfs_aes128_cbc_enc(const uint8_t *key,
-                           uint8_t *iv,
-                           int32_t input_len,
-                           const uint8_t *input,
-                           int32_t *output_len,
-                           uint8_t *output,
-                           uint8_t padding);
-
-/**
- * @brief aes128 cbc decryption
- *
- * @param[in] key: key for aes128, key length should be 16 bytes.
- * @param[in/out] iv: initial vector for cbc, iv length should be 16 bytes. iv will be update.
- * @param[in] input_len:input data length, it should be multiple of 16, which must <= 2MB.
- * @param[in] input: input data for decryption.
- * @param[out] out_len:output data length.
- * @param[out] output: output data for decryption .
- * @param[in] padding: padding type, support pkcs7 padding, zero padding and no padding now.
- * @return: 0~OK, other~ERROR.
- * @note None.
- */
-int32_t tfs_aes128_cbc_dec(const uint8_t *key,
-                           uint8_t *iv,
-                           int32_t input_len,
-                           const uint8_t *input,
-                           int32_t *output_len,
-                           uint8_t *output,
-                           uint8_t padding);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است