coap_context_get_csm_timeout, coap_context_get_max_handshake_sessions, coap_context_get_max_idle_sessions,
coap_context_get_session_timeout, coap_context_set_block_mode, coap_context_set_csm_max_message_size,
coap_context_set_csm_timeout, coap_context_set_keepalive, coap_context_set_max_handshake_sessions,
coap_context_set_max_idle_sessions, coap_context_set_session_timeout, coap_context_t, coap_delete_bin_const,
coap_event_t_COAP_EVENT_OSCORE_DECRYPTION_FAILURE, coap_event_t_COAP_EVENT_OSCORE_INTERNAL_ERROR,
coap_event_t_COAP_EVENT_SESSION_FAILED, coap_event_t_COAP_EVENT_TCP_CLOSED, coap_event_t_COAP_EVENT_TCP_CONNECTED,
coap_event_t_COAP_EVENT_TCP_FAILED, coap_event_t_COAP_EVENT_WS_CLOSED, coap_event_t_COAP_EVENT_WS_CONNECTED,
coap_event_t_COAP_EVENT_WS_PACKET_SIZE, coap_event_t_COAP_EVENT_XMIT_BLOCK_FAIL, coap_free_context,
coap_get_app_data, coap_io_process, coap_join_mcast_group_intf, coap_new_bin_const, coap_new_context, coap_proto_t,
coap_register_event_handler, coap_register_response_handler, coap_set_app_data, coap_startup_with_feature_checks,
use libcoap_sys::{coap_context_oscore_server, coap_delete_oscore_recipient, coap_new_oscore_recipient};
error::{ContextConfigurationError, EndpointCreationError, IoProcessError, MulticastGroupJoinError},
coap_event_t_COAP_EVENT_OSCORE_INTERNAL_ERROR => handler.handle_oscore_internal_error(&mut session),
coap_event_t_COAP_EVENT_OSCORE_DECODE_ERROR => handler.handle_oscore_decode_error(&mut session),
// For server-side sessions: Ensure that server-side session wrappers are either kept in memory or dropped when needed.
/// Returns [`ContextConfigurationError::Unknown`] if the call to the underlying libcoap library
/// function fails and [`ContextConfigurationError::CryptoContextAlreadySet`] if the PSK context
pub fn set_psk_context(&mut self, psk_context: ServerPskContext<'a>) -> Result<(), ContextConfigurationError> {
/// Returns [`ContextConfigurationError::Unknown`] if the call to the underlying libcoap library
/// function fails and [`ContextConfigurationError::CryptoContextAlreadySet`] if the PSK context
/// See the Rust standard library documentation on [FFI conversions](https://doc.rust-lang.org/std/ffi/index.html#conversions])
pub fn shutdown(mut self, exit_wait_timeout: Option<Duration>) -> Result<(), IoProcessError> {
fn add_endpoint(&mut self, addr: SocketAddr, proto: coap_proto_t) -> Result<(), EndpointCreationError> {
pub fn oscore_server(&mut self, oscore_conf: OscoreConf) -> Result<(), OscoreServerCreationError> {
// SAFETY: The raw_conf is guranteed to be dropped by the call to coap_context_oscore_server() below.
// SAFETY: Properly initialized CoapContext always has a valid raw_context that is not deleted until
// [libcoap docs](https://libcoap.net/doc/reference/4.3.5/group__oscore.html#ga71ddf56bcd6d6650f8235ee252fde47f)
pub fn new_oscore_recipient(&mut self, recipient_id: &str) -> Result<(), OscoreRecipientError> {
pub fn delete_oscore_recipient(&mut self, recipient_id: &str) -> Result<(), OscoreRecipientError> {
pub fn add_endpoint_dtls(&mut self, addr: SocketAddr) -> Result<(), EndpointCreationError> {
/// If `ifname` is set to `None`, the first appropriate interface will be chosen by the operating system.
// SAFETY: `inner_ref.raw_context` is always valid by construction of this type, group and interface name are pointers to valid C strings.
/// Return the duration that idle server-side sessions are kept alive if they are not referenced
/// Set the duration that idle server-side sessions are kept alive if they are not referenced or
unsafe { coap_context_set_max_handshake_sessions(self.inner.borrow().raw_context, max_handshake_sessions) };
unsafe { coap_context_set_max_idle_sessions(self.inner.borrow().raw_context, max_idle_sessions) };
unsafe { coap_context_set_csm_max_message_size(self.inner.borrow().raw_context, csm_max_message_size) };