49 int main(
int argc,
char **argv)
52 int exit_status = EXIT_SUCCESS;
53 struct doca_apsh_process **processes;
54 struct doca_apsh_process *process =
NULL;
55 struct doca_apsh_attestation **attestation;
56 int att_failure = 0, att_count;
62 struct doca_telemetry_exporter_schema *telemetry_schema;
63 struct doca_telemetry_exporter_source *telemetry_source;
64 const char *process_path;
65 bool telemetry_enabled;
67 struct doca_log_backend *sdk_log;
112 DOCA_LOG_ERR(
"Apsh init was successful but failed to read process %d information: %s",
115 exit_status = EXIT_FAILURE;
123 attest_event.
pid = apsh_conf.
pid;
126 assert(process_path !=
NULL);
135 exit_status = EXIT_FAILURE;
136 goto telemetry_cleanup;
150 for (runtime_file_ind = 0; runtime_file_ind < att_count && !att_failure; runtime_file_ind++) {
158 if (telemetry_enabled) {
163 attest_event.
result = att_failure;
175 exit_status = EXIT_FAILURE;
185 if (telemetry_enabled)
DOCA_LOG_REGISTER(APSH_APP)
int main(int argc, char **argv)
doca_error_t get_process_by_pid(struct apsh_resources *resources, struct apsh_config *apsh_conf, struct doca_apsh_process ***pslist, struct doca_apsh_process **process)
doca_error_t app_shield_agent_init(struct apsh_config *conf, struct apsh_resources *resources)
doca_error_t telemetry_start(struct doca_telemetry_exporter_schema **telemetry_schema, struct doca_telemetry_exporter_source **telemetry_source, struct event_indexes *indexes)
void app_shield_agent_cleanup(struct apsh_resources *resources)
doca_error_t register_apsh_params(void)
void telemetry_destroy(struct doca_telemetry_exporter_schema *telemetry_schema, struct doca_telemetry_exporter_source *telemetry_source)
doca_telemetry_exporter_timestamp_t timestamp
struct rdma_resources resources
@ DOCA_APSH_ATTESTATION_PAGES_PRESENT
@ DOCA_APSH_ATTESTATION_MATCHING_HASHES
DOCA_EXPERIMENTAL void doca_apsh_attestation_free(struct doca_apsh_attestation **attestation)
Destroys a attestation context.
DOCA_EXPERIMENTAL doca_error_t doca_apsh_attestation_get(struct doca_apsh_process *process, const char *exec_hash_map_path, struct doca_apsh_attestation ***attestation, int *attestation_size)
Get current process attestation.
#define doca_apsh_process_info_get(process, attr)
Get attribute value for a process.
DOCA_EXPERIMENTAL void doca_apsh_processes_free(struct doca_apsh_process **processes)
Destroys a process context.
#define doca_apsh_attst_info_get(attestation, attr)
Get attribute value for a attestation.
DOCA_EXPERIMENTAL doca_error_t doca_apsh_attst_refresh(struct doca_apsh_attestation ***attestation, int *attestation_size)
refresh single attestation handler of a process with new snapshot
DOCA_EXPERIMENTAL doca_error_t doca_argp_start(int argc, char **argv)
Parse incoming arguments (cmd line/json).
DOCA_EXPERIMENTAL doca_error_t doca_argp_init(const char *program_name, void *program_config)
Initialize the parser interface.
DOCA_EXPERIMENTAL doca_error_t doca_argp_destroy(void)
ARG Parser destroy.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_create_standard(void)
Create default, non configurable backend for application messages.
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_create_with_file_sdk(FILE *fptr, struct doca_log_backend **backend)
Create a logging backend with a FILE* stream for SDK messages.
DOCA_EXPERIMENTAL doca_error_t doca_log_backend_set_sdk_level(struct doca_log_backend *backend, uint32_t level)
Set the log level limit for SDK logging backends.
uint64_t doca_telemetry_exporter_timestamp_t
DOCA schema type index type.
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_get_timestamp(doca_telemetry_exporter_timestamp_t *timestamp)
Get timestamp in the proper format.
DOCA_EXPERIMENTAL doca_error_t doca_telemetry_exporter_source_report(struct doca_telemetry_exporter_source *doca_source, doca_telemetry_exporter_type_index_t index, void *data, int count)
Report events data of the same type via DOCA source.
char exec_hash_map_path[MAX_PATH_LEN]
DOCA_APSH_PROCESS_PID_TYPE pid
doca_telemetry_exporter_timestamp_t timestamp
char path[MAX_PATH_LEN+1]
doca_telemetry_exporter_type_index_t attest_index