libcoap
4.3.0
|
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 More... | |
#define | COAP_SOCKET_NOT_EMPTY 0x0001 |
the socket is not empty More... | |
#define | COAP_SOCKET_BOUND 0x0002 |
the socket is bound More... | |
#define | COAP_SOCKET_CONNECTED 0x0004 |
the socket is connected More... | |
#define | COAP_SOCKET_WANT_READ 0x0010 |
non blocking socket is waiting for reading More... | |
#define | COAP_SOCKET_WANT_WRITE 0x0020 |
non blocking socket is waiting for writing More... | |
#define | COAP_SOCKET_WANT_ACCEPT 0x0040 |
non blocking server socket is waiting for accept More... | |
#define | COAP_SOCKET_WANT_CONNECT 0x0080 |
non blocking client socket is waiting for connect More... | |
#define | COAP_SOCKET_CAN_READ 0x0100 |
non blocking socket can now read without blocking More... | |
#define | COAP_SOCKET_CAN_WRITE 0x0200 |
non blocking socket can now write without blocking More... | |
#define | COAP_SOCKET_CAN_ACCEPT 0x0400 |
non blocking server socket can now accept without blocking More... | |
#define | COAP_SOCKET_CAN_CONNECT 0x0800 |
non blocking client socket can now connect without blocking More... | |
#define | COAP_SOCKET_MULTICAST 0x1000 |
socket is used for multicast communication More... | |
#define | coap_mcast_interface(Local) 0 |
Functions | |
coap_endpoint_t * | coap_malloc_endpoint (void) |
void | coap_mfree_endpoint (coap_endpoint_t *ep) |
const char * | coap_socket_format_errno (int error) |
int | coap_socket_connect_udp (coap_socket_t *sock, const coap_address_t *local_if, const coap_address_t *server, int default_port, coap_address_t *local_addr, coap_address_t *remote_addr) |
int | coap_socket_bind_udp (coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr) |
void | coap_socket_close (coap_socket_t *sock) |
ssize_t | coap_socket_send (coap_socket_t *sock, coap_session_t *session, const uint8_t *data, size_t data_len) |
ssize_t | coap_socket_write (coap_socket_t *sock, const uint8_t *data, size_t data_len) |
ssize_t | coap_socket_read (coap_socket_t *sock, uint8_t *data, size_t data_len) |
void | coap_epoll_ctl_mod (coap_socket_t *sock, uint32_t events, const char *func) |
ssize_t | coap_network_send (coap_socket_t *sock, const coap_session_t *session, const uint8_t *data, size_t datalen) |
Function interface for data transmission. More... | |
ssize_t | coap_network_read (coap_socket_t *sock, coap_packet_t *packet) |
Function interface for reading data. More... | |
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. More... | |
#define coap_mcast_interface | ( | Local | ) | 0 |
Definition at line 124 of file coap_io_internal.h.
#define COAP_SOCKET_BOUND 0x0002 |
the socket is bound
Definition at line 45 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_ACCEPT 0x0400 |
non blocking server socket can now accept without blocking
Definition at line 53 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_CONNECT 0x0800 |
non blocking client socket can now connect without blocking
Definition at line 54 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_READ 0x0100 |
non blocking socket can now read without blocking
Definition at line 51 of file coap_io_internal.h.
#define COAP_SOCKET_CAN_WRITE 0x0200 |
non blocking socket can now write without blocking
Definition at line 52 of file coap_io_internal.h.
#define COAP_SOCKET_CONNECTED 0x0004 |
the socket is connected
Definition at line 46 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 55 of file coap_io_internal.h.
#define COAP_SOCKET_NOT_EMPTY 0x0001 |
the socket is not empty
Definition at line 44 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_ACCEPT 0x0040 |
non blocking server socket is waiting for accept
Definition at line 49 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_CONNECT 0x0080 |
non blocking client socket is waiting for connect
Definition at line 50 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_READ 0x0010 |
non blocking socket is waiting for reading
Definition at line 47 of file coap_io_internal.h.
#define COAP_SOCKET_WANT_WRITE 0x0020 |
non blocking socket is waiting for writing
Definition at line 48 of file coap_io_internal.h.
void coap_epoll_ctl_mod | ( | coap_socket_t * | sock, |
uint32_t | events, | ||
const char * | func | ||
) |
coap_endpoint_t* coap_malloc_endpoint | ( | void | ) |
void coap_mfree_endpoint | ( | coap_endpoint_t * | ep | ) |
ssize_t coap_network_read | ( | coap_socket_t * | sock, |
coap_packet_t * | packet | ||
) |
Function interface for reading data.
This function returns the number of bytes that have been read, or a value less than zero on error. In case of an error, *packet
is set to NULL.
sock | Socket to read data from |
packet | Received packet metadata and payload. src and dst should be preset. |
Definition at line 752 of file coap_io.c.
ssize_t coap_network_send | ( | coap_socket_t * | sock, |
const coap_session_t * | session, | ||
const uint8_t * | data, | ||
size_t | datalen | ||
) |
Function interface for data transmission.
This function returns the number of bytes that have been transmitted, or a value less than zero on error.
sock | Socket to send data with |
session | Addressing information for unconnected sockets, or NULL |
data | The data to send. |
datalen | The actual length of data . |
Definition at line 571 of file coap_io.c.
void coap_packet_get_memmapped | ( | coap_packet_t * | packet, |
unsigned char ** | address, | ||
size_t * | length | ||
) |
int coap_socket_bind_udp | ( | coap_socket_t * | sock, |
const coap_address_t * | listen_addr, | ||
coap_address_t * | bound_addr | ||
) |
void coap_socket_close | ( | coap_socket_t * | sock | ) |
int coap_socket_connect_udp | ( | coap_socket_t * | sock, |
const coap_address_t * | local_if, | ||
const coap_address_t * | server, | ||
int | default_port, | ||
coap_address_t * | local_addr, | ||
coap_address_t * | remote_addr | ||
) |
const char* coap_socket_format_errno | ( | int | error | ) |
ssize_t coap_socket_read | ( | coap_socket_t * | sock, |
uint8_t * | data, | ||
size_t | data_len | ||
) |
ssize_t coap_socket_send | ( | coap_socket_t * | sock, |
coap_session_t * | session, | ||
const uint8_t * | data, | ||
size_t | data_len | ||
) |
ssize_t coap_socket_write | ( | coap_socket_t * | sock, |
const uint8_t * | data, | ||
size_t | data_len | ||
) |