Library for using RIOT as CoRE Resource Directory endpoint.
More...
Library for using RIOT as CoRE Resource Directory endpoint.
This module implements a CoRE Resource Directory endpoint library, that allows RIOT nodes to register themselves with resource directories. It implements the standard endpoint functionality as defined in RFC 9176.
- See also
- https://datatracker.ietf.org/doc/html/rfc9176
Design Decisions
- all operations provided by this module are fully synchronous, meaning that the functions will block until an operation is successful or will time out
- the implementation limits the endpoint to be registered with a single RD at any point in time
|
file | ep.h |
| CoRE Resource Directory endpoint interface.
|
|
|
int | cord_ep_discover_regif (const sock_udp_ep_t *remote, char *regif, size_t maxlen) |
| Discover the registration interface resource of a RD.
|
|
int | cord_ep_register (const sock_udp_ep_t *remote, const char *regif) |
| Initiate the node registration by sending an empty push.
|
|
int | cord_ep_update (void) |
| Update our current entry at the RD.
|
|
int | cord_ep_remove (void) |
| Unregister from a given RD server.
|
|
void | cord_ep_dump_status (void) |
| Dump the current RD connection status to STDIO (for debugging)
|
|
◆ anonymous enum
Return values and error codes used by this module.
Enumerator |
---|
CORD_EP_OK | everything went as expected
|
CORD_EP_TIMEOUT | no response from the network
|
CORD_EP_ERR | internal error or invalid reply
|
CORD_EP_NORD | not connected to an RD
|
CORD_EP_OVERFLOW | internal buffers can not handle input
|
Definition at line 46 of file ep.h.
◆ cord_ep_discover_regif()
int cord_ep_discover_regif |
( |
const sock_udp_ep_t * |
remote, |
|
|
char * |
regif, |
|
|
size_t |
maxlen |
|
) |
| |
Discover the registration interface resource of a RD.
- Parameters
-
[in] | remote | remote endpoint of the target RD |
[out] | regif | the registration interface is written to this buffer |
[in] | maxlen | size of regif |
- Returns
- CORD_EP_OK on success
-
CORD_EP_TIMEOUT if the discovery request times out
-
CORD_EP_NORD if addressed endpoint is not a RD
-
CORD_EP_ERR on any other internal error
◆ cord_ep_register()
int cord_ep_register |
( |
const sock_udp_ep_t * |
remote, |
|
|
const char * |
regif |
|
) |
| |
Initiate the node registration by sending an empty push.
- if registration fails (e.g. timeout), we are not associated with any RD anymore (even if we have been before we called cord_ep_register)
- Note
- In case a multicast address is given, the
regif
parameter MUST be NULL. The first RD responding to the request will be chosen and all replies from other RD servers are ignored.
- Parameters
-
[in] | remote | remote endpoint of the target RD |
[in] | regif | registration interface resource of the RD, it will be discovered automatically when set to NULL |
- Returns
- CORD_EP_OK on success
-
CORD_EP_TIMEOUT on registration timeout
-
CORD_EP_NORD if addressed endpoint is not a RD
-
CORD_EP_OVERFLOW if
regif
does not fit into internal buffer
-
CORD_EP_ERR on any other internal error
◆ cord_ep_remove()
int cord_ep_remove |
( |
void |
| ) |
|
Unregister from a given RD server.
- Returns
- CORD_EP_OK on success
-
CORD_EP_TIMEOUT if the remove request times out
-
CORD_EP_ERR on any other internal error
◆ cord_ep_update()
int cord_ep_update |
( |
void |
| ) |
|
Update our current entry at the RD.
- Returns
- CORD_EP_OK on success
-
CORD_EP_TIMEOUT if the update request times out
-
CORD_EP_ERR on any other internal error