[][src]Struct libcoap_sys::coap_context_t

#[repr(C)]
pub struct coap_context_t {
    pub known_options: coap_opt_filter_t,
    pub resources: *mut coap_resource_t,
    pub unknown_resource: *mut coap_resource_t,
    pub async_state: *mut coap_async_state_t,
    pub sendqueue_basetime: coap_tick_t,
    pub sendqueue: *mut coap_queue_t,
    pub endpoint: *mut coap_endpoint_t,
    pub sessions: *mut coap_session_t,
    pub response_handler: coap_response_handler_t,
    pub nack_handler: coap_nack_handler_t,
    pub ping_handler: coap_ping_handler_t,
    pub pong_handler: coap_pong_handler_t,
    pub handle_event: coap_event_handler_t,
    pub network_send: Option<unsafe extern "C" fn(sock: *mut coap_socket_t, session: *const coap_session_t, data: *const u8, datalen: usize) -> isize>,
    pub network_read: Option<unsafe extern "C" fn(sock: *mut coap_socket_t, packet: *mut coap_packet_t) -> isize>,
    pub get_client_psk: Option<unsafe extern "C" fn(session: *const coap_session_t, hint: *const u8, hint_len: usize, identity: *mut u8, identity_len: *mut usize, max_identity_len: usize, psk: *mut u8, max_psk_len: usize) -> usize>,
    pub get_server_psk: Option<unsafe extern "C" fn(session: *const coap_session_t, identity: *const u8, identity_len: usize, psk: *mut u8, max_psk_len: usize) -> usize>,
    pub get_server_hint: Option<unsafe extern "C" fn(session: *const coap_session_t, hint: *mut u8, max_hint_len: usize) -> usize>,
    pub dtls_context: *mut c_void,
    pub psk_hint: *mut u8,
    pub psk_hint_len: usize,
    pub psk_key: *mut u8,
    pub psk_key_len: usize,
    pub session_timeout: c_uint,
    pub max_idle_sessions: c_uint,
    pub max_handshake_sessions: c_uint,
    pub ping_timeout: c_uint,
    pub csm_timeout: c_uint,
    pub app: *mut c_void,
}

The CoAP stack's global state is stored in a coap_context_t object.

Fields

known_options: coap_opt_filter_tresources: *mut coap_resource_t

< hash table or list of known resources

unknown_resource: *mut coap_resource_t

< can be used for handling unknown resources

async_state: *mut coap_async_state_t

list of asynchronous transactions

sendqueue_basetime: coap_tick_t

The time stamp in the first element of the sendqeue is relative to sendqueue_basetime.

sendqueue: *mut coap_queue_tendpoint: *mut coap_endpoint_t

< the endpoints used for listening

sessions: *mut coap_session_t

< client sessions

response_handler: coap_response_handler_tnack_handler: coap_nack_handler_tping_handler: coap_ping_handler_tpong_handler: coap_pong_handler_thandle_event: coap_event_handler_t

Callback function that is used to signal events to the application. This field is set by coap_set_event_handler().

network_send: Option<unsafe extern "C" fn(sock: *mut coap_socket_t, session: *const coap_session_t, data: *const u8, datalen: usize) -> isize>network_read: Option<unsafe extern "C" fn(sock: *mut coap_socket_t, packet: *mut coap_packet_t) -> isize>get_client_psk: Option<unsafe extern "C" fn(session: *const coap_session_t, hint: *const u8, hint_len: usize, identity: *mut u8, identity_len: *mut usize, max_identity_len: usize, psk: *mut u8, max_psk_len: usize) -> usize>get_server_psk: Option<unsafe extern "C" fn(session: *const coap_session_t, identity: *const u8, identity_len: usize, psk: *mut u8, max_psk_len: usize) -> usize>get_server_hint: Option<unsafe extern "C" fn(session: *const coap_session_t, hint: *mut u8, max_hint_len: usize) -> usize>dtls_context: *mut c_voidpsk_hint: *mut u8psk_hint_len: usizepsk_key: *mut u8psk_key_len: usizesession_timeout: c_uint

< Number of seconds of inactivity after which an unused session will be closed. 0 means use default.

max_idle_sessions: c_uint

< Maximum number of simultaneous unused sessions per endpoint. 0 means no maximum.

max_handshake_sessions: c_uint

< Maximum number of simultaneous negotating sessions per endpoint. 0 means use default.

ping_timeout: c_uint

< Minimum inactivity time before sending a ping message. 0 means disabled.

csm_timeout: c_uint

< Timeout for waiting for a CSM from the remote side. 0 means disabled.

app: *mut c_void

< application-specific data

Trait Implementations

impl Clone for coap_context_t[src]

impl Copy for coap_context_t[src]

impl Debug for coap_context_t[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.