Commit d4356efc authored by Cedric Roux's avatar Cedric Roux Committed by Raymond Knopp

f1 du: get list of sst/sd from configuration file

may not be the best place to get data from conf file, to be refined later
if needed
parent 0cacf29d
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include "f1ap_du_interface_management.h" #include "f1ap_du_interface_management.h"
#include "assertions.h" #include "assertions.h"
#include "GNB_APP/gnb_paramdef.h"
int to_NRNRB(int nrb) { int to_NRNRB(int nrb) {
for (int i=0; i<sizeofArray(nrb_lut); i++) for (int i=0; i<sizeofArray(nrb_lut); i++)
if (nrb_lut[i] == nrb) if (nrb_lut[i] == nrb)
...@@ -180,12 +182,30 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) { ...@@ -180,12 +182,30 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList; served_plmns_itemExtIEs->extensionValue.present = F1AP_ServedPLMNs_ItemExtIEs__extensionValue_PR_SliceSupportList;
F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList; F1AP_SliceSupportList_t *slice_support_list = &served_plmns_itemExtIEs->extensionValue.choice.SliceSupportList;
asn1cSequenceAdd(slice_support_list->list, F1AP_SliceSupportItem_t, SliceSupport_item); /* get list of sst/sd from configuration file */
INT8_TO_OCTET_STRING(1,&SliceSupport_item->sNSSAI.sST); paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
asn1cCalloc(SliceSupport_item->sNSSAI.sD, tmp); paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
INT24_TO_OCTET_STRING(10203,tmp); char sstr[100];
//INT24_TO_OCTET_STRING(1,tmp); /* 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 if (f1ap_req(false, instance)->fdd_flag) { // FDD
nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD; nR_Mode_Info->present = F1AP_NR_Mode_Info_PR_fDD;
asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info); asn1cCalloc(nR_Mode_Info->choice.fDD, fDD_Info);
......
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