Loading...
Searching...
No Matches

Library for using RIOT as CoRE Resource Directory endpoint. More...

Detailed Description

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 draft-ietf-core-resource-directory-27.

See also
https://datatracker.ietf.org/doc/html/rfc9176

Design Decisions

Modules

 CoRE RD Endpoint Standalone Extension
 Run a CoRE Resource Directory endpoint standalone.
 

Files

file  ep.h
 CoRE Resource Directory endpoint interface.
 

Enumerations

enum  {
  CORD_EP_OK = 0 , CORD_EP_TIMEOUT = -1 , CORD_EP_ERR = -2 , CORD_EP_NORD = -3 ,
  CORD_EP_OVERFLOW = -4
}
 Return values and error codes used by this module. More...
 

Functions

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)
 

Enumeration Type Documentation

◆ anonymous enum

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.

Function Documentation

◆ 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]remoteremote endpoint of the target RD
[out]regifthe registration interface is written to this buffer
[in]maxlensize 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]remoteremote endpoint of the target RD
[in]regifregistration 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