1
2
3
/* automatically generated by rust-bindgen 0.65.1 */

# [repr (C)] # [derive (Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd)] pub struct __BindgenBitfieldUnit < Storage > { storage : Storage , } impl < Storage > __BindgenBitfieldUnit < Storage > { # [inline] pub const fn new (storage : Storage) -> Self { Self { storage } } } impl < Storage > __BindgenBitfieldUnit < Storage > where Storage : AsRef < [u8] > + AsMut < [u8] >, { # [inline] pub fn get_bit (& self , index : usize) -> bool { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = self . storage . as_ref () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [inline] pub fn set_bit (& mut self , index : usize , val : bool) { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [inline] pub fn get (& self , bit_offset : usize , bit_width : u8) -> u64 { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; let mut val = 0 ; for i in 0 .. (bit_width as usize) { if self . get_bit (i + bit_offset) { let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [inline] pub fn set (& mut self , bit_offset : usize , bit_width : u8 , val : u64) { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; for i in 0 .. (bit_width as usize) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; self . set_bit (index + bit_offset , val_bit_is_set) ; } } } # [repr (C)] pub struct __BindgenUnionField < T > (:: std :: marker :: PhantomData < T >) ; impl < T > __BindgenUnionField < T > { # [inline] pub const fn new () -> Self { __BindgenUnionField (:: std :: marker :: PhantomData) } # [inline] pub unsafe fn as_ref (& self) -> & T { :: std :: mem :: transmute (self) } # [inline] pub unsafe fn as_mut (& mut self) -> & mut T { :: std :: mem :: transmute (self) } } impl < T > :: std :: default :: Default for __BindgenUnionField < T > { # [inline] fn default () -> Self { Self :: new () } } impl < T > :: std :: clone :: Clone for __BindgenUnionField < T > { # [inline] fn clone (& self) -> Self { Self :: new () } } impl < T > :: std :: marker :: Copy for __BindgenUnionField < T > { } impl < T > :: std :: fmt :: Debug for __BindgenUnionField < T > { fn fmt (& self , fmt : & mut :: std :: fmt :: Formatter < '_ >) -> :: std :: fmt :: Result { fmt . write_str ("__BindgenUnionField") } } impl < T > :: std :: hash :: Hash for __BindgenUnionField < T > { fn hash < H : :: std :: hash :: Hasher > (& self , _state : & mut H) { } } impl < T > :: std :: cmp :: PartialEq for __BindgenUnionField < T > { fn eq (& self , _other : & __BindgenUnionField < T >) -> bool { true } } impl < T > :: std :: cmp :: Eq for __BindgenUnionField < T > { } pub const COAP_OPT_FILTER_SHORT : u32 = 6 ; pub const COAP_OPT_FILTER_LONG : u32 = 2 ; pub const COAP_MAX_STR_CONST_FUNC : u32 = 2 ; pub const COAP_URI_SCHEME_SECURE_MASK : u32 = 1 ; pub const COAP_DEFAULT_PORT : u32 = 5683 ; pub const COAP_DEFAULT_MAX_AGE : u32 = 60 ; pub const COAP_DEFAULT_MTU : u32 = 1152 ; pub const COAP_BERT_BASE : u32 = 1152 ; pub const COAP_DEFAULT_HOP_LIMIT : u32 = 16 ; pub const COAP_DEFAULT_SCHEME : & [u8 ; 5usize] = b"coap\0" ; pub const COAP_DEFAULT_URI_WELLKNOWN : & [u8 ; 17usize] = b".well-known/core\0" ; pub const COAP_OPTION_IF_MATCH : u32 = 1 ; pub const COAP_OPTION_URI_HOST : u32 = 3 ; pub const COAP_OPTION_ETAG : u32 = 4 ; pub const COAP_OPTION_IF_NONE_MATCH : u32 = 5 ; pub const COAP_OPTION_OBSERVE : u32 = 6 ; pub const COAP_OPTION_URI_PORT : u32 = 7 ; pub const COAP_OPTION_LOCATION_PATH : u32 = 8 ; pub const COAP_OPTION_OSCORE : u32 = 9 ; pub const COAP_OPTION_URI_PATH : u32 = 11 ; pub const COAP_OPTION_CONTENT_FORMAT : u32 = 12 ; pub const COAP_OPTION_CONTENT_TYPE : u32 = 12 ; pub const COAP_OPTION_MAXAGE : u32 = 14 ; pub const COAP_OPTION_URI_QUERY : u32 = 15 ; pub const COAP_OPTION_HOP_LIMIT : u32 = 16 ; pub const COAP_OPTION_ACCEPT : u32 = 17 ; pub const COAP_OPTION_LOCATION_QUERY : u32 = 20 ; pub const COAP_OPTION_BLOCK2 : u32 = 23 ; pub const COAP_OPTION_BLOCK1 : u32 = 27 ; pub const COAP_OPTION_SIZE2 : u32 = 28 ; pub const COAP_OPTION_PROXY_URI : u32 = 35 ; pub const COAP_OPTION_PROXY_SCHEME : u32 = 39 ; pub const COAP_OPTION_SIZE1 : u32 = 60 ; pub const COAP_OPTION_ECHO : u32 = 252 ; pub const COAP_OPTION_NORESPONSE : u32 = 258 ; pub const COAP_OPTION_RTAG : u32 = 292 ; pub const COAP_MAX_OPT : u32 = 65535 ; pub const COAP_ERROR_PHRASE_LENGTH : u32 = 32 ; pub const COAP_SIGNALING_OPTION_MAX_MESSAGE_SIZE : u32 = 2 ; pub const COAP_SIGNALING_OPTION_BLOCK_WISE_TRANSFER : u32 = 4 ; pub const COAP_SIGNALING_OPTION_CUSTODY : u32 = 2 ; pub const COAP_SIGNALING_OPTION_ALTERNATIVE_ADDRESS : u32 = 2 ; pub const COAP_SIGNALING_OPTION_HOLD_OFF : u32 = 4 ; pub const COAP_SIGNALING_OPTION_BAD_CSM_OPTION : u32 = 2 ; pub const COAP_MEDIATYPE_TEXT_PLAIN : u32 = 0 ; pub const COAP_MEDIATYPE_APPLICATION_LINK_FORMAT : u32 = 40 ; pub const COAP_MEDIATYPE_APPLICATION_XML : u32 = 41 ; pub const COAP_MEDIATYPE_APPLICATION_OCTET_STREAM : u32 = 42 ; pub const COAP_MEDIATYPE_APPLICATION_RDF_XML : u32 = 43 ; pub const COAP_MEDIATYPE_APPLICATION_EXI : u32 = 47 ; pub const COAP_MEDIATYPE_APPLICATION_JSON : u32 = 50 ; pub const COAP_MEDIATYPE_APPLICATION_CBOR : u32 = 60 ; pub const COAP_MEDIATYPE_APPLICATION_CWT : u32 = 61 ; pub const COAP_MEDIATYPE_APPLICATION_COAP_GROUP_JSON : u32 = 256 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_SIGN : u32 = 98 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_SIGN1 : u32 = 18 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT : u32 = 96 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT0 : u32 = 16 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_MAC : u32 = 97 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_MAC0 : u32 = 17 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_KEY : u32 = 101 ; pub const COAP_MEDIATYPE_APPLICATION_COSE_KEY_SET : u32 = 102 ; pub const COAP_MEDIATYPE_APPLICATION_SENML_JSON : u32 = 110 ; pub const COAP_MEDIATYPE_APPLICATION_SENSML_JSON : u32 = 111 ; pub const COAP_MEDIATYPE_APPLICATION_SENML_CBOR : u32 = 112 ; pub const COAP_MEDIATYPE_APPLICATION_SENSML_CBOR : u32 = 113 ; pub const COAP_MEDIATYPE_APPLICATION_SENML_EXI : u32 = 114 ; pub const COAP_MEDIATYPE_APPLICATION_SENSML_EXI : u32 = 115 ; pub const COAP_MEDIATYPE_APPLICATION_SENML_XML : u32 = 310 ; pub const COAP_MEDIATYPE_APPLICATION_SENSML_XML : u32 = 311 ; pub const COAP_MEDIATYPE_APPLICATION_DOTS_CBOR : u32 = 271 ; pub const COAP_MEDIATYPE_APPLICATION_ACE_CBOR : u32 = 19 ; pub const COAP_MEDIATYPE_ANY : u32 = 255 ; pub const COAP_INVALID_MID : i32 = - 1 ; pub const COAP_INVALID_TID : i32 = - 1 ; pub const COAP_MAX_BLOCK_SZX : u32 = 6 ; pub const COAP_BLOCK_USE_LIBCOAP : u32 = 1 ; pub const COAP_BLOCK_SINGLE_BODY : u32 = 2 ; pub const COAP_RXBUFFER_SIZE : u32 = 1472 ; pub const COAP_MAX_EPOLL_EVENTS : u32 = 10 ; pub const COAP_SOCKET_ERROR : i32 = - 1 ; pub const COAP_INVALID_SOCKET : i32 = - 1 ; pub const COAP_DTLS_HINT_LENGTH : u32 = 128 ; pub const COAP_DTLS_MAX_PSK_IDENTITY : u32 = 64 ; pub const COAP_DTLS_MAX_PSK : u32 = 64 ; pub const COAP_DTLS_RPK_CERT_CN : & [u8 ; 4usize] = b"RPK\0" ; pub const COAP_DTLS_PKI_SETUP_VERSION : u32 = 1 ; pub const COAP_DTLS_CPSK_SETUP_VERSION : u32 = 1 ; pub const COAP_DTLS_SPSK_SETUP_VERSION : u32 = 1 ; pub const COAP_DEFAULT_MAX_RETRANSMIT : u32 = 4 ; pub const COAP_DEFAULT_NSTART : u32 = 1 ; pub const COAP_DEFAULT_PROBING_RATE : u32 = 1 ; pub const COAP_DEFAULT_MAX_LATENCY : u32 = 100 ; pub const COAP_IO_WAIT : u32 = 0 ; pub const COAP_LOG_CIPHERS : u32 = 9 ; pub const COAP_OBSERVE_ESTABLISH : u32 = 0 ; pub const COAP_OBSERVE_CANCEL : u32 = 1 ; pub const COAP_RESOURCE_CHECK_TIME : u32 = 2 ; pub const COAP_ATTR_FLAGS_RELEASE_NAME : u32 = 1 ; pub const COAP_ATTR_FLAGS_RELEASE_VALUE : u32 = 2 ; pub const COAP_RESOURCE_FLAGS_RELEASE_URI : u32 = 1 ; pub const COAP_RESOURCE_FLAGS_NOTIFY_NON : u32 = 0 ; pub const COAP_RESOURCE_FLAGS_NOTIFY_CON : u32 = 2 ; pub const COAP_RESOURCE_FLAGS_NOTIFY_NON_ALWAYS : u32 = 4 ; pub const COAP_RESOURCE_FLAGS_HAS_MCAST_SUPPORT : u32 = 8 ; pub const COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_DELAYS : u32 = 16 ; pub const COAP_RESOURCE_FLAGS_LIB_ENA_MCAST_SUPPRESS_2_05 : u32 = 32 ; pub const COAP_RESOURCE_FLAGS_LIB_ENA_MCAST_SUPPRESS_2_XX : u32 = 64 ; pub const COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_SUPPRESS_4_XX : u32 = 128 ; pub const COAP_RESOURCE_FLAGS_LIB_DIS_MCAST_SUPPRESS_5_XX : u32 = 256 ; pub const COAP_RESOURCE_FLAGS_MCAST_LIST : u32 = 504 ; pub const COAP_PRINT_STATUS_MASK : u32 = 4026531840 ; pub const COAP_PRINT_STATUS_ERROR : u32 = 2147483648 ; pub const COAP_PRINT_STATUS_TRUNC : u32 = 1073741824 ; extern "C" { pub fn coap_startup () ; } extern "C" { pub fn coap_cleanup () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_async_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_lg_xmit_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_lg_crcv_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_lg_srcv_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_cache_entry_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_cache_key_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_packet_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_socket_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_context_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_queue_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_pdu_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_attr_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_resource_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_addr_hash_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_endpoint_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_session_t { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_subscription_t { _unused : [u8 ; 0] , } extern "C" { pub fn coap_fls (i : :: std :: os :: raw :: c_uint) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_flsll (i : :: std :: os :: raw :: c_longlong) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_decode_var_bytes (buf : * const u8 , length : usize) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_decode_var_bytes8 (buf : * const u8 , length : usize) -> u64 ; } extern "C" { pub fn coap_encode_var_safe (buf : * mut u8 , length : usize , value : :: std :: os :: raw :: c_uint) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_encode_var_safe8 (buf : * mut u8 , length : usize , value : u64) -> :: std :: os :: raw :: c_uint ; } pub type coap_option_num_t = u16 ; pub type coap_opt_t = u8 ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_option_t { pub delta : u16 , pub length : usize , pub value : * const u8 , } # [test] fn bindgen_test_layout_coap_option_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_option_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_option_t > () , 24usize , concat ! ("Size of: " , stringify ! (coap_option_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_option_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_option_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . delta) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_option_t) , "::" , stringify ! (delta))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_option_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_option_t) , "::" , stringify ! (value))) ; } extern "C" { pub fn coap_opt_parse (opt : * const coap_opt_t , length : usize , result : * mut coap_option_t) -> usize ; } extern "C" { pub fn coap_opt_size (opt : * const coap_opt_t) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_opt_filter_t { pub mask : u16 , pub long_opts : [u16 ; 2usize] , pub short_opts : [u8 ; 6usize] , } # [test] fn bindgen_test_layout_coap_opt_filter_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_opt_filter_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_opt_filter_t > () , 12usize , concat ! ("Size of: " , stringify ! (coap_opt_filter_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_opt_filter_t > () , 2usize , concat ! ("Alignment of " , stringify ! (coap_opt_filter_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mask) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_opt_filter_t) , "::" , stringify ! (mask))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . long_opts) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (coap_opt_filter_t) , "::" , stringify ! (long_opts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . short_opts) as usize - ptr as usize } , 6usize , concat ! ("Offset of field: " , stringify ! (coap_opt_filter_t) , "::" , stringify ! (short_opts))) ; } extern "C" { pub fn coap_option_filter_clear (filter : * mut coap_opt_filter_t) ; } extern "C" { pub fn coap_option_filter_set (filter : * mut coap_opt_filter_t , number : coap_option_num_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_option_filter_unset (filter : * mut coap_opt_filter_t , number : coap_option_num_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_option_filter_get (filter : * mut coap_opt_filter_t , number : coap_option_num_t) -> :: std :: os :: raw :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_opt_iterator_t { pub length : usize , pub number : coap_option_num_t , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub next_option : * mut coap_opt_t , pub filter : coap_opt_filter_t , } # [test] fn bindgen_test_layout_coap_opt_iterator_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_opt_iterator_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_opt_iterator_t > () , 40usize , concat ! ("Size of: " , stringify ! (coap_opt_iterator_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_opt_iterator_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_opt_iterator_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_opt_iterator_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . number) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_opt_iterator_t) , "::" , stringify ! (number))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next_option) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_opt_iterator_t) , "::" , stringify ! (next_option))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filter) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_opt_iterator_t) , "::" , stringify ! (filter))) ; } impl coap_opt_iterator_t { # [inline] pub fn bad (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_bad (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn filtered (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_filtered (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (bad : :: std :: os :: raw :: c_uint , filtered : :: std :: os :: raw :: c_uint) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let bad : u32 = unsafe { :: std :: mem :: transmute (bad) } ; bad as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let filtered : u32 = unsafe { :: std :: mem :: transmute (filtered) } ; filtered as u64 }) ; __bindgen_bitfield_unit } } extern "C" { pub fn coap_option_iterator_init (pdu : * const coap_pdu_t , oi : * mut coap_opt_iterator_t , filter : * const coap_opt_filter_t) -> * mut coap_opt_iterator_t ; } extern "C" { pub fn coap_option_next (oi : * mut coap_opt_iterator_t) -> * mut coap_opt_t ; } extern "C" { pub fn coap_check_option (pdu : * const coap_pdu_t , number : coap_option_num_t , oi : * mut coap_opt_iterator_t) -> * mut coap_opt_t ; } extern "C" { pub fn coap_opt_setheader (opt : * mut coap_opt_t , maxlen : usize , delta : u16 , length : usize) -> usize ; } extern "C" { pub fn coap_opt_encode_size (delta : u16 , length : usize) -> usize ; } extern "C" { pub fn coap_opt_encode (opt : * mut coap_opt_t , n : usize , delta : u16 , val : * const u8 , length : usize) -> usize ; } extern "C" { pub fn coap_opt_length (opt : * const coap_opt_t) -> u32 ; } extern "C" { pub fn coap_opt_value (opt : * const coap_opt_t) -> * const u8 ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_optlist_t { pub next : * mut coap_optlist_t , pub number : u16 , pub length : usize , pub data : * mut u8 , } # [test] fn bindgen_test_layout_coap_optlist_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_optlist_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_optlist_t > () , 32usize , concat ! ("Size of: " , stringify ! (coap_optlist_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_optlist_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_optlist_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_optlist_t) , "::" , stringify ! (next))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . number) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_optlist_t) , "::" , stringify ! (number))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_optlist_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_optlist_t) , "::" , stringify ! (data))) ; } extern "C" { pub fn coap_new_optlist (number : u16 , length : usize , data : * const u8) -> * mut coap_optlist_t ; } extern "C" { pub fn coap_add_optlist_pdu (pdu : * mut coap_pdu_t , optlist_chain : * mut * mut coap_optlist_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_insert_optlist (optlist_chain : * mut * mut coap_optlist_t , optlist : * mut coap_optlist_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_delete_optlist (optlist_chain : * mut coap_optlist_t) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_string_t { pub length : usize , pub s : * mut u8 , } # [test] fn bindgen_test_layout_coap_string_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_string_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_string_t > () , 16usize , concat ! ("Size of: " , stringify ! (coap_string_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_string_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_string_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_string_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . s) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_string_t) , "::" , stringify ! (s))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_str_const_t { pub length : usize , pub s : * const u8 , } # [test] fn bindgen_test_layout_coap_str_const_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_str_const_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_str_const_t > () , 16usize , concat ! ("Size of: " , stringify ! (coap_str_const_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_str_const_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_str_const_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_str_const_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . s) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_str_const_t) , "::" , stringify ! (s))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_binary_t { pub length : usize , pub s : * mut u8 , } # [test] fn bindgen_test_layout_coap_binary_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_binary_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_binary_t > () , 16usize , concat ! ("Size of: " , stringify ! (coap_binary_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_binary_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_binary_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_binary_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . s) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_binary_t) , "::" , stringify ! (s))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_bin_const_t { pub length : usize , pub s : * const u8 , } # [test] fn bindgen_test_layout_coap_bin_const_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_bin_const_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_bin_const_t > () , 16usize , concat ! ("Size of: " , stringify ! (coap_bin_const_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_bin_const_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_bin_const_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_bin_const_t) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . s) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_bin_const_t) , "::" , stringify ! (s))) ; } extern "C" { pub fn coap_new_string (size : usize) -> * mut coap_string_t ; } extern "C" { pub fn coap_delete_string (string : * mut coap_string_t) ; } extern "C" { pub fn coap_new_str_const (data : * const u8 , size : usize) -> * mut coap_str_const_t ; } extern "C" { pub fn coap_delete_str_const (string : * mut coap_str_const_t) ; } extern "C" { pub fn coap_new_binary (size : usize) -> * mut coap_binary_t ; } extern "C" { pub fn coap_delete_binary (binary : * mut coap_binary_t) ; } extern "C" { pub fn coap_resize_binary (binary : * mut coap_binary_t , new_size : usize) -> * mut coap_binary_t ; } extern "C" { pub fn coap_new_bin_const (data : * const u8 , size : usize) -> * mut coap_bin_const_t ; } extern "C" { pub fn coap_delete_bin_const (binary : * mut coap_bin_const_t) ; } extern "C" { pub fn coap_make_str_const (string : * const :: std :: os :: raw :: c_char) -> * mut coap_str_const_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_uri_scheme_t { COAP_URI_SCHEME_COAP = 0 , COAP_URI_SCHEME_COAPS = 1 , COAP_URI_SCHEME_COAP_TCP = 2 , COAP_URI_SCHEME_COAPS_TCP = 3 , COAP_URI_SCHEME_HTTP = 4 , COAP_URI_SCHEME_HTTPS = 5 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_uri_t { pub host : coap_str_const_t , pub port : u16 , pub path : coap_str_const_t , pub query : coap_str_const_t , pub scheme : coap_uri_scheme_t , } # [test] fn bindgen_test_layout_coap_uri_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_uri_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_uri_t > () , 64usize , concat ! ("Size of: " , stringify ! (coap_uri_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_uri_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_uri_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_uri_t) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_uri_t) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_uri_t) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (coap_uri_t) , "::" , stringify ! (query))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (coap_uri_t) , "::" , stringify ! (scheme))) ; } extern "C" { pub fn coap_new_uri (uri : * const u8 , length : :: std :: os :: raw :: c_uint) -> * mut coap_uri_t ; } extern "C" { pub fn coap_clone_uri (uri : * const coap_uri_t) -> * mut coap_uri_t ; } extern "C" { pub fn coap_split_uri (str_var : * const u8 , len : usize , uri : * mut coap_uri_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_split_proxy_uri (str_var : * const u8 , len : usize , uri : * mut coap_uri_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_split_path (s : * const u8 , length : usize , buf : * mut :: std :: os :: raw :: c_uchar , buflen : * mut usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_split_query (s : * const u8 , length : usize , buf : * mut :: std :: os :: raw :: c_uchar , buflen : * mut usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_get_query (request : * const coap_pdu_t) -> * mut coap_string_t ; } extern "C" { pub fn coap_get_uri_path (request : * const coap_pdu_t) -> * mut coap_string_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_pdu_type_t { COAP_MESSAGE_CON = 0 , COAP_MESSAGE_NON = 1 , COAP_MESSAGE_ACK = 2 , COAP_MESSAGE_RST = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_request_t { COAP_REQUEST_GET = 1 , COAP_REQUEST_POST = 2 , COAP_REQUEST_PUT = 3 , COAP_REQUEST_DELETE = 4 , COAP_REQUEST_FETCH = 5 , COAP_REQUEST_PATCH = 6 , COAP_REQUEST_IPATCH = 7 , } extern "C" { pub fn coap_response_phrase (code : :: std :: os :: raw :: c_uchar) -> * const :: std :: os :: raw :: c_char ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_pdu_signaling_proto_t { COAP_SIGNALING_CSM = 225 , COAP_SIGNALING_PING = 226 , COAP_SIGNALING_PONG = 227 , COAP_SIGNALING_RELEASE = 228 , COAP_SIGNALING_ABORT = 229 , } pub type coap_mid_t = :: std :: os :: raw :: c_int ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_option { pub key : u16 , pub length : :: std :: os :: raw :: c_uint , } # [test] fn bindgen_test_layout_coap_option () { const UNINIT : :: std :: mem :: MaybeUninit < coap_option > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_option > () , 8usize , concat ! ("Size of: " , stringify ! (coap_option))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_option > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_option))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_option) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (coap_option) , "::" , stringify ! (length))) ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_proto_t { COAP_PROTO_NONE = 0 , COAP_PROTO_UDP = 1 , COAP_PROTO_DTLS = 2 , COAP_PROTO_TCP = 3 , COAP_PROTO_TLS = 4 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_pdu_code_t { COAP_EMPTY_CODE = 0 , COAP_REQUEST_CODE_GET = 1 , COAP_REQUEST_CODE_POST = 2 , COAP_REQUEST_CODE_PUT = 3 , COAP_REQUEST_CODE_DELETE = 4 , COAP_REQUEST_CODE_FETCH = 5 , COAP_REQUEST_CODE_PATCH = 6 , COAP_REQUEST_CODE_IPATCH = 7 , COAP_RESPONSE_CODE_CREATED = 65 , COAP_RESPONSE_CODE_DELETED = 66 , COAP_RESPONSE_CODE_VALID = 67 , COAP_RESPONSE_CODE_CHANGED = 68 , COAP_RESPONSE_CODE_CONTENT = 69 , COAP_RESPONSE_CODE_CONTINUE = 95 , COAP_RESPONSE_CODE_BAD_REQUEST = 128 , COAP_RESPONSE_CODE_UNAUTHORIZED = 129 , COAP_RESPONSE_CODE_BAD_OPTION = 130 , COAP_RESPONSE_CODE_FORBIDDEN = 131 , COAP_RESPONSE_CODE_NOT_FOUND = 132 , COAP_RESPONSE_CODE_NOT_ALLOWED = 133 , COAP_RESPONSE_CODE_NOT_ACCEPTABLE = 134 , COAP_RESPONSE_CODE_INCOMPLETE = 136 , COAP_RESPONSE_CODE_CONFLICT = 137 , COAP_RESPONSE_CODE_PRECONDITION_FAILED = 140 , COAP_RESPONSE_CODE_REQUEST_TOO_LARGE = 141 , COAP_RESPONSE_CODE_UNSUPPORTED_CONTENT_FORMAT = 143 , COAP_RESPONSE_CODE_UNPROCESSABLE = 150 , COAP_RESPONSE_CODE_TOO_MANY_REQUESTS = 157 , COAP_RESPONSE_CODE_INTERNAL_ERROR = 160 , COAP_RESPONSE_CODE_NOT_IMPLEMENTED = 161 , COAP_RESPONSE_CODE_BAD_GATEWAY = 162 , COAP_RESPONSE_CODE_SERVICE_UNAVAILABLE = 163 , COAP_RESPONSE_CODE_GATEWAY_TIMEOUT = 164 , COAP_RESPONSE_CODE_PROXYING_NOT_SUPPORTED = 165 , COAP_RESPONSE_CODE_HOP_LIMIT_REACHED = 168 , COAP_SIGNALING_CODE_CSM = 225 , COAP_SIGNALING_CODE_PING = 226 , COAP_SIGNALING_CODE_PONG = 227 , COAP_SIGNALING_CODE_RELEASE = 228 , COAP_SIGNALING_CODE_ABORT = 229 , } extern "C" { pub fn coap_pdu_init (type_ : coap_pdu_type_t , code : coap_pdu_code_t , mid : coap_mid_t , size : usize) -> * mut coap_pdu_t ; } extern "C" { pub fn coap_new_pdu (type_ : coap_pdu_type_t , code : coap_pdu_code_t , session : * mut coap_session_t) -> * mut coap_pdu_t ; } extern "C" { pub fn coap_delete_pdu (pdu : * mut coap_pdu_t) ; } extern "C" { pub fn coap_pdu_duplicate (old_pdu : * const coap_pdu_t , session : * mut coap_session_t , token_length : usize , token : * const u8 , drop_options : * mut coap_opt_filter_t) -> * mut coap_pdu_t ; } extern "C" { pub fn coap_pdu_parse (proto : coap_proto_t , data : * const u8 , length : usize , pdu : * mut coap_pdu_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_token (pdu : * mut coap_pdu_t , len : usize , data : * const u8) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_option (pdu : * mut coap_pdu_t , number : coap_option_num_t , len : usize , data : * const u8) -> usize ; } extern "C" { pub fn coap_add_data (pdu : * mut coap_pdu_t , len : usize , data : * const u8) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_data_after (pdu : * mut coap_pdu_t , len : usize) -> * mut u8 ; } extern "C" { pub fn coap_get_data (pdu : * const coap_pdu_t , len : * mut usize , data : * mut * const u8) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_get_data_large (pdu : * const coap_pdu_t , len : * mut usize , data : * mut * const u8 , offset : * mut usize , total : * mut usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_pdu_get_code (pdu : * const coap_pdu_t) -> coap_pdu_code_t ; } extern "C" { pub fn coap_pdu_set_code (pdu : * mut coap_pdu_t , code : coap_pdu_code_t) ; } extern "C" { pub fn coap_pdu_get_type (pdu : * const coap_pdu_t) -> coap_pdu_type_t ; } extern "C" { pub fn coap_pdu_set_type (pdu : * mut coap_pdu_t , type_ : coap_pdu_type_t) ; } extern "C" { pub fn coap_pdu_get_token (pdu : * const coap_pdu_t) -> coap_bin_const_t ; } extern "C" { pub fn coap_pdu_get_mid (pdu : * const coap_pdu_t) -> coap_mid_t ; } extern "C" { pub fn coap_pdu_set_mid (pdu : * mut coap_pdu_t , mid : coap_mid_t) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_block_t { pub num : :: std :: os :: raw :: c_uint , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_coap_block_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_block_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_block_t > () , 8usize , concat ! ("Size of: " , stringify ! (coap_block_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_block_t > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_block_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_block_t) , "::" , stringify ! (num))) ; } impl coap_block_t { # [inline] pub fn m (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_m (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn szx (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 3u8) as u32) } } # [inline] pub fn set_szx (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 3u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (m : :: std :: os :: raw :: c_uint , szx : :: std :: os :: raw :: c_uint) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let m : u32 = unsafe { :: std :: mem :: transmute (m) } ; m as u64 }) ; __bindgen_bitfield_unit . set (1usize , 3u8 , { let szx : u32 = unsafe { :: std :: mem :: transmute (szx) } ; szx as u64 }) ; __bindgen_bitfield_unit } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_block_b_t { pub num : :: std :: os :: raw :: c_uint , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 2usize] > , pub chunk_size : u32 , } # [test] fn bindgen_test_layout_coap_block_b_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_block_b_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_block_b_t > () , 12usize , concat ! ("Size of: " , stringify ! (coap_block_b_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_block_b_t > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_block_b_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_block_b_t) , "::" , stringify ! (num))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_block_b_t) , "::" , stringify ! (chunk_size))) ; } impl coap_block_b_t { # [inline] pub fn m (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_m (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn szx (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 3u8) as u32) } } # [inline] pub fn set_szx (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 3u8 , val as u64) } } # [inline] pub fn aszx (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (4usize , 3u8) as u32) } } # [inline] pub fn set_aszx (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (4usize , 3u8 , val as u64) } } # [inline] pub fn defined (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (7usize , 1u8) as u32) } } # [inline] pub fn set_defined (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (7usize , 1u8 , val as u64) } } # [inline] pub fn bert (& self) -> :: std :: os :: raw :: c_uint { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (8usize , 1u8) as u32) } } # [inline] pub fn set_bert (& mut self , val : :: std :: os :: raw :: c_uint) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (8usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (m : :: std :: os :: raw :: c_uint , szx : :: std :: os :: raw :: c_uint , aszx : :: std :: os :: raw :: c_uint , defined : :: std :: os :: raw :: c_uint , bert : :: std :: os :: raw :: c_uint) -> __BindgenBitfieldUnit < [u8 ; 2usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 2usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let m : u32 = unsafe { :: std :: mem :: transmute (m) } ; m as u64 }) ; __bindgen_bitfield_unit . set (1usize , 3u8 , { let szx : u32 = unsafe { :: std :: mem :: transmute (szx) } ; szx as u64 }) ; __bindgen_bitfield_unit . set (4usize , 3u8 , { let aszx : u32 = unsafe { :: std :: mem :: transmute (aszx) } ; aszx as u64 }) ; __bindgen_bitfield_unit . set (7usize , 1u8 , { let defined : u32 = unsafe { :: std :: mem :: transmute (defined) } ; defined as u64 }) ; __bindgen_bitfield_unit . set (8usize , 1u8 , { let bert : u32 = unsafe { :: std :: mem :: transmute (bert) } ; bert as u64 }) ; __bindgen_bitfield_unit } } extern "C" { pub fn coap_opt_block_num (block_opt : * const coap_opt_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_get_block (pdu : * const coap_pdu_t , number : coap_option_num_t , block : * mut coap_block_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_get_block_b (session : * const coap_session_t , pdu : * const coap_pdu_t , number : coap_option_num_t , block : * mut coap_block_b_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_write_block_opt (block : * mut coap_block_t , number : coap_option_num_t , pdu : * mut coap_pdu_t , data_length : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_write_block_b_opt (session : * mut coap_session_t , block : * mut coap_block_b_t , number : coap_option_num_t , pdu : * mut coap_pdu_t , data_length : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_block (pdu : * mut coap_pdu_t , len : usize , data : * const u8 , block_num : :: std :: os :: raw :: c_uint , block_szx : :: std :: os :: raw :: c_uchar) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_block_b_data (pdu : * mut coap_pdu_t , len : usize , data : * const u8 , block : * mut coap_block_b_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_block_build_body (body_data : * mut coap_binary_t , length : usize , data : * const u8 , offset : usize , total : usize) -> * mut coap_binary_t ; } extern "C" { pub fn coap_add_data_blocked_response (request : * const coap_pdu_t , response : * mut coap_pdu_t , media_type : u16 , maxage : :: std :: os :: raw :: c_int , length : usize , data : * const u8) ; } pub type coap_release_large_data_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , app_ptr : * mut :: std :: os :: raw :: c_void) > ; extern "C" { pub fn coap_add_data_large_request (session : * mut coap_session_t , pdu : * mut coap_pdu_t , length : usize , data : * const u8 , release_func : coap_release_large_data_t , app_ptr : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_add_data_large_response (resource : * mut coap_resource_t , session : * mut coap_session_t , request : * const coap_pdu_t , response : * mut coap_pdu_t , query : * const coap_string_t , media_type : u16 , maxage : :: std :: os :: raw :: c_int , etag : u64 , length : usize , data : * const u8 , release_func : coap_release_large_data_t , app_ptr : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_block_mode (context : * mut coap_context_t , block_mode : u8) ; } extern "C" { pub fn coap_cancel_observe (session : * mut coap_session_t , token : * mut coap_binary_t , message_type : coap_pdu_type_t) -> :: std :: os :: raw :: c_int ; } # [repr (C)] pub struct coap_address_t { pub size : socklen_t , pub addr : coap_address_t__bindgen_ty_1 , } # [repr (C)] pub struct coap_address_t__bindgen_ty_1 { pub sa : __BindgenUnionField < sockaddr > , pub sin : __BindgenUnionField < sockaddr_in > , pub sin6 : __BindgenUnionField < sockaddr_in6 > , pub bindgen_union_field : [u32 ; 7usize] , } # [test] fn bindgen_test_layout_coap_address_t__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < coap_address_t__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_address_t__bindgen_ty_1 > () , 28usize , concat ! ("Size of: " , stringify ! (coap_address_t__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_address_t__bindgen_ty_1 > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_address_t__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sa) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_address_t__bindgen_ty_1) , "::" , stringify ! (sa))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sin) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_address_t__bindgen_ty_1) , "::" , stringify ! (sin))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sin6) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_address_t__bindgen_ty_1) , "::" , stringify ! (sin6))) ; } # [test] fn bindgen_test_layout_coap_address_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_address_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_address_t > () , 32usize , concat ! ("Size of: " , stringify ! (coap_address_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_address_t > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_address_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_address_t) , "::" , stringify ! (size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . addr) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (coap_address_t) , "::" , stringify ! (addr))) ; } extern "C" { pub fn coap_address_get_port (addr : * const coap_address_t) -> u16 ; } extern "C" { pub fn coap_address_set_port (addr : * mut coap_address_t , port : u16) ; } extern "C" { pub fn coap_address_equals (a : * const coap_address_t , b : * const coap_address_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_address_init (addr : * mut coap_address_t) ; } extern "C" { pub fn coap_is_mcast (a : * const coap_address_t) -> :: std :: os :: raw :: c_int ; } pub type coap_fd_t = :: std :: os :: raw :: c_int ; pub type coap_socket_flags_t = u16 ; # [repr (C)] pub struct coap_addr_tuple_t { pub remote : coap_address_t , pub local : coap_address_t , } # [test] fn bindgen_test_layout_coap_addr_tuple_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_addr_tuple_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_addr_tuple_t > () , 64usize , concat ! ("Size of: " , stringify ! (coap_addr_tuple_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_addr_tuple_t > () , 4usize , concat ! ("Alignment of " , stringify ! (coap_addr_tuple_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . remote) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_addr_tuple_t) , "::" , stringify ! (remote))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_addr_tuple_t) , "::" , stringify ! (local))) ; } extern "C" { pub fn coap_socket_strerror () -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_tcp_is_supported () -> :: std :: os :: raw :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_nack_reason_t { COAP_NACK_TOO_MANY_RETRIES = 0 , COAP_NACK_NOT_DELIVERABLE = 1 , COAP_NACK_RST = 2 , COAP_NACK_TLS_FAILED = 3 , COAP_NACK_ICMP_ISSUE = 4 , } pub type coap_tick_t = u64 ; pub type coap_time_t = time_t ; pub type coap_tick_diff_t = i64 ; extern "C" { pub fn coap_clock_init () ; } extern "C" { pub fn coap_ticks (t : * mut coap_tick_t) ; } extern "C" { pub fn coap_ticks_to_rt (t : coap_tick_t) -> coap_time_t ; } extern "C" { pub fn coap_ticks_to_rt_us (t : coap_tick_t) -> u64 ; } extern "C" { pub fn coap_ticks_from_rt_us (t : u64) -> coap_tick_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_dtls_role_t { COAP_DTLS_ROLE_CLIENT = 0 , COAP_DTLS_ROLE_SERVER = 1 , } extern "C" { pub fn coap_dtls_is_supported () -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_tls_is_supported () -> :: std :: os :: raw :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_tls_library_t { COAP_TLS_LIBRARY_NOTLS = 0 , COAP_TLS_LIBRARY_TINYDTLS = 1 , COAP_TLS_LIBRARY_OPENSSL = 2 , COAP_TLS_LIBRARY_GNUTLS = 3 , COAP_TLS_LIBRARY_MBEDTLS = 4 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_tls_version_t { pub version : u64 , pub type_ : coap_tls_library_t , pub built_version : u64 , } # [test] fn bindgen_test_layout_coap_tls_version_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_tls_version_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_tls_version_t > () , 24usize , concat ! ("Size of: " , stringify ! (coap_tls_version_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_tls_version_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_tls_version_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_tls_version_t) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_tls_version_t) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . built_version) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_tls_version_t) , "::" , stringify ! (built_version))) ; } extern "C" { pub fn coap_get_tls_library_version () -> * mut coap_tls_version_t ; } pub type coap_dtls_security_setup_t = :: std :: option :: Option < unsafe extern "C" fn (tls_session : * mut :: std :: os :: raw :: c_void , setup_data : * mut coap_dtls_pki_t) -> :: std :: os :: raw :: c_int > ; pub type coap_dtls_cn_callback_t = :: std :: option :: Option < unsafe extern "C" fn (cn : * const :: std :: os :: raw :: c_char , asn1_public_cert : * const u8 , asn1_length : usize , coap_session : * mut coap_session_t , depth : :: std :: os :: raw :: c_uint , validated : :: std :: os :: raw :: c_int , arg : * mut :: std :: os :: raw :: c_void) -> :: std :: os :: raw :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_asn1_privatekey_type_t { COAP_ASN1_PKEY_NONE = 0 , COAP_ASN1_PKEY_RSA = 1 , COAP_ASN1_PKEY_RSA2 = 2 , COAP_ASN1_PKEY_DSA = 3 , COAP_ASN1_PKEY_DSA1 = 4 , COAP_ASN1_PKEY_DSA2 = 5 , COAP_ASN1_PKEY_DSA3 = 6 , COAP_ASN1_PKEY_DSA4 = 7 , COAP_ASN1_PKEY_DH = 8 , COAP_ASN1_PKEY_DHX = 9 , COAP_ASN1_PKEY_EC = 10 , COAP_ASN1_PKEY_HMAC = 11 , COAP_ASN1_PKEY_CMAC = 12 , COAP_ASN1_PKEY_TLS1_PRF = 13 , COAP_ASN1_PKEY_HKDF = 14 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_pki_key_t { COAP_PKI_KEY_PEM = 0 , COAP_PKI_KEY_ASN1 = 1 , COAP_PKI_KEY_PEM_BUF = 2 , COAP_PKI_KEY_PKCS11 = 3 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_pki_key_pem_t { pub ca_file : * const :: std :: os :: raw :: c_char , pub public_cert : * const :: std :: os :: raw :: c_char , pub private_key : * const :: std :: os :: raw :: c_char , } # [test] fn bindgen_test_layout_coap_pki_key_pem_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_pki_key_pem_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_pki_key_pem_t > () , 24usize , concat ! ("Size of: " , stringify ! (coap_pki_key_pem_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_pki_key_pem_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_pki_key_pem_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca_file) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_t) , "::" , stringify ! (ca_file))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_t) , "::" , stringify ! (public_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_t) , "::" , stringify ! (private_key))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_pki_key_pem_buf_t { pub ca_cert : * const u8 , pub public_cert : * const u8 , pub private_key : * const u8 , pub ca_cert_len : usize , pub public_cert_len : usize , pub private_key_len : usize , } # [test] fn bindgen_test_layout_coap_pki_key_pem_buf_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_pki_key_pem_buf_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_pki_key_pem_buf_t > () , 48usize , concat ! ("Size of: " , stringify ! (coap_pki_key_pem_buf_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_pki_key_pem_buf_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_pki_key_pem_buf_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca_cert) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (ca_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (public_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (private_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca_cert_len) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (ca_cert_len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert_len) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (public_cert_len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key_len) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pem_buf_t) , "::" , stringify ! (private_key_len))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_pki_key_asn1_t { pub ca_cert : * const u8 , pub public_cert : * const u8 , pub private_key : * const u8 , pub ca_cert_len : usize , pub public_cert_len : usize , pub private_key_len : usize , pub private_key_type : coap_asn1_privatekey_type_t , } # [test] fn bindgen_test_layout_coap_pki_key_asn1_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_pki_key_asn1_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_pki_key_asn1_t > () , 56usize , concat ! ("Size of: " , stringify ! (coap_pki_key_asn1_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_pki_key_asn1_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_pki_key_asn1_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca_cert) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (ca_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (public_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (private_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca_cert_len) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (ca_cert_len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert_len) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (public_cert_len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key_len) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (private_key_len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key_type) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_asn1_t) , "::" , stringify ! (private_key_type))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_pki_key_pkcs11_t { pub ca : * const :: std :: os :: raw :: c_char , pub public_cert : * const :: std :: os :: raw :: c_char , pub private_key : * const :: std :: os :: raw :: c_char , pub user_pin : * const :: std :: os :: raw :: c_char , } # [test] fn bindgen_test_layout_coap_pki_key_pkcs11_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_pki_key_pkcs11_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_pki_key_pkcs11_t > () , 32usize , concat ! ("Size of: " , stringify ! (coap_pki_key_pkcs11_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_pki_key_pkcs11_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_pki_key_pkcs11_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ca) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pkcs11_t) , "::" , stringify ! (ca))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . public_cert) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pkcs11_t) , "::" , stringify ! (public_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pkcs11_t) , "::" , stringify ! (private_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_pin) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_pki_key_pkcs11_t) , "::" , stringify ! (user_pin))) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct coap_dtls_key_t { pub key_type : coap_pki_key_t , pub key : coap_dtls_key_t__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union coap_dtls_key_t__bindgen_ty_1 { pub pem : coap_pki_key_pem_t , pub pem_buf : coap_pki_key_pem_buf_t , pub asn1 : coap_pki_key_asn1_t , pub pkcs11 : coap_pki_key_pkcs11_t , } # [test] fn bindgen_test_layout_coap_dtls_key_t__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_key_t__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_key_t__bindgen_ty_1 > () , 56usize , concat ! ("Size of: " , stringify ! (coap_dtls_key_t__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_key_t__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_key_t__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pem) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t__bindgen_ty_1) , "::" , stringify ! (pem))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pem_buf) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t__bindgen_ty_1) , "::" , stringify ! (pem_buf))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . asn1) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t__bindgen_ty_1) , "::" , stringify ! (asn1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pkcs11) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t__bindgen_ty_1) , "::" , stringify ! (pkcs11))) ; } # [test] fn bindgen_test_layout_coap_dtls_key_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_key_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_key_t > () , 64usize , concat ! ("Size of: " , stringify ! (coap_dtls_key_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_key_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_key_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t) , "::" , stringify ! (key_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_key_t) , "::" , stringify ! (key))) ; } pub type coap_dtls_pki_sni_callback_t = :: std :: option :: Option < unsafe extern "C" fn (sni : * const :: std :: os :: raw :: c_char , arg : * mut :: std :: os :: raw :: c_void) -> * mut coap_dtls_key_t > ; # [repr (C)] # [derive (Copy , Clone)] pub struct coap_dtls_pki_t { pub version : u8 , pub verify_peer_cert : u8 , pub check_common_ca : u8 , pub allow_self_signed : u8 , pub allow_expired_certs : u8 , pub cert_chain_validation : u8 , pub cert_chain_verify_depth : u8 , pub check_cert_revocation : u8 , pub allow_no_crl : u8 , pub allow_expired_crl : u8 , pub allow_bad_md_hash : u8 , pub allow_short_rsa_length : u8 , pub is_rpk_not_cert : u8 , pub reserved : [u8 ; 3usize] , pub validate_cn_call_back : coap_dtls_cn_callback_t , pub cn_call_back_arg : * mut :: std :: os :: raw :: c_void , pub validate_sni_call_back : coap_dtls_pki_sni_callback_t , pub sni_call_back_arg : * mut :: std :: os :: raw :: c_void , pub additional_tls_setup_call_back : coap_dtls_security_setup_t , pub client_sni : * mut :: std :: os :: raw :: c_char , pub pki_key : coap_dtls_key_t , } # [test] fn bindgen_test_layout_coap_dtls_pki_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_pki_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_pki_t > () , 128usize , concat ! ("Size of: " , stringify ! (coap_dtls_pki_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_pki_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_pki_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . verify_peer_cert) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (verify_peer_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . check_common_ca) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (check_common_ca))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_self_signed) as usize - ptr as usize } , 3usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_self_signed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_expired_certs) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_expired_certs))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cert_chain_validation) as usize - ptr as usize } , 5usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (cert_chain_validation))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cert_chain_verify_depth) as usize - ptr as usize } , 6usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (cert_chain_verify_depth))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . check_cert_revocation) as usize - ptr as usize } , 7usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (check_cert_revocation))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_no_crl) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_no_crl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_expired_crl) as usize - ptr as usize } , 9usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_expired_crl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_bad_md_hash) as usize - ptr as usize } , 10usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_bad_md_hash))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allow_short_rsa_length) as usize - ptr as usize } , 11usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (allow_short_rsa_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_rpk_not_cert) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (is_rpk_not_cert))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 13usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (reserved))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_cn_call_back) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (validate_cn_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cn_call_back_arg) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (cn_call_back_arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_sni_call_back) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (validate_sni_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sni_call_back_arg) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (sni_call_back_arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . additional_tls_setup_call_back) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (additional_tls_setup_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_sni) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (client_sni))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pki_key) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_pki_t) , "::" , stringify ! (pki_key))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_dtls_cpsk_info_t { pub identity : coap_bin_const_t , pub key : coap_bin_const_t , } # [test] fn bindgen_test_layout_coap_dtls_cpsk_info_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_cpsk_info_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_cpsk_info_t > () , 32usize , concat ! ("Size of: " , stringify ! (coap_dtls_cpsk_info_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_cpsk_info_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_cpsk_info_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_info_t) , "::" , stringify ! (identity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_info_t) , "::" , stringify ! (key))) ; } pub type coap_dtls_ih_callback_t = :: std :: option :: Option < unsafe extern "C" fn (hint : * mut coap_str_const_t , coap_session : * mut coap_session_t , arg : * mut :: std :: os :: raw :: c_void) -> * const coap_dtls_cpsk_info_t > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_dtls_cpsk_t { pub version : u8 , pub reserved : [u8 ; 7usize] , pub validate_ih_call_back : coap_dtls_ih_callback_t , pub ih_call_back_arg : * mut :: std :: os :: raw :: c_void , pub client_sni : * mut :: std :: os :: raw :: c_char , pub psk_info : coap_dtls_cpsk_info_t , } # [test] fn bindgen_test_layout_coap_dtls_cpsk_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_cpsk_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_cpsk_t > () , 64usize , concat ! ("Size of: " , stringify ! (coap_dtls_cpsk_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_cpsk_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_cpsk_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (reserved))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_ih_call_back) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (validate_ih_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ih_call_back_arg) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (ih_call_back_arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_sni) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (client_sni))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . psk_info) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_cpsk_t) , "::" , stringify ! (psk_info))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_dtls_spsk_info_t { pub hint : coap_bin_const_t , pub key : coap_bin_const_t , } # [test] fn bindgen_test_layout_coap_dtls_spsk_info_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_spsk_info_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_spsk_info_t > () , 32usize , concat ! ("Size of: " , stringify ! (coap_dtls_spsk_info_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_spsk_info_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_spsk_info_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . hint) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_info_t) , "::" , stringify ! (hint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_info_t) , "::" , stringify ! (key))) ; } pub type coap_dtls_id_callback_t = :: std :: option :: Option < unsafe extern "C" fn (identity : * mut coap_bin_const_t , coap_session : * mut coap_session_t , arg : * mut :: std :: os :: raw :: c_void) -> * const coap_bin_const_t > ; pub type coap_dtls_psk_sni_callback_t = :: std :: option :: Option < unsafe extern "C" fn (sni : * const :: std :: os :: raw :: c_char , coap_session : * mut coap_session_t , arg : * mut :: std :: os :: raw :: c_void) -> * const coap_dtls_spsk_info_t > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_dtls_spsk_t { pub version : u8 , pub reserved : [u8 ; 7usize] , pub validate_id_call_back : coap_dtls_id_callback_t , pub id_call_back_arg : * mut :: std :: os :: raw :: c_void , pub validate_sni_call_back : coap_dtls_psk_sni_callback_t , pub sni_call_back_arg : * mut :: std :: os :: raw :: c_void , pub psk_info : coap_dtls_spsk_info_t , } # [test] fn bindgen_test_layout_coap_dtls_spsk_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_dtls_spsk_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_dtls_spsk_t > () , 72usize , concat ! ("Size of: " , stringify ! (coap_dtls_spsk_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_dtls_spsk_t > () , 8usize , concat ! ("Alignment of " , stringify ! (coap_dtls_spsk_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (reserved))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_id_call_back) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (validate_id_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . id_call_back_arg) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (id_call_back_arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_sni_call_back) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (validate_sni_call_back))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sni_call_back_arg) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (sni_call_back_arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . psk_info) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (coap_dtls_spsk_t) , "::" , stringify ! (psk_info))) ; } extern "C" { pub fn coap_dtls_set_log_level (level : :: std :: os :: raw :: c_int) ; } extern "C" { pub fn coap_dtls_get_log_level () -> :: std :: os :: raw :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_event_t { COAP_EVENT_DTLS_CLOSED = 0 , COAP_EVENT_DTLS_CONNECTED = 478 , COAP_EVENT_DTLS_RENEGOTIATE = 479 , COAP_EVENT_DTLS_ERROR = 512 , COAP_EVENT_TCP_CONNECTED = 4097 , COAP_EVENT_TCP_CLOSED = 4098 , COAP_EVENT_TCP_FAILED = 4099 , COAP_EVENT_SESSION_CONNECTED = 8193 , COAP_EVENT_SESSION_CLOSED = 8194 , COAP_EVENT_SESSION_FAILED = 8195 , COAP_EVENT_PARTIAL_BLOCK = 12289 , COAP_EVENT_XMIT_BLOCK_FAIL = 12290 , COAP_EVENT_SERVER_SESSION_NEW = 16385 , COAP_EVENT_SERVER_SESSION_DEL = 16386 , } pub type coap_event_handler_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , event : coap_event_t) -> :: std :: os :: raw :: c_int > ; extern "C" { pub fn coap_register_event_handler (context : * mut coap_context_t , hnd : coap_event_handler_t) ; } extern "C" { pub fn coap_set_event_handler (context : * mut coap_context_t , hnd : coap_event_handler_t) ; } extern "C" { pub fn coap_clear_event_handler (context : * mut coap_context_t) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct coap_fixed_point_t { pub integer_part : u16 , pub fractional_part : u16 , } # [test] fn bindgen_test_layout_coap_fixed_point_t () { const UNINIT : :: std :: mem :: MaybeUninit < coap_fixed_point_t > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < coap_fixed_point_t > () , 4usize , concat ! ("Size of: " , stringify ! (coap_fixed_point_t))) ; assert_eq ! (:: std :: mem :: align_of :: < coap_fixed_point_t > () , 2usize , concat ! ("Alignment of " , stringify ! (coap_fixed_point_t))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . integer_part) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (coap_fixed_point_t) , "::" , stringify ! (integer_part))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fractional_part) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (coap_fixed_point_t) , "::" , stringify ! (fractional_part))) ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_session_type_t { COAP_SESSION_TYPE_NONE = 0 , COAP_SESSION_TYPE_CLIENT = 1 , COAP_SESSION_TYPE_SERVER = 2 , COAP_SESSION_TYPE_HELLO = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_session_state_t { COAP_SESSION_STATE_NONE = 0 , COAP_SESSION_STATE_CONNECTING = 1 , COAP_SESSION_STATE_HANDSHAKE = 2 , COAP_SESSION_STATE_CSM = 3 , COAP_SESSION_STATE_ESTABLISHED = 4 , } extern "C" { pub fn coap_session_reference (session : * mut coap_session_t) -> * mut coap_session_t ; } extern "C" { pub fn coap_session_release (session : * mut coap_session_t) ; } extern "C" { pub fn coap_session_disconnected (session : * mut coap_session_t , reason : coap_nack_reason_t) ; } extern "C" { pub fn coap_session_set_app_data (session : * mut coap_session_t , data : * mut :: std :: os :: raw :: c_void) ; } extern "C" { pub fn coap_session_get_app_data (session : * const coap_session_t) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { pub fn coap_session_get_addr_remote (session : * const coap_session_t) -> * const coap_address_t ; } extern "C" { pub fn coap_session_get_addr_local (session : * const coap_session_t) -> * const coap_address_t ; } extern "C" { pub fn coap_session_get_proto (session : * const coap_session_t) -> coap_proto_t ; } extern "C" { pub fn coap_session_get_type (session : * const coap_session_t) -> coap_session_type_t ; } extern "C" { pub fn coap_session_get_state (session : * const coap_session_t) -> coap_session_state_t ; } extern "C" { pub fn coap_session_get_ifindex (session : * const coap_session_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_session_get_tls (session : * const coap_session_t , tls_lib : * mut coap_tls_library_t) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { pub fn coap_session_get_context (session : * const coap_session_t) -> * mut coap_context_t ; } extern "C" { pub fn coap_session_set_type_client (session : * mut coap_session_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_session_set_mtu (session : * mut coap_session_t , mtu : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_session_max_pdu_size (session : * const coap_session_t) -> usize ; } extern "C" { pub fn coap_new_client_session (ctx : * mut coap_context_t , local_if : * const coap_address_t , server : * const coap_address_t , proto : coap_proto_t) -> * mut coap_session_t ; } extern "C" { pub fn coap_new_client_session_psk (ctx : * mut coap_context_t , local_if : * const coap_address_t , server : * const coap_address_t , proto : coap_proto_t , identity : * const :: std :: os :: raw :: c_char , key : * const u8 , key_len : :: std :: os :: raw :: c_uint) -> * mut coap_session_t ; } extern "C" { pub fn coap_new_client_session_psk2 (ctx : * mut coap_context_t , local_if : * const coap_address_t , server : * const coap_address_t , proto : coap_proto_t , setup_data : * mut coap_dtls_cpsk_t) -> * mut coap_session_t ; } extern "C" { pub fn coap_session_get_psk_hint (session : * const coap_session_t) -> * const coap_bin_const_t ; } extern "C" { pub fn coap_session_get_psk_identity (session : * const coap_session_t) -> * const coap_bin_const_t ; } extern "C" { pub fn coap_session_get_psk_key (session : * const coap_session_t) -> * const coap_bin_const_t ; } extern "C" { pub fn coap_new_client_session_pki (ctx : * mut coap_context_t , local_if : * const coap_address_t , server : * const coap_address_t , proto : coap_proto_t , setup_data : * mut coap_dtls_pki_t) -> * mut coap_session_t ; } extern "C" { pub fn coap_session_init_token (session : * mut coap_session_t , length : usize , token : * const u8) ; } extern "C" { pub fn coap_session_new_token (session : * mut coap_session_t , length : * mut usize , token : * mut u8) ; } extern "C" { pub fn coap_session_str (session : * const coap_session_t) -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_new_endpoint (context : * mut coap_context_t , listen_addr : * const coap_address_t , proto : coap_proto_t) -> * mut coap_endpoint_t ; } extern "C" { pub fn coap_endpoint_set_default_mtu (endpoint : * mut coap_endpoint_t , mtu : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_free_endpoint (ep : * mut coap_endpoint_t) ; } extern "C" { pub fn coap_endpoint_str (endpoint : * const coap_endpoint_t) -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_session_get_by_peer (ctx : * const coap_context_t , remote_addr : * const coap_address_t , ifindex : :: std :: os :: raw :: c_int) -> * mut coap_session_t ; } extern "C" { pub fn coap_session_set_ack_timeout (session : * mut coap_session_t , value : coap_fixed_point_t) ; } extern "C" { pub fn coap_session_get_ack_timeout (session : * const coap_session_t) -> coap_fixed_point_t ; } extern "C" { pub fn coap_session_set_ack_random_factor (session : * mut coap_session_t , value : coap_fixed_point_t) ; } extern "C" { pub fn coap_session_get_ack_random_factor (session : * const coap_session_t) -> coap_fixed_point_t ; } extern "C" { pub fn coap_session_set_max_retransmit (session : * mut coap_session_t , value : u16) ; } extern "C" { pub fn coap_session_get_max_retransmit (session : * const coap_session_t) -> u16 ; } extern "C" { pub fn coap_session_set_nstart (session : * mut coap_session_t , value : u16) ; } extern "C" { pub fn coap_session_get_nstart (session : * const coap_session_t) -> u16 ; } extern "C" { pub fn coap_session_set_default_leisure (session : * mut coap_session_t , value : coap_fixed_point_t) ; } extern "C" { pub fn coap_session_get_default_leisure (session : * const coap_session_t) -> coap_fixed_point_t ; } extern "C" { pub fn coap_session_set_probing_rate (session : * mut coap_session_t , value : u32) ; } extern "C" { pub fn coap_session_get_probing_rate (session : * const coap_session_t) -> u32 ; } extern "C" { pub fn coap_session_send_ping (session : * mut coap_session_t) -> coap_mid_t ; } extern "C" { pub fn coap_session_set_no_observe_cancel (session : * mut coap_session_t) ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_response_t { COAP_RESPONSE_FAIL = 0 , COAP_RESPONSE_OK = 1 , } pub type coap_response_handler_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , sent : * const coap_pdu_t , received : * const coap_pdu_t , mid : coap_mid_t) -> coap_response_t > ; pub type coap_nack_handler_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , sent : * const coap_pdu_t , reason : coap_nack_reason_t , mid : coap_mid_t) > ; pub type coap_ping_handler_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , received : * const coap_pdu_t , mid : coap_mid_t) > ; pub type coap_pong_handler_t = :: std :: option :: Option < unsafe extern "C" fn (session : * mut coap_session_t , received : * const coap_pdu_t , mid : coap_mid_t) > ; extern "C" { pub fn coap_register_response_handler (context : * mut coap_context_t , handler : coap_response_handler_t) ; } extern "C" { pub fn coap_register_nack_handler (context : * mut coap_context_t , handler : coap_nack_handler_t) ; } extern "C" { pub fn coap_register_ping_handler (context : * mut coap_context_t , handler : coap_ping_handler_t) ; } extern "C" { pub fn coap_register_pong_handler (context : * mut coap_context_t , handler : coap_pong_handler_t) ; } extern "C" { pub fn coap_register_option (ctx : * mut coap_context_t , type_ : u16) ; } extern "C" { pub fn coap_new_context (listen_addr : * const coap_address_t) -> * mut coap_context_t ; } extern "C" { pub fn coap_context_set_psk (context : * mut coap_context_t , hint : * const :: std :: os :: raw :: c_char , key : * const u8 , key_len : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_psk2 (context : * mut coap_context_t , setup_data : * mut coap_dtls_spsk_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_pki (context : * mut coap_context_t , setup_data : * const coap_dtls_pki_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_pki_root_cas (context : * mut coap_context_t , ca_file : * const :: std :: os :: raw :: c_char , ca_dir : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_keepalive (context : * mut coap_context_t , seconds : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_context_get_coap_fd (context : * const coap_context_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_context_set_max_idle_sessions (context : * mut coap_context_t , max_idle_sessions : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_context_get_max_idle_sessions (context : * const coap_context_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_context_set_session_timeout (context : * mut coap_context_t , session_timeout : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_context_get_session_timeout (context : * const coap_context_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_context_set_csm_timeout (context : * mut coap_context_t , csm_tmeout : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_context_get_csm_timeout (context : * const coap_context_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_context_set_csm_max_message_size (context : * mut coap_context_t , csm_max_message_size : u32) ; } extern "C" { pub fn coap_context_get_csm_max_message_size (context : * const coap_context_t) -> u32 ; } extern "C" { pub fn coap_context_set_max_handshake_sessions (context : * mut coap_context_t , max_handshake_sessions : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_context_get_max_handshake_sessions (context : * const coap_context_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_new_message_id (session : * mut coap_session_t) -> u16 ; } extern "C" { pub fn coap_free_context (context : * mut coap_context_t) ; } extern "C" { pub fn coap_set_app_data (context : * mut coap_context_t , data : * mut :: std :: os :: raw :: c_void) ; } extern "C" { pub fn coap_get_app_data (context : * const coap_context_t) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { pub fn coap_new_error_response (request : * const coap_pdu_t , code : coap_pdu_code_t , opts : * mut coap_opt_filter_t) -> * mut coap_pdu_t ; } extern "C" { pub fn coap_send_error (session : * mut coap_session_t , request : * const coap_pdu_t , code : coap_pdu_code_t , opts : * mut coap_opt_filter_t) -> coap_mid_t ; } extern "C" { pub fn coap_send_message_type (session : * mut coap_session_t , request : * const coap_pdu_t , type_ : coap_pdu_type_t) -> coap_mid_t ; } extern "C" { pub fn coap_send_ack (session : * mut coap_session_t , request : * const coap_pdu_t) -> coap_mid_t ; } extern "C" { pub fn coap_send (session : * mut coap_session_t , pdu : * mut coap_pdu_t) -> coap_mid_t ; } extern "C" { pub fn coap_handle_event (context : * mut coap_context_t , event : coap_event_t , session : * mut coap_session_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_can_exit (context : * mut coap_context_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_join_mcast_group_intf (ctx : * mut coap_context_t , groupname : * const :: std :: os :: raw :: c_char , ifname : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_mcast_set_hops (session : * mut coap_session_t , hops : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_mcast_per_resource (context : * mut coap_context_t) ; } extern "C" { pub fn coap_io_process (ctx : * mut coap_context_t , timeout_ms : u32) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_io_process_with_fds (ctx : * mut coap_context_t , timeout_ms : u32 , nfds : :: std :: os :: raw :: c_int , readfds : * mut fd_set , writefds : * mut fd_set , exceptfds : * mut fd_set) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_io_prepare_io (ctx : * mut coap_context_t , sockets : * mut * mut coap_socket_t , max_sockets : :: std :: os :: raw :: c_uint , num_sockets : * mut :: std :: os :: raw :: c_uint , now : coap_tick_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_io_do_io (ctx : * mut coap_context_t , now : coap_tick_t) ; } extern "C" { pub fn coap_io_prepare_epoll (ctx : * mut coap_context_t , now : coap_tick_t) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn coap_io_do_epoll (ctx : * mut coap_context_t , events : * mut epoll_event , nevents : usize) ; } extern "C" { pub fn coap_async_is_supported () -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_register_async (session : * mut coap_session_t , request : * const coap_pdu_t , delay : coap_tick_t) -> * mut coap_async_t ; } extern "C" { pub fn coap_async_set_delay (async_ : * mut coap_async_t , delay : coap_tick_t) ; } extern "C" { pub fn coap_async_trigger (async_ : * mut coap_async_t) ; } extern "C" { pub fn coap_free_async (session : * mut coap_session_t , async_ : * mut coap_async_t) ; } extern "C" { pub fn coap_find_async (session : * mut coap_session_t , token : coap_bin_const_t) -> * mut coap_async_t ; } extern "C" { pub fn coap_async_set_app_data (async_ : * mut coap_async_t , app_data : * mut :: std :: os :: raw :: c_void) ; } extern "C" { pub fn coap_async_get_app_data (async_ : * const coap_async_t) -> * mut :: std :: os :: raw :: c_void ; } pub type coap_cache_app_data_free_callback_t = :: std :: option :: Option < unsafe extern "C" fn (data : * mut :: std :: os :: raw :: c_void) > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_cache_session_based_t { COAP_CACHE_NOT_SESSION_BASED = 0 , COAP_CACHE_IS_SESSION_BASED = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_cache_record_pdu_t { COAP_CACHE_NOT_RECORD_PDU = 0 , COAP_CACHE_RECORD_PDU = 1 , } extern "C" { pub fn coap_cache_derive_key (session : * const coap_session_t , pdu : * const coap_pdu_t , session_based : coap_cache_session_based_t) -> * mut coap_cache_key_t ; } extern "C" { pub fn coap_cache_derive_key_w_ignore (session : * const coap_session_t , pdu : * const coap_pdu_t , session_based : coap_cache_session_based_t , ignore_options : * const u16 , ignore_count : usize) -> * mut coap_cache_key_t ; } extern "C" { pub fn coap_delete_cache_key (cache_key : * mut coap_cache_key_t) ; } extern "C" { pub fn coap_cache_ignore_options (context : * mut coap_context_t , options : * const u16 , count : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_new_cache_entry (session : * mut coap_session_t , pdu : * const coap_pdu_t , record_pdu : coap_cache_record_pdu_t , session_based : coap_cache_session_based_t , idle_time : :: std :: os :: raw :: c_uint) -> * mut coap_cache_entry_t ; } extern "C" { pub fn coap_delete_cache_entry (context : * mut coap_context_t , cache_entry : * mut coap_cache_entry_t) ; } extern "C" { pub fn coap_cache_get_by_key (context : * mut coap_context_t , cache_key : * const coap_cache_key_t) -> * mut coap_cache_entry_t ; } extern "C" { pub fn coap_cache_get_by_pdu (session : * mut coap_session_t , pdu : * const coap_pdu_t , session_based : coap_cache_session_based_t) -> * mut coap_cache_entry_t ; } extern "C" { pub fn coap_cache_get_pdu (cache_entry : * const coap_cache_entry_t) -> * const coap_pdu_t ; } extern "C" { pub fn coap_cache_set_app_data (cache_entry : * mut coap_cache_entry_t , data : * mut :: std :: os :: raw :: c_void , callback : coap_cache_app_data_free_callback_t) ; } extern "C" { pub fn coap_cache_get_app_data (cache_entry : * const coap_cache_entry_t) -> * mut :: std :: os :: raw :: c_void ; } pub type coap_log_t = :: std :: os :: raw :: c_int ; extern "C" { pub fn coap_get_log_level () -> coap_log_t ; } extern "C" { pub fn coap_set_log_level (level : coap_log_t) ; } pub type coap_log_handler_t = :: std :: option :: Option < unsafe extern "C" fn (level : coap_log_t , message : * const :: std :: os :: raw :: c_char) > ; extern "C" { pub fn coap_set_log_handler (handler : coap_log_handler_t) ; } extern "C" { pub fn coap_package_name () -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_package_version () -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_package_build () -> * const :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_log_impl (level : coap_log_t , format : * const :: std :: os :: raw :: c_char , ...) ; } extern "C" { pub fn coap_set_show_pdu_output (use_fprintf : :: std :: os :: raw :: c_int) ; } extern "C" { pub fn coap_show_pdu (level : coap_log_t , pdu : * const coap_pdu_t) ; } extern "C" { pub fn coap_show_tls_version (level : coap_log_t) ; } extern "C" { pub fn coap_string_tls_version (buffer : * mut :: std :: os :: raw :: c_char , bufsize : usize) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_string_tls_support (buffer : * mut :: std :: os :: raw :: c_char , bufsize : usize) -> * mut :: std :: os :: raw :: c_char ; } extern "C" { pub fn coap_print_addr (address : * const coap_address_t , buffer : * mut :: std :: os :: raw :: c_uchar , size : usize) -> usize ; } extern "C" { pub fn coap_debug_set_packet_loss (loss_level : * const :: std :: os :: raw :: c_char) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_debug_send_packet () -> :: std :: os :: raw :: c_int ; } pub type coap_rand_func_t = :: std :: option :: Option < unsafe extern "C" fn (out : * mut :: std :: os :: raw :: c_void , len : usize) -> :: std :: os :: raw :: c_int > ; extern "C" { pub fn coap_set_prng (rng : coap_rand_func_t) ; } extern "C" { pub fn coap_prng_init (seed : :: std :: os :: raw :: c_uint) ; } extern "C" { pub fn coap_prng (buf : * mut :: std :: os :: raw :: c_void , len : usize) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_resource_set_get_observable (resource : * mut coap_resource_t , mode : :: std :: os :: raw :: c_int) ; } extern "C" { pub fn coap_resource_notify_observers (resource : * mut coap_resource_t , query : * const coap_string_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_memory_init () ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum coap_memory_tag_t { COAP_STRING = 0 , COAP_ATTRIBUTE_NAME = 1 , COAP_ATTRIBUTE_VALUE = 2 , COAP_PACKET = 3 , COAP_NODE = 4 , COAP_CONTEXT = 5 , COAP_ENDPOINT = 6 , COAP_PDU = 7 , COAP_PDU_BUF = 8 , COAP_RESOURCE = 9 , COAP_RESOURCEATTR = 10 , COAP_SESSION = 11 , COAP_OPTLIST = 12 , COAP_CACHE_KEY = 13 , COAP_CACHE_ENTRY = 14 , COAP_LG_XMIT = 15 , COAP_LG_CRCV = 16 , COAP_LG_SRCV = 17 , } extern "C" { pub fn coap_malloc_type (type_ : coap_memory_tag_t , size : usize) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { pub fn coap_realloc_type (type_ : coap_memory_tag_t , p : * mut :: std :: os :: raw :: c_void , size : usize) -> * mut :: std :: os :: raw :: c_void ; } extern "C" { pub fn coap_free_type (type_ : coap_memory_tag_t , p : * mut :: std :: os :: raw :: c_void) ; } pub type coap_method_handler_t = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut coap_resource_t , arg2 : * mut coap_session_t , arg3 : * const coap_pdu_t , arg4 : * const coap_string_t , arg5 : * mut coap_pdu_t) > ; extern "C" { pub fn coap_resource_init (uri_path : * mut coap_str_const_t , flags : :: std :: os :: raw :: c_int) -> * mut coap_resource_t ; } extern "C" { pub fn coap_resource_unknown_init (put_handler : coap_method_handler_t) -> * mut coap_resource_t ; } extern "C" { pub fn coap_resource_unknown_init2 (put_handler : coap_method_handler_t , flags : :: std :: os :: raw :: c_int) -> * mut coap_resource_t ; } extern "C" { pub fn coap_resource_proxy_uri_init (handler : coap_method_handler_t , host_name_count : usize , host_name_list : * mut * const :: std :: os :: raw :: c_char) -> * mut coap_resource_t ; } extern "C" { pub fn coap_resource_proxy_uri_init2 (handler : coap_method_handler_t , host_name_count : usize , host_name_list : * mut * const :: std :: os :: raw :: c_char , flags : :: std :: os :: raw :: c_int) -> * mut coap_resource_t ; } extern "C" { pub fn coap_get_resource_from_uri_path (context : * mut coap_context_t , uri_path : * mut coap_str_const_t) -> * mut coap_resource_t ; } extern "C" { pub fn coap_resource_get_uri_path (resource : * mut coap_resource_t) -> * mut coap_str_const_t ; } extern "C" { pub fn coap_resource_set_mode (resource : * mut coap_resource_t , mode : :: std :: os :: raw :: c_int) ; } extern "C" { pub fn coap_resource_set_userdata (resource : * mut coap_resource_t , data : * mut :: std :: os :: raw :: c_void) ; } extern "C" { pub fn coap_resource_get_userdata (resource : * mut coap_resource_t) -> * mut :: std :: os :: raw :: c_void ; } pub type coap_resource_release_userdata_handler_t = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: std :: os :: raw :: c_void) > ; extern "C" { pub fn coap_resource_release_userdata_handler (context : * mut coap_context_t , callback : coap_resource_release_userdata_handler_t) ; } extern "C" { pub fn coap_add_resource (context : * mut coap_context_t , resource : * mut coap_resource_t) ; } extern "C" { pub fn coap_delete_resource (context : * mut coap_context_t , resource : * mut coap_resource_t) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn coap_register_handler (resource : * mut coap_resource_t , method : coap_request_t , handler : coap_method_handler_t) ; } extern "C" { pub fn coap_register_request_handler (resource : * mut coap_resource_t , method : coap_request_t , handler : coap_method_handler_t) ; } extern "C" { pub fn coap_add_attr (resource : * mut coap_resource_t , name : * mut coap_str_const_t , value : * mut coap_str_const_t , flags : :: std :: os :: raw :: c_int) -> * mut coap_attr_t ; } extern "C" { pub fn coap_find_attr (resource : * mut coap_resource_t , name : * mut coap_str_const_t) -> * mut coap_attr_t ; } extern "C" { pub fn coap_attr_get_value (attribute : * mut coap_attr_t) -> * mut coap_str_const_t ; } pub type coap_print_status_t = :: std :: os :: raw :: c_uint ; extern "C" { pub fn coap_print_link (resource : * const coap_resource_t , buf : * mut :: std :: os :: raw :: c_uchar , len : * mut usize , offset : * mut usize) -> coap_print_status_t ; } extern "C" { pub fn coap_resource_set_dirty (r : * mut coap_resource_t , query : * const coap_string_t) -> :: std :: os :: raw :: c_int ; }