EDM first effort

This commit is contained in:
emanuel 2023-04-18 18:46:52 +01:00
parent ef7348ee90
commit ba2a47b08d
3 changed files with 57 additions and 0 deletions

View File

@ -11,6 +11,7 @@ ADD_EXECUTABLE(it2s-itss-facilities
tpm.c
vcm.c
evm.c
edm.c
)
TARGET_LINK_LIBRARIES(it2s-itss-facilities

9
src/edm.c Normal file
View File

@ -0,0 +1,9 @@
#include "edm.h"
int edm_encap(void* its_msg, int its_msg_type) {
return 0;
}
int edm_decap(uint8_t* data, uint16_t data_len) {
return 0;
}

47
src/edm.h Normal file
View File

@ -0,0 +1,47 @@
#pragma once
#include <stdint.h>
#define EDM_VE_MAX_MSGS 16
#define EDM_MAX_VES 16
typedef enum VE_MSG_TYPE {
iid,
hash
} VE_MSG_TYPE_e;
/*
* event message
*/
typedef struct ve_msg {
VE_MSG_TYPE_e present;
union {
uint32_t iid;
uint8_t hash[32];
} choice;
} ve_msg_t;
/*
* event
*/
typedef struct ve {
uint32_t id;
uint64_t t_init;
uint64_t t_la;
ve_msg_t* ve_msgs[EDM_VE_MAX_MSGS];
uint8_t ve_msgs_len;
} ve_t;
/*
* event data manager
*/
typedef struct edm {
ve_t* ves[EDM_MAX_VES];
uint8_t ves_len;
} edm_t;
int edm_encap(void* its_msg, int its_msg_type);
int edm_decap(uint8_t* data, uint16_t data_len);