Explorar o código

Merge pull request #8 from SummerGGift/0903_del

 【删除】:非实现功能必要的文件
朱天龙 (Armink) %!s(int64=7) %!d(string=hai) anos
pai
achega
8f83c6d3e9
Modificáronse 100 ficheiros con 2 adicións e 13953 borrados
  1. 2 0
      README.md
  2. 0 26
      azure/.gitattributes
  3. 0 45
      azure/.github/CONTRIBUTING.md
  4. 0 30
      azure/.github/ISSUE_TEMPLATE.md
  5. 0 24
      azure/.github/PULL_REQUEST_TEMPLATE.md
  6. 0 207
      azure/.gitignore
  7. 0 399
      azure/CMakeLists.txt
  8. 0 21
      azure/LICENSE
  9. 0 8
      azure/build_all/arduino/CMakeList.append
  10. 0 88
      azure/build_all/arduino/Makefile.iot
  11. 0 51
      azure/build_all/arduino/build.sh
  12. 0 52
      azure/build_all/arduino/setup.sh
  13. 0 115
      azure/build_all/arduino/setup_sdk.sh
  14. 0 2449
      azure/build_all/docs/Doxyfile
  15. 0 180
      azure/build_all/linux/build.sh
  16. 0 13
      azure/build_all/linux/print_failed_tests.sed
  17. 0 51
      azure/build_all/linux/setup.sh
  18. 0 93
      azure/build_all/linux/setup_opensuse.sh
  19. 0 29
      azure/build_all/mbed/build.cmd
  20. 0 48
      azure/build_all/packaging/linux/apt-get-release.sh
  21. 0 2
      azure/build_all/packaging/linux/debian/azure-iot-sdk-c-dev.dirs
  22. 0 1
      azure/build_all/packaging/linux/debian/azure-iot-sdk-c-dev.install
  23. 0 1
      azure/build_all/packaging/linux/debian/azure-iot-sdk-c-lib.dirs
  24. 0 1
      azure/build_all/packaging/linux/debian/azure-iot-sdk-c-lib.install
  25. 0 5
      azure/build_all/packaging/linux/debian/changelog-trusty
  26. 0 5
      azure/build_all/packaging/linux/debian/changelog-vivid
  27. 0 5
      azure/build_all/packaging/linux/debian/changelog-wily
  28. 0 5
      azure/build_all/packaging/linux/debian/changelog-xenial
  29. 0 1
      azure/build_all/packaging/linux/debian/compat
  30. 0 27
      azure/build_all/packaging/linux/debian/control
  31. 0 26
      azure/build_all/packaging/linux/debian/control-trusty
  32. 0 30
      azure/build_all/packaging/linux/debian/copyright
  33. 0 1
      azure/build_all/packaging/linux/debian/docs
  34. 0 37
      azure/build_all/packaging/linux/debian/rules
  35. 0 1
      azure/build_all/packaging/linux/debian/source/format
  36. 0 54
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport.nuspec
  37. 0 107
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport.targets
  38. 0 9
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport_thirdpartynotice.txt
  39. 0 42
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport.nuspec
  40. 0 101
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport.targets
  41. 0 8
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport_thirdpartynotice.txt
  42. 0 51
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient.nuspec
  43. 0 101
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient.targets
  44. 0 8
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient_thirdpartynotice.txt
  45. 0 55
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport.nuspec
  46. 0 107
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport.targets
  47. 0 8
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport_thirdpartynotice.txt
  48. 0 40
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer.nuspec
  49. 0 101
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer.targets
  50. 0 8
      azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer_thirdpartynotice.txt
  51. 0 92
      azure/build_all/packaging/windows/rebuild_nugets.cmd
  52. 0 59
      azure/build_all/tirtos/Makefile
  53. 0 133
      azure/build_all/tirtos/azureiot.bld
  54. 0 23
      azure/build_all/tirtos/products.mak
  55. 0 47
      azure/build_all/tizenRT/Make.defs
  56. 0 39
      azure/build_all/tizenRT/Makefile
  57. 0 15
      azure/build_all/windows/NuGet.Config
  58. 0 372
      azure/build_all/windows/build.cmd
  59. 0 150
      azure/build_all/windows/build_client.cmd
  60. 0 54
      azure/build_all/windowsce/build.cmd
  61. 0 27
      azure/c-utility/.gitattributes
  62. 0 12
      azure/c-utility/.gitignore
  63. 0 590
      azure/c-utility/CMakeLists.txt
  64. 0 21
      azure/c-utility/LICENSE
  65. 0 93
      azure/c-utility/README.md
  66. 0 16
      azure/c-utility/adapters/README.md
  67. 0 32
      azure/c-utility/adapters/agenttime.c
  68. 0 27
      azure/c-utility/adapters/agenttime_esp8266.c
  69. 0 28
      azure/c-utility/adapters/agenttime_mbed.c
  70. 0 140
      azure/c-utility/adapters/condition_pthreads.c
  71. 0 47
      azure/c-utility/adapters/condition_rtx_mbed.cpp
  72. 0 155
      azure/c-utility/adapters/condition_win32.c
  73. 0 13
      azure/c-utility/adapters/envvariable.c
  74. 0 306
      azure/c-utility/adapters/esp8266_mock.h
  75. 0 972
      azure/c-utility/adapters/httpapi_curl.c
  76. 0 298
      azure/c-utility/adapters/httpapi_tirtos.c
  77. 0 639
      azure/c-utility/adapters/httpapi_wince.c
  78. 0 1050
      azure/c-utility/adapters/httpapi_winhttp.c
  79. 0 75
      azure/c-utility/adapters/linux_time.c
  80. 0 26
      azure/c-utility/adapters/linux_time.h
  81. 0 111
      azure/c-utility/adapters/lock_pthreads.c
  82. 0 96
      azure/c-utility/adapters/lock_rtx_mbed.cpp
  83. 0 112
      azure/c-utility/adapters/lock_win32.c
  84. 0 35
      azure/c-utility/adapters/platform_esp8266.c
  85. 0 34
      azure/c-utility/adapters/platform_freertos.c
  86. 0 68
      azure/c-utility/adapters/platform_linux.c
  87. 0 75
      azure/c-utility/adapters/platform_mbed.cpp
  88. 0 26
      azure/c-utility/adapters/platform_stub.c
  89. 0 28
      azure/c-utility/adapters/platform_tizenrt.c
  90. 0 133
      azure/c-utility/adapters/platform_win32.c
  91. 0 1143
      azure/c-utility/adapters/socketio_berkeley.c
  92. 0 460
      azure/c-utility/adapters/socketio_mbed.c
  93. 0 613
      azure/c-utility/adapters/socketio_win32.c
  94. 0 67
      azure/c-utility/adapters/tcpsocketconnection_c.cpp
  95. 0 31
      azure/c-utility/adapters/threadapi_esp8266.c
  96. 0 137
      azure/c-utility/adapters/threadapi_pthreads.c
  97. 0 140
      azure/c-utility/adapters/threadapi_rtx_mbed.cpp
  98. 0 85
      azure/c-utility/adapters/threadapi_win32.c
  99. 0 56
      azure/c-utility/adapters/tickcounter_esp8266.c
  100. 0 75
      azure/c-utility/adapters/tickcounter_linux.c

+ 2 - 0
README.md

@@ -84,6 +84,8 @@ RT-Thread online packages  --->
 ```
 选择合适的配置项后,使用 `pkgs --update` 命令下载软件包并添加到工程中即可。
 
+**注意:本软件包移植过程中删除了多余的文件,如需要使用完整功能的SDK,可以下载[原始SDK](https://github.com/Azure/azure-iot-sdk-c/tree/5299d0010226fdf2dabb3ac3c1f38eabe4500986)进行对比添加。**
+
 ## 3、使用 Azure 软件包
 
 * 了解软件包提供的功能,请参考 [用户手册](docs/user-guide.md)。

+ 0 - 26
azure/.gitattributes

@@ -1,26 +0,0 @@
-# Default behavior: if Git thinks a file is text (as opposed to binary), it
-# will normalize line endings to LF in the repository, but convert to your
-# platform's native line endings on checkout (e.g., CRLF for Windows).
-* text=auto
-
-# Explicitly declare text files you want to always be normalized and converted
-# to native line endings on checkout. E.g.,
-#*.c text
-
-# Declare files that will always have CRLF line endings on checkout. E.g.,
-#*.sln text eol=crlf
-
-# Declare files that will always have LF line endings on checkout. E.g.,
-*.sh text eol=lf
-
-# Denote all files that should not have line endings normalized, should not be
-# merged, and should not show in a textual diff.
-*.docm binary
-*.docx binary
-*.ico binary
-*.lib binary
-*.png binary
-*.pptx binary
-*.snk binary
-*.vsdx binary
-*.xps binary

+ 0 - 45
azure/.github/CONTRIBUTING.md

@@ -1,45 +0,0 @@
-**The Azure IoT SDKs team wants to hear from you!**
-
-- [Need support?](#need-support)
-- [Contribute code or documentation](#contribute-code-or-documentation)
-
-# Need Support?
-* Have a feature request for SDKs? Please post it on [User Voice](https://feedback.azure.com/forums/321918-azure-iot) to help us prioritize.
-* Have a technical question? Ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-iot-hub) with tag "azure-iot-hub".
-* Need Support? Every customer with an active Azure subscription has access to [support](https://docs.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request) with guaranteed response time.  Consider submitting a ticket and get assistance from Microsoft support team
-* Found a bug? Please help us fix it by thoroughly documenting it and filing an issue on GitHub ([C](https://github.com/Azure/azure-iot-sdk-c), [Java](https://github.com/Azure/azure-iot-sdk-java), [.NET](https://github.com/Azure/azure-iot-sdk-csharp), [Node.js](https://github.com/Azure/azure-iot-sdk-node), [Python](https://github.com/Azure/azure-iot-sdk-python)).
-
-
-*Our SDKs are open-source and we do accept pull-requests if you feel like taking a stab at fixing the bug and maybe adding your name to our commit history :) Please mention any relevant issue number in the pull request description.* Please see [Contribute code](#contribute-code) below.
-
-# Contribute code or documentation
-We require pull-requests for code and documentation to be submitted against the `master` branch in order to review and run it in our gated build system. We try to maintain a high bar for code quality and maintainability, we insist on having tests associated with the code, and if necessary, additions/modifications to the requirement documents.
-
-Also, have you signed the [Contribution License Agreement](https://cla.microsoft.com/) ([CLA](https://cla.microsoft.com/))? A friendly bot will remind you about it when you submit your pull-request.
-
-**If your contribution is going to be a major effort, you should give us a heads-up first. We have a lot of items captured in our backlog and we release every two weeks, so before you spend the time, just check with us to make sure your plans and ours are in sync :) Just open an issue on github and tag it as "contribution".**
-
-## Editing module requirements
-We use requirement documents to describe the expected behavior for each code module. It works as a basis to understand what tests need to be written.
-
-Each requirement has a unique tag that is re-used in the code comments to identify where it's implemented and where it's tested.
-
-Each unique tag is in the following form:
-SRS_<MODULE_NAME>_<DEVELOPER_ID>_<REQUIREMENT_ID>
-
-When contributing to requirement docs, you can use `99` as a DEVELOPER_ID, and just increment the requirement ID to be unique.
-
-For an example see the template in the [Adding new files](#adding-new-files)
-
-## Adding new files
-If your contribution is not part of an already existing code, you must create a new requirement file and a new unit test project. Our team created a template to help you on it. For the requirements you can copy the [template_requirements.md](https://github.com/Azure/azure-c-shared-utility/blob/master/devdoc/template_requirements.md) to the appropriate `devdoc` directory and change it to fits your needs.
-
-For the unit test, copy the directory [template_ut](https://github.com/Azure/azure-c-shared-utility/tree/master/tests/template_ut) to the appropriate `tests` directory and change it to fits your needs. To include your new test suite in the `cmake`, add your new test suite in `test/CMakeLists.txt` with the command `add_subdirectory(template_ut)`.
-
-## Contributing Ports
-We encourage ports of our library to other platforms. Detailed process and guidelines around that process will be provided soon...
-
-## Review Process
-We expect all guidelines to be met before accepting a pull request. As such, we will work with you to address issues we find by leaving comments in your code. Please understand that it may take a few iterations before the code is accepted as we maintain high standards on code quality. Once we feel comfortable with a contribution, we will validate the change and accept the pull request.
-
-Thank you for any contributions! Please let the team know if you have any questions or concerns about our contribution policy.

+ 0 - 30
azure/.github/ISSUE_TEMPLATE.md

@@ -1,30 +0,0 @@
-<!--
-Hi there! thank you for discovering and submitting an issue!
-
-Please use your Azure subscription if you need to share any information from your Azure subscription such as connection strings, service names (IoTHub, Provisioning), etc.
-
-# Need Support?
-* Have a feature request for SDKs? Please post it on [User Voice](https://feedback.azure.com/forums/321918-azure-iot) to help us prioritize.
-* Have a technical question? Ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-iot-hub) with tag "azure-iot-hub".
-* Need Support? Every customer with an active Azure subscription has access to [support](https://docs.microsoft.com/en-us/azure/azure-supportability/how-to-create-azure-support-request) with guaranteed response time.  Consider submitting a ticket and get assistance from Microsoft support team
-* Found a bug? Please help us fix it by thoroughly documenting it and filing an issue on GitHub ([C](https://github.com/Azure/azure-iot-sdk-c), [Java](https://github.com/Azure/azure-iot-sdk-java), [.NET](https://github.com/Azure/azure-iot-sdk-csharp), [Node.js](https://github.com/Azure/azure-iot-sdk-node), [Python](https://github.com/Azure/azure-iot-sdk-python)).
-
-Please first tell us a little bit about the environment you're running:
--->
-
-
-- **OS and version used:** <VERSION> <!-- Windows 10, Ubuntu 15.04... -->
-
-- **SDK version used:** <VERSION> <!-- Please include the SDK version -->
-
-
-# Description of the issue:
-<!-- Please be as detailed as possible: which feature has a problem, how often does it fail,  -->
-
-# Code sample exhibiting the issue:
-<!-- Please remove any connection string information! -->
-
-# Console log of the issue:
-<!-- Please share as much logs as posible, that will help debugging -->
-<!-- Don't forget to remove any connection string information! -->
-

+ 0 - 24
azure/.github/PULL_REQUEST_TEMPLATE.md

@@ -1,24 +0,0 @@
-<!--
-Thank you for helping us improve the Azure IoT C SDK!
-
-Here's a little checklist of things that will help it make its way to the repository: Note that you don't have to check all the boxes, we can help you with that. 
-This being said, the more you do, the quicker it'll go through our gated build! 
---> 
-
-# Checklist
-- [ ] I have read the [contribution guidelines] (https://github.com/Azure/azure-iot-sdk-c/blob/master/.github/CONTRIBUTING.md).
-- [ ] I added or modified the existing tests to cover the change (we do not allow our test coverage to go down).
-- If this is a modification that impacts the behavior of a public API
-  - [ ] I edited the corresponding document in the `devdoc` folder and added or modified requirements.
-- I submitted this PR against the correct branch: 
-  - [ ] This pull-request is submitted against the `master` branch. 
-  - [ ] I have merged the latest `master` branch prior to submission and re-merged as needed after I took any feedback.
-  - [ ] I have squashed my changes into one with a clear description of the change.
-
-# Reference/Link to the issue solved with this PR (if any)
-
-# Description of the problem
-<!-- Please be as precise as possible: what issue you experienced, how often... -->
-
-# Description of the solution
-<!-- How you solved the issue and the other things you considered and maybe rejected --> 

+ 0 - 207
azure/.gitignore

@@ -1,207 +0,0 @@
-# Compiled object files
-*.o
-*.opp
-
-# Compiled static libraries
-*.a
-
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-
-# User-specific files
-*.suo
-*.user
-*.sln.docstates
-
-# Build results
-
-[Dd]ebug/
-[Rr]elease/
-x64/
-[Bb]in/
-[Oo]bj/
-/build/release/Maven
-!/build/release/
-[Cc]make/
-
-# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
-!packages/*/build/
-
-# MSTest test Results
-[Tt]est[Rr]esult*/
-[Bb]uild[Ll]og.*
-
-*_i.c
-*_p.c
-*.ilk
-*.meta
-*.obj
-*.pch
-*.pdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.tmp_proj
-*.log
-*.vspscc
-*.vssscc
-.builds
-*.pidb
-*.log
-*.scc
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opensdf
-*.sdf
-*.cachefile
-
-# Visual Studio profiler
-*.psess
-*.vsp
-*.vspx
-
-# Guidance Automation Toolkit
-*.gpState
-
-# ReSharper is a .NET coding add-in
-_ReSharper*/
-*.[Rr]e[Ss]harper
-*.VC.opendb
-
-# TeamCity is a build add-in
-_TeamCity*
-
-# DotCover is a Code Coverage Tool
-*.dotCover
-
-# NCrunch
-*.ncrunch*
-.*crunch*.local.xml
-
-# Installshield output folder
-[Ee]xpress/
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish/
-
-# Publish Web Output
-*.Publish.xml
-
-# NuGet Packages Directory
-packages/
-
-# Windows Azure Build Output
-csx
-*.build.csdef
-
-# Windows Store app package directory
-AppPackages/
-
-# Others
-sql/
-*.Cache
-ClientBin/
-[Ss]tyle[Cc]op.*
-~$*
-*~
-*.dbmdl
-*.[Pp]ublish.xml
-*.pfx
-*.publishsettings
-*.jar
-
-# RIA/Silverlight projects
-Generated_Code/
-
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-UpgradeLog*.htm
-
-# SQL Server files
-App_Data/*.mdf
-App_Data/*.ldf
-
-
-#LightSwitch generated files
-GeneratedArtifacts/
-_Pvt_Extensions/
-ModelManifest.xml
-
-# CPython & Wheels
-*.pyc
-*.pyd
-*.whl
-*.egg-info
-
-# =========================
-# Windows detritus
-# =========================
-
-# Windows image file caches
-Thumbs.db
-ehthumbs.db
-
-# Folder config file
-Desktop.ini
-
-# Recycle Bin used on file shares
-$RECYCLE.BIN/
-
-# Mac desktop service store files
-.DS_Store
-
-# Visual studio build artifacts
-*.tlog
-*.lastbuildstate
-*.idb
-*.exp
-*.lib
-*.dll
-
-# Visual Studio Temporary files
-*.VC.db
-
-# Windows CE build artifacts
-Build.err
-Build.wrn
-Buildx86retail.dat
-*.dat
-
-# Tools EXE that doesn't end up in a typical build directory
-common/tools/macro_utils_h_generator/macro_utils_h_generator.exe
-
-# hg directories should be ignored
-**/hg/
-
-# VS Code stuff
-**/typings/**
-**/.vscode/**
-# C/C++ extension for VS Code
-.browse.VC.db*
-
-build_all/windows/nuget.exe
-
-/cmake
-/build
-*.cert

+ 0 - 399
azure/CMakeLists.txt

@@ -1,399 +0,0 @@
-# Copyright (c) Microsoft. All rights reserved.
-# Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-cmake_minimum_required(VERSION 2.8.11)
-project(azure_iot_sdks)
-
-include("configs/azure_iot_sdksFunctions.cmake")
-
-getIoTSDKVersion()
-message(STATUS "IoT Client SDK Version = ${IOT_SDK_VERSION}")
-
-if (POLICY CMP0042)
-    cmake_policy(SET CMP0042 NEW)
-endif()
-
-#
-#making a global variable to know if we are on linux, windows, or macosx.
-if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
-    set(WINDOWS TRUE)
-elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-    set(LINUX TRUE)
-    # on Linux, enable valgrind
-    # these commands (MEMORYCHECK...) need to apear BEFORE include(CTest) or they will not have any effect
-    find_program(MEMORYCHECK_COMMAND valgrind)
-    set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --error-exitcode=1")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-    set(MACOSX TRUE)
-    add_definitions(-DMACOSX)
-endif()
-
-include (CTest)
-
-if (MSVC)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4232")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4232")
-endif()
-
-if (WIN32)
-    # windows needs this define
-    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-    # Make warning as error
-    add_definitions(/WX)
-else()
-    # Make warning as error
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
-endif(WIN32)
-
-set(hsm_type_x509 OFF CACHE BOOL "x509 type of hsm used with the Provisioning client")
-set(hsm_type_sastoken OFF CACHE BOOL "tpm type of hsm used with the Provisioning client")
-set(hsm_type_custom OFF CACHE BOOL "hsm type of custom used with the Provisioning client")
-set(hsm_custom_lib "" CACHE STRING "Full path to custom HSM repo library")
-set(run_sfc_tests OFF CACHE BOOL "setup the Service Fault tests")
-
-set(use_wolfssl)
-
-# the following variables are project-wide and can be used with cmake-gui
-option(use_amqp "set use_amqp to ON if amqp is to be used, set to OFF to not use amqp" ON)
-option(use_http "set use_http to ON if http is to be used, set to OFF to not use http" ON)
-option(use_mqtt "set use_mqtt to ON if mqtt is to be used, set to OFF to not use mqtt" ON)
-option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF)" OFF)
-option(run_unittests "set run_unittests to ON to run unittests (default is OFF)" OFF)
-option(run_longhaul_tests "set run_longhaul_tests to ON to run longhaul tests (default is OFF)[if possible, they are always build]" OFF)
-option(skip_samples "set skip_samples to ON to skip building samples (default is OFF)[if possible, they are always build]" OFF)
-option(compileOption_C "passes a string to the command line of the C compiler" OFF)
-option(compileOption_CXX "passes a string to the command line of the C++ compiler" OFF)
-option(build_service_client "controls whether the iothub_service_client is built or not" ON)
-option(build_provisioning_service_client "controls whether the provisioning_service_client is built or not" ON)
-option(build_python "builds the Python native iothub_client module" OFF)
-option(build_javawrapper "builds the native iothub_client library for java C wrapper" OFF)
-option(dont_use_uploadtoblob "set dont_use_uploadtoblob to ON if the functionality of upload to blob is to be excluded, OFF otherwise. It requires HTTP" OFF)
-option(no_logging "disable logging" OFF)
-option(use_installed_dependencies "set use_installed_dependencies to ON to use installed packages instead of building dependencies from submodules" OFF)
-option(build_as_dynamic "build the IoT SDK libaries as dynamic"  OFF)
-option(build_network_e2e "build network E2E tests" OFF)
-option(use_prov_client "Enable provisioning client" OFF)
-option(use_tpm_simulator "tpm simulator type of hsm used with the provisioning client" OFF)
-option(use_edge_modules "Enable support for running modules against Azure IoT Edge" OFF)
-option(use_custom_heap "use externally defined heap functions instead of the malloc family" OFF)
-
-set(use_prov_client_core OFF)
-
-if(${use_custom_heap})
-    add_definitions(-DGB_USE_CUSTOM_HEAP)
-endif()
-
-if (NOT ${use_amqp} AND NOT ${use_http} AND NOT ${use_mqtt})
-    message(FATAL_ERROR "CMAKE Failure: AMQP, HTTP & MQTT are all disable, iothub client must have one protocol enabled")
-endif()
-
-message(STATUS "Provisioning client ${use_prov_client}")
-if (XCODE AND ${use_prov_client})
-    # The TPM module is not available on Mac, and Mac's <string.h> and <unistd.h> files collide as well
-    message(FATAL_ERROR "Provisioning client is not supported on Mac")
-endif()
-
-if (WIN32 OR MACOSX)
-    option(use_openssl "set use_openssl to ON to use OpenSSL." OFF)
-else()
-    option(use_openssl "set use_openssl to ON to use OpenSSL." ON)
-endif()
-
-# openssl samples on Windows need to have a trusted cert set
-if ("${use_openssl}" OR "${use_wolfssl}")
-    option(use_sample_trusted_cert "Set flag in samples to use SDK's built-in CA as TrustedCerts" ON)
-else()
-    option(use_sample_trusted_cert "Set flag in samples to use SDK's built-in CA as TrustedCerts" OFF)
-endif()
-
-# Enable IoT SDK to act as a module for Edge
-if(${use_edge_modules})
-    set(use_prov_client_core ON)
-    set(use_http ON)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_EDGE_MODULES")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_EDGE_MODULES")
-    set(hsm_type_edge_module ON)
-endif()
-
-# Set Provisioning Information.  This will also setup appropriate HSM
-if (${use_prov_client})
-    set(use_prov_client_core ON)
-
-    if ("${hsm_custom_lib}" STREQUAL "")
-        set(hsm_type_x509 ON)
-        set(hsm_type_sastoken ON)
-    else()
-        set(hsm_type_custom ON)
-    endif()
-endif()
-
-if (${use_prov_client_core})
-    getProvSDKVersion()
-    message(STATUS "Provisioning SDK Version = ${PROV_SDK_VERSION}")
-endif()
-
-# setting nuget_e2e_tests will only generate e2e tests to run with nuget packages.
-# Install-packages from Package Manager Console in VS before building the projects
-option(nuget_e2e_tests "set nuget_e2e_tests to ON to generate e2e tests to run with nuget packages (default is OFF)" OFF)
-
-# check for conflicting options
-if (NOT ${use_http})
-    MESSAGE( "Setting dont_use_uploadtoblob to ON because use_http is OFF")
-    set(dont_use_uploadtoblob "ON")
-    MESSAGE( STATUS "use_http:         " ${use_http} )
-    MESSAGE( STATUS "dont_use_uploadtoblob:         " ${dont_use_uploadtoblob} )
-endif()
-
-if (${dont_use_uploadtoblob})
-    add_definitions(-DDONT_USE_UPLOADTOBLOB)
-endif()
-
-if (${no_logging})
-    add_definitions(-DNO_LOGGING)
-endif()
-
-# Use solution folders.
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-# build the parson library for json parsing
-add_library(parson
-    ./deps/parson/parson.c
-    ./deps/parson/parson.h
-)
-if (MSVC)
-    set_source_files_properties(../deps/parson/parson.c PROPERTIES COMPILE_FLAGS "/wd4244 /wd4232")
-endif()
-set(parson_h_install_files ./deps/parson/parson.h)
-set(parson_install_libs parson)
-
-if (IN_OPENWRT)
-    ADD_DEFINITIONS("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
-    INCLUDE_DIRECTORIES("$ENV{TOOLCHAIN_DIR}/usr/include" "$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
-endif()
-
-if (LINUX)
-    if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-        # now all static libraries use PIC flag for Python shared lib
-        set(CMAKE_C_FLAGS "-fPIC ${CMAKE_C_FLAGS}")
-        set(CMAKE_CXX_FLAGS "-fPIC ${CMAKE_CXX_FLAGS}")
-    endif()
-endif()
-
-# if any compiler has a command line switch called "OFF" then it will need special care
-if (NOT "${compileOption_C}" STREQUAL "OFF")
-    set(CMAKE_C_FLAGS "${compileOption_C} ${CMAKE_C_FLAGS}")
-endif()
-
-if (NOT "${compileOption_CXX}" STREQUAL "OFF")
-    set(CMAKE_CXX_FLAGS "${compileOption_CXX} ${CMAKE_CXX_FLAGS}")
-endif()
-
-include("configs/azure_iot_sdksFunctions.cmake")
-
-if (${run_unittests} OR ${run_e2e_tests} OR ${run_sfc_tests})
-    include("dependencies-test.cmake")
-endif()
-
-# do not add or build any tests of the dependencies
-set(original_run_e2e_tests ${run_e2e_tests})
-set(original_run_unittests ${run_unittests})
-set(original_skip_samples ${skip_samples})
-
-set(run_e2e_tests OFF)
-set(run_unittests OFF)
-set(skip_samples ON)
-
-include("dependencies.cmake")
-
-if (${original_run_e2e_tests} OR ${original_run_unittests} OR ${run_sfc_tests})
-    set(SHARED_UTIL_REAL_TEST_FOLDER ${CMAKE_CURRENT_LIST_DIR}/c-utility/tests/real_test_files CACHE INTERNAL "this is what needs to be included when doing test sources" FORCE)
-    add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/c-utility/testtools)
-endif()
-
-set_platform_files(${CMAKE_CURRENT_LIST_DIR}/c-utility)
-
-set(run_e2e_tests ${original_run_e2e_tests})
-set(run_unittests ${original_run_unittests})
-set(skip_samples ${original_skip_samples})
-
-enable_testing()
-
-# this project uses several other projects that are build not by these CMakeFiles
-# this project also targets several OSes
-
-include(CheckSymbolExists)
-function(detect_architecture symbol arch)
-    if (NOT DEFINED ARCHITECTURE OR ARCHITECTURE STREQUAL "")
-        set(CMAKE_REQUIRED_QUIET 1)
-        check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
-        unset(CMAKE_REQUIRED_QUIET)
-
-        # The output variable needs to be unique across invocations otherwise
-        # CMake's crazy scope rules will keep it defined
-        if (ARCHITECTURE_${arch})
-            set(ARCHITECTURE "${arch}" PARENT_SCOPE)
-            set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
-            add_definitions(-DARCHITECTURE_${arch}=1)
-        endif()
-    endif()
-endfunction()
-
-if (MSVC)
-    detect_architecture("_M_AMD64" x86_64)
-    detect_architecture("_M_IX86" x86)
-    detect_architecture("_M_ARM" ARM)
-else()
-    detect_architecture("__x86_64__" x86_64)
-    detect_architecture("__i386__" x86)
-    detect_architecture("__arm__" ARM)
-endif()
-
-if (NOT DEFINED ARCHITECTURE OR ARCHITECTURE STREQUAL "")
-    set(ARCHITECTURE "GENERIC")
-endif()
-
-message(STATUS "iothub architecture: ${ARCHITECTURE}")
-
-macro(compileAsC99)
-    if (CMAKE_VERSION VERSION_LESS "3.1")
-        if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-            set (CMAKE_C_FLAGS "--std=c99 ${CMAKE_C_FLAGS}")
-            if (NOT IN_OPENWRT)
-                set (CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
-            endif()
-        endif()
-    else()
-        set (CMAKE_C_STANDARD 99)
-        set (CMAKE_CXX_STANDARD 11)
-    endif()
-endmacro(compileAsC99)
-
-macro(compileAsC11)
-    if (CMAKE_VERSION VERSION_LESS "3.1")
-        if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
-            set (CMAKE_C_FLAGS "--std=c11 ${CMAKE_C_FLAGS}")
-            set (CMAKE_C_FLAGS "-D_POSIX_C_SOURCE=200112L ${CMAKE_C_FLAGS}")
-            set (CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
-        endif()
-    else()
-        set (CMAKE_C_STANDARD 11)
-        set (CMAKE_CXX_STANDARD 11)
-    endif()
-endmacro(compileAsC11)
-
-if (WIN32)
-    set(LOCK_C_FILE ${SHARED_UTIL_ADAPTER_FOLDER}/lock_win32.c)
-    set(THREAD_C_FILE ${SHARED_UTIL_ADAPTER_FOLDER}/threadapi_c11.c)
-else()
-    set(LOCK_C_FILE ${SHARED_UTIL_ADAPTER_FOLDER}/lock_pthreads.c)
-    set(THREAD_C_FILE ${SHARED_UTIL_ADAPTER_FOLDER}/threadapi_pthreads.c)
-endif()
-
-# Set CMAKE_INSTALL_LIBDIR if not defined
-include(GNUInstallDirs)
-
-if (NOT ${use_amqp} OR NOT ${use_http})
-    set (build_service_client OFF)
-    message(STATUS "iothub_service_client build is disabled (AMQP and HTTP support are required)")
-endif()
-
-if (NOT ${use_http} AND ${use_prov_client})
-    set (build_provisioning_service_client OFF)
-    message(STATUS "provisioning_service_client build is disabled (HTTP support is required)")
-endif()
-
-if (${use_prov_client_core})
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_PROV_MODULE")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_PROV_MODULE")
-
-    if (${build_provisioning_service_client})
-        add_subdirectory(provisioning_service_client)
-    endif()
-
-    add_subdirectory(provisioning_client)
-endif()
-
-if (${build_service_client})
-    add_subdirectory(iothub_service_client)
-endif()
-
-if (${run_e2e_tests} OR ${run_longhaul_tests} OR ${nuget_e2e_tests} OR ${run_sfc_tests})
-    add_subdirectory(testtools)
-endif()
-
-add_subdirectory(iothub_client)
-add_subdirectory(serializer)
-
-# add the device_auth sample subdirectory
-if (${use_prov_client} AND NOT ${skip_samples})
-    add_subdirectory(./provisioning_client/samples)
-
-    if (NOT "${build_python}" STREQUAL "OFF")
-        add_subdirectory(../provisioning_device_client provisioning_device_client_python)
-    endif()
-endif()
-
-if (NOT "${build_python}" STREQUAL "OFF")
-    add_subdirectory(../device/iothub_client_python python)
-    if (${build_service_client})
-        add_subdirectory(../service python_service_client)
-    endif()
-endif()
-
-if ("${build_javawrapper}" STREQUAL "ON")
-     add_subdirectory(../device/iothub_client_javawrapper javawrapper)
-endif()
-
-if (${use_installed_dependencies})
-    # Install azure_iot_sdks
-    set(package_location "cmake")
-
-    include(CMakePackageConfigHelpers)
-
-    write_basic_package_version_file(
-        "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
-        VERSION ${IOT_SDK_VERSION}
-        COMPATIBILITY SameMajorVersion
-    )
-
-    configure_file("configs/${PROJECT_NAME}Config.cmake"
-        "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake"
-        COPYONLY
-    )
-
-    install(FILES ${parson_h_install_files}
-        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot
-    )
-    install(TARGETS ${parson_install_libs} EXPORT azure_iot_sdksTargets
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot
-    )
-
-    install(EXPORT azure_iot_sdksTargets
-        FILE
-            "${PROJECT_NAME}Targets.cmake"
-        DESTINATION
-            ${package_location}
-    )
-
-    install(
-        FILES
-            "configs/${PROJECT_NAME}Config.cmake"
-            "configs/${PROJECT_NAME}Functions.cmake"
-            "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
-        DESTINATION
-            ${package_location}
-    )
-else()
-    install(FILES ${parson_h_install_files}
-        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot)
-    install(TARGETS ${parson_install_libs}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
-endif()
-
-if (${build_network_e2e})
-    add_subdirectory(network_e2e/tests)
-endif()

+ 0 - 21
azure/LICENSE

@@ -1,21 +0,0 @@
-Microsoft Azure IoT SDKs 
-Copyright (c) Microsoft Corporation
-All rights reserved. 
-MIT License
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the ""Software""), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software, and to permit persons to whom the Software is 
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
-THE SOFTWARE.

+ 0 - 8
azure/build_all/arduino/CMakeList.append

@@ -1,8 +0,0 @@
-SET(IN_OPENWRT $ENV{IN_OPENWRT})
-
-if(IN_OPENWRT)
-        ADD_DEFINITIONS("$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
-        INCLUDE_DIRECTORIES("$ENV{TOOLCHAIN_DIR}/usr/include" "$ENV{TARGET_LDFLAGS}" "$ENV{TARGET_CPPFLAGS}" "$ENV{TARGET_CFLAGS}")
-        INCLUDE_DIRECTORIES("$ENV{TOOLCHAIN_DIR}/usr/include/openssl")
-        INCLUDE_DIRECTORIES("$ENV{TOOLCHAIN_DIR}/usr/include/uuid")
-endif()

+ 0 - 88
azure/build_all/arduino/Makefile.iot

@@ -1,88 +0,0 @@
-#
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=azure-iot-sdks
-PKG_VERSION:=1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/azure-iot-sdks
-  SECTION:=libs
-  CATEGORY:=Libraries
-  DEPENDS:=+libopenssl +libuuid +libcurl +libpthread
-  TITLE:=Azure IoT SDK
-endef
-
-define Build/Prepare
-	mkdir -p $(PKG_BUILD_DIR)
-	$(CP) ./src/* $(PKG_BUILD_DIR)/
-#	rm -f $(PKG_BUILD_DIR)/CMakeCache.txt
-#	rm -fR $(PKG_BUILD_DIR)/CMakeFiles
-#	rm -f $(PKG_BUILD_DIR)/Makefile ]
-#	rm -f $(PKG_BUILD_DIR)/cmake_install.cmake
-endef
-
-define Build/Configure
-  IN_OPENWRT=1 \
-  TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
-  TARGET_CFLAGS="$(TARGET_CFLAGS) -DIN_OPENWRT" \
-  TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
-  AR="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ar" \
-  AS="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC) -c $(TARGET_CFLAGS)" \
-  LD="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ld" \
-  NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
-  CC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
-  GCC="$(TOOLCHAIN_DIR)/bin/$(TARGET_CC)" \
-  CXX="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)g++" \
-  RANLIB="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)ranlib" \
-  STRIP="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip" \
-  OBJCOPY="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)objcopy" \
-  OBJDUMP="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)objdump" \
-  cmake -DCMAKE_FIND_ROOT_PATH="$(TOOLCHAIN_DIR)" $(PKG_BUILD_DIR)/CMakeLists.txt -DIN_OPENWRT=1 -Duse_amqp:bool=ON -Duse_http:bool=ON -Duse_mqtt:bool=OFF -Duse_floats:bool=OFF -Duse_condition:bool=OFF
-endef
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(STAGING_DIR)/usr/include/azure-iot-sdks
-	$(CP) $(PKG_BUILD_DIR)/c-utility/inc/* $(STAGING_DIR)/usr/include/
-	$(CP) $(PKG_BUILD_DIR)/iothub_client/inc/* $(STAGING_DIR)/usr/include/
-	$(CP) $(PKG_BUILD_DIR)/serializer/inc/* $(STAGING_DIR)/usr/include/
-	$(INSTALL_DIR) $(STAGING_DIR)/usr/lib
-	$(CP) $(PKG_BUILD_DIR)/c-utility/*.a $(STAGING_DIR)/usr/lib/
-	$(CP) $(PKG_BUILD_DIR)/iothub_client/*.a $(STAGING_DIR)/usr/lib/
-	$(CP) $(PKG_BUILD_DIR)/serializer/*.a $(STAGING_DIR)/usr/lib/
-endef
-
-define Build/UninstallDev
-	rm -rf \
-	$(STAGING_DIR)/usr/include/* \
-	$(STAGING_DIR)/usr/lib/*
-endef
-
-define Build/Compile
-	$(MAKE) -C $(PKG_BUILD_DIR)
-#	$(STRIP) $(PKG_BUILD_DIR)/c-utility/*.a
-#	$(STRIP) $(PKG_BUILD_DIR)/iothub_client/*.a
-#	$(STRIP) $(PKG_BUILD_DIR)/serializer/*.a
-#	$(STRING) $(PKG_BUILD_DIR)/serializer/samples/simplesample_http/simplesample_http
-endef
-
-define Package/azure-iot-sdks/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/c-utility/*.a $(1)/usr/lib/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/iothub_client/*.a $(1)/usr/lib/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/serializer/*.a $(1)/usr/lib/
-	$(INSTALL_DIR) $(1)/usr/share/azure-iot-sdk/samples
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/serializer/samples/remote_monitoring/remote_monitoring $(1)/usr/share/azure-iot-sdk/samples/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/serializer/samples/simplesample_http/simplesample_http $(1)/usr/share/azure-iot-sdk/samples/
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/serializer/samples/simplesample_amqp/simplesample_amqp $(1)/usr/share/azure-iot-sdk/samples/
-endef
-
-$(eval $(call BuildPackage,azure-iot-sdks))

+ 0 - 51
azure/build_all/arduino/build.sh

@@ -1,51 +0,0 @@
-#!/bin/bash
-
-set -e
-
-sdk_root="$HOME"
-openwrt_folder="openwrt"
-openwrt_sdk_folder="sdk"
-working_dir=$PWD
-iot_dir="azure-iot-sdk-c"
-
-usage ()
-{
-    echo 'build.sh [options]'
-    echo 'options'
-    echo ' -d, --sdkroot   OpenWRT SDK root directory'
-    echo '                 (default: $HOME)'
-    exit 1
-}
-
-process_args ()
-{
-    while [ ! -z "$1" ] && [ ! -z "$2" ]
-    do
-        if [ "$1" == "-d" ] || [ "$1" == "--sdkroot" ]
-        then
-            sdk_root="$2"
-        else
-            usage
-        fi
-
-        shift
-        shift
-    done
-}
-
-build_iot()
-{
-    echo "Building IoT"
-    rm -d -f -r $sdk_root/$openwrt_folder/$openwrt_sdk_folder/package/$iot_dir
-    mkdir $sdk_root/$openwrt_folder/$openwrt_sdk_folder/package/$iot_dir
-    mkdir $sdk_root/$openwrt_folder/$openwrt_sdk_folder/package/$iot_dir/src
-    cp -f "$working_dir/Makefile.iot" "$sdk_root/$openwrt_folder/$openwrt_sdk_folder/package/$iot_dir/Makefile"
-    cd "$working_dir/../../.."
-    cp -R -f . "$sdk_root/$openwrt_folder/$openwrt_sdk_folder/package/$iot_dir/src"
-    cd "$sdk_root/$openwrt_folder/$openwrt_sdk_folder"
-    make V=s "package/$iot_dir/compile"
-}
-
-process_args $*
-
-build_iot

+ 0 - 52
azure/build_all/arduino/setup.sh

@@ -1,52 +0,0 @@
-#!/bin/bash
-
-set -e
-
-install_root="$HOME"
-openwrt_folder="openwrt"
-openwrt_sdk_folder="sdk"
-working_dir=$PWD
-package_dir="package"
-
-iot_dir="azure-iot-sdk-c"
-iot_repo="https://github.com/Azure/azure-iot-sdk-c.git"
-iot_makefile="Makefile.iot"
-
-usage ()
-{
-    echo 'setup.sh [options]'
-    echo 'options'
-    echo ' -d, --installdir   OpenWRT SDK root directory'
-    echo '                    (default: $HOME)'
-    exit 1
-}
-
-process_args ()
-{
-    while [ ! -z "$1" ] && [ ! -z "$2" ]
-    do
-        if [ "$1" == "-d" ] || [ "$1" == "--installdir" ]
-        then
-            install_root="$2"
-        else
-            usage
-        fi
-
-        shift
-        shift
-    done
-}
-
-setup_sdk()
-{
-  # Check if SDK is installed
-  #if [ ! -d "$install_root/$openwrt_folder/$openwrt_sdk_folder" ]
-  #then
-    # Kickoff the SDK installation since it doesn't exists
-    ./setup_sdk.sh -d $install_root
-  #fi
-}
-
-process_args $*
-
-setup_sdk

+ 0 - 115
azure/build_all/arduino/setup_sdk.sh

@@ -1,115 +0,0 @@
-#!/bin/bash
-
-set -e
-
-sdk_repo="http://download.linino.org/linino-utils/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2-32bit.tar.bz2"
-sdk_repo_x86="http://download.linino.org/linino-utils/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2-32bit.tar.bz2"
-sdk_repo_x64="http://download.linino.org/linino-utils/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2-64bit.tar.bz2"
-install_root="$HOME"
-openwrt_folder="openwrt"
-openwrt_sdk_folder="sdk"
-working_dir=$PWD
-package_dir="package"
-
-MACHINE_TYPE=`uname -m`
-
-usage ()
-{
-    echo 'setup_sdk.sh [options]'
-    echo 'options'
-    echo ' -d, --installdir   destination root directory for OpenWRT SDK installation'
-    echo '                    (default: $HOME)'
-    echo ' -s, --sdk          url of the prebuilt OpenWRT SDK archive'
-    echo '                    (default: http://download.linino.org/linino-utils/OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2-32bit.tar.bz2)'
-    exit 1
-}
-
-process_args ()
-{
-    while [ ! -z "$1" ] && [ ! -z "$2" ]
-    do
-        if [ "$1" == "-d" ] || [ "$1" == "--installdir" ]
-        then
-          install_root="$2"
-        elif [ "$1" == "-s" ] || [ "$1" == "--sdk" ]
-        then
-          sdk_repo="$2"
-        else
-          usage
-        fi
-
-        shift
-        shift
-    done
-}
-
-download_sdk()
-{
-  if [ -d  "$install_root/$openwrt_folder/$openwrt_sdk_folder" ]
-	then
-    # SDK folder already exists ask to reinstall SDK
-    read -p "The OpenWRT SDK ($install_root/$openwrt_folder/$openwrt_sdk_folder) already exists. Do you want to delete and reinstall? (Y/N)" input_var
-    if [ ! "$input_var" == "y" ] && [ ! "$input_var" == "Y" ]
-    then
-      return
-    fi
-	fi
-
-  read -p "Download and installation of the OpenWRT SDK may take some time. Do you want to continue? (Y/N)" input_var
-  if [ ! "$input_var" == "y" ] && [ ! "$input_var" == "Y" ]
-  then
-    exit 1
-  fi
-
-	echo "Downloading OpenWRT SDK to $install_root/$openwrt_folder"
-
-  cd $install_root
-
-	if [ ! -d  $openwrt_folder ]
-	then
-		mkdir $openwrt_folder
-	fi
-
-  # Download the SDK
-  cd $openwrt_folder
-
-  if [ -d $openwrt_sdk_folder ]
-  then
-    rm -r -f $openwrt_sdk_folder
-  fi
-
-  if [ "$1" == "-s" ] || [ "$1" == "--sdk" ]
-  then
-    wget $sdk_repo -O openwrtsdk.tar.bz2
-  elif [ ${MACHINE_TYPE} == 'x86_64' ]
-  then
-    wget $sdk_repo_x64 -O openwrtsdk.tar.bz2
-  else
-    wget $sdk_repo_x86 -O openwrtsdk.tar.bz2
-  fi
-
-  tar xvf openwrtsdk.tar.bz2
-
-  # get folders only
-  folders=(*/)
-
-  # assuming the only and first file is the name of the extracted archive
-  extractedFolder=${folders[0]}
-
-  mv $extractedFolder $openwrt_sdk_folder
-
-  patch_sdk
-}
-
-patch_sdk()
-{
-  #removing cmake from the toolchain
-  mv "$install_root/$openwrt_folder/$openwrt_sdk_folder/staging_dir/host/bin/cmake" "$install_root/$openwrt_folder/$openwrt_sdk_folder/staging_dir/host/bin/cmake.old"
-}
-
-process_args $*
-echo "Installing OpenWRT SDK to $install_root/$openwrt_folder/$openwrt_sdk_folder"
-
-download_sdk
-
-echo "Finished installing the OpenWRT SDK"

+ 0 - 2449
azure/build_all/docs/Doxyfile

@@ -1,2449 +0,0 @@
-# Doxyfile 1.8.10
-
-# 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           = "Microsoft Azure IoT Device SDK for C"
-
-# 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         = 1.2.8
-
-# 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          = "The Microsoft Azure IoT device libraries for C contain code that facilitates building devices and applications that connect to and are managed by Azure IoT Hub services."
-
-# 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        = repo
-
-# 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       = NO
-
-# 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            = NO
-
-# 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     = YES
-
-# 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       = NO
-
-# 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       = NO
-
-# 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       = YES
-
-# 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  = 0
-
-# 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                  = YES
-
-# 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
-
-# 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                  = mainpage.dox \
-                         repo/c-utility/inc/azure_c_shared_utility/agenttime.h \
-                         repo/c-utility/inc/azure_c_shared_utility/base64.h \
-                         repo/c-utility/inc/azure_c_shared_utility/httpapi.h \
-                         repo/c-utility/inc/azure_c_shared_utility/httpapi.h \
-                         repo/c-utility/inc/azure_c_shared_utility/httpapiex.h \
-                         repo/c-utility/inc/azure_c_shared_utility/httpheaders.h \
-                         repo/c-utility/inc/azure_c_shared_utility/threadapi.h \
-                         repo/c-utility/inc/azure_c_shared_utility/lock.h \
-                         repo/c-utility/inc/azure_c_shared_utility/map.h \
-                         repo/iothub_client/inc/iothub_client_version.h \
-                         repo/iothub_client/inc/iothub_message.h \
-                         repo/iothub_client/inc/iothub_client_ll.h \
-                         repo/iothub_client/inc/iothub_client.h \
-                         repo/serializer/inc/serializer.h \
-                         repo/serializer/inc/schemalib.h
-
-# 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, *.f90, *.f, *.for, *.tcl, *.vhd,
-# *.vhdl, *.ucf, *.qsf, *.as and *.js.
-
-FILE_PATTERNS          =
-
-# 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/*
-#
-# We prevent DEFINE_ENUM cruft from being generated in the docs. Other unused
-# symbols are ignored as well.
-#
-EXCLUDE_SYMBOLS        = *_VALUES \
-                         HTTPAPI_REQUEST_TYPEStrings \
-                         HTTPAPI_REQUEST_TYPE_FromString \
-                         HTTPAPI_RESULTStrings \
-                         HTTPAPI_RESULT_FromString \
-                         HTTPAPIEX_RESULTStrings \
-                         HTTPAPIEX_RESULT_FromString \
-                         HTTP_HEADERS_RESULTStrings \
-                         HTTP_HEADERS_RESULT_FromString \
-                         LOCK_RESULTStrings \
-                         LOCK_RESULT_FromString \
-                         TRANSPORT_TYPE \
-                         IOTHUB_CLIENT_RESULTStrings \
-                         IOTHUB_CLIENT_RESULT_FromString \
-                         IOTHUB_CLIENT_CONFIRMATION_RESULTStrings \
-                         IOTHUB_CLIENT_CONFIRMATION_RESULT_FromString \
-                         IOTHUB_CLIENT_STATUSStrings \
-                         IOTHUB_CLIENT_STATUS_FromString \
-                         TRANSPORT_TYPEStrings \
-                         TRANSPORT_TYPE_FromString \
-                         IOTHUBMESSAGE_DISPOSITION_RESULTStrings \
-                         IOTHUBMESSAGE_DISPOSITION_RESULT_FromString \
-                         AMBIGUOUS_STATUS_CODE \
-                         IFCOMMA* \
-                         ANOTHERIF* \
-                         REFLECTED_* \
-                         DROP_* \
-                         TO_AGENT* \
-                         EXPAND_MODEL_* \
-                         FIELD_AS_STRING \
-                         BUILD_* \
-                         UNBUILD_* \
-                         ADDRESS_MACRO \
-                         KEEP_FIRST* \
-                         PROMOTIONMAP* \
-                         CASTMAP* \
-                         EMPTY_TOKEN \
-                         MAP_* \
-                         *_LOCAL_PARAMETER \
-                         *_COMMA_* \
-                         PUSH_LOCAL_PARAMETER \
-                         DEFINE_FUNCTION_PARAMETER \
-                         MAKE_WRAPPER_ARGUMENT \
-                         CREATE_* \
-                         INSERT_FIELD_* \
-                         IMPL_PROPERTY \
-                         IOT_AGENT_RESULTStrings \
-                         IOT_AGENT_RESULT_FromString
-
-# 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.
-
-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.
-
-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 = YES
-
-# 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
-
-#---------------------------------------------------------------------------
-# 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            = docs
-
-# 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    = 0
-
-# 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      = NO
-
-# 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
-
-#---------------------------------------------------------------------------
-# 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        = YES
-
-# 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     = YES
-
-# 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           = repo/c-utility/inc
-
-# 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      = DEFINE_ENUM
-
-# 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: NO.
-
-HAVE_DOT               = NO
-
-# 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, jpg, gif, 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 - 180
azure/build_all/linux/build.sh

@@ -1,180 +0,0 @@
-#!/bin/bash
-#set -o pipefail
-#
-
-set -e
-
-script_dir=$(cd "$(dirname "$0")" && pwd)
-build_root=$(cd "${script_dir}/../.." && pwd)
-log_dir=$build_root
-run_e2e_tests=OFF
-run_sfc_tests=OFF
-run_longhaul_tests=OFF
-build_amqp=ON
-build_http=ON
-build_mqtt=ON
-no_blob=OFF
-run_unittests=OFF
-build_python=OFF
-build_javawrapper=OFF
-run_valgrind=0
-build_folder=$build_root"/cmake/iotsdk_linux"
-make=true
-toolchainfile=" "
-cmake_install_prefix=" "
-no_logging=OFF
-prov_auth=OFF
-prov_use_tpm_simulator=OFF
-use_edge_modules=OFF
-
-usage ()
-{
-    echo "build.sh [options]"
-    echo "options"
-    echo " -cl, --compileoption <value>  specify a compile option to be passed to gcc"
-    echo "   Example: -cl -O1 -cl ..."
-    echo " --run-e2e-tests               run the end-to-end tests (e2e tests are skipped by default)"
-    echo " --run-sfc-tests               run the end-to-end tests for Service Faults (sfc tests are skipped by default)"
-    echo " --run-unittests               run the unit tests"
-    echo " --run-longhaul-tests          run long haul tests (long haul tests are not run by default)"
-    echo ""
-    echo " --no-amqp                     do no build AMQP transport and samples"
-    echo " --no-http                     do no build HTTP transport and samples"
-    echo " --no-mqtt                     do no build MQTT transport and samples"
-    echo " --no_uploadtoblob             do no build upload to blob"
-    echo " --no-make                     do not run make after cmake"
-    echo " --toolchain-file <file>       pass cmake a toolchain file for cross compiling"
-    echo " --install-path-prefix         alternative prefix for make install"
-    echo " --build-python <version>      build Python C wrapper module (requires boost) with given python version (2.7 3.4 3.5 are currently supported)"
-    echo " --build-javawrapper           build java C wrapper module"
-    echo " -rv, --run_valgrind           will execute ctest with valgrind"
-    echo " --no-logging                  Disable logging"
-    echo " --provisioning                Use Provisioning with Flow"
-    echo " --use-tpm-simulator           Build TPM simulator"
-    echo " --use-edge-modules            Build Edge modules"    
-    exit 1
-}
-
-process_args ()
-{
-    save_next_arg=0
-    extracloptions=" "
-
-    for arg in $*
-    do      
-      if [ $save_next_arg == 1 ]
-      then
-        # save arg to pass to gcc
-        extracloptions="$arg $extracloptions"
-        save_next_arg=0
-      elif [ $save_next_arg == 2 ]
-      then
-        # save arg to pass as toolchain file
-        toolchainfile="$arg"
-           save_next_arg=0
-      elif [ $save_next_arg == 3 ]
-      then
-        # save the arg to python version
-        build_python="$arg"
-        if [ $build_python != "2.7" ] && [ $build_python != "3.4" ] && [ $build_python != "3.5" ] && [ $build_python != "3.6" ]
-        then
-          echo "Supported python versions are 2.7, 3.4 or 3.5 or 3.6"
-          exit 1
-        fi 
-        save_next_arg=0
-      elif [ $save_next_arg == 4 ]
-      then
-        # save arg for install prefix
-        cmake_install_prefix="$arg"
-        save_next_arg=0
-      else
-          case "$arg" in
-              "-cl" | "--compileoption" ) save_next_arg=1;;
-              "--run-e2e-tests" ) run_e2e_tests=ON;;
-              "--run-unittests" ) run_unittests=ON;;
-              "--run-longhaul-tests" ) run_longhaul_tests=ON;;
-              "--no-amqp" ) build_amqp=OFF;;
-              "--no-http" ) build_http=OFF;;
-              "--no-mqtt" ) build_mqtt=OFF;;
-              "--no_uploadtoblob" ) no_blob=ON;;
-              "--no-make" ) make=false;;
-              "--build-python" ) save_next_arg=3;;
-              "--build-javawrapper" ) build_javawrapper=ON;;
-              "--toolchain-file" ) save_next_arg=2;;
-              "-rv" | "--run_valgrind" ) run_valgrind=1;;
-              "--no-logging" ) no_logging=ON;;
-              "--install-path-prefix" ) save_next_arg=4;;
-              "--provisioning" ) prov_auth=ON;;
-              "--use-tpm-simulator" ) prov_use_tpm_simulator=ON;;
-              "--run-sfc-tests" ) run_sfc_tests=ON;;
-              "--use-edge-modules") use_edge_modules=ON;;
-              * ) usage;;
-          esac
-      fi
-    done
-
-    if [ "$toolchainfile" != " " ]
-    then
-      toolchainfile=$(readlink -f $toolchainfile)
-      toolchainfile="-DCMAKE_TOOLCHAIN_FILE=$toolchainfile"
-    fi
-   
-   if [ "$cmake_install_prefix" != " " ]
-   then
-     cmake_install_prefix="-DCMAKE_INSTALL_PREFIX=$cmake_install_prefix"
-   fi
-}
-
-process_args $*
-
-rm -r -f $build_folder
-mkdir -p $build_folder
-pushd $build_folder
-cmake $toolchainfile $cmake_install_prefix -Drun_valgrind:BOOL=$run_valgrind -DcompileOption_C:STRING="$extracloptions" -Drun_e2e_tests:BOOL=$run_e2e_tests -Drun_sfc_tests:BOOL=$run-sfc-tests -Drun_longhaul_tests=$run_longhaul_tests -Duse_amqp:BOOL=$build_amqp -Duse_http:BOOL=$build_http -Duse_mqtt:BOOL=$build_mqtt -Ddont_use_uploadtoblob:BOOL=$no_blob -Drun_unittests:BOOL=$run_unittests -Dbuild_python:STRING=$build_python -Dbuild_javawrapper:BOOL=$build_javawrapper -Dno_logging:BOOL=$no_logging $build_root -Duse_prov_client:BOOL=$prov_auth -Duse_tpm_simulator:BOOL=$prov_use_tpm_simulator -Duse_edge_modules=$use_edge_modules
-
-if [ "$make" = true ]
-then
-  # Set the default cores
-  MAKE_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
-  
-  echo "Initial MAKE_CORES=$MAKE_CORES"
-  
-  # Make sure there is enough virtual memory on the device to handle more than one job  
-  MINVSPACE="1500000"
-  
-  # Acquire total memory and total swap space setting them to zero in the event the command fails
-  MEMAR=( $(sed -n -e 's/^MemTotal:[^0-9]*\([0-9][0-9]*\).*/\1/p' -e 's/^SwapTotal:[^0-9]*\([0-9][0-9]*\).*/\1/p' /proc/meminfo) )
-  [ -z "${MEMAR[0]##*[!0-9]*}" ] && MEMAR[0]=0
-  [ -z "${MEMAR[1]##*[!0-9]*}" ] && MEMAR[1]=0
-  
-  let VSPACE=${MEMAR[0]}+${MEMAR[1]}
-  
-  echo "VSPACE=$VSPACE"
-
-  if [ "$VSPACE" -lt "$MINVSPACE" ] ; then
-    echo "WARNING: Not enough space.  Setting MAKE_CORES=1"
-    MAKE_CORES=1
-  fi
-  
-  echo "MAKE_CORES=$MAKE_CORES"
-  echo "Starting run..."
-  date
-  make --jobs=$MAKE_CORES
-  echo "completed run..."
-  date
-
-  # Only for testing E2E behaviour !!! 
-  TEST_CORES=16
-
-  if [[ $run_valgrind == 1 ]] ;
-  then
-    #use doctored openssl
-    export LD_LIBRARY_PATH=/usr/local/ssl/lib
-    ctest -j $TEST_CORES --output-on-failure
-    export LD_LIBRARY_PATH=
-  else
-    ctest -j $TEST_CORES -C "Debug" --output-on-failure
-  fi
-fi
-
-popd

+ 0 - 13
azure/build_all/linux/print_failed_tests.sed

@@ -1,13 +0,0 @@
-# Run in shell with: sed -n -f <this-sed-script> <unit-test-log-file>
-# Saves output for a test case until it can determine whether the test
-# succeeded or failed. Discards output for successful test cases, prints
-# output for failed test cases.
-
-:in_testcase                # loop entry point
-/^Suceeded\./ b             # test case succeeded; discard output & exit loop
-/^!!! FAILED !!!$/ {x;p;b}  # test case failed; print output & exit loop
-/^Executing test / h        # if new test case found, start saving output
-/^Executing test /! H       # else keep saving output
-n                           # grab the next line of output
-b in_testcase               # branch to the top of the loop
-

+ 0 - 51
azure/build_all/linux/setup.sh

@@ -1,51 +0,0 @@
-#!/bin/bash
-
-#This script updates a fresh Ubuntu installation with all the dependent
-# components necessary to use the IoT Client SDK for C.
-
-repo_name_from_uri()
-{
-    echo "$1" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g'
-}
-
-scriptdir=$(cd "$(dirname "$0")" && pwd)
-deps="curl build-essential pkg-config libcurl4-openssl-dev git cmake libssl-dev uuid-dev valgrind"
-repo="https://github.com/Azure/azure-iot-sdk-c.git"
-repo_name=$(repo_name_from_uri $repo)
-
-push_dir () { pushd $1 > /dev/null; }
-pop_dir () { popd $1 > /dev/null; }
-
-repo_exists ()
-{
-    push_dir "$scriptdir"
-    [ "$(git rev-parse --is-inside-work-tree)" == "true" ] || return 1
-    origin=$(git config remote.origin.url) || return 1
-    actual_name=$(repo_name_from_uri $origin)
-    [ "${repo_name,,}" == "${actual_name,,}" ] || return 1
-    pop_dir
-}
-
-deps_install ()
-{
-    sudo apt-get update
-    sudo apt-get install -y $deps
-}
-
-clone_source ()
-{
-    git clone $repo
-}
-
-deps_install
-
-if repo_exists
-then
-    echo "Repo $repo_name already cloned"
-    push_dir "$(git rev-parse --show-toplevel)"
-else
-    clone_source || exit 1
-    push_dir "$repo_name"
-fi
-
-pop_dir

+ 0 - 93
azure/build_all/linux/setup_opensuse.sh

@@ -1,93 +0,0 @@
-#!/bin/bash
-
-#This script updates a fresh openSUSE installation with all the dependent
-# components necessary to use the IoT Client SDK for C.
-
-#Make sure temporary Git credentials file is ALWAYS deleted
-trap 'creds_delete' EXIT
-
-repo_name_from_uri()
-{
-    echo "$1" | sed -e 's|/$||' -e 's|:*/*\.git$||' -e 's|.*[/:]||g'
-}
-
-scriptdir=$(cd "$(dirname "$0")" && pwd)
-deps=" make cmake gcc git libcurl-devel swig doxygen gcc-c++ libopenssl-devel"
-repo="https://github.com/Azure/azure-iot-sdks.git"
-repo_name=$(repo_name_from_uri $repo)
-cred=~/cred.$$
-user=
-pass=
-
-push_dir () { pushd $1 > /dev/null; }
-pop_dir () { popd $1 > /dev/null; }
-
-repo_exists ()
-{
-    push_dir "$scriptdir"
-    [ "$(git rev-parse --is-inside-work-tree)" == "true" ] || return 1
-    origin=$(git config remote.origin.url) || return 1
-    actual_name=$(repo_name_from_uri $origin)
-    [ "${repo_name,,}" == "${actual_name,,}" ] || return 1
-    pop_dir
-}
-
-creds_read ()
-{
-    echo "Enter credentials for $repo:"
-    read -p "username: " user
-    read -p "password (or access token, for 2FA): " -s pass
-    echo -e "\n"
-}
-
-creds_create ()
-{
-    protocol=$(expr "$repo" : '\(.*\):\/\/.*')
-    host=$(expr "$repo" : '.*:\/\/\([^/]*\)/.*')
-
-    #NOTE: tabs in the heredoc are intentional; don't replace them with spaces
-    git credential-store --file $cred store <<-end-credentials
-	protocol=$protocol
-	host=$host
-	username=$user
-	password=$pass
-
-	end-credentials
-}
-
-creds_delete ()
-{
-    rm -f $cred
-}
-
-deps_install ()
-{
-    sudo zypper ref
-    sudo zypper --non-interactive in $deps
-    sudo gem install rspec simplecov
-}
-
-clone_source ()
-{
-    git -c credential.helper="store --file $cred" -c core.askpass=true clone $repo
-}
-
-if ! repo_exists
-then
-    creds_read #read Git credentials up front, so script can be unattended-ish
-fi
-
-deps_install
-
-if repo_exists
-then
-    echo "Repo $repo_name already cloned"
-    push_dir "$(git rev-parse --show-toplevel)"
-else
-    creds_create
-    clone_source || exit 1
-    push_dir "$repo_name"
-    creds_delete
-fi
-
-pop_dir

+ 0 - 29
azure/build_all/mbed/build.cmd

@@ -1,29 +0,0 @@
-@REM Copyright (c) Microsoft. All rights reserved.
-@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-@setlocal EnableExtensions EnableDelayedExpansion
-@echo off
-
-set current-path=%~dp0
-rem // remove trailing slash
-set current-path=%current-path:~0,-1%
-
-set repo-build-root=%current-path%\..\..
-rem // resolve to fully qualified path
-for %%i in ("%repo-build-root%") do set repo-build-root=%%~fi
-
-rem -----------------------------------------------------------------------------
-rem -- build (clean) compilembed tool
-rem -----------------------------------------------------------------------------
-
-call "%repo-build-root%\c-utility\tools\compilembed\build.cmd" --clean
-if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-rem -----------------------------------------------------------------------------
-rem -- build iothub client samples
-rem -----------------------------------------------------------------------------
-
-call %repo-build-root%\iothub_client\build\mbed\build.cmd %*
-if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-goto :eof

+ 0 - 48
azure/build_all/packaging/linux/apt-get-release.sh

@@ -1,48 +0,0 @@
-#!/bin/bash
-#set -o pipefail
-#
-
-azureiot_folder="azure-iot-sdk"
-azureiot_repo="https://github.com/Azure/azure-iot-sdk-c"
-azureiot_c_folder="azure-iot-sdk-c-0.1.0"
-azureiot_c_zip_folder="azure-iot-sdk-c-0.1.0.tar.gz"
-azureiot_c_change_file="azure-iot-sdk-c_0.1.0-1_source.changes"
-
-sync_azureiot()
-{
-	echo Sync Azure IoT SDK
-	echo $azureiot_repo
-
-	git clone $azureiot_repo $azureiot_folder
-}
-
-setup_debian_folder()
-{
-	cd ~/$azureiot_folder
-	mv c $azureiot_c_folder
-	tar czvf $azureiot_c_zip_folder $azureiot_c_folder
-	cd $azureiot_c_folder
-	dh_make -y -l -c mit -e aziotsdklinux@outlook.com -f ../$azureiot_c_zip_folder
-
-	# Remove the debian folder
-	dh_make -y -l -c mit -e aziotsdklinux@outlook.com -f ../$azureiot_c_zip_folder
-	cp -r ~/$azureiot_folder/$azureiot_c_folder/build_all/packaging/linux/debian ./
-}
-
-build_package()
-{
-	cd ..
-	echo build package
-	dpkg-buildpackage -us -uc
-
-	# Sign the packages
-	dpkg-buildpackage -S
-}
-
-upload_to_Launchpad()
-{
-	dput ppa:aziotsdklinux/ppa-azure-iot-sdk-c $azureiot_c_file
-}
-
-sync_azureiot
-build_package

+ 0 - 2
azure/build_all/packaging/linux/debian/azure-iot-sdk-c-dev.dirs

@@ -1,2 +0,0 @@
-usr/include
-usr/include/azureiot

+ 0 - 1
azure/build_all/packaging/linux/debian/azure-iot-sdk-c-dev.install

@@ -1 +0,0 @@
-usr/include/azureiot/*

+ 0 - 1
azure/build_all/packaging/linux/debian/azure-iot-sdk-c-lib.dirs

@@ -1 +0,0 @@
-usr/lib

+ 0 - 1
azure/build_all/packaging/linux/debian/azure-iot-sdk-c-lib.install

@@ -1 +0,0 @@
-usr/lib/lib*.a

+ 0 - 5
azure/build_all/packaging/linux/debian/changelog-trusty

@@ -1,5 +0,0 @@
-azure-iot-sdk-c (0.2.0-1trusty) trusty; urgency=low
-
-  * See https://github.com/Azure/azure-iot-sdk-c/releases for details of the release
-
- -- AzureIoT User <aziotsdklinux@outlook.com>  Tue, 27 Sep 2016 11:00:00 +0000

+ 0 - 5
azure/build_all/packaging/linux/debian/changelog-vivid

@@ -1,5 +0,0 @@
-azure-iot-sdk-c (0.1.0-61vivid) vivid; urgency=low
-
-  * See https://github.com/Azure/azure-iot-sdk-c/releases for details of the release
-
- -- AzureIoT User <aziotsdklinux@outlook.com>  Tue, 27 Sep 2016 11:00:00 +0000

+ 0 - 5
azure/build_all/packaging/linux/debian/changelog-wily

@@ -1,5 +0,0 @@
-azure-iot-sdk-c (undefined) wily; urgency=low
-
-  * See https://github.com/Azure/azure-iot-sdk-c/releases for details of the release
-
- -- AzureIoT User <aziotsdklinux@outlook.com>  Tue, 27 Sep 2016 11:00:00 +0000

+ 0 - 5
azure/build_all/packaging/linux/debian/changelog-xenial

@@ -1,5 +0,0 @@
-azure-iot-sdk-c (0.2.0.0-1xenial) xenial; urgency=low
-
-  * See https://github.com/Azure/azure-iot-sdk-c/releases for details of the release
-
- -- AzureIoT User <aziotsdklinux@outlook.com>  Tue, 27 Sep 2016 11:00:00 +0000

+ 0 - 1
azure/build_all/packaging/linux/debian/compat

@@ -1 +0,0 @@
-9

+ 0 - 27
azure/build_all/packaging/linux/debian/control

@@ -1,27 +0,0 @@
-Source: azure-iot-sdk-c
-Priority: optional
-Maintainer: Azure User <aziotsdklinux@outlook.com>
-Build-Depends: debhelper (>= 9), cmake (>= 2.8), libssl-dev, libcurl4-openssl-dev, curl, azure-c-shared-util-dev, azure-uamqp-c-dev, azure-umqtt-c-dev
-Standards-Version: 3.9.6
-Section: libs
-Homepage: https://github.com/Azure/azure-iot-sdk-c.git
-Vcs-Git: git://anonscm.debian.org/collab-maint/azure-iot-sdk-c.git
-Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/azure-iot-sdk-c.git;a=summary
-
-Package: azure-iot-sdk-c-dev
-Section: libdevel
-Architecture: any
-Depends: azure-iot-sdk-c-lib (= ${binary:Version}), ${misc:Depends}, libssl-dev, libcurl4-openssl-dev, curl, azure-c-shared-util-dev, azure-uamqp-c-dev, azure-umqtt-c-dev
-Description: Microsoft Azure IoT device SDK for C Library
- The Microsoft Azure IoT device libraries for C contain code that
- facilitates building devices and applications that connect to and
- are managed by Azure IoT Hub services
-
-Package: azure-iot-sdk-c-lib
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libssl-dev, libcurl4-openssl-dev, curl, azure-c-shared-util-dev, azure-uamqp-c-dev, azure-umqtt-c-dev
-Description: Microsoft Azure IoT device SDK for C Library
- The Microsoft Azure IoT device libraries for C contain code that
- facilitates building devices and applications that connect to and
- are managed by Azure IoT Hub services
-

+ 0 - 26
azure/build_all/packaging/linux/debian/control-trusty

@@ -1,26 +0,0 @@
-Source: azure-iot-sdk-c
-Priority: optional
-Maintainer: Azure User <aziotsdklinux@outlook.com>
-Build-Depends: gcc (>= 4.9), debhelper (>= 9), cmake (>= 3), libcurl4-openssl-dev, curl, azureiot-qpid-proton-dev
-Standards-Version: 3.9.6
-Section: libs
-Homepage: https://github.com/Azure/azure-iot-sdk-c.git
-Vcs-Git: git://anonscm.debian.org/collab-maint/azure-iot-sdk-c.git
-Vcs-Browser: http://anonscm.debian.org/?p=collab-maint/azure-iot-sdk-c.git;a=summary
-
-Package: azure-iot-sdk-c-dev
-Section: libdevel
-Architecture: any
-Depends: azure-iot-sdk-c-lib (= ${binary:Version}), ${misc:Depends}
-Description: AzureIoT Apache Qpid-Proton-C Development Package
- Fork of Apache Qpid-Proton-C Library used to developing apps
- to communicate Microsoft Azure IoTHub
-
-Package: azure-iot-sdk-c-lib
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, azureiot-qpid-proton-dev, curl
-Description: Microsoft Azure IoT device SDK for C Library
- The Microsoft Azure IoT device libraries for C contain code that
- facilitates building devices and applications that connect to and
- are managed by Azure IoT Hub services
-

+ 0 - 30
azure/build_all/packaging/linux/debian/copyright

@@ -1,30 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: azure-iot-sdk-c
-Source: https://github.com/Azure/azure-iot-sdk-c.git
-
-Files: *
-Copyright: 2015 AzureIoT User <aziotsdklinux@outlook.com>
-License: MIT
-
-Files: debian/*
-Copyright: 2015 AzureIoT User <aziotsdklinux@outlook.com>
-License: MIT
-
-License: MIT
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
- .
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- .
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 1
azure/build_all/packaging/linux/debian/docs

@@ -1 +0,0 @@
-readme.md

+ 0 - 37
azure/build_all/packaging/linux/debian/rules

@@ -1,37 +0,0 @@
-#!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-DH_VERBOSE = 1
-
-# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
-DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/default.mk
-
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-
-
-# main packaging script based on dh7 syntax
-%:
-	dh $@ --buildsystem=cmake --DSYSINSTALL_BINDINGS=ON
-
-override_dh_auto_configure:
-	dh_auto_configure --
-
-override_dh_auto_install:
-	rm -f -r $$(pwd)/debian/tmp
-	mkdir $$(pwd)/debian/tmp
-	mkdir $$(pwd)/debian/tmp/usr
-	mkdir $$(pwd)/debian/tmp/usr/lib
-	mkdir $$(pwd)/debian/tmp/usr/include
-	mkdir $$(pwd)/debian/tmp/usr/include/azureiot
-	cp $$(pwd)/obj-*/iothub_client/*.a $$(pwd)/debian/tmp/usr/lib/
-	cp $$(pwd)/obj-*/serializer/*.a $$(pwd)/debian/tmp/usr/lib/
-	cp $$(pwd)/iothub_client/inc/* $$(pwd)/debian/tmp/usr/include/azureiot
-	cp $$(pwd)/serializer/inc/* $$(pwd)/debian/tmp/usr/include/azureiot

+ 0 - 1
azure/build_all/packaging/linux/debian/source/format

@@ -1 +0,0 @@
-3.0 (native)

+ 0 - 54
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport.nuspec

@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-    <metadata>
-        <id>Microsoft.Azure.IoTHub.AmqpTransport</id>
-        <version>1.2.4</version>
-        <title>Microsoft Azure IoTHub AMQP transport</title>
-        <authors>Microsoft</authors>
-        <licenseUrl>https://github.com/Azure/azure-iot-sdk-c/blob/master/LICENSE</licenseUrl>
-        <projectUrl>https://github.com/Azure/azure-iot-sdk-c</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-        <description>Microsoft Azure IoTHub AMQP transport</description>
-        <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
-        <summary>This nuget package can be used to connect to IoTHub over AMQP.</summary>
-        <releaseNotes/>
-        <copyright>© Microsoft Corporation. All rights reserved.</copyright>
-        <tags>AMQP Microsoft Azure IoT Native x86 x64 arm native package</tags>
-        <dependencies>
-            <dependency id="Microsoft.Azure.Uamqp" version="1.2.4"/>
-            <dependency id="Microsoft.Azure.IoTHub.IoTHubClient" version="1.2.4"/>
-            <dependency id="Microsoft.Azure.C.SharedUtility" version="1.1.4"/>
-        </dependencies>
-    </metadata>
-    <files>
-        <file src="Microsoft.Azure.IoTHub.AmqpTransport_thirdpartynotice.txt" target="thirdpartynotice.txt"/>
-
-        <!-- these are files for x86 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_amqp_transport.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_amqp_transport.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client_amqp_transport.lib" target="build\native\Win32\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_amqp_ws_transport.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_amqp_ws_transport.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client_amqp_ws_transport.lib" target="build\native\Win32\Release"/>
-
-        <!-- these are files for x64 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_amqp_transport.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_amqp_transport.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client_amqp_transport.lib" target="build\native\x64\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_amqp_ws_transport.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_amqp_ws_transport.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client_amqp_ws_transport.lib" target="build\native\x64\Release"/>
-
-        <!-- these are files for arm plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_amqp_transport.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_amqp_transport.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client_amqp_transport.lib" target="build\native\arm\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_amqp_ws_transport.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_amqp_ws_transport.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client_amqp_ws_transport.lib" target="build\native\arm\Release"/>
-
-        <file src="Microsoft.Azure.IoTHub.AmqpTransport.targets" target="build\native"/>
-        <file src="..\..\..\iothub_client\inc\iothubtransportamqp.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothubtransportamqp_websockets.h" target="build\native\include"/>
-    </files>
-</package>

+ 0 - 107
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport.targets

@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Microsoft_Azure_Amqp_Transport_Init">
-  <PropertyGroup Label="Default initializers for properties">
-    <Linkage-Microsoft_Azure_Amqp_Transport_Init Condition="'$(Linkage-Microsoft_Azure_Amqp_Transport_Init)' == ''">static</Linkage-Microsoft_Azure_Amqp_Transport_Init>
-    <CallingConvention-Microsoft_Azure_Amqp_Transport Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)' == ''">cdecl</CallingConvention-Microsoft_Azure_Amqp_Transport>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmDebug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmRelease" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client_amqp_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client_amqp_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <UsingTask TaskName="Microsoft_Azure_Amqp_Transport_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
-    <ParameterGroup>
-      <Text Output="false" ParameterType="System.String" />
-      <Library Output="false" Required="true" ParameterType="System.String" />
-      <Value Output="false" Required="true" ParameterType="System.String" />
-      <Result Output="true" ParameterType="System.String" />
-    </ParameterGroup>
-    <Task>
-      <Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
-    </Task>
-  </UsingTask>
-  <Target Name="Microsoft_Azure_Amqp_Transport_Init">
-    <Microsoft_Azure_Amqp_Transport_Contains Text="Linkage-dynamic" Library="Microsoft_Azure_Amqp_Transport" Value="dynamic" Condition="'$(Linkage-Microsoft_Azure_Amqp_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Amqp_Transport_Init" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="Linkage-static" Library="Microsoft_Azure_Amqp_Transport" Value="static" Condition="'$(Linkage-Microsoft_Azure_Amqp_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Amqp_Transport_Init" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="Linkage-ltcg" Library="Microsoft_Azure_Amqp_Transport" Value="ltcg" Condition="'$(Linkage-Microsoft_Azure_Amqp_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Amqp_Transport_Init" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="Linkage-sxs" Library="Microsoft_Azure_Amqp_Transport" Value="sxs" Condition="'$(Linkage-Microsoft_Azure_Amqp_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Amqp_Transport_Init" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="CallingConvention-cdecl" Library="Microsoft_Azure_Amqp_Transport" Value="cdecl" Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Amqp_Transport" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="CallingConvention-stdcall" Library="Microsoft_Azure_Amqp_Transport" Value="stdcall" Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Amqp_Transport" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="CallingConvention-fastcall" Library="Microsoft_Azure_Amqp_Transport" Value="fastcall" Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Amqp_Transport" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="CallingConvention-thiscall" Library="Microsoft_Azure_Amqp_Transport" Value="thiscall" Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Amqp_Transport" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-    <Microsoft_Azure_Amqp_Transport_Contains Text="CallingConvention-clrcall" Library="Microsoft_Azure_Amqp_Transport" Value="clrcall" Condition="'$(CallingConvention-Microsoft_Azure_Amqp_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Amqp_Transport" />
-    </Microsoft_Azure_Amqp_Transport_Contains>
-  </Target>
-    <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild" AfterTargets="AfterBuild" />
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Win32_and_Debug" Label="Win32 and Debug" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Win32_and_Release" Label="Win32 and Release" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Win64_and_Debug" Label="Win64 and Debug" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Win64_and_Release" Label="Win64 and Release" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Arm_and_Debug" Label="Arm and Debug" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Amqp_Transport_redist_AfterBuild_Arm_and_Release" Label="Arm and Release" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Amqp_Transport_redist_AfterBuild">
-  </Target>
-  
-</Project>

+ 0 - 9
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.AmqpTransport_thirdpartynotice.txt

@@ -1,9 +0,0 @@
-Third Party Notices for Azure IoT SDKs project
-
-This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
-Microsoft Corporation is not the original author of the Third Party Code.
-The original copyright notice and license, under which Microsoft Corporation received such Third Party Code, 
-are set out below.  This Third Party Code is licensed to you under their original license terms set forth below.  
-Microsoft Corporation reserves all other rights not expressly granted, whether by implication, estoppel or otherwise.  
-
-N/A

+ 0 - 42
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport.nuspec

@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-    <metadata>
-        <id>Microsoft.Azure.IoTHub.HttpTransport</id>
-        <version>1.2.4</version>
-        <title>Microsoft Azure IoTHub HTTP transport</title>
-        <authors>Microsoft</authors>
-        <licenseUrl>https://github.com/Azure/azure-iot-sdk-c/blob/master/LICENSE</licenseUrl>
-        <projectUrl>https://github.com/Azure/azure-iot-sdk-c</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-        <description>Microsoft Azure IoTHub HTTP transport</description>
-        <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
-        <summary>This nuget package can be used to connect to IoTHub over HTTP.</summary>
-        <releaseNotes/>
-        <copyright>© Microsoft Corporation. All rights reserved.</copyright>
-        <tags>HTTP Microsoft Azure IoT Native x86 x64 arm native package</tags>
-        <dependencies>
-            <dependency id="Microsoft.Azure.IoTHub.IoTHubClient" version="1.2.4"/>
-            <dependency id="Microsoft.Azure.C.SharedUtility" version="1.1.4"/>
-        </dependencies>
-    </metadata>
-    <files>
-        <!-- these are files for x86 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_http_transport.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_http_transport.pdb" target="build\native\Win32\Debug"/>
-
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client_http_transport.lib" target="build\native\Win32\Release"/>
-
-        <!-- these are files for x64 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_http_transport.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_http_transport.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client_http_transport.lib" target="build\native\x64\Release"/>
-
-        <!-- these are files for arm plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_http_transport.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_http_transport.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client_http_transport.lib" target="build\native\arm\Release"/>
-
-        <file src="Microsoft.Azure.IoTHub.HttpTransport.targets" target="build\native"/>
-        <file src="..\..\..\iothub_client\inc\iothubtransporthttp.h" target="build\native\include"/>
-    </files>
-</package>

+ 0 - 101
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport.targets

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Microsoft_Azure_Http_Transport_Init">
-  <PropertyGroup Label="Default initializers for properties">
-    <Linkage-Microsoft_Azure_Http_Transport_Init Condition="'$(Linkage-Microsoft_Azure_Http_Transport_Init)' == ''">static</Linkage-Microsoft_Azure_Http_Transport_Init>
-    <CallingConvention-Microsoft_Azure_Http_Transport Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)' == ''">cdecl</CallingConvention-Microsoft_Azure_Http_Transport>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmDebug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmRelease" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client_http_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <UsingTask TaskName="Microsoft_Azure_Http_Transport_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
-    <ParameterGroup>
-      <Text Output="false" ParameterType="System.String" />
-      <Library Output="false" Required="true" ParameterType="System.String" />
-      <Value Output="false" Required="true" ParameterType="System.String" />
-      <Result Output="true" ParameterType="System.String" />
-    </ParameterGroup>
-    <Task>
-      <Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
-    </Task>
-  </UsingTask>
-  <Target Name="Microsoft_Azure_Http_Transport_Init">
-    <Microsoft_Azure_Http_Transport_Contains Text="Linkage-dynamic" Library="Microsoft_Azure_Http_Transport" Value="dynamic" Condition="'$(Linkage-Microsoft_Azure_Http_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Http_Transport_Init" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="Linkage-static" Library="Microsoft_Azure_Http_Transport" Value="static" Condition="'$(Linkage-Microsoft_Azure_Http_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Http_Transport_Init" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="Linkage-ltcg" Library="Microsoft_Azure_Http_Transport" Value="ltcg" Condition="'$(Linkage-Microsoft_Azure_Http_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Http_Transport_Init" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="Linkage-sxs" Library="Microsoft_Azure_Http_Transport" Value="sxs" Condition="'$(Linkage-Microsoft_Azure_Http_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Http_Transport_Init" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="CallingConvention-cdecl" Library="Microsoft_Azure_Http_Transport" Value="cdecl" Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Http_Transport" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="CallingConvention-stdcall" Library="Microsoft_Azure_Http_Transport" Value="stdcall" Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Http_Transport" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="CallingConvention-fastcall" Library="Microsoft_Azure_Http_Transport" Value="fastcall" Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Http_Transport" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="CallingConvention-thiscall" Library="Microsoft_Azure_Http_Transport" Value="thiscall" Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Http_Transport" />
-    </Microsoft_Azure_Http_Transport_Contains>
-    <Microsoft_Azure_Http_Transport_Contains Text="CallingConvention-clrcall" Library="Microsoft_Azure_Http_Transport" Value="clrcall" Condition="'$(CallingConvention-Microsoft_Azure_Http_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Http_Transport" />
-    </Microsoft_Azure_Http_Transport_Contains>
-  </Target>
-    <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild" AfterTargets="AfterBuild" />
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Win32_and_Debug" Label="Win32 and Debug" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Win32_and_Release" Label="Win32 and Release" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Win64_and_Debug" Label="Win64 and Debug" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Win64_and_Release" Label="Win64 and Release" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Arm_and_Debug" Label="Arm and Debug" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Http_Transport_redist_AfterBuild_Arm_and_Release" Label="Arm and Release" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Http_Transport_redist_AfterBuild">
-  </Target>
-  
-</Project>

+ 0 - 8
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.HttpTransport_thirdpartynotice.txt

@@ -1,8 +0,0 @@
-Third Party Notices for Azure IoT Http SDKs project
-
-This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
-Microsoft Corporation is not the original author of the Third Party Code.
-The original copyright notice and license, under which Microsoft Corporation received such Third Party Code, 
-are set out below.  This Third Party Code is licensed to you under their original license terms set forth below.  
-Microsoft Corporation reserves all other rights not expressly granted, whether by implication, estoppel or otherwise.  
-

+ 0 - 51
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient.nuspec

@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-    <metadata>
-        <id>Microsoft.Azure.IoTHub.IoTHubClient</id>
-        <version>1.2.4</version>
-        <title>Microsoft Azure IoTHub IoTHubClient</title>
-        <authors>Microsoft</authors>
-        <licenseUrl>https://github.com/Azure/azure-iot-sdk-c/blob/master/LICENSE</licenseUrl>
-        <projectUrl>https://github.com/Azure/azure-iot-sdk-c</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-        <description>Microsoft Azure IoTHub Client</description>
-        <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
-        <summary>This nuget package contains common interface shared between AMQP, MQTT and HTTP transports to IoTHub</summary>
-        <releaseNotes/>
-        <copyright>© Microsoft Corporation. All rights reserved.</copyright>
-        <tags>Microsoft Azure IoT Native x86 x64 arm native package IoTHubClient</tags>
-        <dependencies>
-            <dependency id="Microsoft.Azure.C.SharedUtility" version="1.1.4"/>
-        </dependencies>
-    </metadata>
-    <files>
-        <!-- these are files for x86 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client.lib" target="build\native\Win32\Release"/>
-
-        <!-- these are files for x64 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client.lib" target="build\native\x64\Release"/>
-
-        <!-- these are files for arm plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client.lib" target="build\native\arm\Release"/>
-
-        <file src="Microsoft.Azure.IoTHub.IoTHubClient.targets" target="build\native"/>
-
-        <file src="..\..\..\iothub_client\inc\iothub_client.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_client_ll.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_client_options.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_message.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_client_version.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_transport_ll.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_client_edge.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_client_ll_edge.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_module_client.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub_module_client_ll.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothub.h" target="build\native\include"/>
-    </files>
-</package>

+ 0 - 101
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient.targets

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Microsoft_Azure_IoTHubClient_Init">
-  <PropertyGroup Label="Default initializers for properties">
-    <Linkage-Microsoft_Azure_IoTHubClient_Init Condition="'$(Linkage-Microsoft_Azure_IoTHubClient_Init)' == ''">static</Linkage-Microsoft_Azure_IoTHubClient_Init>
-    <CallingConvention-Microsoft_Azure_IoTHubClient Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)' == ''">cdecl</CallingConvention-Microsoft_Azure_IoTHubClient>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmDebug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmRelease" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>crypt32.lib;winhttp.lib;$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <UsingTask TaskName="Microsoft_Azure_IoTHubClient_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
-    <ParameterGroup>
-      <Text Output="false" ParameterType="System.String" />
-      <Library Output="false" Required="true" ParameterType="System.String" />
-      <Value Output="false" Required="true" ParameterType="System.String" />
-      <Result Output="true" ParameterType="System.String" />
-    </ParameterGroup>
-    <Task>
-      <Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
-    </Task>
-  </UsingTask>
-  <Target Name="Microsoft_Azure_IoTHubClient_Init">
-    <Microsoft_Azure_IoTHubClient_Contains Text="Linkage-dynamic" Library="Microsoft_Azure_IoTHubClient" Value="dynamic" Condition="'$(Linkage-Microsoft_Azure_IoTHubClient_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_IoTHubClient_Init" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="Linkage-static" Library="Microsoft_Azure_IoTHubClient" Value="static" Condition="'$(Linkage-Microsoft_Azure_IoTHubClient_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_IoTHubClient_Init" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="Linkage-ltcg" Library="Microsoft_Azure_IoTHubClient" Value="ltcg" Condition="'$(Linkage-Microsoft_Azure_IoTHubClient_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_IoTHubClient_Init" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="Linkage-sxs" Library="Microsoft_Azure_IoTHubClient" Value="sxs" Condition="'$(Linkage-Microsoft_Azure_IoTHubClient_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_IoTHubClient_Init" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="CallingConvention-cdecl" Library="Microsoft_Azure_IoTHubClient" Value="cdecl" Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_IoTHubClient" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="CallingConvention-stdcall" Library="Microsoft_Azure_IoTHubClient" Value="stdcall" Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_IoTHubClient" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="CallingConvention-fastcall" Library="Microsoft_Azure_IoTHubClient" Value="fastcall" Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_IoTHubClient" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="CallingConvention-thiscall" Library="Microsoft_Azure_IoTHubClient" Value="thiscall" Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_IoTHubClient" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-    <Microsoft_Azure_IoTHubClient_Contains Text="CallingConvention-clrcall" Library="Microsoft_Azure_IoTHubClient" Value="clrcall" Condition="'$(CallingConvention-Microsoft_Azure_IoTHubClient)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_IoTHubClient" />
-    </Microsoft_Azure_IoTHubClient_Contains>
-  </Target>
-    <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild" AfterTargets="AfterBuild" />
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Win32_and_Debug" Label="Win32 and Debug" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Win32_and_Release" Label="Win32 and Release" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Win64_and_Debug" Label="Win64 and Debug" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Win64_and_Release" Label="Win64 and Release" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Arm_and_Debug" Label="Arm and Debug" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_IoTHubClient_redist_AfterBuild_Arm_and_Release" Label="Arm and Release" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_IoTHubClient_redist_AfterBuild">
-  </Target>
-  
-</Project>

+ 0 - 8
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.IoTHubClient_thirdpartynotice.txt

@@ -1,8 +0,0 @@
-Third Party Notices for Azure IoThub SDKs project
-
-This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
-Microsoft Corporation is not the original author of the Third Party Code.
-The original copyright notice and license, under which Microsoft Corporation received such Third Party Code, 
-are set out below.  This Third Party Code is licensed to you under their original license terms set forth below.  
-Microsoft Corporation reserves all other rights not expressly granted, whether by implication, estoppel or otherwise.  
-

+ 0 - 55
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport.nuspec

@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-    <metadata>
-        <id>Microsoft.Azure.IoTHub.MqttTransport</id>
-        <version>1.2.4</version>
-        <title>Microsoft Azure IoTHub MQTT transport</title>
-        <authors>Microsoft</authors>
-        <licenseUrl>https://github.com/Azure/azure-iot-sdk-c/blob/master/LICENSE</licenseUrl>
-        <projectUrl>https://github.com/Azure/azure-iot-sdk-c</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-        <description>Microsoft Azure IoTHub MQTT transport</description>
-        <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
-        <summary>This nuget package can be used to connect to IoTHub over MQTT.</summary>
-        <releaseNotes/>
-        <copyright>© Microsoft Corporation. All rights reserved.</copyright>
-        <tags>MQTT Microsoft Azure IoT Native x86 x64 arm native package</tags>
-        <dependencies>
-            <dependency id="Microsoft.Azure.IoTHub.IoTHubClient" version="1.2.4"/>
-            <dependency id="Microsoft.Azure.C.SharedUtility" version="1.1.4"/>
-            <dependency id="Microsoft.Azure.umqtt" version="1.1.4"/>
-        </dependencies>
-    </metadata>
-    <files>
-        <file src="Microsoft.Azure.IoTHub.MqttTransport_thirdpartynotice.txt" target="thirdpartynotice.txt"/>
-
-        <!-- these are files for x86 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_mqtt_transport.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_mqtt_transport.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client_mqtt_transport.lib" target="build\native\Win32\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_mqtt_ws_transport.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\iothub_client_mqtt_ws_transport.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\iothub_client_mqtt_ws_transport.lib" target="build\native\Win32\Release"/>
-
-        <!-- these are files for x64 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_mqtt_transport.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_mqtt_transport.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client_mqtt_transport.lib" target="build\native\x64\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_mqtt_ws_transport.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\iothub_client_mqtt_ws_transport.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\iothub_client_mqtt_ws_transport.lib" target="build\native\x64\Release"/>
-
-        <!-- these are files for arm plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_mqtt_transport.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_mqtt_transport.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client_mqtt_transport.lib" target="build\native\arm\Release"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_mqtt_ws_transport.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\iothub_client_mqtt_ws_transport.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\iothub_client_mqtt_ws_transport.lib" target="build\native\arm\Release"/>
-
-        <file src="Microsoft.Azure.IoTHub.MqttTransport.targets" target="build\native"/>
-
-        <file src="..\..\..\iothub_client\inc\iothubtransportmqtt.h" target="build\native\include"/>
-        <file src="..\..\..\iothub_client\inc\iothubtransportmqtt_websockets.h" target="build\native\include"/>
-    </files>
-</package>

+ 0 - 107
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport.targets

@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Microsoft_Azure_Mqtt_Transport_Init">
-  <PropertyGroup Label="Default initializers for properties">
-    <Linkage-Microsoft_Azure_Mqtt_Transport_Init Condition="'$(Linkage-Microsoft_Azure_Mqtt_Transport_Init)' == ''">static</Linkage-Microsoft_Azure_Mqtt_Transport_Init>
-    <CallingConvention-Microsoft_Azure_Mqtt_Transport Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)' == ''">cdecl</CallingConvention-Microsoft_Azure_Mqtt_Transport>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Release/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Debug/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Release/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmDebug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Debug/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmRelease" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'arm`' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client_mqtt_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Release/iothub_client_mqtt_ws_transport.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <UsingTask TaskName="Microsoft_Azure_Mqtt_Transport_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
-    <ParameterGroup>
-      <Text Output="false" ParameterType="System.String" />
-      <Library Output="false" Required="true" ParameterType="System.String" />
-      <Value Output="false" Required="true" ParameterType="System.String" />
-      <Result Output="true" ParameterType="System.String" />
-    </ParameterGroup>
-    <Task>
-      <Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
-    </Task>
-  </UsingTask>
-  <Target Name="Microsoft_Azure_Mqtt_Transport_Init">
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="Linkage-dynamic" Library="Microsoft_Azure_Mqtt_Transport" Value="dynamic" Condition="'$(Linkage-Microsoft_Azure_Mqtt_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Mqtt_Transport_Init" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="Linkage-static" Library="Microsoft_Azure_Mqtt_Transport" Value="static" Condition="'$(Linkage-Microsoft_Azure_Mqtt_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Mqtt_Transport_Init" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="Linkage-ltcg" Library="Microsoft_Azure_Mqtt_Transport" Value="ltcg" Condition="'$(Linkage-Microsoft_Azure_Mqtt_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Mqtt_Transport_Init" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="Linkage-sxs" Library="Microsoft_Azure_Mqtt_Transport" Value="sxs" Condition="'$(Linkage-Microsoft_Azure_Mqtt_Transport_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Mqtt_Transport_Init" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="CallingConvention-cdecl" Library="Microsoft_Azure_Mqtt_Transport" Value="cdecl" Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Mqtt_Transport" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="CallingConvention-stdcall" Library="Microsoft_Azure_Mqtt_Transport" Value="stdcall" Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Mqtt_Transport" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="CallingConvention-fastcall" Library="Microsoft_Azure_Mqtt_Transport" Value="fastcall" Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Mqtt_Transport" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="CallingConvention-thiscall" Library="Microsoft_Azure_Mqtt_Transport" Value="thiscall" Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Mqtt_Transport" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-    <Microsoft_Azure_Mqtt_Transport_Contains Text="CallingConvention-clrcall" Library="Microsoft_Azure_Mqtt_Transport" Value="clrcall" Condition="'$(CallingConvention-Microsoft_Azure_Mqtt_Transport)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Mqtt_Transport" />
-    </Microsoft_Azure_Mqtt_Transport_Contains>
-  </Target>
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild" AfterTargets="AfterBuild" />
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Win32_and_Debug" Label="Win32 and Debug" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Win32_and_Release" Label="Win32 and Release" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-    
-   <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Win64_and_Debug" Label="Win64 and Debug" Condition="'$(Platform.ToLower())' == 'win64' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Win64_and_Release" Label="Win64 and Release" Condition="'$(Platform.ToLower())' == 'win64' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-  
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Arm_and_Debug" Label="Arm and Debug" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild_Arm_and_Release" Label="Arm and Release" Condition="'$(Platform.ToLower())' == 'arm' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Mqtt_Transport_redist_AfterBuild">
-  </Target>
-  
-</Project>

+ 0 - 8
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.MqttTransport_thirdpartynotice.txt

@@ -1,8 +0,0 @@
-Third Party Notices for Azure IoT MQTT SDKs project
-
-This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
-Microsoft Corporation is not the original author of the Third Party Code.
-The original copyright notice and license, under which Microsoft Corporation received such Third Party Code, 
-are set out below.  This Third Party Code is licensed to you under their original license terms set forth below.  
-Microsoft Corporation reserves all other rights not expressly granted, whether by implication, estoppel or otherwise.  
-

+ 0 - 40
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer.nuspec

@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
-    <metadata>
-        <id>Microsoft.Azure.IoTHub.Serializer</id>
-        <version>1.2.4</version>
-        <title>Microsoft Azure IoTHub Serializer</title>
-        <authors>Microsoft</authors>
-        <licenseUrl>https://github.com/Azure/azure-iot-sdk-c/blob/master/LICENSE</licenseUrl>
-        <projectUrl>https://github.com/Azure/azure-iot-sdk-c</projectUrl>
-        <requireLicenseAcceptance>true</requireLicenseAcceptance>
-        <description>Microsoft Azure IoTHub Serializer</description>
-        <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
-        <summary>This nuget package contains a serializer library for IoTHub</summary>
-        <releaseNotes/>
-        <copyright>© Microsoft Corporation. All rights reserved.</copyright>
-        <tags>Microsoft Azure IoT Native x86 x64 arm native package</tags>
-        <dependencies>
-            <dependency id="Microsoft.Azure.C.SharedUtility" version="1.1.4"/>
-        </dependencies>
-    </metadata>
-    <files>
-        <!-- these are files for x86 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\serializer.lib" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\debug\serializer.pdb" target="build\native\Win32\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\win32\release\serializer.lib" target="build\native\Win32\Release"/>
-
-        <!-- these are files for x64 plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\serializer.lib" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\debug\serializer.pdb" target="build\native\x64\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\x64\release\serializer.lib" target="build\native\x64\Release"/>
-
-        <!-- these are files for arm plaform -->
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\serializer.lib" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\debug\serializer.pdb" target="build\native\arm\Debug"/>
-        <file src="..\..\..\cmake\iot_sdk_output\c\arm\release\serializer.lib" target="build\native\arm\Release"/>
-
-        <file src="Microsoft.Azure.IoTHub.Serializer.targets" target="build\native"/>
-        <file src="..\..\..\serializer\inc\*.h" target="build\native\include"/>
-    </files>
-</package>

+ 0 - 101
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer.targets

@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="Microsoft_Azure_Serializer_Init">
-  <PropertyGroup Label="Default initializers for properties">
-    <Linkage-Microsoft_Azure_Serializer_Init Condition="'$(Linkage-Microsoft_Azure_Serializer_Init)' == ''">static</Linkage-Microsoft_Azure_Serializer_Init>
-    <CallingConvention-Microsoft_Azure_Serializer Condition="'$(CallingConvention-Microsoft_Azure_Serializer)' == ''">cdecl</CallingConvention-Microsoft_Azure_Serializer>
-  </PropertyGroup>
-  <ItemDefinitionGroup>
-    <ClCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <ResourceCompile>
-      <AdditionalIncludeDirectories>$(MSBuildThisFileDirectory)../../build/native/include/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ResourceCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Debug/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win32Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'Win32' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/Win32/Release/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Debug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Debug/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="Win64Release" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'x64' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/x64/Release/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmDebug" Condition="(( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Debug/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Label="ArmRelease" Condition="(( $(Configuration.ToLower().IndexOf('debug')) == -1 ) And ('$(Platform)' == 'arm' ) )">
-    <Link>
-      <AdditionalDependencies>$(MSBuildThisFileDirectory)../../build/native/arm/Release/serializer.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <UsingTask TaskName="Microsoft_Azure_Serializer_Contains" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
-    <ParameterGroup>
-      <Text Output="false" ParameterType="System.String" />
-      <Library Output="false" Required="true" ParameterType="System.String" />
-      <Value Output="false" Required="true" ParameterType="System.String" />
-      <Result Output="true" ParameterType="System.String" />
-    </ParameterGroup>
-    <Task>
-      <Code>Result = ((Text ?? "").Split(';').Contains(Library) ) ? Value : String.Empty;</Code>
-    </Task>
-  </UsingTask>
-  <Target Name="Microsoft_Azure_Serializer_Init">
-    <Microsoft_Azure_Serializer_Contains Text="Linkage-dynamic" Library="Microsoft_Azure_Serializer" Value="dynamic" Condition="'$(Linkage-Microsoft_Azure_Serializer_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Serializer_Init" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="Linkage-static" Library="Microsoft_Azure_Serializer" Value="static" Condition="'$(Linkage-Microsoft_Azure_Serializer_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Serializer_Init" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="Linkage-ltcg" Library="Microsoft_Azure_Serializer" Value="ltcg" Condition="'$(Linkage-Microsoft_Azure_Serializer_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Serializer_Init" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="Linkage-sxs" Library="Microsoft_Azure_Serializer" Value="sxs" Condition="'$(Linkage-Microsoft_Azure_Serializer_Init)'==''">
-      <Output TaskParameter="Result" PropertyName="Linkage-Microsoft_Azure_Serializer_Init" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="CallingConvention-cdecl" Library="Microsoft_Azure_Serializer" Value="cdecl" Condition="'$(CallingConvention-Microsoft_Azure_Serializer)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Serializer" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="CallingConvention-stdcall" Library="Microsoft_Azure_Serializer" Value="stdcall" Condition="'$(CallingConvention-Microsoft_Azure_Serializer)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Serializer" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="CallingConvention-fastcall" Library="Microsoft_Azure_Serializer" Value="fastcall" Condition="'$(CallingConvention-Microsoft_Azure_Serializer)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Serializer" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="CallingConvention-thiscall" Library="Microsoft_Azure_Serializer" Value="thiscall" Condition="'$(CallingConvention-Microsoft_Azure_Serializer)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Serializer" />
-    </Microsoft_Azure_Serializer_Contains>
-    <Microsoft_Azure_Serializer_Contains Text="CallingConvention-clrcall" Library="Microsoft_Azure_Serializer" Value="clrcall" Condition="'$(CallingConvention-Microsoft_Azure_Serializer)'==''">
-      <Output TaskParameter="Result" PropertyName="CallingConvention-Microsoft_Azure_Serializer" />
-    </Microsoft_Azure_Serializer_Contains>
-  </Target>
-    <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild" AfterTargets="AfterBuild" />
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Win32_and_Debug" Label="Win32 and Debug" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Win32_and_Release" Label="Win32 and Release" Condition="'$(Platform.ToLower())' == 'win32' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Win64_and_Debug" Label="Win64 and Debug" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Win64_and_Release" Label="Win64 and Release" Condition="'$(Platform.ToLower())' == 'x64' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Arm_and_Debug" Label="Arm and Debug" Condition="'$(Platform.ToLower())' == 'Arm' And ( $(Configuration.ToLower().IndexOf('debug')) &gt; -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-  <Target Name="Microsoft_Azure_Serializer_redist_AfterBuild_Arm_and_Release" Label="Arm and Release" Condition="'$(Platform.ToLower())' == 'Arm' And ( $(Configuration.ToLower().IndexOf('debug')) == -1 )" AfterTargets="Microsoft_Azure_Serializer_redist_AfterBuild">
-  </Target>
-  
-</Project>

+ 0 - 8
azure/build_all/packaging/windows/Microsoft.Azure.IoTHub.Serializer_thirdpartynotice.txt

@@ -1,8 +0,0 @@
-Third Party Notices for Azure IoT SDKs project
-
-This project incorporates material from the project(s) listed below (collectively, "Third Party Code").
-Microsoft Corporation is not the original author of the Third Party Code.
-The original copyright notice and license, under which Microsoft Corporation received such Third Party Code, 
-are set out below.  This Third Party Code is licensed to you under their original license terms set forth below.  
-Microsoft Corporation reserves all other rights not expressly granted, whether by implication, estoppel or otherwise.  
-

+ 0 - 92
azure/build_all/packaging/windows/rebuild_nugets.cmd

@@ -1,92 +0,0 @@
-@REM Copyright (c) Microsoft. All rights reserved.
-@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-@setlocal EnableExtensions EnableDelayedExpansion
-@echo off
-
-rem - Specify the Azure SDK client build root
-set current-path=%~dp0
-set current-path=%current-path:~0,-1%
-set build-root=%current-path%\..\..\..
-for %%i in ("%build-root%") do set build-root=%%~fi
-echo Build root is %build-root%
-
-pushd %build-root%\build_all\packaging\windows\
-
-where /q nuget.exe
-if not !errorlevel! == 0 (
-@Echo Azure IoT SDK needs to download nuget.exe from https://www.nuget.org/nuget.exe 
-@Echo https://www.nuget.org 
-choice /C yn /M "Do you want to download and run nuget.exe?" 
-if not !errorlevel!==1 goto :eof
-rem if nuget.exe is not found, then ask user
-Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
-	if not exist .\nuget.exe (
-		echo nuget does not exist
-		exit /b 1
-	)
-)
-
-set build-path=%build-root%\cmake
-
-echo Build path is %build-path%
-
-if exist %build-path%\iot_sdk_output (
-	rmdir /s/q %build-path%\iot_sdk_output
-	rem no error checking
-)
-
-echo Deleting any existing .nupkg files...
-if exist *.nupkg (
-	del *.nupkg
-)
-
-rem -- Copy all Win32 files from cmake build directory to the repo directory
-xcopy /q /y /R %build-path%\iotsdk_win32\iothub_client\Debug\*.* %build-path%\iot_sdk_output\c\win32\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_win32\serializer\Debug\*.* %build-path%\iot_sdk_output\c\win32\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_win32\iothub_client\Release\*.* %build-path%\iot_sdk_output\c\win32\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_win32\serializer\Release\*.* %build-path%\iot_sdk_output\c\win32\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-rem -- Copy all x64 files from cmake build directory to the repo directory
-xcopy /q /y /R %build-path%\iotsdk_x64\iothub_client\Debug\*.* %build-path%\iot_sdk_output\c\x64\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_x64\serializer\Debug\*.* %build-path%\iot_sdk_output\c\x64\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_x64\iothub_client\Release\*.* %build-path%\iot_sdk_output\c\x64\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_x64\serializer\Release\*.* %build-path%\iot_sdk_output\c\x64\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-rem -- Copy all arm files from cmake build directory to the repo directory
-xcopy /q /y /R %build-path%\iotsdk_arm\iothub_client\Debug\*.* %build-path%\iot_sdk_output\c\arm\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_arm\serializer\Debug\*.* %build-path%\iot_sdk_output\c\arm\debug\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_arm\iothub_client\Release\*.* %build-path%\iot_sdk_output\c\arm\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-xcopy /q /y /R %build-path%\iotsdk_arm\serializer\Release\*.* %build-path%\iot_sdk_output\c\arm\release\*.*
-if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-rem -- Package Nuget
-nuget pack Microsoft.Azure.IoTHub.HttpTransport.nuspec
-nuget pack Microsoft.Azure.IoTHub.AmqpTransport.nuspec
-nuget pack Microsoft.Azure.IoTHub.IoTHubClient.nuspec
-nuget pack Microsoft.Azure.IoTHub.MqttTransport.nuspec
-nuget pack Microsoft.Azure.IoTHub.Serializer.nuspec
-
-rmdir %build-path%\iot_sdk_output /S /Q
-
-popd

+ 0 - 59
azure/build_all/tirtos/Makefile

@@ -1,59 +0,0 @@
-#
-# ==== Makefile ====
-#
-
-#
-# ==== Standard Variables ====
-#
-
-include ./products.mak
-
-#
-# Set XDCOPTIONS.  Use -v for a verbose build.
-#
-#XDCOPTIONS=v
-export XDCOPTIONS
-
-# Set XDCARGS to some of the variables above.  XDCARGS are passed
-# to the XDC build engine... which will load ns.bld... which will
-# extract these variables and use them to determine what to build and which
-# toolchains to use.
-#
-# Note that not all of these variables need to be set to something valid.
-# Unfortunately, since these vars are unconditionally assigned, your build line
-# will be longer and more noisy than necessary (e.g., it will include C66
-# assignment even if you're just building for C64P).
-#
-# Some background is here:
-#     http://rtsc.eclipse.org/docs-tip/Command_-_xdc#Environment_Variables
-#
-XDCARGS= \
-    CC3200SDK=$(CC3200SDK_INSTALLATION_DIR) \
-    BIOS=$(BIOS_INSTALLATION_DIR) \
-    ti.targets.arm.elf.M4=\"$(ti.targets.arm.elf.M4)\"
-
-# Set XDCPATH to contain necessary repositories.
-XDCPATH = $(NS_INSTALLATION_DIR)/packages;$(BIOS_INSTALLATION_DIR)/packages;$(TIRTOS_INSTALLATION_DIR)/packages;$(WOLFSSL_INSTALLATION_DIR)/tirtos/packages;$(NDK_INSTALLATION_DIR)/packages;$(CC3200SDK_INSTALLATION_DIR)/simplelink_extlib/provisioninglib
-export XDCPATH
-
-#
-# Set XDC executable command
-# Note that XDCBUILDCFG points to the ns.bld file which uses
-# the arguments specified by XDCARGS
-#
-XDC = $(XDCTOOLS_INSTALLATION_DIR)/xdc XDCARGS="$(XDCARGS)" XDCBUILDCFG=./azureiot.bld
-XS = $(XDCTOOLS_INSTALLATION_DIR)/xs
-
-######################################################
-## Shouldnt have to modify anything below this line ##
-######################################################
-
-all:
-	@echo building packages...
-	@$(XDC) -Pr ../../c-utility
-	@$(XDC) -Pr ../../
-
-clean:
-	@echo cleaning packages ...
-	@$(XDC) clean -Pr ../../c-utility
-	@$(XDC) clean -Pr ../../

+ 0 - 133
azure/build_all/tirtos/azureiot.bld

@@ -1,133 +0,0 @@
-/*
- * Generally there is no need to edit this file!
- *
- * This file controls which libraries are built, as well as compiler options
- * to use.
- */
-
-/*
- *  ======== azureiot.bld ========
- *  This script is run prior to all build scripts. It sets host-system-
- *  independent values for targets and platforms, then it attempts to
- *  find the host-system-specific user.bld script that sets rootDirs.
- *
- *  These settings may be a function of the following global variables:
- *
- *      environment a hash table of environment strings
- *
- *      arguments   an array of string arguments to the script
- *                  initialized as follows:
- *                      arguments[0] - the file name of the script
- *                      arguments[1] - the first argument specified in XDCARGS
- *                          :
- *                      arguments[n] - the n'th argument in XDCARGS
- *
- *      Build       an alias for xdc.om.xdc.bld.BuildEnvironment
- */
-
-var Build = xdc.useModule('xdc.bld.BuildEnvironment');
-var Pkg = xdc.useModule('xdc.bld.PackageContents');
-
-/*
- * Linux86 => -std=c99 for (at least sscanf() and strtof())
- */
-var ccOpts = {
-    "ti.targets.arm.elf.M4"           : " -ms -g --c99 -DTI_RTOS",
-};
-
-var lnkOpts = {
-};
-
-var platforms = {
-    "ti.targets.arm.elf.M4"           : "ti.platforms.simplelink:CC3200",
-};
-
-var platform = "";
-
-/* initialize local vars with those set in products.mak (via XDCARGS) */
-for (arg = 0; arg < arguments.length; arg++) {
-    /* split each arg into its '+' separated parts */
-    var configParts = arguments[arg].split(";");
-
-    if (ccOpts[configParts[0].split("=")[0]] === undefined) {
-        continue;
-    }
-
-    /*
-     * Get the compiler's installation directory.
-     * For "ti.targets.elf.C674=/vendors/c6x/7.2.0", we get "/vendors/c6x/7.2.0"
-     */
-    var targetName = configParts[0].split("=")[0];
-    var rootDir = configParts[0].split("=")[1];
-
-    /* only build for the specified compilers */
-    if (rootDir == "" || rootDir == undefined) {
-        continue;
-    }
-
-    var target = xdc.useModule(targetName);
-    target.rootDir = rootDir;
-
-    if (ccOpts[targetName] != undefined) {
-        target.ccOpts.suffix += ccOpts[targetName];
-    }
-
-    if (lnkOpts[targetName] != undefined) {
-        target.lnkOpts.suffix += lnkOpts[targetName];
-    }
-
-    if (platforms[targetName] != undefined) {
-        target.platform = platforms[targetName];
-    }
-
-    /* for all the other parts, assign target.<left> = <right> */
-    for (var i = 1; i < configParts.length; i++) {
-        var modCfgParam = configParts[i].split("=")[0];
-        var modCfgValue =
-                configParts[i].substring(configParts[i].indexOf("=") + 1);
-        var modCfgIndex = modCfgParam.split(".");
-        var element = target;
-
-        for (j = 0; j < (modCfgIndex.length -1); j++) {
-                element = element[modCfgIndex[j]];
-        }
-        element[modCfgIndex[j]] = modCfgValue;
-    }
-
-    /* and finally add this target to the Build.targets array */
-    Build.targets.$add(target);
-}
-
-/* lib/ is a generated directory that 'xdc clean' should remove */
-Pkg.generatedFiles.$add("lib/");
-
-/*
- * Some packages build for 'all profiles' - but that's too much to ship.
- * Loop over all profiles in all Build.targets and remove everything
- * except 'release' and 'debug'.
- */
-for (var t = 0; t < Build.targets.length; t++) {
-    if (Build.targets[t].$name.match(/^iar/)) {
-        continue;
-    }
-
-    for (prof in Build.targets[t].profiles) {
-        if ((prof != 'release') && (prof != 'debug')) {
-            delete Build.targets[t].profiles[prof];
-        }
-    }
-}
-
-/* add notrace profile to all targets */
-var notrace_defs = " -Dxdc_runtime_Log_DISABLE_ALL " +
-        "-Dxdc_runtime_Assert_DISABLE_ALL ";
-
-/* All libraries add a new notrace profile */
-for (var t = 0; t < Build.targets.length; t++) {
-    var targ = Build.targets[t];
-
-    targ.profiles["notrace"] = targ.profiles["release"].$copy();
-    var defs = targ.profiles["notrace"].compileOpts.defs;
-    targ.profiles["notrace"].compileOpts.defs =
-        (defs == undefined ? notrace_defs : defs + notrace_defs);
-}

+ 0 - 23
azure/build_all/tirtos/products.mak

@@ -1,23 +0,0 @@
-#
-#  ======== products.mak ========
-#
-
-##################### All platforms ####################
-
-XDCTOOLS_INSTALLATION_DIR ?= c:\\ti\\xdctools_3_31_01_33_core
-
-##################### TI-RTOS ####################
-
-TIRTOS_INSTALLATION_DIR ?= c:\\ti/tirtos_simplelink_2_14_01_20
-BIOS_INSTALLATION_DIR   ?= $(TIRTOS_INSTALLATION_DIR)/products/bios_6_42_02_29
-UIA_INSTALLATION_DIR    ?= $(TIRTOS_INSTALLATION_DIR)/products/uia_2_00_02_39
-NS_INSTALLATION_DIR     ?= c:\\ti/ns_1_10_00_00_eng
-
-##################### TI-RTOS (CC3200) ####################
-
-CC3200SDK_VERSION = 1.1.0
-CCWARE_INSTALLATION_DIR    ?= $(TIRTOS_INSTALLATION_DIR)/products/CC3200_driverlib_1.1.0
-CC3200SDK_INSTALLATION_DIR ?= c:\\ti/CC3200SDK_1.1.0/cc3200-sdk
-
-# Leave assignment empty to disable this toolchain
-ti.targets.arm.elf.M4  ?= c:\\ti/ti-cgt-arm_5.2.5

+ 0 - 47
azure/build_all/tizenRT/Make.defs

@@ -1,47 +0,0 @@
--include $(TOPDIR)/.config
--include $(TOPDIR)/Make.defs
-
-AZURE_CLIENT_DIR = $(AZURE_DIR)/iothub_client
-AZURE_SERIAL_DIR = $(AZURE_DIR)/serializer
-AZURE_UTIL_DIR = $(AZURE_DIR)/c-utility
-
-CSRCS += $(AZURE_DIR)/certs/certs.c
-CSRCS += $(AZURE_DIR)/deps/parson/parson.c
-
-CSRCS += $(AZURE_CLIENT_DIR)/src/blob.c	$(AZURE_CLIENT_DIR)/src/iothub_client.c	\
-$(AZURE_CLIENT_DIR)/src/iothub_message.c $(AZURE_CLIENT_DIR)/src/iothubtransport.c \
-$(AZURE_CLIENT_DIR)/src/iothub_client_ll.c $(AZURE_CLIENT_DIR)/src/iothubtransporthttp.c	\
-$(AZURE_CLIENT_DIR)/src/version.c $(AZURE_CLIENT_DIR)/src/iothub_client_ll_uploadtoblob.c
-
-CSRCS += $(AZURE_UTIL_DIR)/src/base64.c $(AZURE_UTIL_DIR)/src/buffer.c  \
-$(AZURE_UTIL_DIR)/src/connection_string_parser.c $(AZURE_UTIL_DIR)/src/consolelogger.c  \
-$(AZURE_UTIL_DIR)/src/constbuffer.c $(AZURE_UTIL_DIR)/src/constmap.c	\
-$(AZURE_UTIL_DIR)/src/crt_abstractions.c $(AZURE_UTIL_DIR)/src/doublylinkedlist.c	\
-$(AZURE_UTIL_DIR)/src/gballoc.c $(AZURE_UTIL_DIR)/src/gb_stdio.c        \
-$(AZURE_UTIL_DIR)/src/gb_time.c	$(AZURE_UTIL_DIR)/src/hmac.c  \
-$(AZURE_UTIL_DIR)/src/hmacsha256.c $(AZURE_UTIL_DIR)/src/httpapiex.c     \
-$(AZURE_UTIL_DIR)/src/httpapiexsas.c $(AZURE_UTIL_DIR)/src/httpheaders.c	\
-$(AZURE_UTIL_DIR)/src/map.c $(AZURE_UTIL_DIR)/src/optionhandler.c  \
-$(AZURE_UTIL_DIR)/src/sastoken.c $(AZURE_UTIL_DIR)/src/sha1.c	\
-$(AZURE_UTIL_DIR)/src/sha224.c $(AZURE_UTIL_DIR)/src/sha384-512.c    \
-$(AZURE_UTIL_DIR)/src/singlylinkedlist.c $(AZURE_UTIL_DIR)/src/strings.c	\
-$(AZURE_UTIL_DIR)/src/string_tokenizer.c $(AZURE_UTIL_DIR)/src/urlencode.c   \
-$(AZURE_UTIL_DIR)/src/usha.c $(AZURE_UTIL_DIR)/src/vector.c $(AZURE_UTIL_DIR)/src/xlogging.c	\
-$(AZURE_UTIL_DIR)/src/xio.c
-
-CSRCS += $(AZURE_UTIL_DIR)/adapters/agenttime.c	$(AZURE_UTIL_DIR)/adapters/condition_pthreads.c  \
-$(AZURE_UTIL_DIR)/adapters/threadapi_pthreads.c $(AZURE_UTIL_DIR)/adapters/lock_pthreads.c  \
-$(AZURE_UTIL_DIR)/adapters/platform_tizenrt.c $(AZURE_UTIL_DIR)/adapters/uniqueid_linux.c	\
-$(AZURE_UTIL_DIR)/adapters/socketio_berkeley.c $(AZURE_UTIL_DIR)/adapters/tlsio_mbedtls.c	\
-$(AZURE_UTIL_DIR)/adapters/tickcounter_linux.c $(AZURE_UTIL_DIR)/adapters/httpapi_compact.c
-
-CSRCS += $(wildcard $(AZURE_SERIAL_DIR)/src/*.c)
-
-ifeq ($(CONFIG_CLOUD_AZURE_SAMPLES),y)
-CSRCS += $(AZURE_CLIENT_DIR)/samples/iothub_ll_telemetry_sample/iothub_ll_telemetry_sample.c
-CSRCS += $(AZURE_SERIAL_DIR)/samples/simplesample_http/simplesample_http.c
-endif
-
-CFLAGS += -I$(AZURE_DIR)/c-utility/inc -I$(AZURE_DIR)/serializer/inc	\
-	  -I$(AZURE_DIR)/iothub_client/inc -I$(AZURE_DIR)/deps/parson -I$(AZURE_DIR)/certs
-CFLAGS += -DWITH_POSIX -DTIZENRT -DMBED_BUILD_TIMESTAMP -DUSE_MBED_TLS -std=c99 -w

+ 0 - 39
azure/build_all/tizenRT/Makefile

@@ -1,39 +0,0 @@
--include $(TOPDIR)/Make.defs
-
-DEPPATH = --dep-path .
-VPATH = .
-CSRCS =
-
-AZURE_DIR = ${shell pwd}/../..
-
-include Make.defs
-
-COBJS = $(CSRCS:.c=$(OBJEXT))
-
-OBJS = $(COBJS)
-
-BIN = libazure$(LIBEXT)
-
-all:	$(BIN)
-
-$(COBJS): %$(OBJEXT): %.c
-	$(call COMPILE, $<, $@)
-
-$(BIN): $(OBJS)
-	$(call ARCHIVE, $@, $(OBJS))
-
-.depend: Makefile $(SRCS)
-	$(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
-	$(Q) touch $@
-
-depend: .depend
-
-clean:
-	$(call DELFILE, $(BIN))
-	$(call CLEAN, $(AZURE_DIR))
-
-distclean: clean
-	$(call DELFILE, Make.dep)
-	$(call DELFILE, .depend)
-
--include Make.dep

+ 0 - 15
azure/build_all/windows/NuGet.Config

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <packageSources>
-    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
-    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
-	<add key="Local NuGet package source" value="..\..\..\..\LocalNuget" />
-  </packageSources>
-  <packageRestore>
-    <add key="enabled" value="True" />
-    <add key="automatic" value="True" />
-  </packageRestore>
-  <activePackageSource>
-    <add key="All" value="(Aggregate source)" />
-  </activePackageSource>
-</configuration>

+ 0 - 372
azure/build_all/windows/build.cmd

@@ -1,372 +0,0 @@
-@REM Copyright (c) Microsoft. All rights reserved.
-@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-@setlocal EnableExtensions EnableDelayedExpansion
-@echo off
-
-set current-path=%~dp0
-rem // remove trailing slash
-set current-path=%current-path:~0,-1%
-
-set build-root=%current-path%\..\..
-rem // resolve to fully qualified path
-for %%i in ("%build-root%") do set build-root=%%~fi
-
-set repo_root=%build-root%\..\..
-rem // resolve to fully qualified path
-for %%i in ("%repo_root%") do set repo_root=%%~fi
-
-echo Build Root: %build-root%
-echo Repo Root: %repo_root%
-
-set cmake-root=%build-root%
-rem -----------------------------------------------------------------------------
-rem -- check prerequisites
-rem -----------------------------------------------------------------------------
-
-rem -----------------------------------------------------------------------------
-rem -- parse script arguments
-rem -----------------------------------------------------------------------------
-
-rem // default build options
-set build-clean=0
-set build-config=Debug
-set build-platform=Win32
-set CMAKE_run_e2e_tests=OFF
-set CMAKE_run_sfc_tests=OFF
-set CMAKE_run_longhaul_tests=OFF
-set CMAKE_run_unittests=OFF
-set MAKE_NUGET_PKG=no
-set CMAKE_DIR=iotsdk_win32
-set build-samples=yes
-set make=yes
-set build_traceabilitytool=0
-set prov_auth=OFF
-set use_edge_modules=OFF
-
-:args-loop
-if "%1" equ "" goto args-done
-if "%1" equ "-c" goto arg-build-clean
-if "%1" equ "--clean" goto arg-build-clean
-if "%1" equ "--config" goto arg-build-config
-if "%1" equ "--platform" goto arg-build-platform
-if "%1" equ "--run-e2e-tests" goto arg-run-e2e-tests
-if "%1" equ "--run-sfc-tests" goto arg-run-sfc-tests
-if "%1" equ "--run-longhaul-tests" goto arg-longhaul-tests
-if "%1" equ "--run-unittests" goto arg-run-unittests
-if "%1" equ "--make_nuget" goto arg-build-nuget
-if "%1" equ "--cmake-root" goto arg-cmake-root
-if "%1" equ "--no-make" goto arg-no-make
-if "%1" equ "--build-traceabilitytool" goto arg-build-traceabilitytool
-if "%1" equ "--provisioning" goto arg-provisioning
-if "%1" equ "--use-edge-modules" goto arg-edge-modules
-call :usage && exit /b 1
-
-:arg-build-clean
-set build-clean=1
-goto args-continue
-
-:arg-build-config
-shift
-if "%1" equ "" call :usage && exit /b 1
-set build-config=%1
-goto args-continue
-
-:arg-build-platform
-shift
-if "%1" equ "" call :usage && exit /b 1
-set build-platform=%1
-if %build-platform% == x64 (
-    set CMAKE_DIR=iotsdk_x64
-) else if %build-platform% == arm (
-    set CMAKE_DIR=iotsdk_arm
-)
-goto args-continue
-
-:arg-run-e2e-tests
-set CMAKE_run_e2e_tests=ON
-goto args-continue
-
-:arg-run-sfc-tests
-set CMAKE_run_sfc_tests=ON
-goto args-continue
-
-:arg-longhaul-tests
-set CMAKE_run_longhaul_tests=ON
-goto args-continue
-
-:arg-run-unittests
-set CMAKE_run_unittests=ON
-goto args-continue
-
-:arg-build-nuget
-shift
-if "%1" equ "" call :usage && exit /b 1
-set MAKE_NUGET_PKG=%1
-set build-samples=no
-goto args-continue
-
-:arg-cmake-root
-shift
-if "%1" equ "" call :usage && exit /b 1
-set cmake-root=%1
-goto args-continue
-
-:arg-no-make
-set make=no
-goto args-continue
-
-:arg-build-traceabilitytool
-set build_traceabilitytool=1
-goto args-continue
-
-:arg-provisioning
-set prov_auth=ON
-goto args-continue
-
-:arg-edge-modules
-set use_edge_modules=ON
-goto args-continue
-
-:args-continue
-shift
-goto args-loop
-
-:args-done
-
-if %make% == no (
-    rem No point running tests if we are not building the code
-    set CMAKE_run_e2e_tests=OFF
-    set CMAKE_run_sfc_tests=OFF
-    set CMAKE_run_longhaul_tests=OFF
-    set build-samples=no
-)
-
-rem -----------------------------------------------------------------------------
-rem -- restore packages for solutions
-rem -----------------------------------------------------------------------------
-
-if %build-samples%==yes (
-    where /q nuget.exe
-    if not !errorlevel! == 0 (
-    @Echo Azure IoT SDK needs to download nuget.exe from https://www.nuget.org/nuget.exe 
-    @Echo https://www.nuget.org 
-    choice /C yn /M "Do you want to download and run nuget.exe?" 
-    if not !errorlevel!==1 goto :eof
-    rem if nuget.exe is not found, then ask user
-    Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
-        if not exist .\nuget.exe (
-            echo nuget does not exist
-            exit /b 1
-        )
-    )
-
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\iothub_client\samples\iothub_ll_telemetry_sample\windows\iothub_ll_telemetry_sample.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\serializer\samples\simplesample_http\windows\simplesample_http.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\serializer\samples\simplesample_amqp\windows\simplesample_amqp.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\serializer\samples\simplesample_mqtt\windows\simplesample_mqtt.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\serializer\samples\remote_monitoring\windows\remote_monitoring.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-    call nuget restore -config "%current-path%\NuGet.Config" "%build-root%\serializer\samples\temp_sensor_anomaly\windows\temp_sensor_anomaly.sln"
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-)
-
-rem -----------------------------------------------------------------------------
-rem -- clean solutions
-rem -----------------------------------------------------------------------------
-
-if %build-clean%==1 (
-    if %build-samples%==yes (
-        call nuget restore "%build-root%\iothub_client\samples\iothub_ll_telemetry_sample\windows\iothub_ll_telemetry_sample.sln"
-        call :clean-a-solution "%build-root%\iothub_client\samples\iothub_ll_telemetry_sample\windows\iothub_ll_telemetry_sample.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        
-        call :clean-a-solution "%build-root%\serializer\samples\simplesample_http\windows\simplesample_http.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        
-        call :clean-a-solution "%build-root%\serializer\samples\simplesample_amqp\windows\simplesample_amqp.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        
-        call :clean-a-solution "%build-root%\serializer\samples\simplesample_mqtt\windows\simplesample_mqtt.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        
-        call :clean-a-solution "%build-root%\serializer\samples\remote_monitoring\windows\remote_monitoring.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        
-        call :clean-a-solution "%build-root%\serializer\samples\temp_sensor_anomaly\windows\temp_sensor_anomaly.sln"
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-    )
-)
-
-rem -----------------------------------------------------------------------------
-rem -- build solutions
-rem -----------------------------------------------------------------------------
-
-if %build-samples%==yes (
-    rem call :build-a-solution "%build-root%\iothub_client\samples\iothub_ll_telemetry_sample\windows\iothub_ll_telemetry_sample.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-    rem call :build-a-solution "%build-root%\serializer\samples\simplesample_amqp\windows\simplesample_amqp.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-    rem call :build-a-solution "%build-root%\serializer\samples\simplesample_http\windows\simplesample_http.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-    rem call :build-a-solution "%build-root%\serializer\samples\simplesample_mqtt\windows\simplesample_mqtt.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-    rem call :build-a-solution "%build-root%\serializer\samples\remote_monitoring\windows\remote_monitoring.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-    rem call :build-a-solution "%build-root%\serializer\samples\temp_sensor_anomaly\windows\temp_sensor_anomaly.sln"
-    rem if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-)
-
-rem -----------------------------------------------------------------------------
-rem -- build with CMAKE and run tests
-rem -----------------------------------------------------------------------------
-
-if EXIST %cmake-root%\cmake\%CMAKE_DIR% (
-    rmdir /s/q %cmake-root%\cmake\%CMAKE_DIR%
-    rem no error checking
-)
-
-echo CMAKE Output Path: %cmake-root%\cmake\%CMAKE_DIR%
-mkdir %cmake-root%\cmake\%CMAKE_DIR%
-rem no error checking
-pushd %cmake-root%\cmake\%CMAKE_DIR%
-
-if %MAKE_NUGET_PKG% == yes (
-    echo ***Running CMAKE for Win32***
-    cmake %build-root% -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% -Duse_prov_client:BOOL=%prov_auth% -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-    popd
-
-    echo ***Running CMAKE for Win64***
-    if EXIST %cmake-root%\cmake\iotsdk_x64 (
-        rmdir /s/q %cmake-root%\cmake\iotsdk_x64
-    )
-    mkdir %cmake-root%\cmake\iotsdk_x64
-    rem no error checking
-
-    pushd %cmake-root%\cmake\iotsdk_x64
-    cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 Win64" -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-    popd
-
-    echo ***Running CMAKE for ARM***
-    if EXIST %cmake-root%\cmake\iotsdk_arm (
-        rmdir /s/q %cmake-root%\cmake\iotsdk_arm
-    )
-    mkdir %cmake-root%\cmake\iotsdk_arm
-    rem no error checking
-
-    pushd %cmake-root%\cmake\iotsdk_arm
-    cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 ARM" -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-) else if %build-platform% == x64 (
-    echo ***Running CMAKE for Win64***
-    cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 Win64" -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-) else if %build-platform% == arm (
-    echo ***Running CMAKE for ARM***
-    cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 ARM"  -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-) else (
-    echo ***Running CMAKE for Win32***
-    cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_sfc_tests:BOOL=%CMAKE_run_sfc_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -Duse_edge_modules=%use_edge_modules%
-    if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-)
-
-if %MAKE_NUGET_PKG% == yes (
-    if %make%==yes (
-        echo ***Building all configurations***
-        msbuild /m %cmake-root%\cmake\iotsdk_win32\azure_iot_sdks.sln /p:Configuration=Release
-        if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-        msbuild /m %cmake-root%\cmake\iotsdk_win32\azure_iot_sdks.sln /p:Configuration=Debug
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-        msbuild /m %cmake-root%\cmake\iotsdk_x64\azure_iot_sdks.sln /p:Configuration=Release
-        if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-        msbuild /m %cmake-root%\cmake\iotsdk_x64\azure_iot_sdks.sln /p:Configuration=Debug
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-
-        msbuild /m %cmake-root%\cmake\iotsdk_arm\azure_iot_sdks.sln /p:Configuration=Release
-        if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-        msbuild /m %cmake-root%\cmake\iotsdk_arm\azure_iot_sdks.sln /p:Configuration=Debug
-        if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-    )
-) else (
-    if %make%==yes (
-        msbuild /m azure_iot_sdks.sln
-        if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-
-        if %build-platform% neq arm (
-            ctest -C "debug" -V -j 8
-            if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-        )
-    )
-)
-
-popd
-
-if %build_traceabilitytool%==1 (
-    rem invoke the traceabilitytool here instead of the second build step in Jenkins windows_c job
-    msbuild /m %build-root%\tools\traceabilitytool\traceabilitytool.sln
-    if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
-)
-
-goto :eof
-
-
-rem -----------------------------------------------------------------------------
-rem -- subroutines
-rem -----------------------------------------------------------------------------
-
-:clean-a-solution
-call :_run-msbuild "Clean" %1 %2 %3
-goto :eof
-
-
-:build-a-solution
-call :_run-msbuild "Build" %1 %2 %3
-goto :eof
-
-:usage
-echo build.cmd [options]
-echo options:
-echo  -c, --clean                   delete artifacts from previous build before building
-echo  --config ^<value^>            [Debug] build configuration (e.g. Debug, Release)
-echo  --platform ^<value^>          [Win32] build platform (e.g. Win32, x64, arm, ...)
-echo  --make_nuget ^<value^>        [no] generates the binaries to be used for nuget packaging (e.g. yes, no)
-echo  --run-e2e-tests               run end-to-end tests
-echo  --run-longhaul-tests          run long-haul tests
-echo  --cmake-root                  Directory to place the cmake files used for building the project
-echo  --no-make                     Surpress building the code
-echo  --build-traceabilitytool      Builds an internal tool (traceabilitytool) to check for requirements/code/test consistency
-echo  --run-unittests               Run unit tests
-echo  --provisioning                Use Provisiong service
-goto :eof
-
-
-rem -----------------------------------------------------------------------------
-rem -- helper subroutines
-rem -----------------------------------------------------------------------------
-
-:_run-msbuild
-rem // optionally override configuration|platform
-setlocal EnableExtensions
-set build-target=
-if "%~1" neq "Build" set "build-target=/t:%~1"
-if "%~3" neq "" set build-config=%~3
-if "%~4" neq "" set build-platform=%~4
-
-msbuild /m %build-target% "/p:Configuration=%build-config%;Platform=%build-platform%" %2
-if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-goto :eof

+ 0 - 150
azure/build_all/windows/build_client.cmd

@@ -1,150 +0,0 @@
-@REM Copyright (c) Microsoft. All rights reserved.
-@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-@setlocal EnableExtensions EnableDelayedExpansion
-@echo off
-
-set current-path=%~dp0
-rem // remove trailing slash
-set current-path=%current-path:~0,-1%
-
-set build-root=%current-path%\..\..
-rem // resolve to fully qualified path
-for %%i in ("%build-root%") do set build-root=%%~fi
-
-rem -----------------------------------------------------------------------------
-rem -- check prerequisites
-rem -----------------------------------------------------------------------------
-
-rem -----------------------------------------------------------------------------
-rem -- parse script arguments
-rem -----------------------------------------------------------------------------
-
-rem // default build options
-set build-clean=0
-set build-config=
-set build-platform=Win32
-set CMAKE_build_python=OFF
-set CMAKE_build_javawrapper=OFF
-set CMAKE_no_logging=OFF
-set CMAKE_run_unittests=OFF
-set prov_auth=OFF
-set prov_use_tpm_simulator=OFF
-set use_edge_modules=OFF
-
-:args-loop
-if "%1" equ "" goto args-done
-if "%1" equ "--config" goto arg-build-config
-if "%1" equ "--platform" goto arg-build-platform
-if "%1" equ "--buildpython" goto arg-build-python
-if "%1" equ "--build-javawrapper" goto arg-build-javawrapper
-if "%1" equ "--no-logging" goto arg-no-logging
-if "%1" equ "--run-unittests" goto arg-run-unittests
-if "%1" equ "--provisioning" goto arg-provisioning
-if "%1" equ "--use-tpm-simulator" goto arg-tpm-simulator
-if "%1" equ "--use_edge_modules" goto arg-edge-modules
-call :usage && exit /b 1
-
-:arg-build-config
-shift
-if "%1" equ "" call :usage && exit /b 1
-set build-config=%1
-goto args-continue
-
-:arg-build-platform
-shift
-if "%1" equ "" call :usage && exit /b 1
-set build-platform=%1
-goto args-continue
-
-:arg-build-python
-set CMAKE_build_python=2.7
-if "%2"=="" goto args-continue
-set PyVer=%2
-if "%PyVer:~0,2%"=="--" goto args-continue
-set CMAKE_build_python=%PyVer%
-shift
-goto args-continue
-
-:arg-build-javawrapper
-set CMAKE_build_javawrapper=ON 
-goto args-continue
-
-:arg-no-logging
-set CMAKE_no_logging=ON 
-goto args-continue
-
-:arg-run-unittests
-set CMAKE_run_unittests=ON
-goto args-continue
-
-:arg-provisioning
-set prov_auth=ON
-goto args-continue
-
-:arg-tpm-simulator
-set prov_use_tpm_simulator=ON
-goto args-continue
-
-:arg-edge-modules
-set use_edge_modules=ON
-goto args-continue
-
-:args-continue
-shift
-goto args-loop
-
-:args-done
-set cmake-output=cmake_%build-platform%
-
-rem -----------------------------------------------------------------------------
-rem -- build with CMAKE
-rem -----------------------------------------------------------------------------
-
-echo CMAKE Output Path: %USERPROFILE%\%cmake-output%
-
-rmdir /s/q %USERPROFILE%\%cmake-output%
-rem no error checking
-
-mkdir %USERPROFILE%\%cmake-output%
-rem no error checking
-
-pushd %USERPROFILE%\%cmake-output%
-
-if %build-platform% == Win32 (
-	echo ***Running CMAKE for Win32***
-	cmake %build-root% -Drun_unittests:BOOL=%CMAKE_run_unittests% -Dbuild_python:STRING=%CMAKE_build_python% -Dbuild_javawrapper:BOOL=%CMAKE_build_javawrapper% -Dno_logging:BOOL=%CMAKE_no_logging% -Duse_prov_client:BOOL=%prov_auth% -Duse_tpm_simulator:BOOL=%prov_use_tpm_simulator% -Duse_edge_modules=%use_edge_modules%
-	if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-) else (
-	echo ***Running CMAKE for Win64***
-	cmake %build-root% -G "Visual Studio 14 Win64" -Drun_unittests:BOOL=%CMAKE_run_unittests% -Dbuild_python:STRING=%CMAKE_build_python% -Dbuild_javawrapper:BOOL=%CMAKE_build_javawrapper% -Dno_logging:BOOL=%CMAKE_no_logging% -Duse_prov_client:BOOL=%prov_auth% -Duse_tpm_simulator:BOOL=%prov_use_tpm_simulator%  -Duse_edge_modules=%use_edge_modules%
-	if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-)
-
-if not defined build-config (
-	echo ***Building both configurations***
-	msbuild /m azure_iot_sdks.sln /p:Configuration=Release
-	if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-	msbuild /m azure_iot_sdks.sln /p:Configuration=Debug
-	if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-) else (
-	echo ***Building %build-config% only***
-	msbuild /m azure_iot_sdks.sln /p:Configuration=%build-config%
-	if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
-)
-
-popd
-goto :eof
-
-
-:usage
-echo build_client.cmd [options]
-echo options:
-echo  --config ^<value^>         [Debug] build configuration (e.g. Debug, Release)
-echo  --platform ^<value^>       [Win32] build platform (e.g. Win32, x64, ...)
-echo  --buildpython ^<value^>    [2.7]   build python extension (e.g. 2.7, 3.4, ...)
-echo  --no-logging               Disable logging
-echo  --run-unittests            Run unittests
-echo  --provisioning             Use Provisiong service
-echo  --use-tpm-simulator        Build TPM simulator
-goto :eof

+ 0 - 54
azure/build_all/windowsce/build.cmd

@@ -1,54 +0,0 @@
-@REM Copyright (c) Microsoft. All rights reserved.
-@REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-@setlocal EnableExtensions EnableDelayedExpansion
-echo off
-
-set current-path=%~dp0
-rem // remove trailing slash
-set current-path=%current-path:~0,-1%
-
-set build-root=%current-path%\..\..
-rem // resolve to fully qualified path
-for %%i in ("%build-root%") do set build-root=%%~fi
-
-rem -----------------------------------------------------------------------------
-rem -- check prerequisites
-rem -----------------------------------------------------------------------------
-
-rem // check that SDK is installed
-
-rem -----------------------------------------------------------------------------
-rem -- parse script arguments
-rem -----------------------------------------------------------------------------
-
-rem // default build options
-set build-clean=0
-set build-config=Debug
-set build-platform=WindowsCE
-set CMAKE_run_e2e_tests=OFF
-set CMAKE_run_longhaul_tests=OFF
-
-rem -----------------------------------------------------------------------------
-rem -- build solution with CMake
-rem -----------------------------------------------------------------------------
-
-rmdir /s/q "%USERPROFILE%\cmake_ce8"
-rem no error checking
-
-mkdir "%USERPROFILE%\cmake_ce8"
-rem no error checking
-
-pushd "%USERPROFILE%\cmake_ce8"
-
-rem if you plan to use a different SDK you need to change SDKNAME to the name of your SDK. Ensure that this is also changed in the sample solutions iothub_ll_telemetry_sample, simplesample_http and remote_monitoring
-set SDKNAME=TORADEX_CE800
-set PROCESSOR=arm
-
-cmake -DWINCE=TRUE -DCMAKE_SYSTEM_NAME=WindowsCE -DCMAKE_SYSTEM_VERSION=8.0 -DCMAKE_SYSTEM_PROCESSOR=%PROCESSOR% -DCMAKE_GENERATOR_TOOLSET=CE800 -DCMAKE_GENERATOR_PLATFORM=%SDKNAME% -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Duse_amqp=FALSE -Duse_mqtt=FALSE %build-root%
-
-if not %errorlevel%==0 exit /b %errorlevel%
-
-rem Currently, only building of HTTP sample is supported
-rem msbuild "%USERPROFILE%\cmake_ce8\iothub_client\samples\iothub_ll_telemetry_sample\iothub_ll_telemetry_sample.vcxproj
-rem if not %errorlevel%==0 exit /b %errorlevel%

+ 0 - 27
azure/c-utility/.gitattributes

@@ -1,27 +0,0 @@
-# Default behavior: if Git thinks a file is text (as opposed to binary), it
-# will normalize line endings to LF in the repository, but convert to your
-# platform's native line endings on checkout (e.g., CRLF for Windows).
-* text=auto
-
-# Explicitly declare text files you want to always be normalized and converted
-# to native line endings on checkout. E.g.,
-#*.c text
-
-# Declare files that will always have CRLF line endings on checkout. E.g.,
-#*.sln text eol=crlf
-
-# Declare files that will always have LF line endings on checkout. E.g.,
-*.sh text eol=lf
-*.json text eol=lf
-
-# Denote all files that should not have line endings normalized, should not be
-# merged, and should not show in a textual diff.
-*.docm binary
-*.docx binary
-*.ico binary
-*.lib binary
-*.png binary
-*.pptx binary
-*.snk binary
-*.vsdx binary
-*.xps binary

+ 0 - 12
azure/c-utility/.gitignore

@@ -1,12 +0,0 @@
-################################################################################
-# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
-################################################################################
-
-/build
-/build_all/windows/nuget.exe
-/cmake
-/devdoc/~$o_requirements.docm
-/.vscode
-*.jar
-*.aps
-/res

+ 0 - 590
azure/c-utility/CMakeLists.txt

@@ -1,590 +0,0 @@
-#Copyright (c) Microsoft. All rights reserved.
-#Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-if (TARGET aziotsharedutil)
-    RETURN()
-endif()
-
-project(azure_c_shared_utility)
-
-FILE(READ ${CMAKE_CURRENT_LIST_DIR}/version.txt C_SHARED_VERSION)
-
-# Include the common build rules for the C SDK
-include(configs/azure_iot_build_rules.cmake)
-
-#the following variables are project-wide and can be used with cmake-gui
-option(run_unittests "set run_unittests to ON to run unittests (default is OFF)" OFF)
-option(skip_samples "set skip_samples to ON to skip building samples (default is OFF)[if possible, they are always built]" OFF)
-option(use_http "set use_http to ON if http is to be used, set to OFF to not use http" ON)
-option(use_condition "set use_condition to ON if the condition module and its adapters should be enabled" ON)
-option(use_wsio "set use_wsio to ON to build WebSockets support (default is ON)" ON)
-option(nuget_e2e_tests "set nuget_e2e_tests to ON to generate e2e tests to run with nuget packages (default is OFF)" OFF)
-option(use_installed_dependencies "set use_installed_dependencies to ON to use installed packages instead of building dependencies from submodules" OFF)
-option(use_default_uuid "set use_default_uuid to ON to use the out of the box UUID that comes with the SDK rather than platform specific implementations" OFF)
-option(run_e2e_tests "set run_e2e_tests to ON to run e2e tests (default is OFF). Chsare dutility does not have any e2e tests, but the option needs to exist to evaluate in IF statements" OFF)
-option(use_builtin_httpapi "set use_builtin_httpapi to ON to use the built-in httpapi_compact that comes with C shared utility (default is OFF)" OFF)
-option(use_cppunittest "set use_cppunittest to ON to build CppUnitTest tests on Windows (default is ON)" ON)
-option(suppress_header_searches "do not try to find headers - used when compiler check will fail" OFF)
-option(use_custom_heap "use externally defined heap functions instead of the malloc family" OFF)
-
-if(${use_custom_heap})
-    add_definitions(-DGB_USE_CUSTOM_HEAP)
-endif()
-
-if(WIN32)
-    option(use_schannel "set use_schannel to ON if schannel is to be used, set to OFF to not use schannel" ON)
-    option(use_openssl "set use_openssl to ON if openssl is to be used, set to OFF to not use openssl" OFF)
-    option(use_wolfssl "set use_wolfssl to ON if wolfssl is to be used, set to OFF to not use wolfssl" OFF)
-    option(use_etw "set use_etw to ON if ETW logging is to be used. Default is OFF" OFF)
-    option(use_socketio "set use_socketio to ON if socketio is to be included in the library, set to OFF if a different implementation will be provided" ON)
-else()
-    option(use_schannel "set use_schannel to ON if schannel is to be used, set to OFF to not use schannel" OFF)
-    if(MACOSX)
-        option(use_openssl "set use_openssl to ON if openssl is to be used, set to OFF to not use openssl" OFF)
-        option(use_socketio "set use_socketio to ON if socketio is to be included in the library, set to OFF if a different implementation will be provided" OFF)
-    else()
-        option(use_openssl "set use_openssl to ON if openssl is to be used, set to OFF to not use openssl" ON)
-        option(use_socketio "set use_socketio to ON if socketio is to be included in the library, set to OFF if a different implementation will be provided" ON)
-    endif()    
-    option(use_wolfssl "set use_wolfssl to ON if wolfssl is to be used, set to OFF to not use wolfssl" OFF)
-endif()
-
-option(no_logging "disable logging (default is OFF)" OFF)
-
-# The options setting for use_socketio is not reliable. If openssl is used, make sure it's on,
-# and if apple tls is used then use_socketio must be off.
-if (MACOSX)
-    if (${use_openssl})
-        set(use_socketio ON)
-    else()
-        # MACOSX only has native tls and open ssl, so this must be the native apple tls
-        set(use_applessl ON)
-        set(use_socketio OFF)
-    endif()
-endif()
-
-if(${use_etw}) 
-    #create res folder
-    file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/res)
-    
-    #populate res folder with the ETW resources
-    execute_process(COMMAND  ${CMAKE_CURRENT_LIST_DIR}/src/etw_provider_generate.cmd 
-        WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/src
-    )
-endif()
-
-option(build_as_dynamic "build the C Shared libaries as shared"  OFF)
-
-if(${memory_trace})
-    add_definitions(-DGB_MEASURE_MEMORY_FOR_THIS -DGB_DEBUG_ALLOC)
-    add_definitions(-DGB_MEASURE_NETWORK_FOR_THIS -DGB_DEBUG_NETWORK)
-endif()
-
-if(${use_openssl})
-    if("${OPENSSL_ROOT_DIR}" STREQUAL "" AND NOT ("$ENV{OpenSSLDir}" STREQUAL ""))
-        set(OPENSSL_ROOT_DIR $ENV{OpenSSLDir} CACHE PATH "")
-    endif()
-
-    find_package(OpenSSL REQUIRED)
-    include_directories(${OPENSSL_INCLUDE_DIR})
-endif()
-
-if(${use_applessl})
-    # MACOSX only has native tls and open ssl, so use the native apple tls
-    find_library(cf_foundation Foundation)
-    find_library(cf_network CFNetwork)
-endif()
-
-if(${no_logging})
-    add_definitions(-DNO_LOGGING)
-endif()
-# Start of variables used during install
-set (LIB_INSTALL_DIR lib CACHE PATH "Library object file directory")
-
-#Setup the platform files
-include("${CMAKE_CURRENT_LIST_DIR}/configs/azure_c_shared_utilityFunctions.cmake")
-set_platform_files(${CMAKE_CURRENT_LIST_DIR})
-
-if(MSVC)
-    if (WINCE)
-        # WEC 2013 uses older VS compiler. Build some files as C++ files to resolve C99 related compile issues
-        SET_SOURCE_FILES_PROPERTIES(${LOGGING_C_FILE} ${XLOGGING_C_FILE} src/map.c adapters/uniqueid_win32.c src/tlsio_schannel.c src/x509_schannel.c PROPERTIES LANGUAGE CXX)
-        if (${use_httpapi_compact})
-            SET_SOURCE_FILES_PROPERTIES(adapters/httpapi_compact.c PROPERTIES LANGUAGE CXX)
-        else()
-            SET_SOURCE_FILES_PROPERTIES(adapters/httpapi_wince.c PROPERTIES LANGUAGE CXX)
-        endif()
-    ELSE()
-        if(${use_openssl})
-            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_OPENSSL")
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_OPENSSL")
-        endif()
-        if(${use_wolfssl})
-            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WOLFSSL")
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_WOLFSSL")
-        endif()
-
-    endif()
-elseif(LINUX) #LINUX OR APPLE
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wformat-security")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wformat-security")
-    if(${use_openssl})
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_OPENSSL")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_OPENSSL")
-    endif()
-    if(${use_wolfssl})
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WOLFSSL")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_WOLFSSL")
-    endif()
-    # Turn off warning that can not be fixed right now
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-missing-braces -Wno-missing-field-initializers -Wno-format-nonliteral")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable -Wno-missing-braces -Wno-missing-field-initializers -Wno-format-nonliteral")
-elseif(APPLE)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wformat-security")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat-security")
-    if(${use_openssl})
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_OPENSSL")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_OPENSSL")
-    endif()
-    if(${use_wolfssl})
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WOLFSSL")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_WOLFSSL")
-    endif()
-endif()
-
-
-include_directories(${UMOCK_C_INC_FOLDER})
-
-#these are the C source files
-set(source_c_files
-./src/base32.c
-./src/base64.c
-./src/buffer.c
-./src/connection_string_parser.c
-./src/constbuffer.c
-${LOGGING_C_FILE}
-./src/crt_abstractions.c
-./src/constmap.c
-./src/doublylinkedlist.c
-./src/gballoc.c
-./src/gbnetwork.c
-./src/gb_stdio.c
-./src/gb_time.c
-./src/gb_rand.c
-./src/hmac.c
-./src/hmacsha256.c
-./src/http_proxy_io.c
-./src/xio.c
-./src/singlylinkedlist.c
-./src/map.c
-./src/sastoken.c
-./src/sha1.c
-./src/sha224.c
-./src/sha384-512.c
-./src/strings.c
-./src/string_tokenizer.c
-./src/uuid.c
-./src/urlencode.c
-./src/usha.c
-./src/vector.c
-${XLOGGING_C_FILE}
-./src/optionhandler.c
-./adapters/agenttime.c
-${CONDITION_C_FILE}
-${LOCK_C_FILE}
-${PLATFORM_C_FILE}
-${SOCKETIO_C_FILE}
-${TICKCOUTER_C_FILE}
-${THREAD_C_FILE}
-${UNIQUEID_C_FILE}
-${ENVIRONMENT_VARIABLE_C_FILE}
-)
-
-if(UNIX) #LINUX OR APPLE
-    set(source_c_files ${source_c_files}
-        ./adapters/linux_time.c
-    )
-endif()
-
-if(${use_http})
-    set(source_c_files ${source_c_files}
-        ./src/httpapiex.c
-        ./src/httpapiexsas.c
-        ./src/httpheaders.c
-        ${HTTP_C_FILE}
-    )
-endif()
-
-if(${use_schannel})
-    set(source_c_files ${source_c_files}
-        ./adapters/tlsio_schannel.c
-        ./adapters/x509_schannel.c
-    )
-endif()
-if(${use_wolfssl})
-    set(source_c_files ${source_c_files}
-        ./adapters/tlsio_wolfssl.c
-    )
-endif()
-if(${use_openssl})
-    set(source_c_files ${source_c_files}
-        ./adapters/tlsio_openssl.c
-        ./adapters/x509_openssl.c
-    )
-endif()
-if(${use_applessl})
-    set(source_c_files ${source_c_files}
-        ./pal/ios-osx/tlsio_appleios.c
-        ./pal/tlsio_options.c
-    )
-    include_directories(./pal/ios-osx/)
-endif()
-
-#these are the C headers
-set(source_h_files
-./inc/azure_c_shared_utility/agenttime.h
-./inc/azure_c_shared_utility/base32.h
-./inc/azure_c_shared_utility/base64.h
-./inc/azure_c_shared_utility/buffer_.h
-./inc/azure_c_shared_utility/connection_string_parser.h
-./inc/azure_c_shared_utility/crt_abstractions.h
-./inc/azure_c_shared_utility/constmap.h
-./inc/azure_c_shared_utility/condition.h
-./inc/azure_c_shared_utility/const_defines.h
-${LOGGING_H_FILE}
-./inc/azure_c_shared_utility/doublylinkedlist.h
-./inc/azure_c_shared_utility/gballoc.h
-./inc/azure_c_shared_utility/gbnetwork.h
-./inc/azure_c_shared_utility/gb_stdio.h
-./inc/azure_c_shared_utility/gb_time.h
-./inc/azure_c_shared_utility/gb_rand.h
-./inc/azure_c_shared_utility/hmac.h
-./inc/azure_c_shared_utility/hmacsha256.h
-./inc/azure_c_shared_utility/http_proxy_io.h
-./inc/azure_c_shared_utility/singlylinkedlist.h
-./inc/azure_c_shared_utility/lock.h
-./inc/azure_c_shared_utility/macro_utils.h
-./inc/azure_c_shared_utility/map.h
-./inc/azure_c_shared_utility/optimize_size.h
-./inc/azure_c_shared_utility/platform.h
-./inc/azure_c_shared_utility/refcount.h
-./inc/azure_c_shared_utility/sastoken.h
-./inc/azure_c_shared_utility/sha-private.h
-./inc/azure_c_shared_utility/shared_util_options.h
-./inc/azure_c_shared_utility/sha.h
-./inc/azure_c_shared_utility/socketio.h
-./inc/azure_c_shared_utility/stdint_ce6.h
-./inc/azure_c_shared_utility/strings.h
-./inc/azure_c_shared_utility/strings_types.h
-./inc/azure_c_shared_utility/string_tokenizer.h
-./inc/azure_c_shared_utility/string_tokenizer_types.h
-./inc/azure_c_shared_utility/tickcounter.h
-./inc/azure_c_shared_utility/threadapi.h
-./inc/azure_c_shared_utility/xio.h
-./inc/azure_c_shared_utility/umock_c_prod.h
-./inc/azure_c_shared_utility/uniqueid.h
-./inc/azure_c_shared_utility/uuid.h
-./inc/azure_c_shared_utility/urlencode.h
-./inc/azure_c_shared_utility/vector.h
-./inc/azure_c_shared_utility/vector_types.h
-./inc/azure_c_shared_utility/vector_types_internal.h
-./inc/azure_c_shared_utility/xlogging.h
-./inc/azure_c_shared_utility/constbuffer.h
-./inc/azure_c_shared_utility/tlsio.h
-./inc/azure_c_shared_utility/optionhandler.h
-)
-
-if(UNIX) #LINUX OR APPLE
-    set(source_h_files ${source_h_files}
-        ./adapters/linux_time.h
-    )
-endif()
-
-if(${use_wsio})
-    set(source_h_files ${source_h_files}
-        ./inc/azure_c_shared_utility/wsio.h
-        ./inc/azure_c_shared_utility/uws_client.h
-        ./inc/azure_c_shared_utility/uws_frame_encoder.h
-        ./inc/azure_c_shared_utility/utf8_checker.h
-    )
-    set(source_c_files ${source_c_files}
-        ./src/wsio.c
-        ./src/uws_client.c
-        ./src/uws_frame_encoder.c
-        ./src/utf8_checker.c
-    )
-endif()
-
-if(${use_http})
-    set(source_h_files ${source_h_files}
-        ./inc/azure_c_shared_utility/httpapi.h
-        ./inc/azure_c_shared_utility/httpapiex.h
-        ./inc/azure_c_shared_utility/httpapiexsas.h
-        ./inc/azure_c_shared_utility/httpheaders.h
-        )
-endif()
-
-if(${use_schannel})
-    set(source_h_files ${source_h_files}
-    ./inc/azure_c_shared_utility/tlsio_schannel.h
-    ./inc/azure_c_shared_utility/x509_schannel.h
-    )
-endif()
-
-if(${use_wolfssl})
-    set(source_h_files ${source_h_files}
-        ./inc/azure_c_shared_utility/tlsio_wolfssl.h
-    )
-    if(WIN32)
-        include_directories($ENV{WolfSSLDir})
-    endif()
-endif()
-if(${use_openssl})
-    set(source_h_files ${source_h_files}
-        ./inc/azure_c_shared_utility/tlsio_openssl.h
-        ./inc/azure_c_shared_utility/x509_openssl.h
-        )
-endif()
-if(${use_applessl})
-    set(source_h_files ${source_h_files}
-        ./pal/ios-osx/tlsio_appleios.h
-    )
-    include_directories(./pal/ios-osx/)
-endif()
-
-#this is the product (a library)
-add_library(aziotsharedutil ${source_c_files} ${source_h_files})
-setTargetBuildProperties(aziotsharedutil)
-
-target_include_directories(aziotsharedutil PUBLIC $<BUILD_INTERFACE:${SHARED_UTIL_INC_FOLDER}>)
-
-if(MSVC)
-    set(source_h_files ${source_h_files}
-        ./pal/windows/refcount_os.h
-    )
-    target_include_directories(aziotsharedutil PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>$<BUILD_INTERFACE:${SHARED_UTIL_FOLDER}/pal/windows>)
-else()
-    set(source_h_files ${source_h_files}
-        ./pal/linux/refcount_os.h
-    )
-    target_include_directories(aziotsharedutil PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>$<BUILD_INTERFACE:${SHARED_UTIL_FOLDER}/pal/linux>)
-endif()
-
-
-if(${build_as_dynamic})
-    #make sure we can link as dll/so
-    add_library(aziotsharedutil_dll SHARED ./src/aziotsharedutil.def ${source_c_files} ${source_h_files})
-    set_target_properties(aziotsharedutil_dll PROPERTIES OUTPUT_NAME "aziotsharedutil")
-endif()
-
-set(aziotsharedutil_target_libs)
-
-if(${use_http})
-    if(WIN32)
-        if (WINCE)
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2)
-        else()
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 winhttp)
-        endif()
-    else()
-        if (NOT use_builtin_httpapi)
-            if (CMAKE_CROSSCOMPILING)
-                # As mentioned at https://cmake.org/Wiki/CMake_Cross_Compiling the
-                # pkg-config tool can not be used by cmake while cross compiling.
-                message(STATUS "Cross compiling not using pkg-config")
-            else()
-                # try pkg-config first
-                find_package(PkgConfig)
-                if(PKG_CONFIG_FOUND)
-                    pkg_check_modules(CURL libcurl)
-                endif()
-            endif()
-
-            # if that didn't work, try CMake find_package
-            if(NOT CURL_FOUND)
-                find_package(CURL)
-            endif()
-
-            set(CURL_FIND_REQUIRED 1)
-            find_package_handle_standard_args(CURL DEFAULT_MSG CURL_LIBRARIES)
-
-            include_directories(${CURL_INCLUDE_DIRS})
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${CURL_LIBRARIES})
-        endif(NOT use_builtin_httpapi)
-    endif()
-endif(${use_http})
-
-if(${use_schannel})
-    if(WIN32)
-        if (WINCE)
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} secur32)
-        else()
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2_32 secur32 advapi32 ncrypt)
-        endif()
-    endif()
-endif()
-
-if(${use_openssl})
-    set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${OPENSSL_LIBRARIES})
-    if (WIN32)
-        set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} crypt32 ws2_32 secur32)
-    endif()
-endif()
-
-if(${use_wolfssl})
-    if (WIN32)
-        if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} $ENV{WolfSSLDir}/Debug/wolfssl.lib)
-        else()
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} $ENV{WolfSSLDir}/Release/wolfssl.lib)
-        endif()
-    else()
-        set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} wolfssl)
-    endif()
-endif()
-
-if(${use_applessl})
-    set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} ${cf_foundation} ${cf_network})
-endif()
-
-if(WIN32)
-    if (NOT ${use_default_uuid})
-        set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} rpcrt4.lib)
-    endif()
-endif()
-
-if(LINUX)
-    set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} pthread m rt)
-    if (NOT ${use_default_uuid})
-        if(APPLE)
-            find_package(PkgConfig REQUIRED)
-            pkg_search_module(UUID REQUIRED uuid)
-            link_directories(${UUID_LIBRARY_DIRS})
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} -L${UUID_LIBRARY_DIRS} ${UUID_LIBRARIES})
-        else()
-            set(aziotsharedutil_target_libs ${aziotsharedutil_target_libs} uuid)
-        endif()
-    endif()
-endif()
-
-target_link_libraries(aziotsharedutil ${aziotsharedutil_target_libs})
-if(${build_as_dynamic})
-    target_link_libraries(aziotsharedutil_dll ${aziotsharedutil_target_libs})
-endif()
-
-# do not add or build any tests of the dependencies
-set(original_run_e2e_tests ${run_e2e_tests})
-set(original_run_unittests ${run_unittests})
-
-set(run_e2e_tests OFF)
-set(run_unittests OFF)
-
-if (${original_run_unittests})
-    include("dependencies-test.cmake")
-    add_subdirectory(testtools)
-endif()
-
-if (${run_unittests} OR ${run_e2e_tests})
-    setTargetBuildProperties(ctest)
-    setTargetBuildProperties(testrunnerswitcher)
-    setTargetBuildProperties(umock_c)
-endif()
-
-set(run_e2e_tests ${original_run_e2e_tests})
-set(run_unittests ${original_run_unittests})
-
-if (${run_unittests})
-    add_subdirectory(tests)
-endif()
-
-function(FindDllFromLib var libFile)
-    get_filename_component(_libName ${libFile} NAME_WE)
-    get_filename_component(_libDir ${libFile} DIRECTORY)
-
-    while(NOT ("${_libDir}" STREQUAL ""))
-        file(GLOB_RECURSE _dllList "${_libDir}/${_libName}.dll")
-        list(LENGTH _dllList _listLen)
-        if(${_listLen} GREATER 0)
-            list(GET _dllList 0 _dll)
-            set(${var} "${_dll}" PARENT_SCOPE)
-            break()
-        endif()
-        get_filename_component(_libDir ${_libDir} DIRECTORY)
-    endwhile()
-endfunction()
-
-if (NOT ${skip_samples})
-    if(${use_openssl} AND WIN32)
-        FindDllFromLib(SSL_DLL "${OPENSSL_SSL_LIBRARY}")
-        FindDllFromLib(CRYPTO_DLL "${OPENSSL_CRYPTO_LIBRARY}")
-    endif()
-    add_subdirectory(samples)
-endif()
-
-# Set CMAKE_INSTALL_* if not defined
-include(GNUInstallDirs)
-
-if(${use_installed_dependencies})
-
-    if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
-        set(CMAKE_INSTALL_LIBDIR "lib")
-    endif()
-
-    # Install Azure C Shared Utility
-    set(package_location "cmake")
-    
-    if(${build_as_dynamic})
-        set(targets aziotsharedutil aziotsharedutil_dll)
-    else(${build_as_dynamic})
-        set(targets aziotsharedutil)
-    endif(${build_as_dynamic})
-    
-    install (TARGETS ${targets} EXPORT aziotsharedutilTargets
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/../bin
-        INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot
-    )
-    install (FILES ${source_h_files} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot/azure_c_shared_utility)
-    install (FILES ${micromock_h_files_full_path} ${INSTALL_H_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azureiot)
-
-    include(CMakePackageConfigHelpers)
-
-    write_basic_package_version_file(
-        "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
-        VERSION ${C_SHARED_VERSION}
-        COMPATIBILITY SameMajorVersion
-    )
-
-    configure_file("configs/${PROJECT_NAME}Config.cmake"
-        "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Config.cmake"
-        COPYONLY
-    )
-
-    install(EXPORT aziotsharedutilTargets
-        FILE
-            "${PROJECT_NAME}Targets.cmake"
-        DESTINATION
-            ${package_location}
-    )
-    install(
-        FILES
-            "configs/${PROJECT_NAME}Config.cmake"
-            "configs/${PROJECT_NAME}Functions.cmake"
-            "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}ConfigVersion.cmake"
-        DESTINATION
-            ${package_location}
-    )
-else()
-    set(install_staticlibs
-        aziotsharedutil
-    )
-    install(FILES ${source_h_files}
-        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/azure_c_shared_utility) 
-    install(TARGETS ${install_staticlibs} 
-        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-endif()
-

+ 0 - 21
azure/c-utility/LICENSE

@@ -1,21 +0,0 @@
-Microsoft Azure IoT SDKs 
-Copyright (c) Microsoft Corporation
-All rights reserved. 
-MIT License
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software and associated documentation files (the ""Software""), to deal 
-in the Software without restriction, including without limitation the rights 
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
-copies of the Software, and to permit persons to whom the Software is 
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in 
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
-THE SOFTWARE.

+ 0 - 93
azure/c-utility/README.md

@@ -1,93 +0,0 @@
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
-# Azure C Shared Utility
-
-azure-c-shared-utility is a C library providing common functionality for basic tasks (like string, list manipulation, IO, etc.).
-
-## Dependencies
-
-azure-c-shared-utility provides 3 tlsio implementations:
-- tlsio_schannel - runs only on Windows
-- tlsio_openssl - depends on OpenSSL being installed
-- tlsio_wolfssl - depends on WolfSSL being installed 
-
-azure-c-shared-utility depends on curl for HTTPAPI for Linux.
-
-azure-c-shared-utility uses cmake for configuring build files.
-
-## Setup
-
-1. Clone **azure-c-shared-utility** using the recursive option:
-
-```
-git clone --recursive https://github.com/Azure/azure-c-shared-utility.git
-```
-
-2. Create a folder called *cmake* under *azure-c-shared-utility*
-
-3. Switch to the *cmake* folder and run
-```
-cmake ..
-```
-
-4. Build
-
-```
-cmake --build .
-```
-
-### Installation and Use
-Optionally, you may choose to install azure-c-shared-utility on your machine:
-
-1. Switch to the *cmake* folder and run
-    ```
-    cmake -Duse_installed_dependencies=ON ../
-    ```
-    ```
-    cmake --build . --target install
-    ```
-
-    or install using the follow commands for each platform:
-
-    On Linux:
-    ```
-    sudo make install
-    ```
-
-    On Windows:
-    ```
-    msbuild /m INSTALL.vcxproj
-    ```
-
-2. Use it in your project (if installed)
-    ```
-    find_package(azure_c_shared_utility REQUIRED CONFIG)
-    target_link_library(yourlib aziotsharedutil)
-    ```
-
-_If running tests, this requires that umock-c, azure-ctest, and azure-c-testrunnerswitcher are installed (through CMake) on your machine._
-
-### Building the tests
-
-In order to build the tests use:
-
-```
-cmake .. -Drun_unittests:bool=ON
-```
-
-## Configuration options
-
-In order to turn on/off the tlsio implementations use the following CMAKE options:
-
-* `-Duse_schannel:bool={ON/OFF}` - turns on/off the SChannel support
-* `-Duse_openssl:bool={ON/OFF}` - turns on/off the OpenSSL support. If this option is use an environment variable name OpenSSLDir should be set to point to the OpenSSL folder.
-* `-Duse_wolfssl:bool={ON/OFF}` - turns on/off the WolfSSL support. If this option is use an environment variable name WolfSSLDir should be set to point to the WolfSSL folder.
-* `-Duse_http:bool={ON/OFF}` - turns on/off the HTTP API support. 
-* `-Duse_installed_dependencies:bool={ON/OFF}` - turns on/off building azure-c-shared-utility using installed dependencies. This package may only be installed if this flag is ON.
-* `-Drun_unittests:bool={ON/OFF}` - enables building of unit tests. Default is OFF.
-
-
-## Porting to new devices
-
-Instructions for porting the Azure IoT C SDK to new devices are located
-[here](https://github.com/Azure/azure-c-shared-utility/blob/master/devdoc/porting_guide.md).

+ 0 - 16
azure/c-utility/adapters/README.md

@@ -1,16 +0,0 @@
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
-# azure-c-shared-utility/src
-
-This directory contains source files for Azure C Shared Utility.
-
-### Where did that file go?
-
-Files related to adapting the Azure IoT C SDK to specific devices are being moved to new locations
-within the [azure-c-shared-utility/pal](https://github.com/Azure/azure-c-shared-utility/tree/master/pal) 
-directory and its subfolders.
-
-### Porting to new devices
-
-Instructions for porting the Azure IoT C SDK to new devices are located
-[here](https://github.com/Azure/azure-c-shared-utility/blob/pal-porting/devdoc/porting_guide.md).

+ 0 - 32
azure/c-utility/adapters/agenttime.c

@@ -1,32 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/gballoc.h"
-
-#include <time.h>
-#include "azure_c_shared_utility/agenttime.h"
-
-time_t get_time(time_t* p)
-{
-    return time(p);
-}
-
-struct tm* get_gmtime(time_t* currentTime)
-{
-    return gmtime(currentTime);
-}
-
-time_t get_mktime(struct tm* cal_time)
-{
-    return mktime(cal_time);
-}
-
-char* get_ctime(time_t* timeToGet)
-{
-    return ctime(timeToGet);
-}
-
-double get_difftime(time_t stopTime, time_t startTime)
-{
-    return difftime(stopTime, startTime);
-}

+ 0 - 27
azure/c-utility/adapters/agenttime_esp8266.c

@@ -1,27 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/agenttime.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "lwip/apps/sntp.h"
-#include "lwip/apps/sntp_time.h"
-
-time_t get_time(time_t* currentTime)
-{
-    return sntp_get_current_timestamp();
-}
-
-double get_difftime(time_t stopTime, time_t startTime)
-{	
-    return (double)stopTime - (double)startTime;
-}
-
-struct tm* get_gmtime(time_t* currentTime)
-{
-    return NULL;
-}
-
-char* get_ctime(time_t* timeToGet)
-{
-    return NULL;
-}

+ 0 - 28
azure/c-utility/adapters/agenttime_mbed.c

@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/agenttime.h"
-
-// mbed version of gmtime() returns NULL.
-// system RTC should be set to UTC as its localtime 
-
-time_t get_time(time_t* currentTime)
-{
-    return time(currentTime);
-}
-
-double get_difftime(time_t stopTime, time_t startTime)
-{
-    return difftime(stopTime, startTime);
-}
-
-
-struct tm* get_gmtime(time_t* currentTime)
-{
-    return localtime(currentTime);
-}
-
-char* get_ctime(time_t* timeToGet)
-{
-    return ctime(timeToGet);
-}

+ 0 - 140
azure/c-utility/adapters/condition_pthreads.c

@@ -1,140 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include "azure_c_shared_utility/lock.h"
-#include "azure_c_shared_utility/condition.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include <errno.h>
-#include <pthread.h>
-#include "azure_c_shared_utility/gballoc.h"
-#include "time.h"
-#include "linux_time.h"
-
-DEFINE_ENUM_STRINGS(COND_RESULT, COND_RESULT_VALUES);
-
-pthread_cond_t* create_cond(void)
-{
-    pthread_cond_t * cond = (pthread_cond_t*)malloc(sizeof(pthread_cond_t));
-    if (cond != NULL)
-    {
-#ifdef __MACH__
-        pthread_cond_init(cond, NULL);
-#else
-        pthread_condattr_t cattr;
-        pthread_condattr_init(&cattr);
-        pthread_condattr_setclock(&cattr, time_basis);
-        pthread_cond_init(cond, &cattr);
-        pthread_condattr_destroy(&cattr);
-#endif
-    }
-
-    return cond;
-}
-
-COND_HANDLE Condition_Init(void)
-{
-    set_time_basis();
-
-    // Codes_SRS_CONDITION_18_002: [ Condition_Init shall create and return a CONDITION_HANDLE ]
-    // Codes_SRS_CONDITION_18_008: [ Condition_Init shall return NULL if it fails to allocate the CONDITION_HANDLE ]
-    return create_cond();
-}
-
-COND_RESULT Condition_Post(COND_HANDLE handle)
-{
-    COND_RESULT result;
-    // Codes_SRS_CONDITION_18_001: [ Condition_Post shall return COND_INVALID_ARG if handle is NULL ]
-    if (handle == NULL)
-    {
-        result = COND_INVALID_ARG;
-    }
-    else
-    {
-        // Codes_SRS_CONDITION_18_003: [ Condition_Post shall return COND_OK if it succcessfully posts the condition ]
-        if (pthread_cond_signal((pthread_cond_t*)handle) == 0)
-        {
-            result = COND_OK;
-        }
-        else
-        {
-            result = COND_ERROR;
-        }
-    }
-    return result;
-}
-
-COND_RESULT Condition_Wait(COND_HANDLE handle, LOCK_HANDLE lock, int timeout_milliseconds)
-{
-    COND_RESULT result;
-    // Codes_SRS_CONDITION_18_004: [ Condition_Wait shall return COND_INVALID_ARG if handle is NULL ]
-    // Codes_SRS_CONDITION_18_005: [ Condition_Wait shall return COND_INVALID_ARG if lock is NULL and timeout_milliseconds is 0 ]
-    // Codes_SRS_CONDITION_18_006: [ Condition_Wait shall return COND_INVALID_ARG if lock is NULL and timeout_milliseconds is not 0 ]
-    if (handle == NULL || lock == NULL)
-    {
-        result = COND_INVALID_ARG;
-    }
-    else
-    {
-        if (timeout_milliseconds > 0)
-        {
-            // Codes_SRS_CONDITION_18_013: [ Condition_Wait shall accept relative timeouts ]
-            struct timespec tm;
-            if (get_time_ns(&tm) != 0)
-            {
-                LogError("Failed to get the current time");
-                return COND_ERROR;
-            }
-
-            tm.tv_nsec += (timeout_milliseconds % MILLISECONDS_IN_1_SECOND) * NANOSECONDS_IN_1_MILLISECOND;
-            tm.tv_sec += timeout_milliseconds / MILLISECONDS_IN_1_SECOND;
-            // handle overflow in tv_nsec
-            tm.tv_sec+= tm.tv_nsec / NANOSECONDS_IN_1_SECOND;
-            tm.tv_nsec %= NANOSECONDS_IN_1_SECOND;
-            int wait_result = pthread_cond_timedwait((pthread_cond_t *)handle, (pthread_mutex_t *)lock, &tm);
-            if (wait_result == ETIMEDOUT)
-            {
-                // Codes_SRS_CONDITION_18_011: [ Condition_Wait shall return COND_TIMEOUT if the condition is NOT triggered and timeout_milliseconds is not 0 ]
-                return COND_TIMEOUT;
-            }
-            else if (wait_result == 0)
-            {
-                // Codes_SRS_CONDITION_18_012: [ Condition_Wait shall return COND_OK if the condition is triggered and timeout_milliseconds is not 0 ]
-                result = COND_OK;
-            }
-            else
-            {
-                LogError("Failed to pthread_cond_timedwait");
-                return COND_ERROR;
-            }
-        }
-        else
-        {
-            if (pthread_cond_wait((pthread_cond_t*)handle, (pthread_mutex_t *)lock) != 0)
-            {
-                LogError("Failed to pthread_cond_wait");
-                return COND_ERROR;
-            }
-            else
-            {
-                // Codes_SRS_CONDITION_18_010: [ Condition_Wait shall return COND_OK if the condition is triggered and timeout_milliseconds is 0 ]
-                result = COND_OK;
-            }
-        }
-    }
-    return result;
-}
-
-void Condition_Deinit(COND_HANDLE handle)
-{
-// Codes_SRS_CONDITION_18_007: [ Condition_Deinit will not fail if handle is NULL ]
-    if (handle != NULL)
-    {
-        // Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL 
-        pthread_cond_t* cond = (pthread_cond_t*)handle;
-        pthread_cond_destroy(cond);
-        free(cond);
-    }
-}
-
-

+ 0 - 47
azure/c-utility/adapters/condition_rtx_mbed.cpp

@@ -1,47 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/lock.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "azure_c_shared_utility/condition.h"
-#include "rtos.h"
-
-COND_HANDLE Condition_Init(void)
-{
-    return NULL;
-}
-
-COND_RESULT Condition_Post(COND_HANDLE handle)
-{
-    COND_RESULT result;
-    if (handle == NULL)
-    {
-        result = COND_INVALID_ARG;
-    }
-    else
-    {
-        result = COND_ERROR;
-    }
-    return result;
-}
-
-COND_RESULT Condition_Wait(COND_HANDLE  handle, LOCK_HANDLE lock, int timeout_milliseconds)
-{
-    COND_RESULT result;
-    if (handle == NULL)
-    {
-        result = COND_INVALID_ARG;
-    }
-    else
-    {
-        result = COND_ERROR;
-    }
-    return result;
-}
-
-void Condition_Deinit(COND_HANDLE handle)
-{
-    if (handle != NULL)
-    {
-    }
-}

+ 0 - 155
azure/c-utility/adapters/condition_win32.c

@@ -1,155 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-
-#include "azure_c_shared_utility/condition.h"
-#include "windows.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "azure_c_shared_utility/gballoc.h"
-
-DEFINE_ENUM_STRINGS(COND_RESULT, COND_RESULT_VALUES);
-
-typedef struct CONDITION_TAG
-{
-    volatile LONG waiting_thread_count;
-    HANDLE event_handle;
-}
-CONDITION;
-
-COND_HANDLE Condition_Init(void)
-{
-    // Codes_SRS_CONDITION_18_002: [ Condition_Init shall create and return a CONDITION_HANDLE ]
-
-    CONDITION* cond = (CONDITION*)malloc(sizeof(CONDITION));
-
-    // Codes_SRS_CONDITION_18_008: [ Condition_Init shall return NULL if it fails to allocate the CONDITION_HANDLE ]
-    if (cond != NULL)
-    {
-        cond->event_handle = CreateEvent(NULL, FALSE, FALSE, NULL);
-
-        if (cond->event_handle == INVALID_HANDLE_VALUE)
-        {
-            LogError("CreateEvent failed with error %d", GetLastError());
-            free(cond);
-            cond = NULL;
-        }
-        else
-        {
-            /* Needed to emulate pthread_signal as we only signal the event when there are waiting threads */
-            cond->waiting_thread_count = 0;
-        }
-    }
-    else
-    {
-        LogError("Failed to allocate condition handle");
-    }
-
-    return (COND_HANDLE)cond;
-}
-
-COND_RESULT Condition_Post(COND_HANDLE handle)
-{
-    COND_RESULT result;
-    if (handle == NULL)
-    {
-        LogError("Null argument handle passed to Condition_Post");
-
-        // Codes_SRS_CONDITION_18_001: [ Condition_Post shall return COND_INVALID_ARG if handle is NULL ]
-        result = COND_INVALID_ARG;
-    }
-    else
-    {
-        CONDITION* cond = (CONDITION*)handle;
-
-        /* Emulate pthreads signalling, by only unblocking *one* waiting thread if there is one waiting */
-        if (cond->waiting_thread_count == 0 || SetEvent(cond->event_handle))
-        {
-            // Codes_SRS_CONDITION_18_003: [ Condition_Post shall return COND_OK if it succcessfully posts the condition ]
-            result = COND_OK;
-        }
-        else
-        {
-            LogError("Failed SetEvent call with error %d", GetLastError());
-
-            result = COND_ERROR;
-        }
-    }
-    return result;
-}
-
-COND_RESULT Condition_Wait(COND_HANDLE handle, LOCK_HANDLE lock, int timeout_milliseconds)
-{
-    COND_RESULT result;
-
-    // Codes_SRS_CONDITION_18_004: [ Condition_Wait shall return COND_INVALID_ARG if handle is NULL ]
-    // Codes_SRS_CONDITION_18_005: [ Condition_Wait shall return COND_INVALID_ARG if lock is NULL and timeout_milliseconds is 0 ]
-    // Codes_SRS_CONDITION_18_006: [ Condition_Wait shall return COND_INVALID_ARG if lock is NULL and timeout_milliseconds is not 0 ]
-    if (handle == NULL || lock == NULL)
-    {
-        result = COND_INVALID_ARG;
-    }
-    else if (Unlock(lock) == 0)
-    {
-        CONDITION* cond = (CONDITION*)handle;
-        DWORD wait_result;
-
-        /* Increment the waiting thread count, unlock the lock and wait */
-        (void)InterlockedIncrement(&cond->waiting_thread_count);
-        
-        // Codes_SRS_CONDITION_18_013: [ Condition_Wait shall accept relative timeouts ]
-        wait_result = WaitForSingleObject(cond->event_handle, timeout_milliseconds == 0 ? INFINITE : timeout_milliseconds);
-
-        /* If we unlocked ok, it means the lock handle is valid, lock must succeed since it wraps EnterCriticalSection */
-        (void)Lock(lock);
-
-        if (wait_result != WAIT_OBJECT_0 && wait_result != WAIT_TIMEOUT)
-        {
-            LogError("Failed wait, wait returned with %x", wait_result);
-
-            /* cond might be freed at this point, just return error and do not touch condition */
-            result = COND_ERROR;
-        }
-        else
-        {
-            /* To handle the chance of a race condition reset the event again when there are no more waiting threads */
-            if (InterlockedDecrement(&cond->waiting_thread_count) == 0)
-            {
-                (void)ResetEvent(cond->event_handle);
-            }
-
-            if (wait_result == WAIT_TIMEOUT)
-            {
-                // Codes_SRS_CONDITION_18_011: [ Condition_Wait shall return COND_TIMEOUT if the condition is NOT triggered and timeout_milliseconds is not 0 ]
-                result = COND_TIMEOUT;
-            }
-            else
-            {
-                // Codes_SRS_CONDITION_18_012: [ Condition_Wait shall return COND_OK if the condition is triggered and timeout_milliseconds is not 0 ]
-                result = COND_OK;
-            }
-        }
-    }
-    else
-    {
-        LogError("Invalid lock passed which failed to unlock");
-        result = COND_ERROR;
-    }
-    return result;
-}
-
-void Condition_Deinit(COND_HANDLE handle)
-{
-    // Codes_SRS_CONDITION_18_007: [ Condition_Deinit will not fail if handle is NULL ]
-    // Codes_SRS_CONDITION_18_009: [ Condition_Deinit will deallocate handle if it is not NULL 
-    if (handle != NULL)
-    {
-        CONDITION* cond = (CONDITION*)handle;
-
-        (void)CloseHandle(cond->event_handle);
-        cond->event_handle = INVALID_HANDLE_VALUE;
-
-        free(cond);
-    }
-}
-

+ 0 - 13
azure/c-utility/adapters/envvariable.c

@@ -1,13 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>  
-#include <stdio.h>  
-
-#include "azure_c_shared_utility/envvariable.h"
-
-const char* environment_get_variable(const char *variable_name)
-{
-    return getenv(variable_name);
-}
-

+ 0 - 306
azure/c-utility/adapters/esp8266_mock.h

@@ -1,306 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#ifndef _ESP8266_MOCK_H_
-#define _ESP8266_MOCK_H_
-
-#include <stdint.h>
-#include "azure_c_shared_utility/umock_c_prod.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef void SSL;
-typedef void SSL_CTX;
-typedef void SSL_METHOD;
-
-/*
- * SSL_CTX_new - create a SSL context
- *
- * @param method - the SSL context configuration file
- *
- * @return the context point, if create failed return NULL
- */
-//SSL_CTX* SSL_CTX_new(SSL_METHOD *method);
-MOCKABLE_FUNCTION(, SSL_CTX*, SSL_CTX_new, SSL_METHOD*, method);
-
-
-/*
- * SSL_CTX_free - free a SSL context
- *
- * @param method - the SSL context point
- *
- * @return none
- */
-//void SSL_CTX_free(SSL_CTX *ctx);
-MOCKABLE_FUNCTION(, void, SSL_CTX_free, SSL_CTX*, ctx);
-
-/*
- * SSL_new - create a SSL
- *
- * @param ssl_ctx - the SSL context which includes the SSL parameter
- *
- * @return the result
- *     result = 0 : successfully
- *     result < 0 : error, you may see the mbedtls error code
- */
-//SSL* SSL_new(SSL_CTX *ssl_ctx);
-MOCKABLE_FUNCTION(, SSL*, SSL_new, SSL_CTX*, ssl_ctx);
-
-/*
- * SSL_free - free the SSL
- *
- * @param ssl - the SSL point which has been "SSL_new"
- *
- * @return none
- */
-//void SSL_free(SSL *ssl);
-MOCKABLE_FUNCTION(, void, SSL_free, SSL*, ssl);
-
-/*
- * SSL_connect - connect to the remote SSL server
- *
- * @param ssl - the SSL point which has been "SSL_new"
- *
- * @return the result
- *     result = 0 : successfully
- *     result < 0 : error, you can see the mbedtls error code
- */
-//int SSL_connect(SSL *ssl);
-MOCKABLE_FUNCTION(, int, SSL_connect, SSL*, ssl);
-
-/*
- * SSL_read - read data from remote
- *
- * @param ssl - the SSL point which has been connected
- * @param buffer - the received data point
- * @param len - the received data length
- *
- * @return the result
- *     result > 0 : the length of the received data
- *     result = 0 : the connect is closed
- *     result < 0 : error, you can see the mbedtls error code
- */
-// int SSL_read(SSL *ssl, void *buffer, int len);
-MOCKABLE_FUNCTION(, int, SSL_read, SSL*, ssl, void*, buffer, int, len);
-
-/*
- * SSL_write - send the data to remote
- *
- * @param ssl - the SSL point which has been connected
- * @param buffer - the send data point
- * @param len - the send data length
- *
- * @return the result of verifying
- *     result > 0 : the length of the written data
- *     result = 0 : the connect is closed
- *     result < 0 : error, you can see the mbedtls error code
- */
-//int SSL_write(SSL *ssl, const void *buffer, int len);
-MOCKABLE_FUNCTION(, int, SSL_write, SSL*, ssl, const void*, buffer, int, len);
-
-/*
- * SSL_shutdown - shutdown the connection to the remote
- *
- * @param ssl - the SSL point which has been connected or accepted
- *
- * @return the result
- *     result = 0 : successfully
- *     result < 0 : error, you may see the mbedtls error code
- */
-//int SSL_shutdown(SSL *ssl);
-MOCKABLE_FUNCTION(, int, SSL_shutdown, SSL*, ssl);
-
-/*
- * SSL_set_fd - set the socket file description to the SSL
- *
- * @param ssl - the SSL point which has been "SSL_new"
- * @param fd  - socket file description
- *
- * @return the result
- *     result = 1  : successfully
- *     result <= 0 : error, SSL is NULL or socket file description is NULL
- */
-//int SSL_set_fd(SSL *ssl, int fd);
-MOCKABLE_FUNCTION(, int, SSL_set_fd, SSL*, ssl, int, fd);
-
-/*
- * TLSv1_client_method - create the target SSL context client method
- *
- * @return the TLSV1.0 version SSL context client method
- */
-//SSL_METHOD* TLSv1_client_method(void);
-MOCKABLE_FUNCTION(, SSL_METHOD*, TLSv1_client_method);
-
-/**
- * @brief set the SSL context read buffer length
- *
- * @param ctx - SSL context point
- * @param len - read buffer length
- *
- * @return none
- */
-//void SSL_CTX_set_default_read_buffer_len(SSL_CTX *ctx, size_t len);
-MOCKABLE_FUNCTION(, void, SSL_CTX_set_default_read_buffer_len, SSL_CTX*, ctx, size_t, len);
-
-/**
- * @brief get SSL error code
- *
- * @param ssl       - SSL point
- * @param ret_code  - SSL return code
- *
- * @return SSL error number
- */
-//int SSL_get_error(const SSL *ssl, int ret_code);
-MOCKABLE_FUNCTION(, int, SSL_get_error, const SSL*, ssl, int, ret_code);
-
-#define MEMP_NUM_NETCONN                10
-
-
-typedef uint32_t u32_t;
-#define socklen_t unsigned int
-typedef uint8_t u8_t;
-typedef uint8_t uint8;
-typedef uint16_t u16_t;
-typedef int32_t err_t;
-
-struct ip_addr {
-  u32_t addr;
-};
-typedef struct ip_addr ip_addr_t;
-
-#define SOL_SOCKET   0xfff     /* options for socket level */
-#define SO_SNDBUF    0x1001    /* Unimplemented: send buffer size */
-#define SO_RCVBUF    0x1002    /* receive buffer size */
-#define SO_SNDLOWAT  0x1003    /* Unimplemented: send low-water mark */
-#define SO_RCVLOWAT  0x1004    /* Unimplemented: receive low-water mark */
-#define SO_SNDTIMEO  0x1005    /* Unimplemented: send timeout */
-#define SO_RCVTIMEO  0x1006    /* receive timeout */
-#define SO_ERROR     0x1007    /* get error status and clear */
-#define SO_TYPE      0x1008    /* get socket type */
-#define SO_CONTIMEO  0x1009    /* Unimplemented: connect timeout */
-#define SO_NO_CHECK  0x100a    /* don't create UDP checksum */
-#define SO_REUSEADDR 1         /* Enable address reuse */
-
-#define  SO_KEEPALIVE   0x0008 /* keep connections alive */
-#define IPPROTO_TCP     6
-#define TCP_KEEPALIVE  0x02    /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */
-#define TCP_KEEPIDLE   0x03    /* set pcb->keep_idle  - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */
-#define TCP_KEEPINTVL  0x04    /* set pcb->keep_intvl - Use seconds for get/setsockopt */
-#define TCP_KEEPCNT    0x05    /* set pcb->keep_cnt   - Use number of probes sent for get/setsockopt */
-#define SSL_ERROR_WANT_READ             2
-#define SSL_ERROR_WANT_WRITE            3
-
-#define AF_INET         2
-/* Socket protocol types (TCP/UDP/RAW) */
-#define SOCK_STREAM     1
-#define SOCK_DGRAM      2
-#define SOCK_RAW        3
-
-int ioctl(int s, long cmd, void *argp);
-#define F_GETFL 3
-#define F_SETFL 4
-#define O_NONBLOCK  1 /* nonblocking I/O */
-#define O_NDELAY    1 /* same as O_NONBLOCK, for compatibility */
-#define LOCAL
-
-
-
-typedef u8_t sa_family_t;
-typedef u16_t in_port_t;
-
-typedef u32_t in_addr_t;
-
-struct in_addr {
-  in_addr_t s_addr;
-};
-
-
-struct sockaddr_in {
-  u8_t            sin_len;
-  sa_family_t     sin_family;
-  in_port_t       sin_port;
-  struct in_addr  sin_addr;
-#define SIN_ZERO_LEN 8
-  char            sin_zero[SIN_ZERO_LEN];
-};
-
-
-struct sockaddr {
-  u8_t        sa_len;
-  sa_family_t sa_family;
-#if LWIP_IPV6
-  char        sa_data[22];
-#else /* LWIP_IPV6 */
-  char        sa_data[14];
-#endif /* LWIP_IPV6 */
-};
-
-/* FD_SET used for lwip_select */
-//int my_FD_ISSET(int n, void* p);
-#ifndef FD_SET
-  #undef  FD_SETSIZE
-  /* Make FD_SETSIZE match NUM_SOCKETS in socket.c */
-  #define FD_SETSIZE    MEMP_NUM_NETCONN
-  #define FD_SET(n, p)  ((p)->fd_bits[(n)/8] |=  (1 << ((n) & 7)))
-  #define FD_CLR(n, p)  ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7)))
-  //#define FD_ISSET(n,p) my_FD_ISSET(n, p)
-  //((p)->fd_bits[(n)/8] &   (1 << ((n) & 7)))
-  #define FD_ZERO(p)    memset((void*)(p),0,sizeof(*(p)))
-
-  typedef struct fd_set {
-          unsigned char fd_bits [(FD_SETSIZE+7)/8];
-        } fd_set;
-
-#endif /* FD_SET */
-
-struct timeval {
-  long    tv_sec;         /* seconds */
-  long    tv_usec;        /* and microseconds */
-};
-
-//err_t netconn_gethostbyname(const char *name, ip_addr_t *addr);
-MOCKABLE_FUNCTION(, err_t, netconn_gethostbyname, const char*, name, ip_addr_t*, addr);
-
-//int socket(int domain, int type, int protocol);
-MOCKABLE_FUNCTION(, int, socket, int, domain, int, type, int, protocol);
-
-//int bind(int s, const struct sockaddr* name, socklen_t namelen);
-MOCKABLE_FUNCTION(, int, bind, int, s, const struct sockaddr*, name, socklen_t, namelen);
-
-//int connect(int s, const struct sockaddr *name, socklen_t namelen);
-MOCKABLE_FUNCTION(, int, connect, int, s, const struct sockaddr*, name, socklen_t, namelen);
-
-//int lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen)
-MOCKABLE_FUNCTION(, int, getsockopt, int, s, int, level, int, optname, void*, optval, socklen_t*, optlen);
-
-//int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
-//                struct timeval *timeout);
-MOCKABLE_FUNCTION(, int, lwip_select, int, maxfdp1, fd_set*, readset, fd_set*, writeset, fd_set*, exceptset, struct timeval*, timeout);
-
-//os_delay_us(int us);
-MOCKABLE_FUNCTION(, void, os_delay_us, int, us);
-
-//int setsockopt(int s, int level, int optname, const void *optval, socklen_t optlen);
-MOCKABLE_FUNCTION(, int, setsockopt, int, s, int, level, int, optname, const void*, optval, socklen_t, optlen);
-
-//int close(int s)
-MOCKABLE_FUNCTION(, int, close, int, s);
-
-MOCKABLE_FUNCTION(, int, FD_ISSET, int, n, void*, p);
-
-//int fcntl(int s, int cmd, int val);
-MOCKABLE_FUNCTION(, int, fcntl, int, s, int, cmd, int, val);
-
-
-#define htons(x) (x)
-#define ntohs(x) (x)
-#define htonl(x) (x)
-#define ntohl(x) (x)
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif

+ 0 - 972
azure/c-utility/adapters/httpapi_curl.c

@@ -1,972 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
-#include <ctype.h>
-
-#include "azure_c_shared_utility/strings.h"
-#include "azure_c_shared_utility/httpapi.h"
-#include "azure_c_shared_utility/httpheaders.h"
-#include "azure_c_shared_utility/crt_abstractions.h"
-#include "curl/curl.h"
-#include "azure_c_shared_utility/xlogging.h"
-#ifdef USE_OPENSSL
-#include "azure_c_shared_utility/x509_openssl.h"
-#elif USE_WOLFSSL
-#define WOLFSSL_OPTIONS_IGNORE_SYS
-#include "wolfssl/options.h"
-#include "wolfssl/ssl.h"
-#include "wolfssl/error-ssl.h"
-#endif
-#include "azure_c_shared_utility/shared_util_options.h"
-
-#define TEMP_BUFFER_SIZE 1024
-
-DEFINE_ENUM_STRINGS(HTTPAPI_RESULT, HTTPAPI_RESULT_VALUES);
-
-typedef struct HTTP_HANDLE_DATA_TAG
-{
-    CURL* curl;
-    char* hostURL;
-    long timeout;
-    long lowSpeedLimit;
-    long lowSpeedTime;
-    long forbidReuse;
-    long freshConnect;
-    long verbose;
-    const char* x509privatekey;
-    const char* x509certificate;
-    const char* certificates; /*a list of CA certificates*/
-} HTTP_HANDLE_DATA;
-
-typedef struct HTTP_RESPONSE_CONTENT_BUFFER_TAG
-{
-    unsigned char* buffer;
-    size_t bufferSize;
-    unsigned char error;
-} HTTP_RESPONSE_CONTENT_BUFFER;
-
-static size_t nUsersOfHTTPAPI = 0; /*used for reference counting (a weak one)*/
-
-HTTPAPI_RESULT HTTPAPI_Init(void)
-{
-    HTTPAPI_RESULT result;
-    if (nUsersOfHTTPAPI == 0)
-    {
-        if (curl_global_init(CURL_GLOBAL_NOTHING) != 0)
-        {
-            result = HTTPAPI_INIT_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        }
-        else
-        {
-            nUsersOfHTTPAPI++;
-            result = HTTPAPI_OK;
-        }
-    }
-    else
-    {
-        nUsersOfHTTPAPI++;
-        result = HTTPAPI_OK;
-    }
-
-    return result;
-}
-
-void HTTPAPI_Deinit(void)
-{
-    if (nUsersOfHTTPAPI > 0)
-    {
-        nUsersOfHTTPAPI--;
-        if (nUsersOfHTTPAPI == 0)
-        {
-            curl_global_cleanup();
-        }
-    }
-}
-
-HTTP_HANDLE HTTPAPI_CreateConnection(const char* hostName)
-{
-    HTTP_HANDLE_DATA* httpHandleData;
-
-    if (hostName == NULL)
-    {
-        LogError("invalid arg const char* hostName = %p", hostName);
-        httpHandleData = NULL;
-    }
-    else
-    {
-        httpHandleData = (HTTP_HANDLE_DATA*)malloc(sizeof(HTTP_HANDLE_DATA));
-        if (httpHandleData != NULL)
-        {
-            size_t hostURL_size = strlen("https://") + strlen(hostName) + 1;
-            httpHandleData->hostURL = malloc(hostURL_size);
-            if (httpHandleData->hostURL == NULL)
-            {
-                LogError("unable to malloc");
-                free(httpHandleData);
-                httpHandleData = NULL;
-            }
-            else
-            {
-                if ((strcpy_s(httpHandleData->hostURL, hostURL_size, "https://") == 0) &&
-                    (strcat_s(httpHandleData->hostURL, hostURL_size, hostName) == 0))
-                {
-                    httpHandleData->curl = curl_easy_init();
-                    if (httpHandleData->curl == NULL)
-                    {
-                        free(httpHandleData->hostURL);
-                        free(httpHandleData);
-                        httpHandleData = NULL;
-                    }
-                    else
-                    {
-                        httpHandleData->timeout = 242 * 1000; /*242 seconds seems like a nice enough time. Reasone for 242:
-                                                                1. http://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT.html says Normally, name lookups can take a considerable time and limiting operations to less than a few minutes risk aborting perfectly normal operations.
-                                                                2. 256KB of data... at 9600 bps transfers in about 218 seconds. Add to that a buffer of 10%... round it up to 242 :)*/
-                        httpHandleData->lowSpeedTime = 0;
-                        httpHandleData->lowSpeedLimit = 0;
-                        httpHandleData->forbidReuse = 0;
-                        httpHandleData->freshConnect = 0;
-                        httpHandleData->verbose = 0;
-                        httpHandleData->x509certificate = NULL;
-                        httpHandleData->x509privatekey = NULL;
-                        httpHandleData->certificates = NULL;
-                    }
-                }
-                else
-                {
-                    free(httpHandleData->hostURL);
-                    free(httpHandleData);
-                    httpHandleData = NULL;
-                }
-            }
-        }
-    }
-
-    return (HTTP_HANDLE)httpHandleData;
-}
-
-void HTTPAPI_CloseConnection(HTTP_HANDLE handle)
-{
-    HTTP_HANDLE_DATA* httpHandleData = (HTTP_HANDLE_DATA*)handle;
-    if (httpHandleData != NULL)
-    {
-        free(httpHandleData->hostURL);
-        curl_easy_cleanup(httpHandleData->curl);
-        free(httpHandleData);
-    }
-}
-
-static size_t HeadersWriteFunction(void *ptr, size_t size, size_t nmemb, void *userdata)
-{
-    HTTP_HEADERS_HANDLE responseHeadersHandle = (HTTP_HEADERS_HANDLE)userdata;
-    char* headerLine = (char*)ptr;
-
-    if (headerLine != NULL)
-    {
-        char* token = strtok(headerLine, "\r\n");
-        while ((token != NULL) &&
-               (token[0] != '\0'))
-        {
-            char* whereIsColon = strchr(token, ':');
-            if(whereIsColon!=NULL)
-            {
-                *whereIsColon='\0';
-                HTTPHeaders_AddHeaderNameValuePair(responseHeadersHandle, token, whereIsColon+1);
-                *whereIsColon=':';
-            }
-            else
-            {
-                /*not a header, maybe a status-line*/
-            }
-            token = strtok(NULL, "\r\n");
-        }
-    }
-
-    return size * nmemb;
-}
-
-static size_t ContentWriteFunction(void *ptr, size_t size, size_t nmemb, void *userdata)
-{
-    HTTP_RESPONSE_CONTENT_BUFFER* responseContentBuffer = (HTTP_RESPONSE_CONTENT_BUFFER*)userdata;
-    if ((userdata != NULL) &&
-        (ptr != NULL) &&
-        (size * nmemb > 0))
-    {
-        void* newBuffer = realloc(responseContentBuffer->buffer, responseContentBuffer->bufferSize + (size * nmemb));
-        if (newBuffer != NULL)
-        {
-            responseContentBuffer->buffer = newBuffer;
-            memcpy(responseContentBuffer->buffer + responseContentBuffer->bufferSize, ptr, size * nmemb);
-            responseContentBuffer->bufferSize += size * nmemb;
-        }
-        else
-        {
-            LogError("Could not allocate buffer of size %zu", (size_t)(responseContentBuffer->bufferSize + (size * nmemb)));
-            responseContentBuffer->error = 1;
-            if (responseContentBuffer->buffer != NULL)
-            {
-                free(responseContentBuffer->buffer);
-            }
-        }
-    }
-
-    return size * nmemb;
-}
-
-static CURLcode ssl_ctx_callback(CURL *curl, void *ssl_ctx, void *userptr)
-{
-    CURLcode result;
-
-    if (
-        (curl == NULL) ||
-        (ssl_ctx == NULL) ||
-        (userptr == NULL)
-        )
-    {
-        LogError("unexpected parameter CURL *curl=%p, void *ssl_ctx=%p, void *userptr=%p", curl, ssl_ctx, userptr);
-        result = CURLE_SSL_CERTPROBLEM;
-    }
-    else
-    {
-        HTTP_HANDLE_DATA *httpHandleData = (HTTP_HANDLE_DATA *)userptr;
-#ifdef USE_OPENSSL
-        /*trying to set the x509 per device certificate*/
-        if (
-            (httpHandleData->x509certificate != NULL) && (httpHandleData->x509privatekey != NULL) &&
-            (x509_openssl_add_credentials(ssl_ctx, httpHandleData->x509certificate, httpHandleData->x509privatekey) != 0)
-           )
-        {
-            LogError("unable to x509_openssl_add_credentials");
-            result = CURLE_SSL_CERTPROBLEM;
-        }
-        /*trying to set CA certificates*/
-        else if (
-            (httpHandleData->certificates != NULL) &&
-            (x509_openssl_add_certificates(ssl_ctx, httpHandleData->certificates) != 0)
-            )
-        {
-            LogError("failure in x509_openssl_add_certificates");
-            result = CURLE_SSL_CERTPROBLEM;
-        }
-#elif USE_WOLFSSL
-        if (
-            (httpHandleData->x509certificate != NULL) &&
-            (httpHandleData->x509privatekey != NULL) &&
-            (
-             ((wolfSSL_use_certificate_chain_buffer(ssl_ctx, (unsigned char*)httpHandleData->x509certificate, strlen(httpHandleData->x509certificate)) != SSL_SUCCESS)) ||
-             ((wolfSSL_use_PrivateKey_buffer(ssl_ctx, (unsigned char*)httpHandleData->x509privatekey, strlen(httpHandleData->x509privatekey), SSL_FILETYPE_PEM) != SSL_SUCCESS))
-            )
-            )
-        {
-            LogError("unable to add x509 certs to wolfssl");
-            result = CURLE_SSL_CERTPROBLEM;
-        }
-        else if (
-            (httpHandleData->certificates != NULL) && 
-            (wolfSSL_CTX_load_verify_buffer(ssl_ctx, (const unsigned char*)httpHandleData->certificates, strlen(httpHandleData->certificates), SSL_FILETYPE_PEM) != SSL_SUCCESS)
-            )
-        {
-            LogError("failure in adding trusted certificate to client");
-            result = CURLE_SSL_CERTPROBLEM;
-        }
-#else
-        if (httpHandleData->x509certificate != NULL || httpHandleData->x509privatekey != NULL)
-        {
-            LogError("Failure no platform is enabled to handle certificates");
-            result = CURLE_SSL_CERTPROBLEM;
-        }
-#endif
-        else
-        {
-            result = CURLE_OK;
-        }
-    }
-
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, HTTPAPI_REQUEST_TYPE requestType, const char* relativePath,
-                                      HTTP_HEADERS_HANDLE httpHeadersHandle, const unsigned char* content,
-                                      size_t contentLength, unsigned int* statusCode,
-                                      HTTP_HEADERS_HANDLE responseHeadersHandle, BUFFER_HANDLE responseContent)
-{
-    HTTPAPI_RESULT result;
-    HTTP_HANDLE_DATA* httpHandleData = (HTTP_HANDLE_DATA*)handle;
-    size_t headersCount;
-    HTTP_RESPONSE_CONTENT_BUFFER responseContentBuffer;
-
-    if ((httpHandleData == NULL) ||
-        (relativePath == NULL) ||
-        (httpHeadersHandle == NULL) ||
-        ((content == NULL) && (contentLength > 0))
-    )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-    }
-    else if (HTTPHeaders_GetHeaderCount(httpHeadersHandle, &headersCount) != HTTP_HEADERS_OK)
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-    }
-    else
-    {
-        char* tempHostURL;
-        size_t tempHostURL_size = strlen(httpHandleData->hostURL) + strlen(relativePath) + 1;
-        tempHostURL = malloc(tempHostURL_size);
-        if (tempHostURL == NULL)
-        {
-            result = HTTPAPI_ERROR;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        }
-        else
-        {
-            if (curl_easy_setopt(httpHandleData->curl, CURLOPT_VERBOSE, httpHandleData->verbose) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_VERBOSE (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if ((strcpy_s(tempHostURL, tempHostURL_size, httpHandleData->hostURL) != 0) ||
-                (strcat_s(tempHostURL, tempHostURL_size, relativePath) != 0))
-            {
-                result = HTTPAPI_STRING_PROCESSING_ERROR;
-                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            /* set the URL */
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_URL, tempHostURL) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_URL (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_TIMEOUT_MS, httpHandleData->timeout) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_TIMEOUT_MS (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_LOW_SPEED_LIMIT, httpHandleData->lowSpeedLimit) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_LOW_SPEED_LIMIT (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_LOW_SPEED_TIME, httpHandleData->lowSpeedTime) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_LOW_SPEED_TIME (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_FRESH_CONNECT, httpHandleData->freshConnect) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_FRESH_CONNECT (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_FORBID_REUSE, httpHandleData->forbidReuse) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_FORBID_REUSE (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else if (curl_easy_setopt(httpHandleData->curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1) != CURLE_OK)
-            {
-                result = HTTPAPI_SET_OPTION_FAILED;
-                LogError("failed to set CURLOPT_HTTP_VERSION (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else
-            {
-                result = HTTPAPI_OK;
-
-                switch (requestType)
-                {
-                default:
-                    result = HTTPAPI_INVALID_ARG;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    break;
-
-                case HTTPAPI_REQUEST_GET:
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_HTTPGET, 1L) != CURLE_OK)
-                    {
-                        result = HTTPAPI_SET_OPTION_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_CUSTOMREQUEST, NULL) != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                    }
-
-                    break;
-
-                case HTTPAPI_REQUEST_POST:
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_POST, 1L) != CURLE_OK)
-                    {
-                        result = HTTPAPI_SET_OPTION_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_CUSTOMREQUEST, NULL) != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                    }
-
-                    break;
-
-                case HTTPAPI_REQUEST_PUT:
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_POST, 1L))
-                    {
-                        result = HTTPAPI_SET_OPTION_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_CUSTOMREQUEST, "PUT") != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                    }
-                    break;
-
-                case HTTPAPI_REQUEST_DELETE:
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_POST, 1L) != CURLE_OK)
-                    {
-                        result = HTTPAPI_SET_OPTION_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_CUSTOMREQUEST, "DELETE") != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                    }
-                    break;
-
-                case HTTPAPI_REQUEST_PATCH:
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_POST, 1L) != CURLE_OK)
-                    {
-                        result = HTTPAPI_SET_OPTION_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_CUSTOMREQUEST, "PATCH") != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                    }
-
-                    break;
-                }
-
-                if (result == HTTPAPI_OK)
-                {
-                    /* add headers */
-                    struct curl_slist* headers = NULL;
-                    size_t i;
-
-                    for (i = 0; i < headersCount; i++)
-                    {
-                        char *tempBuffer;
-                        if (HTTPHeaders_GetHeader(httpHeadersHandle, i, &tempBuffer) != HTTP_HEADERS_OK)
-                        {
-                            /* error */
-                            result = HTTPAPI_HTTP_HEADERS_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                            break;
-                        }
-                        else
-                        {
-                            struct curl_slist* newHeaders = curl_slist_append(headers, tempBuffer);
-                            if (newHeaders == NULL)
-                            {
-                                result = HTTPAPI_ALLOC_FAILED;
-                                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                free(tempBuffer);
-                                break;
-                            }
-                            else
-                            {
-                                free(tempBuffer);
-                                headers = newHeaders;
-                            }
-                        }
-                    }
-
-                    if (result == HTTPAPI_OK)
-                    {
-                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_HTTPHEADER, headers) != CURLE_OK)
-                        {
-                            result = HTTPAPI_SET_OPTION_FAILED;
-                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                        else
-                        {
-                            /* add content */
-                            if ((content != NULL) &&
-                                (contentLength > 0))
-                            {
-                                if ((curl_easy_setopt(httpHandleData->curl, CURLOPT_POSTFIELDS, (void*)content) != CURLE_OK) ||
-                                    (curl_easy_setopt(httpHandleData->curl, CURLOPT_POSTFIELDSIZE, contentLength) != CURLE_OK))
-                                {
-                                    result = HTTPAPI_SET_OPTION_FAILED;
-                                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                }
-                            }
-                            else
-                            {
-                                if (requestType != HTTPAPI_REQUEST_GET)
-                                {
-                                    if ((curl_easy_setopt(httpHandleData->curl, CURLOPT_POSTFIELDS, (void*)NULL) != CURLE_OK) ||
-                                        (curl_easy_setopt(httpHandleData->curl, CURLOPT_POSTFIELDSIZE, 0) != CURLE_OK))
-                                    {
-                                        result = HTTPAPI_SET_OPTION_FAILED;
-                                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                    }
-                                }
-                                else
-                                {
-                                    /*GET request cannot POST, so "do nothing*/
-                                }
-                            }
-
-                            if (result == HTTPAPI_OK)
-                            {
-                                if ((curl_easy_setopt(httpHandleData->curl, CURLOPT_WRITEHEADER, NULL) != CURLE_OK) ||
-                                    (curl_easy_setopt(httpHandleData->curl, CURLOPT_HEADERFUNCTION, NULL) != CURLE_OK) ||
-                                    (curl_easy_setopt(httpHandleData->curl, CURLOPT_WRITEFUNCTION, ContentWriteFunction) != CURLE_OK))
-                                {
-                                    result = HTTPAPI_SET_OPTION_FAILED;
-                                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                }
-                                else
-                                {
-                                    if (responseHeadersHandle != NULL)
-                                    {
-                                        /* setup the code to get the response headers */
-                                        if ((curl_easy_setopt(httpHandleData->curl, CURLOPT_WRITEHEADER, responseHeadersHandle) != CURLE_OK) ||
-                                            (curl_easy_setopt(httpHandleData->curl, CURLOPT_HEADERFUNCTION, HeadersWriteFunction) != CURLE_OK))
-                                        {
-                                            result = HTTPAPI_SET_OPTION_FAILED;
-                                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                        }
-                                    }
-
-                                    if (result == HTTPAPI_OK)
-                                    {
-                                        responseContentBuffer.buffer = NULL;
-                                        responseContentBuffer.bufferSize = 0;
-                                        responseContentBuffer.error = 0;
-
-                                        if (curl_easy_setopt(httpHandleData->curl, CURLOPT_WRITEDATA, &responseContentBuffer) != CURLE_OK)
-                                        {
-                                            result = HTTPAPI_SET_OPTION_FAILED;
-                                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                        }
-
-                                        if (result == HTTPAPI_OK)
-                                        {
-                                            /* Execute request */
-                                            CURLcode curlRes = curl_easy_perform(httpHandleData->curl);
-                                            if (curlRes != CURLE_OK)
-                                            {
-                                                LogError("curl_easy_perform() failed: %s\n", curl_easy_strerror(curlRes));
-                                                result = HTTPAPI_OPEN_REQUEST_FAILED;
-                                                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                            }
-                                            else
-                                            {
-                                                long httpCode;
-
-                                                /* get the status code */
-                                                if (curl_easy_getinfo(httpHandleData->curl, CURLINFO_RESPONSE_CODE, &httpCode) != CURLE_OK)
-                                                {
-                                                    result = HTTPAPI_QUERY_HEADERS_FAILED;
-                                                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                }
-                                                else if (responseContentBuffer.error)
-                                                {
-                                                    result = HTTPAPI_READ_DATA_FAILED;
-                                                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                }
-                                                else
-                                                {
-                                                    if (statusCode != NULL)
-                                                    {
-                                                        *statusCode = (unsigned int)httpCode;
-                                                    }
-
-                                                    /* fill response content length */
-                                                    if (responseContent != NULL)
-                                                    {
-                                                        if ((responseContentBuffer.bufferSize > 0) && (BUFFER_build(responseContent, responseContentBuffer.buffer, responseContentBuffer.bufferSize) != 0))
-                                                        {
-                                                            result = HTTPAPI_INSUFFICIENT_RESPONSE_BUFFER;
-                                                            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                        }
-                                                        else
-                                                        {
-                                                            /*all nice*/
-                                                        }
-                                                    }
-
-                                                    if (httpCode >= 300)
-                                                    {
-                                                        LogError("Failure in HTTP communication: server reply code is %ld", httpCode);
-                                                        LogInfo("HTTP Response:%*.*s", (int)responseContentBuffer.bufferSize,
-                                                            (int)responseContentBuffer.bufferSize, responseContentBuffer.buffer);
-                                                    }
-                                                    else
-                                                    {
-                                                        result = HTTPAPI_OK;
-                                                    }
-                                                }
-                                            }
-                                        }
-
-                                        if (responseContentBuffer.buffer != NULL)
-                                        {
-                                            free(responseContentBuffer.buffer);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    curl_slist_free_all(headers);
-                }
-            }
-            free(tempHostURL);
-        }
-    }
-
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_SetOption(HTTP_HANDLE handle, const char* optionName, const void* value)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (handle == NULL) ||
-        (optionName == NULL) ||
-        (value == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid parameter (NULL) passed to HTTPAPI_SetOption");
-    }
-    else
-    {
-        HTTP_HANDLE_DATA* httpHandleData = (HTTP_HANDLE_DATA*)handle;
-        if (strcmp(OPTION_HTTP_TIMEOUT, optionName) == 0)
-        {
-            long timeout = (long)(*(unsigned int*)value);
-            httpHandleData->timeout = timeout;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_CURL_LOW_SPEED_LIMIT, optionName) == 0)
-        {
-            httpHandleData->lowSpeedLimit = *(const long*)value;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_CURL_LOW_SPEED_TIME, optionName) == 0)
-        {
-            httpHandleData->lowSpeedTime = *(const long*)value;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_CURL_FRESH_CONNECT, optionName) == 0)
-        {
-            httpHandleData->freshConnect = *(const long*)value;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_CURL_FORBID_REUSE, optionName) == 0)
-        {
-            httpHandleData->forbidReuse = *(const long*)value;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_CURL_VERBOSE, optionName) == 0)
-        {
-            httpHandleData->verbose = *(const long*)value;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(SU_OPTION_X509_PRIVATE_KEY, optionName) == 0 || strcmp(OPTION_X509_ECC_KEY, optionName) == 0)
-        {
-            httpHandleData->x509privatekey = value;
-            if (httpHandleData->x509certificate != NULL)
-            {
-                if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_FUNCTION, ssl_ctx_callback) != CURLE_OK)
-                {
-                    LogError("unable to curl_easy_setopt");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_DATA, httpHandleData) != CURLE_OK)
-                    {
-                        LogError("unable to curl_easy_setopt");
-                        result = HTTPAPI_ERROR;
-                    }
-                    else
-                    {
-                        result = HTTPAPI_OK;
-                    }
-                }
-            }
-            else
-            {
-                /*if privatekey comes 1st and certificate is not set yet, then return OK and wait for the certificate to be set*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_CERT, optionName) == 0 || strcmp(OPTION_X509_ECC_CERT, optionName) == 0)
-        {
-            httpHandleData->x509certificate = value;
-            if (httpHandleData->x509privatekey != NULL)
-            {
-                if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_FUNCTION, ssl_ctx_callback) != CURLE_OK)
-                {
-                    LogError("unable to curl_easy_setopt");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_DATA, httpHandleData) != CURLE_OK)
-                    {
-                        LogError("unable to curl_easy_setopt");
-                        result = HTTPAPI_ERROR;
-                    }
-                    else
-                    {
-                        result = HTTPAPI_OK;
-                    }
-                }
-            }
-            else
-            {
-                /*if certificate comes 1st and private key is not set yet, then return OK and wait for the private key to be set*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(OPTION_HTTP_PROXY, optionName) == 0)
-        {
-            char proxy[MAX_HOSTNAME_LEN];
-            char* proxy_auth;
-
-            HTTP_PROXY_OPTIONS* proxy_data = (HTTP_PROXY_OPTIONS*)value;
-
-            if (sprintf_s(proxy, MAX_HOSTNAME_LEN, "%s:%d", proxy_data->host_address, proxy_data->port) <= 0)
-            {
-                LogError("failure constructing proxy address");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                if (curl_easy_setopt(httpHandleData->curl, CURLOPT_PROXY, proxy) != CURLE_OK)
-                {
-                    LogError("failure setting curl proxy address");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    if (proxy_data->username != NULL && proxy_data->password != NULL)
-                    {
-                        size_t authLen = strlen(proxy_data->username)+strlen(proxy_data->password)+1;
-                        proxy_auth = malloc(authLen+1);
-                        if (proxy_auth == NULL)
-                        {
-                            LogError("failure allocating proxy authentication");
-                            result = HTTPAPI_ERROR;
-                        }
-                        else
-                        {
-                            // From curl website 'Pass a char * as parameter, which should be [user name]:[password]'
-                            if (sprintf_s(proxy_auth, MAX_HOSTNAME_LEN, "%s:%s", proxy_data->username, proxy_data->password) <= 0)
-                            {
-                                LogError("failure constructing proxy authentication");
-                                result = HTTPAPI_ERROR;
-                            }
-                            else
-                            {
-                                if (curl_easy_setopt(httpHandleData->curl, CURLOPT_PROXYUSERPWD, proxy_auth) != CURLE_OK)
-                                {
-                                    LogError("failure setting curl proxy authentication");
-                                    result = HTTPAPI_ERROR;
-                                }
-                                else
-                                {
-                                    result = HTTPAPI_OK;
-                                }
-                            }
-                            free(proxy_auth);
-                        }
-                    }
-                    else
-                    {
-                        result = HTTPAPI_OK;
-                    }
-                }
-            }
-        }
-        else if (strcmp("TrustedCerts", optionName) == 0)
-        {
-            /*TrustedCerts needs to trigger the CURLOPT_SSL_CTX_FUNCTION in curl so we can pass the CAs*/
-            if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_FUNCTION, ssl_ctx_callback) != CURLE_OK)
-            {
-                LogError("failure in curl_easy_setopt - CURLOPT_SSL_CTX_FUNCTION");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                if (curl_easy_setopt(httpHandleData->curl, CURLOPT_SSL_CTX_DATA, httpHandleData) != CURLE_OK)
-                {
-                    LogError("failure in curl_easy_setopt - CURLOPT_SSL_CTX_DATA");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    httpHandleData->certificates = (const char*)value;
-                    result = HTTPAPI_OK;
-                }
-            }
-        }
-        else
-        {
-            result = HTTPAPI_INVALID_ARG;
-            LogError("unknown option %s", optionName);
-        }
-    }
-
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_CloneOption(const char* optionName, const void* value, const void** savedValue)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (optionName == NULL) ||
-        (value == NULL) ||
-        (savedValue == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid argument(NULL) passed to HTTPAPI_CloneOption");
-    }
-    else
-    {
-        if (strcmp(OPTION_HTTP_TIMEOUT, optionName) == 0)
-        {
-            /*by convention value is pointing to an unsigned int */
-            unsigned int* temp = malloc(sizeof(unsigned int)); /*shall be freed by HTTPAPIEX*/
-            if (temp == NULL)
-            {
-                result = HTTPAPI_ERROR;
-                LogError("malloc failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else
-            {
-                *temp = *(const unsigned int*)value;
-                *savedValue = temp;
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_CERT, optionName) == 0 || strcmp(OPTION_X509_ECC_CERT, optionName) == 0)
-        {
-            /*this is getting the x509 certificate. In this case, value is a pointer to a const char* that contains the certificate as a null terminated string*/
-            if (mallocAndStrcpy_s((char**)savedValue, value) != 0)
-            {
-                LogError("unable to clone the x509 certificate content");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                /*return OK when the certificate has been clones successfully*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_PRIVATE_KEY, optionName) == 0 || strcmp(OPTION_X509_ECC_KEY, optionName) == 0)
-        {
-            /*this is getting the x509 private key. In this case, value is a pointer to a const char* that contains the private key as a null terminated string*/
-            if (mallocAndStrcpy_s((char**)savedValue, value) != 0)
-            {
-                LogError("unable to clone the x509 private key content");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                /*return OK when the private key has been clones successfully*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp("TrustedCerts", optionName) == 0)
-        {
-            if (mallocAndStrcpy_s((char**)savedValue, value) != 0)
-            {
-                LogError("unable to clone TrustedCerts");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                /*return OK when the certificates have been clones successfully*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(OPTION_HTTP_PROXY, optionName) == 0)
-        {
-            HTTP_PROXY_OPTIONS* proxy_data = (HTTP_PROXY_OPTIONS*)value;
-
-            HTTP_PROXY_OPTIONS* new_proxy_info = malloc(sizeof(HTTP_PROXY_OPTIONS));
-            if (new_proxy_info == NULL)
-            {
-                LogError("unable to allocate proxy option information");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                new_proxy_info->host_address = proxy_data->host_address;
-                new_proxy_info->port = proxy_data->port;
-                new_proxy_info->password = proxy_data->password;
-                new_proxy_info->username = proxy_data->username;
-                *savedValue = new_proxy_info;
-                result = HTTPAPI_OK;
-            }
-        }
-        /*all "long" options are cloned in the same way*/
-        else if (
-            (strcmp(OPTION_CURL_LOW_SPEED_LIMIT, optionName) == 0) ||
-            (strcmp(OPTION_CURL_LOW_SPEED_TIME, optionName) == 0) ||
-            (strcmp(OPTION_CURL_FRESH_CONNECT, optionName) == 0) ||
-            (strcmp(OPTION_CURL_FORBID_REUSE, optionName) == 0) ||
-            (strcmp(OPTION_CURL_VERBOSE, optionName) == 0)
-            )
-        {
-            /*by convention value is pointing to an long */
-            long* temp = malloc(sizeof(long)); /*shall be freed by HTTPAPIEX*/
-            if (temp == NULL)
-            {
-                result = HTTPAPI_ERROR;
-                LogError("malloc failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else
-            {
-                *temp = *(const long*)value;
-                *savedValue = temp;
-                result = HTTPAPI_OK;
-            }
-        }
-        else
-        {
-            result = HTTPAPI_INVALID_ARG;
-            LogError("unknown option %s", optionName);
-        }
-    }
-    return result;
-}

+ 0 - 298
azure/c-utility/adapters/httpapi_tirtos.c

@@ -1,298 +0,0 @@
-// Copyright (c) Texas Instruments. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <ti/net/http/httpcli.h>
-
-#include "azure_c_shared_utility/httpapi.h"
-#include "azure_c_shared_utility/strings.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-#define CONTENT_BUF_LEN     128
-
-static const char* getHttpMethod(HTTPAPI_REQUEST_TYPE requestType)
-{
-    switch (requestType) {
-        case HTTPAPI_REQUEST_GET:
-            return (HTTPStd_GET);
-        case HTTPAPI_REQUEST_POST:
-            return (HTTPStd_POST);
-        case HTTPAPI_REQUEST_PUT:
-            return (HTTPStd_PUT);
-        case HTTPAPI_REQUEST_DELETE:
-            return (HTTPStd_DELETE);
-        case HTTPAPI_REQUEST_PATCH:
-            return (HTTPStd_PATCH);
-        default:
-            return (NULL);
-    }
-}
-
-static int splitHeader(char *headerName, char **headerValue)
-{
-    *headerValue = strchr(headerName, ':');
-    if (*headerValue == NULL) {
-         return (-1);
-    }
-
-    **headerValue = '\0';
-    (*headerValue)++;
-    while (**headerValue == ' ') {
-        (*headerValue)++;
-    }
-
-    return (0);
-}
-
-HTTPAPI_RESULT HTTPAPI_Init(void)
-{
-    return (HTTPAPI_OK);
-}
-
-void HTTPAPI_Deinit(void)
-{
-}
-
-HTTP_HANDLE HTTPAPI_CreateConnection(const char* hostName)
-{
-    int ret;
-    struct sockaddr addr;
-    HTTPCli_Handle cli;
-
-    ret = HTTPCli_initSockAddr(&addr, hostName, 0);
-    if (ret < 0) {
-		LogError("HTTPCli_initSockAddr failed, ret=%d", ret);
-        return (NULL);
-    }
-    ((struct sockaddr_in *) (&addr))->sin_port = htons(HTTPStd_SECURE_PORT);
-
-    cli = HTTPCli_create();
-    if (cli == NULL) {
-		LogError("HTTPCli_create failed");
-        return (NULL);
-    }
-
-    ret = HTTPCli_connect(cli, &addr, HTTPCli_TYPE_TLS, NULL);
-    if (ret < 0) {
-		LogError("HTTPCli_connect failed, ret=%d", ret);
-        HTTPCli_delete(&cli);
-        return (NULL);
-    }
-     
-    return ((HTTP_HANDLE) cli);
-}
-
-void HTTPAPI_CloseConnection(HTTP_HANDLE handle)
-{
-    HTTPCli_Handle cli = (HTTPCli_Handle) handle;
-
-    if (cli) {
-        HTTPCli_disconnect(cli);
-        HTTPCli_delete(&cli);
-    }
-}
-
-HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, 
-        HTTPAPI_REQUEST_TYPE requestType, const char* relativePath,
-        HTTP_HEADERS_HANDLE httpHeadersHandle, const unsigned char* content,
-        size_t contentLength, unsigned int* statusCode,
-        HTTP_HEADERS_HANDLE responseHeadersHandle,
-        BUFFER_HANDLE responseContent)
-{
-    HTTPCli_Handle cli = (HTTPCli_Handle) handle;
-    int ret;
-    int offset;
-    size_t cnt;
-    char contentBuf[CONTENT_BUF_LEN] = {0};
-    char *hname;
-    char *hvalue;
-    const char *method;
-    bool moreFlag;
-
-    method = getHttpMethod(requestType);
-
-    if ((cli == NULL) || (method == NULL) || (relativePath == NULL)
-            || (statusCode == NULL) || (responseHeadersHandle == NULL)) {
-		LogError("Invalid arguments: handle=%p, requestType=%d, relativePath=%p, statusCode=%p, responseHeadersHandle=%p",
-			handle, (int)requestType, relativePath, statusCode, responseHeadersHandle);
-        return (HTTPAPI_INVALID_ARG);
-    }
-    else if (HTTPHeaders_GetHeaderCount(httpHeadersHandle, &cnt) 
-            != HTTP_HEADERS_OK) {
-		LogError("Cannot get header count");
-		return (HTTPAPI_QUERY_HEADERS_FAILED);
-    }
-
-    /* Send the request line */
-    ret = HTTPCli_sendRequest(cli, method, relativePath, true);
-    if (ret < 0) {
-		LogError("HTTPCli_sendRequest failed, ret=%d", ret);
-        return (HTTPAPI_SEND_REQUEST_FAILED);
-    }
-
-    /* Send the request headers */
-    while (cnt--) {
-        ret = HTTPHeaders_GetHeader(httpHeadersHandle, cnt, &hname);
-        if (ret != HTTP_HEADERS_OK) {
-			LogError("Cannot get request header %d", cnt);
-            return (HTTPAPI_QUERY_HEADERS_FAILED);
-        }
-
-        ret = splitHeader(hname, &hvalue);
-
-        if (ret == 0) {
-            ret = HTTPCli_sendField(cli, hname, hvalue, false);
-        }
-
-        free(hname);
-        hname = NULL;
-
-        if (ret < 0) {
-			LogError("HTTP send field failed, ret=%d", ret);
-			return (HTTPAPI_SEND_REQUEST_FAILED);
-        }
-    }
-
-    /* Send the last header and request body */
-    ret = HTTPCli_sendField(cli, NULL, NULL, true);
-    if (ret < 0) {
-		LogError("HTTP send empty field failed, ret=%d", ret);
-        return (HTTPAPI_SEND_REQUEST_FAILED);
-    }
-
-    if (content && contentLength != 0) {
-        ret = HTTPCli_sendRequestBody(cli, (const char *)content,
-                contentLength);
-        if (ret < 0) {
-			LogError("HTTP send request body failed, ret=%d", ret);
-            return (HTTPAPI_SEND_REQUEST_FAILED);
-        }
-    }
-
-    /* Get the response status code */
-    ret = HTTPCli_getResponseStatus(cli);
-    if (ret < 0) {
-		LogError("HTTP receive response failed, ret=%d", ret);
-        return (HTTPAPI_RECEIVE_RESPONSE_FAILED);
-    }
-    *statusCode = (unsigned int)ret;
-
-    /* Get the response headers */
-    hname = NULL;
-    cnt = 0;
-    offset = 0;
-    do {
-        ret = HTTPCli_readResponseHeader(cli, contentBuf, CONTENT_BUF_LEN,
-            &moreFlag);
-        if (ret < 0) {
-			LogError("HTTP read response header failed, ret=%d", ret);
-            ret = HTTPAPI_RECEIVE_RESPONSE_FAILED;
-            goto headersDone;
-        }
-        else if (ret == 0) {
-            /* All headers read */
-            goto headersDone;
-        }
-
-        if (cnt < offset + ret) {
-            hname = (char *)realloc(hname, offset + ret);
-            if (hname == NULL) {
-				LogError("Failed reallocating memory");
-                ret = HTTPAPI_ALLOC_FAILED;
-                goto headersDone;
-            }
-            cnt = offset + ret;
-        }
-      
-        memcpy(hname + offset, contentBuf, ret);
-        offset += ret;
-
-        if (moreFlag) {
-            continue;
-        }
-
-        ret = splitHeader(hname, &hvalue);
-        if (ret < 0) {
-			LogError("HTTP split header failed, ret=%d", ret);
-            ret = HTTPAPI_HTTP_HEADERS_FAILED;
-            goto headersDone;
-        }
-
-        ret = HTTPHeaders_AddHeaderNameValuePair(responseHeadersHandle,
-                hname, hvalue);
-        if (ret != HTTP_HEADERS_OK) {
-			LogError("Adding the response header failed");
-            ret = HTTPAPI_HTTP_HEADERS_FAILED;
-            goto headersDone;
-        }
-        offset = 0;
-    } while (1);
-
-headersDone:
-    free(hname);
-    hname = NULL;
-    if (ret != 0) {
-        return ((HTTPAPI_RESULT)ret);
-    }
-
-    /* Get response body */
-    if (responseContent != NULL) {
-        offset = 0;
-        cnt = 0;
-
-        do {
-            ret = HTTPCli_readResponseBody(cli, contentBuf, CONTENT_BUF_LEN,
-                    &moreFlag);
-
-            if (ret < 0) {
-				LogError("HTTP read response body failed, ret=%d", ret);
-                ret = HTTPAPI_RECEIVE_RESPONSE_FAILED;
-                goto contentDone;
-            }
-             
-            if (ret != 0) {
-                cnt = ret;
-                ret = BUFFER_enlarge(responseContent, cnt); 
-                if (ret != 0) {
-					LogError("Failed enlarging response buffer");
-                    ret = HTTPAPI_ALLOC_FAILED;
-                    goto contentDone;
-                }
-
-                ret = BUFFER_content(responseContent,
-                        (const unsigned char **)&hname);
-                if (ret != 0) {
-					LogError("Failed getting the response buffer content");
-                    ret = HTTPAPI_ALLOC_FAILED;
-                    goto contentDone;
-                }
-
-                memcpy(hname + offset, contentBuf, cnt);
-                offset += cnt;
-            }
-        } while (moreFlag);
-
-    contentDone:
-        if (ret < 0) {
-            BUFFER_unbuild(responseContent);
-            return ((HTTPAPI_RESULT)ret);
-        }
-    }
-
-    return (HTTPAPI_OK);
-}
-
-HTTPAPI_RESULT HTTPAPI_SetOption(HTTP_HANDLE handle, const char* optionName,
-        const void* value)
-{
-    return (HTTPAPI_INVALID_ARG);
-}
-
-HTTPAPI_RESULT HTTPAPI_CloneOption(const char* optionName, const void* value,
-        const void** savedValue)
-{
-    return (HTTPAPI_INVALID_ARG);
-}

+ 0 - 639
azure/c-utility/adapters/httpapi_wince.c

@@ -1,639 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/httpapi.h"
-#include "azure_c_shared_utility/httpheaders.h"
-#include "azure_c_shared_utility/crt_abstractions.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "winsock2.h"
-#include "sslsock.h"
-#include "schnlsp.h"
-
-
-#define MAX_HOSTNAME     64
-#define TEMPORARY_BUFFER_SIZE 4096
-
-#define CHAR_COUNT(A)   (sizeof(A) - 1)
-
-DEFINE_ENUM_STRINGS(HTTPAPI_RESULT, HTTPAPI_RESULT_VALUES)
-
-// data structure that contains all the information required to manage a connection
-class HTTP_HANDLE_DATA
-{
-public:
-    char   host[MAX_HOSTNAME];
-    SOCKET _sock_fd;
-    struct sockaddr_in _remoteHost;
-};
-
-// If Root CA is not found in CA database, dwFlags will be set to SSL_CERT_FLAG_ISSUER_UNKNOWN (value 1). In that case return SSL_ERR_CERT_UNKNOWN (value 10)
-int CALLBACK SSLValidateCertHook(DWORD  dwType, LPVOID pvArg,
-    DWORD  dwChainLen, LPBLOB pCertChain, DWORD dwFlags)
-{
-	DWORD dwRetValue = SSL_ERR_OKAY; // SSL_ERR_OKAY : The certificate is acceptable
-	if (dwFlags)
-		dwRetValue = SSL_ERR_CERT_UNKNOWN; // Issuer is unknown
-
-	return dwRetValue;
-
-}
-
-// Initializes SSL layer, called only once on initialization
-int SSLInit(SOCKET s)
-{
-    DWORD optval = SO_SEC_SSL;
-    SSLVALIDATECERTHOOK hook;
-    SSLPROTOCOLS protocolsToUse;
-    int ret;
-	
-    
-    if (setsockopt(s, SOL_SOCKET, SO_SECURE, (LPSTR)&optval, sizeof(optval)) ==
-        SOCKET_ERROR)
-    {
-        goto SSLInit_Error;
-    }
-
-    hook.HookFunc = SSLValidateCertHook;
-    hook.pvArg = NULL; //WSAIoctl cannot handle the pointer copy, use a global variable
-
-    if (WSAIoctl(s, SO_SSL_SET_VALIDATE_CERT_HOOK,
-        &hook, sizeof(SSLVALIDATECERTHOOK),
-        NULL, 0, NULL, NULL, NULL) == SOCKET_ERROR)
-    {
-        goto SSLInit_Error;
-    }
-
-    //specify TLS1 protocol
-
-    protocolsToUse.dwCount = 1;
-    protocolsToUse.ProtocolList[0].dwFlags = 0;
-    protocolsToUse.ProtocolList[0].dwProtocol = SSL_PROTOCOL_TLS1;
-    protocolsToUse.ProtocolList[0].dwVersion = 0;
-
-    if (WSAIoctl(s, SO_SSL_SET_PROTOCOLS,
-        (LPVOID)&protocolsToUse, sizeof(protocolsToUse),
-        NULL, 0, NULL, NULL, NULL) == SOCKET_ERROR)
-    {
-        goto SSLInit_Error;
-    }
-
-    return 0;
-
-SSLInit_Error:
-
-    ret = WSAGetLastError();
-    return ret;
-}
-
-HTTPAPI_RESULT HTTPAPI_Init(void)
-{
-    WORD wVersionRequested;
-    WSADATA wsaData;
-    int err;
-
-    LogInfo("HTTPAPI_Init::Start");
-    time_t ctTime;
-    ctTime = time(NULL);
-
-    LogInfo("HTTAPI_Init::Time is now (UTC) %s", ctime(&ctTime));
-
-    wVersionRequested = MAKEWORD(2, 2);
-
-    err = WSAStartup(wVersionRequested, &wsaData);
-    if (err != 0) {
-        return HTTPAPI_INIT_FAILED;
-    }
-
-    if (LOBYTE(wsaData.wVersion) != 2 ||
-        HIBYTE(wsaData.wVersion) != 2) {
-        WSACleanup();
-        return HTTPAPI_INIT_FAILED;
-    }
-
-
-    LogInfo("HTTPAPI_Init::End");
-    return HTTPAPI_OK;
-}
-
-void HTTPAPI_Deinit(void)
-{
-    WSACleanup();
-}
-
-HTTP_HANDLE HTTPAPI_CreateConnection(const char* hostName)
-{
-    LogInfo("HTTPAPI_CreateConnection::Start");
-    HTTP_HANDLE_DATA* handle = NULL;
-
-    if (hostName)
-    {
-        LogInfo("HTTPAPI_CreateConnection::Connecting to %s", hostName);
-        handle = new HTTP_HANDLE_DATA();
-        if (strcpy_s(handle->host, MAX_HOSTNAME, hostName) != 0)
-        {
-            LogError("HTTPAPI_CreateConnection::Could not strcpy_s");
-            delete handle;
-            handle = NULL;
-        }
-        else
-        {
-            handle->_sock_fd = -1;
-        }
-    }
-    else
-    {
-        LogInfo("HTTPAPI_CreateConnection:: null hostName parameter");
-    }
-    LogInfo("HTTPAPI_CreateConnection::End");
-
-    return (HTTP_HANDLE)handle;
-}
-
-void HTTPAPI_CloseConnection(HTTP_HANDLE handle)
-{
-    HTTP_HANDLE_DATA* h = (HTTP_HANDLE_DATA*)handle;
-
-    if (h)
-    {
-        LogInfo("HTTPAPI_CloseConnection to %s", h->host);
-        if (h->_sock_fd != -1)
-        {
-            LogInfo("HTTPAPI_CloseConnection to %s", h->host);
-            closesocket(h->_sock_fd);
-            h->_sock_fd = -1;
-        }
-        LogInfo("HTTPAPI_CloseConnection (delete h) to %s", h->host);
-        delete h;
-    }
-}
-
-static int readLine(SOCKET _sock_fd, char* buf, const size_t size)
-{
-    // reads until \r\n is encountered. writes in buf all the characters
-    // read until \r\n and returns the number of characters in the buffer.
-    char* p = buf;
-    char  c;
-    if (recv(_sock_fd, &c, 1, 0) < 0)
-        return -1;
-    while (c != '\r') {
-        if ((p - buf + 1) >= (int)size)
-            return -1;
-        *p++ = c;
-        if (recv(_sock_fd, &c, 1, 0) < 0)
-            return -1;
-    }
-    *p = 0;
-    if (recv(_sock_fd, &c, 1, 0) < 0 || c != '\n') // skip \n
-        return -1;
-    return p - buf;
-}
-
-static int readChunk(SOCKET _sock_fd, char* buf, size_t size)
-{
-    size_t cur, offset;
-
-    // read content with specified length, even if it is received
-    // only in chunks due to fragmentation in the networking layer.
-    // returns -1 in case of error.
-    offset = 0;
-    while (size > 0)
-    {
-        cur = recv(_sock_fd, buf + offset, size, 0);
-
-        // end of stream reached
-        if (cur == 0)
-            return offset;
-
-        // read cur bytes (might be less than requested)
-        size -= cur;
-        offset += cur;
-    }
-
-    return offset;
-}
-
-static int skipN(SOCKET _sock_fd, size_t n, char* buf, size_t size)
-{
-    size_t org = n;
-    // read and abandon response content with specified length
-    // returns -1 in case of error.
-    while (n > size)
-    {
-        if (readChunk(_sock_fd, (char*)buf, size) < 0)
-            return -1;
-
-        n -= size;
-    }
-
-    if (readChunk(_sock_fd, (char*)buf, n) < 0)
-        return -1;
-
-    return org;
-}
-
-//Note: This function assumes that "Host:" and "Content-Length:" headers are setup
-//      by the caller of HTTPAPI_ExecuteRequest() (which is true for httptransport.c).
-HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, HTTPAPI_REQUEST_TYPE requestType, const char* relativePath,
-    HTTP_HEADERS_HANDLE httpHeadersHandle, const unsigned char* content,
-    size_t contentLength, unsigned int* statusCode,
-    HTTP_HEADERS_HANDLE responseHeadersHandle, BUFFER_HANDLE responseContent)
-{
-    LogInfo("HTTPAPI_ExecuteRequest::Start");
-
-    HTTPAPI_RESULT result;
-    size_t  headersCount;
-	char    buf[TEMPORARY_BUFFER_SIZE];
-    int     ret;
-    size_t  bodyLength = 0;
-    bool    chunked = false;
-    const unsigned char* receivedContent;
-
-    const char* method = (requestType == HTTPAPI_REQUEST_GET) ? "GET"
-        : (requestType == HTTPAPI_REQUEST_POST) ? "POST"
-        : (requestType == HTTPAPI_REQUEST_PUT) ? "PUT"
-        : (requestType == HTTPAPI_REQUEST_DELETE) ? "DELETE"
-        : (requestType == HTTPAPI_REQUEST_PATCH) ? "PATCH"
-        : NULL;
-
-    if (handle == NULL ||
-        relativePath == NULL ||
-        httpHeadersHandle == NULL ||
-        method == NULL ||
-        HTTPHeaders_GetHeaderCount(httpHeadersHandle, &headersCount) != HTTP_HEADERS_OK)
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-
-    HTTP_HANDLE_DATA* httpHandle = (HTTP_HANDLE_DATA*)handle;
-
-    if (httpHandle->_sock_fd == -1)
-    {
-        // Make the connection
-        if ((httpHandle->_sock_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
-        {
-            LogError("init_socket failed");
-            result = HTTPAPI_INIT_FAILED;
-            goto exit;
-        }
-        else
-        {
-            // IP Address
-            char address[5];
-            char *p_address = address;
-
-            memset(&httpHandle->_remoteHost, 0, sizeof(struct sockaddr_in));
-
-            // Dot-decimal notation
-            int result = sscanf(httpHandle->host, "%3u.%3u.%3u.%3u",
-                (unsigned int*)&address[0], (unsigned int*)&address[1],
-                (unsigned int*)&address[2], (unsigned int*)&address[3]);
-
-            if (result != 4) {
-                // Resolve address with DNS
-                struct hostent *host_address = gethostbyname(httpHandle->host);
-                if (host_address == NULL)
-                {
-                    LogError("set_address failed");
-                    result = HTTPAPI_INVALID_ARG;
-                    goto exit;
-                }
-                p_address = (char*)host_address->h_addr_list[0];
-            }
-
-            memcpy((char*)&httpHandle->_remoteHost.sin_addr.s_addr, p_address, 4);
-
-            // Address family
-            httpHandle->_remoteHost.sin_family = AF_INET;
-
-            // Set port
-            httpHandle->_remoteHost.sin_port = htons(443);
-
-            if (SSLInit(httpHandle->_sock_fd))
-            {
-                LogError("SSLInit failed");
-                result = HTTPAPI_ERROR;
-                goto exit;
-            }
-
-            if (connect(httpHandle->_sock_fd, (const struct sockaddr *) &httpHandle->_remoteHost, sizeof(httpHandle->_remoteHost)) < 0)
-            {
-                closesocket(httpHandle->_sock_fd);
-                httpHandle->_sock_fd = -1;
-                LogError("connect failed");
-                result = HTTPAPI_ERROR;
-                goto exit;
-            }
-        }
-    }
-
-    //Send request
-    if ((ret = _snprintf(buf, sizeof(buf), "%s %s HTTP/1.1\r\n", method, relativePath)) < 0
-        || ret >= sizeof(buf))
-    {
-        result = HTTPAPI_STRING_PROCESSING_ERROR;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-    LogInfo("HTTPAPI_ExecuteRequest::Sending=%*.*s", strlen(buf), strlen(buf), buf);
-    if (send(httpHandle->_sock_fd, buf, strlen(buf), 0) < 0)
-    {
-        result = HTTPAPI_SEND_REQUEST_FAILED;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-
-    //Send default headers
-    for (size_t i = 0; i < headersCount; i++)
-    {
-        char* header;
-        if (HTTPHeaders_GetHeader(httpHeadersHandle, i, &header) != HTTP_HEADERS_OK)
-        {
-            result = HTTPAPI_HTTP_HEADERS_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            goto exit;
-        }
-        LogInfo("HTTPAPI_ExecuteRequest::Sending=%*.*s", strlen(header), strlen(header), header);
-        if (send(httpHandle->_sock_fd, header, strlen(header), 0) < 0)
-        {
-            result = HTTPAPI_SEND_REQUEST_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            free(header);
-            goto exit;
-        }
-        if (send(httpHandle->_sock_fd, "\r\n", 2, 0) < 0)
-        {
-            result = HTTPAPI_SEND_REQUEST_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            free(header);
-            goto exit;
-        }
-        free(header);
-    }
-
-    //Close headers
-    if (send(httpHandle->_sock_fd, "\r\n", 2, 0) < 0)
-    {
-        result = HTTPAPI_SEND_REQUEST_FAILED;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-
-    //Send data (if available)
-    if (content && contentLength > 0)
-    {
-        LogInfo("HTTPAPI_ExecuteRequest::Sending data=%*.*s", contentLength, contentLength, content);
-        if (send(httpHandle->_sock_fd, (char*)content, contentLength, 0) < 0)
-        {
-            result = HTTPAPI_SEND_REQUEST_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            goto exit;
-        }
-    }
-
-    //Receive response
-    if (readLine(httpHandle->_sock_fd, buf, sizeof(buf)) < 0)
-    {
-        result = HTTPAPI_READ_DATA_FAILED;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-
-    //Parse HTTP response
-    if (sscanf(buf, "HTTP/%*d.%*d %d %*[^\r\n]", &ret) != 1)
-    {
-        //Cannot match string, error
-        LogInfo("HTTPAPI_ExecuteRequest::Not a correct HTTP answer=%s", buf);
-        result = HTTPAPI_READ_DATA_FAILED;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-    if (statusCode)
-        *statusCode = ret;
-    LogInfo("HTTPAPI_ExecuteRequest::Received response=%*.*s", strlen(buf), strlen(buf), buf);
-
-    //Read HTTP response headers
-    if (readLine(httpHandle->_sock_fd, buf, sizeof(buf)) < 0)
-    {
-        result = HTTPAPI_READ_DATA_FAILED;
-        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        goto exit;
-    }
-
-    while (buf[0])
-    {
-        const char ContentLength[] = "content-length:";
-        const char TransferEncoding[] = "transfer-encoding:";
-
-        LogInfo("Receiving header=%*.*s", strlen(buf), strlen(buf), buf);
-
-        if (_strnicmp(buf, ContentLength, CHAR_COUNT(ContentLength)) == 0)
-        {
-            if (sscanf(buf + CHAR_COUNT(ContentLength), " %d", &bodyLength) != 1)
-            {
-                result = HTTPAPI_READ_DATA_FAILED;
-                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                goto exit;
-            }
-        }
-        else if (_strnicmp(buf, TransferEncoding, CHAR_COUNT(TransferEncoding)) == 0)
-        {
-            const char* p = buf + CHAR_COUNT(TransferEncoding);
-            while (isspace(*p)) p++;
-            if (_stricmp(p, "chunked") == 0)
-                chunked = true;
-        }
-
-        char* whereIsColon = strchr((char*)buf, ':');
-        if (whereIsColon && responseHeadersHandle != NULL)
-        {
-            *whereIsColon = '\0';
-            HTTPHeaders_AddHeaderNameValuePair(responseHeadersHandle, buf, whereIsColon + 1);
-        }
-
-        if (readLine(httpHandle->_sock_fd, buf, sizeof(buf)) < 0)
-        {
-            result = HTTPAPI_READ_DATA_FAILED;
-            LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            goto exit;
-        }
-    }
-
-    //Read HTTP response body
-    LogInfo("HTTPAPI_ExecuteRequest::Receiving body=%d,%x", bodyLength, responseContent);
-    if (!chunked)
-    {
-        if (bodyLength)
-        {
-            if (responseContent != NULL)
-            {
-                if (BUFFER_pre_build(responseContent, bodyLength) != 0)
-                {
-                    result = HTTPAPI_ALLOC_FAILED;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                }
-                else if (BUFFER_content(responseContent, &receivedContent) != 0)
-                {
-                    (void)BUFFER_unbuild(responseContent);
-
-                    result = HTTPAPI_ALLOC_FAILED;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                }
-
-                if (readChunk(httpHandle->_sock_fd, (char*)receivedContent, bodyLength) < 0)
-                {
-                    result = HTTPAPI_READ_DATA_FAILED;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    goto exit;
-                }
-                else
-                {
-                    LogInfo("HTTPAPI_ExecuteRequest::Received response body=%*.*s", bodyLength, bodyLength, receivedContent);
-                    result = HTTPAPI_OK;
-                }
-            }
-            else
-            {
-                (void)skipN(httpHandle->_sock_fd, bodyLength, buf, sizeof(buf));
-                result = HTTPAPI_OK;
-            }
-        }
-        else
-        {
-            result = HTTPAPI_OK;
-        }
-    }
-    else
-    {
-        size_t size = 0;
-        result = HTTPAPI_OK;
-        for (;;)
-        {
-            int chunkSize;
-            if (readLine(httpHandle->_sock_fd, buf, sizeof(buf)) < 0)    // read [length in hex]/r/n
-            {
-                result = HTTPAPI_READ_DATA_FAILED;
-                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                goto exit;
-            }
-            if (sscanf(buf, "%x", &chunkSize) != 1)     // chunkSize is length of next line (/r/n is not counted)
-            {
-                //Cannot match string, error
-                result = HTTPAPI_RECEIVE_RESPONSE_FAILED;
-                LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                goto exit;
-            }
-
-            if (chunkSize == 0)
-            {
-                // 0 length means next line is just '\r\n' and end of chunks
-                if (readChunk(httpHandle->_sock_fd, (char*)buf, 2) < 0
-                    || buf[0] != '\r' || buf[1] != '\n') // skip /r/n
-                {
-                    (void)BUFFER_unbuild(responseContent);
-
-                    result = HTTPAPI_READ_DATA_FAILED;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    goto exit;
-                }
-                break;
-            }
-            else
-            {
-                if (responseContent != NULL)
-                {
-                    if (BUFFER_enlarge(responseContent, chunkSize) != 0)
-                    {
-                        (void)BUFFER_unbuild(responseContent);
-
-                        result = HTTPAPI_ALLOC_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else if (BUFFER_content(responseContent, &receivedContent) != 0)
-                    {
-                        (void)BUFFER_unbuild(responseContent);
-
-                        result = HTTPAPI_ALLOC_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-
-                    if (readChunk(httpHandle->_sock_fd, (char*)receivedContent + size, chunkSize) < 0)
-                    {
-                        result = HTTPAPI_READ_DATA_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        goto exit;
-                    }
-                }
-                else
-                {
-                    if (skipN(httpHandle->_sock_fd, chunkSize, buf, sizeof(buf)) < 0)
-                    {
-                        result = HTTPAPI_READ_DATA_FAILED;
-                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        goto exit;
-                    }
-                }
-
-                if (readChunk(httpHandle->_sock_fd, (char*)buf, 2) < 0
-                    || buf[0] != '\r' || buf[1] != '\n') // skip /r/n
-                {
-                    result = HTTPAPI_READ_DATA_FAILED;
-                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    goto exit;
-                }
-                size += chunkSize;
-            }
-        }
-
-        if (size > 0)
-        {
-            LogInfo("HTTPAPI_ExecuteRequest::Received chunk body=%*.*s", (int)size, (int)size, (const char*)responseContent);
-        }
-    }
-
-exit:
-    LogInfo("HTTPAPI_ExecuteRequest::End=%d", result);
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_SetOption(HTTP_HANDLE handle, const char* optionName, const void* value)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (handle == NULL) ||
-        (optionName == NULL) ||
-        (value == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid parameter (NULL) passed to HTTPAPI_SetOption");
-    }
-    else
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("unknown option %s", optionName);
-    }
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_CloneOption(const char* optionName, const void* value, const void** savedValue)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (optionName == NULL) ||
-        (value == NULL) ||
-        (savedValue == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid argument(NULL) passed to HTTPAPI_CloneOption");
-    }
-    else
-    {
-        *savedValue = NULL;
-        result = HTTPAPI_INVALID_ARG;
-        LogError("unknown option %s", optionName);
-    }
-    return result;
-}

+ 0 - 1050
azure/c-utility/adapters/httpapi_winhttp.c

@@ -1,1050 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <string.h>
-#include "azure_c_shared_utility/gballoc.h"
-#include "azure_c_shared_utility/crt_abstractions.h"
-
-#include "windows.h"
-#include "winhttp.h"
-#include "azure_c_shared_utility/httpapi.h"
-#include "azure_c_shared_utility/httpheaders.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "azure_c_shared_utility/strings.h"
-#include "azure_c_shared_utility/x509_schannel.h"
-#include "azure_c_shared_utility/shared_util_options.h"
-
-DEFINE_ENUM_STRINGS(HTTPAPI_RESULT, HTTPAPI_RESULT_VALUES)
-
-typedef enum HTTPAPI_STATE_TAG
-{
-    HTTPAPI_NOT_INITIALIZED,
-    HTTPAPI_INITIALIZED
-} HTTPAPI_STATE;
-
-typedef struct HTTP_HANDLE_DATA_TAG
-{
-    /*working set*/
-    HINTERNET ConnectionHandle;
-    X509_SCHANNEL_HANDLE x509SchannelHandle;
-    /*options*/
-    unsigned int timeout;
-    const char* x509certificate;
-    const char* x509privatekey;
-    const char* proxy_host;
-    const char* proxy_username;
-    const char* proxy_password;
-} HTTP_HANDLE_DATA;
-
-static HTTPAPI_STATE g_HTTPAPIState = HTTPAPI_NOT_INITIALIZED;
-
-/*There's a global SessionHandle for all the connections*/
-static HINTERNET g_SessionHandle;
-static size_t nUsersOfHTTPAPI = 0; /*used for reference counting (a weak one)*/
-
-/*returns NULL if it failed to construct the headers*/
-static const char* ConstructHeadersString(HTTP_HEADERS_HANDLE httpHeadersHandle)
-{
-    char* result;
-    size_t headersCount;
-
-    if (HTTPHeaders_GetHeaderCount(httpHeadersHandle, &headersCount) != HTTP_HEADERS_OK)
-    {
-        result = NULL;
-        LogError("HTTPHeaders_GetHeaderCount failed.");
-    }
-    else
-    {
-        size_t i;
-
-        /*the total size of all the headers is given by sumof(lengthof(everyheader)+2)*/
-        size_t toAlloc = 0;
-        for (i = 0; i < headersCount; i++)
-        {
-            char *temp;
-            if (HTTPHeaders_GetHeader(httpHeadersHandle, i, &temp) == HTTP_HEADERS_OK)
-            {
-                toAlloc += strlen(temp);
-                toAlloc += 2;
-                free(temp);
-            }
-            else
-            {
-                LogError("HTTPHeaders_GetHeader failed");
-                break;
-            }
-        }
-
-        if (i < headersCount)
-        {
-            result = NULL;
-        }
-        else
-        {
-            result = (char*)malloc(toAlloc*sizeof(char) + 1 );
-
-            if (result == NULL)
-            {
-                LogError("unable to malloc");
-                /*let it be returned*/
-            }
-            else
-            {
-                result[0] = '\0';
-                for (i = 0; i < headersCount; i++)
-                {
-                    char* temp;
-                    if (HTTPHeaders_GetHeader(httpHeadersHandle, i, &temp) != HTTP_HEADERS_OK)
-                    {
-                        LogError("unable to HTTPHeaders_GetHeader");
-                        break;
-                    }
-                    else
-                    {
-                        (void)strcat(result, temp);
-                        (void)strcat(result, "\r\n");
-                        free(temp);
-                    }
-                }
-
-                if (i < headersCount)
-                {
-                    free(result);
-                    result = NULL;
-                }
-                else
-                {
-                    /*all is good*/
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_Init(void)
-{
-    HTTPAPI_RESULT result;
-
-    if (nUsersOfHTTPAPI == 0)
-    {
-        if ((g_SessionHandle = WinHttpOpen(
-            NULL,
-            WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
-            WINHTTP_NO_PROXY_NAME,
-            WINHTTP_NO_PROXY_BYPASS,
-            0)) == NULL)
-        {
-            LogErrorWinHTTPWithGetLastErrorAsString("WinHttpOpen failed.");
-            result = HTTPAPI_INIT_FAILED;
-        }
-        else
-        {
-            nUsersOfHTTPAPI++;
-            g_HTTPAPIState = HTTPAPI_INITIALIZED;
-            result = HTTPAPI_OK;
-        }
-    }
-    else
-    {
-        nUsersOfHTTPAPI++;
-        result = HTTPAPI_OK;
-    }
-
-    return result;
-}
-
-void HTTPAPI_Deinit(void)
-{
-    if (nUsersOfHTTPAPI > 0)
-    {
-        nUsersOfHTTPAPI--;
-        if (nUsersOfHTTPAPI == 0)
-        {
-            if (g_SessionHandle != NULL)
-            {
-                (void)WinHttpCloseHandle(g_SessionHandle);
-                g_SessionHandle = NULL;
-                g_HTTPAPIState = HTTPAPI_NOT_INITIALIZED;
-            }
-        }
-    }
-
-
-}
-
-HTTP_HANDLE HTTPAPI_CreateConnection(const char* hostName)
-{
-    HTTP_HANDLE_DATA* result;
-    if (g_HTTPAPIState != HTTPAPI_INITIALIZED)
-    {
-        LogError("g_HTTPAPIState not HTTPAPI_INITIALIZED");
-        result = NULL;
-    }
-    else
-    {
-        result = (HTTP_HANDLE_DATA*)malloc(sizeof(HTTP_HANDLE_DATA));
-        if (result == NULL)
-        {
-            LogError("malloc returned NULL.");
-        }
-        else
-        {
-            wchar_t* hostNameTemp;
-            size_t hostNameTemp_size = MultiByteToWideChar(CP_ACP, 0, hostName, -1, NULL, 0);
-            if (hostNameTemp_size == 0)
-            {
-                LogError("MultiByteToWideChar failed");
-                free(result);
-                result = NULL;
-            }
-            else
-            {
-                hostNameTemp = (wchar_t*)malloc(sizeof(wchar_t)*hostNameTemp_size);
-                if (hostNameTemp == NULL)
-                {
-                    LogError("malloc failed");
-                    free(result);
-                    result = NULL;
-                }
-                else
-                {
-                    if (MultiByteToWideChar(CP_ACP, 0, hostName, -1, hostNameTemp, (int)hostNameTemp_size) == 0)
-                    {
-                        LogError("MultiByteToWideChar failed");
-                        free(result);
-                        result = NULL;
-                    }
-                    else
-                    {
-                        result->ConnectionHandle = WinHttpConnect(
-                            g_SessionHandle,
-                            hostNameTemp,
-                            INTERNET_DEFAULT_HTTPS_PORT,
-                            0);
-
-                        if (result->ConnectionHandle == NULL)
-                        {
-                            LogErrorWinHTTPWithGetLastErrorAsString("WinHttpConnect returned NULL.");
-                            free(result);
-                            result = NULL;
-                        }
-                        else
-                        {
-                            result->timeout = 60000;
-                            result->x509certificate = NULL;
-                            result->x509privatekey = NULL;
-                            result->x509SchannelHandle = NULL;
-                            result->proxy_host = NULL;
-                            result->proxy_username = NULL;
-                            result->proxy_password = NULL;
-                        }
-                    }
-                    free(hostNameTemp);
-                }
-            }
-        }
-    }
-
-    return (HTTP_HANDLE)result;
-}
-
-void HTTPAPI_CloseConnection(HTTP_HANDLE handle)
-{
-    if (g_HTTPAPIState != HTTPAPI_INITIALIZED)
-    {
-        LogError("g_HTTPAPIState not HTTPAPI_INITIALIZED");
-    }
-    else
-    {
-        HTTP_HANDLE_DATA* handleData = (HTTP_HANDLE_DATA*)handle;
-
-        if (handleData != NULL)
-        {
-            if (handleData->ConnectionHandle != NULL)
-            {
-                (void)WinHttpCloseHandle(handleData->ConnectionHandle);
-                /*no x509 free because the options are owned by httpapiex.*/
-                handleData->ConnectionHandle = NULL;
-            }
-            if (handleData->proxy_host != NULL)
-            {
-                free((void*)handleData->proxy_host);
-            }
-            if (handleData->proxy_username != NULL)
-            {
-                free((void*)handleData->proxy_username);
-            }
-            if (handleData->proxy_password != NULL)
-            {
-                free((void*)handleData->proxy_password);
-            }
-            x509_schannel_destroy(handleData->x509SchannelHandle);
-            free(handleData);
-        }
-    }
-}
-
-HTTPAPI_RESULT HTTPAPI_ExecuteRequest(HTTP_HANDLE handle, HTTPAPI_REQUEST_TYPE requestType, const char* relativePath,
-    HTTP_HEADERS_HANDLE httpHeadersHandle, const unsigned char* content,
-    size_t contentLength, unsigned int* statusCode,
-    HTTP_HEADERS_HANDLE responseHeadersHandle, BUFFER_HANDLE responseContent)
-{
-    HTTPAPI_RESULT result;
-    if (g_HTTPAPIState != HTTPAPI_INITIALIZED)
-    {
-        LogError("g_HTTPAPIState not HTTPAPI_INITIALIZED");
-        result = HTTPAPI_NOT_INIT;
-    }
-    else
-    {
-        HTTP_HANDLE_DATA* handleData = (HTTP_HANDLE_DATA*)handle;
-
-        if ((handleData == NULL) ||
-            (relativePath == NULL) ||
-            (httpHeadersHandle == NULL))
-        {
-            result = HTTPAPI_INVALID_ARG;
-            LogError("NULL parameter detected (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-        }
-        else
-        {
-            wchar_t* requestTypeString = NULL;
-
-            switch (requestType)
-            {
-            default:
-                break;
-
-            case HTTPAPI_REQUEST_GET:
-                requestTypeString = L"GET";
-                break;
-
-            case HTTPAPI_REQUEST_POST:
-                requestTypeString = L"POST";
-                break;
-
-            case HTTPAPI_REQUEST_PUT:
-                requestTypeString = L"PUT";
-                break;
-
-            case HTTPAPI_REQUEST_DELETE:
-                requestTypeString = L"DELETE";
-                break;
-
-            case HTTPAPI_REQUEST_PATCH:
-                requestTypeString = L"PATCH";
-                break;
-            }
-
-            if (requestTypeString == NULL)
-            {
-                result = HTTPAPI_INVALID_ARG;
-                LogError("requestTypeString was NULL (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else
-            {
-                const char* headers2;
-                headers2 = ConstructHeadersString(httpHeadersHandle);
-                if (headers2 != NULL)
-                {
-                    size_t requiredCharactersForRelativePath = MultiByteToWideChar(CP_ACP, 0, relativePath, -1, NULL, 0);
-                    wchar_t* relativePathTemp = (wchar_t*)malloc((requiredCharactersForRelativePath+1) * sizeof(wchar_t));
-                    result = HTTPAPI_OK; /*legacy code*/
-
-                    if (relativePathTemp == NULL)
-                    {
-                        result = HTTPAPI_ALLOC_FAILED;
-                        LogError("malloc failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                    }
-                    else
-                    {
-                        if (MultiByteToWideChar(CP_ACP, 0, relativePath, -1, relativePathTemp, (int)requiredCharactersForRelativePath) == 0)
-                        {
-                            result = HTTPAPI_STRING_PROCESSING_ERROR;
-                            LogError("MultiByteToWideChar was 0. (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                        }
-                        else
-                        {
-                            size_t requiredCharactersForHeaders = MultiByteToWideChar(CP_ACP, 0, headers2, -1, NULL, 0);
-
-                            wchar_t* headersTemp = (wchar_t*)malloc((requiredCharactersForHeaders +1) * sizeof(wchar_t) );
-                            if (headersTemp == NULL)
-                            {
-                                result = HTTPAPI_STRING_PROCESSING_ERROR;
-                                LogError("MultiByteToWideChar was 0. (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                            }
-                            else
-                            {
-                                if (MultiByteToWideChar(CP_ACP, 0, headers2, -1, headersTemp, (int)requiredCharactersForHeaders) == 0)
-                                {
-                                    result = HTTPAPI_STRING_PROCESSING_ERROR;
-                                    LogError("MultiByteToWideChar was 0(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                }
-                                else
-                                {
-                                    HINTERNET requestHandle = WinHttpOpenRequest(
-                                        handleData->ConnectionHandle,
-                                        requestTypeString,
-                                        relativePathTemp,
-                                        NULL,
-                                        WINHTTP_NO_REFERER,
-                                        WINHTTP_DEFAULT_ACCEPT_TYPES,
-                                        WINHTTP_FLAG_SECURE);
-                                    if (requestHandle == NULL)
-                                    {
-                                        result = HTTPAPI_OPEN_REQUEST_FAILED;
-                                        LogErrorWinHTTPWithGetLastErrorAsString("WinHttpOpenRequest failed (result = %s).", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                    }
-                                    else
-                                    {
-                                        if ((handleData->x509SchannelHandle!=NULL) &&
-                                            !WinHttpSetOption(
-                                                requestHandle,
-                                                WINHTTP_OPTION_CLIENT_CERT_CONTEXT,
-                                                (void*)x509_schannel_get_certificate_context(handleData->x509SchannelHandle),
-                                                sizeof(CERT_CONTEXT)
-                                        ))
-                                        {
-                                            LogErrorWinHTTPWithGetLastErrorAsString("unable to WinHttpSetOption");
-                                            result = HTTPAPI_SET_X509_FAILURE;
-                                        }
-                                        else
-                                        {
-                                            // Set proxy host if needed
-                                            if (handleData->proxy_host != NULL)
-                                            {
-                                                WINHTTP_PROXY_INFO winhttp_proxy;
-                                                wchar_t wproxy[MAX_HOSTNAME_LEN];
-                                                winhttp_proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
-                                                if (mbstowcs_s(NULL, wproxy, MAX_HOSTNAME_LEN, handleData->proxy_host, MAX_HOSTNAME_LEN-1) != 0)
-                                                {
-                                                    LogError("Error during proxy host conversion");
-                                                    result = HTTPAPI_ERROR;
-                                                }
-                                                else
-                                                {
-                                                    winhttp_proxy.lpszProxy = wproxy;
-                                                    winhttp_proxy.lpszProxyBypass = NULL;
-                                                    if (WinHttpSetOption(requestHandle,
-                                                        WINHTTP_OPTION_PROXY,
-                                                        &winhttp_proxy,
-                                                        (DWORD)sizeof(WINHTTP_PROXY_INFO)) != TRUE)
-                                                    {
-                                                        LogError("failure setting proxy address (%i)", GetLastError());
-                                                        result = HTTPAPI_ERROR;
-                                                    }
-                                                    else
-                                                    {
-                                                        //Set username and password if needed
-                                                        if (handleData->proxy_username != NULL && handleData->proxy_password != NULL)
-                                                        {
-                                                            wchar_t wusername[MAX_USERNAME_LEN];
-                                                            if (mbstowcs_s(NULL, wusername, MAX_USERNAME_LEN, handleData->proxy_username, MAX_USERNAME_LEN-1) != 0)
-                                                            {
-                                                                LogError("Error during proxy username conversion");
-                                                                result = HTTPAPI_ERROR;
-                                                            }
-                                                            else
-                                                            {
-                                                                wchar_t wpassword[MAX_PASSWORD_LEN];
-                                                                if (mbstowcs_s(NULL, wpassword, MAX_PASSWORD_LEN, handleData->proxy_password, MAX_PASSWORD_LEN-1) != 0)
-                                                                {
-                                                                    LogError("Error during proxy password conversion");
-                                                                    result = HTTPAPI_ERROR;
-                                                                }
-                                                                else
-                                                                {
-                                                                    if (WinHttpSetCredentials(requestHandle,
-                                                                        WINHTTP_AUTH_TARGET_PROXY,
-                                                                        WINHTTP_AUTH_SCHEME_BASIC,
-                                                                        wusername,
-                                                                        wpassword,
-                                                                        NULL) != TRUE)
-                                                                    {
-                                                                        LogErrorWinHTTPWithGetLastErrorAsString("Failure setting proxy credentials");
-                                                                        result = HTTPAPI_ERROR;
-                                                                    }
-                                                                    else
-                                                                    {
-                                                                        result = HTTPAPI_OK;
-                                                                    }
-                                                                }
-                                                            }
-                                                        }
-                                                        else
-                                                        {
-                                                            result = HTTPAPI_OK;
-                                                        }
-                                                    }
-                                                }
-                                            }
-                                            else
-                                            {
-                                                result = HTTPAPI_OK;
-                                            }
-                                            // verify if no error when set proxy
-                                            if (result == HTTPAPI_OK)
-                                            {
-                                                if (WinHttpSetTimeouts(requestHandle,
-                                                    0,                      /*_In_  int dwResolveTimeout - The initial value is zero, meaning no time-out (infinite). */
-                                                    60000,                  /*_In_  int dwConnectTimeout, -  The initial value is 60,000 (60 seconds).*/
-                                                    handleData->timeout,    /*_In_  int dwSendTimeout, -  The initial value is 30,000 (30 seconds).*/
-                                                    handleData->timeout     /* int dwReceiveTimeout The initial value is 30,000 (30 seconds).*/
-                                                ) == FALSE)
-                                                {
-                                                    result = HTTPAPI_SET_TIMEOUTS_FAILED;
-                                                    LogErrorWinHTTPWithGetLastErrorAsString("WinHttpOpenRequest failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                }
-                                                else
-                                                {
-                                                    DWORD dwSecurityFlags = 0;
-
-                                                    if (!WinHttpSetOption(
-                                                        requestHandle,
-                                                        WINHTTP_OPTION_SECURITY_FLAGS,
-                                                        &dwSecurityFlags,
-                                                        sizeof(dwSecurityFlags)))
-                                                    {
-                                                        result = HTTPAPI_SET_OPTION_FAILED;
-                                                        LogErrorWinHTTPWithGetLastErrorAsString("WinHttpSetOption failed (result = %s).", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                    }
-                                                    else
-                                                    {
-                                                        if (!WinHttpSendRequest(
-                                                            requestHandle,
-                                                            headersTemp,
-                                                            (DWORD)-1L, /*An unsigned long integer value that contains the length, in characters, of the additional headers. If this parameter is -1L ... */
-                                                            (void*)content,
-                                                            (DWORD)contentLength,
-                                                            (DWORD)contentLength,
-                                                            0))
-                                                        {
-                                                            result = HTTPAPI_SEND_REQUEST_FAILED;
-                                                            LogErrorWinHTTPWithGetLastErrorAsString("WinHttpSendRequest: (result = %s).", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                        }
-                                                        else
-                                                        {
-                                                            if (!WinHttpReceiveResponse(
-                                                                requestHandle,
-                                                                0))
-                                                            {
-                                                                result = HTTPAPI_RECEIVE_RESPONSE_FAILED;
-                                                                LogErrorWinHTTPWithGetLastErrorAsString("WinHttpReceiveResponse: (result = %s).", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                            }
-                                                            else
-                                                            {
-                                                                DWORD dwStatusCode = 0;
-                                                                DWORD dwBufferLength = sizeof(DWORD);
-                                                                DWORD responseBytesAvailable;
-
-                                                                if (!WinHttpQueryHeaders(
-                                                                    requestHandle,
-                                                                    WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER,
-                                                                    WINHTTP_HEADER_NAME_BY_INDEX,
-                                                                    &dwStatusCode,
-                                                                    &dwBufferLength,
-                                                                    WINHTTP_NO_HEADER_INDEX))
-                                                                {
-                                                                    result = HTTPAPI_QUERY_HEADERS_FAILED;
-                                                                    LogErrorWinHTTPWithGetLastErrorAsString("WinHttpQueryHeaders failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                }
-                                                                else
-                                                                {
-                                                                    BUFFER_HANDLE useToReadAllResponse = (responseContent != NULL) ? responseContent : BUFFER_new();
-
-                                                                    if (statusCode != NULL)
-                                                                    {
-                                                                        *statusCode = dwStatusCode;
-                                                                    }
-
-                                                                    if (useToReadAllResponse == NULL)
-                                                                    {
-                                                                        result = HTTPAPI_ERROR;
-                                                                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                    }
-                                                                    else
-                                                                    {
-
-                                                                        int goOnAndReadEverything = 1;
-                                                                        do
-                                                                        {
-                                                                            /*from MSDN: If no data is available and the end of the file has not been reached, one of two things happens. If the session is synchronous, the request waits until data becomes available.*/
-                                                                            if (!WinHttpQueryDataAvailable(requestHandle, &responseBytesAvailable))
-                                                                            {
-                                                                                result = HTTPAPI_QUERY_DATA_AVAILABLE_FAILED;
-                                                                                LogErrorWinHTTPWithGetLastErrorAsString("WinHttpQueryDataAvailable failed (result = %s).", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                goOnAndReadEverything = 0;
-                                                                            }
-                                                                            else if (responseBytesAvailable == 0)
-                                                                            {
-                                                                                /*end of the stream, go out*/
-                                                                                result = HTTPAPI_OK;
-                                                                                goOnAndReadEverything = 0;
-                                                                            }
-                                                                            else
-                                                                            {
-                                                                                if (BUFFER_enlarge(useToReadAllResponse, responseBytesAvailable) != 0)
-                                                                                {
-                                                                                    result = HTTPAPI_ERROR;
-                                                                                    LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                    goOnAndReadEverything = 0;
-                                                                                }
-                                                                                else
-                                                                                {
-                                                                                    /*Add the read bytes to the response buffer*/
-                                                                                    size_t bufferSize;
-                                                                                    const unsigned char* bufferContent;
-
-                                                                                    if (BUFFER_content(useToReadAllResponse, &bufferContent) != 0)
-                                                                                    {
-                                                                                        result = HTTPAPI_ERROR;
-                                                                                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                        goOnAndReadEverything = 0;
-                                                                                    }
-                                                                                    else if (BUFFER_size(useToReadAllResponse, &bufferSize) != 0)
-                                                                                    {
-                                                                                        result = HTTPAPI_ERROR;
-                                                                                        LogError("(result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                        goOnAndReadEverything = 0;
-                                                                                    }
-                                                                                    else
-                                                                                    {
-                                                                                        DWORD bytesReceived;
-                                                                                        if (!WinHttpReadData(requestHandle, (LPVOID)(bufferContent + bufferSize - responseBytesAvailable), responseBytesAvailable, &bytesReceived))
-                                                                                        {
-                                                                                            result = HTTPAPI_READ_DATA_FAILED;
-                                                                                            LogErrorWinHTTPWithGetLastErrorAsString("WinHttpReadData failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                            goOnAndReadEverything = 0;
-                                                                                        }
-                                                                                        else
-                                                                                        {
-                                                                                            /*if for some reason bytesReceived is zero If you are using WinHttpReadData synchronously, and the return value is TRUE and the number of bytes read is zero, the transfer has been completed and there are no more bytes to read on the handle.*/
-                                                                                            if (bytesReceived == 0)
-                                                                                            {
-                                                                                                /*end of everything, but this looks like an error still, or a non-conformance between WinHttpQueryDataAvailable and WinHttpReadData*/
-                                                                                                result = HTTPAPI_READ_DATA_FAILED;
-                                                                                                LogError("bytesReceived was unexpectedly zero (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                                                goOnAndReadEverything = 0;
-                                                                                            }
-                                                                                            else
-                                                                                            {
-                                                                                                /*all is fine, keep going*/
-                                                                                            }
-                                                                                        }
-                                                                                    }
-                                                                                }
-                                                                            }
-
-                                                                        } while (goOnAndReadEverything != 0);
-                                                                    }
-                                                                }
-
-                                                                if (result == HTTPAPI_OK && responseHeadersHandle != NULL)
-                                                                {
-                                                                    wchar_t* responseHeadersTemp;
-                                                                    DWORD responseHeadersTempLength = sizeof(responseHeadersTemp);
-
-                                                                    (void)WinHttpQueryHeaders(
-                                                                        requestHandle,
-                                                                        WINHTTP_QUERY_RAW_HEADERS_CRLF,
-                                                                        WINHTTP_HEADER_NAME_BY_INDEX,
-                                                                        WINHTTP_NO_OUTPUT_BUFFER,
-                                                                        &responseHeadersTempLength,
-                                                                        WINHTTP_NO_HEADER_INDEX);
-
-                                                                    responseHeadersTemp = (wchar_t*)malloc(responseHeadersTempLength + 2);
-                                                                    if (responseHeadersTemp == NULL)
-                                                                    {
-                                                                        result = HTTPAPI_ALLOC_FAILED;
-                                                                        LogError("malloc failed: (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-                                                                    }
-                                                                    else
-                                                                    {
-                                                                        if (WinHttpQueryHeaders(
-                                                                            requestHandle,
-                                                                            WINHTTP_QUERY_RAW_HEADERS_CRLF,
-                                                                            WINHTTP_HEADER_NAME_BY_INDEX,
-                                                                            responseHeadersTemp,
-                                                                            &responseHeadersTempLength,
-                                                                            WINHTTP_NO_HEADER_INDEX))
-                                                                        {
-                                                                            wchar_t *next_token;
-                                                                            wchar_t* token = wcstok_s(responseHeadersTemp, L"\r\n", &next_token);
-                                                                            while ((token != NULL) &&
-                                                                                (token[0] != L'\0'))
-                                                                            {
-                                                                                char* tokenTemp;
-                                                                                size_t tokenTemp_size;
-
-                                                                                tokenTemp_size = WideCharToMultiByte(CP_ACP, 0, token, -1, NULL, 0, NULL, NULL);
-                                                                                if (tokenTemp_size == 0)
-                                                                                {
-                                                                                    LogError("WideCharToMultiByte failed");
-                                                                                }
-                                                                                else
-                                                                                {
-                                                                                    tokenTemp = (char*)malloc(sizeof(char)*tokenTemp_size);
-                                                                                    if (tokenTemp == NULL)
-                                                                                    {
-                                                                                        LogError("malloc failed");
-                                                                                    }
-                                                                                    else
-                                                                                    {
-                                                                                        if (WideCharToMultiByte(CP_ACP, 0, token, -1, tokenTemp, (int)tokenTemp_size, NULL, NULL) > 0)
-                                                                                        {
-                                                                                            /*breaking the token in 2 parts: everything before the first ":" and everything after the first ":"*/
-                                                                                            /* if there is no such character, then skip it*/
-                                                                                            /*if there is a : then replace is by a '\0' and so it breaks the original string in name and value*/
-
-                                                                                            char* whereIsColon = strchr(tokenTemp, ':');
-                                                                                            if (whereIsColon != NULL)
-                                                                                            {
-                                                                                                *whereIsColon = '\0';
-                                                                                                if (HTTPHeaders_AddHeaderNameValuePair(responseHeadersHandle, tokenTemp, whereIsColon + 1) != HTTP_HEADERS_OK)
-                                                                                                {
-                                                                                                    LogError("HTTPHeaders_AddHeaderNameValuePair failed");
-                                                                                                    result = HTTPAPI_HTTP_HEADERS_FAILED;
-                                                                                                    break;
-                                                                                                }
-                                                                                            }
-                                                                                        }
-                                                                                        else
-                                                                                        {
-                                                                                            LogError("WideCharToMultiByte failed");
-                                                                                        }
-                                                                                        free(tokenTemp);
-                                                                                    }
-                                                                                }
-
-
-                                                                                token = wcstok_s(NULL, L"\r\n", &next_token);
-                                                                            }
-                                                                        }
-                                                                        else
-                                                                        {
-                                                                            LogError("WinHttpQueryHeaders failed");
-                                                                        }
-
-                                                                        free(responseHeadersTemp);
-                                                                    }
-                                                                }
-                                                            }
-                                                        }
-                                                    }
-                                                }
-                                            }
-                                        }
-                                        (void)WinHttpCloseHandle(requestHandle);
-                                    }
-                                }
-                                free(headersTemp);
-                            }
-                        }
-                        free(relativePathTemp);
-                    }
-                    free((void*)headers2);
-                }
-                else
-                {
-                    result = HTTPAPI_ALLOC_FAILED; /*likely*/
-                    LogError("ConstructHeadersString failed");
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_SetOption(HTTP_HANDLE handle, const char* optionName, const void* value)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (handle == NULL) ||
-        (optionName == NULL) ||
-        (value == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid parameter (NULL) passed to HTTPAPI_SetOption");
-    }
-    else
-    {
-        HTTP_HANDLE_DATA* httpHandleData = (HTTP_HANDLE_DATA*)handle;
-        if (strcmp(OPTION_HTTP_TIMEOUT, optionName) == 0)
-        {
-            long timeout = (long)(*(unsigned int*)value);
-            httpHandleData->timeout = timeout;
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(SU_OPTION_X509_CERT, optionName) == 0 || strcmp(OPTION_X509_ECC_CERT, optionName) == 0)
-        {
-            httpHandleData->x509certificate = (const char*)value;
-            if (httpHandleData->x509privatekey != NULL)
-            {
-                httpHandleData->x509SchannelHandle = x509_schannel_create(httpHandleData->x509certificate, httpHandleData->x509privatekey);
-                if (httpHandleData->x509SchannelHandle == NULL)
-                {
-                    LogError("unable to x509_schannel_create");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    result = HTTPAPI_OK;
-                }
-            }
-            else
-            {
-                /*if certificate comes 1st and private key is not set yet, then return OK and wait for the private key to be set*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_PRIVATE_KEY, optionName) == 0 || strcmp(OPTION_X509_ECC_KEY, optionName) == 0)
-        {
-            httpHandleData->x509privatekey = (const char*)value;
-            if (httpHandleData->x509certificate != NULL)
-            {
-                httpHandleData->x509SchannelHandle = x509_schannel_create(httpHandleData->x509certificate, httpHandleData->x509privatekey);
-                if (httpHandleData->x509SchannelHandle == NULL)
-                {
-                    LogError("unable to x509_schannel_create");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    result = HTTPAPI_OK;
-                }
-            }
-            else
-            {
-                /*if privatekey comes 1st and certificate is not set yet, then return OK and wait for the certificate to be set*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp("TrustedCerts", optionName) == 0)
-        {
-            /*winhttp accepts all certificates, because it actually relies on the system ones*/
-            result = HTTPAPI_OK;
-        }
-        else if (strcmp(OPTION_HTTP_PROXY, optionName) == 0)
-        {
-            char proxyAddressAndPort[MAX_HOSTNAME_LEN];
-            HTTP_PROXY_OPTIONS* proxy_data = (HTTP_PROXY_OPTIONS*)value;
-            if (proxy_data->host_address == NULL || proxy_data->port <= 0)
-            {
-              LogError("invalid proxy_data values ( host_address = %p, port = %d)", proxy_data->host_address, proxy_data->port);
-              result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                if (sprintf_s(proxyAddressAndPort, MAX_HOSTNAME_LEN, "%s:%d", proxy_data->host_address, proxy_data->port) <= 0)
-                {
-                    LogError("failure constructing proxy address");
-                    result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    if(httpHandleData->proxy_host != NULL)
-                    {
-                      free((void*)httpHandleData->proxy_host);
-                      httpHandleData->proxy_host = NULL;
-                    }
-                    if(mallocAndStrcpy_s((char**)&(httpHandleData->proxy_host), (const char*)proxyAddressAndPort) != 0)
-                    {
-                        LogError("failure allocate proxy host");
-                        result = HTTPAPI_ERROR;
-                    }
-                    else
-                    {
-                        if (proxy_data->username != NULL && proxy_data->password != NULL)
-                        {
-                            if(httpHandleData->proxy_username != NULL)
-                            {
-                              free((void*)httpHandleData->proxy_username);
-                              httpHandleData->proxy_username = NULL;
-                            }
-                            if(mallocAndStrcpy_s((char**)&(httpHandleData->proxy_username), (const char*)proxy_data->username) != 0)
-                            {
-                                LogError("failure allocate proxy username");
-                                free((void*)httpHandleData->proxy_host);
-                                httpHandleData->proxy_host = NULL;
-                                result = HTTPAPI_ERROR;
-                            }
-                            else
-                            {
-                                if(httpHandleData->proxy_password != NULL)
-                                {
-                                  free((void*)httpHandleData->proxy_password);
-                                  httpHandleData->proxy_password = NULL;
-                                }
-                                if(mallocAndStrcpy_s((char**)&(httpHandleData->proxy_password), (const char*)proxy_data->password) != 0)
-                                {
-                                    LogError("failure allocate proxy password");
-                                    free((void*)httpHandleData->proxy_host);
-                                    httpHandleData->proxy_host = NULL;
-                                    free((void*)httpHandleData->proxy_username);
-                                    httpHandleData->proxy_username = NULL;
-                                    result = HTTPAPI_ERROR;
-                                }
-                                else
-                                {
-                                  result = HTTPAPI_OK;
-                                }
-                            }
-                        }
-                        else
-                        {
-                            result = HTTPAPI_OK;
-                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            result = HTTPAPI_INVALID_ARG;
-            LogError("unknown option %s", optionName);
-        }
-    }
-    return result;
-}
-
-HTTPAPI_RESULT HTTPAPI_CloneOption(const char* optionName, const void* value, const void** savedValue)
-{
-    HTTPAPI_RESULT result;
-    if (
-        (optionName == NULL) ||
-        (value == NULL) ||
-        (savedValue == NULL)
-        )
-    {
-        result = HTTPAPI_INVALID_ARG;
-        LogError("invalid argument(NULL) passed to HTTPAPI_CloneOption");
-    }
-    else
-    {
-        if (strcmp(OPTION_HTTP_TIMEOUT, optionName) == 0)
-        {
-            /*by convention value is pointing to an unsigned int */
-            unsigned int* temp = (unsigned int*)malloc(sizeof(unsigned int)); /*shall be freed by HTTPAPIEX*/
-            if (temp == NULL)
-            {
-                result = HTTPAPI_ERROR;
-                LogError("malloc failed (result = %s)", ENUM_TO_STRING(HTTPAPI_RESULT, result));
-            }
-            else
-            {
-                *temp = *(const unsigned int*)value;
-                *savedValue = temp;
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_CERT, optionName) == 0 || strcmp(OPTION_X509_ECC_CERT, optionName) == 0)
-        {
-            /*this is getting the x509 certificate. In this case, value is a pointer to a const char* that contains the certificate as a null terminated string*/
-            if (mallocAndStrcpy_s((char**)savedValue, (const char*)value) != 0)
-            {
-                LogError("unable to clone the x509 certificate content");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                /*return OK when the certificate has been clones successfully*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(SU_OPTION_X509_PRIVATE_KEY, optionName) == 0 || strcmp(OPTION_X509_ECC_KEY, optionName) == 0)
-        {
-            /*this is getting the x509 private key. In this case, value is a pointer to a const char* that contains the private key as a null terminated string*/
-            if (mallocAndStrcpy_s((char**)savedValue, (const char*)value) != 0)
-            {
-                LogError("unable to clone the x509 private key content");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                /*return OK when the private key has been clones successfully*/
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp("TrustedCerts", optionName) == 0)
-        {
-            *savedValue = malloc(1); /*_CloneOption needs to return in *savedValue something that can be free()'d*/
-            if (*savedValue == NULL)
-            {
-                LogError("failure in malloc");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                result = HTTPAPI_OK;
-            }
-        }
-        else if (strcmp(OPTION_HTTP_PROXY, optionName) == 0)
-        {
-            *savedValue = malloc(sizeof(HTTP_PROXY_OPTIONS));
-            if (*savedValue == NULL)
-            {
-                LogError("failure in malloc");
-                result = HTTPAPI_ERROR;
-            }
-            else
-            {
-                HTTP_PROXY_OPTIONS *savedOption = (HTTP_PROXY_OPTIONS*) *savedValue;
-                HTTP_PROXY_OPTIONS *option = (HTTP_PROXY_OPTIONS*) value;
-                memset((void*)*savedValue, 0, sizeof(HTTP_PROXY_OPTIONS));
-                if (mallocAndStrcpy_s((char**)&(savedOption->host_address),
-                                      (const char*)option->host_address) != 0)
-                {
-                  LogError("unable to clone the proxy host adress content");
-                  free((void*)*savedValue);
-                  *savedValue = NULL;
-                  result = HTTPAPI_ERROR;
-                }
-                else
-                {
-                    savedOption->port = option->port;
-                    if (option->username != NULL && mallocAndStrcpy_s((char**)&(savedOption->username),
-                                                                      (const char*)option->username) != 0)
-                    {
-                      LogError("unable to clone the proxy username content");
-                      free((void*)savedOption->host_address);
-                      savedOption->host_address = NULL;
-                      free((void*)*savedValue);
-                      *savedValue = NULL;
-                      result = HTTPAPI_ERROR;
-                    }
-                    else
-                    {
-                        if (option->password != NULL && mallocAndStrcpy_s((char**)&(savedOption->password),
-                                                                          (const char*)option->password) != 0)
-                        {
-                          LogError("unable to clone the proxy password content");
-                          free((void*)savedOption->host_address);
-                          savedOption->host_address = NULL;
-                          free((void*)savedOption->username);
-                          savedOption->username = NULL;
-                          free((void*)*savedValue);
-                          *savedValue = NULL;
-                          result = HTTPAPI_ERROR;
-                        }
-                        else
-                        {
-                            result = HTTPAPI_OK;
-                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            result = HTTPAPI_INVALID_ARG;
-            LogError("unknown option %s", optionName);
-        }
-    }
-    return result;
-}

+ 0 - 75
azure/c-utility/adapters/linux_time.c

@@ -1,75 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include "azure_c_shared_utility/xlogging.h"
-#include "linux_time.h"
-
-#ifdef __MACH__
-#include <mach/clock.h>
-#include <mach/mach.h>
-#endif
-
-
-#ifndef __MACH__
-clockid_t time_basis = -1;
-#endif
-
-void set_time_basis(void)
-{
-// The time basis depends on what clock is available. Prefer CLOCK_MONOTONIC,
-// then CLOCK_REALTIME, otherwise query the default pthread_condattr_t value 
-// and use that. Note the time basis stuff requires _POSIX_TIMERS [TMR] at a
-// minimum; querying pthread_condattr_t requires _POSIX_CLOCK_SELECTION [CS].
-// OSX has neither so we use a platform-specific clock.
-#ifndef __MACH__
-#if defined(CLOCK_MONOTONIC)
-    time_basis = CLOCK_MONOTONIC;
-#elif defined(CLOCK_REALTIME)
-    time_basis = CLOCK_REALTIME;
-#else
-    pthread_condattr_t cattr;
-    pthread_condattr_init(&cattr);
-    pthread_condattr_getclock(&cattr, &time_basis);
-    pthread_condattr_destroy(&cattr);
-#endif
-#endif
-}
-
-int get_time_ns(struct timespec* ts)
-{
-    int err;
-
-#ifdef __MACH__
-    clock_serv_t cclock;
-    mach_timespec_t mts;
-    err = host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
-    if (!err)
-    {
-        err = clock_get_time(cclock, &mts);
-        mach_port_deallocate(mach_task_self(), cclock);
-
-        if (!err)
-        {
-            ts->tv_sec = mts.tv_sec;
-            ts->tv_nsec = mts.tv_nsec;
-        } 
-    }
-#else
-    err = clock_gettime(time_basis, ts);
-#endif
-    return err;
-}
-
-time_t get_time_s()
-{   
-    struct timespec ts;
-    if (get_time_ns(&ts) != 0)
-    {
-        LogError("Failed to get the current time");
-        return INVALID_TIME_VALUE;
-    }
-
-    return (time_t)ts.tv_sec;
-}
-

+ 0 - 26
azure/c-utility/adapters/linux_time.h

@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#ifndef LINUX_TIME_H
-#define LINUX_TIME_H
-
-#include <time.h>
-#include <pthread.h>
-
-#ifndef __MACH__
-extern clockid_t time_basis;
-#endif
-
-extern void set_time_basis(void);
-extern int get_time_ns(struct timespec* ts);
-extern time_t get_time_s(void);
-
-#define INVALID_TIME_VALUE      (time_t)(-1)
-
-
-#define NANOSECONDS_IN_1_SECOND 1000000000L
-#define MILLISECONDS_IN_1_SECOND 1000
-#define NANOSECONDS_IN_1_MILLISECOND 1000000L
-
-#endif
-

+ 0 - 111
azure/c-utility/adapters/lock_pthreads.c

@@ -1,111 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include <pthread.h>
-#include "azure_c_shared_utility/lock.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-LOCK_HANDLE Lock_Init(void)
-{
-    /* Codes_SRS_LOCK_10_002: [Lock_Init on success shall return a valid lock handle which should be a non NULL value] */
-    pthread_mutex_t* result = (pthread_mutex_t*)malloc(sizeof(pthread_mutex_t));
-    if (result == NULL)
-    {
-        LogError("malloc failed.");
-    }
-    else
-	{
-		if (pthread_mutex_init(result, NULL) != 0)
-		{
-            /* Codes_SRS_LOCK_10_003: [Lock_Init on error shall return NULL ] */
-			LogError("pthread_mutex_init failed.");
-            free(result);
-            result = NULL;
-		}
-	}
-	
-	return (LOCK_HANDLE)result;
-}
-
-LOCK_RESULT Lock(LOCK_HANDLE handle)
-{
-	LOCK_RESULT result;
-	if (handle == NULL)
-	{
-        /* Codes_SRS_LOCK_10_007: [Lock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-	else
-	{
-		if (pthread_mutex_lock((pthread_mutex_t*)handle) == 0)
-		{
-            /* Codes_SRS_LOCK_10_005: [Lock on success shall return LOCK_OK] */
-            result = LOCK_OK;
-		}
-		else
-		{
-            /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-            LogError("pthread_mutex_lock failed.");
-            result = LOCK_ERROR;
-		}
-	}
-
-	return result;
-}
-
-LOCK_RESULT Unlock(LOCK_HANDLE handle)
-{
-	LOCK_RESULT result;
-	if (handle == NULL)
-	{
-        /* Codes_SRS_LOCK_10_007: [Unlock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-	else
-	{
-		if (pthread_mutex_unlock((pthread_mutex_t*)handle) == 0)
-		{
-            /* Codes_SRS_LOCK_10_009: [Unlock on success shall return LOCK_OK] */
-            result = LOCK_OK;
-		}
-		else
-		{
-            /* Codes_SRS_LOCK_10_010: [Unlock on error shall return LOCK_ERROR] */
-            LogError("pthread_mutex_unlock failed.");
-            result = LOCK_ERROR;
-		}
-	}
-
-	return result;
-}
-
-LOCK_RESULT Lock_Deinit(LOCK_HANDLE handle)
-{
-	LOCK_RESULT result;
-	if (NULL == handle)
-	{
-        /* Codes_SRS_LOCK_10_007: [Lock_Deinit on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-	else
-	{
-        /* Codes_SRS_LOCK_10_012: [Lock_Deinit frees the memory pointed by handle] */
-        if(pthread_mutex_destroy((pthread_mutex_t*)handle) == 0)
-		{
-			free(handle);
-			handle = NULL;
-            result = LOCK_OK;
-        }
-		else
-		{
-            LogError("pthread_mutex_destroy failed;");
-			result = LOCK_ERROR;
-		}
-	}
-	
-	return result;
-}

+ 0 - 96
azure/c-utility/adapters/lock_rtx_mbed.cpp

@@ -1,96 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/lock.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "rtos.h"
-
-
-LOCK_HANDLE Lock_Init(void)
-{
-    /* Codes_SRS_LOCK_10_002: [Lock_Init on success shall return a valid lock handle which should be a non NULL value] */
-    /* Codes_SRS_LOCK_10_003: [Lock_Init on error shall return NULL] */
-    Mutex* result = new Mutex();
-    if (result == NULL)
-    {
-        LogError("Failed to instantiate a new Mutex object.");
-    }
-
-    return (LOCK_HANDLE)result;
-}
-
-LOCK_RESULT Lock(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (handle == NULL)
-    {
-        /* Codes_SRS_LOCK_10_007: [Lock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else
-    {
-        Mutex* lock_mtx = (Mutex*)handle;
-        if (lock_mtx->lock() == osOK)
-        {
-            /* Codes_SRS_LOCK_10_005: [Lock on success shall return LOCK_OK] */
-            result = LOCK_OK;
-        }
-        else
-        {
-            /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-            LogError("Mutex(%p)->lock() failed.", handle);
-            result = LOCK_ERROR;
-        }
-    }
-
-    return result;
-}
-
-LOCK_RESULT Unlock(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (handle == NULL)
-    {
-        /* Codes_SRS_LOCK_10_007: [Unlock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else
-    {
-        Mutex* lock_mtx = (Mutex*)handle;
-        if (lock_mtx->unlock() == osOK)
-        {
-            /* Codes_SRS_LOCK_10_009: [Unlock on success shall return LOCK_OK] */
-            result = LOCK_OK;
-        }
-        else
-        {
-            /* Codes_SRS_LOCK_10_010: [Unlock on error shall return LOCK_ERROR] */
-            LogError("Mutex(%p)->unlock() failed.", handle);
-            result = LOCK_ERROR;
-        }
-    }
-
-    return result;
-}
-
-LOCK_RESULT Lock_Deinit(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (NULL == handle)
-    {
-        /* Codes_SRS_LOCK_10_007: [Lock_Deinit on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else
-    {
-        /* Codes_SRS_LOCK_10_012: [Lock_Deinit frees the memory pointed by handle] */
-        Mutex* lock_mtx = (Mutex*)handle;
-        delete lock_mtx;
-        result = LOCK_OK;
-    }
-    
-    return result;
-}

+ 0 - 112
azure/c-utility/adapters/lock_win32.c

@@ -1,112 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/lock.h"
-#include <windows.h>
-#include <stdlib.h>
-#include "azure_c_shared_utility/xlogging.h"
-
-#include "azure_c_shared_utility/macro_utils.h"
-
-LOCK_HANDLE Lock_Init(void)
-{
-    /* Codes_SRS_LOCK_10_002: [Lock_Init on success shall return a valid lock handle which should be a non NULL value] */
-    /* Codes_SRS_LOCK_10_003: [Lock_Init on error shall return NULL ] */
-    HANDLE result = CreateSemaphoreW(NULL, 1, 1, NULL);
-    if (result == NULL)
-    {
-        LogError("CreateSemaphore failed.");
-    }
-
-    return (LOCK_HANDLE)result;
-}
-
-LOCK_RESULT Lock_Deinit(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (handle == NULL)
-    {
-        /* Codes_SRS_LOCK_10_007: [Lock_Deinit on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else
-    {
-        /* Codes_SRS_LOCK_10_012: [Lock_Deinit frees the memory pointed by handle] */
-        CloseHandle((HANDLE)handle);
-        result = LOCK_OK;
-    }
-
-    return result;
-}
-
-LOCK_RESULT Lock(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (handle == NULL)
-    {
-        /* Codes_SRS_LOCK_10_007: [Lock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else 
-    {
-        DWORD rv = WaitForSingleObject((HANDLE)handle, INFINITE);
-        switch (rv)
-        {
-            case WAIT_OBJECT_0:
-                /* Codes_SRS_LOCK_10_005: [Lock on success shall return LOCK_OK] */
-                result = LOCK_OK;
-                break;
-            case WAIT_ABANDONED:
-                LogError("WaitForSingleObject returned 'abandoned'.");
-                /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-                result = LOCK_ERROR;
-                break;
-            case WAIT_TIMEOUT:
-                LogError("WaitForSingleObject timed out.");
-                /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-                result = LOCK_ERROR;
-                break;
-            case WAIT_FAILED:
-                LogError("WaitForSingleObject failed: %d", GetLastError());
-                /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-                result = LOCK_ERROR;
-                break;
-            default:
-                LogError("WaitForSingleObject returned an invalid value.");
-                /* Codes_SRS_LOCK_10_006: [Lock on error shall return LOCK_ERROR] */
-                result = LOCK_ERROR;
-                break;
-        }
-    }    
-
-    return result;
-}
-
-LOCK_RESULT Unlock(LOCK_HANDLE handle)
-{
-    LOCK_RESULT result;
-    if (handle == NULL)
-    {
-        /* Codes_SRS_LOCK_10_007: [Unlock on NULL handle passed returns LOCK_ERROR] */
-        LogError("Invalid argument; handle is NULL.");
-        result = LOCK_ERROR;
-    }
-    else
-    {
-        if (ReleaseSemaphore((HANDLE)handle, 1, NULL))
-        {
-            /* Codes_SRS_LOCK_10_009: [Unlock on success shall return LOCK_OK] */
-            result = LOCK_OK;
-        }
-        else
-        {
-            /* Codes_SRS_LOCK_10_010: [Unlock on error shall return LOCK_ERROR] */
-            LogError("ReleaseSemaphore failed: %d", GetLastError());
-            result = LOCK_ERROR;
-        }
-    }
-    
-    return result;
-}

+ 0 - 35
azure/c-utility/adapters/platform_esp8266.c

@@ -1,35 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#ifdef _CRTDBG_MAP_ALLOC
-#include <crtdbg.h>
-#endif
-#include "azure_c_shared_utility/platform.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/tlsio_openssl.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "lwip/apps/sntp.h"
-#include "lwip/apps/sntp_time.h"
-
-int platform_init(void)
-{
-    sntp_init();
-    u32_t ts = 0;
-    while(ts == 0){
-        vTaskDelay(5000 / portTICK_RATE_MS);
-        ts = sntp_get_current_timestamp();
-        LogInfo("%s", sntp_get_real_time(ts));
-    }
-    return 0;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-    return tlsio_openssl_get_interface_description();
-}
-
-void platform_deinit(void)
-{
-     sntp_stop();
-}

+ 0 - 34
azure/c-utility/adapters/platform_freertos.c

@@ -1,34 +0,0 @@
-// Copyright (C) Firmwave Ltd., All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/platform.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/tlsio_cyclonessl.h"
-#include "azure_c_shared_utility/threadapi.h"
-
-#include "debug.h"
-
-int platform_init(void)
-{
-    //TODO Add proper network events synchronization
-    ThreadAPI_Sleep(10000);
-    return 0;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-    return tlsio_cyclonessl_get_interface_description();
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    return STRING_construct("(native; freertos; undefined)");
-}
-
-void platform_deinit(void)
-{
-    TRACE_INFO("Deinitializing platform \r\n");
-    while(1) {};
-}

+ 0 - 68
azure/c-utility/adapters/platform_linux.c

@@ -1,68 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/platform.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/xlogging.h"
-#ifdef USE_OPENSSL
-#include "azure_c_shared_utility/tlsio_openssl.h"
-#endif
-#if USE_CYCLONESSL
-#include "azure_c_shared_utility/tlsio_cyclonessl.h"
-#endif
-#if USE_WOLFSSL
-#include "azure_c_shared_utility/tlsio_wolfssl.h"
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-
-int platform_init(void)
-{
-    int result;
-#ifdef USE_OPENSSL
-    result = tlsio_openssl_init();
-#else
-    result = 0;
-#endif
-    return result;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-#if USE_CYCLONESSL
-    return tlsio_cyclonessl_get_interface_description();
-#elif USE_WOLFSSL
-    return tlsio_wolfssl_get_interface_description();
-#else
-    return tlsio_openssl_get_interface_description();
-#endif
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    STRING_HANDLE result;
-    struct utsname nnn;
-
-    if (uname(&nnn) == 0)
-    {
-        result = STRING_construct_sprintf("(native; %s; %s)", nnn.sysname, nnn.machine);
-    }
-    else
-    {
-        LogInfo("WARNING: failed to find machine info.");
-        result = STRING_construct("(native; Linux; undefined)");
-    }
-
-    return result;
-}
-
-void platform_deinit(void)
-{
-#ifdef USE_OPENSSL
-    tlsio_openssl_deinit();
-#endif
-}

+ 0 - 75
azure/c-utility/adapters/platform_mbed.cpp

@@ -1,75 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/platform.h"
-#include "EthernetInterface.h"
-#include "NTPClient.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/tlsio_wolfssl.h"
-
-int setupRealTime(void)
-{
-    int result;
-
-    if (EthernetInterface::connect())
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        NTPClient ntp;
-        if (ntp.setTime("0.pool.ntp.org") != 0)
-        {
-            result = __FAILURE__;
-        }
-        else
-        {
-            result = 0;
-        }
-        EthernetInterface::disconnect();
-    }
-
-    return result;
-}
-
-int platform_init(void)
-{
-    int result;
-
-    if (EthernetInterface::init())
-    {
-        result = __FAILURE__;
-    }
-    else if (setupRealTime() != 0)
-    {
-        result = __FAILURE__;
-    } 
-    else if (EthernetInterface::connect())
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        result = 0;
-    }
-
-    return result;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-    return tlsio_wolfssl_get_interface_description();
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    return STRING_construct("(native; mbed; undefined)");
-}
-
-void platform_deinit(void)
-{
-    EthernetInterface::disconnect();
-}

+ 0 - 26
azure/c-utility/adapters/platform_stub.c

@@ -1,26 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/platform.h"
-
-int platform_init(void)
-{
-	return 0;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-    return NULL;
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    return STRING_construct("(native; undefined; undefined)");
-}
-
-void platform_deinit(void)
-{
-	return;
-}

+ 0 - 28
azure/c-utility/adapters/platform_tizenrt.c

@@ -1,28 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include "azure_c_shared_utility/platform.h"
-#include "azure_c_shared_utility/tlsio_mbedtls.h"
-
-int platform_init(void)
-{
-	return 0;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-	return tlsio_mbedtls_get_interface_description();
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    return STRING_construct("(native; tizenrt; undefined)");
-}
-
-void platform_deinit(void)
-{
-	return;
-}

+ 0 - 133
azure/c-utility/adapters/platform_win32.c

@@ -1,133 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "azure_c_shared_utility/platform.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/xio.h"
-#include "azure_c_shared_utility/strings.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "winsock2.h"
-
-#ifdef USE_OPENSSL
-#include "azure_c_shared_utility/tlsio_openssl.h"
-#endif
-#if USE_CYCLONESSL
-#include "azure_c_shared_utility/tlsio_cyclonessl.h"
-#endif
-#if USE_WOLFSSL
-#include "azure_c_shared_utility/tlsio_wolfssl.h"
-#endif
-
-#include "azure_c_shared_utility/tlsio_schannel.h"
-
-int platform_init(void)
-{
-    int result;
-
-    WSADATA wsaData;
-    int error_code = WSAStartup(MAKEWORD(2, 2), &wsaData);
-    if (error_code != 0)
-    {
-        LogError("WSAStartup failed: 0x%x", error_code);
-        result = __FAILURE__;
-    }
-    else
-    {
-#ifdef USE_OPENSSL
-        tlsio_openssl_init();
-#endif
-        result = 0;
-    }
-    return result;
-}
-
-const IO_INTERFACE_DESCRIPTION* platform_get_default_tlsio(void)
-{
-#ifdef USE_OPENSSL
-    return tlsio_openssl_get_interface_description();
-#elif USE_CYCLONESSL
-    return tlsio_cyclonessl_get_interface_description();
-#elif USE_WOLFSSL
-    return tlsio_wolfssl_get_interface_description();
-#else
-#ifndef WINCE
-    return tlsio_schannel_get_interface_description();
-#else
-    LogError("TLS IO interface currently not supported on WEC 2013");
-    return (IO_INTERFACE_DESCRIPTION*)NULL;
-#endif
-#endif
-}
-
-STRING_HANDLE platform_get_platform_info(void)
-{
-    // Expected format: "(<runtime name>; <operating system name>; <platform>)"
-
-    STRING_HANDLE result;
-#ifndef WINCE
-    SYSTEM_INFO sys_info;
-    OSVERSIONINFO osvi;
-    char *arch;
-    GetSystemInfo(&sys_info);
-
-    switch (sys_info.wProcessorArchitecture)
-    {
-        case PROCESSOR_ARCHITECTURE_AMD64:
-            arch = "x64";
-            break;
-
-        case PROCESSOR_ARCHITECTURE_ARM:
-            arch = "ARM";
-            break;
-
-        case PROCESSOR_ARCHITECTURE_IA64:
-            arch = "IA64";
-            break;
-
-        case PROCESSOR_ARCHITECTURE_INTEL:
-            arch = "x32";
-            break;
-
-        default:
-            arch = "UNKNOWN";
-            break;
-    }
-
-    result = NULL;
-    memset(&osvi, 0, sizeof(osvi));
-    osvi.dwOSVersionInfoSize = sizeof(osvi);
-#pragma warning(disable:4996)
-    if (GetVersionEx(&osvi))
-    {
-        DWORD product_type;
-        if (GetProductInfo(osvi.dwMajorVersion, osvi.dwMinorVersion, 0, 0, &product_type))
-        {
-            result = STRING_construct_sprintf("(native; WindowsProduct:0x%08x %d.%d; %s)", product_type, osvi.dwMajorVersion, osvi.dwMinorVersion, arch);
-        }
-    }
-
-    if (result == NULL)
-    {
-        DWORD dwVersion = GetVersion();
-        result = STRING_construct_sprintf("(native; WindowsProduct:Windows NT %d.%d; %s)", LOBYTE(LOWORD(dwVersion)), HIBYTE(LOWORD(dwVersion)), arch);
-    }
-#pragma warning(default:4996)
-
-#else
-    result = STRING_construct("(native; Windows CE; undefined)");
-#endif
-    if (result == NULL)
-    {
-        LogError("STRING_construct_sprintf failed");
-    }
-    return result;
-}
-
-void platform_deinit(void)
-{
-    (void)WSACleanup();
-
-#ifdef USE_OPENSSL
-    tlsio_openssl_deinit();
-#endif
-}

+ 0 - 1143
azure/c-utility/adapters/socketio_berkeley.c

@@ -1,1143 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#ifndef _BSD_SOURCE
-#define _BSD_SOURCE
-#define SOCKETIO_BERKELEY_UNDEF_BSD_SOURCE
-#endif
-
-#define _DEFAULT_SOURCE
-#include <net/if.h>
-#undef _DEFAULT_SOURCE
-
-#ifdef SOCKETIO_BERKELEY_UNDEF_BSD_SOURCE
-#undef _BSD_SOURCE
-#undef SOCKETIO_BERKELEY_UNDEF_BSD_SOURCE
-#endif
-
-#include <signal.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include "azure_c_shared_utility/socketio.h"
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#ifdef TIZENRT
-#include <net/lwip/tcp.h>
-#else
-#include <netinet/tcp.h>
-#endif
-#include <netdb.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include "azure_c_shared_utility/singlylinkedlist.h"
-#include "azure_c_shared_utility/gballoc.h"
-#include "azure_c_shared_utility/gbnetwork.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/optionhandler.h"
-#include "azure_c_shared_utility/shared_util_options.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "azure_c_shared_utility/const_defines.h"
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/un.h>
-
-#define SOCKET_SUCCESS                 0
-#define INVALID_SOCKET                 -1
-#define MAC_ADDRESS_STRING_LENGTH      18
-
-#ifndef IFREQ_BUFFER_SIZE
-#define IFREQ_BUFFER_SIZE              1024
-#endif
-
-// connect timeout in seconds
-#define CONNECT_TIMEOUT         10
-
-typedef enum IO_STATE_TAG
-{
-    IO_STATE_CLOSED,
-    IO_STATE_OPENING,
-    IO_STATE_OPEN,
-    IO_STATE_CLOSING,
-    IO_STATE_ERROR
-} IO_STATE;
-
-typedef enum ADDRESS_TYPE_TAG
-{
-    ADDRESS_TYPE_IP,
-    ADDRESS_TYPE_DOMAIN_SOCKET
-} ADDRESS_TYPE;
-
-typedef struct PENDING_SOCKET_IO_TAG
-{
-    unsigned char* bytes;
-    size_t size;
-    ON_SEND_COMPLETE on_send_complete;
-    void* callback_context;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-} PENDING_SOCKET_IO;
-
-typedef struct SOCKET_IO_INSTANCE_TAG
-{
-    int socket;
-    ADDRESS_TYPE address_type;
-    ON_BYTES_RECEIVED on_bytes_received;
-    ON_IO_ERROR on_io_error;
-    void* on_bytes_received_context;
-    void* on_io_error_context;
-    char* hostname;
-    int port;
-    char* target_mac_address;
-    IO_STATE io_state;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-    unsigned char recv_bytes[RECEIVE_BYTES_VALUE];
-} SOCKET_IO_INSTANCE;
-
-typedef struct NETWORK_INTERFACE_DESCRIPTION_TAG
-{
-    char* name;
-    char* mac_address;
-    char* ip_address;
-    struct NETWORK_INTERFACE_DESCRIPTION_TAG* next;
-} NETWORK_INTERFACE_DESCRIPTION;
-
-/*this function will clone an option given by name and value*/
-static void* socketio_CloneOption(const char* name, const void* value)
-{
-    void* result;
-
-    if (name != NULL)
-    {
-        result = NULL;
-
-        if (strcmp(name, OPTION_NET_INT_MAC_ADDRESS) == 0)
-        {
-            if (value == NULL)
-            {
-                LogError("Failed cloning option %s (value is NULL)", name);
-            }
-            else
-            {
-                if ((result = malloc(sizeof(char) * (strlen((char*)value) + 1))) == NULL)
-                {
-                    LogError("Failed cloning option %s (malloc failed)", name);
-                }
-                else if (strcpy((char*)result, (char*)value) == NULL)
-                {
-                    LogError("Failed cloning option %s (strcpy failed)", name);
-                    free(result);
-                    result = NULL;
-                }
-            }
-        }
-        else
-        {
-            LogError("Cannot clone option %s (not suppported)", name);
-        }
-    }
-    else
-    {
-        result = NULL;
-    }
-    return result;
-}
-
-/*this function destroys an option previously created*/
-static void socketio_DestroyOption(const char* name, const void* value)
-{
-    if (name != NULL)
-    {
-        if (strcmp(name, OPTION_NET_INT_MAC_ADDRESS) == 0 && value != NULL)
-        {
-            free((void*)value);
-        }
-    }
-}
-
-static OPTIONHANDLER_HANDLE socketio_retrieveoptions(CONCRETE_IO_HANDLE handle)
-{
-    OPTIONHANDLER_HANDLE result;
-
-    if (handle == NULL)
-    {
-        LogError("failed retrieving options (handle is NULL)");
-        result = NULL;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)handle;
-
-        result = OptionHandler_Create(socketio_CloneOption, socketio_DestroyOption, socketio_setoption);
-        if (result == NULL)
-        {
-            LogError("unable to OptionHandler_Create");
-        }
-        else if (socket_io_instance->target_mac_address != NULL &&
-            OptionHandler_AddOption(result, OPTION_NET_INT_MAC_ADDRESS, socket_io_instance->target_mac_address) != OPTIONHANDLER_OK)
-        {
-            LogError("failed retrieving options (failed adding net_interface_mac_address)");
-            OptionHandler_Destroy(result);
-            result = NULL;
-        }
-    }
-
-    return result;
-}
-
-static const IO_INTERFACE_DESCRIPTION socket_io_interface_description = 
-{
-    socketio_retrieveoptions,
-    socketio_create,
-    socketio_destroy,
-    socketio_open,
-    socketio_close,
-    socketio_send,
-    socketio_dowork,
-    socketio_setoption
-};
-
-static void indicate_error(SOCKET_IO_INSTANCE* socket_io_instance)
-{
-    if (socket_io_instance->on_io_error != NULL)
-    {
-        socket_io_instance->on_io_error(socket_io_instance->on_io_error_context);
-    }
-}
-
-static int add_pending_io(SOCKET_IO_INSTANCE* socket_io_instance, const unsigned char* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-    PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)malloc(sizeof(PENDING_SOCKET_IO));
-    if (pending_socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        pending_socket_io->bytes = (unsigned char*)malloc(size);
-        if (pending_socket_io->bytes == NULL)
-        {
-            LogError("Allocation Failure: Unable to allocate pending list.");
-            free(pending_socket_io);
-            result = __FAILURE__;
-        }
-        else
-        {
-            pending_socket_io->size = size;
-            pending_socket_io->on_send_complete = on_send_complete;
-            pending_socket_io->callback_context = callback_context;
-            pending_socket_io->pending_io_list = socket_io_instance->pending_io_list;
-            (void)memcpy(pending_socket_io->bytes, buffer, size);
-
-            if (singlylinkedlist_add(socket_io_instance->pending_io_list, pending_socket_io) == NULL)
-            {
-                LogError("Failure: Unable to add socket to pending list.");
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-                result = __FAILURE__;
-            }
-            else
-            {
-                result = 0;
-            }
-        }
-    }
-    return result;
-}
-
-static STATIC_VAR_UNUSED void signal_callback(int signum)
-{
-    AZURE_UNREFERENCED_PARAMETER(signum);
-    LogError("Socket received signal %d.", signum);
-}
-
-static int lookup_address_and_initiate_socket_connection(SOCKET_IO_INSTANCE* socket_io_instance) 
-{
-    int result;
-    int err;
-
-    struct addrinfo addrInfoHintIp;
-    struct sockaddr_un addrInfoUn;
-    struct sockaddr* connect_addr;
-    socklen_t connect_addr_len;
-    struct addrinfo* addrInfoIp = NULL;
-
-    if (socket_io_instance->address_type == ADDRESS_TYPE_IP)
-    {
-        char portString[16];
-
-        memset(&addrInfoHintIp, 0, sizeof(addrInfoHintIp));
-        addrInfoHintIp.ai_family = AF_INET;
-        addrInfoHintIp.ai_socktype = SOCK_STREAM;
-
-        sprintf(portString, "%u", socket_io_instance->port);
-        err = getaddrinfo(socket_io_instance->hostname, portString, &addrInfoHintIp, &addrInfoIp);
-        if (err != 0)
-        {
-            LogError("Failure: getaddrinfo failure %d.", err);
-            result = __FAILURE__;
-        }
-        else
-        {
-            connect_addr = addrInfoIp->ai_addr;
-            connect_addr_len = sizeof(*addrInfoIp->ai_addr);
-            result = 0;
-        }
-    }
-    else
-    {
-        if (strlen(socket_io_instance->hostname) + 1 > sizeof(addrInfoUn.sun_path))
-        {
-            LogError("Hostname %s is too long for a unix socket (max len = %d)", socket_io_instance->hostname, sizeof(addrInfoUn.sun_path));
-            result = __FAILURE__;
-        }
-        else
-        {
-            memset(&addrInfoUn, 0, sizeof(addrInfoUn));
-            addrInfoUn.sun_family = AF_UNIX;
-            strncpy(addrInfoUn.sun_path, socket_io_instance->hostname, sizeof(addrInfoUn.sun_path) - 1);
-            
-            connect_addr = (struct sockaddr*)&addrInfoUn;
-            connect_addr_len = sizeof(addrInfoUn);
-            result = 0;
-        }
-    }
-    
-    if (result == 0)
-    {
-        int flags;
-
-        if ((-1 == (flags = fcntl(socket_io_instance->socket, F_GETFL, 0))) ||
-            (fcntl(socket_io_instance->socket, F_SETFL, flags | O_NONBLOCK) == -1))
-        {
-            LogError("Failure: fcntl failure.");
-            result = __FAILURE__;
-        }
-        else
-        {
-            err = connect(socket_io_instance->socket, connect_addr, connect_addr_len);
-            if ((err != 0) && (errno != EINPROGRESS))
-            {
-                LogError("Failure: connect failure %d.", errno);
-                result = __FAILURE__;
-            }
-        }    
-    }
-
-    if (addrInfoIp != NULL)
-    {
-        freeaddrinfo(addrInfoIp);
-    }
-    
-    return result;
-}
-
-static int wait_for_connection(SOCKET_IO_INSTANCE* socket_io_instance)
-{
-    int result;
-    int err;
-    int retval;
-    int select_errno = 0;
-
-    fd_set fdset;
-    struct timeval tv;
-    
-    FD_ZERO(&fdset);
-    FD_SET(socket_io_instance->socket, &fdset);
-    tv.tv_sec = CONNECT_TIMEOUT;
-    tv.tv_usec = 0;
-    
-    do
-    {
-        retval = select(socket_io_instance->socket + 1, NULL, &fdset, NULL, &tv);
-    
-        if (retval < 0)
-        {
-            select_errno = errno;
-        }
-    } while (retval < 0 && select_errno == EINTR);
-    
-    if (retval != 1)
-    {
-        LogError("Failure: select failure.");
-        result = __FAILURE__;
-    }
-    else
-    {
-        int so_error = 0;
-        socklen_t len = sizeof(so_error);
-        err = getsockopt(socket_io_instance->socket, SOL_SOCKET, SO_ERROR, &so_error, &len);
-        if (err != 0)
-        {
-            LogError("Failure: getsockopt failure %d.", errno);
-            result = __FAILURE__;
-        }
-        else if (so_error != 0)
-        {
-            err = so_error;
-            LogError("Failure: connect failure %d.", so_error);
-            result = __FAILURE__;
-        }
-        else
-        {
-            result = 0;
-        }
-    }
-
-    return result;
-}
-
-
-
-#ifndef __APPLE__
-static void destroy_network_interface_descriptions(NETWORK_INTERFACE_DESCRIPTION* nid)
-{
-    if (nid != NULL)
-    {
-        if (nid->next != NULL)
-        {
-            destroy_network_interface_descriptions(nid->next);
-        }
-    
-        if (nid->name != NULL)
-        {
-            free(nid->name);
-        }
-
-        if (nid->mac_address != NULL)
-        {
-            free(nid->mac_address);
-        }
-        
-        if (nid->ip_address != NULL)
-        {
-            free(nid->ip_address);
-        }
-
-        free(nid);
-    }
-}
-
-static NETWORK_INTERFACE_DESCRIPTION* create_network_interface_description(struct ifreq *ifr, NETWORK_INTERFACE_DESCRIPTION* previous_nid)
-{
-    NETWORK_INTERFACE_DESCRIPTION* result;
-    
-    if ((result = (NETWORK_INTERFACE_DESCRIPTION*)malloc(sizeof(NETWORK_INTERFACE_DESCRIPTION))) == NULL)
-    {
-        LogError("Failed allocating NETWORK_INTERFACE_DESCRIPTION");
-    }
-    else if ((result->name = (char*)malloc(sizeof(char) * (strlen(ifr->ifr_name) + 1))) == NULL)
-    {
-        LogError("failed setting interface description name (malloc failed)");
-        destroy_network_interface_descriptions(result);
-        result = NULL;
-    }
-    else if (strcpy(result->name, ifr->ifr_name) == NULL)
-    {
-        LogError("failed setting interface description name (strcpy failed)");
-        destroy_network_interface_descriptions(result);
-        result = NULL;
-    }
-    else
-    {
-        char* ip_address;
-        unsigned char* mac = (unsigned char*)ifr->ifr_hwaddr.sa_data;
-
-        if ((result->mac_address = (char*)malloc(sizeof(char) * MAC_ADDRESS_STRING_LENGTH)) == NULL)
-        {
-            LogError("failed formatting mac address (malloc failed)");
-            destroy_network_interface_descriptions(result);
-            result = NULL;
-        }
-        else if (sprintf(result->mac_address, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]) <= 0)
-        {
-            LogError("failed formatting mac address (sprintf failed)");
-            destroy_network_interface_descriptions(result);
-            result = NULL;
-        }
-        else if ((ip_address = inet_ntoa(((struct sockaddr_in*)&ifr->ifr_addr)->sin_addr)) == NULL)
-        {
-            LogError("failed setting the ip address (inet_ntoa failed)");
-            destroy_network_interface_descriptions(result);
-            result = NULL;
-        }
-        else if ((result->ip_address = (char*)malloc(sizeof(char) * (strlen(ip_address) + 1))) == NULL)
-        {
-            LogError("failed setting the ip address (malloc failed)");
-            destroy_network_interface_descriptions(result);
-            result = NULL;
-        }
-        else if (strcpy(result->ip_address, ip_address) == NULL)
-        {
-            LogError("failed setting the ip address (strcpy failed)");
-            destroy_network_interface_descriptions(result);
-            result = NULL;
-        }
-        else
-        {
-            result->next = NULL;
-
-            if (previous_nid != NULL)
-            {
-                previous_nid->next = result;
-            }
-        }
-    }
-    
-    return result;
-}
-
-static int get_network_interface_descriptions(int socket, NETWORK_INTERFACE_DESCRIPTION** nid)
-{
-    int result;
-
-    struct ifreq ifr;
-    struct ifconf ifc;
-    char buf[IFREQ_BUFFER_SIZE];
-
-    ifc.ifc_len = sizeof(buf);
-    ifc.ifc_buf = buf;
-
-    if (ioctl(socket, SIOCGIFCONF, &ifc) == -1)
-    {
-        LogError("ioctl failed querying socket (SIOCGIFCONF, errno=%s)", errno);
-        result = __FAILURE__;
-    }
-    else 
-    {
-        NETWORK_INTERFACE_DESCRIPTION* root_nid = NULL;
-        NETWORK_INTERFACE_DESCRIPTION* new_nid = NULL;
-
-        struct ifreq* it = ifc.ifc_req;
-        const struct ifreq* const end = it + (ifc.ifc_len / sizeof(struct ifreq));
-        
-        result = 0;
-
-        for (; it != end; ++it)
-        {
-            strcpy(ifr.ifr_name, it->ifr_name);
-
-            if (ioctl(socket, SIOCGIFFLAGS, &ifr) != 0)
-            {
-                LogError("ioctl failed querying socket (SIOCGIFFLAGS, errno=%d)", errno);
-                result = __FAILURE__;
-                break;
-            }
-            else if (ioctl(socket, SIOCGIFHWADDR, &ifr) != 0)
-            {
-                LogError("ioctl failed querying socket (SIOCGIFHWADDR, errno=%d)", errno);
-                result = __FAILURE__;
-                break;
-            }
-            else if (ioctl(socket, SIOCGIFADDR, &ifr) != 0)
-            {
-                LogError("ioctl failed querying socket (SIOCGIFADDR, errno=%d)", errno);
-                result = __FAILURE__;
-                break;
-            }
-            else if ((new_nid = create_network_interface_description(&ifr, new_nid)) == NULL)
-            {
-                LogError("Failed creating network interface description");
-                result = __FAILURE__;
-                break;    
-            }
-            else if (root_nid == NULL)
-            {
-                root_nid = new_nid;
-            }
-        }
-        
-        if (result == 0)
-        {
-            *nid = root_nid;
-        }
-        else
-        {
-            destroy_network_interface_descriptions(root_nid);
-        }
-    }
-
-    return result;
-}
-
-static int set_target_network_interface(int socket, char* mac_address)
-{
-    int result;
-    NETWORK_INTERFACE_DESCRIPTION* nid;
-
-    if (get_network_interface_descriptions(socket, &nid) != 0)
-    {
-        LogError("Failed getting network interface descriptions");
-        result = __FAILURE__;
-    }
-    else
-    {
-        NETWORK_INTERFACE_DESCRIPTION* current_nid = nid;
-    
-        while(current_nid != NULL)
-        {
-            if (strcmp(mac_address, current_nid->mac_address) == 0)
-            {
-                break;
-            }
-
-            current_nid = current_nid->next;
-        }
-
-        if (current_nid == NULL)
-        {
-            LogError("Did not find a network interface matching MAC ADDRESS");
-            result = __FAILURE__;
-        }
-        else if (setsockopt(socket, SOL_SOCKET, SO_BINDTODEVICE, current_nid->name, strlen(current_nid->name)) != 0)
-        {
-            LogError("setsockopt failed (%d)", errno);
-            result = __FAILURE__;
-        }
-        else
-        {
-            result = 0;
-        }
-        
-        destroy_network_interface_descriptions(nid);
-    }
-
-    return result;
-}
-#endif //__APPLE__
-
-CONCRETE_IO_HANDLE socketio_create(void* io_create_parameters)
-{
-    SOCKETIO_CONFIG* socket_io_config = io_create_parameters;
-    SOCKET_IO_INSTANCE* result;
-
-    if (socket_io_config == NULL)
-    {
-        LogError("Invalid argument: socket_io_config is NULL");
-        result = NULL;
-    }
-    else
-    {
-        result = malloc(sizeof(SOCKET_IO_INSTANCE));
-        if (result != NULL)
-        {
-            result->address_type = ADDRESS_TYPE_IP;
-            result->pending_io_list = singlylinkedlist_create();
-            if (result->pending_io_list == NULL)
-            {
-                LogError("Failure: singlylinkedlist_create unable to create pending list.");
-                free(result);
-                result = NULL;
-            }
-            else
-            {
-                if (socket_io_config->hostname != NULL)
-                {
-                    result->hostname = (char*)malloc(strlen(socket_io_config->hostname) + 1);
-                    if (result->hostname != NULL)
-                    {
-                        (void)strcpy(result->hostname, socket_io_config->hostname);
-                    }
-
-                    result->socket = INVALID_SOCKET;
-                }
-                else
-                {
-                    result->hostname = NULL;
-                    result->socket = *((int*)socket_io_config->accepted_socket);
-                }
-
-                if ((result->hostname == NULL) && (result->socket == INVALID_SOCKET))
-                {
-                    LogError("Failure: hostname == NULL and socket is invalid.");
-                    singlylinkedlist_destroy(result->pending_io_list);
-                    free(result);
-                    result = NULL;
-                }
-                else
-                {
-                    result->port = socket_io_config->port;
-                    result->target_mac_address = NULL;
-                    result->on_bytes_received = NULL;
-                    result->on_io_error = NULL;
-                    result->on_bytes_received_context = NULL;
-                    result->on_io_error_context = NULL;
-                    result->io_state = IO_STATE_CLOSED;
-                }
-            }
-        }
-        else
-        {
-            LogError("Allocation Failure: SOCKET_IO_INSTANCE");
-        }
-    }
-
-    return result;
-}
-
-void socketio_destroy(CONCRETE_IO_HANDLE socket_io)
-{
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        /* we cannot do much if the close fails, so just ignore the result */
-        if (socket_io_instance->socket != INVALID_SOCKET)
-        {
-            close(socket_io_instance->socket);
-        }
-
-        /* clear allpending IOs */
-        LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        while (first_pending_io != NULL)
-        {
-            PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-            if (pending_socket_io != NULL)
-            {
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-            }
-
-            (void)singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io);
-            first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        }
-
-        singlylinkedlist_destroy(socket_io_instance->pending_io_list);
-        free(socket_io_instance->hostname);
-        free(socket_io_instance->target_mac_address);
-        free(socket_io);
-    }
-}
-
-int socketio_open(CONCRETE_IO_HANDLE socket_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context)
-{
-    int result;
-
-    SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-    if (socket_io == NULL)
-    {
-        LogError("Invalid argument: SOCKET_IO_INSTANCE is NULL");
-        result = __FAILURE__;
-    }
-    else
-    {
-        if (socket_io_instance->io_state != IO_STATE_CLOSED)
-        {
-            LogError("Failure: socket state is not closed.");
-            result = __FAILURE__;
-        }
-        else if (socket_io_instance->socket != INVALID_SOCKET)
-        {
-            // Opening an accepted socket
-            socket_io_instance->on_bytes_received_context = on_bytes_received_context;
-            socket_io_instance->on_bytes_received = on_bytes_received;
-            socket_io_instance->on_io_error = on_io_error;
-            socket_io_instance->on_io_error_context = on_io_error_context;
-
-            socket_io_instance->io_state = IO_STATE_OPEN;
-
-            result = 0;
-        }
-        else
-        {
-            socket_io_instance->socket = socket (socket_io_instance->address_type == ADDRESS_TYPE_IP ? AF_INET : AF_UNIX, SOCK_STREAM, 0);
-            if (socket_io_instance->socket < SOCKET_SUCCESS)
-            {
-                LogError("Failure: socket create failure %d.", socket_io_instance->socket);
-                result = __FAILURE__;
-            }
-#ifndef __APPLE__
-            else if (socket_io_instance->target_mac_address != NULL &&
-                     set_target_network_interface(socket_io_instance->socket, socket_io_instance->target_mac_address) != 0)
-            {
-                LogError("Failure: failed selecting target network interface (MACADDR=%s).", socket_io_instance->target_mac_address);
-                result = __FAILURE__;
-            }
-#endif //__APPLE__
-            else if ((result = lookup_address_and_initiate_socket_connection(socket_io_instance)) != 0)
-            {
-                LogError("lookup_address_and_connect_socket failed");
-            }
-            else if ((result = wait_for_connection(socket_io_instance)) != 0)
-            {
-                LogError("wait_for_connection failed");
-            }
-
-            if (result == 0)
-            {
-                socket_io_instance->on_bytes_received = on_bytes_received;
-                socket_io_instance->on_bytes_received_context = on_bytes_received_context;
-
-                socket_io_instance->on_io_error = on_io_error;
-                socket_io_instance->on_io_error_context = on_io_error_context;
-
-                socket_io_instance->io_state = IO_STATE_OPEN;
-            }
-            else
-            {
-                if (socket_io_instance->socket >= SOCKET_SUCCESS)
-                {
-                    close(socket_io_instance->socket);
-                }
-                socket_io_instance->socket = INVALID_SOCKET;
-            }
-        }
-    }
-
-    if (on_io_open_complete != NULL)
-    {
-        on_io_open_complete(on_io_open_complete_context, result == 0 ? IO_OPEN_OK : IO_OPEN_ERROR);
-    }
-
-    return result;
-}
-
-int socketio_close(CONCRETE_IO_HANDLE socket_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* callback_context)
-{
-    int result = 0;
-
-    if (socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if ((socket_io_instance->io_state != IO_STATE_CLOSED) && (socket_io_instance->io_state != IO_STATE_CLOSING))
-        {
-            // Only close if the socket isn't already in the closed or closing state
-            (void)shutdown(socket_io_instance->socket, SHUT_RDWR);
-            close(socket_io_instance->socket);
-            socket_io_instance->socket = INVALID_SOCKET;
-            socket_io_instance->io_state = IO_STATE_CLOSED;
-        }
-
-        if (on_io_close_complete != NULL)
-        {
-            on_io_close_complete(callback_context);
-        }
-
-        result = 0;
-    }
-
-    return result;
-}
-
-int socketio_send(CONCRETE_IO_HANDLE socket_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-
-    if ((socket_io == NULL) ||
-        (buffer == NULL) ||
-        (size == 0))
-    {
-        /* Invalid arguments */
-        LogError("Invalid argument: send given invalid parameter");
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if (socket_io_instance->io_state != IO_STATE_OPEN)
-        {
-            LogError("Failure: socket state is not opened.");
-            result = __FAILURE__;
-        }
-        else
-        {
-            LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            if (first_pending_io != NULL)
-            {
-                if (add_pending_io(socket_io_instance, buffer, size, on_send_complete, callback_context) != 0)
-                {
-                    LogError("Failure: add_pending_io failed.");
-                    result = __FAILURE__;
-                }
-                else
-                {
-                    result = 0;
-                }
-            }
-            else
-            {
-                signal(SIGPIPE, SIG_IGN);
-
-                ssize_t send_result = send(socket_io_instance->socket, buffer, size, 0);
-                if ((send_result < 0) || ((size_t)send_result != size))
-                {
-                    if (send_result == INVALID_SOCKET)
-                    {
-                        if (errno == EAGAIN) /*send says "come back later" with EAGAIN - likely the socket buffer cannot accept more data*/
-                        {
-                            /*do nothing*/
-                            result = 0;
-                        }
-                        else
-                        {
-                            LogError("Failure: sending socket failed. errno=%d (%s).", errno, strerror(errno));
-                            result = __FAILURE__;
-                        }
-                    }
-                    else
-                    {
-                        /* queue data */
-                        if (add_pending_io(socket_io_instance, buffer + send_result, size - send_result, on_send_complete, callback_context) != 0)
-                        {
-                            LogError("Failure: add_pending_io failed.");
-                            result = __FAILURE__;
-                        }
-                        else
-                        {
-                            result = 0;
-                        }
-                    }
-                }
-                else
-                {
-                    if (on_send_complete != NULL)
-                    {
-                        on_send_complete(callback_context, IO_SEND_OK);
-                    }
-
-                    result = 0;
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-void socketio_dowork(CONCRETE_IO_HANDLE socket_io)
-{
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        while (first_pending_io != NULL)
-        {
-            PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-            if (pending_socket_io == NULL)
-            {
-                socket_io_instance->io_state = IO_STATE_ERROR;
-                indicate_error(socket_io_instance);
-                LogError("Failure: retrieving socket from list");
-                break;
-            }
-
-            signal(SIGPIPE, SIG_IGN);
-
-            ssize_t send_result = send(socket_io_instance->socket, pending_socket_io->bytes, pending_socket_io->size, 0);
-            if ((send_result < 0) || ((size_t)send_result != pending_socket_io->size))
-            {
-                if (send_result == INVALID_SOCKET)
-                {
-                    if (errno == EAGAIN) /*send says "come back later" with EAGAIN - likely the socket buffer cannot accept more data*/
-                    {
-                        /*do nothing until next dowork */
-                        break;
-                    }
-                    else
-                    {
-                        free(pending_socket_io->bytes);
-                        free(pending_socket_io);
-                        (void)singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io);
-
-                        LogError("Failure: sending Socket information. errno=%d (%s).", errno, strerror(errno));
-                        socket_io_instance->io_state = IO_STATE_ERROR;
-                        indicate_error(socket_io_instance);
-                    }
-                }
-                else
-                {
-                    /* simply wait until next dowork */
-                    (void)memmove(pending_socket_io->bytes, pending_socket_io->bytes + send_result, pending_socket_io->size - send_result);
-                    pending_socket_io->size -= send_result;
-                    break;
-                }
-            }
-            else
-            {
-                if (pending_socket_io->on_send_complete != NULL)
-                {
-                    pending_socket_io->on_send_complete(pending_socket_io->callback_context, IO_SEND_OK);
-                }
-
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-                if (singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io) != 0)
-                {
-                    socket_io_instance->io_state = IO_STATE_ERROR;
-                    indicate_error(socket_io_instance);
-                    LogError("Failure: unable to remove socket from list");
-                }
-            }
-
-            first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        }
-
-        if (socket_io_instance->io_state == IO_STATE_OPEN)
-        {
-            ssize_t received = 0;
-            do
-            {
-                received = recv(socket_io_instance->socket, socket_io_instance->recv_bytes, RECEIVE_BYTES_VALUE, 0);
-                if (received > 0)
-                {
-                    if (socket_io_instance->on_bytes_received != NULL)
-                    {
-                        /* Explicitly ignoring here the result of the callback */
-                        (void)socket_io_instance->on_bytes_received(socket_io_instance->on_bytes_received_context, socket_io_instance->recv_bytes, received);
-                    }
-                }
-                else if (received == 0)
-                {
-                    // Do not log error here due to this is probably the socket being closed on the other end
-                    indicate_error(socket_io_instance);
-                }
-                else if (received < 0 && errno != EAGAIN)
-                {
-                    LogError("Socketio_Failure: Receiving data from endpoint: errno=%d.", errno);
-                    indicate_error(socket_io_instance);
-                }
-
-            } while (received > 0 && socket_io_instance->io_state == IO_STATE_OPEN);
-        }
-    }
-}
-
-// Edison is missing this from netinet/tcp.h, but this code still works if we manually define it.
-#ifndef SOL_TCP
-#define SOL_TCP 6
-#endif
-
-#ifndef __APPLE__
-static void strtoup(char* str)
-{
-    if (str != NULL)
-    {
-        while (*str != '\0')
-        {
-            if (isalpha((int)*str) && islower((int)*str))
-            {
-                *str = (char)toupper((int)*str);
-            }
-            str++;
-        }
-    }
-}
-#endif // __APPLE__
-
-static int socketio_setaddresstype_option(SOCKET_IO_INSTANCE* socket_io_instance, const char* addressType)
-{
-    int result;
-
-    if (socket_io_instance->io_state != IO_STATE_CLOSED)
-    {
-        LogError("Socket's type can only be changed when in state 'IO_STATE_CLOSED'.  Current state=%d", socket_io_instance->io_state);
-        result = __FAILURE__;
-    }
-    else if (strcmp(addressType, OPTION_ADDRESS_TYPE_DOMAIN_SOCKET) == 0)
-    {
-        socket_io_instance->address_type = ADDRESS_TYPE_DOMAIN_SOCKET;
-        result = 0;
-    }
-    else if (strcmp(addressType, OPTION_ADDRESS_TYPE_IP_SOCKET) == 0)
-    {
-        socket_io_instance->address_type = ADDRESS_TYPE_IP;
-        result = 0;
-    }
-    else
-    {
-        LogError("Address type %s is not supported", addressType);
-        result = __FAILURE__;
-    }
-
-    return result;
-}
-
-int socketio_setoption(CONCRETE_IO_HANDLE socket_io, const char* optionName, const void* value)
-{
-    int result;
-
-    if (socket_io == NULL ||
-        optionName == NULL ||
-        value == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-
-        if (strcmp(optionName, "tcp_keepalive") == 0)
-        {
-            result = setsockopt(socket_io_instance->socket, SOL_SOCKET, SO_KEEPALIVE, value, sizeof(int));
-            if (result == -1) result = errno;
-        }
-        else if (strcmp(optionName, "tcp_keepalive_time") == 0)
-        {
-#ifdef __APPLE__
-            result = setsockopt(socket_io_instance->socket, IPPROTO_TCP, TCP_KEEPALIVE, value, sizeof(int));
-#else
-            result = setsockopt(socket_io_instance->socket, SOL_TCP, TCP_KEEPIDLE, value, sizeof(int));
-#endif
-            if (result == -1) result = errno;
-        }
-        else if (strcmp(optionName, "tcp_keepalive_interval") == 0)
-        {
-            result = setsockopt(socket_io_instance->socket, SOL_TCP, TCP_KEEPINTVL, value, sizeof(int));
-            if (result == -1) result = errno;
-        }
-        else if (strcmp(optionName, OPTION_NET_INT_MAC_ADDRESS) == 0)
-        {
-#ifdef __APPLE__
-            LogError("option not supported.");
-            result = __FAILURE__;
-#else
-            if (strlen(value) == 0)
-            {
-                LogError("option value must be a valid mac address");
-                result = __FAILURE__;
-            }
-            else if ((socket_io_instance->target_mac_address = (char*)malloc(sizeof(char) * (strlen(value) + 1))) == NULL)
-            {
-                LogError("failed setting net_interface_mac_address option (malloc failed)");
-                result = __FAILURE__;
-            }
-            else if (strcpy(socket_io_instance->target_mac_address, value) == NULL)
-            {
-                LogError("failed setting net_interface_mac_address option (strcpy failed)");
-                free(socket_io_instance->target_mac_address);
-                socket_io_instance->target_mac_address = NULL;
-                result = __FAILURE__;
-            }
-            else
-            {
-                strtoup(socket_io_instance->target_mac_address);
-                result = 0;
-            }
-#endif
-        }
-        else if (strcmp(optionName, OPTION_ADDRESS_TYPE) == 0)
-        {
-            result = socketio_setaddresstype_option(socket_io_instance, (const char*)value);
-        }
-        else
-        {
-            result = __FAILURE__;
-        }
-    }
-
-    return result;
-}
-
-const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
-{
-    return &socket_io_interface_description;
-}
-

+ 0 - 460
azure/c-utility/adapters/socketio_mbed.c

@@ -1,460 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include "azure_c_shared_utility/socketio.h"
-#include "azure_c_shared_utility/singlylinkedlist.h"
-#include "azure_c_shared_utility/tcpsocketconnection_c.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-#define UNABLE_TO_COMPLETE -2
-#define MBED_RECEIVE_BYTES_VALUE    128
-
-typedef enum IO_STATE_TAG
-{
-    IO_STATE_CLOSED,
-    IO_STATE_OPENING,
-    IO_STATE_OPEN,
-    IO_STATE_CLOSING,
-    IO_STATE_ERROR
-} IO_STATE;
-
-typedef struct PENDING_SOCKET_IO_TAG
-{
-    unsigned char* bytes;
-    size_t size;
-    ON_SEND_COMPLETE on_send_complete;
-    void* callback_context;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-} PENDING_SOCKET_IO;
-
-typedef struct SOCKET_IO_INSTANCE_TAG
-{
-    TCPSOCKETCONNECTION_HANDLE tcp_socket_connection;
-    ON_BYTES_RECEIVED on_bytes_received;
-    ON_IO_ERROR on_io_error;
-    void* on_bytes_received_context;
-    void* on_io_error_context;
-    char* hostname;
-    int port;
-    IO_STATE io_state;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-} SOCKET_IO_INSTANCE;
-
-/*this function will clone an option given by name and value*/
-static void* socketio_CloneOption(const char* name, const void* value)
-{
-    (void)name;
-    (void)value;
-    return NULL;
-}
-
-/*this function destroys an option previously created*/
-static void socketio_DestroyOption(const char* name, const void* value)
-{
-    (void)name;
-    (void)value;
-}
-
-static OPTIONHANDLER_HANDLE socketio_retrieveoptions(CONCRETE_IO_HANDLE socket_io)
-{
-    OPTIONHANDLER_HANDLE result;
-    (void)socket_io;
-    result = OptionHandler_Create(socketio_CloneOption, socketio_DestroyOption, socketio_setoption);
-    if (result == NULL)
-    {
-        /*return as is*/
-    }
-    else
-    {
-        /*insert here work to add the options to "result" handle*/
-    }
-    return result;
-}
-
-static const IO_INTERFACE_DESCRIPTION socket_io_interface_description =
-{
-    socketio_retrieveoptions,
-    socketio_create,
-    socketio_destroy,
-    socketio_open,
-    socketio_close,
-    socketio_send,
-    socketio_dowork,
-    socketio_setoption
-};
-
-static void indicate_error(SOCKET_IO_INSTANCE* socket_io_instance)
-{
-    if (socket_io_instance->on_io_error != NULL)
-    {
-        socket_io_instance->on_io_error(socket_io_instance->on_io_error_context);
-    }
-}
-
-static int add_pending_io(SOCKET_IO_INSTANCE* socket_io_instance, const unsigned char* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-    PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)malloc(sizeof(PENDING_SOCKET_IO));
-    if (pending_socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        pending_socket_io->bytes = (unsigned char*)malloc(size);
-        if (pending_socket_io->bytes == NULL)
-        {
-            free(pending_socket_io);
-            result = __FAILURE__;
-        }
-        else
-        {
-            pending_socket_io->size = size;
-            pending_socket_io->on_send_complete = on_send_complete;
-            pending_socket_io->callback_context = callback_context;
-            pending_socket_io->pending_io_list = socket_io_instance->pending_io_list;
-            (void)memcpy(pending_socket_io->bytes, buffer, size);
-
-            if (singlylinkedlist_add(socket_io_instance->pending_io_list, pending_socket_io) == NULL)
-            {
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-                result = __FAILURE__;
-            }
-            else
-            {
-                result = 0;
-            }
-        }
-    }
-
-    return result;
-}
-
-CONCRETE_IO_HANDLE socketio_create(void* io_create_parameters)
-{
-    SOCKETIO_CONFIG* socket_io_config = io_create_parameters;
-    SOCKET_IO_INSTANCE* result;
-
-    if (socket_io_config == NULL)
-    {
-        result = NULL;
-    }
-    else
-    {
-        result = malloc(sizeof(SOCKET_IO_INSTANCE));
-        if (result != NULL)
-        {
-            result->pending_io_list = singlylinkedlist_create();
-            if (result->pending_io_list == NULL)
-            {
-                free(result);
-                result = NULL;
-            }
-            else
-            {
-                result->hostname = (char*)malloc(strlen(socket_io_config->hostname) + 1);
-                if (result->hostname == NULL)
-                {
-                    singlylinkedlist_destroy(result->pending_io_list);
-                    free(result);
-                    result = NULL;
-                }
-                else
-                {
-                    strcpy(result->hostname, socket_io_config->hostname);
-                    result->port = socket_io_config->port;
-                    result->on_bytes_received = NULL;
-                    result->on_io_error = NULL;
-                    result->on_bytes_received_context = NULL;
-                    result->on_io_error_context = NULL;
-                    result->io_state = IO_STATE_CLOSED;
-                    result->tcp_socket_connection = NULL;
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-void socketio_destroy(CONCRETE_IO_HANDLE socket_io)
-{
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-
-        tcpsocketconnection_destroy(socket_io_instance->tcp_socket_connection);
-
-        /* clear all pending IOs */
-        LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        while (first_pending_io != NULL)
-        {
-            PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-            if (pending_socket_io != NULL)
-            {
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-            }
-
-            (void)singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io);
-            first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-        }
-
-        singlylinkedlist_destroy(socket_io_instance->pending_io_list);
-        free(socket_io_instance->hostname);
-        free(socket_io);
-    }
-}
-
-int socketio_open(CONCRETE_IO_HANDLE socket_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context)
-{
-    int result;
-
-    SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-    if (socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        socket_io_instance->tcp_socket_connection = tcpsocketconnection_create();
-        if (socket_io_instance->tcp_socket_connection == NULL)
-        {
-            result = __FAILURE__;
-        }
-        else
-        {
-            if (tcpsocketconnection_connect(socket_io_instance->tcp_socket_connection, socket_io_instance->hostname, socket_io_instance->port) != 0)
-            {
-                tcpsocketconnection_destroy(socket_io_instance->tcp_socket_connection);
-                socket_io_instance->tcp_socket_connection = NULL;
-                result = __FAILURE__;
-            }
-            else
-            {
-                tcpsocketconnection_set_blocking(socket_io_instance->tcp_socket_connection, false, 0);
-
-                socket_io_instance->on_bytes_received = on_bytes_received;
-                socket_io_instance->on_bytes_received_context = on_bytes_received_context;
-
-                socket_io_instance->on_io_error = on_io_error;
-                socket_io_instance->on_io_error_context = on_io_error_context;
-
-                socket_io_instance->io_state = IO_STATE_OPEN;
-
-                result = 0;
-            }
-        }
-    }
-    
-    if (on_io_open_complete != NULL)
-    {
-        on_io_open_complete(on_io_open_complete_context, result == 0 ? IO_OPEN_OK : IO_OPEN_ERROR);
-    }
-
-    return result;
-}
-
-int socketio_close(CONCRETE_IO_HANDLE socket_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* callback_context)
-{
-    int result = 0;
-
-    if (socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-
-        if ((socket_io_instance->io_state == IO_STATE_CLOSED) ||
-            (socket_io_instance->io_state == IO_STATE_CLOSING))
-        {
-            result = __FAILURE__;
-        }
-        else
-        {
-            tcpsocketconnection_close(socket_io_instance->tcp_socket_connection);
-            socket_io_instance->tcp_socket_connection = NULL;
-            socket_io_instance->io_state = IO_STATE_CLOSED;
-
-            if (on_io_close_complete != NULL)
-            {
-                on_io_close_complete(callback_context);
-            }
-
-            result = 0;
-        }
-    }
-
-    return result;
-}
-
-int socketio_send(CONCRETE_IO_HANDLE socket_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-
-    if ((socket_io == NULL) ||
-        (buffer == NULL) ||
-        (size == 0))
-    {
-        /* Invalid arguments */
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if (socket_io_instance->io_state != IO_STATE_OPEN)
-        {
-            result = __FAILURE__;
-        }
-        else
-        {
-            LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            if (first_pending_io != NULL)
-            {
-                if (add_pending_io(socket_io_instance, buffer, size, on_send_complete, callback_context) != 0)
-                {
-                    result = __FAILURE__;
-                }
-                else
-                {
-                    result = 0;
-                }
-            }
-            else
-            {
-                int send_result = tcpsocketconnection_send(socket_io_instance->tcp_socket_connection, buffer, size);
-                if (send_result != size)
-                {
-                    if (send_result < 0)
-                    {
-                        send_result = 0;
-                    }
-
-                    /* queue data */
-                    if (add_pending_io(socket_io_instance, (unsigned char*)buffer + send_result, size - send_result, on_send_complete, callback_context) != 0)
-                    {
-                        result = __FAILURE__;
-                    }
-                    else
-                    {
-                        result = 0;
-                    }
-                }
-                else
-                {
-                    if (on_send_complete != NULL)
-                    {
-                        on_send_complete(callback_context, IO_SEND_OK);
-                    }
-
-                    result = 0;
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-void socketio_dowork(CONCRETE_IO_HANDLE socket_io)
-{
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if (socket_io_instance->io_state == IO_STATE_OPEN)
-        {
-            int received = 1;
-
-            LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            while (first_pending_io != NULL)
-            {
-                PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-                if (pending_socket_io == NULL)
-                {
-                    socket_io_instance->io_state = IO_STATE_ERROR;
-                    indicate_error(socket_io_instance);
-                    break;
-                }
-
-                int send_result = tcpsocketconnection_send(socket_io_instance->tcp_socket_connection, (const char*)pending_socket_io->bytes, pending_socket_io->size);
-                if (send_result != pending_socket_io->size)
-                {
-                    if (send_result < 0)
-                    {
-                        if (send_result < UNABLE_TO_COMPLETE)
-                        {
-                            // Bad error.  Indicate as much.
-                            socket_io_instance->io_state = IO_STATE_ERROR;
-                            indicate_error(socket_io_instance);
-                        }
-                        break;
-                    }
-                    else
-                    {
-                        /* send something, wait for the rest */
-                        (void)memmove(pending_socket_io->bytes, pending_socket_io->bytes + send_result, pending_socket_io->size - send_result);
-                    }
-                }
-                else
-                {
-                    if (pending_socket_io->on_send_complete != NULL)
-                    {
-                        pending_socket_io->on_send_complete(pending_socket_io->callback_context, IO_SEND_OK);
-                    }
-
-                    free(pending_socket_io->bytes);
-                    free(pending_socket_io);
-                    if (singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io) != 0)
-                    {
-                        socket_io_instance->io_state = IO_STATE_ERROR;
-                        indicate_error(socket_io_instance);
-                    }
-                }
-
-                first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            }
-
-            while (received > 0)
-            {
-                unsigned char* recv_bytes = malloc(MBED_RECEIVE_BYTES_VALUE);
-                if (recv_bytes == NULL)
-                {
-                    LogError("Socketio_Failure: NULL allocating input buffer.");
-                    indicate_error(socket_io_instance);
-                }
-                else
-                {
-                    received = tcpsocketconnection_receive(socket_io_instance->tcp_socket_connection, (char*)recv_bytes, MBED_RECEIVE_BYTES_VALUE);
-                    if (received > 0)
-                    {
-                        if (socket_io_instance->on_bytes_received != NULL)
-                        {
-                            /* explictly ignoring here the result of the callback */
-                            (void)socket_io_instance->on_bytes_received(socket_io_instance->on_bytes_received_context, recv_bytes, received);
-                        }
-                    }
-                    free(recv_bytes);
-                }
-            }
-        }
-    }
-}
-
-int socketio_setoption(CONCRETE_IO_HANDLE socket_io, const char* optionName, const void* value)
-{
-    /* Not implementing any options */
-    return __FAILURE__;
-}
-
-const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
-{
-    return &socket_io_interface_description;
-}

+ 0 - 613
azure/c-utility/adapters/socketio_win32.c

@@ -1,613 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#include <mstcpip.h>
-#include "azure_c_shared_utility/socketio.h"
-#include "azure_c_shared_utility/singlylinkedlist.h"
-#include "azure_c_shared_utility/gballoc.h"
-#include "azure_c_shared_utility/gbnetwork.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-typedef enum IO_STATE_TAG
-{
-    IO_STATE_CLOSED,
-    IO_STATE_OPENING,
-    IO_STATE_OPEN,
-    IO_STATE_CLOSING
-} IO_STATE;
-
-typedef struct PENDING_SOCKET_IO_TAG
-{
-    unsigned char* bytes;
-    size_t size;
-    ON_SEND_COMPLETE on_send_complete;
-    void* callback_context;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-} PENDING_SOCKET_IO;
-
-typedef struct SOCKET_IO_INSTANCE_TAG
-{
-    SOCKET socket;
-    ON_BYTES_RECEIVED on_bytes_received;
-    ON_IO_ERROR on_io_error;
-    void* on_bytes_received_context;
-    void* on_io_error_context;
-    char* hostname;
-    int port;
-    IO_STATE io_state;
-    SINGLYLINKEDLIST_HANDLE pending_io_list;
-    struct tcp_keepalive keep_alive;
-    unsigned char recv_bytes[RECEIVE_BYTES_VALUE];
-} SOCKET_IO_INSTANCE;
-
-/*this function will clone an option given by name and value*/
-static void* socketio_CloneOption(const char* name, const void* value)
-{
-    (void)name;
-    (void)value;
-    return NULL;
-}
-
-/*this function destroys an option previously created*/
-static void socketio_DestroyOption(const char* name, const void* value)
-{
-    (void)name;
-    (void)value;
-}
-
-static OPTIONHANDLER_HANDLE socketio_retrieveoptions(CONCRETE_IO_HANDLE handle)
-{
-    OPTIONHANDLER_HANDLE result;
-    (void)handle;
-    result = OptionHandler_Create(socketio_CloneOption, socketio_DestroyOption, socketio_setoption);
-    if (result == NULL)
-    {
-        LogError("unable to OptionHandler_Create");
-        /*return as is*/
-    }
-    else
-    {
-        /*insert here work to add the options to "result" handle*/
-    }
-    return result;
-}
-
-static const IO_INTERFACE_DESCRIPTION socket_io_interface_description =
-{
-    socketio_retrieveoptions,
-    socketio_create,
-    socketio_destroy,
-    socketio_open,
-    socketio_close,
-    socketio_send,
-    socketio_dowork,
-    socketio_setoption
-};
-
-static void indicate_error(SOCKET_IO_INSTANCE* socket_io_instance)
-{
-    if (socket_io_instance->on_io_error != NULL)
-    {
-        socket_io_instance->on_io_error(socket_io_instance->on_io_error_context);
-    }
-}
-
-static int add_pending_io(SOCKET_IO_INSTANCE* socket_io_instance, const unsigned char* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-    PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)malloc(sizeof(PENDING_SOCKET_IO));
-    if (pending_socket_io == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        pending_socket_io->bytes = (unsigned char*)malloc(size);
-        if (pending_socket_io->bytes == NULL)
-        {
-            LogError("Allocation Failure: Unable to allocate pending list.");
-            free(pending_socket_io);
-            result = __FAILURE__;
-        }
-        else
-        {
-            pending_socket_io->size = size;
-            pending_socket_io->on_send_complete = on_send_complete;
-            pending_socket_io->callback_context = callback_context;
-            pending_socket_io->pending_io_list = socket_io_instance->pending_io_list;
-            (void)memcpy(pending_socket_io->bytes, buffer, size);
-
-            if (singlylinkedlist_add(socket_io_instance->pending_io_list, pending_socket_io) == NULL)
-            {
-                LogError("Failure: Unable to add socket to pending list.");
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-                result = __FAILURE__;
-            }
-            else
-            {
-                result = 0;
-            }
-        }
-    }
-
-    return result;
-}
-
-CONCRETE_IO_HANDLE socketio_create(void* io_create_parameters)
-{
-    SOCKETIO_CONFIG* socket_io_config = (SOCKETIO_CONFIG*)io_create_parameters;
-    SOCKET_IO_INSTANCE* result;
-    struct tcp_keepalive tcp_keepalive = { 0, 0, 0 };
-    
-    if (socket_io_config == NULL)
-    {
-        LogError("Invalid argument: socket_io_config is NULL");
-        result = NULL;
-    }
-    else
-    {
-        result = (SOCKET_IO_INSTANCE*)malloc(sizeof(SOCKET_IO_INSTANCE));
-        if (result != NULL)
-        {
-            result->pending_io_list = singlylinkedlist_create();
-            if (result->pending_io_list == NULL)
-            {
-                LogError("Failure: singlylinkedlist_create unable to create pending list.");
-                free(result);
-                result = NULL;
-            }
-            else
-            {
-                if (socket_io_config->hostname != NULL)
-                {
-                    result->hostname = (char*)malloc(strlen(socket_io_config->hostname) + 1);
-                    if (result->hostname != NULL)
-                    {
-                        (void)strcpy(result->hostname, socket_io_config->hostname);
-                    }
-
-                    result->socket = INVALID_SOCKET;
-                }
-                else
-                {
-                    result->hostname = NULL;
-                    result->socket = *((SOCKET*)socket_io_config->accepted_socket);
-                }
-
-                if ((result->hostname == NULL) && (result->socket == INVALID_SOCKET))
-                {
-                    LogError("Failure: hostname == NULL and socket is invalid.");
-                    singlylinkedlist_destroy(result->pending_io_list);
-                    free(result);
-                    result = NULL;
-                }
-                else
-                {
-                    result->port = socket_io_config->port;
-                    result->on_bytes_received = NULL;
-                    result->on_io_error = NULL;
-                    result->on_bytes_received_context = NULL;
-                    result->on_io_error_context = NULL;
-                    result->io_state = IO_STATE_CLOSED;
-                    result->keep_alive = tcp_keepalive;
-                    
-                }
-            }
-        }
-        else
-        {
-            LogError("Allocation Failure: SOCKET_IO_INSTANCE");
-        }
-    }
-
-    return (XIO_HANDLE)result;
-}
-
-void socketio_destroy(CONCRETE_IO_HANDLE socket_io)
-{
-    LIST_ITEM_HANDLE first_pending_io;
-
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        /* we cannot do much if the close fails, so just ignore the result */
-        (void)closesocket(socket_io_instance->socket);
-
-        /* clear allpending IOs */
-        
-        while ((first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list)) != NULL)
-        {
-            PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-            if (pending_socket_io != NULL)
-            {
-                free(pending_socket_io->bytes);
-                free(pending_socket_io);
-            }
-
-            singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io);
-        }
-
-        singlylinkedlist_destroy(socket_io_instance->pending_io_list);
-        if (socket_io_instance->hostname != NULL)
-        {
-            free(socket_io_instance->hostname);
-        }
-
-        free(socket_io);
-    }
-}
-
-int socketio_open(CONCRETE_IO_HANDLE socket_io, ON_IO_OPEN_COMPLETE on_io_open_complete, void* on_io_open_complete_context, ON_BYTES_RECEIVED on_bytes_received, void* on_bytes_received_context, ON_IO_ERROR on_io_error, void* on_io_error_context)
-{
-    int result;
-
-    SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-    if (socket_io == NULL)
-    {
-        LogError("Invalid argument: SOCKET_IO_INSTANCE is NULL");
-        result = __FAILURE__;
-    }
-    else
-    {
-        if (socket_io_instance->io_state != IO_STATE_CLOSED)
-        {
-            LogError("Failure: socket state is not closed.");
-            result = __FAILURE__;
-        }
-        else if (socket_io_instance->socket != INVALID_SOCKET)
-        {
-            // Opening an accepted socket
-            socket_io_instance->on_bytes_received_context = on_bytes_received_context;
-            socket_io_instance->on_bytes_received = on_bytes_received;
-            socket_io_instance->on_io_error = on_io_error;
-            socket_io_instance->on_io_error_context = on_io_error_context;
-
-            socket_io_instance->io_state = IO_STATE_OPEN;
-
-            result = 0;
-        }
-        else
-        {
-            socket_io_instance->socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-            if (socket_io_instance->socket == INVALID_SOCKET)
-            {
-                LogError("Failure: socket create failure %d.", WSAGetLastError());
-                result = __FAILURE__;
-            }
-            else
-            {
-                char portString[16];
-                ADDRINFO addrHint = { 0 };
-                ADDRINFO* addrInfo = NULL;
-
-                addrHint.ai_family = AF_INET;
-                addrHint.ai_socktype = SOCK_STREAM;
-                addrHint.ai_protocol = 0;
-                sprintf(portString, "%u", socket_io_instance->port);
-                if (getaddrinfo(socket_io_instance->hostname, portString, &addrHint, &addrInfo) != 0)
-                {
-                    LogError("Failure: getaddrinfo failure %d.", WSAGetLastError());
-                    (void)closesocket(socket_io_instance->socket);
-                    socket_io_instance->socket = INVALID_SOCKET;
-                    result = __FAILURE__;
-                }
-                else
-                {
-                    u_long iMode = 1;
-
-                    if (connect(socket_io_instance->socket, addrInfo->ai_addr, (int)addrInfo->ai_addrlen) != 0)
-                    {
-                        LogError("Failure: connect failure %d.", WSAGetLastError());
-                        (void)closesocket(socket_io_instance->socket);
-                        socket_io_instance->socket = INVALID_SOCKET;
-                        result = __FAILURE__;
-                    }
-                    else if (ioctlsocket(socket_io_instance->socket, FIONBIO, &iMode) != 0)
-                    {
-                        LogError("Failure: ioctlsocket failure %d.", WSAGetLastError());
-                        (void)closesocket(socket_io_instance->socket);
-                        socket_io_instance->socket = INVALID_SOCKET;
-                        result = __FAILURE__;
-                    }
-                    else
-                    {
-                        socket_io_instance->on_bytes_received = on_bytes_received;
-                        socket_io_instance->on_bytes_received_context = on_bytes_received_context;
-
-                        socket_io_instance->on_io_error = on_io_error;
-                        socket_io_instance->on_io_error_context = on_io_error_context;
-
-                        socket_io_instance->io_state = IO_STATE_OPEN;
-
-                        result = 0;
-                    }
-
-                    freeaddrinfo(addrInfo);
-                }
-            }
-        }
-    }
-
-    if (on_io_open_complete != NULL)
-    {
-        on_io_open_complete(on_io_open_complete_context, result == 0 ? IO_OPEN_OK : IO_OPEN_ERROR);
-    }
-
-    return result;
-}
-
-int socketio_close(CONCRETE_IO_HANDLE socket_io, ON_IO_CLOSE_COMPLETE on_io_close_complete, void* callback_context)
-{
-    int result;
-
-    if (socket_io == NULL)
-    {
-        LogError("Invalid argument: socket_io is NULL");
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-
-        if ((socket_io_instance->io_state != IO_STATE_CLOSING) &&
-            (socket_io_instance->io_state != IO_STATE_CLOSED))
-        {
-            (void)closesocket(socket_io_instance->socket);
-            socket_io_instance->socket = INVALID_SOCKET;
-            socket_io_instance->io_state = IO_STATE_CLOSED;
-        }
-        if (on_io_close_complete != NULL)
-        {
-            on_io_close_complete(callback_context);
-        }
-        result = 0;
-    }
-
-    return result;
-}
-
-int socketio_send(CONCRETE_IO_HANDLE socket_io, const void* buffer, size_t size, ON_SEND_COMPLETE on_send_complete, void* callback_context)
-{
-    int result;
-
-    if ((socket_io == NULL) ||
-        (buffer == NULL) ||
-        (size == 0))
-    {
-        /* Invalid arguments */
-        LogError("Invalid argument: send given invalid parameter");
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if (socket_io_instance->io_state != IO_STATE_OPEN)
-        {
-            LogError("Failure: socket state is not opened.");
-            result = __FAILURE__;
-        }
-        else
-        {
-            LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            if (first_pending_io != NULL)
-            {
-                if (add_pending_io(socket_io_instance, (const unsigned char*)buffer, size, on_send_complete, callback_context) != 0)
-                {
-                    LogError("Failure: add_pending_io failed.");
-                    result = __FAILURE__;
-                }
-                else
-                {
-                    result = 0;
-                }
-            }
-            else
-            {
-                /* TODO: we need to do more than a cast here to be 100% clean 
-                The following bug was filed: [WarnL4] socketio_win32 does not account for already sent bytes and there is a truncation of size from size_t to int */
-                int send_result = send(socket_io_instance->socket, (const char*)buffer, (int)size, 0);
-                if (send_result != (int)size)
-                {
-                    int last_error = WSAGetLastError();
-                    if (last_error != WSAEWOULDBLOCK)
-                    {
-                        LogError("Failure: sending socket failed %d.", last_error);
-                        result = __FAILURE__;
-                    }
-                    else
-                    {
-                        /* queue data */
-                        if (add_pending_io(socket_io_instance, (const unsigned char*)buffer, size, on_send_complete, callback_context) != 0)
-                        {
-                            LogError("Failure: add_pending_io failed.");
-                            result = __FAILURE__;
-                        }
-                        else
-                        {
-                            result = 0;
-                        }
-                    }
-                }
-                else
-                {
-                    if (on_send_complete != NULL)
-                    {
-                        on_send_complete(callback_context, IO_SEND_OK);
-                    }
-
-                    result = 0;
-                }
-            }
-        }
-    }
-
-    return result;
-}
-
-void socketio_dowork(CONCRETE_IO_HANDLE socket_io)
-{
-    int send_result;
-    if (socket_io != NULL)
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-        if (socket_io_instance->io_state == IO_STATE_OPEN)
-        {
-            LIST_ITEM_HANDLE first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            while (first_pending_io != NULL)
-            {
-                PENDING_SOCKET_IO* pending_socket_io = (PENDING_SOCKET_IO*)singlylinkedlist_item_get_value(first_pending_io);
-                if (pending_socket_io == NULL)
-                {
-                    LogError("Failure: retrieving socket from list");
-                    indicate_error(socket_io_instance);
-                    break;
-                }
-
-                /* TODO: we need to do more than a cast here to be 100% clean
-                The following bug was filed: [WarnL4] socketio_win32 does not account for already sent bytes and there is a truncation of size from size_t to int */
-                send_result = send(socket_io_instance->socket, (const char*)pending_socket_io->bytes, (int)pending_socket_io->size, 0);
-                if (send_result != (int)pending_socket_io->size)
-                {
-                    int last_error = WSAGetLastError();
-                    if (last_error != WSAEWOULDBLOCK)
-                    {
-                        free(pending_socket_io->bytes);
-                        free(pending_socket_io);
-                        (void)singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io);
-                    }
-                    else
-                    {
-                        /* try again */
-                    }
-                }
-                else
-                {
-                    if (pending_socket_io->on_send_complete != NULL)
-                    {
-                        pending_socket_io->on_send_complete(pending_socket_io->callback_context, IO_SEND_OK);
-                    }
-
-                    free(pending_socket_io->bytes);
-                    free(pending_socket_io);
-                    if (singlylinkedlist_remove(socket_io_instance->pending_io_list, first_pending_io) != 0)
-                    {
-                        LogError("Failure: removing socket from list");
-                        indicate_error(socket_io_instance);
-                    }
-                }
-
-                first_pending_io = singlylinkedlist_get_head_item(socket_io_instance->pending_io_list);
-            }
-
-            if (socket_io_instance->io_state == IO_STATE_OPEN)
-            {
-                int received = 0;
-                do
-                {
-                    received = recv(socket_io_instance->socket, (char*)socket_io_instance->recv_bytes, RECEIVE_BYTES_VALUE, 0);
-                    if ((received > 0))
-                    {
-                        if (socket_io_instance->on_bytes_received != NULL)
-                        {
-                            /* Explicitly ignoring here the result of the callback */
-                            (void)socket_io_instance->on_bytes_received(socket_io_instance->on_bytes_received_context, socket_io_instance->recv_bytes, received);
-                        }
-                    }
-                    else if (received == 0)
-                    {
-                        indicate_error(socket_io_instance);
-                    }
-                    else
-                    {
-                        int last_error = WSAGetLastError();
-                        if (last_error != WSAEWOULDBLOCK && last_error != ERROR_SUCCESS)
-                        {
-                            LogError("Socketio_Failure: Receiving data from endpoint: %d.", last_error);
-                            indicate_error(socket_io_instance);
-                        }
-                    }
-                } while (received > 0 && socket_io_instance->io_state == IO_STATE_OPEN);
-            }
-        }
-    }
-}
-
-static int set_keepalive(SOCKET_IO_INSTANCE* socket_io, struct tcp_keepalive* keepAlive)
-{
-    int result;
-    DWORD bytesReturned;
-
-    int err = WSAIoctl(socket_io->socket, SIO_KEEPALIVE_VALS, keepAlive,
-        sizeof(struct tcp_keepalive), NULL, 0, &bytesReturned, NULL, NULL);
-    if (err != 0)
-    {
-        LogError("Failure: setting keep-alive on the socket: %d.\r\n", err == SOCKET_ERROR ? WSAGetLastError() : err);
-        result = __FAILURE__;
-    }
-    else
-    {
-        socket_io->keep_alive = *keepAlive;
-        result = 0;
-    }
-
-    return result;
-}
-
-int socketio_setoption(CONCRETE_IO_HANDLE socket_io, const char* optionName, const void* value)
-{
-    int result;
-
-    if (socket_io == NULL ||
-        optionName == NULL ||
-        value == NULL)
-    {
-        result = __FAILURE__;
-    }
-    else
-    {
-        SOCKET_IO_INSTANCE* socket_io_instance = (SOCKET_IO_INSTANCE*)socket_io;
-
-        if (strcmp(optionName, "tcp_keepalive") == 0)
-        {
-            struct tcp_keepalive keepAlive = socket_io_instance->keep_alive;
-            keepAlive.onoff = *(int *)value;
-
-            result = set_keepalive(socket_io_instance, &keepAlive);
-        }
-        else if (strcmp(optionName, "tcp_keepalive_time") == 0)
-        {
-            unsigned long kaTime = *(int *)value * 1000; // convert to ms
-            struct tcp_keepalive keepAlive = socket_io_instance->keep_alive;
-            keepAlive.keepalivetime = kaTime;
-
-            result = set_keepalive(socket_io_instance, &keepAlive);
-        }
-        else if (strcmp(optionName, "tcp_keepalive_interval") == 0)
-        {
-            unsigned long kaInterval = *(int *)value * 1000; // convert to ms
-            struct tcp_keepalive keepAlive = socket_io_instance->keep_alive;
-            keepAlive.keepaliveinterval = kaInterval;
-
-            result = set_keepalive(socket_io_instance, &keepAlive);
-        }
-        else
-        {
-            result = __FAILURE__;
-        }
-    }
-
-    return result;
-}
-
-const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
-{
-    return &socket_io_interface_description;
-}

+ 0 - 67
azure/c-utility/adapters/tcpsocketconnection_c.cpp

@@ -1,67 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "mbed.h"
-
-#include <stddef.h>
-#include "TCPSocketConnection.h"
-#include "azure_c_shared_utility/tcpsocketconnection_c.h"
-
-
-TCPSOCKETCONNECTION_HANDLE tcpsocketconnection_create(void)
-{
-    return new TCPSocketConnection();
-}
-
-void tcpsocketconnection_set_blocking(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, bool blocking, unsigned int timeout)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	tsc->set_blocking(blocking, timeout);
-}
-
-void tcpsocketconnection_destroy(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle)
-{
-	delete (TCPSocketConnection*)tcpSocketConnectionHandle;
-}
-
-int tcpsocketconnection_connect(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* host, const int port)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->connect(host, port);
-}
-
-bool tcpsocketconnection_is_connected(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->is_connected();
-}
-
-void tcpsocketconnection_close(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	tsc->close();
-}
-
-int tcpsocketconnection_send(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* data, int length)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->send((char*)data, length);
-}
-
-int tcpsocketconnection_send_all(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, const char* data, int length)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->send_all((char*)data, length);
-}
-
-int tcpsocketconnection_receive(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, char* data, int length)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->receive(data, length);
-}
-
-int tcpsocketconnection_receive_all(TCPSOCKETCONNECTION_HANDLE tcpSocketConnectionHandle, char* data, int length)
-{
-	TCPSocketConnection* tsc = (TCPSocketConnection*)tcpSocketConnectionHandle;
-	return tsc->receive_all(data, length);
-}

+ 0 - 31
azure/c-utility/adapters/threadapi_esp8266.c

@@ -1,31 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdint.h>
-#include <stdlib.h>
-#include "azure_c_shared_utility/threadapi.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-DEFINE_ENUM_STRINGS(THREADAPI_RESULT, THREADAPI_RESULT_VALUES);
-
-THREADAPI_RESULT ThreadAPI_Create(THREAD_HANDLE* threadHandle, THREAD_START_FUNC func, void* arg)
-{
-	LogError("ESP8266 RTOS does not support multi-thread function.");
-    return THREADAPI_ERROR;
-}
-
-THREADAPI_RESULT ThreadAPI_Join(THREAD_HANDLE threadHandle, int* res)
-{
-    LogError("ESP8266 RTOS does not support multi-thread function.");
-    return THREADAPI_ERROR;
-}
-
-void ThreadAPI_Exit(int res)
-{
-	vTaskDelete(NULL);
-}
-
-void ThreadAPI_Sleep(unsigned int milliseconds)
-{
-	vTaskDelay(milliseconds);
-}

+ 0 - 137
azure/c-utility/adapters/threadapi_pthreads.c

@@ -1,137 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#define _DEFAULT_SOURCE
-
-#include "azure_c_shared_utility/threadapi.h"
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#ifdef TI_RTOS
-#include <ti/sysbios/knl/Task.h>
-#else
-#include <unistd.h>
-#endif
-
-#include <pthread.h>
-#include <time.h>
-#include "azure_c_shared_utility/xlogging.h"
-
-DEFINE_ENUM_STRINGS(THREADAPI_RESULT, THREADAPI_RESULT_VALUES);
-
-typedef struct THREAD_INSTANCE_TAG
-{
-    pthread_t Pthread_handle;
-    THREAD_START_FUNC ThreadStartFunc;
-    void* Arg;
-} THREAD_INSTANCE;
-
-static void* ThreadWrapper(void* threadInstanceArg)
-{
-    THREAD_INSTANCE* threadInstance = (THREAD_INSTANCE*)threadInstanceArg;
-    int result = threadInstance->ThreadStartFunc(threadInstance->Arg);
-    return (void*)(intptr_t)result;
-}
-
-THREADAPI_RESULT ThreadAPI_Create(THREAD_HANDLE* threadHandle, THREAD_START_FUNC func, void* arg)
-{
-    THREADAPI_RESULT result;
-
-    if ((threadHandle == NULL) ||
-        (func == NULL))
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    else
-    {
-        THREAD_INSTANCE* threadInstance = malloc(sizeof(THREAD_INSTANCE));
-        if (threadInstance == NULL)
-        {
-            result = THREADAPI_NO_MEMORY;
-            LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-        }
-        else
-        {
-            threadInstance->ThreadStartFunc = func;
-            threadInstance->Arg = arg;
-            int createResult = pthread_create(&threadInstance->Pthread_handle, NULL, ThreadWrapper, threadInstance);
-            switch (createResult)
-            {
-            default:
-                free(threadInstance);
-
-                result = THREADAPI_ERROR;
-                LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-                break;
-
-            case 0:
-                *threadHandle = threadInstance;
-                result = THREADAPI_OK;
-                break;
-
-            case EAGAIN:
-                free(threadInstance);
-
-                result = THREADAPI_NO_MEMORY;
-                LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-                break;
-            }
-        }
-    }
-
-    return result;
-}
-
-THREADAPI_RESULT ThreadAPI_Join(THREAD_HANDLE threadHandle, int* res)
-{
-    THREADAPI_RESULT result;
-
-    THREAD_INSTANCE* threadInstance = (THREAD_INSTANCE*)threadHandle;
-    if (threadInstance == NULL)
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    else
-    {
-        void* threadResult;
-        if (pthread_join(threadInstance->Pthread_handle, &threadResult) != 0)
-        {
-            result = THREADAPI_ERROR;
-            LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-        }
-        else
-        {
-            if (res != NULL)
-            {
-                *res = (int)(intptr_t)threadResult;
-            }
-
-            result = THREADAPI_OK;
-        }
-
-        free(threadInstance);
-    }
-
-    return result;
-}
-
-void ThreadAPI_Exit(int res)
-{
-    pthread_exit((void*)(intptr_t)res);
-}
-
-void ThreadAPI_Sleep(unsigned int milliseconds)
-{
-#ifdef TI_RTOS
-    Task_sleep(milliseconds);
-#else
-    time_t seconds = milliseconds / 1000;
-    long nsRemainder = (milliseconds % 1000) * 1000000;
-    struct timespec timeToSleep = { seconds, nsRemainder };
-    (void)nanosleep(&timeToSleep, NULL);
-#endif
-}

+ 0 - 140
azure/c-utility/adapters/threadapi_rtx_mbed.cpp

@@ -1,140 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include "azure_c_shared_utility/threadapi.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "rtos.h"
-
-DEFINE_ENUM_STRINGS(THREADAPI_RESULT, THREADAPI_RESULT_VALUES);
-
-#define MAX_THREADS 4
-#define STACK_SIZE  0x4000
-
-typedef struct _thread
-{
-    Thread*       thrd;
-    osThreadId    id;
-    Queue<int, 1> result;
-} mbedThread;
-static mbedThread threads[MAX_THREADS] = { 0 };
-
-typedef struct _create_param
-{
-    THREAD_START_FUNC func;
-    const void* arg;
-    mbedThread *p_thread;
-} create_param;
-
-static void thread_wrapper(const void* createParamArg)
-{
-    const create_param* p = (const create_param*)createParamArg;
-    p->p_thread->id = Thread::gettid();
-    (*(p->func))((void*)p->arg);
-    free((void*)p);
-}
-
-THREADAPI_RESULT ThreadAPI_Create(THREAD_HANDLE* threadHandle, THREAD_START_FUNC func, void* arg)
-{
-    THREADAPI_RESULT result;
-    if ((threadHandle == NULL) ||
-        (func == NULL))
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    else
-    {
-        size_t slot;
-        for (slot = 0; slot < MAX_THREADS; slot++)
-        {
-            if (threads[slot].id == NULL)
-                break;
-        }
-
-        if (slot < MAX_THREADS)
-        {
-            create_param* param = (create_param*)malloc(sizeof(create_param));
-            if (param != NULL)
-            {
-                param->func = func;
-                param->arg = arg;
-                param->p_thread = threads + slot;
-                threads[slot].thrd = new Thread(thread_wrapper, param, osPriorityNormal, STACK_SIZE);
-                *threadHandle = (THREAD_HANDLE)(threads + slot);
-                result = THREADAPI_OK;
-            }
-            else
-            {
-                result = THREADAPI_NO_MEMORY;
-                LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-            }
-        }
-        else
-        {
-            result = THREADAPI_NO_MEMORY;
-            LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-        }
-    }
-
-    return result;
-}
-
-THREADAPI_RESULT ThreadAPI_Join(THREAD_HANDLE thr, int *res)
-{
-    THREADAPI_RESULT result = THREADAPI_OK;
-    mbedThread* p = (mbedThread*)thr;
-    if (p)
-    {
-        osEvent evt = p->result.get();
-        if (evt.status == osEventMessage) {
-            Thread* t = p->thrd;
-            if (res)
-            {
-                *res = (int)evt.value.p;
-            }
-            (void)t->terminate();
-        }
-        else
-        {
-            result = THREADAPI_ERROR;
-            LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-        }
-    }
-    else
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    return result;
-}
-
-void ThreadAPI_Exit(int res)
-{
-    mbedThread* p;
-    for (p = threads; p < &threads[MAX_THREADS]; p++)
-    {
-        if (p->id == Thread::gettid())
-        {
-            p->result.put((int*)res);
-            break;
-        }
-    }
-}
-
-void ThreadAPI_Sleep(unsigned int millisec)
-{
-    //
-    // The timer on mbed seems to wrap around 65 seconds. Hmmm.
-    // So we will do our waits in increments of 30 seconds.
-    //
-    const int thirtySeconds = 30000;
-    int numberOfThirtySecondWaits = millisec / thirtySeconds;
-    int remainderOfThirtySeconds = millisec % thirtySeconds;
-    int i;
-    for (i = 1; i <= numberOfThirtySecondWaits; i++)
-    {
-        Thread::wait(thirtySeconds);
-    }
-    Thread::wait(remainderOfThirtySeconds);
-}

+ 0 - 85
azure/c-utility/adapters/threadapi_win32.c

@@ -1,85 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include "windows.h"
-#include "azure_c_shared_utility/threadapi.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-DEFINE_ENUM_STRINGS(THREADAPI_RESULT, THREADAPI_RESULT_VALUES);
-
-THREADAPI_RESULT ThreadAPI_Create(THREAD_HANDLE* threadHandle, THREAD_START_FUNC func, void* arg)
-{
-    THREADAPI_RESULT result;
-    if ((threadHandle == NULL) ||
-        (func == NULL))
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    else
-    {
-        *threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, arg, 0, NULL);
-        if(*threadHandle == NULL)
-        {
-            result = (GetLastError() == ERROR_OUTOFMEMORY) ? THREADAPI_NO_MEMORY : THREADAPI_ERROR;
-
-            LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-        }
-        else
-        {
-            result = THREADAPI_OK;
-        }
-    }
-
-    return result;
-}
-
-THREADAPI_RESULT ThreadAPI_Join(THREAD_HANDLE threadHandle, int *res)
-{
-    THREADAPI_RESULT result = THREADAPI_OK;
-
-    if (threadHandle == NULL)
-    {
-        result = THREADAPI_INVALID_ARG;
-        LogError("(result = %s)", ENUM_TO_STRING(THREADAPI_RESULT, result));
-    }
-    else
-    {
-        DWORD returnCode = WaitForSingleObject(threadHandle, INFINITE);
-        
-        if( returnCode != WAIT_OBJECT_0)
-        {
-            result = THREADAPI_ERROR;
-            LogError("Error waiting for Single Object. Return Code: %d. Error Code: %d", returnCode, result);
-        }
-        else
-        {
-            if (res != NULL)
-            {
-                DWORD exit_code;
-                if (!GetExitCodeThread(threadHandle, &exit_code)) //If thread end is signaled we need to get the Thread Exit Code;
-                {
-                    result = THREADAPI_ERROR;
-                    LogError("Error Getting Exit Code. Error Code: %u.", (unsigned int)GetLastError());
-                }
-                else
-                {
-                    *res = (int)exit_code;
-                }
-            }
-        }
-        CloseHandle(threadHandle);
-    }
-
-    return result;
-}
-
-void ThreadAPI_Exit(int res)
-{
-    ExitThread(res);
-}
-
-void ThreadAPI_Sleep(unsigned int milliseconds)
-{
-    Sleep(milliseconds);
-}

+ 0 - 56
azure/c-utility/adapters/tickcounter_esp8266.c

@@ -1,56 +0,0 @@
-// Copyright (C) Firmwave Ltd., All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#ifdef _CRTDBG_MAP_ALLOC
-#include <crtdbg.h>
-#endif
-
-#include "azure_c_shared_utility/gballoc.h"
-
-#include <stdint.h>
-#include <time.h>
-#include "azure_c_shared_utility/tickcounter.h"
-#include "azure_c_shared_utility/xlogging.h"
-
-typedef struct TICK_COUNTER_INSTANCE_TAG
-{
-    unsigned char dummy;
-} TICK_COUNTER_INSTANCE;
-
-TICK_COUNTER_HANDLE tickcounter_create(void)
-{
-    TICK_COUNTER_INSTANCE* result = (TICK_COUNTER_INSTANCE*)malloc(sizeof(TICK_COUNTER_INSTANCE));
-    if (result == NULL)
-    {
-        LogError("Failed creating tick counter");
-    }
-    return result;
-}
-
-void tickcounter_destroy(TICK_COUNTER_HANDLE tick_counter)
-{
-    if (tick_counter != NULL)
-    {
-        free(tick_counter);
-    }
-}
-
-int tickcounter_get_current_ms(TICK_COUNTER_HANDLE tick_counter, tickcounter_ms_t * current_ms)
-{
-    int result;
-
-    if (tick_counter == NULL || current_ms == NULL)
-    {
-        LogError("tickcounter failed: Invalid Arguments.\r\n");
-        result = __LINE__;
-    }
-    else
-    {
-        //Currently configTICK_RATE_HZ is set to 100 (100Hz); a tick is 10ms
-        *current_ms = (tickcounter_ms_t)xTaskGetTickCount()*10;
-        result = 0;
-    }
-
-    return result;
-}

+ 0 - 75
azure/c-utility/adapters/tickcounter_linux.c

@@ -1,75 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-#include <stdlib.h>
-#include "azure_c_shared_utility/gballoc.h"
-#include <stdint.h>
-#include "azure_c_shared_utility/tickcounter.h"
-#include "azure_c_shared_utility/optimize_size.h"
-#include "azure_c_shared_utility/xlogging.h"
-#include "linux_time.h"
-
-
-typedef struct TICK_COUNTER_INSTANCE_TAG
-{
-    time_t init_time_value;
-    tickcounter_ms_t current_ms;
-} TICK_COUNTER_INSTANCE;
-
-TICK_COUNTER_HANDLE tickcounter_create(void)
-{
-    TICK_COUNTER_INSTANCE* result = (TICK_COUNTER_INSTANCE*)malloc(sizeof(TICK_COUNTER_INSTANCE));
-    if (result != NULL)
-    {
-        set_time_basis();
-
-        result->init_time_value = get_time_s();
-        if (result->init_time_value == INVALID_TIME_VALUE)
-        {
-            LogError("tickcounter failed: time return INVALID_TIME.");
-            free(result);
-            result = NULL;
-        }
-        else
-        {
-            result->current_ms = 0;
-        }
-    }
-    return result;
-}
-
-void tickcounter_destroy(TICK_COUNTER_HANDLE tick_counter)
-{
-    if (tick_counter != NULL)
-    {
-        free(tick_counter);
-    }
-}
-
-int tickcounter_get_current_ms(TICK_COUNTER_HANDLE tick_counter, tickcounter_ms_t * current_ms)
-{
-    int result;
-
-    if (tick_counter == NULL || current_ms == NULL)
-    {
-        LogError("tickcounter failed: Invalid Arguments.");
-        result = __FAILURE__;
-    }
-    else
-    {
-        time_t time_value = get_time_s();
-        if (time_value == INVALID_TIME_VALUE)
-        {
-            result = __FAILURE__;
-        }
-        else
-        {
-            TICK_COUNTER_INSTANCE* tick_counter_instance = (TICK_COUNTER_INSTANCE*)tick_counter;
-            tick_counter_instance->current_ms = (tickcounter_ms_t)(difftime(time_value, tick_counter_instance->init_time_value) * 1000);
-            *current_ms = tick_counter_instance->current_ms;
-            result = 0;
-        }
-    }
-
-    return result;
-}

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio