libcoap 4.3.1
|
Go to the source code of this file.
Data Structures | |
struct | in6_pktinfo |
struct | in_pktinfo |
Macros | |
#define | SOL_IP IPPROTO_IP |
#define | UNUSED_PARAM |
#define | iov_len_t size_t |
#define | SIN6(A) ((struct sockaddr_in6 *)(A)) |
Functions | |
void | coap_free_endpoint (coap_endpoint_t *ep) |
static const char * | coap_socket_format_errno (int error) |
struct coap_endpoint_t * | coap_malloc_endpoint (void) |
void | coap_mfree_endpoint (struct coap_endpoint_t *ep) |
int | coap_socket_bind_udp (coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr) |
int | coap_socket_connect_tcp1 (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) |
Create a new TCP socket and initiate the connection. More... | |
int | coap_socket_connect_tcp2 (coap_socket_t *sock, coap_address_t *local_addr, coap_address_t *remote_addr) |
Complete the TCP Connection. More... | |
int | coap_socket_bind_tcp (coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr) |
Create a new TCP socket and then listen for new incoming TCP sessions. More... | |
int | coap_socket_accept_tcp (coap_socket_t *server, coap_socket_t *new_client, coap_address_t *local_addr, coap_address_t *remote_addr) |
Accept a new incoming TCP session. More... | |
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) |
void | coap_socket_close (coap_socket_t *sock) |
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) |
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... | |
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... | |
ssize_t | coap_network_read (coap_socket_t *sock, coap_packet_t *packet) |
Function interface for reading data. More... | |
unsigned int | coap_write (coap_context_t *ctx, coap_socket_t *sockets[], unsigned int max_sockets, unsigned int *num_sockets, coap_tick_t now) |
int | coap_run_once (coap_context_t *ctx, unsigned timeout_ms) |
const char * | coap_socket_strerror (void) |
ssize_t | coap_socket_send (coap_socket_t *sock, coap_session_t *session, const uint8_t *data, size_t data_len) |
#define iov_len_t size_t |
Definition at line 843 of file coap_io_contiki.c.
#define SIN6 | ( | A | ) | ((struct sockaddr_in6 *)(A)) |
Definition at line 1023 of file coap_io_contiki.c.
#define SOL_IP IPPROTO_IP |
Definition at line 815 of file coap_io_contiki.c.
#define UNUSED_PARAM |
Definition at line 821 of file coap_io_contiki.c.
void coap_free_endpoint | ( | coap_endpoint_t * | ep | ) |
struct coap_endpoint_t * coap_malloc_endpoint | ( | void | ) |
void coap_mfree_endpoint | ( | struct 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 1033 of file coap_io_contiki.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 848 of file coap_io_contiki.c.
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.
Definition at line 1026 of file coap_io_contiki.c.
int coap_run_once | ( | coap_context_t * | ctx, |
unsigned | timeout_ms | ||
) |
Definition at line 1467 of file coap_io_contiki.c.
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 | ) |
Definition at line 650 of file coap_io_contiki.c.
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 | ||
) |
Definition at line 542 of file coap_io_contiki.c.
|
static |
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 | ||
) |
Definition at line 1680 of file coap_io_contiki.c.
const char * coap_socket_strerror | ( | void | ) |
ssize_t coap_socket_write | ( | coap_socket_t * | sock, |
const uint8_t * | data, | ||
size_t | data_len | ||
) |
unsigned int coap_write | ( | coap_context_t * | ctx, |
coap_socket_t * | sockets[], | ||
unsigned int | max_sockets, | ||
unsigned int * | num_sockets, | ||
coap_tick_t | now | ||
) |
Definition at line 1290 of file coap_io_contiki.c.