Skip to content

Commit

Permalink
update dps client name to be provisioning client
Browse files Browse the repository at this point in the history
  • Loading branch information
jebrando committed Oct 24, 2017
1 parent bb45943 commit 004d011
Show file tree
Hide file tree
Showing 202 changed files with 10,021 additions and 12,221 deletions.
12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
[submodule "azure-uamqp-c"]
path = uamqp
url = https://github.com/Azure/azure-uamqp-c.git
[submodule "dps_client/deps/utpm"]
path = dps_client/deps/utpm
url = https://github.com/Azure/azure-utpm-c.git
[submodule "dps_client/deps/RIoT"]
path = dps_client/deps/RIoT
url = https://github.com/Microsoft/RIoT.git
[submodule "deps/parson"]
path = deps/parson
url = https://github.com/kgabis/parson.git
[submodule "deps/uhttp"]
path = deps/uhttp
url = https://github.com/Azure/azure-uhttp-c.git
[submodule "provisioning_client/deps/RIoT"]
path = provisioning_client/deps/RIoT
url = https://github.com/Microsoft/RIoT.git
[submodule "provisioning_client/deps/utpm"]
path = provisioning_client/deps/utpm
url = https://github.com/Azure/azure-utpm-c.git
65 changes: 23 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,10 @@ ELSE()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
ENDIF(WIN32)

set(dps_auth_type "" CACHE STRING "The type of authentication used with the DPS client")
set(use_dps_client OFF CACHE BOOL "Enable DPS client")
set(dps_hsm_x509 OFF CACHE BOOL "x509 type of hsm used with the DPS client")
set(dps_hsm_sastoken OFF CACHE BOOL "tpm type of hsm used with the DPS client")
set(dps_custom_hsm OFF CACHE BOOL "hsm type of custom used with the DPS client")
set(dps_hsm_tpm_simulator OFF CACHE BOOL "tpm simulator type of hsm used with the DPS client")
set(dps_hsm_custom_repo "" CACHE STRING "Custom repo")
set(dps_hsm_custom_lib "" CACHE STRING "Custom repo library")
set(DPS_PROTOCOL_FEATURE OFF CACHE BOOL "Disable DPS protocols")
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 "Custom repo library")

