libcoap 4.3.5-develop-ea01661
|
Internal network I/O functions. More...
#include "coap_internal.h"
#include "coap_layers_internal.h"
#include <sys/types.h>
#include "coap_address.h"
Go to the source code of this file.
Data Structures | |
struct | coap_socket_t |
struct | coap_packet_t |
Macros | |
#define | COAP_SOCKET_EMPTY 0x0000 |
coap_socket_flags_t values | |
#define | COAP_SOCKET_NOT_EMPTY 0x0001 |
the socket is not empty | |
#define | COAP_SOCKET_BOUND 0x0002 |
the socket is bound | |
#define | COAP_SOCKET_CONNECTED 0x0004 |
the socket is connected | |
#define | COAP_SOCKET_WANT_READ 0x0010 |
non blocking socket is waiting for reading | |
#define | COAP_SOCKET_WANT_WRITE 0x0020 |
non blocking socket is waiting for writing | |
#define | COAP_SOCKET_WANT_ACCEPT 0x0040 |
non blocking server socket is waiting for accept | |
#define | COAP_SOCKET_WANT_CONNECT 0x0080 |
non blocking client socket is waiting for connect | |
#define | COAP_SOCKET_CAN_READ 0x0100 |
non blocking socket can now read without blocking | |
#define | COAP_SOCKET_CAN_WRITE 0x0200 |
non blocking socket can now write without blocking | |
#define | COAP_SOCKET_CAN_ACCEPT 0x0400 |
non blocking server socket can now accept without blocking | |
#define | COAP_SOCKET_CAN_CONNECT 0x0800 |
non blocking client socket can now connect without blocking | |
#define | COAP_SOCKET_MULTICAST 0x1000 |
socket is used for multicast communication | |
#define | COAP_SOCKET_SLAVE 0x2000 |
socket is a slave socket - do not close | |
Functions | |
coap_endpoint_t * | coap_malloc_endpoint (void) |
void | coap_mfree_endpoint (coap_endpoint_t *ep) |
const char * | coap_socket_format_errno (int error) |
void | coap_epoll_ctl_add (coap_socket_t *sock, uint32_t events, const char *func) |
Epoll specific function to add the state of events that epoll is to track for the appropriate file descriptor. | |
void | coap_epoll_ctl_mod (coap_socket_t *sock, uint32_t events, const char *func) |
Epoll specific function to modify the state of events that epoll is tracking on the appropriate file descriptor. | |
void | coap_update_io_timer (coap_context_t *context, coap_tick_t delay) |
Update when to continue with I/O processing, unless packets come in in the meantime. | |
void | coap_packet_get_memmapped (coap_packet_t *packet, unsigned char **address, size_t *length) |
Given a packet, set msg and msg_len to an address and length of the packet's data in memory. | |
Internal network I/O functions.
Definition in file coap_io_internal.h.
#define COAP_SOCKET_BOUND 0x0002 |
the socket is bound
Definition at line 80 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_ACCEPT 0x0400 |
non blocking server socket can now accept without blocking
Definition at line 88 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_CONNECT 0x0800 |
non blocking client socket can now connect without blocking
Definition at line 89 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_READ 0x0100 |
non blocking socket can now read without blocking
Definition at line 86 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_WRITE 0x0200 |
non blocking socket can now write without blocking
Definition at line 87 of file coap_io_internal.h.
#define COAP_SOCKET_CONNECTED 0x0004 |
the socket is connected
Definition at line 81 of file coap_io_internal.h.
#define COAP_SOCKET_EMPTY 0x0000 |
#define COAP_SOCKET_MULTICAST 0x1000 |
socket is used for multicast communication
Definition at line 90 of file coap_io_internal.h.
#define COAP_SOCKET_NOT_EMPTY 0x0001 |
the socket is not empty
Definition at line 79 of file coap_io_internal.h.
#define COAP_SOCKET_SLAVE 0x2000 |
socket is a slave socket - do not close
Definition at line 91 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_ACCEPT 0x0040 |
non blocking server socket is waiting for accept
Definition at line 84 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_CONNECT 0x0080 |
non blocking client socket is waiting for connect
Definition at line 85 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_READ 0x0010 |
non blocking socket is waiting for reading
Definition at line 82 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_WRITE 0x0020 |
non blocking socket is waiting for writing
Definition at line 83 of file coap_io_internal.h.
void coap_epoll_ctl_add | ( | coap_socket_t * | sock, |
uint32_t | events, | ||
const char * | func | ||
) |
Epoll specific function to add the state of events that epoll is to track for the appropriate file descriptor.
sock | Socket information. |
events | The Epoll events to update |
func | Function that this function was called from. |
void coap_epoll_ctl_mod | ( | coap_socket_t * | sock, |
uint32_t | events, | ||
const char * | func | ||
) |
Epoll specific function to modify the state of events that epoll is tracking on the appropriate file descriptor.
sock | Socket information. |
events | The Epoll events to update |
func | Function that this function was called from. |
coap_endpoint_t * coap_malloc_endpoint | ( | void | ) |
void coap_mfree_endpoint | ( | coap_endpoint_t * | ep | ) |
void coap_packet_get_memmapped | ( | coap_packet_t * | packet, |
unsigned char ** | address, | ||
size_t * | length | ||
) |
const char * coap_socket_format_errno | ( | int | error | ) |
void coap_update_io_timer | ( | coap_context_t * | context, |
coap_tick_t | delay | ||
) |
Update when to continue with I/O processing, unless packets come in in the meantime.
Typically, this timeout triggers retransmissions.
context | The CoAP context. |
delay | The time to delay before continuing with I/O processing. |
Definition at line 533 of file coap_io.c.