libcoap 4.3.5-develop-72190a8
Loading...
Searching...
No Matches
coap_net_internal.h File Reference

CoAP context internal information. More...

+ Include dependency graph for coap_net_internal.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  coap_queue_t
 Queue entry. More...
 
struct  coap_context_t
 The CoAP stack's global state is stored in a coap_context_t object. More...
 

Functions

int coap_insert_node (coap_queue_t **queue, coap_queue_t *node)
 Adds node to given queue, ordered by variable t in node.
 
COAP_API int coap_delete_node (coap_queue_t *node)
 Destroys specified node.
 
int coap_delete_node_lkd (coap_queue_t *node)
 Destroys specified node.
 
void coap_delete_all (coap_queue_t *queue)
 Removes all items from given queue and frees the allocated storage.
 
coap_queue_tcoap_new_node (void)
 Creates a new node suitable for adding to the CoAP sendqueue.
 
unsigned int coap_adjust_basetime (coap_context_t *ctx, coap_tick_t now)
 Set sendqueue_basetime in the given context object ctx to now.
 
coap_queue_tcoap_peek_next (coap_context_t *context)
 Returns the next pdu to send without removing from sendqeue.
 
coap_queue_tcoap_pop_next (coap_context_t *context)
 Returns the next pdu to send and removes it from the sendqeue.
 
coap_mid_t coap_retransmit (coap_context_t *context, coap_queue_t *node)
 Handles retransmissions of confirmable messages.
 
int coap_handle_dgram (coap_context_t *ctx, coap_session_t *session, uint8_t *data, size_t data_len)
 Parses and interprets a CoAP datagram with context ctx.
 
int coap_remove_from_queue (coap_queue_t **queue, coap_session_t *session, coap_mid_t id, coap_queue_t **node)
 This function removes the element with given id from the list given list.
 
coap_mid_t coap_wait_ack (coap_context_t *context, coap_session_t *session, coap_queue_t *node)
 
void coap_cancel_all_messages (coap_context_t *context, coap_session_t *session, coap_bin_const_t *token)
 Cancels all outstanding messages for session session that have the specified token.
 
void coap_cancel_session_messages (coap_context_t *context, coap_session_t *session, coap_nack_reason_t reason)
 Cancels all outstanding messages for session session.
 
uint16_t coap_new_message_id_lkd (coap_session_t *session)
 Returns a new message id and updates session->tx_mid accordingly.
 
void coap_dispatch (coap_context_t *context, coap_session_t *session, coap_pdu_t *pdu)
 Dispatches the PDUs from the receive queue in given context.
 
int coap_option_check_critical (coap_session_t *session, coap_pdu_t *pdu, coap_opt_filter_t *unknown)
 Verifies that pdu contains no unknown critical options.
 
coap_pdu_tcoap_wellknown_response (coap_context_t *context, coap_session_t *session, coap_pdu_t *request)
 Creates a new response for given request with the contents of .well-known/core.
 
unsigned int coap_calc_timeout (coap_session_t *session, unsigned char r)
 Calculates the initial timeout based on the session CoAP transmission parameters 'ack_timeout', 'ack_random_factor', and COAP_TICKS_PER_SECOND.
 
int coap_check_code_class (coap_session_t *session, coap_pdu_t *pdu)
 Check whether the pdu contains a valid code class.
 
coap_mid_t coap_send_internal (coap_session_t *session, coap_pdu_t *pdu)
 Sends a CoAP message to given peer.
 
int coap_client_delay_first (coap_session_t *session)
 Delay the sending of the first client request until some other negotiation has completed.
 
void coap_free_context_lkd (coap_context_t *context)
 CoAP stack context must be released with coap_free_context_lkd().
 
int coap_handle_event_lkd (coap_context_t *context, coap_event_t event, coap_session_t *session)
 Invokes the event handler of context for the given event and data.
 
int coap_can_exit_lkd (coap_context_t *context)
 Returns 1 if there are no messages to send or to dispatch in the context's queues.
 
