BSL v1.0.0 - 16.g9d98179
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
agent.h File Reference

Declarations for Agent initialization. More...

#include "ctr.h"
#include "policy_registry.h"
#include <BPSecLib_Public.h>
#include <BPSecLib_Private.h>
#include <policy_provider/SamplePolicyProvider.h>
#include <m-atomic.h>
#include <m-buffer.h>
#include <m-string.h>
#include <arpa/inet.h>
#include <pthread.h>
#include <inttypes.h>
+ Include dependency graph for agent.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  MockBPA_Agent_BSL_Ctx_t
 Each BSL context and its associated control state. More...
 
struct  MockBPA_Agent_t
 Overall Mock BPA state above any particular bundle handling. More...
 

Macros

#define MOCKBPA_DATA_QUEUE_SIZE   100
 Queue size for bundle queues.
 

Functions

int MockBPA_GetBundleMetadata (const BSL_BundleRef_t *bundle_ref, BSL_PrimaryBlock_t *result_primary_block)
 
int MockBPA_GetBlockNums (const BSL_BundleRef_t *bundle_ref, size_t block_id_array_capacity, uint64_t *block_id_array_result, size_t *result_count)
 
int MockBPA_GetBlockMetadata (const BSL_BundleRef_t *bundle_ref, uint64_t block_num, BSL_CanonicalBlock_t *result_canonical_block)
 
int MockBPA_ReallocBTSD (BSL_BundleRef_t *bundle_ref, uint64_t block_num, size_t bytesize)
 
int MockBPA_CreateBlock (BSL_BundleRef_t *bundle_ref, uint64_t block_type_code, uint64_t *result_block_num)
 
int MockBPA_RemoveBlock (BSL_BundleRef_t *bundle_ref, uint64_t block_num)
 
int MockBPA_DeleteBundle (BSL_BundleRef_t *bundle_ref, BSL_ReasonCode_t reason)
 
BSL_HostDescriptors_t MockBPA_Agent_Descriptors (MockBPA_Agent_t *agent)
 Get host descriptors without a specific agent.
 
int MockBPA_Agent_Init (MockBPA_Agent_t *agent)
 Initialize and register this mock BPA for the current process.
 
void MockBPA_Agent_Deinit (MockBPA_Agent_t *agent)
 Clean up the mock BPA for the current process.
 
int MockBPA_Agent_Start (MockBPA_Agent_t *agent)
 Start worker threads.
 
void MockBPA_Agent_Stop (MockBPA_Agent_t *agent)
 Stop an agent from another thread or a signal handler.
 
int MockBPA_Agent_Exec (MockBPA_Agent_t *agent)
 Execute the main thread activity while work threads are running.
 
int MockBPA_Agent_Join (MockBPA_Agent_t *agent)
 Wait for and join worker threads.
 

Detailed Description

Declarations for Agent initialization.

Macro Definition Documentation

◆ MOCKBPA_DATA_QUEUE_SIZE

#define MOCKBPA_DATA_QUEUE_SIZE   100

Queue size for bundle queues.

Function Documentation

◆ MockBPA_Agent_Deinit()

◆ MockBPA_Agent_Descriptors()

◆ MockBPA_Agent_Exec()

◆ MockBPA_Agent_Init()

◆ MockBPA_Agent_Join()

int MockBPA_Agent_Join ( MockBPA_Agent_t agent)

◆ MockBPA_Agent_Start()

int MockBPA_Agent_Start ( MockBPA_Agent_t agent)

◆ MockBPA_Agent_Stop()

void MockBPA_Agent_Stop ( MockBPA_Agent_t agent)

Stop an agent from another thread or a signal handler.

Parameters
[in,out]agentThe agent to set the stopping state on.

References agent, BSL_LOG_ERR, buf, MockBPA_Agent_t::stop_state, and MockBPA_Agent_t::tx_notify_w.

Referenced by sig_stop().

◆ MockBPA_CreateBlock()

◆ MockBPA_DeleteBundle()

int MockBPA_DeleteBundle ( BSL_BundleRef_t bundle_ref,
BSL_ReasonCode_t  reason 
)

◆ MockBPA_GetBlockMetadata()

◆ MockBPA_GetBlockNums()

int MockBPA_GetBlockNums ( const BSL_BundleRef_t bundle_ref,
size_t  block_id_array_capacity,
uint64_t *  block_id_array_result,
size_t *  result_count 
)

◆ MockBPA_GetBundleMetadata()

◆ MockBPA_ReallocBTSD()

int MockBPA_ReallocBTSD ( BSL_BundleRef_t bundle_ref,
uint64_t  block_num,
size_t  bytesize 
)

◆ MockBPA_RemoveBlock()