36int MockBPA_GetEid(
const void *user_data,
BSL_HostEID_t *result_eid)
38 const char *local_ipn = getenv(
"BSL_TEST_LOCAL_IPN_EID");
89 const char *local_ipn = getenv(
"BSL_TEST_LOCAL_IPN_EID");
101 const char *curs = text;
102 const char *end = curs + strlen(text);
103 char *pend = strchr(text,
':');
108 size_t scheme_len = pend - text;
110 if (strncasecmp(text,
"ipn", scheme_len) == 0)
117 int res = sscanf(curs,
"%" PRIu64
".%" PRIu64
"%n.%" PRIu64
"%n", &p1, &p2, &len1, &p3, &len2);
156 assert(eid->
handle != NULL);
Single entry-point include file for all of the BPSec Lib (BSL) frontend API.
#define CHKVOID(cond)
Return from void functions if condition fails.
#define _U_
Mark an unused parameter Within a function definition.
#define CHKERR1(cond)
Return the error value 1 if condition fails.
int BSL_Data_Deinit(BSL_Data_t *data)
De-initialize a data struct, freeing if necessary.
void bsl_mock_eid_deinit(bsl_mock_eid_t *eid)
Internal struct de-initializer.
int mock_bpa_get_secsrc(BSL_HostEID_t *eid, void *user_data)
Interface for BSL_HostDescriptors_t::get_secsrc.
void MockBPA_EID_Deinit(void *user_data, BSL_HostEID_t *eid)
Interface for BSL_HostDescriptors_t::eid_deinit.
int MockBPA_EID_Init(void *user_data, BSL_HostEID_t *eid)
Interface for BSL_HostDescriptors_t::eid_init.
int mock_bpa_eid_from_text(BSL_HostEID_t *eid, const char *text, void *user_data)
Interface for BSL_HostDescriptors_t::eid_from_text.
void bsl_mock_eid_init(bsl_mock_eid_t *eid)
Internal struct initializer.
Declarations for EID handling.
@ BSL_MOCK_EID_IPN
The "ipn" scheme.
Opaque pointer to BPA-specific Endpoint ID storage.
void * handle
Opaque pointer for BPA backend to use.
Scheme-specific part for IPN scheme.
int ncomp
The number of components when encoded, either 2 or 3.
uint64_t svc_num
The service number component.
uint64_t node_num
The node number component.
uint64_t auth_num
The authority number component.
Struct to be used as a BSL_HostEID_t::handle.
union bsl_mock_eid_t::@0 ssp
Interpreted according to scheme code.
bsl_eid_ipn_ssp_t as_ipn
Used when scheme is BSL_MOCK_EID_IPN.
uint64_t scheme
Code point for EID schemes from .
BSL_Data_t as_raw
Used in all other cases, copied from source.