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 crate (or another coap library written in pure rust such as coap-rs) instead.
§Cargo Features
We currently define a number of features that affect the functionality provided by this wrapper and required by the linked libcoap library.
Features affecting functionality:
-
dtls
: Enable usage of DTLS for transport security. Supports a number of different backends.Note that while not specified here due to limitations in Cargo’s syntax, the DTLS feature depends on one of the DTLS backends being enabled, and failing to enable a DTLS backend will result in a build failure.
If you are developing a library based on libcoap-sys and do not care about the DTLS backend, enable the dtls feature and let the user decide on the backend to use, either by re-exporting these features (see the Cargo Book) or by assuming that the user will use libcoap-sys as a dependency and enable the corresponding backend feature themselves, relying on Cargo’s feature unification to enable it for your crate as well.
Also note that the backends are mutually exclusive due to the C library having these backends as mutually exclusive features. If multiple backends are enabled (e.g. because multiple dependencies use libcoap-sys and use different backends), we select one based on the auto-detection order specified in the libcoap configure script (gnutls > openssl > mbedtls > tinydtls).
-
dtls_backend_(openssl|gnutls|mbedtls|tinydtls)
: Enable the corresponding DTLS backend.Note that enabling the OpenSSL, GnuTLS, TinyDTLS or MbedTLS backend will also require the appropriate library to be available (hence the dependency on the corresponding sys-crate). The TinyDTLS backend is built using a vendored (and statically linked) version of TinyDTLS by default, see the tinydtls-sys crate for more info. Choosing a DTLS backend also means that the license terms of these libraries may apply to you. See the relevant parts of the libcoap license file for more information.
-
-
tcp
(default): Enable CoAP over TCP support -
async
(default): Enable async functionality.Note that this async functionality is not translated to Rust’s async language functionality, but instead adds functionality to the underlying C library to allow for making asynchronous requests (i.e. function calls that return before the response has arrived).
Integrating libcoap into Rusts async language features is out of scope for this crate, but might be implemented later on in the libcoap (safe abstraction) crate.
-
server
(default): Enable code related to server functionality -
client
(default): Enable code related to client functionality -
epoll
(default): Allow the underlying C library to perform IO operations using epoll.
Other features:
vendored
(default): Use a vendored version of libcoap instead of the system-provided one. Note thatvendored
impliesstatic
.static
(default): Perform static linking to the libcoap C library.
§Note on features affecting functionality
The features that add or remove functionality do not change the generated bindings as libcoap’s
headers (unlike the source files themselves) are not affected by the corresponding #define
s.
For library users that link to a shared version of libcoap, this means that the feature flags do not have any effect and the supported features will correspond directly to the features enabled during the build of the shared libcoap instance (using the configure-script).
For users of the vendored version of libcoap (see the vendored
feature), the supported
features of the vendored libcoap will be set to match the cargo features during build.
Structs§
- __
Bindgen Bitfield Unit - __
Bindgen Union Field - coap_
addr_ hash_ t - coap_
addr_ tuple_ t - coap_
address_ t - coap_
address_ t__ bindgen_ ty_ 1 - 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_
packet_ t - coap_
pdu_ t - coap_
pki_ key_ asn1_ t - coap_
pki_ key_ pem_ buf_ t - coap_
pki_ key_ pem_ t - coap_
pki_ key_ pkcs11_ t - coap_
queue_ t - coap_
resource_ t - coap_
session_ t - coap_
socket_ t - coap_
str_ const_ t - coap_
string_ t - coap_
subscription_ t - coap_
tls_ version_ t - coap_
uri_ t
Enums§
- coap_
asn1_ privatekey_ type_ t - coap_
cache_ record_ pdu_ t - coap_
cache_ session_ based_ t - coap_
dtls_ role_ t - coap_
event_ t - coap_
memory_ tag_ t - coap_
nack_ reason_ t - coap_
pdu_ code_ t - coap_
pdu_ signaling_ proto_ t - coap_
pdu_ type_ t - coap_
pki_ key_ t - coap_
proto_ t - coap_
request_ t - coap_
response_ t - coap_
session_ state_ t - coap_
session_ type_ t - coap_
tls_ library_ t - coap_
uri_ scheme_ t
Constants§
- COAP_
ATTR_ FLAGS_ RELEASE_ NAME - COAP_
ATTR_ FLAGS_ RELEASE_ VALUE - COAP_
BERT_ BASE - COAP_
BLOCK_ SINGLE_ BODY - COAP_
BLOCK_ USE_ LIBCOAP - COAP_
DEFAULT_ HOP_ LIMIT - COAP_
DEFAULT_ MAX_ AGE - COAP_
DEFAULT_ MAX_ LATENCY - COAP_
DEFAULT_ MAX_ RETRANSMIT - COAP_
DEFAULT_ MTU - COAP_
DEFAULT_ NSTART - COAP_
DEFAULT_ PORT - COAP_
DEFAULT_ PROBING_ RATE - COAP_
DEFAULT_ SCHEME - COAP_
DEFAULT_ URI_ WELLKNOWN - 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_
ERROR_ PHRASE_ LENGTH - COAP_
INVALID_ MID - COAP_
INVALID_ SOCKET - COAP_
INVALID_ TID - COAP_
IO_ WAIT - COAP_
LOG_ CIPHERS - COAP_
MAX_ BLOCK_ SZX - COAP_
MAX_ EPOLL_ EVENTS - COAP_
MAX_ OPT - COAP_
MAX_ STR_ CONST_ FUNC - COAP_
MEDIATYPE_ ANY - COAP_
MEDIATYPE_ APPLICATION_ ACE_ CBOR - COAP_
MEDIATYPE_ APPLICATION_ CBOR - COAP_
MEDIATYPE_ APPLICATION_ COAP_ GROUP_ JSON - COAP_
MEDIATYPE_ APPLICATION_ COSE_ ENCRYPT - COAP_
MEDIATYPE_ APPLICATION_ COSE_ ENCRYP T0 - 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_ OCTET_ STREAM - 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_ BLOC K1 - COAP_
OPTION_ BLOC K2 - 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_ 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_
PRINT_ STATUS_ ERROR - COAP_
PRINT_ STATUS_ MASK - COAP_
PRINT_ STATUS_ TRUNC - COAP_
RESOURCE_ CHECK_ TIME - 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_ RELEASE_ URI - COAP_
RXBUFFER_ SIZE - COAP_
SIGNALING_ OPTION_ ALTERNATIVE_ ADDRESS - COAP_
SIGNALING_ OPTION_ BAD_ CSM_ OPTION - COAP_
SIGNALING_ OPTION_ BLOCK_ WISE_ TRANSFER - COAP_
SIGNALING_ OPTION_ CUSTODY - COAP_
SIGNALING_ OPTION_ HOLD_ OFF - COAP_
SIGNALING_ OPTION_ MAX_ MESSAGE_ SIZE - COAP_
SOCKET_ ERROR - COAP_
URI_ SCHEME_ SECURE_ MASK
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_ ⚠equals - coap_
address_ ⚠get_ port - coap_
address_ ⚠init - coap_
address_ ⚠set_ port - 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_ ⚠option - coap_
cleanup ⚠ - coap_
clear_ ⚠event_ handler - coap_
clock_ ⚠init - coap_
clone_ ⚠uri - coap_
context_ ⚠get_ coap_ fd - coap_
context_ ⚠get_ csm_ max_ message_ size - coap_
context_ ⚠get_ csm_ timeout - coap_
context_ ⚠get_ max_ handshake_ sessions - coap_
context_ ⚠get_ max_ idle_ sessions - coap_
context_ ⚠get_ session_ timeout - coap_
context_ ⚠set_ block_ mode - coap_
context_ ⚠set_ csm_ max_ message_ size - coap_
context_ ⚠set_ csm_ timeout - coap_
context_ ⚠set_ keepalive - coap_
context_ ⚠set_ max_ handshake_ sessions - coap_
context_ ⚠set_ max_ idle_ sessions - 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_ ⚠send_ packet - 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_ ⚠pdu - coap_
delete_ ⚠resource - coap_
delete_ ⚠str_ const - coap_
delete_ ⚠string - coap_
dtls_ ⚠get_ log_ level - coap_
dtls_ ⚠is_ supported - coap_
dtls_ ⚠set_ log_ level - coap_
encode_ ⚠var_ safe - coap_
encode_ ⚠var_ safe8 - coap_
endpoint_ ⚠set_ default_ mtu - coap_
endpoint_ ⚠str - coap_
find_ ⚠async - coap_
find_ ⚠attr - coap_
fls ⚠ - coap_
flsll ⚠ - coap_
free_ ⚠async - coap_
free_ ⚠context - coap_
free_ ⚠endpoint - coap_
free_ ⚠type - coap_
get_ ⚠app_ data - 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_
insert_ ⚠optlist - coap_
io_ ⚠do_ epoll - coap_
io_ ⚠do_ io - coap_
io_ ⚠prepare_ epoll - coap_
io_ ⚠prepare_ io - coap_
io_ ⚠process - coap_
io_ ⚠process_ with_ fds - coap_
is_ ⚠mcast - coap_
join_ ⚠mcast_ group_ intf - coap_
log_ ⚠impl - 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_ 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_ ⚠pdu - coap_
new_ ⚠str_ const - coap_
new_ ⚠string - coap_
new_ ⚠uri - 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_
package_ ⚠build - coap_
package_ ⚠name - coap_
package_ ⚠version - 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_
print_ ⚠addr - coap_
print_ ⚠link - coap_
prng ⚠ - coap_
prng_ ⚠init - 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_
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_ ⚠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_
session_ ⚠disconnected - coap_
session_ ⚠get_ ack_ random_ factor - coap_
session_ ⚠get_ ack_ timeout - coap_
session_ ⚠get_ addr_ local - 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_ retransmit - 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_ retransmit - coap_
session_ ⚠set_ mtu - coap_
session_ ⚠set_ no_ observe_ cancel - 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_
string_ ⚠tls_ support - coap_
string_ ⚠tls_ version - coap_
tcp_ ⚠is_ supported - coap_
ticks ⚠ - coap_
ticks_ ⚠from_ rt_ us - coap_
ticks_ ⚠to_ rt - coap_
ticks_ ⚠to_ rt_ us - coap_
tls_ ⚠is_ supported - coap_
write_ ⚠block_ b_ opt - coap_
write_ ⚠block_ opt
Type Aliases§
- coap_
cache_ app_ data_ free_ callback_ 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_ security_ setup_ t - coap_
event_ handler_ t - coap_
fd_ t - coap_
log_ handler_ t - coap_
log_ t - coap_
method_ handler_ t - coap_
mid_ t - coap_
nack_ handler_ t - coap_
opt_ t - coap_
option_ num_ t - coap_
ping_ handler_ t - coap_
pong_ handler_ t - coap_
print_ status_ t - coap_
rand_ func_ t - coap_
release_ large_ data_ t - coap_
resource_ release_ userdata_ handler_ t - coap_
response_ handler_ t - coap_
socket_ flags_ t - coap_
tick_ diff_ t - coap_
tick_ t - coap_
time_ t