BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
bsl_mock_bpa_eid.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 The Johns Hopkins University Applied Physics
3 * Laboratory LLC.
4 *
5 * This file is part of the Bundle Protocol Security Library (BSL).
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * This work was performed for the Jet Propulsion Laboratory, California
18 * Institute of Technology, sponsored by the United States Government under
19 * the prime contract 80NM0018D0004 between the Caltech and NASA under
20 * subcontract 1700763.
21 */
22
27#ifndef BSL_MOCK_BPA_EID_H_
28#define BSL_MOCK_BPA_EID_H_
29
30#include <inttypes.h>
31
32#include <BPSecLib_Private.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38int MockBPA_GetEid(const void *user_data, BSL_HostEID_t *result_eid _U_);
39
41typedef struct
42{
44 int ncomp;
46 uint64_t auth_num;
48 uint64_t node_num;
50 uint64_t svc_num;
52
59
61typedef struct
62{
64 uint64_t scheme;
65
67 union
68 {
73 } ssp;
75
78
81
83int MockBPA_EID_Init(void *user_data, BSL_HostEID_t *eid);
84
86void MockBPA_EID_Deinit(void *user_data, BSL_HostEID_t *eid);
87
89int mock_bpa_get_secsrc(BSL_HostEID_t *eid, void *user_data);
90
92int mock_bpa_eid_from_text(BSL_HostEID_t *eid, const char *text, void *user_data);
93
95// int mock_bpa_eid_to_text(string_t out, const BSL_HostEID_t *eid, void *user_data);
96
97#ifdef __cplusplus
98} // extern C
99#endif
100
101#endif // BSL_MOCK_BPA_EID_H_
Single entry-point include file for all of the BPSec Lib (BSL) frontend API.
#define _U_
Mark an unused parameter Within a function definition.
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.
bsl_mock_eid_scheme_e
Decodable schemes.
@ BSL_MOCK_EID_IPN
The "ipn" scheme.
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.
Heap data storage and views.
Opaque pointer to BPA-specific Endpoint ID storage.
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.
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.