diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f394bd..be00ded 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,11 +105,11 @@ include_directories(${LWIP_PORT_DIR}/include) # ------------------------------------------------------------------------------ # Defaults -set(ALLOW_INSTALL_TARGET TRUE) -set(BUILD_STATIC_LIB TRUE) -set(BUILD_SHARED_LIB TRUE) -set(BUILD_HOST_SELFTEST TRUE) -set(ZTS_DISABLE_CENTRAL_API TRUE) +option(ALLOW_INSTALL_TARGET "Enable the install target" TRUE) +option(BUILD_STATIC_LIB "Build static library" TRUE) +option(BUILD_SHARED_LIB "Build shared libary" TRUE) +option(BUILD_HOST_SELFTEST "Build host selftest binary" TRUE) +option(ZTS_DISABLE_CENTRAL_API "Disable central API" TRUE) # C# language bindings (libzt.dll/dylib/so) if (ZTS_ENABLE_PINVOKE) @@ -380,10 +380,15 @@ if(BUILD_WIN) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc -DNOMINMAX") else() + option(STACK_PROTECTOR "Compile with -fstack-protector" ON) + if(STACK_PROTECTOR) + set(STACK_PROTECTOR_FLAGS -fstack-protector) + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \ ${ZT_FLAGS} \ - -fstack-protector") + ${STACK_PROTECTOR_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} \ @@ -393,7 +398,7 @@ else() set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} \ ${RELEASE_OPTIMIZATION} \ - -fstack-protector") + ${STACK_PROTECTOR_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ ${ZT_FLAGS} -Wall -Wextra -std=c++11") diff --git a/include/ZeroTierSockets.h b/include/ZeroTierSockets.h index fe01d43..98058e9 100644 --- a/include/ZeroTierSockets.h +++ b/include/ZeroTierSockets.h @@ -1227,7 +1227,7 @@ ZTS_API int ZTCALL zts_init_from_storage(const char* path); * * See also: `zts_init_from_storage()` * - * @param key Path Null-terminated file-system path string + * @param key Buffer containing identity key * @param len Length of `key` buffer * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. @@ -1325,7 +1325,7 @@ ZTS_API int ZTCALL zts_init_set_random_port_range(unsigned short start_port, uns * that traffic on your chosen primary port is allowed. This is an initialization function that can * only be called before `zts_node_start()`. * - * @param port Port number + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */ @@ -1335,7 +1335,7 @@ ZTS_API int ZTCALL zts_init_allow_secondary_port(unsigned int allowed); * @brief Allow or disallow the use of port-mapping. This is enabled by default. This is an * initialization function that can only be called before `zts_node_start()`. * - * @param port Port number + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */ @@ -1355,7 +1355,7 @@ ZTS_API int ZTCALL zts_init_allow_port_mapping(unsigned int allowed); * * See also: `zts_init_allow_peer_cache()` * - * @param enabled Whether or not this feature is enabled + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */ @@ -1374,7 +1374,7 @@ ZTS_API int ZTCALL zts_init_allow_net_cache(unsigned int allowed); * * See also: `zts_init_allow_net_cache()` * - * @param enabled Whether or not this feature is enabled + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */ @@ -1384,7 +1384,7 @@ ZTS_API int ZTCALL zts_init_allow_peer_cache(unsigned int allowed); * @brief Enable or disable whether the node will cache root definitions (enabled * by default when `zts_init_from_storage()` is used.) Must be called before `zts_node_start()`. * - * @param enabled Whether or not this feature is enabled + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */ @@ -1394,7 +1394,7 @@ ZTS_API int ZTCALL zts_init_allow_roots_cache(unsigned int allowed); * @brief Enable or disable whether the node will cache identities (enabled * by default when `zts_init_from_storage()` is used.) Must be called before `zts_node_start()`. * - * @param enabled Whether or not this feature is enabled + * @param allowed Whether or not this feature is enabled * @return `ZTS_ERR_OK` if successful, `ZTS_ERR_SERVICE` if the node * experiences a problem, `ZTS_ERR_ARG` if invalid argument. */