diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c index 367b71fed5..0a19c953f8 100644 --- a/openair2/F1AP/f1ap_du_interface_management.c +++ b/openair2/F1AP/f1ap_du_interface_management.c @@ -37,6 +37,8 @@ #include "f1ap_du_interface_management.h" #include "assertions.h" +#include "GNB_APP/gnb_paramdef.h" + int to_NRNRB(int nrb) { for (int i=0; iextensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList; F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList; - asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, SliceSupport_item); - INT8_TO_OCTET_STRING(1,&SliceSupport_item->sNSSAI.sST); - asn1cCalloc(SliceSupport_item->sNSSAI.sD, tmp); - INT24_TO_OCTET_STRING(10203,tmp); - //INT24_TO_OCTET_STRING(1,tmp); - + /* get list of sst/sd from configuration file */ + paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC; + paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0}; + char sstr[100]; + /* TODO: be sure that %d in the line below is at the right place */ + sprintf(sstr, "%s.[%d].%s.[0]", GNB_CONFIG_STRING_GNB_LIST, i, GNB_CONFIG_STRING_PLMN_LIST); + config_getlist(&SNSSAIParamList, SNSSAIParams, sizeof(SNSSAIParams)/sizeof(paramdef_t), sstr); + AssertFatal(SNSSAIParamList.numelt > 0, "no slice configuration found (snssaiList in the configuration file)\n"); + AssertFatal(SNSSAIParamList.numelt <= 1024, "maximum size for slice support list is 1024, see F1AP 38.473 9.3.1.37\n"); + for (int s = 0; s < SNSSAIParamList.numelt; s++) { + uint32_t sst; + uint32_t sd; + bool has_sd; + sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr; + has_sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr != 0xffffff; + asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, slice); + INT8_TO_OCTET_STRING(sst, &slice->sNSSAI.sST); + if (has_sd) { + sd = *SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr; + asn1cCalloc(slice->sNSSAI.sD, tmp); + INT24_TO_OCTET_STRING(sd, tmp); + } + } + if (f1ap_req(false, instance)->fdd_flag) { // FDD nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD; asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);