[][src]Function libcoap_sys::coap_dtls_context_set_psk

pub unsafe extern "C" fn coap_dtls_context_set_psk(
    coap_context: *mut coap_context_t,
    identity_hint: *const c_char,
    role: coap_dtls_role_t
) -> c_int

Set the DTLS context's default PSK information. This does the PSK specifics following coap_dtls_new_context(). If @p COAP_DTLS_ROLE_SERVER, then identity hint will also get set. If @p COAP_DTLS_ROLE_SERVER, then the information will get put into the TLS library's context (from which sessions are derived). If @p COAP_DTLS_ROLE_CLIENT, then the information will get put into the TLS library's session.

Internal function.

@param coap_context The CoAP context. @param identity_hint The default PSK server identity hint sent to a client. Required parameter. If @p NULL, will be set to "". Empty string is a valid hint. This parameter is ignored if COAP_DTLS_ROLE_CLIENT @param role One of @p COAP_DTLS_ROLE_CLIENT or @p COAP_DTLS_ROLE_SERVER

@return @c 1 if successful, else @c 0.