Go to the source code of this file.
◆ ndn_sd_context_t
The structure to implement state storage and management in Service Discovery.
◆ ndn_sd_identity_t
The structure to implement neighbors management in Access Control.
◆ ndn_service_t
The structure to represent a NDN service.
◆ ndn_sd_find_first_service_provider()
ndn_sd_identity_t* ndn_sd_find_first_service_provider |
( |
const char * |
id_value, |
|
|
uint32_t |
id_size |
|
) |
| |
Find a service provider in the neighbor list by searching service ID.
- Parameters
-
id. | Input. The service ID searched. |
id_size. | Input. Size of input service ID. |
- Returns
- pointer to the first service provider's neighbor identity if it exists.
◆ ndn_sd_find_neigbor()
Find a neighbor in the neighbor list by searching its identity.
- Parameters
-
id. | Input. The neighbor identity searched. |
- Returns
- pointer to the neighbor identity if it exists.
◆ ndn_sd_init()
Init a Service Discovery State structure.
- Parameters
-
home_prefix. | Input. The network home prefix to configure the state manager. |
self_id. | Input. The local state manager identity. |
◆ ndn_sd_on_advertisement_process()
int ndn_sd_on_advertisement_process |
( |
const ndn_interest_t * |
interest | ) |
|
Process Service Discovery Advertisement.
This function will automatically set and update local Service Discovery State and is used in receiver side onInterest callback.
- Parameters
-
interest. | Input. Decoded advertisement interest. |
- Returns
- 0 if there is no error.
◆ ndn_sd_on_query_process()
Process Service Discovery Query.
This function is used in receiver side onInterest callback.
- Parameters
-
interest. | Input. Decoded and signature verified query interest. |
response. | Output. Prepared query response. |
- Returns
- 0 if there is no error.
◆ ndn_sd_on_query_response_process()
int ndn_sd_on_query_response_process |
( |
const ndn_data_t * |
response | ) |
|
Process Service Discovery Query's Response.
This function will automatically set and update local Service Discovery State and is used in sender side onData callback.
- Parameters
-
response. | Input. Decoded and signature verified query response. |
- Returns
- 0 if there is no error.
◆ ndn_sd_on_query_timeout_process()
int ndn_sd_on_query_timeout_process |
( |
const ndn_interest_t * |
interest | ) |
|
Process Service Discovery Query's Timeout.
This function will automatically remove query target identity from local neighbor list and is used in sender side onInterestTimeout callback.
- Parameters
-
interest. | Input. Expired interest. |
- Returns
- 0 if there is no error.
◆ ndn_sd_prepare_advertisement()
Prepare a Service Discovery Advertisement.
This function should be called after setting local services status.
- Parameters
-
interest. | Output. The prepared advertisement interest. |
◆ ndn_sd_prepare_query()
Prepare a Service Discovery Query.
Users should manually sign the output query interest to obtain a valid signed query interest.
- Parameters
-
interest. | Output. The prepared unsigned query interest. |
target. | Input. The query target identity. |
service. | Input. The query target service. |
params_value. | Input. The query parameter buffer (optional) |
params_size. | Input. Size of input buffer (optional) |
◆ ndn_sd_register_get_self_service()
ndn_service_t* ndn_sd_register_get_self_service |
( |
const char * |
id_value, |
|
|
uint32_t |
id_size |
|
) |
| |
Get a pointer to a NDN service by searching its NDN service ID.
- Parameters
-
id_value. | Input. Service ID buffer. |
id_size. | Input. Size of input service ID. |
- Returns
- pointer to the NDN service if it exists.
◆ ndn_sd_set_service_status()
static int ndn_sd_set_service_status |
( |
ndn_service_t * |
service, |
|
|
uint8_t |
status |
|
) |
| |
|
inlinestatic |
Set service status of a NDN service.
- Parameters
-
service. | Input. The NDN service whose service status will be set. |
status. | Input. Service status value. |
- Returns
- 0 if there is no error.