Crate libcoap_sys

Source
Expand description

Auto-generated unsafe bindings to libcoap, generated using bindgen.

This crate allows direct (but unsafe) usage of the libcoap C library from Rust. The declarations made in this library are generated automatically using bindgen, for further documentation on how to use them, refer to the libcoap documentation.

In most cases you probably want to use the safe wrapper provided by the libcoap_rs crate or another CoAP library written in pure Rust such as coap-rs instead.

§The TLDR for building libcoap-sys (and resolving the most common Build Issues)

It is strongly recommended that you read the remainder of this page in order to fully understand the build process and possible causes of errors, especially if you’re cross-compiling or building for embedded targets.

However, if you lack the time to do so, the following instructions should work in most cases:

  1. Add a dependency to this crate and add all features you need for your crate to work. Call coap_startup_with_feature_checks() instead of coap_startup() during initialization to ensure that all of these features are actually available in the linked version of libcoap.

  2. If you require DTLS support and run into Required feature "dtls-(psk|pki|rpk|...)" is not supported by libcoap errors, manually select a DTLS library that supports all of your required DTLS features by setting the LIBCOAP_RS_DTLS_BACKEND environment variable to your desired choice (the library name in all-lowercase should work).

  3. If you’re building a binary crate (or tests, examples, …) and are getting non-DTLS-related Required feature "<FEATURE>" is not supported by libcoap errors, enable the vendored feature to build and statically link a version of libcoap that supports exactly the features you requested.

  4. Inspect your dependency tree to determine whether you already have a DTLS library’s sys-crate (openssl-sys, tinydtls-sys or mbedtls-sys-auto) in your dependency tree. If this is the case, enable the dtls-<LIBRARY NAME>-sys feature for all of them. This may resolve issues related to linking multiple versions of the same library at once, and could also help in reducing binary size.

If you’re still unable to compile libcoap-sys, refer to the documentation below. If the documentation below does not solve your issue, feel free to open an issue on GitHub and ask for help.

§Optional Features

Most features specified in this crate’s Cargo.toml directly correspond to a feature that can be enabled or disabled in libcoap’s configure-script and/or CMake configuration, refer to the libcoap documentation for more details on these features.

The default feature should match the default features enabled in the configure script of the minimum supported version of libcoap.

Depending on the build system and linked version of libcoap, the features actually provided may differ from the ones indicated by the crate features. If you want to ensure that all features that are enabled for this crate are actually supported by the linked version of libcoap, you may call coap_startup_with_feature_checks().

Aside from the features relating to libcoap functionality, the following features may also be enabled for this crate:

  • vendored: Build and statically link against a version of libcoap bundled with this crate instead of using a system-provided one1.

  • dtls-<LIBRARY NAME>-sys: Allows the vendored libcoap version to link against the same version of a DTLS library that is used by the corresponding -sys crate2. Note, however, that this does not imply that this DTLS library will be used, refer to the documentation below for more information.

    If a different build system than vendored is used, this feature is effectively a no-op.

  • dtls-<LIBRARY NAME>-sys-vendored instructs the sys-crate of the DTLS library corresponding to the feature name to use a vendored version of the underlying library (implies dtls-<LIBRARY NAME>-sys).

  • dtls-(cid|psk|pki|pkcs11|rpk): Require support for specific DTLS features in libcoap. These features can not be enabled explicitly while building libcoap, support for them is automatically made available based on the used DTLS library (see the corresponding section below).

    Enabling these features will add appropriate checks during compile- and/or runtime initialization to ensure these features are available in the used DTLS library (or panic otherwise).

§Build Process

