12 #ifndef COAP_IO_INTERNAL_H_
13 #define COAP_IO_INTERNAL_H_
15 #include <sys/types.h>
24 #if defined(WITH_LWIP)
26 #elif defined(WITH_CONTIKI)
31 #if defined(RIOT_VERSION)
43 #define COAP_SOCKET_EMPTY 0x0000
44 #define COAP_SOCKET_NOT_EMPTY 0x0001
45 #define COAP_SOCKET_BOUND 0x0002
46 #define COAP_SOCKET_CONNECTED 0x0004
47 #define COAP_SOCKET_WANT_READ 0x0010
48 #define COAP_SOCKET_WANT_WRITE 0x0020
49 #define COAP_SOCKET_WANT_ACCEPT 0x0040
50 #define COAP_SOCKET_WANT_CONNECT 0x0080
51 #define COAP_SOCKET_CAN_READ 0x0100
52 #define COAP_SOCKET_CAN_WRITE 0x0200
53 #define COAP_SOCKET_CAN_ACCEPT 0x0400
54 #define COAP_SOCKET_CAN_CONNECT 0x0800
55 #define COAP_SOCKET_MULTICAST 0x1000
79 const uint8_t *data,
size_t data_len );
123 #ifndef coap_mcast_interface
124 # define coap_mcast_interface(Local) 0
132 unsigned char **address,
140 struct pbuf *coap_packet_extract_pbuf(
coap_packet_t *packet);
143 #if defined(WITH_LWIP)
Representation of network addresses.
uint16_t coap_socket_flags_t
#define COAP_RXBUFFER_SIZE
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)
ssize_t coap_socket_read(coap_socket_t *sock, uint8_t *data, size_t data_len)
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)
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.
ssize_t coap_socket_write(coap_socket_t *sock, const uint8_t *data, size_t data_len)
ssize_t coap_network_read(coap_socket_t *sock, coap_packet_t *packet)
Function interface for reading data.
int coap_socket_bind_udp(coap_socket_t *sock, const coap_address_t *listen_addr, coap_address_t *bound_addr)
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.
const char * coap_socket_format_errno(int error)
void coap_epoll_ctl_mod(coap_socket_t *sock, uint32_t events, const char *func)
void coap_mfree_endpoint(coap_endpoint_t *ep)
coap_endpoint_t * coap_malloc_endpoint(void)
multi-purpose address abstraction
Abstraction of virtual endpoint that can be attached to coap_context_t.
size_t length
length of payload
coap_addr_tuple_t addr_info
local and remote addresses
unsigned char payload[COAP_RXBUFFER_SIZE]
payload
int ifindex
the interface index
structure for CoAP PDUs token, if any, follows the fixed size header, then options until payload mark...
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
coap_endpoint_t * endpoint
coap_socket_flags_t flags