Go to the source code of this file.
|
| DPS_RegistrationList * | DPS_CreateRegistrationList (uint8_t size) |
| | Create an empty regisration list of the specified size. More...
|
| |
| void | DPS_DestroyRegistrationList (DPS_RegistrationList *regs) |
| | Destroy a regisration list and free resources. More...
|
| |
| DPS_Status | DPS_Registration_Put (DPS_Node *node, const char *host, uint16_t port, const char *tenantString, DPS_OnRegPutComplete cb, void *data) |
| | Resolve the host and port of a registration service and register a local node with that service. More...
|
| |
| DPS_Status | DPS_Registration_PutSyn (DPS_Node *node, const char *host, uint16_t port, const char *tenantString) |
| | Synchronous version of DPS_RegistrationPut(). More...
|
| |
| DPS_Status | DPS_Registration_Get (DPS_Node *node, const char *host, uint16_t port, const char *tenantString, DPS_RegistrationList *regs, DPS_OnRegGetComplete cb, void *data) |
| | Resolve the host and port of a registration service and lookup the addresses registered with that service. More...
|
| |
| DPS_Status | DPS_Registration_GetSyn (DPS_Node *node, const char *host, uint16_t port, const char *tenantString, DPS_RegistrationList *regs) |
| | A synchronous version of DPS_RegistrationGet() this function blocks until the candidate list has been populated or the request times out. More...
|
| |
| DPS_Status | DPS_Registration_LinkTo (DPS_Node *node, DPS_RegistrationList *regs, DPS_OnRegLinkToComplete cb, void *data) |
| | Randomly select a remote candidate to link to. More...
|
| |
| DPS_Status | DPS_Registration_LinkToSyn (DPS_Node *node, DPS_RegistrationList *regs, DPS_NodeAddress *addr) |
| | Synchronous version of Registration_LinkTo. More...
|
| |
| #define DPS_CANDIDATE_FAILED 0x02 /** An attempt to link to a candidate was attempted but failed */ |
| #define DPS_CANDIDATE_INVALID 0x10 /** This is a invalid candidate address for linking */ |
| #define DPS_CANDIDATE_LINKED 0x04 /** Registration is currently linked */ |
| #define DPS_CANDIDATE_TRYING 0x01 /** An attempt is being made link to a candidate */ |
| #define DPS_CANDIDATE_UNLINKED 0x08 /** Registration was linked but is currently not linked */ |
Function prototype for callback called when DPS_Registration_LinkTo() completes.
- Parameters
-
| regs | The list of registrations addressess passed in to DPS_Registration_LinkTo(). |
| addr | The address if the remote if status == DPS_OK |
| status | Status code indicating success or failure
- DPS_OK if a link was sucessfully established
- DPS_ERR_NO_ROUTE if a link could not be established
- Other error status codes
|
| data | Caller supplied data passed into the DPS_Registration_LinkTo() |
| typedef void(* DPS_OnRegPutComplete) (DPS_Status status, void *data) |
Function prototype for callback called when DPS_Registration_Put() completes.
- Parameters
-
| status | Status code indicating success or failure
- DPS_OK if the registration was made
- Other error status codes
|
| data | Caller supplied data passed into the DPS_Registration_Put() |
For returning a list of candidate remote nodes.
Create an empty regisration list of the specified size.
Destroy a regisration list and free resources.
Resolve the host and port of a registration service and lookup the addresses registered with that service.
- Parameters
-
| node | The node |
| host | The host name or IP address to register with |
| port | The port number |
| tenantString | Topic string indentifying the tenant |
| regs | Registration list for accumulating the results. The count field must be initialized with the maximum number of registrations to be returned. The candidate list pointer must remanin valid until the callback is called. |
| cb | The callback to call with the result |
| data | Caller supplied data to be passed to the callback |
- Returns
- DPS_OK if the registration get request was succesfully initiated, otherwise returns an error status and the callback function will not be called.
A synchronous version of DPS_RegistrationGet() this function blocks until the candidate list has been populated or the request times out.
- Parameters
-
| node | The node |
| host | The host name or IP address to register with |
| port | The port number |
| tenantString | Topic string indentifying the tenant |
| regs | Registration list for accumulating the results. |
- Returns
- DPS_OK if the get request succeeded or and error status for the failure.
Randomly select a remote candidate to link to.
- Parameters
-
| node | The local node to link |
| regs | The list of candidate registrations to try to link to |
| cb | The callback to call with the result |
| data | Caller supplied data to be passed to the callback |
- Returns
- Status code indicating success or failure
- DPS_OK if a link is being tried, the success or failure will be reported in the callback
- DPS_ERR_NO_ROUTE if no new links can be established
- Other error status codes
Synchronous version of Registration_LinkTo.
- Parameters
-
| node | The local node to link |
| regs | The list of candidate registrations to try to link to |
| addr | Set to the address of the linked candidate |
- Returns
- Status code indicating success or failure
- DPS_OK if a link was successfully established
- DPS_ERR_NO_ROUTE if no new links can be established
- Other error status codes
Resolve the host and port of a registration service and register a local node with that service.
- Parameters
-
| node | The local node to register |
| host | The host name or IP address to register with |
| port | The port number |
| tenantString | Topic string indentifying the tenant |
| cb | Callback called when the registration completes. |
| data | Caller provided data to be passed to the callback function |
- Returns
- DPS_OK if the registration put reequest was succesfully initiated, otherwise returns an error status and the callback function will not be called.
| DPS_Status DPS_Registration_PutSyn |
( |
DPS_Node * |
node, |
|
|
const char * |
host, |
|
|
uint16_t |
port, |
|
|
const char * |
tenantString |
|
) |
| |
Synchronous version of DPS_RegistrationPut().
This function blocks until the operations is complete.
- Parameters
-
| node | The local node to register |
| host | The host name or IP address to register with |
| port | The port number |
| tenantString | Topic string indentifying the tenant |
- Returns
- DPS_OK if the put request succeeded or and error status for the failure.
| const char* DPS_RegistryTopicString |
APIs for interacting with a registration service.