14 #include <sys/types.h>
24 #define COAP_IF_INVALID -1
36 #if defined(WITH_POSIX) || defined(WITH_CONTIKI)
55 #define COAP_ENDPOINT_NOSEC 0x00
56 #define COAP_ENDPOINT_DTLS 0x01
78 unsigned char *data,
size_t datalen);
95 #ifndef coap_mcast_interface
96 # define coap_mcast_interface(Local) 0
123 unsigned char **address,
131 struct pbuf *coap_packet_extract_pbuf(
coap_packet_t *packet);
void * conn
opaque connection (e.g.
void coap_free_endpoint(coap_endpoint_t *ep)
void coap_free_packet(coap_packet_t *packet)
Releases the storage allocated for packet.
coap_address_t addr
local interface address
multi-purpose address abstraction
void coap_packet_populate_endpoint(coap_packet_t *packet, coap_endpoint_t *target)
Populate the coap_endpoint_t *target from the incoming packet's destination data. ...
Abstraction of virtual endpoint that can be attached to coap_context_t.
ssize_t coap_network_send(struct coap_context_t *context, const coap_endpoint_t *local_interface, const coap_address_t *dst, unsigned char *data, size_t datalen)
Function interface for data transmission.
struct coap_endpoint_t coap_endpoint_t
Abstraction of virtual endpoint that can be attached to coap_context_t.
void * session
opaque session data
coap_address_t src
the packet's source address
coap_if_handle_t hnd
the interface handle
coap_endpoint_t * coap_new_endpoint(const coap_address_t *addr, int flags)
const coap_endpoint_t * interface
ssize_t coap_network_read(coap_endpoint_t *ep, coap_packet_t **packet)
Function interface for reading data.
void coap_packet_copy_source(coap_packet_t *packet, coap_address_t *target)
Given an incoming packet, copy its source address into an address struct.
unsigned char payload[]
payload
Representation of network addresses.
coap_address_t dst
the packet's destination address
size_t length
length of payload
union coap_endpoint_t::@1 handle
opaque handle to identify this endpoint
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...
int coap_if_handle_t
Abstract handle that is used to identify a local network interface.
The CoAP stack's global state is stored in a coap_context_t object.