int coap_join_mcast_group_intf_lkd (coap_context_t *ctx, const char *groupname, const char *ifname)
 Function interface for joining a multicast group for listening for the currently defined endpoints that are UDP.
 
void coap_register_option_lkd (coap_context_t *ctx, uint16_t type)
 Registers the option type type with the given context object ctx.
 
int coap_context_set_pki_lkd (coap_context_t *context, const coap_dtls_pki_t *setup_data)
 Set the context's default PKI information for a server.
 
int coap_context_set_pki_root_cas_lkd (coap_context_t *context, const char *ca_file, const char *ca_dir)
 Set the context's default Root CA information for a client or server.
 
int coap_context_set_psk_lkd (coap_context_t *context, const char *hint, const uint8_t *key, size_t key_len)
 Set the context's default PSK hint and/or key for a server.
 
int coap_context_set_psk2_lkd (coap_context_t *context, coap_dtls_spsk_t *setup_data)
 Set the context's default PSK hint and/or key for a server.
 
void coap_io_do_io_lkd (coap_context_t *ctx, coap_tick_t now)
 Processes any outstanding read, write, accept or connect I/O as indicated in the coap_socket_t structures (COAP_SOCKET_CAN_xxx set) embedded in endpoints or sessions associated with ctx.
 
void coap_io_do_epoll_lkd (coap_context_t *ctx, struct epoll_event *events, size_t nevents)
 Process all the epoll events.
 
int coap_io_pending_lkd (coap_context_t *context)
 Check to see if there is any i/o pending for the context.
 
unsigned int coap_io_prepare_epoll_lkd (coap_context_t *ctx, coap_tick_t now)
 Any now timed out delayed packet is transmitted, along with any packets associated with requested observable response.
 
unsigned int coap_io_prepare_io_lkd (coap_context_t *ctx, coap_socket_t *sockets[], unsigned int max_sockets, unsigned int *num_sockets, coap_tick_t now)
 Iterates through all the coap_socket_t structures embedded in endpoints or sessions associated with the ctx to determine which are wanting any read, write, accept or connect I/O (COAP_SOCKET_WANT_xxx is set).
 
int coap_io_process_lkd (coap_context_t *ctx, uint32_t timeout_ms)
 The main I/O processing function.
 
int coap_io_process_with_fds_lkd (coap_context_t *ctx, uint32_t timeout_ms, int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds)
 The main message processing loop with additional fds for internal select.
 
unsigned int coap_io_get_fds_lkd (coap_context_t *context, coap_fd_t read_fds[], unsigned int *have_read_fds, unsigned int max_read_fds, coap_fd_t write_fds[], unsigned int *have_write_fds, unsigned int max_write_fds, unsigned int *rem_timeout_ms)
 
coap_mid_t coap_send_lkd (coap_session_t *session, coap_pdu_t *pdu)
 Sends a CoAP message to given peer.
 
int coap_send_recv_lkd (coap_session_t *session, coap_pdu_t *request_pdu, coap_pdu_t **response_pdu, uint32_t timeout_ms)
 
coap_mid_t coap_send_error_lkd (coap_session_t *session, const coap_pdu_t *request, coap_pdu_code_t code, coap_opt_filter_t *opts)
 Sends an error response with code code for request request to dst.
 
coap_mid_t coap_send_message_type_lkd (coap_session_t *session, const coap_pdu_t *request, coap_pdu_type_t type)
 Helper function to create and send a message with type (usually ACK or RST).
 
coap_mid_t coap_send_ack_lkd (coap_session_t *session, const coap_pdu_t *request)
 Sends an ACK message with code 0 for the specified request to dst.
 
coap_mid_t coap_send_rst_lkd (coap_session_t *session, const coap_pdu_t *request)
 Sends an RST message with code 0 for the specified request to dst.
 

Variables

int coap_started
 

Detailed Description

CoAP context internal information.

Definition in file coap_net_internal.h.

Variable Documentation

◆ coap_started

int coap_started
extern

Definition at line 4611 of file coap_net.c.