Commit 9f092d00 authored by Sreeshma Shiv's avatar Sreeshma Shiv

XNAP setup Req/Resp

-Xn Setup,fix conflicts
-Sending XnSetup Response
-Sending XnSetup Request
-XnSetup-Updation of IEs,fixing comflicts
-XnSetup-Updation of neighbour cells limit,removal of exit on error when
target gNB is not reachable, cleanup
-XnSetup-Testing method addition
-XnSetup-Final cleanup
-Xnsetup-changes in config_get()
-CMake changes
-comments changes required- dec 30
parent c37974ca
......@@ -1458,7 +1458,7 @@ add_library(e1_if
target_link_libraries(e1_if PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap SECURITY ${OPENSSL_LIBRARIES} e1ap GTPV1U)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap ngap nr_rrc e1ap nr_rlc xnap)
if(E2_AGENT)
target_link_libraries(L2_NR PUBLIC e2_agent e2_ran_func)
target_compile_definitions(L2_NR PRIVATE ${E2AP_VERSION} ${KPM_VERSION})
......
......@@ -213,6 +213,7 @@ typedef enum {
LOCALIZE,
F1U,
X2AP,
XNAP,
M2AP,
M3AP,
NGAP,
......
......@@ -466,6 +466,27 @@ ID = LEGACY_X2AP_TRACE
GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_INFO
DESC = XNAP legacy logs - info level
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_INFO:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_ERROR
DESC = XNAP legacy logs - error level
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_ERROR:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_WARNING
DESC = XNAP legacy logs - warning level
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_WARNING:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_DEBUG
DESC = XNAP legacy logs - debug level
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_DEBUG:LEGACY
FORMAT = string,log
ID = LEGACY_XNAP_TRACE
DESC = XNAP legacy logs - trace level
GROUP = ALL:LEGACY_XNAP:LEGACY_GROUP_TRACE:LEGACY
FORMAT = string,log
ID = LEGACY_M2AP_INFO
DESC = M2AP legacy logs - info level
GROUP = ALL:LEGACY_M2AP:LEGACY_GROUP_INFO:LEGACY
......
......@@ -9,6 +9,7 @@
#endif
#include "openair2/COMMON/s1ap_messages_def.h"
#include "openair2/COMMON/x2ap_messages_def.h"
#include "openair2/COMMON/xnap_messages_def.h"
#include "openair2/COMMON/m2ap_messages_def.h"
#include "openair2/COMMON/m3ap_messages_def.h"
#include "openair2/COMMON/sctp_messages_def.h"
......
......@@ -227,6 +227,7 @@ typedef struct IttiMsgText_s {
#endif
#include <openair2/COMMON/s1ap_messages_types.h>
#include <openair2/COMMON/x2ap_messages_types.h>
#include <openair2/COMMON/xnap_messages_types.h>
#include <openair2/COMMON/m2ap_messages_types.h>
#include <openair2/COMMON/m3ap_messages_types.h>
#include <openair2/COMMON/sctp_messages_types.h>
......@@ -298,6 +299,7 @@ typedef struct {
TASK_DEF(TASK_S1AP, 200) \
TASK_DEF(TASK_NGAP, 200) \
TASK_DEF(TASK_X2AP, 200) \
TASK_DEF(TASK_XNAP, 200) \
TASK_DEF(TASK_M2AP_ENB, 200) \
TASK_DEF(TASK_M2AP_MCE, 200) \
TASK_DEF(TASK_M3AP, 200) \
......
......@@ -74,6 +74,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "executables/thread-common.h"
#include "NB_IoT_interface.h"
#include "x2ap_eNB.h"
#include "openair2/XNAP/xnap_gNB_task.h"
#include "ngap_gNB.h"
#include "gnb_paramdef.h"
#include <openair3/ocp-gtpu/gtp_itf.h>
......@@ -356,6 +357,14 @@ static int create_gNB_tasks(ngran_node_t node_type, configmodule_interface_t *cf
} else {
LOG_I(X2AP, "X2AP is disabled.\n");
}
if (is_xnap_enabled()) {
if (itti_create_task(TASK_XNAP, xnap_task, NULL) < 0) {
LOG_E(XNAP, "Create task for XNAP failed\n");
}
} else {
LOG_I(XNAP, "XNAP is disabled.\n");
}
}
if (get_softmodem_params()->sa &&
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_messages_def.h
* \author Sreeshma Shiv <sreeshmau@iisc.ac.in>
* \date August 2023
* \version 1.0
*/
/* gNB application layer -> XNAP messages */
MESSAGE_DEF(XNAP_REGISTER_GNB_REQ, MESSAGE_PRIORITY_MED, xnap_register_gnb_req_t, xnap_register_gnb_req)
/* XNAP -> gNB application layer messages */
/* handover messages XNAP <-> RRC */
MESSAGE_DEF(XNAP_SETUP_REQ, MESSAGE_PRIORITY_MED, xnap_setup_req_t, xnap_setup_req)
MESSAGE_DEF(XNAP_SETUP_RESP, MESSAGE_PRIORITY_MED, xnap_setup_resp_t, xnap_setup_resp)
MESSAGE_DEF(XNAP_SETUP_FAILURE, MESSAGE_PRIORITY_MED, xnap_setup_failure_t, xnap_setup_failure)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_messages_types.h
* \author Sreeshma Shiv <sreeshmau@iisc.ac.in>
* \date August 2023
* \version 1.0
*/
#ifndef XNAP_MESSAGES_TYPES_H_
#define XNAP_MESSAGES_TYPES_H_
// Defines to access message fields.
#define XNAP_REGISTER_GNB_REQ(mSGpTR) (mSGpTR)->ittiMsg.xnap_register_gnb_req
#define XNAP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.xnap_setup_req
#define XNAP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.xnap_setup_resp
#define XNAP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.xnap_setup_failure
#define XNAP_MAX_NB_GNB_IP_ADDRESS 4
// gNB application layer -> XNAP messages
typedef struct xnap_net_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
char ipv4_address[16];
char ipv6_address[46];
} xnap_net_ip_address_t;
typedef struct xnap_sctp_s {
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
} xnap_sctp_t;
typedef struct xnap_net_config_t {
uint8_t nb_xn;
xnap_net_ip_address_t gnb_xn_ip_address;
xnap_net_ip_address_t target_gnb_xn_ip_address[XNAP_MAX_NB_GNB_IP_ADDRESS];
uint32_t gnb_port_for_XNC;
xnap_sctp_t sctp_streams;
} xnap_net_config_t;
typedef struct xnap_plmn_t {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
} xnap_plmn_t;
typedef struct xnap_amf_regioninfo_s {
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_len;
uint8_t amf_region_id;
} xnap_amf_regioninfo_t;
typedef enum xnap_mode_t { XNAP_MODE_TDD = 0, XNAP_MODE_FDD = 1 } xnap_mode_t;
typedef struct xnap_nr_frequency_info_t {
uint32_t arfcn;
int band;
} xnap_nr_frequency_info_t;
typedef struct xnap_transmission_bandwidth_t {
uint8_t scs;
uint16_t nrb;
} xnap_transmission_bandwidth_t;
typedef struct xnap_fdd_info_t {
xnap_nr_frequency_info_t ul_freqinfo;
xnap_nr_frequency_info_t dl_freqinfo;
xnap_transmission_bandwidth_t ul_tbw;
xnap_transmission_bandwidth_t dl_tbw;
} xnap_fdd_info_t;
typedef struct xnap_tdd_info_t {
xnap_nr_frequency_info_t freqinfo;
xnap_transmission_bandwidth_t tbw;
} xnap_tdd_info_t;
typedef struct xnap_snssai_s {
uint8_t sst;
uint8_t sd;
} xnap_snssai_t;
typedef struct xnap_served_cell_info_t {
// NR CGI
xnap_plmn_t plmn;
uint64_t nr_cellid; // NR Global Cell Id
uint16_t nr_pci;// NR Physical Cell Ids
/* Tracking area code */
uint32_t tac;
xnap_mode_t mode;
union {
xnap_fdd_info_t fdd;
xnap_tdd_info_t tdd;
};
char *measurement_timing_information;
} xnap_served_cell_info_t;
typedef struct xnap_setup_req_s {
uint64_t gNB_id;
/* Tracking area code */
uint16_t num_tai;
uint32_t tai_support;
xnap_plmn_t plmn_support;
// Number of slide support items
uint16_t num_snssai;
xnap_snssai_t snssai[2];
xnap_amf_regioninfo_t amf_region_info;
uint8_t num_cells_available;
xnap_served_cell_info_t info;
} xnap_setup_req_t;
typedef struct xnap_setup_resp_s {
int64_t gNB_id;
/* Tracking area code */
uint16_t num_tai;
uint32_t tai_support;
xnap_plmn_t plmn_support;
// Number of slide support items
uint16_t num_ssi;
uint8_t sst;
uint8_t sd;
uint16_t nb_xn;//number of gNBs connected
xnap_served_cell_info_t info;
} xnap_setup_resp_t;
typedef struct xnap_register_gnb_req_s {
xnap_setup_req_t setup_req;
xnap_net_config_t net_config;
char *gNB_name;
} xnap_register_gnb_req_t;
typedef enum xnap_Cause_e {
XNAP_CAUSE_NOTHING, /* No components present */
XNAP_CAUSE_RADIO_NETWORK,
XNAP_CAUSE_TRANSPORT,
XNAP_CAUSE_PROTOCOL,
XNAP_CAUSE_MISC,
} xnap_Cause_t;
typedef struct xnap_setup_failure_s {
long cause_value;
xnap_Cause_t cause_type;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
} xnap_setup_failure_t;
#endif /* XNAP_MESSAGES_TYPES_H_ */
......@@ -39,6 +39,7 @@
#include "common/utils/LOG/log.h"
#include "openair2/XNAP/xnap_gNB_task.h"
#include "x2ap_eNB.h"
#include "intertask_interface.h"
#include "ngap_gNB.h"
......@@ -59,6 +60,7 @@ extern unsigned char NB_gNB_INST;
extern RAN_CONTEXT_t RC;
#define GNB_REGISTER_RETRY_DELAY 10
#define XNAP_GNB_REGISTER_RETRY_DELAY 10
/*------------------------------------------------------------------------------*/
......@@ -116,6 +118,21 @@ uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) {
}
/*------------------------------------------------------------------------------*/
void gNB_app_register_xn(uint32_t gnb_id_num)
{
MessageDef *msg;
for (uint32_t gnb_id = 0; (gnb_id < gnb_id_num); gnb_id++) {
msg = itti_alloc_new_message(TASK_GNB_APP, 0, XNAP_REGISTER_GNB_REQ);
LOG_I(XNAP, "GNB_ID: %d \n", gnb_id);
uint64_t id;
char *name = NULL;
read_xn_setup(&id, &name, &XNAP_REGISTER_GNB_REQ(msg).setup_req);
XNAP_REGISTER_GNB_REQ(msg).net_config = Read_IPconfig_Xn();
XNAP_REGISTER_GNB_REQ(msg).gNB_name = name;
itti_send_msg_to_task(TASK_XNAP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg);
}
}
void *gNB_app_task(void *args_p)
{
......@@ -128,6 +145,11 @@ void *gNB_app_task(void *args_p)
(void)instance;
int cell_to_activate = 0;
if (is_xnap_enabled()) {
gNB_app_register_xn (RC.nb_nr_inst);
}
itti_mark_task_ready (TASK_GNB_APP);
ngran_node_t node_type = get_node_type();
......
......@@ -35,4 +35,5 @@
void *gNB_app_task(void *args_p);
uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end);
uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end);
void gNB_app_register_xn(uint32_t gnb_id_num);
#endif /* GNB_APP_H_ */
......@@ -1086,7 +1086,7 @@ static int read_du_cell_info(configmodule_interface_t *cfg,
}
*name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
info->tac = malloc(sizeof(*info->tac));
info->tac = calloc(1,sizeof(*info->tac));
AssertFatal(info->tac != NULL, "out of memory\n");
*info->tac = *GNBParamList.paramarray[0][GNB_TRACKING_AREA_CODE_IDX].uptr;
info->plmn.mcc = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
......@@ -2227,6 +2227,147 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
return(ret);
}
void read_xn_setup(uint64_t *id, char **name, xnap_setup_req_t *req)
{
memset(req, 0, sizeof(*req));
xnap_served_cell_info_t *info = &req->info;
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
paramdef_t GNBParams[] = GNBPARAMS_DESC;
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST, NULL, 0};
config_get(config_get_if(), GNBSParams, sizeofArray(GNBSParams), NULL);
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
AssertFatal(num_gnbs == 1, "Failed to parse config file\n");
// Output a list of all gNBs.
config_getlist(config_get_if(), &GNBParamList, GNBParams, sizeof(GNBParams) / sizeof(paramdef_t), NULL);
AssertFatal(config_isparamset(GNBParamList.paramarray[0], GNB_GNB_ID_IDX),
"%s is not defined in configuration file\n",
GNB_CONFIG_STRING_GNB_ID);
*id = *GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr;
AssertFatal(strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[0], *GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr) == 0,
"no active gNB found/mismatch of gNBs: %s vs %s\n",
GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[0],
*GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr);
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
sprintf(aprefix, "%s.[0]", GNB_CONFIG_STRING_GNB_LIST);
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
/* map parameter checking array instances to parameter definition array instances */
checkedparam_t config_check_PLMNParams[] = PLMNPARAMS_CHECK;
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
config_getlist(config_get_if(), &PLMNParamList, PLMNParams, sizeofArray(PLMNParams), aprefix);
*name = strdup(*(GNBParamList.paramarray[0][GNB_GNB_NAME_IDX].strptr));
info->tac = *GNBParamList.paramarray[0][GNB_TRACKING_AREA_CODE_IDX].uptr;
info->plmn.mcc = *PLMNParamList.paramarray[0][GNB_MOBILE_COUNTRY_CODE_IDX].uptr;
info->plmn.mnc = *PLMNParamList.paramarray[0][GNB_MOBILE_NETWORK_CODE_IDX].uptr;
info->plmn.mnc_digit_length = *PLMNParamList.paramarray[0][GNB_MNC_DIGIT_LENGTH].u8ptr;
AssertFatal((info->plmn.mnc_digit_length == 2) || (info->plmn.mnc_digit_length == 3),
"BAD MNC DIGIT LENGTH %d",
info->plmn.mnc_digit_length);
info->nr_cellid = (uint64_t) * (GNBParamList.paramarray[0][GNB_NRCELLID_IDX].u64ptr);
paramdef_t SNSSAIParams[] = GNBSNSSAIPARAMS_DESC;
checkedparam_t config_check_SNSSAIParams[] = SNSSAIPARAMS_CHECK;
for (int J = 0; J < sizeofArray(SNSSAIParams); ++J)
SNSSAIParams[J].chkPptr = &(config_check_SNSSAIParams[J]);
paramlist_def_t SNSSAIParamList = {GNB_CONFIG_STRING_SNSSAI_LIST, NULL, 0};
config_getlist(config_get_if(), &SNSSAIParamList, SNSSAIParams, sizeofArray(SNSSAIParams), aprefix);
req->num_snssai = SNSSAIParamList.numelt;
for (int s = 0; s < SNSSAIParamList.numelt; ++s) {
req->snssai[s].sst = *SNSSAIParamList.paramarray[s][GNB_SLICE_SERVICE_TYPE_IDX].uptr;
req->snssai[s].sd = (*SNSSAIParamList.paramarray[s][GNB_SLICE_DIFFERENTIATOR_IDX].uptr & 0xffffff);
}
NR_ServingCellConfigCommon_t *scc = get_scc_config(config_get_if(), 6);
info->nr_pci = *scc->physCellId;
struct NR_FrequencyInfoDL *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
if (scc->tdd_UL_DL_ConfigurationCommon) {
info->mode = XNAP_MODE_TDD;
xnap_tdd_info_t *tdd = &info->tdd;
tdd->freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
tdd->tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
tdd->tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
tdd->freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];
} else {
info->mode = XNAP_MODE_FDD;
xnap_fdd_info_t *fdd = &info->fdd;
fdd->dl_freqinfo.arfcn = frequencyInfoDL->absoluteFrequencyPointA;
fdd->ul_freqinfo.arfcn = *scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA;
fdd->dl_tbw.scs = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->ul_tbw.scs = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
fdd->dl_tbw.nrb = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->ul_tbw.nrb = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
fdd->dl_freqinfo.band = *frequencyInfoDL->frequencyBandList.list.array[0];
fdd->ul_freqinfo.band = *scc->uplinkConfigCommon->frequencyInfoUL->frequencyBandList->list.array[0];
}
info->measurement_timing_information = "0";
req->gNB_id = *id;
req->tai_support = info->tac;
req->plmn_support = info->plmn;
}
xnap_net_config_t Read_IPconfig_Xn(void)
{
char *cidr = NULL;
char *address = NULL;
char *gnb_ipv4_address_for_NGU = NULL;
uint32_t gnb_port_for_NGU = 0;
char *gnb_ipv4_address_for_S1U = NULL;
uint32_t gnb_port_for_S1U = 0;
xnap_net_config_t nc = {0};
paramdef_t XnParams[] = XnPARAMS_DESC;
paramlist_def_t XnParamList = {GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS, NULL, 0};
paramdef_t NETParams[] = GNBNETPARAMS_DESC;
paramdef_t SCTPParams[] = GNBSCTPPARAMS_DESC;
char aprefix[MAX_OPTNAME_SIZE * 2 + 8];
config_getlist(config_get_if(), &XnParamList, XnParams, sizeofArray(XnParams), aprefix);
AssertFatal(XnParamList.numelt <= XNAP_MAX_NB_GNB_IP_ADDRESS,
"value of XnParamList.numelt %d must be lower than XnAP_MAX_NB_GNB_IP_ADDRESS %d value: reconsider to increase "
"XNAP_MAX_NB_GNB_IP_ADDRESS\n",
XnParamList.numelt,
XNAP_MAX_NB_GNB_IP_ADDRESS);
for (int l = 0; l < XnParamList.numelt; l++) {
nc.nb_xn += 1;
strcpy(nc.target_gnb_xn_ip_address[l].ipv4_address, *(XnParamList.paramarray[l][GNB_Xn_IPV4_ADDRESS_IDX].strptr));
strcpy(nc.target_gnb_xn_ip_address[l].ipv6_address, *(XnParamList.paramarray[l][GNB_Xn_IPV6_ADDRESS_IDX].strptr));
if (strcmp(*(XnParamList.paramarray[l][GNB_Xn_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
nc.target_gnb_xn_ip_address[l].ipv4 = 1;
nc.target_gnb_xn_ip_address[l].ipv6 = 0;
} else if (strcmp(*(XnParamList.paramarray[l][GNB_Xn_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv6") == 0) {
nc.target_gnb_xn_ip_address[l].ipv4 = 0;
nc.target_gnb_xn_ip_address[l].ipv6 = 1;
} else if (strcmp(*(XnParamList.paramarray[l][GNB_Xn_IP_ADDRESS_PREFERENCE_IDX].strptr), "no") == 0) {
nc.target_gnb_xn_ip_address[l].ipv4 = 1;
nc.target_gnb_xn_ip_address[l].ipv6 = 1;
}
}
sprintf(aprefix, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
// NETWORK_INTERFACES
config_get(config_get_if(), NETParams, sizeofArray(NETParams), aprefix);
nc.gnb_port_for_XNC = (uint32_t) * (NETParams[GNB_PORT_FOR_XNC_IDX].uptr);
if ((NETParams[GNB_IPV4_ADDR_FOR_XNC_IDX].strptr == NULL) || (nc.gnb_port_for_XNC == 0)) {
LOG_E(RRC, "Add gNB IPv4 address and/or port for XNC in the CONF file!\n");
exit(1);
}
cidr = *(NETParams[GNB_IPV4_ADDR_FOR_XNC_IDX].strptr);
char *save = NULL;
address = strtok_r(cidr, "/", &save);
nc.gnb_xn_ip_address.ipv6 = 0;
nc.gnb_xn_ip_address.ipv4 = 1;
strcpy(nc.gnb_xn_ip_address.ipv4_address, address);
// SCTP SETTING
nc.sctp_streams.sctp_out_streams = SCTP_OUT_STREAMS;
nc.sctp_streams.sctp_in_streams = SCTP_IN_STREAMS;
if (get_softmodem_params()->sa) {
// sprintf(aprefix, "%s.[%i].%s", GNB_CONFIG_STRING_GNB_LIST, 0, GNB_CONFIG_STRING_SCTP_CONFIG);
config_get(config_get_if(), SCTPParams, sizeofArray(SCTPParams), aprefix);
nc.sctp_streams.sctp_in_streams = (uint16_t) * (SCTPParams[GNB_SCTP_INSTREAMS_IDX].uptr);
nc.sctp_streams.sctp_out_streams = (uint16_t) * (SCTPParams[GNB_SCTP_OUTSTREAMS_IDX].uptr);
}
return nc;
}
ngran_node_t get_node_type(void)
{
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
......
......@@ -108,6 +108,8 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i);
void wait_f1_setup_response(void);
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
MessageDef *RCconfig_NR_CU_E1(const E1_t *entity);
void read_xn_setup(uint64_t *id, char **name, xnap_setup_req_t *req);
xnap_net_config_t Read_IPconfig_Xn(void);
ngran_node_t get_node_type(void);
#ifdef E2_AGENT
......
......@@ -131,6 +131,7 @@ typedef enum {
#define GNB_CONFIG_STRING_GNB_DU_ID "gNB_DU_ID"
#define GNB_CONFIG_STRING_GNB_CU_UP_ID "gNB_CU_UP_ID"
#define GNB_CONFIG_STRING_XN "enable_xn"
#define GNB_CONFIG_HLP_STRING_ENABLE_SDAP "enable the SDAP layer\n"
#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support"
#define GNB_CONFIG_HLP_STRING_DRBS "Number of total DRBs to establish, including the mandatory for PDU SEssion (default=1)\n"
......@@ -345,6 +346,8 @@ typedef enum {
#define GNB_PORT_FOR_NGU_IDX 4
#define GNB_IPV4_ADDR_FOR_X2C_IDX 5
#define GNB_PORT_FOR_X2C_IDX 6
#define GNB_IPV4_ADDR_FOR_XNC_IDX 7
#define GNB_PORT_FOR_XNC_IDX 8
/* S1 interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1_MME "GNB_INTERFACE_NAME_FOR_S1_MME"
......@@ -363,6 +366,10 @@ typedef enum {
#define GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C "GNB_IPV4_ADDRESS_FOR_X2C"
#define GNB_CONFIG_STRING_ENB_PORT_FOR_X2C "GNB_PORT_FOR_X2C"
/* Xn interface configuration parameters names */
#define GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_XNC "GNB_IPV4_ADDRESS_FOR_XNC"
#define GNB_CONFIG_STRING_GNB_PORT_FOR_XNC "GNB_PORT_FOR_XNC"
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
/* S1 interface configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......@@ -375,6 +382,8 @@ typedef enum {
{GNB_CONFIG_STRING_GNB_PORT_FOR_NGU, NULL, 0, .uptr=&gnb_port_for_NGU, .defintval=2152L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, .uptr=NULL, .defintval=0L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDR_FOR_XNC, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_XNC, NULL, 0, .uptr=NULL, .defintval=0L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_GNB_INTERFACE_NAME_FOR_S1U, NULL, 0, .strptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_IPV4_ADDRESS_FOR_S1U, NULL, 0, .strptr=&gnb_ipv4_address_for_S1U, .defstrval="127.0.0.1",TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_GNB_PORT_FOR_S1U, NULL, 0, .uptr=&gnb_port_for_S1U, .defintval=2152L, TYPE_UINT, 0} \
......@@ -382,6 +391,29 @@ typedef enum {
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Xn configuration parameters section name */
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS "target_gnb_xn_ip_address"
/* Xn configuration parameters names */
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV4_ADDRESS "ipv4"
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV6_ADDRESS "ipv6"
#define GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_PREFERENCE "preference"
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* Xn configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define XnPARAMS_DESC { \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV4_ADDRESS, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IPV6_ADDRESS, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_TARGET_GNB_Xn_IP_ADDRESS_PREFERENCE, NULL, 0, .uptr=NULL, .defstrval=NULL, TYPE_STRING, 0}, \
}
#define GNB_Xn_IPV4_ADDRESS_IDX 0
#define GNB_Xn_IPV6_ADDRESS_IDX 1
#define GNB_Xn_IP_ADDRESS_PREFERENCE_IDX 2
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/* E1 configuration section */
#define GNB_CONFIG_STRING_E1_PARAMETERS "E1_INTERFACE"
......
......@@ -96,6 +96,8 @@
#define NR_UE_MODULE_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!!
#define NR_UE_INDEX_INVALID ((module_id_t) ~0) // FIXME attention! depends on type uint8_t!!! used to be -1
#define MAX_NUM_NR_NEIGH_CELLs 6 /* maximum neighbouring cells number */
typedef enum {
NR_RRC_OK=0,
NR_RRC_ConnSetup_failed,
......@@ -405,6 +407,9 @@ typedef struct gNB_RRC_INST_s {
char *uecap_file;
// Neighborouring cells id
int num_nr_neigh_cells;
uint32_t nr_neigh_cells_id[MAX_NUM_NR_NEIGH_CELLs];
// security configuration (preferred algorithms)
nr_security_configuration_t security;
......
......@@ -98,7 +98,6 @@
#include "openair2/F1AP/f1ap_ids.h"
#include "openair2/SDAP/nr_sdap/nr_sdap_entity.h"
#include "cucp_cuup_if.h"
#include "BIT_STRING.h"
#include "assertions.h"
......@@ -2182,6 +2181,38 @@ void rrc_gNB_process_e1_bearer_context_release_cplt(const e1ap_bearer_release_cp
LOG_I(RRC, "UE %d: received bearer release complete\n", cplt->gNB_cu_cp_ue_id);
}
void rrc_gNB_process_xn_setup_request(sctp_assoc_t assoc_id, xnap_setup_req_t *m)
{
if (RC.nrrrc[0]->num_nr_neigh_cells > MAX_NUM_NR_NEIGH_CELLs) {
LOG_E(NR_RRC, "Error: number of neighbouring cells is exceeded \n");
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, XNAP_SETUP_FAILURE);
msg->ittiMsgHeader.originInstance = assoc_id;
xnap_setup_failure_t *xnap_msg = &XNAP_SETUP_FAILURE(msg);
xnap_msg->cause_type = XNAP_CAUSE_PROTOCOL;
xnap_msg->cause_value = 6; //XNAP_CauseProtocol_unspecified;
itti_send_msg_to_task(TASK_XNAP, 0, msg);
}
RC.nrrrc[0]->num_nr_neigh_cells++;
RC.nrrrc[0]->nr_neigh_cells_id[RC.nrrrc[0]->num_nr_neigh_cells - 1] = m->info.nr_pci;
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, XNAP_SETUP_RESP);
msg->ittiMsgHeader.originInstance = assoc_id;
xnap_setup_resp_t *xnap_msg = &XNAP_SETUP_RESP(msg);
xnap_msg->gNB_id = m->gNB_id;
xnap_msg->info = m->info;//add all required
itti_send_msg_to_task(TASK_XNAP, 0, msg);
}
void rrc_gNB_process_xn_setup_response(sctp_assoc_t assoc_id, xnap_setup_resp_t *m)
{
if (RC.nrrrc[0]->num_nr_neigh_cells > MAX_NUM_NR_NEIGH_CELLs) {
LOG_E(RRC, "Error: number of neighbouring cells is exceeded \n");
return;
}
RC.nrrrc[0]->num_nr_neigh_cells++;
RC.nrrrc[0]->nr_neigh_cells_id[RC.nrrrc[0]->num_nr_neigh_cells - 1] = m->info.nr_pci;
}
static void print_rrc_meas(FILE *f, const NR_MeasResults_t *measresults)
{
DevAssert(measresults->measResultServingMOList.list.count >= 1);
......@@ -2301,7 +2332,7 @@ void *rrc_gnb_task(void *args_p) {
/* timer to write stats to file */
timer_setup(1, 0, TASK_RRC_GNB, 0, TIMER_PERIODIC, NULL, &stats_timer_id);
}
itti_mark_task_ready(TASK_RRC_GNB);
LOG_I(NR_RRC,"Entering main loop of NR_RRC message task\n");
......@@ -2405,6 +2436,15 @@ void *rrc_gnb_task(void *args_p) {
rrc_CU_process_f1_lost_connection(RC.nrrrc[0], &F1AP_LOST_CONNECTION(msg_p), msg_p->ittiMsgHeader.originInstance);
break;
/*Messages from XNAP*/
case XNAP_SETUP_RESP:
rrc_gNB_process_xn_setup_response(ITTI_MSG_ORIGIN_INSTANCE(msg_p), &XNAP_SETUP_RESP(msg_p));
break;
case XNAP_SETUP_REQ:
rrc_gNB_process_xn_setup_request(ITTI_MSG_ORIGIN_INSTANCE(msg_p), &XNAP_SETUP_REQ(msg_p));
break;
/* Messages from X2AP */
case X2AP_ENDC_SGNB_ADDITION_REQ:
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
......
add_subdirectory(MESSAGES)
add_library(xnap xnap_common.c)
add_library(xnap
xnap_common.c
xnap_gNB_task.c
xnap_gNB_management_procedures.c
xnap_gNB_itti_messaging.c
xnap_gNB_handler.c
xnap_gNB_interface_management.c
xnap_gNB_generate_messages)
target_link_libraries(xnap
PUBLIC asn1_xnap
PRIVATE nr_rrc)
......
......@@ -19,30 +19,55 @@
* contact@openairinterface.org
*/
/*! \file xnap_common.c
* \brief xnap encoder,decoder dunctions for gNB
* \author Sreeshma Shiv <sreeshmau@iisc.ac.in>
* \date Dec 2023
* \version 1.0
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "xnap_common.h"
#include "XNAP_XnAP-PDU.h"
ssize_t XNAP_generate_initiating_message(uint8_t **buffer,
uint32_t *length,
XNAP_ProcedureCode_t procedureCode,
XNAP_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
int xnap_gNB_encode_pdu(XNAP_XnAP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
XNAP_XnAP_PDU_t pdu;
ssize_t encoded;
memset(&pdu, 0, sizeof(XNAP_XnAP_PDU_t));
pdu.present = XNAP_XnAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage->procedureCode = procedureCode;
pdu.choice.initiatingMessage->criticality = criticality;
ANY_fromType_aper((ANY_t *)&pdu.choice.initiatingMessage->value, td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_XNAP_XnAP_PDU, 0, &pdu, (void **)buffer)) < 0) {
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
DevAssert(len != NULL);
xer_fprint(stdout, &asn_DEF_XNAP_XnAP_PDU, (void *)pdu);
encoded = aper_encode_to_new_buffer(&asn_DEF_XNAP_XnAP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
return -1;
}
*length = encoded;
*len = encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, pdu);
return encoded;
}
int xnap_gNB_decode_pdu(XNAP_XnAP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL, &asn_DEF_XNAP_XnAP_PDU, (void **)&pdu, buffer, length, 0, 0);
xer_fprint(stdout, &asn_DEF_XNAP_XnAP_PDU, pdu);
if (dec_ret.code != RC_OK) {
LOG_E(XNAP, "Failed to decode PDU\n");
return -1;
}
return 0;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
* the OAI Public License, Version 1.1 (the "License"); you may not use this
*file except in compliance with the License. You may obtain a copy of the
*License at
*
* http://www.openairinterface.org/?page_id=698
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
......@@ -23,22 +20,26 @@
#ifndef XNAP_COMMON_H_
#define XNAP_COMMON_H_
#include "XNAP_XnAP-PDU.h"
#include "intertask_interface.h"
#include "common/openairinterface5g_limits.h"
#include "oai_asn1.h"
#include "XNAP_ProtocolIE-Field.h"
#include "XNAP_InitiatingMessage.h"
#include "XNAP_ProtocolIE-ContainerPair.h"
#include "XNAP_ProtocolExtensionField.h"
#include "XNAP_ProtocolExtensionContainer.h"
#include "XNAP_ProtocolExtensionField.h"
#include "XNAP_ProtocolIE-ContainerPair.h"
#include "XNAP_ProtocolIE-Field.h"
#include "XNAP_ProtocolIE-FieldPair.h"
#include "XNAP_SuccessfulOutcome.h"
#include "XNAP_UnsuccessfulOutcome.h"
#include "XNAP_XnAP-PDU.h"
#include "XNAP_asn_constant.h"
#include "common/openairinterface5g_limits.h"
#include "intertask_interface.h"
#include "oai_asn1.h"
#ifndef XNAP_PORT
#define XNAP_PORT 38422
#define XNAP_PORT 38423
#endif
extern int asn1_xer_print;
#define XNAP_FIND_PROTOCOLIE_BY_ID(IE_TYPE, ie, container, IE_ID, mandatory) \
do { \
IE_TYPE **ptr; \
......@@ -54,11 +55,7 @@
DevAssert(ie != NULL); \
} while (0)
ssize_t xnap_generate_initiating_message(uint8_t **buffer,
uint32_t *length,
XNAP_ProcedureCode_t procedureCode,
XNAP_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr);
typedef int (*xnap_message_decoded_callback)(instance_t instance, sctp_assoc_t assocId, uint32_t stream, XNAP_XnAP_PDU_t *pdu);
int xnap_gNB_decode_pdu(XNAP_XnAP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) __attribute__((warn_unused_result));
int xnap_gNB_encode_pdu(XNAP_XnAP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) __attribute__((warn_unused_result));
#endif /* XNAP_COMMON_H_ */
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdint.h>
#include "queue.h"
#include "tree.h"
#include "sctp_eNB_defs.h"
#include "xnap_messages_types.h"
#ifndef XNAP_GNB_DEFS_H_
#define XNAP_GNB_DEFS_H_
#define XNAP_GNB_NAME_LENGTH_MAX (150)
typedef enum {
/* Disconnected state: initial state for any association. */
XNAP_GNB_STATE_DISCONNECTED = 0x0,
/* State waiting for xn Setup response message if the target gNB accepts or
* Xn Setup failure if rejects the gNB.
*/
XNAP_GNB_STATE_WAITING = 0x1,
/* The gNB is successfully connected to another gNB. */
XNAP_GNB_STATE_CONNECTED = 0x2,
/* XnAP is ready, and the gNB is successfully connected to another gNB. */
XNAP_GNB_STATE_READY = 0x3,
XNAP_GNB_STATE_OVERLOAD = 0x4,
XNAP_GNB_STATE_RESETTING = 0x5,
/* Max number of states available */
XNAP_GNB_STATE_MAX,
} xnap_gNB_state_t;
struct xnap_gNB_instance_s;
/* This structure describes association of gNBs over Xn */
typedef struct xnap_gNB_data_t {
/* gNB descriptors tree, ordered by sctp assoc id */
RB_ENTRY(xnap_gNB_data_t) entry;
char *gNB_name;
/* target gNB ID */
uint64_t gNB_id;
/* Current gNB->gNB XnAP association state */
xnap_gNB_state_t state;
/* Number of input/ouput streams */
uint16_t in_streams;
uint16_t out_streams;
/* Connexion id used between SCTP/XNAP */
uint16_t cnx_id;
/* SCTP association id */
sctp_assoc_t assoc_id;
} xnap_gNB_data_t;
typedef struct xnap_gNB_instance_s {
/* Number of target gNBs requested by gNB (tree size) */
uint32_t xn_target_gnb_nb;
/* Number of target gNBs for which association is pending */
uint32_t xn_target_gnb_pending_nb;
/* Number of target gNB successfully associated to gNB */
uint32_t xn_target_gnb_associated_nb;
/* Tree of XNAP gNB associations ordered by association ID */
RB_HEAD(xnap_gnb_tree, xnap_gNB_data_t) xnap_gnbs; // gNBs, indexed by assoc_id
size_t num_gnbs;
instance_t instance;
xnap_setup_req_t setup_req;
/* The gNB IP address to bind */
xnap_net_config_t net_config;
/* SCTP information */
xnap_sctp_t sctp_streams;
char *gNB_name;
} xnap_gNB_instance_t;
#endif /* XNAP_GNB_DEFS_H_ */
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_generate_messages.h
* \brief xnap procedures for gNB
* \date 2023 July
* \version 1.0
*/
#ifndef XNAP_GNB_GENERATE_MESSAGES_H_
#define XNAP_GNB_GENERATE_MESSAGES_H_
#include "xnap_gNB_defs.h"
#include "xnap_common.h"
int xnap_gNB_generate_xn_setup_request(sctp_assoc_t assoc_id, xnap_setup_req_t *req);
int xnap_gNB_generate_xn_setup_response(sctp_assoc_t assoc_id, xnap_setup_resp_t *resp);
int xnap_gNB_generate_xn_setup_failure(sctp_assoc_t assoc_id, xnap_setup_failure_t *fail);
int xnap_gNB_set_cause(XNAP_Cause_t *cause_p, XNAP_Cause_PR cause_type, long cause_value);
#endif /* XNAP_GNB_GENERATE_MESSAGES_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_handler.c
* \brief xnap handler procedures for gNB
* \author Sreeshma Shiv <sreeshmau@iisc.ac.in>
* \date August 2023
* \version 1.0
*/
#include <stdint.h>
#include "intertask_interface.h"
#include "xnap_common.h"
#include "xnap_gNB_defs.h"
#include "xnap_gNB_handler.h"
#include "xnap_gNB_interface_management.h"
#include "assertions.h"
#include "conversions.h"
/* Placement of callback functions according to XNAP_ProcedureCode.h */
static const xnap_message_decoded_callback xnap_messages_callback[][3] = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{xnap_gNB_handle_xn_setup_request, xnap_gNB_handle_xn_setup_response, xnap_gNB_handle_xn_setup_failure}, /* xnSetup */
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}};
static const char *const xnap_direction_String[] = {
"", /* Nothing */
"Originating message", /* originating message */
"Successfull outcome", /* successfull outcome */
"UnSuccessfull outcome", /* successfull outcome */
};
const char *xnap_direction2String(int xnap_dir)
{
return (xnap_direction_String[xnap_dir]);
}
int xnap_gNB_handle_message(instance_t instance,
sctp_assoc_t assoc_id,
int32_t stream,
const uint8_t *const data,
const uint32_t data_length)
{
XNAP_XnAP_PDU_t pdu;
int ret = 0;
DevAssert(data != NULL);
memset(&pdu, 0, sizeof(pdu));
printf("Data length received: %d\n", data_length);
if (xnap_gNB_decode_pdu(&pdu, data, data_length) < 0) {
LOG_E(XNAP, "Failed to decode PDU\n");
return -1;
}
switch (pdu.present) {
case XNAP_XnAP_PDU_PR_initiatingMessage:
LOG_I(XNAP, "xnap_gNB_decode_initiating_message!\n");
/* Checking procedure Code and direction of message */
if (pdu.choice.initiatingMessage->procedureCode
>= sizeof(xnap_messages_callback) / (3 * sizeof(xnap_message_decoded_callback))) {
//|| (pdu.present > XNAP_XnAP_PDU_PR_unsuccessfulOutcome)) {
LOG_E(XNAP, "[SCTP %d] Either procedureCode %ld exceed expected\n", assoc_id, pdu.choice.initiatingMessage->procedureCode);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* No handler present */
if (xnap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1] == NULL) {
LOG_E(XNAP,
"[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id,
pdu.choice.initiatingMessage->procedureCode,
xnap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* Calling the right handler */
ret =
(*xnap_messages_callback[pdu.choice.initiatingMessage->procedureCode][pdu.present - 1])(instance, assoc_id, stream, &pdu);
break;
case XNAP_XnAP_PDU_PR_successfulOutcome:
LOG_I(XNAP, "xnap_gNB_decode_successfuloutcome_message!\n");
/* Checking procedure Code and direction of message */
if (pdu.choice.successfulOutcome->procedureCode
>= sizeof(xnap_messages_callback) / (3 * sizeof(xnap_message_decoded_callback))) {
LOG_E(XNAP, "[SCTP %d] Either procedureCode %ld exceed expected\n", assoc_id, pdu.choice.successfulOutcome->procedureCode);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* No handler present.*/
if (xnap_messages_callback[pdu.choice.successfulOutcome->procedureCode][pdu.present - 1] == NULL) {
LOG_E(XNAP,
"[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id,
pdu.choice.successfulOutcome->procedureCode,
xnap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* Calling the right handler */
ret =
(*xnap_messages_callback[pdu.choice.successfulOutcome->procedureCode][pdu.present - 1])(instance, assoc_id, stream, &pdu);
break;
case XNAP_XnAP_PDU_PR_unsuccessfulOutcome:
LOG_I(XNAP, "xnap_gNB_decode_unsuccessfuloutcome_message!\n");
/* Checking procedure Code and direction of message */
if (pdu.choice.unsuccessfulOutcome->procedureCode
>= sizeof(xnap_messages_callback) / (3 * sizeof(xnap_message_decoded_callback))) {
LOG_E(XNAP,
"[SCTP %d] Either procedureCode %ld exceed expected\n",
assoc_id,
pdu.choice.unsuccessfulOutcome->procedureCode);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* No handler present */
if (xnap_messages_callback[pdu.choice.unsuccessfulOutcome->procedureCode][pdu.present - 1] == NULL) {
LOG_E(XNAP,
"[SCTP %d] No handler for procedureCode %ld in %s\n",
assoc_id,
pdu.choice.unsuccessfulOutcome->procedureCode,
xnap_direction2String(pdu.present - 1));
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return -1;
}
/* Calling the right handler */
ret = (*xnap_messages_callback[pdu.choice.unsuccessfulOutcome->procedureCode][pdu.present - 1])(instance,
assoc_id,
stream,
&pdu);
break;
default:
LOG_E(XNAP, "[SCTP %d] Direction %d exceed expected\n", assoc_id, pdu.present);
break;
}
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_XNAP_XnAP_PDU, &pdu);
return ret;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_handler.h
* \brief xnap handler procedures for gNB
* \date 2023 July
* \version 1.0
*/
#ifndef XNAP_GNB_HANDLERS_H_
#define XNAP_GNB_HANDLERS_H_
#include "xnap_gNB_defs.h"
int xnap_gNB_handle_message(instance_t instance,
sctp_assoc_t assoc_id,
int32_t stream,
const uint8_t *const data,
const uint32_t data_length);
#endif /* XNAP_GNB_HANDLERS_H_ */
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_interface_management.h
* \brief xnap interface handler procedures for gNB
* \date 2023 Dec
* \version 1.0
*/
#ifndef XNAP_GNB_INTERFACE_MANAGEMENT_H_
#define XNAP_GNB_INTERFACE_MANAGEMENT_H_
/*Xn Setup*/
int xnap_gNB_handle_xn_setup_request(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, XNAP_XnAP_PDU_t *pdu);
int xnap_gNB_handle_xn_setup_response(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, XNAP_XnAP_PDU_t *pdu);
int xnap_gNB_handle_xn_setup_failure(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, XNAP_XnAP_PDU_t *pdu);
#endif /* XNAP_GNB_INTERFACE_MANAGEMENT_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "intertask_interface.h"
#include "xnap_gNB_itti_messaging.h"
void xnap_gNB_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
instance_t instance = 0; // we have only one instance
message_p = itti_alloc_new_message(TASK_XNAP, 0, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file xnap_gNB_itti_messaging.h
* \brief xnap itti messaging for gNB
* \date 2023 July
* \version 1.0
*/
#ifndef XNAP_GNB_ITTI_MESSAGING_H_
#define XNAP_GNB_ITTI_MESSAGING_H_
void xnap_gNB_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length, uint16_t stream);
#endif /* XNAP_GNB_ITTI_MESSAGING_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "intertask_interface.h"
#include "assertions.h"
#include "conversions.h"
#include "xnap_common.h"
#include "xnap_gNB_defs.h"
#include "xnap_gNB_task.h"
// xnap_gNB_internal_data_t xnap_gNB_internal_data;
static xnap_gNB_instance_t *xn_inst[NUMBER_OF_gNB_MAX] = {0};
static int xnap_gNB_compare_assoc_id(const xnap_gNB_data_t *p1, const xnap_gNB_data_t *p2)
{
if (p1->assoc_id > p2->assoc_id)
return 1;
if (p1->assoc_id == p2->assoc_id)
return 0;
return -1; /* p1->assoc_id < p1->assoc_id */
}
RB_GENERATE(xnap_gnb_tree, xnap_gNB_data_t, entry, xnap_gNB_compare_assoc_id);
/*int xnap_gNB_compare_assoc_id(struct xnap_gNB_data_s *p1, struct xnap_gNB_data_s *p2)
{
if (p1->assoc_id == -1) {
if (p1->cnx_id < p2->cnx_id) {
return -1;
}
if (p1->cnx_id > p2->cnx_id) {
return 1;
}
} else {
if (p1->assoc_id < p2->assoc_id) {
return -1;
}
if (p1->assoc_id > p2->assoc_id) {
return 1;
}
}
return 0;
}*/
static pthread_mutex_t xn_inst_mtx = PTHREAD_MUTEX_INITIALIZER;
void createXninst(instance_t instanceP, xnap_setup_req_t *req, xnap_net_config_t *nc)
{
DevAssert(instanceP == 0);
pthread_mutex_lock(&xn_inst_mtx);
AssertFatal(xn_inst[0] == NULL, "Attempted to initialize multiple Xn instances\n");
xn_inst[0] = calloc(1, sizeof(xnap_gNB_instance_t));
AssertFatal(xn_inst[0] != NULL, "out of memory\n");
if (req)
xn_inst[0]->setup_req = *req;
if (nc)
xn_inst[0]->net_config = *nc;
pthread_mutex_unlock(&xn_inst_mtx);
}
void xnap_dump_trees(const instance_t instance)
{
pthread_mutex_lock(&xn_inst_mtx);
printf("%ld connected gNBs \n", xn_inst[instance]->num_gnbs);
xnap_gNB_data_t *xnap_gnb_data_p = NULL;
/* cast is necessary to eliminate warning "discards ‘const’ qualifier" */
RB_FOREACH (xnap_gnb_data_p, xnap_gnb_tree, &((xnap_gNB_instance_t *)xn_inst[instance])->xnap_gnbs) {
if (xnap_gnb_data_p->assoc_id == -1) {
printf("integrated gNB");
printf("cnx_id %d\n", xnap_gnb_data_p->cnx_id);
} else {
printf("assoc_id %d", xnap_gnb_data_p->assoc_id);
printf("state %d\n", xnap_gnb_data_p->state);
printf("cnx_id %d\n", xnap_gnb_data_p->cnx_id);
}
}
pthread_mutex_unlock(&xn_inst_mtx);
}
xnap_gNB_data_t *xnap_get_gNB(instance_t instance, sctp_assoc_t assoc_id)
{
AssertFatal(assoc_id != 0, "illegal assoc_id == 0: should be -1 or >0)\n");
xnap_gNB_data_t e = {.assoc_id = assoc_id};
pthread_mutex_lock(&xn_inst_mtx);
xnap_gNB_data_t *xnap_gnb = RB_FIND(xnap_gnb_tree, &xn_inst[instance]->xnap_gnbs, &e);
if (xnap_gnb == NULL) {
LOG_W(NR_RRC, "no gNB connected or not found for assoc_id %d:\n", assoc_id);
pthread_mutex_unlock(&xn_inst_mtx);
return NULL;
}
pthread_mutex_unlock(&xn_inst_mtx);
return xnap_gnb;
}
xnap_gNB_instance_t *xnap_gNB_get_instance(instance_t instanceP)
{
DevAssert(instanceP == 0);
pthread_mutex_lock(&xn_inst_mtx);
xnap_gNB_instance_t *instance_xnap = xn_inst[instanceP];
pthread_mutex_unlock(&xn_inst_mtx);
return instance_xnap;
}
void xnap_insert_gnb(instance_t instance, xnap_gNB_data_t *xnap_gnb_data_p)
{
pthread_mutex_lock(&xn_inst_mtx);
RB_INSERT(xnap_gnb_tree, &xn_inst[instance]->xnap_gnbs, xnap_gnb_data_p);
xn_inst[instance]->num_gnbs++;
pthread_mutex_unlock(&xn_inst_mtx);
}
void xnap_handle_xn_setup_message(instance_t instance, sctp_assoc_t assoc_id, int sctp_shutdown)
{
if (sctp_shutdown) {
/* A previously connected gNB has been shutdown */
xnap_gNB_data_t *gnb_data_p = xnap_get_gNB(instance, assoc_id);
if (gnb_data_p == NULL) {
LOG_W(XNAP, "no gNB connected or not found for assoc_id %d:\n", assoc_id);
return;
}
pthread_mutex_lock(&xn_inst_mtx);
if (gnb_data_p->state == XNAP_GNB_STATE_CONNECTED) {
gnb_data_p->state = XNAP_GNB_STATE_DISCONNECTED;
// Removing the gNB data from tree
RB_REMOVE(xnap_gnb_tree, &xn_inst[instance]->xnap_gnbs, gnb_data_p);
if (xn_inst[instance]->xn_target_gnb_associated_nb > 0) {
/* Decrease associated gNB number */
xn_inst[instance]->xn_target_gnb_associated_nb--;
}
/* If there are no more associated gNB */
if (xn_inst[instance]->xn_target_gnb_associated_nb == 0) {
// TODO : Inform GNB_APP ???
LOG_I(XNAP, "No more associated gNBs- Number of connected gNBS : %d \n", xn_inst[instance]->xn_target_gnb_associated_nb);
}
}
} else {
/* Check that at least one setup message is pending */
DevCheck(xn_inst[instance]->xn_target_gnb_pending_nb > 0, instance, xn_inst[instance]->xn_target_gnb_pending_nb, 0);
if (xn_inst[instance]->xn_target_gnb_pending_nb > 0) {
/* Decrease pending messages number */
xn_inst[instance]->xn_target_gnb_pending_nb--;
}
/* If there are no more pending messages */
if (xn_inst[instance]->xn_target_gnb_pending_nb == 0) {
// TODO : Need to inform GNB_APP??
LOG_I(XNAP, "No more pending messages- Number of connected gNBS : %d", xn_inst[instance]->xn_target_gnb_associated_nb);
}
}
pthread_mutex_unlock(&xn_inst_mtx);
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __XNAP_GNB_MANAGEMENT_PROCEDURES__H__
#define __XNAP_GNB_MANAGEMENT_PROCEDURES__H__
// void xnap_gNB_prepare_internal_data(void);
void createXninst(instance_t instanceP, xnap_setup_req_t *req, xnap_net_config_t *nc);
// void xnap_dump_trees(void);
void xnap_dump_trees(const instance_t instance);
// void xnap_gNB_insert_new_instance(xnap_gNB_instance_t *new_instance_p);
xnap_gNB_instance_t *xnap_gNB_get_instance(instance_t instanceP);
// uint16_t xnap_gNB_fetch_add_global_cnx_id(void);
// void xnap_gNB_prepare_internal_data(void);
// xnap_gNB_data_t *xnap_is_gNB_id_in_list(uint32_t gNB_id);
// xnap_gNB_data_t *xnap_is_gNB_assoc_id_in_list(uint32_t sctp_assoc_id);
// xnap_gNB_data_t *xnap_is_gNB_pci_in_list(const uint32_t pci);
xnap_gNB_data_t *xnap_get_gNB(instance_t instance, sctp_assoc_t assoc_id);
void xnap_insert_gnb(instance_t instance, xnap_gNB_data_t *xnap_gnb_data_p);
void xnap_handle_xn_setup_message(instance_t instance, sctp_assoc_t assoc_id, int sctp_shutdown);
#endif /* __XNAP_GNB_MANAGEMENT_PROCEDURES__H__ */
This diff is collapsed.
/* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdint.h>
#ifndef XNAP_H_
#define XNAP_H_
#define XNAP_SCTP_PPID (61) ///< XNAP SCTP Payload Protocol Identifier (PPID)
#include "xnap_gNB_defs.h"
int xnap_gNB_init_sctp(instance_t instance_p, xnap_net_config_t *nc);
void *xnap_task(void *arg);
int is_xnap_enabled(void);
void xnap_trigger(void);
#endif /* XNAP_H_ */
/**
* @}
*/
This diff is collapsed.
This diff is collapsed.
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