#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)
Expand All @@ -63,7 +58,7 @@ option(skip_samples "set skip_samples to ON to skip building samples (default is
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 dps_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)
Expand All @@ -72,6 +67,8 @@ option(use_installed_dependencies "set use_installed_dependencies to ON to use i
option(use_firmware_update "build the Raspberry PI firmware_update sample" 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)

if(WIN32)
option(use_openssl "set use_openssl to ON to use OpenSSL." OFF)
Expand All @@ -86,28 +83,13 @@ else()
option(set_trusted_cert_in_samples "set set_trusted_cert_in_samples to ON to have the samples set the SDK's built-in CA as TrustedCerts" OFF)
endif()

if ("${dps_auth_type}" STREQUAL "tpm")
set(dps_hsm_x509 OFF)
set(dps_hsm_sastoken ON)
set(dps_hsm_tpm_simulator OFF)
set(use_dps_client ON)
set(dps_custom_hsm OFF)
elseif("${dps_auth_type}" STREQUAL "tpm_simulator")
set(dps_hsm_x509 OFF)
set(dps_hsm_sastoken ON)
set(dps_hsm_tpm_simulator ON)
set(use_dps_client ON)
set(dps_custom_hsm OFF)
elseif("${dps_auth_type}" STREQUAL "x509")
set(dps_hsm_sastoken OFF)
set(dps_hsm_tpm_simulator OFF)
set(dps_hsm_x509 ON)
set(use_dps_client ON)
set(dps_custom_hsm OFF)
elseif(${dps_auth_type})
STRING(LENGTH ${dps_auth_type} hsm_length)
if (hsm_length GREATER 0)
message(FATAL_ERROR "Unknown DPS HSM value specified: ${dps_auth_type}")
# Set Provisioning Information
if (${use_prov_client})
if ("${hsm_custom_lib}" STREQUAL "")
set(hsm_type_x509 ON)
set(hsm_type_sastoken ON)
else()
set(hsm_type_custom ON)
endif()
endif()

Expand Down Expand Up @@ -155,10 +137,13 @@ if(NOT "${compileOption_CXX}" STREQUAL "OFF")
set(CMAKE_CXX_FLAGS "${compileOption_CXX} ${CMAKE_CXX_FLAGS}")
endif()

include("configs/azure_iot_sdksFunctions.cmake")

include("dependencies.cmake")

set_platform_files(${CMAKE_CURRENT_LIST_DIR}/c-utility)


if(${run_unittests} OR ${run_e2e_tests})
include("dependencies-test.cmake")
endif()
Expand Down Expand Up @@ -198,8 +183,6 @@ if (NOT DEFINED ARCHITECTURE OR ARCHITECTURE STREQUAL "")
endif()
message(STATUS "iothub architecture: ${ARCHITECTURE}")

include("configs/azure_iot_sdksFunctions.cmake")

macro(compileAsC99)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -248,11 +231,11 @@ if(NOT ${use_http})
message(STATUS "provisioning_service_client build is disabled (HTTP support is required)")
endif()

if (${use_dps_client})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_DPS_MODULE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_DPS_MODULE")
if (${use_prov_client})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_PROV_MODULE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_PROV_MODULE")

add_subdirectory(dps_client)
add_subdirectory(provisioning_client)

if(${build_provisioning_service_client})
add_subdirectory(provisioning_service_client)
Expand All @@ -272,8 +255,8 @@ add_subdirectory(iothub_client)
add_subdirectory(serializer)

#add the device_auth sample subdirectory
if(${use_dps_client} AND NOT ${skip_samples})
add_subdirectory(dps_client/samples)
if(${use_prov_client} AND NOT ${skip_samples})
add_subdirectory(./provisioning_client/samples)
endif()

if(NOT "${build_python}" STREQUAL "OFF")
Expand All @@ -287,8 +270,6 @@ 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")
Expand Down
10 changes: 4 additions & 6 deletions build_all/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ make=true
toolchainfile=" "
cmake_install_prefix=" "
no_logging=OFF
dps_auth_type=""
prov_auth=OFF

usage ()
{
Expand All @@ -45,8 +45,7 @@ usage ()
echo " --build-javawrapper build java C wrapper module"
echo " -rv, --run_valgrind will execute ctest with valgrind"
echo " --no-logging Disable logging"
echo " --dps-tpm Use DPS with TPM Flow"
echo " --dps-x509 Use DPS with x509 Flow"
echo " --provisioning Use Provisioning with Flow"
exit 1
}

Expand Down Expand Up @@ -99,8 +98,7 @@ process_args ()
"-rv" | "--run_valgrind" ) run_valgrind=1;;
"--no-logging" ) no_logging=ON;;
"--install-path-prefix" ) save_next_arg=4;;
"--dps-tpm" ) dps_auth_type=tpm_simulator;;
"--dps-x509" ) dps_auth_type=x509;;
"--provisioning" ) prov_auth=ON;;
* ) usage;;
esac
fi
Expand All @@ -123,7 +121,7 @@ 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_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 -Ddps_auth_type:STRING=$dps_auth_type
cmake $toolchainfile $cmake_install_prefix -Drun_valgrind:BOOL=$run_valgrind -DcompileOption_C:STRING="$extracloptions" -Drun_e2e_tests:BOOL=$run_e2e_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

if [ "$make" = true ]
then
Expand Down
21 changes: 8 additions & 13 deletions build_all/windows/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ set CMAKE_DIR=iotsdk_win32
set build-samples=yes
set make=yes
set build_traceabilitytool=0
set dps_auth_type=""
set prov_auth=OFF

:args-loop
if "%1" equ "" goto args-done
Expand All @@ -55,8 +55,7 @@ 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 "--dps-tpm" goto arg-dps-tpm
if "%1" equ "--dps-x509" goto arg-dps-x509
if "%1" equ "--provisioning" goto arg-provisioning
call :usage && exit /b 1

:arg-build-clean
Expand Down Expand Up @@ -113,12 +112,8 @@ goto args-continue
set build_traceabilitytool=1
goto args-continue

:arg-dps-tpm
set dps_auth_type="tpm_simulator"
goto args-continue

:arg-dps-x509
set dps_auth_type="x509"
:arg-provisioning
set prov_auth=ON
goto args-continue

:args-continue
Expand Down Expand Up @@ -277,20 +272,20 @@ if %MAKE_NUGET_PKG% == yes (
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_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Ddps_auth_type:STRING=%dps_auth_type% -G "Visual Studio 14 ARM"
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 ARM"
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_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Ddps_auth_type:STRING=%dps_auth_type% -G "Visual Studio 14 Win64"
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 Win64"
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_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Ddps_auth_type:STRING=%dps_auth_type% -G "Visual Studio 14 ARM"
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth% -G "Visual Studio 14 ARM"
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_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Ddps_auth_type:STRING=%dps_auth_type%
cmake -Drun_longhaul_tests:BOOL=%CMAKE_run_longhaul_tests% -Drun_e2e_tests:BOOL=%CMAKE_run_e2e_tests% -Drun_unittests:BOOL=%CMAKE_run_unittests% %build-root% -Duse_prov_client:BOOL=%prov_auth%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
)

Expand Down
Loading

0 comments on commit 004d011

Please sign in to comment.