Skip to content
Snippets Groups Projects
Commit 2db86473 authored by Chieh-Chun Chen's avatar Chieh-Chun Chen Committed by Kumar, Sunil Dr (Comp Sci & Elec Eng)
Browse files

Update E2 agent for FlexRIC dev 559cbf2f

parent f6a9eec8
No related branches found
No related tags found
No related merge requests found
...@@ -55,45 +55,34 @@ extern "C" { ...@@ -55,45 +55,34 @@ extern "C" {
/* /*
* SEC 0: General data types that make the mapping between ASN data types and RIC ones * SEC 0: General data types that make the mapping between ASN data types and RIC ones
*/ */
typedef byte_array_t adapter_OCTET_STRING_t; typedef byte_array_t adapter_OCTET_STRING_t;
typedef adapter_OCTET_STRING_t adapter_PrintableString_t; typedef adapter_OCTET_STRING_t adapter_PrintableString_t;
typedef adapter_OCTET_STRING_t adapter_TimeStamp_t; // IETF RFC 5905 , NTP spec, 4 bytes long typedef uint32_t adapter_TimeStamp_t; // IETF RFC 5905 , NTP spec, 4 bytes long
/******************************************************* typedef adapter_PrintableString_t adapter_MeasurementTypeName_t;
* SEC 1. RIC Event Trigger Definition as per $8.2.1.1 typedef long adapter_MeasurementTypeID_t;
*******************************************************/ typedef byte_array_t adapter_PLMNIdentity_t; // 3 bytes size
typedef struct kpm_event_trigger_t { typedef uint64_t adapter_NRCellIdentity_t; // 36 bits size
unsigned long ms; // reporting period in milliseconds
} kpm_event_trigger_t;
/*******************************************************
* SEC 2. RIC Action Definition as per $8.2.1.2
*******************************************************/
typedef byte_array_t adapter_MeasurementTypeName_t;
typedef long adapter_MeasurementTypeID_t;
typedef byte_array_t adapter_PLMNIdentity_t; // 3 bytes size
typedef uint64_t adapter_NRCellIdentity_t; // 36 bits size
typedef long adapter_QCI_t; typedef long adapter_QCI_t;
typedef byte_array_t adapter_SST_t;// size = 1 byte typedef byte_array_t adapter_SST_t;// size = 1 byte
typedef byte_array_t adapter_SD_t; // size = 3 byte typedef byte_array_t adapter_SD_t; // size = 3 byte
typedef struct S_NSSAI { typedef struct S_NSSAI {
adapter_SST_t sST; adapter_SST_t sST;
adapter_SD_t *sD; /* OPTIONAL */ adapter_SD_t *sD; /* OPTIONAL */
} adapter_S_NSSAI_t; } adapter_S_NSSAI_t;
typedef long adapter_FiveQI_t; // values: 0..255 typedef long adapter_FiveQI_t; // values: 0..255
typedef long adapter_QosFlowIdentifier_t; typedef long adapter_QosFlowIdentifier_t;
typedef uint64_t adapter_EUTRACellIdentity_t; // 28 bit size
/* /*
* Structure 'adapter_LabelInfoList_t' defines the values of the subcounters that are applicable to an associated measurement type * Structure 'adapter_LabelInfoItem_t_t' defines the values of the subcounters that are applicable to an associated measurement type
* identified by measName or measID. All the fields are indicated as optional. If value is != NULL, it means presence of the optional * identified by measName or measID. All the fields are indicated as optional. If value is != NULL, it means presence of the optional
* field. * field.
*/ */
typedef struct adapter_LabelInfoList_t { typedef struct adapter_LabelInfoItem_t {
long *noLabel; /* OPTIONAL: looks like this is an enumeration datatype that accepts only true (0) */ long *noLabel; /* OPTIONAL: looks like this is an enumeration datatype that accepts only true (0) */
adapter_PLMNIdentity_t *plmnID; /* OPTIONAL */ adapter_PLMNIdentity_t *plmnID; /* OPTIONAL */
adapter_S_NSSAI_t *sliceID; /* OPTIONAL */ adapter_S_NSSAI_t *sliceID; /* OPTIONAL */
...@@ -115,18 +104,29 @@ typedef struct adapter_LabelInfoList_t { ...@@ -115,18 +104,29 @@ typedef struct adapter_LabelInfoList_t {
long *min; /* OPTIONAL */ long *min; /* OPTIONAL */
long *max; /* OPTIONAL */ long *max; /* OPTIONAL */
long *avg; /* OPTIONAL */ long *avg; /* OPTIONAL */
} adapter_LabelInfoList_t; } adapter_LabelInfoItem_t;
void free_label_info(adapter_LabelInfoItem_t *l);
void cp_label_info(adapter_LabelInfoItem_t *dst, adapter_LabelInfoItem_t const *src);
typedef struct MeasInfo_t { typedef struct MeasInfo_t {
enum {MeasurementType_NAME = 1, MeasurementType_ID=2} measType; enum {MeasurementType_NAME = 1, MeasurementType_ID=2} measType;
adapter_MeasurementTypeName_t measName; adapter_MeasurementTypeName_t measName;
adapter_MeasurementTypeID_t measID; adapter_MeasurementTypeID_t measID;
adapter_LabelInfoList_t *labelInfo; // list implemented as array having a maximum of 'maxnoofLabelInfo' items adapter_LabelInfoItem_t *labelInfo; // list implemented as array having a maximum of 'maxnoofLabelInfo' items
size_t labelInfo_len;// length of the array labelInfo size_t labelInfo_len;// length of the array labelInfo
} MeasInfo_t; } MeasInfo_t;
typedef uint64_t adapter_EUTRACellIdentity_t; // 28 bit size /*******************************************************
* SEC 1. RIC Event Trigger Definition as per $8.2.1.1
*******************************************************/
typedef struct kpm_event_trigger_t {
unsigned long ms; // reporting period in milliseconds
} kpm_event_trigger_t;
/*******************************************************
* SEC 2. RIC Action Definition as per $8.2.1.2
*******************************************************/
typedef struct kpm_action_def_t typedef struct kpm_action_def_t
{ {
/* /*
...@@ -166,7 +166,6 @@ typedef struct kpm_action_def_t ...@@ -166,7 +166,6 @@ typedef struct kpm_action_def_t
} kpm_action_def_t; } kpm_action_def_t;
void free_kpm_action_def(kpm_action_def_t* src); void free_kpm_action_def(kpm_action_def_t* src);
void free_kpm_label_info(adapter_LabelInfoList_t *l);
/************************************************ /************************************************
* SEC 3. RIC Indication Header as per $8.2.1.3.1 * SEC 3. RIC Indication Header as per $8.2.1.3.1
************************************************/ ************************************************/
......
...@@ -941,17 +941,8 @@ void read_kpm_sm(kpm_ind_data_t* data) ...@@ -941,17 +941,8 @@ void read_kpm_sm(kpm_ind_data_t* data)
// Fill KPM indication header // Fill KPM indication header
kpm_ind_hdr_t* hdr = &data->hdr; kpm_ind_hdr_t* hdr = &data->hdr;
hdr->collectStartTime.len = 4;
hdr->collectStartTime.buf = calloc(1, 4);
assert(hdr->collectStartTime.buf != NULL && "memory exhausted");
int64_t t = time_now_us(); int64_t t = time_now_us();
uint32_t t_truncated = t / 1000000; hdr->collectStartTime = t / 1000000; // needs to be truncated to 32 bits to arrive to a resolution of seconds
#if BYTE_ORDER == LITTLE_ENDIAN
t_truncated = __bswap_32 (t_truncated);
#endif
memcpy(hdr->collectStartTime.buf, &t_truncated, 4);
hdr->fileFormatversion = NULL; hdr->fileFormatversion = NULL;
hdr->senderName = NULL; hdr->senderName = NULL;
hdr->senderType = NULL; hdr->senderType = NULL;
...@@ -1060,10 +1051,12 @@ void read_kpm_sm(kpm_ind_data_t* data) ...@@ -1060,10 +1051,12 @@ void read_kpm_sm(kpm_ind_data_t* data)
// TODO: assign labelInfo_len according to the action definition (?) // TODO: assign labelInfo_len according to the action definition (?)
info->labelInfo_len = 1; info->labelInfo_len = 1;
info->labelInfo = calloc(info->labelInfo_len, sizeof(adapter_LabelInfoList_t)); info->labelInfo = calloc(info->labelInfo_len, sizeof(adapter_LabelInfoItem_t));
adapter_LabelInfoList_t* label = &info->labelInfo[0]; assert(info->labelInfo != NULL && "memory exhausted");
adapter_LabelInfoItem_t* label = &info->labelInfo[0];
label->noLabel = calloc(1, sizeof(long)); label->noLabel = calloc(1, sizeof(long));
*(label->noLabel) = 1; assert(label->noLabel != NULL && "memory exhausted");
*(label->noLabel) = 0;
} }
} else { } else {
for (size_t i = 0; i < msg->MeasData_len; i++) { for (size_t i = 0; i < msg->MeasData_len; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment