Commit 9f699fcf authored by Teodora's avatar Teodora

Add node type in read_setup_ran function

parent 9207e134
...@@ -25,18 +25,66 @@ ...@@ -25,18 +25,66 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
void read_setup_ran(void* data) void read_setup_ran(void* data, const ngran_node_t node_type)
{ {
assert(data != NULL); assert(data != NULL);
#ifdef E2AP_V1 #ifdef E2AP_V1
#elif defined(E2AP_V2) || defined(E2AP_V3) #elif defined(E2AP_V2) || defined(E2AP_V3)
*((e2ap_node_component_config_add_t*)data) = fill_e2ap_node_component_config_add();
arr_node_component_config_add_t* dst = (arr_node_component_config_add_t*)data;
if(node_type == ngran_gNB){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CU){
dst->len_cca = 2;
dst->cca = calloc(2, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_DU){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// F1AP
dst->cca[0] = fill_f1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CUCP){
dst->len_cca = 3;
dst->cca = calloc(3, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
// E1AP
dst->cca[2] = fill_e1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_gNB_CUUP){
dst->len_cca = 3;
dst->cca = calloc(3, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// NGAP
dst->cca[0] = fill_ngap_e2ap_node_component_config_add();
// F1AP
dst->cca[1] = fill_f1ap_e2ap_node_component_config_add();
// E1AP
dst->cca[2] = fill_e1ap_e2ap_node_component_config_add();
} else if(node_type == ngran_eNB){
dst->len_cca = 1;
dst->cca = calloc(1, sizeof(e2ap_node_component_config_add_t));
assert(dst->cca != NULL);
// S1AP
dst->cca[0] = fill_s1ap_e2ap_node_component_config_add();
} else {
assert(0 != 0 && "Not implemented");
}
#else #else
static_assert(0!=0, "Unknown E2AP version"); static_assert(0!=0, "Unknown E2AP version");
#endif #endif
} }
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#ifndef READ_SETUP_RAN_E2_AGENT_H #ifndef READ_SETUP_RAN_E2_AGENT_H
#define READ_SETUP_RAN_E2_AGENT_H #define READ_SETUP_RAN_E2_AGENT_H
void read_setup_ran(void* data); #include "common/ngran_types.h"
void read_setup_ran(void* data, const ngran_node_t node_type);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment