10 #ifndef NDN_APP_SUPPORT_SERVICE_DISCOVERY_H 11 #define NDN_APP_SUPPORT_SERVICE_DISCOVERY_H 13 #include "../encode/interest.h" 14 #include "../encode/data.h" 135 const uint8_t* params_value, uint32_t params_size);
177 #endif // NDN_APP_SUPPORT_SERVICE_DISCOVERY_H struct ndn_sd_identity ndn_sd_identity_t
The structure to implement neighbors management in Access Control.
int ndn_sd_on_query_response_process(const ndn_data_t *response)
Process Service Discovery Query's Response.
Definition: service-discovery.c:286
int ndn_sd_on_query_timeout_process(const ndn_interest_t *interest)
Process Service Discovery Query's Timeout.
Definition: service-discovery.c:309
uint8_t id_value[NDN_APPSUPPORT_SERVICE_ID_SIZE]
The NDN service ID.
Definition: service-discovery.h:31
The structure to represent an NDN Interest packet.
Definition: interest.h:31
name_component_t identity
The neighbor identity.
Definition: service-discovery.h:45
The structure to represent an NDN Data packet The best practice of using ndn_data_t is to first decla...
Definition: data.h:30
ndn_name_t home_prefix
The home prefix of local network.
Definition: service-discovery.h:59
void ndn_sd_prepare_query(ndn_interest_t *interest, name_component_t *target, ndn_service_t *service, const uint8_t *params_value, uint32_t params_size)
Prepare a Service Discovery Query.
Definition: service-discovery.c:203
The structure to implement state storage and management in Service Discovery.
Definition: service-discovery.h:55
int ndn_sd_on_query_process(const ndn_interest_t *interest, ndn_data_t *response)
Process Service Discovery Query.
Definition: service-discovery.c:252
ndn_sd_identity_t * ndn_sd_find_neigbor(const name_component_t *id)
Find a neighbor in the neighbor list by searching its identity.
Definition: service-discovery.c:163
void ndn_sd_prepare_advertisement(ndn_interest_t *interest)
Prepare a Service Discovery Advertisement.
Definition: service-discovery.c:175
int ndn_sd_on_advertisement_process(const ndn_interest_t *interest)
Process Service Discovery Advertisement.
Definition: service-discovery.c:228
struct ndn_service ndn_service_t
The structure to represent a NDN service.
The structure to represent the Name.
Definition: name.h:24
struct ndn_sd_context ndn_sd_context_t
The structure to implement state storage and management in Service Discovery.
void ndn_sd_init(const ndn_name_t *home_prefix, const name_component_t *self_id)
Init a Service Discovery State structure.
Definition: service-discovery.c:129
The structure to represent a NDN service.
Definition: service-discovery.h:23
The structure to implement neighbors management in Access Control.
Definition: service-discovery.h:41
ndn_service_t services[NDN_APPSUPPORT_SERVICES_SIZE]
The neighbor identity's service list.
Definition: service-discovery.h:49
The structure to represent the Name Component.
Definition: name-component.h:23
#define NDN_APPSUPPORT_NEIGHBORS_SIZE
Definition: ndn-constants.h:65
ndn_sd_identity_t neighbors[NDN_APPSUPPORT_NEIGHBORS_SIZE]
The neighbor list.
Definition: service-discovery.h:67
#define NDN_APPSUPPORT_SERVICES_SIZE
Definition: ndn-constants.h:67
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.
Definition: service-discovery.c:169
static int ndn_sd_set_service_status(ndn_service_t *service, uint8_t status)
Set service status of a NDN service.
Definition: service-discovery.h:94
uint32_t id_size
Size of service ID.
Definition: service-discovery.h:35
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.
Definition: service-discovery.c:141
#define NDN_APPSUPPORT_SERVICE_ID_SIZE
Definition: ndn-constants.h:68
uint8_t status
The NDN service status.
Definition: service-discovery.h:27