In general, libcoap-sys supports four different build systems, which will be explained in more detail in the following sections:

  • vendored: Build libcoap from source using a bundled version of the library (requires the vendored feature to be enabled.
  • pkgconfig: Link against a system-provided version of libcoap, obtaining the library and include paths using the pkg-config utility.
  • manual: Provide include and library directories+compiler/linker flags via environment variables.
  • espidf: Build for the ESP family of microcontrollers using the ESP-IDF framework (used instead of the regular vendored build if the build system is set to vendored and building for an ESP-IDF Rust target).

The build system that should be used can be specified manually by setting the LIBCOAP_RS_BUILD_SYSTEM environment variable to the corresponding value.

If you have explicitly specified a build system and building using that system fails, no other system will be tried.

If you do not explicitly provide a build system to use, the build script will follow these steps to determine a suitable build system:

  1. If the vendored crate feature is enabled, or we are building for the ESP-IDF, act as if the build system is set to vendored. If a vendored build is attempted and fails, return with an error and do not try anything else.
  2. Otherwise, try pkgconfig first.
  3. If pkgconfig doesn’t work, fall back to manual (which will fail if the environment variables aren’t set).
  4. If manual doesn’t work, return an error indicating the issues with all previously attempted build systems.

§Generic Information (applies to all build systems)

The following information applies to all build systems (although some specifics may be detailed in the respective build system’s section).

§C Standard Library Functions

Some libcoap functions utilize types from the C standard library (e.g., sockaddr_in in coap_address_t).

For most targets, the data types defined in the libc crate will be used to provide those data types. However, some targets (especially embedded ones such as espidf) will use a different library instead, which may cause compilation issues in code that assumes libc data types to be compatible.

For your convenience, this crate re-exports the used standard library crate as the c_stdlib module. For best interoperability, you should use this module instead of using the actual crates directly to import the required data types.

§DTLS Library Selection

In order to provide DTLS support, libcoap must be combined with a DTLS library/backend. DTLS libraries are mutually exclusive, and multiple versions of libcoap linked against different DTLS libraries may be installed in a system simultaneously, so libcoap-sys must decide on a variant of libcoap to link against during build.

While the default mechanism for determining a DTLS library differs between build systems, you may select a DTLS library explicitly by setting the LIBCOAP_RS_DTLS_BACKEND environment variable to any of the supported values (gnutls, openssl, mbedtls, tinydtls, or wolfssl). Refer to the build-system-specific documentation for information about supported DTLS libraries and specifics.

Note that some DTLS-related features (such as dtls-(cid|psk|pki|pkcs11|rpk)) are dependent on the used DTLS backend, refer to the coap_encryption(3) man page for information on supported features for each DTLS library.

§Feature Support and Compile-Time/Initialization Checks

During compilation, each build system will attempt to ensure that the used version of libcoap does in fact support all features that were enabled in Cargo.toml. The exact method differs based on each build system, but most will attempt to parse the coap3/coap_defines.h header file in order to determine missing features (with espidf being a notable exception).

If a build system detects that a requested feature is missing, an appropriate error message will be returned. In most cases, these errors must be resolved by linking to a different version of libcoap.

Unfortunately, for various reasons, this compile-time feature check may produce false positive and/or false negative results (especially when cross compiling3) is not available for all features (especially ones dependent on the DTLS library) and may not even be available at all on some platforms.

Therefore, library users should assume that the compile-time checks may not provide accurate results, and should call coap_startup_with_feature_checks() during initialization to perform run-time checks for all requested features. This run-time check will always work and be accurate.

Lastly, if you encounter a false positive error (i.e., a compile time error that indicates that some feature is missing, even though you are 100% certain that it is available), you may bypass the compile-time checks by setting LIBCOAP_RS_BYPASS_COMPILE_FEATURE_CHECKS to any non-zero value. Note, however, that this might lead to cryptic errors if your assumption was wrong and the feature is not available after all.

In most cases, a false positive might be caused by the include paths/header files used for binding generation refering to a different version of libcoap than the one that is linked against, which could also cause difficult-to-debug issues and indicates a more severe problem with the build process.

§Vendored Build System

The vendored build system uses a bundled version of libcoap (usually the latest stable version at the time of release) to build and statically link against. Under the hood, it uses the autotools crate to configure and run the build process, and you may therefore customize the build’s compiler and linker flags by setting the environment variables used in libcoap’s configure script.

This build system will enable only those features in libcoap that are requested as Cargo.toml features, and will explicitly disable all other ones.

If a DTLS library is explicitly selected by the user, it will instruct libcoap to link against that library by setting the corresponding --with-<LIBRARY NAME> configure flag.

If you enable the dtls-<LIBRARY NAME>-sys features and do not set the <LIBRARY NAME>_CFLAGS or <LIBRARY NAME>_LIBS environment variables, this build system will set these environment variables to ensure that if this DTLS library is the one that libcoap uses, we link against exactly the same version as used in the <LIBRARY NAME>-sys crate. This is especially relevant if those crates also provide a vendored version in order to avoid multiple versions of the same library being in use. If a different DTLS library is used, this feature should have no effect (it will set the environment variable, but libcoap will ignore it).

If you do not specify a DTLS library, this build system will follow the same default order that libcoap does (gnutls > openssl > wolfssl > mbedtls > tinydtls), unless you enabled one of the dtls-<LIBRARY NAME>-sys features, in which case those will have priority. If multiple of these features are enabled, they are prioritized in the same order as used by libcoap (openssl > mbedtls > tinydtls).

§pkg-config Build System

The pkg-config build system utilizes the pkg-config utility available on most Unix-like systems to link against a system-provided version of libcoap. To do so, it uses the pkg_config crate, and you may therefore customize the build process by setting the environment variables described in that library’s documentation (which may be of special relevance if you try to cross compile).

By default, it will probe pkg-config for a library with the name libcoap-3, which will usually symlink to the DTLS library variant of libcoap that was installed most recently. If you have explicitly requested use of a specific DTLS library, this build system will attempt to find the libcoap-3-<LIBRARY NAME> library instead.

However, library selection does not take into account any other requested features (i.e., it will not check for feature support before generating the bindings), but will use header-based compile-time feature checks (see the general section) to ensure support for all required features after binding generation.

The dtls-<LIBRARY NAME>-sys features have no effect on this build system, but note that static linking against a system-provided version of libcoap may cause issues if it causes multiple versions of the same DTLS library to be statically linked into the same Rust binary.

§manual Build System

This build system is intended as a fallback solution if all other options fail. It will attempt to generate bindings and link against the version of libcoap that is described by the following environment variables:

  • LIBCOAP_RS_INCLUDE_DIRS: Paths that should be added to clang’s include path to search for header files (e.g., /usr/local/include, not /usr/local/include/coap3). Multiple values are separated by colons (:).
  • LIBCOAP_RS_LIB_DIRS: Paths that should be added to rustc’s library path to search for object files to link against. Multiple values are separated by colons (:).
  • LIBCOAP_RS_STATIC: Set to any non-zero and non-empty value to instruct rustc to use static linking instead of dynamic linking for libcoap.
  • LIBCOAP_RS_ADDITIONAL_LIBRARIES: Additional libraries (such as DTLS libraries) that should be linked against, separated by colons (:). Note that these will be added after libcoap, and that the order in which they are specified matters for most linkers. You may also request static linking by prepending static= to the library name.

§espidf Build System

This build system will be used instead of the regular vendored build if you are building for targets that are based on the ESP-IDF.

If libcoap-sys is a direct dependency, it will automatically enable the espressif/coap component in order to instruct esp-idf-sys to compile and link libcoap and generate bindings for it.

If you encounter errors that indicate that the espressif/coap component may not be enabled in the ESP-IDF, this could have the following reasons:

  • You may have to run cargo clean, as the esp-idf-sys build script does not always detect changes in requested extra components properly.
  • libcoap-sys is a transient dependency: the esp-idf-sys build script only considers metadata from the root crate and its direct dependencies to determine which components to install. In order to solve this, you can either add libcoap-sys as a direct dependency, or copy this crate’s src/wrapper.h file and add the following snippet to your own Cargo.toml.
    [[package.metadata.esp-idf-sys.extra_components]]
    remote_component = { name = "espressif/coap", version = "4.3.5~3" }
    bindings_header = "src/wrapper.h"
    Afterward, run cargo clean (see the issue mentioned above) and try again.

It will then parse the generated bindings file and re-export all symbols in esp-idf-sys that are related to libcoap.

Note that esp-idf-sys may use a different version of bindgen than the other build systems and that bindings might differ slightly as a result.

Unlike most other targets, this one will use esp-idf-sys instead of libc to provide its standard library types (see the generic information section above).


  1. Note that when building for the ESP-IDF, this feature will be a no-op, as the version provided by the ESP-IDF will always be used. 

  2. In the case of mbedtls, mbedtls-sys-auto is used instead, as mbedtls-sys is unmaintained. 

  3. For this reason, using this method while cross-compiling is noted to be unsafe in libcoap’s documentation

Re-exports§

pub use libc as c_stdlib;

Macros§

coap_string_equal
Compares instances of coap_str_const_t and/or coap_string_t.

Structs§

__BindgenBitfieldUnit
coap_addr_hash_t
coap_addr_info_t
coap_addr_tuple_t
coap_address_t
coap_async_t
coap_attr_t
coap_bin_const_t
coap_binary_t
coap_block_b_t
coap_block_t
coap_cache_entry_t
coap_cache_key_t
coap_context_t
coap_dtls_cpsk_info_t
coap_dtls_cpsk_t
coap_dtls_key_t
coap_dtls_pki_t
coap_dtls_spsk_info_t
coap_dtls_spsk_t
coap_endpoint_t
coap_fixed_point_t
coap_lg_crcv_t
coap_lg_srcv_t
coap_lg_xmit_t
coap_opt_filter_t
coap_opt_iterator_t
coap_option
coap_option_t
coap_optlist_t
coap_oscore_conf_t
coap_packet_t
coap_pdu_t
coap_pki_key_asn1_t
coap_pki_key_define_t
coap_pki_key_pem_buf_t
coap_pki_key_pem_t
coap_pki_key_pkcs11_t
coap_proxy_list_t
coap_proxy_server_list_t
coap_proxy_server_t
coap_queue_t
coap_resource_t
coap_session_t
coap_sockaddr_un
coap_socket_t
coap_str_const_t
coap_string_t
coap_subscription_t
coap_tls_version_t
coap_uri_t

Constants§

COAP_AF_UNIX_SUPPORT
COAP_ASYNC_SUPPORT
COAP_ATTR_FLAGS_RELEASE_NAME
COAP_ATTR_FLAGS_RELEASE_VALUE
COAP_BERT_BASE
COAP_BLOCK_NOT_RANDOM_BLOCK1
COAP_BLOCK_NO_PREEMPTIVE_RTAG
COAP_BLOCK_SINGLE_BODY
COAP_BLOCK_STLESS_BLOCK2
COAP_BLOCK_STLESS_FETCH
COAP_BLOCK_TRY_Q_BLOCK
COAP_BLOCK_USE_LIBCOAP
COAP_BLOCK_USE_M_Q_BLOCK
COAP_CLIENT_SUPPORT
COAP_DEFAULT_HOP_LIMIT
COAP_DEFAULT_MAX_AGE
COAP_DEFAULT_MAX_LATENCY
COAP_DEFAULT_MAX_PAYLOADS
COAP_DEFAULT_MAX_RETRANSMIT
COAP_DEFAULT_MTU
COAP_DEFAULT_NON_MAX_RETRANSMIT
COAP_DEFAULT_NSTART
COAP_DEFAULT_PORT
COAP_DEFAULT_PROBING_RATE
COAP_DEFAULT_SCHEME
COAP_DEFAULT_URI_WELLKNOWN
COAP_DISABLE_TCP
COAP_DTLS_CPSK_SETUP_VERSION
COAP_DTLS_HINT_LENGTH
COAP_DTLS_MAX_PSK
COAP_DTLS_MAX_PSK_IDENTITY
COAP_DTLS_PKI_SETUP_VERSION
COAP_DTLS_RPK_CERT_CN
COAP_DTLS_SPSK_SETUP_VERSION
COAP_EPOLL_SUPPORT
COAP_ERROR_PHRASE_LENGTH
COAP_INVALID_MID
COAP_INVALID_SOCKET
COAP_INVALID_TID
COAP_IO_WAIT
COAP_IPV4_SUPPORT
COAP_IPV6_SUPPORT
COAP_MAX_BLOCK_SZX
COAP_MAX_EPOLL_EVENTS
COAP_MAX_LOGGING_LEVEL
COAP_MAX_OPT
COAP_MAX_STR_CONST_FUNC
COAP_MEDIATYPE_APPLICATION_ACE_CBOR
COAP_MEDIATYPE_APPLICATION_CBOR
COAP_MEDIATYPE_APPLICATION_COAP_GROUP_JSON
COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT
COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT0
COAP_MEDIATYPE_APPLICATION_COSE_KEY
COAP_MEDIATYPE_APPLICATION_COSE_KEY_SET
COAP_MEDIATYPE_APPLICATION_COSE_MAC
COAP_MEDIATYPE_APPLICATION_COSE_MAC0
COAP_MEDIATYPE_APPLICATION_COSE_SIGN
COAP_MEDIATYPE_APPLICATION_COSE_SIGN1
COAP_MEDIATYPE_APPLICATION_CWT
COAP_MEDIATYPE_APPLICATION_DOTS_CBOR
COAP_MEDIATYPE_APPLICATION_EXI
COAP_MEDIATYPE_APPLICATION_JSON
COAP_MEDIATYPE_APPLICATION_LINK_FORMAT
COAP_MEDIATYPE_APPLICATION_MB_CBOR_SEQ
COAP_MEDIATYPE_APPLICATION_OCTET_STREAM
COAP_MEDIATYPE_APPLICATION_OSCORE
COAP_MEDIATYPE_APPLICATION_RDF_XML
COAP_MEDIATYPE_APPLICATION_SENML_CBOR
COAP_MEDIATYPE_APPLICATION_SENML_EXI
COAP_MEDIATYPE_APPLICATION_SENML_JSON
COAP_MEDIATYPE_APPLICATION_SENML_XML
COAP_MEDIATYPE_APPLICATION_SENSML_CBOR
COAP_MEDIATYPE_APPLICATION_SENSML_EXI
COAP_MEDIATYPE_APPLICATION_SENSML_JSON
COAP_MEDIATYPE_APPLICATION_SENSML_XML
COAP_MEDIATYPE_APPLICATION_XML
COAP_MEDIATYPE_TEXT_PLAIN
COAP_OBSERVE_CANCEL
COAP_OBSERVE_ESTABLISH
COAP_OPTION_ACCEPT
COAP_OPTION_BLOCK1
COAP_OPTION_BLOCK2
COAP_OPTION_CONTENT_FORMAT
COAP_OPTION_CONTENT_TYPE
COAP_OPTION_ECHO
COAP_OPTION_ETAG
COAP_OPTION_HOP_LIMIT
COAP_OPTION_IF_MATCH
COAP_OPTION_IF_NONE_MATCH
COAP_OPTION_LOCATION_PATH
COAP_OPTION_LOCATION_QUERY
COAP_OPTION_MAXAGE
COAP_OPTION_NORESPONSE
COAP_OPTION_OBSERVE
COAP_OPTION_OSCORE
COAP_OPTION_PROXY_SCHEME
COAP_OPTION_PROXY_URI
COAP_OPTION_Q_BLOCK1
COAP_OPTION_Q_BLOCK2
COAP_OPTION_RTAG
COAP_OPTION_SIZE1
COAP_OPTION_SIZE2
COAP_OPTION_URI_HOST
COAP_OPTION_URI_PATH
COAP_OPTION_URI_PORT
COAP_OPTION_URI_QUERY
COAP_OPT_FILTER_LONG
COAP_OPT_FILTER_SHORT
COAP_OSCORE_SUPPORT
COAP_PRINT_STATUS_ERROR
COAP_PRINT_STATUS_MASK
COAP_PRINT_STATUS_MAX
COAP_PRINT_STATUS_TRUNC
COAP_PROXY_SUPPORT
COAP_Q_BLOCK_SUPPORT
COAP_RESOURCE_CHECK_TIME
COAP_RESOURCE_FLAGS_FORCE_SINGLE_BODY
COAP_RESOURCE_FLAGS_HAS_MCAST_SUPPORT
COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_DELAYS
COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_SUPPRESS_4_XX
COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_SUPPRESS_5_XX
COAP_RESOURCE_FLAGS_LIB_ENA_MCAST_SUPPRESS_2_05
COAP_RESOURCE_FLAGS_LIB_ENA_MCAST_SUPPRESS_2_XX
COAP_RESOURCE_FLAGS_MCAST_LIST
COAP_RESOURCE_FLAGS_NOTIFY_CON
COAP_RESOURCE_FLAGS_NOTIFY_NON
COAP_RESOURCE_FLAGS_NOTIFY_NON_ALWAYS
COAP_RESOURCE_FLAGS_OSCORE_ONLY
COAP_RESOURCE_FLAGS_RELEASE_URI
COAP_RESOURCE_HANDLE_WELLKNOWN_CORE
COAP_RXBUFFER_SIZE
COAP_SERVER_SUPPORT
COAP_SIGNALING_OPTION_ALTERNATIVE_ADDRESS
COAP_SIGNALING_OPTION_BAD_CSM_OPTION
COAP_SIGNALING_OPTION_BLOCK_WISE_TRANSFER
COAP_SIGNALING_OPTION_CUSTODY
COAP_SIGNALING_OPTION_EXTENDED_TOKEN_LENGTH
COAP_SIGNALING_OPTION_HOLD_OFF
COAP_SIGNALING_OPTION_MAX_MESSAGE_SIZE
COAP_SOCKET_ERROR
COAP_THREAD_RECURSIVE_CHECK
COAP_THREAD_SAFE
COAP_TOKEN_DEFAULT_MAX
COAP_TOKEN_EXT_MAX
COAP_URI_SCHEME_SECURE_MASK
COAP_WITH_LIBGNUTLS
COAP_WITH_OBSERVE_PERSIST
COAP_WS_SUPPORT
LIBCOAP_PACKAGE_BUGREPORT
LIBCOAP_PACKAGE_NAME
LIBCOAP_PACKAGE_STRING
LIBCOAP_PACKAGE_URL
LIBCOAP_PACKAGE_VERSION
LIBCOAP_VERSION
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_CMAC
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DH
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DHX
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DSA
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DSA1
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DSA2
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DSA3
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_DSA4
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_EC
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_HKDF
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_HMAC
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_NONE
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_RSA
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_RSA2
coap_asn1_privatekey_type_t_COAP_ASN1_PKEY_TLS1_PRF
coap_cache_record_pdu_t_COAP_CACHE_NOT_RECORD_PDU
coap_cache_record_pdu_t_COAP_CACHE_RECORD_PDU
coap_cache_session_based_t_COAP_CACHE_IS_SESSION_BASED
coap_cache_session_based_t_COAP_CACHE_NOT_SESSION_BASED
coap_dtls_role_t_COAP_DTLS_ROLE_CLIENT
coap_dtls_role_t_COAP_DTLS_ROLE_SERVER
coap_event_t_COAP_EVENT_BAD_PACKET
coap_event_t_COAP_EVENT_DTLS_CLOSED
coap_event_t_COAP_EVENT_DTLS_CONNECTED
coap_event_t_COAP_EVENT_DTLS_ERROR
coap_event_t_COAP_EVENT_DTLS_RENEGOTIATE
coap_event_t_COAP_EVENT_KEEPALIVE_FAILURE
coap_event_t_COAP_EVENT_MSG_RETRANSMITTED
coap_event_t_COAP_EVENT_OSCORE_DECODE_ERROR
coap_event_t_COAP_EVENT_OSCORE_DECRYPTION_FAILURE
coap_event_t_COAP_EVENT_OSCORE_INTERNAL_ERROR
coap_event_t_COAP_EVENT_OSCORE_NOT_ENABLED
coap_event_t_COAP_EVENT_OSCORE_NO_PROTECTED_PAYLOAD
coap_event_t_COAP_EVENT_OSCORE_NO_SECURITY
coap_event_t_COAP_EVENT_PARTIAL_BLOCK
coap_event_t_COAP_EVENT_SERVER_SESSION_DEL
coap_event_t_COAP_EVENT_SERVER_SESSION_NEW
coap_event_t_COAP_EVENT_SESSION_CLOSED
coap_event_t_COAP_EVENT_SESSION_CONNECTED
coap_event_t_COAP_EVENT_SESSION_FAILED
coap_event_t_COAP_EVENT_TCP_CLOSED
coap_event_t_COAP_EVENT_TCP_CONNECTED
coap_event_t_COAP_EVENT_TCP_FAILED
coap_event_t_COAP_EVENT_WS_CLOSED
coap_event_t_COAP_EVENT_WS_CONNECTED
coap_event_t_COAP_EVENT_WS_PACKET_SIZE
coap_event_t_COAP_EVENT_XMIT_BLOCK_FAIL
coap_log_t_COAP_LOG_ALERT
coap_log_t_COAP_LOG_CRIT
coap_log_t_COAP_LOG_DEBUG
coap_log_t_COAP_LOG_DTLS_BASE
coap_log_t_COAP_LOG_EMERG
coap_log_t_COAP_LOG_ERR
coap_log_t_COAP_LOG_INFO
coap_log_t_COAP_LOG_NOTICE
coap_log_t_COAP_LOG_OSCORE
coap_log_t_COAP_LOG_WARN
coap_memory_tag_t_COAP_ATTRIBUTE_NAME
coap_memory_tag_t_COAP_ATTRIBUTE_VALUE
coap_memory_tag_t_COAP_CACHE_ENTRY
coap_memory_tag_t_COAP_CACHE_KEY
coap_memory_tag_t_COAP_CONTEXT
coap_memory_tag_t_COAP_COSE
coap_memory_tag_t_COAP_DIGEST_CTX
coap_memory_tag_t_COAP_DTLS_CONTEXT
coap_memory_tag_t_COAP_DTLS_SESSION
coap_memory_tag_t_COAP_ENDPOINT
coap_memory_tag_t_COAP_LG_CRCV
coap_memory_tag_t_COAP_LG_SRCV
coap_memory_tag_t_COAP_LG_XMIT
coap_memory_tag_t_COAP_MEM_TAG_LAST
coap_memory_tag_t_COAP_NODE
coap_memory_tag_t_COAP_OPTLIST
coap_memory_tag_t_COAP_OSCORE_BUF
coap_memory_tag_t_COAP_OSCORE_COM
coap_memory_tag_t_COAP_OSCORE_EP
coap_memory_tag_t_COAP_OSCORE_EX
coap_memory_tag_t_COAP_OSCORE_REC
coap_memory_tag_t_COAP_OSCORE_SEN
coap_memory_tag_t_COAP_PACKET
coap_memory_tag_t_COAP_PDU
coap_memory_tag_t_COAP_PDU_BUF
coap_memory_tag_t_COAP_RESOURCE
coap_memory_tag_t_COAP_RESOURCEATTR
coap_memory_tag_t_COAP_SESSION
coap_memory_tag_t_COAP_STRING
coap_memory_tag_t_COAP_SUBSCRIPTION
coap_nack_reason_t_COAP_NACK_BAD_RESPONSE
coap_nack_reason_t_COAP_NACK_ICMP_ISSUE
coap_nack_reason_t_COAP_NACK_NOT_DELIVERABLE
coap_nack_reason_t_COAP_NACK_RST
coap_nack_reason_t_COAP_NACK_TLS_FAILED
coap_nack_reason_t_COAP_NACK_TLS_LAYER_FAILED
coap_nack_reason_t_COAP_NACK_TOO_MANY_RETRIES
coap_nack_reason_t_COAP_NACK_WS_FAILED
coap_nack_reason_t_COAP_NACK_WS_LAYER_FAILED
coap_pdu_code_t_COAP_EMPTY_CODE
coap_pdu_code_t_COAP_REQUEST_CODE_DELETE
coap_pdu_code_t_COAP_REQUEST_CODE_FETCH
coap_pdu_code_t_COAP_REQUEST_CODE_GET
coap_pdu_code_t_COAP_REQUEST_CODE_IPATCH
coap_pdu_code_t_COAP_REQUEST_CODE_PATCH
coap_pdu_code_t_COAP_REQUEST_CODE_POST
coap_pdu_code_t_COAP_REQUEST_CODE_PUT
coap_pdu_code_t_COAP_RESPONSE_CODE_BAD_GATEWAY
coap_pdu_code_t_COAP_RESPONSE_CODE_BAD_OPTION
coap_pdu_code_t_COAP_RESPONSE_CODE_BAD_REQUEST
coap_pdu_code_t_COAP_RESPONSE_CODE_CHANGED
coap_pdu_code_t_COAP_RESPONSE_CODE_CONFLICT
coap_pdu_code_t_COAP_RESPONSE_CODE_CONTENT
coap_pdu_code_t_COAP_RESPONSE_CODE_CONTINUE
coap_pdu_code_t_COAP_RESPONSE_CODE_CREATED
coap_pdu_code_t_COAP_RESPONSE_CODE_DELETED
coap_pdu_code_t_COAP_RESPONSE_CODE_FORBIDDEN
coap_pdu_code_t_COAP_RESPONSE_CODE_GATEWAY_TIMEOUT
coap_pdu_code_t_COAP_RESPONSE_CODE_HOP_LIMIT_REACHED
coap_pdu_code_t_COAP_RESPONSE_CODE_INCOMPLETE
coap_pdu_code_t_COAP_RESPONSE_CODE_INTERNAL_ERROR
coap_pdu_code_t_COAP_RESPONSE_CODE_NOT_ACCEPTABLE
coap_pdu_code_t_COAP_RESPONSE_CODE_NOT_ALLOWED
coap_pdu_code_t_COAP_RESPONSE_CODE_NOT_FOUND
coap_pdu_code_t_COAP_RESPONSE_CODE_NOT_IMPLEMENTED
coap_pdu_code_t_COAP_RESPONSE_CODE_PRECONDITION_FAILED
coap_pdu_code_t_COAP_RESPONSE_CODE_PROXYING_NOT_SUPPORTED
coap_pdu_code_t_COAP_RESPONSE_CODE_REQUEST_TOO_LARGE
coap_pdu_code_t_COAP_RESPONSE_CODE_SERVICE_UNAVAILABLE
coap_pdu_code_t_COAP_RESPONSE_CODE_TOO_MANY_REQUESTS
coap_pdu_code_t_COAP_RESPONSE_CODE_UNAUTHORIZED
coap_pdu_code_t_COAP_RESPONSE_CODE_UNPROCESSABLE
coap_pdu_code_t_COAP_RESPONSE_CODE_UNSUPPORTED_CONTENT_FORMAT
coap_pdu_code_t_COAP_RESPONSE_CODE_VALID
coap_pdu_code_t_COAP_SIGNALING_CODE_ABORT
coap_pdu_code_t_COAP_SIGNALING_CODE_CSM
coap_pdu_code_t_COAP_SIGNALING_CODE_PING
coap_pdu_code_t_COAP_SIGNALING_CODE_PONG
coap_pdu_code_t_COAP_SIGNALING_CODE_RELEASE
coap_pdu_signaling_proto_t_COAP_SIGNALING_ABORT
coap_pdu_signaling_proto_t_COAP_SIGNALING_CSM
coap_pdu_signaling_proto_t_COAP_SIGNALING_PING
coap_pdu_signaling_proto_t_COAP_SIGNALING_PONG
coap_pdu_signaling_proto_t_COAP_SIGNALING_RELEASE
coap_pdu_type_t_COAP_MESSAGE_ACK
coap_pdu_type_t_COAP_MESSAGE_CON
coap_pdu_type_t_COAP_MESSAGE_NON
coap_pdu_type_t_COAP_MESSAGE_RST
coap_pki_define_t_COAP_PKI_KEY_DEF_DER
coap_pki_define_t_COAP_PKI_KEY_DEF_DER_BUF
coap_pki_define_t_COAP_PKI_KEY_DEF_ENGINE
coap_pki_define_t_COAP_PKI_KEY_DEF_PEM
coap_pki_define_t_COAP_PKI_KEY_DEF_PEM_BUF
coap_pki_define_t_COAP_PKI_KEY_DEF_PKCS11
coap_pki_define_t_COAP_PKI_KEY_DEF_PKCS11_RPK
coap_pki_define_t_COAP_PKI_KEY_DEF_RPK_BUF
coap_pki_key_t_COAP_PKI_KEY_ASN1
coap_pki_key_t_COAP_PKI_KEY_DEFINE
coap_pki_key_t_COAP_PKI_KEY_PEM
coap_pki_key_t_COAP_PKI_KEY_PEM_BUF
coap_pki_key_t_COAP_PKI_KEY_PKCS11
coap_proto_t_COAP_PROTO_DTLS
coap_proto_t_COAP_PROTO_LAST
coap_proto_t_COAP_PROTO_NONE
coap_proto_t_COAP_PROTO_TCP
coap_proto_t_COAP_PROTO_TLS
coap_proto_t_COAP_PROTO_UDP
coap_proto_t_COAP_PROTO_WS
coap_proto_t_COAP_PROTO_WSS
coap_proxy_t_COAP_PROXY_DIRECT
coap_proxy_t_COAP_PROXY_DIRECT_STRIP
coap_proxy_t_COAP_PROXY_FORWARD
coap_proxy_t_COAP_PROXY_FORWARD_STRIP
coap_proxy_t_COAP_PROXY_REVERSE
coap_proxy_t_COAP_PROXY_REVERSE_STRIP
coap_request_t_COAP_REQUEST_DELETE
coap_request_t_COAP_REQUEST_FETCH
coap_request_t_COAP_REQUEST_GET
coap_request_t_COAP_REQUEST_IPATCH
coap_request_t_COAP_REQUEST_PATCH
coap_request_t_COAP_REQUEST_POST
coap_request_t_COAP_REQUEST_PUT
coap_resolve_type_t_COAP_RESOLVE_TYPE_LOCAL
coap_resolve_type_t_COAP_RESOLVE_TYPE_REMOTE
coap_response_t_COAP_RESPONSE_FAIL
coap_response_t_COAP_RESPONSE_OK
coap_session_state_t_COAP_SESSION_STATE_CONNECTING
coap_session_state_t_COAP_SESSION_STATE_CSM
coap_session_state_t_COAP_SESSION_STATE_ESTABLISHED
coap_session_state_t_COAP_SESSION_STATE_HANDSHAKE
coap_session_state_t_COAP_SESSION_STATE_NONE
coap_session_type_t_COAP_SESSION_TYPE_CLIENT
coap_session_type_t_COAP_SESSION_TYPE_HELLO
coap_session_type_t_COAP_SESSION_TYPE_NONE
coap_session_type_t_COAP_SESSION_TYPE_SERVER
coap_tls_library_t_COAP_TLS_LIBRARY_GNUTLS
coap_tls_library_t_COAP_TLS_LIBRARY_MBEDTLS
coap_tls_library_t_COAP_TLS_LIBRARY_NOTLS
coap_tls_library_t_COAP_TLS_LIBRARY_OPENSSL
coap_tls_library_t_COAP_TLS_LIBRARY_TINYDTLS
coap_tls_library_t_COAP_TLS_LIBRARY_WOLFSSL
coap_uri_scheme_t_COAP_URI_SCHEME_COAP
coap_uri_scheme_t_COAP_URI_SCHEME_COAPS
coap_uri_scheme_t_COAP_URI_SCHEME_COAPS_TCP
coap_uri_scheme_t_COAP_URI_SCHEME_COAPS_WS
coap_uri_scheme_t_COAP_URI_SCHEME_COAP_TCP
coap_uri_scheme_t_COAP_URI_SCHEME_COAP_WS
coap_uri_scheme_t_COAP_URI_SCHEME_HTTP
coap_uri_scheme_t_COAP_URI_SCHEME_HTTPS
coap_uri_scheme_t_COAP_URI_SCHEME_LAST

Functions§

coap_add_attr
coap_add_block
coap_add_block_b_data
coap_add_data
coap_add_data_after
coap_add_data_blocked_response
coap_add_data_large_request
coap_add_data_large_response
coap_add_option
coap_add_optlist_pdu
coap_add_resource
coap_add_token
coap_address_copy
coap_address_equals
coap_address_get_port
coap_address_init
coap_address_set_port
coap_address_set_unix_domain
coap_af_unix_is_supported
coap_async_get_app_data
coap_async_is_supported
coap_async_set_app_data
coap_async_set_delay
coap_async_trigger
coap_attr_get_value
coap_block_build_body
coap_cache_derive_key
coap_cache_derive_key_w_ignore
coap_cache_get_app_data
coap_cache_get_by_key
coap_cache_get_by_pdu
coap_cache_get_pdu
coap_cache_ignore_options
coap_cache_set_app_data
coap_can_exit
coap_cancel_observe
coap_check_notify
coap_check_option
coap_cleanup
coap_clear_event_handler
coap_client_is_supported
coap_clock_init
coap_clone_uri
coap_context_get_app_data
coap_context_get_coap_fd
coap_context_get_csm_max_message_size
coap_context_get_csm_timeout
coap_context_get_csm_timeout_ms
coap_context_get_max_handshake_sessions
coap_context_get_max_idle_sessions
coap_context_get_session_timeout
coap_context_oscore_server
coap_context_set_app_data
coap_context_set_block_mode
coap_context_set_cid_tuple_change
coap_context_set_csm_max_message_size
coap_context_set_csm_timeout
coap_context_set_csm_timeout_ms
coap_context_set_keepalive
coap_context_set_max_block_size
coap_context_set_max_handshake_sessions
coap_context_set_max_idle_sessions
coap_context_set_max_token_size
coap_context_set_pki
coap_context_set_pki_root_cas
coap_context_set_psk
coap_context_set_psk2
coap_context_set_session_timeout
coap_debug_set_packet_loss
coap_decode_var_bytes
coap_decode_var_bytes8
coap_delete_bin_const
coap_delete_binary
coap_delete_cache_entry
coap_delete_cache_key
coap_delete_optlist
coap_delete_oscore_conf
coap_delete_oscore_recipient
coap_delete_pdu
coap_delete_resource
coap_delete_str_const
coap_delete_string
coap_delete_uri
coap_dtls_cid_is_supported
coap_dtls_get_log_level
coap_dtls_is_supported
coap_dtls_pkcs11_is_supported
coap_dtls_pki_is_supported
coap_dtls_psk_is_supported
coap_dtls_rpk_is_supported
coap_dtls_set_log_level
coap_dump_memory_type_counts
coap_encode_var_safe
coap_encode_var_safe8
coap_endpoint_set_default_mtu
coap_endpoint_str
coap_epoll_is_supported
coap_find_async
coap_find_attr
coap_fls
coap_flsll
coap_free_address_info
coap_free_async
coap_free_context
coap_free_endpoint
coap_free_type
coap_get_app_data
coap_get_available_scheme_hint_bits
coap_get_block
coap_get_block_b
coap_get_data
coap_get_data_large
coap_get_log_level
coap_get_query
coap_get_resource_from_uri_path
coap_get_tls_library_version
coap_get_uri_path
coap_handle_event
coap_host_is_unix_domain
coap_insert_optlist
coap_io_do_epoll
coap_io_do_io
coap_io_pending
coap_io_prepare_epoll
coap_io_prepare_io
coap_io_process
coap_io_process_with_fds
coap_ipv4_is_supported
coap_ipv6_is_supported
coap_is_af_unix
coap_is_bcast
coap_is_mcast
coap_join_mcast_group_intf
coap_log_impl
coap_log_level_desc
coap_make_str_const
coap_malloc_type
coap_mcast_per_resource
coap_mcast_set_hops
coap_memory_init
coap_new_bin_const
coap_new_binary
coap_new_cache_entry
coap_new_client_session
coap_new_client_session_oscore
coap_new_client_session_oscore_pki
coap_new_client_session_oscore_psk
coap_new_client_session_pki
coap_new_client_session_psk
coap_new_client_session_psk2
coap_new_context
coap_new_endpoint
coap_new_error_response
coap_new_message_id
coap_new_optlist
coap_new_oscore_conf
coap_new_oscore_recipient
coap_new_pdu
coap_new_str_const
coap_new_string
coap_new_uri
coap_observe_persist_is_supported
coap_opt_block_num
coap_opt_encode
coap_opt_encode_size
coap_opt_length
coap_opt_parse
coap_opt_setheader
coap_opt_size
coap_opt_value
coap_option_filter_clear
coap_option_filter_get
coap_option_filter_set
coap_option_filter_unset
coap_option_iterator_init
coap_option_next
coap_oscore_is_supported
coap_package_build
coap_package_name
coap_package_version
coap_path_into_optlist
coap_pdu_duplicate
coap_pdu_get_code
coap_pdu_get_mid
coap_pdu_get_token
coap_pdu_get_type
coap_pdu_init
coap_pdu_parse
coap_pdu_set_code
coap_pdu_set_mid
coap_pdu_set_type
coap_persist_observe_add
coap_persist_set_observe_num
coap_persist_startup
coap_persist_stop
coap_persist_track_funcs
coap_print_addr
coap_print_ip_addr
coap_print_link
coap_print_wellknown
coap_prng
coap_prng_init
coap_proxy_forward_request
coap_proxy_forward_response
coap_proxy_is_supported
coap_q_block_is_supported
coap_query_into_optlist
coap_realloc_type
coap_register_async
coap_register_event_handler
coap_register_handler
coap_register_nack_handler
coap_register_option
coap_register_ping_handler
coap_register_pong_handler
coap_register_request_handler
coap_register_response_handler
coap_resize_binary
coap_resolve_address_info
coap_resource_get_uri_path
coap_resource_get_userdata
coap_resource_init
coap_resource_notify_observers
coap_resource_proxy_uri_init
coap_resource_proxy_uri_init2
coap_resource_release_userdata_handler
coap_resource_reverse_proxy_init
coap_resource_set_dirty
coap_resource_set_get_observable
coap_resource_set_mode
coap_resource_set_userdata
coap_resource_unknown_init
coap_resource_unknown_init2
coap_response_phrase
coap_send
coap_send_ack
coap_send_error
coap_send_message_type
coap_send_rst
coap_server_is_supported
coap_session_disconnected
coap_session_get_ack_random_factor
coap_session_get_ack_timeout
coap_session_get_addr_local
coap_session_get_addr_mcast
coap_session_get_addr_remote
coap_session_get_app_data
coap_session_get_by_peer
coap_session_get_context
coap_session_get_default_leisure
coap_session_get_ifindex
coap_session_get_max_payloads
coap_session_get_max_retransmit
coap_session_get_non_max_retransmit
coap_session_get_non_receive_timeout
coap_session_get_non_timeout
coap_session_get_nstart
coap_session_get_probing_rate
coap_session_get_proto
coap_session_get_psk_hint
coap_session_get_psk_identity
coap_session_get_psk_key
coap_session_get_state
coap_session_get_tls
coap_session_get_type
coap_session_init_token
coap_session_max_pdu_size
coap_session_new_token
coap_session_reference
coap_session_release
coap_session_send_ping
coap_session_set_ack_random_factor
coap_session_set_ack_timeout
coap_session_set_app_data
coap_session_set_default_leisure
coap_session_set_max_payloads
coap_session_set_max_retransmit
coap_session_set_mtu
coap_session_set_no_observe_cancel
coap_session_set_non_max_retransmit
coap_session_set_non_receive_timeout
coap_session_set_non_timeout
coap_session_set_nstart
coap_session_set_probing_rate
coap_session_set_type_client
coap_session_str
coap_set_app_data
coap_set_event_handler
coap_set_log_handler
coap_set_log_level
coap_set_prng
coap_set_show_pdu_output
coap_show_pdu
coap_show_tls_version
coap_socket_strerror
coap_split_path
coap_split_proxy_uri
coap_split_query
coap_split_uri
coap_startup
coap_startup_with_feature_checks
Initialize the CoAP library and additionally perform runtime checks to ensure that required features (as enabled in Cargo.toml) are available and that the used DTLS library matches the one that was determined during compile-time.
coap_string_equal_internal
Internal only function for CoAP string comparisons.
coap_string_tls_support
coap_string_tls_version
coap_tcp_is_supported
coap_threadsafe_is_supported
coap_ticks
coap_ticks_from_rt_us
coap_ticks_to_rt
coap_ticks_to_rt_us
coap_tls_engine_configure
coap_tls_engine_remove
coap_tls_is_supported
coap_uri_into_options
coap_uri_into_optlist
coap_verify_proxy_scheme_supported
coap_write_block_b_opt
coap_write_block_opt
coap_ws_is_supported
coap_ws_set_host_request
coap_wss_is_supported

Type Aliases§

coap_asn1_privatekey_type_t
coap_cache_app_data_free_callback_t
coap_cache_record_pdu_t
coap_cache_session_based_t
coap_dtls_cn_callback_t
coap_dtls_id_callback_t
coap_dtls_ih_callback_t
coap_dtls_pki_sni_callback_t
coap_dtls_psk_sni_callback_t
coap_dtls_role_t
coap_dtls_security_setup_t
coap_dyn_resource_added_t
coap_event_handler_t
coap_event_t
coap_fd_t
coap_log_handler_t
coap_log_t
coap_memory_tag_t
coap_method_handler_t
coap_mid_t
coap_nack_handler_t
coap_nack_reason_t
coap_observe_added_t
coap_observe_deleted_t
coap_opt_t
coap_option_num_t
coap_oscore_save_seq_num_t
coap_pdu_code_t
coap_pdu_signaling_proto_t
coap_pdu_type_t
coap_ping_handler_t
coap_pki_define_t
coap_pki_key_t
coap_pong_handler_t
coap_print_status_t
coap_proto_t
coap_proxy_t
coap_rand_func_t
coap_release_large_data_t
coap_request_t
coap_resolve_type_t
coap_resource_deleted_t
coap_resource_release_userdata_handler_t
coap_response_handler_t
coap_response_t
coap_session_state_t
coap_session_type_t
coap_socket_flags_t
coap_tick_diff_t
coap_tick_t
coap_time_t
coap_tls_library_t
coap_track_observe_value_t
coap_uri_scheme_t

Unions§

coap_address_t__bindgen_ty_1
coap_const_char_ptr_t
coap_dtls_key_t__bindgen_ty_1