Commit 60b9043b authored by Haruki NAOI's avatar Haruki NAOI Committed by Robert Schmidt

Add S1down auto recovery.

(cherry picked from commit 2339972ceaeb75fe18c0b2ae9ea69216dd919668)
parent d124932d
......@@ -540,6 +540,7 @@ add_library(S1AP_ENB
${S1AP_DIR}/s1ap_eNB_overload.c
${S1AP_DIR}/s1ap_eNB_trace.c
${S1AP_DIR}/s1ap_eNB_ue_context.c
${S1AP_DIR}/s1ap_eNB_timer.c
)
add_dependencies(S1AP_ENB rrc_flag s1ap_flag)
......
......@@ -393,6 +393,11 @@ typedef struct s1ap_register_enb_req_s {
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
uint16_t s1_setuprsp_wait_timer;
uint16_t s1_setupreq_wait_timer;
uint16_t s1_setupreq_count;
uint16_t sctp_req_timer;
uint16_t sctp_req_count;
} s1ap_register_enb_req_t;
//-------------------------------------------------------------------------------------------//
......
......@@ -47,7 +47,8 @@ TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000)
// GTP_V1U task
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000)
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
//TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 2000)
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200)
/// M3ap task, acts as both source and target
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -20,7 +20,7 @@
*/
/*! \file openair2/ENB_APP/enb_paramdef.h
* \brief definition of configuration parameters for all eNodeB modules
* \brief definition of configuration parameters for all eNodeB modules
* \author Francois TABURET
* \date 2017
* \version 0.1
......@@ -36,20 +36,20 @@
#include "RRC_paramsvalues.h"
#include "s1ap_eNB_default_values.h"
#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
#define ENB_CONFIG_STRING_CC_NODE_FUNCTION "node_function"
#define ENB_CONFIG_STRING_CC_NODE_TIMING "node_timing"
#define ENB_CONFIG_STRING_CC_NODE_SYNCH_REF "node_synch_ref"
// OTG config per ENB-UE DL
#define ENB_CONF_STRING_OTG_CONFIG "otg_config"
#define ENB_CONF_STRING_OTG_UE_ID "ue_id"
#define ENB_CONF_STRING_OTG_APP_TYPE "app_type"
#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic"
#define ENB_CONF_STRING_OTG_CONFIG "otg_config"
#define ENB_CONF_STRING_OTG_UE_ID "ue_id"
#define ENB_CONF_STRING_OTG_APP_TYPE "app_type"
#define ENB_CONF_STRING_OTG_BG_TRAFFIC "bg_traffic"
#ifdef LIBCONFIG_LONG
#define libconfig_int long
#define libconfig_int long
#else
#define libconfig_int int
#define libconfig_int int
#endif
typedef enum {
......@@ -130,38 +130,38 @@ typedef enum {
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
/* RU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
#define RUPARAMS_DESC { \
{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \
{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \
{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_IS_SLAVE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \
{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \
{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFBANDS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_IS_SLAVE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SDR_TME_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \
{CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
}
}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -169,7 +169,7 @@ typedef enum {
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE "none"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING "annoying"
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
/* global parameters, not under a specific section */
#define ENB_CONFIG_STRING_ASN1_VERBOSITY "Asn1_verbosity"
......@@ -180,10 +180,10 @@ typedef enum {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define ENBSPARAMS_DESC { \
{ENB_CONFIG_STRING_ASN1_VERBOSITY, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ACTIVE_ENBS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0}, \
{ENB_CONFIG_STRING_NOS1, NULL, PARAMFLAG_BOOL, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
}
{ENB_CONFIG_STRING_ASN1_VERBOSITY, NULL, 0, uptr:NULL, defstrval:ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ACTIVE_ENBS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRINGLIST, 0}, \
{ENB_CONFIG_STRING_NOS1, NULL, PARAMFLAG_BOOL, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
}
#define ENB_ASN1_VERBOSITY_IDX 0
#define ENB_ACTIVE_ENBS_IDX 1
#define ENB_NOS1_IDX 2
......@@ -214,32 +214,42 @@ typedef enum {
#define ENB_CONFIG_STRING_X2 "enable_x2"
#define ENB_CONFIG_STRING_ENB_M2 "enable_enb_m2"
#define ENB_CONFIG_STRING_MCE_M2 "enable_mce_m2"
#define ENB_CONFIG_STRING_S1SETUP_RSP_TIMER "s1setup_rsp_timer"
#define ENB_CONFIG_STRING_S1SETUP_REQ_TIMER "s1setup_req_timer"
#define ENB_CONFIG_STRING_S1SETUP_REQ_COUNT "s1setup_req_count"
#define ENB_CONFIG_STRING_SCTP_REQ_TIMER "sctp_req_timer"
#define ENB_CONFIG_STRING_SCTP_REQ_COUNT "sctp_req_count"
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
/* cell configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
#define ENBPARAMS_DESC {\
{ENB_CONFIG_STRING_ENB_ID, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_TYPE, NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_NAME, NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRACKING_AREA_CODE, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE_OLD, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE_OLD, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \
{ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MEASUREMENT_REPORTS, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_X2, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MCE_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
}
{ENB_CONFIG_STRING_ENB_ID, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_TYPE, NULL, 0, strptr:NULL, defstrval:"CELL_MACRO_ENB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_NAME, NULL, 0, strptr:NULL, defstrval:"OAIeNodeB", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRACKING_AREA_CODE, NULL, 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE_OLD, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE_OLD, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"local_mac", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_NR_CELLID, NULL, 0, u64ptr:NULL, defint64val:0, TYPE_UINT64, 0}, \
{ENB_CONFIG_STRING_RRC_INACTIVITY_THRESHOLD, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MEASUREMENT_REPORTS, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_X2, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MCE_M2, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_S1SETUP_RSP_TIMER, NULL, 0, uptr:NULL, defuintval:5, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_S1SETUP_REQ_TIMER, NULL, 0, uptr:NULL, defuintval:5, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_S1SETUP_REQ_COUNT, NULL, 0, uptr:NULL, defuintval:65535, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SCTP_REQ_TIMER, NULL, 0, uptr:NULL, defuintval:180, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SCTP_REQ_COUNT, NULL, 0, uptr:NULL, defuintval:65535, TYPE_UINT, 0}, \
}
#define ENB_ENB_ID_IDX 0
#define ENB_CELL_TYPE_IDX 1
......@@ -261,31 +271,36 @@ typedef enum {
#define ENB_ENABLE_X2 17
#define ENB_ENABLE_ENB_M2 18
#define ENB_ENABLE_MCE_M2 19
#define ENB_S1SETUP_RSP_TIMER_IDX 20
#define ENB_S1SETUP_REQ_TIMER_IDX 21
#define ENB_S1SETUP_REQ_COUNT_IDX 22
#define ENB_SCTP_REQ_TIMER_IDX 23
#define ENB_SCTP_REQ_COUNT_IDX 24
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
#define ENBPARAMS_CHECK { \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s2 = { config_check_intrange, TRACKING_AREA_CODE_OKRANGE } },\
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
#define ENBPARAMS_CHECK { \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s2 = { config_check_intrange, TRACKING_AREA_CODE_OKRANGE } },\
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
}
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
/* PLMN ID configuration */
......@@ -300,20 +315,20 @@ typedef enum {
#define ENB_MNC_DIGIT_LENGTH 2
#define PLMNPARAMS_DESC { \
/* optname helpstr paramflags XXXptr def val type numelt */ \
{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "mobile country code", 0, uptr:NULL, defuintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, "mobile network code", 0, uptr:NULL, defuintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MNC_DIGIT_LENGTH, "length of the MNC (2 or 3)", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \
}
/* optname helpstr paramflags XXXptr def val type numelt */ \
{ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, "mobile country code", 0, uptr:NULL, defuintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, "mobile network code", 0, uptr:NULL, defuintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MNC_DIGIT_LENGTH, "length of the MNC (2 or 3)", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0}, \
}
#define MCC_MNC_OKRANGES {0,999}
#define MNC_DIGIT_LENGTH_OKVALUES {2,3}
#define PLMNPARAMS_CHECK { \
{ .s2 = { config_check_intrange, MCC_MNC_OKRANGES } }, \
{ .s2 = { config_check_intrange, MCC_MNC_OKRANGES } }, \
{ .s1 = { config_check_intval, MNC_DIGIT_LENGTH_OKVALUES, 2 } }, \
}
{ .s2 = { config_check_intrange, MCC_MNC_OKRANGES } }, \
{ .s2 = { config_check_intrange, MCC_MNC_OKRANGES } }, \
{ .s1 = { config_check_intval, MNC_DIGIT_LENGTH_OKVALUES, 2 } }, \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -430,8 +445,8 @@ typedef enum {
#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311"
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
#define ENB_CONFIG_STRING_UE_MULTIPLE_MAX "ue_multiple_max"
//SIB1-MBMS
#define ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL "mbms_dedicated_serving_cell"
//SIB1-MBMS
#define ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL "mbms_dedicated_serving_cell"
//NSA NR Cell SSB Absolute Frequency
#define ENB_CONFIG_STRING_NR_SCG_SSB_FREQ "nr_scg_ssb_freq"
......@@ -587,289 +602,289 @@ typedef struct ccparams_lte_s {
int32_t nr_scg_ssb_freq;
} ccparams_lte_t;
#define CCPARAMS_CHECK { \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} ,\
{ .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} ,\
{ .s1a= { config_check_modify_integer, UETIMER_T310_OKVALUES, UETIMER_T310_MODVALUES,7}} ,\
{ .s1a= { config_check_modify_integer, UETIMER_T311_OKVALUES, UETIMER_T311_MODVALUES,7}} ,\
{ .s1a= { config_check_modify_integer, UETIMER_N310_OKVALUES, UETIMER_N310_MODVALUES,8}} ,\
{ .s1a= { config_check_modify_integer, UETIMER_N311_OKVALUES, UETIMER_N311_MODVALUES,8}} ,\
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } , \
{ { NULL } } \
#define CCPARAMS_CHECK { \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T300_OKVALUES, UETIMER_T300_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T301_OKVALUES, UETIMER_T301_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T310_OKVALUES, UETIMER_T310_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_T311_OKVALUES, UETIMER_T311_MODVALUES,7}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N310_OKVALUES, UETIMER_N310_MODVALUES,8}} , \
{ .s1a= { config_check_modify_integer, UETIMER_N311_OKVALUES, UETIMER_N311_MODVALUES,8}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} , \
{{NULL}} \
}
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* component carriers configuration parameters */
/* component carriers configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CCPARAMS_DESC(ccparams) { \
{ENB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&ccparams.frame_type, defstrval:"FDD", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG, NULL, 0, iptr:&ccparams.tdd_config, defintval:3, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG_S, NULL, 0, iptr:&ccparams.tdd_config_s, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PREFIX_TYPE, NULL, 0, strptr:&ccparams.prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PBCH_REPETITION, NULL, 0, strptr:&ccparams.pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&ccparams.eutra_band, defintval:7, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&ccparams.downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \
{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&ccparams.uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&ccparams.Nid_cell, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&ccparams.N_RB_DL, defintval:25, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_MBSFN, NULL, 0, iptr:&ccparams.Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&ccparams.nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_ROOT, NULL, 0, iptr:&ccparams.prach_root, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, NULL, 0, iptr:&ccparams.prach_config_index, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, NULL, 0, strptr:&ccparams.prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, NULL, 0, iptr:&ccparams.prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, NULL, 0, iptr:&ccparams.prach_freq_offset, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, NULL, 0, iptr:&ccparams.pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NRB_CQI, NULL, 0, iptr:&ccparams.pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NCS_AN, NULL, 0, iptr:&ccparams.pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_N1_AN, NULL, 0, iptr:&ccparams.pucch_n1_AN, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PDSCH_RS_EPRE, NULL, 0, iptr:&ccparams.pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PDSCH_PB, NULL, 0, iptr:&ccparams.pdsch_p_b, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_N_SB, NULL, 0, iptr:&ccparams.pusch_n_SB, defintval:1, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, NULL, 0, strptr:&ccparams.pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, NULL, 0, iptr:&ccparams.pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, NULL, 0, strptr:&ccparams.pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, NULL, 0, strptr:&ccparams.pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, NULL, 0, iptr:&ccparams.pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, NULL, 0, strptr:&ccparams.pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_NDMRS1, NULL, 0, iptr:&ccparams.pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PHICH_DURATION, NULL, 0, strptr:&ccparams.phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PHICH_RESOURCE, NULL, 0, strptr:&ccparams.phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_ENABLE, NULL, 0, strptr:&ccparams.srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, NULL, 0, iptr:&ccparams.srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, NULL, 0, iptr:&ccparams.srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, NULL, 0, strptr:&ccparams.srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_MAXUPPTS, NULL, 0, strptr:&ccparams.srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, NULL, 0, iptr:&ccparams.pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ALPHA, NULL, 0, strptr:&ccparams.pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, NULL, 0, iptr:&ccparams.pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, NULL, 0, iptr:&ccparams.msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, NULL, 0, strptr:&ccparams.pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, NULL, 0, strptr:&ccparams.pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, NULL, 0, iptr:&ccparams.rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, NULL, 0, strptr:&ccparams.rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, NULL, 0, iptr:&ccparams.rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, NULL, 0, iptr:&ccparams.rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, strptr:&ccparams.rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, NULL, 0, iptr:&ccparams.rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, NULL, 0, iptr:&ccparams.rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, NULL, 0, iptr:&ccparams.rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, NULL, 0, iptr:&ccparams.rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&ccparams.rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, NULL, 0, iptr:&ccparams.rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&ccparams.pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&ccparams.pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_CONFIG_PRESENT, NULL, 0, strptr:&ccparams.drx_Config_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_ONDURATIONTIMER, NULL, 0, strptr:&ccparams.drx_onDurationTimer, defstrval:"psf10", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_INACTIVITYTIMER, NULL, 0, strptr:&ccparams.drx_InactivityTimer, defstrval:"psf10", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER, NULL, 0, strptr:&ccparams.drx_RetransmissionTimer, defstrval:"psf8", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT, NULL, 0, strptr:&ccparams.drx_longDrx_CycleStartOffset_present, defstrval:"prSf128", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET, NULL, 0, iptr:&ccparams.drx_longDrx_CycleStartOffset, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE, NULL, 0, strptr:&ccparams.drx_shortDrx_Cycle, defstrval:"sf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER, NULL, 0, iptr:&ccparams.drx_shortDrx_ShortCycleTimer, defintval:3, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&ccparams.bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T310, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N310, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, NULL, 0, iptr:&ccparams.ue_TransmissionMode, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UE_MULTIPLE_MAX, NULL, 0, iptr:&ccparams.ue_multiple_max, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_FRAME_TYPE, NULL, 0, strptr:&ccparams.frame_type, defstrval:"FDD", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG, NULL, 0, iptr:&ccparams.tdd_config, defintval:3, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_TDD_CONFIG_S, NULL, 0, iptr:&ccparams.tdd_config_s, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PREFIX_TYPE, NULL, 0, strptr:&ccparams.prefix_type, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PBCH_REPETITION, NULL, 0, strptr:&ccparams.pbch_repetition, defstrval:"FALSE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_EUTRA_BAND, NULL, 0, iptr:&ccparams.eutra_band, defintval:7, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, NULL, 0, i64ptr:(int64_t *)&ccparams.downlink_frequency, defint64val:2680000000, TYPE_UINT64, 0}, \
{ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, NULL, 0, iptr:&ccparams.uplink_frequency_offset, defintval:-120000000, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NID_CELL, NULL, 0, iptr:&ccparams.Nid_cell, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_N_RB_DL, NULL, 0, iptr:&ccparams.N_RB_DL, defintval:25, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_CELL_MBSFN, NULL, 0, iptr:&ccparams.Nid_cell_mbsfn, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_NB_ANT_PORTS, NULL, 0, iptr:&ccparams.nb_antenna_ports, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_ROOT, NULL, 0, iptr:&ccparams.prach_root, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, NULL, 0, iptr:&ccparams.prach_config_index, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PRACH_HIGH_SPEED, NULL, 0, strptr:&ccparams.prach_high_speed, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, NULL, 0, iptr:&ccparams.prach_zero_correlation, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, NULL, 0, iptr:&ccparams.prach_freq_offset, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, NULL, 0, iptr:&ccparams.pucch_delta_shift, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NRB_CQI, NULL, 0, iptr:&ccparams.pucch_nRB_CQI, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_NCS_AN, NULL, 0, iptr:&ccparams.pucch_nCS_AN, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_N1_AN, NULL, 0, iptr:&ccparams.pucch_n1_AN, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PDSCH_RS_EPRE, NULL, 0, iptr:&ccparams.pdsch_referenceSignalPower, defintval:-29, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PDSCH_PB, NULL, 0, iptr:&ccparams.pdsch_p_b, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_N_SB, NULL, 0, iptr:&ccparams.pusch_n_SB, defintval:1, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, NULL, 0, strptr:&ccparams.pusch_hoppingMode, defstrval:"interSubFrame", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, NULL, 0, iptr:&ccparams.pusch_hoppingOffset, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, NULL, 0, strptr:&ccparams.pusch_enable64QAM, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, NULL, 0, strptr:&ccparams.pusch_groupHoppingEnabled, defstrval:"ENABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, NULL, 0, iptr:&ccparams.pusch_groupAssignment, defintval:0, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, NULL, 0, strptr:&ccparams.pusch_sequenceHoppingEnabled, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_NDMRS1, NULL, 0, iptr:&ccparams.pusch_nDMRS1, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PHICH_DURATION, NULL, 0, strptr:&ccparams.phich_duration, defstrval:"NORMAL", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PHICH_RESOURCE, NULL, 0, strptr:&ccparams.phich_resource, defstrval:"ONESIXTH", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_ENABLE, NULL, 0, strptr:&ccparams.srs_enable, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, NULL, 0, iptr:&ccparams.srs_BandwidthConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, NULL, 0, iptr:&ccparams.srs_SubframeConfig, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, NULL, 0, strptr:&ccparams.srs_ackNackST, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_SRS_MAXUPPTS, NULL, 0, strptr:&ccparams.srs_MaxUpPts, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, NULL, 0, iptr:&ccparams.pusch_p0_Nominal, defintval:-90, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PUSCH_ALPHA, NULL, 0, strptr:&ccparams.pusch_alpha, defstrval:"AL1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, NULL, 0, iptr:&ccparams.pucch_p0_Nominal, defintval:-96, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, NULL, 0, iptr:&ccparams.msg3_delta_Preamble, defintval:6, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, NULL, 0, strptr:&ccparams.pucch_deltaF_Format1, defstrval:"DELTAF2", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, NULL, 0, strptr:&ccparams.pucch_deltaF_Format1b, defstrval:"deltaF3", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2a, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, NULL, 0, strptr:&ccparams.pucch_deltaF_Format2b, defstrval:"deltaF0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, NULL, 0, iptr:&ccparams.rach_numberOfRA_Preambles, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, NULL, 0, strptr:&ccparams.rach_preamblesGroupAConfig, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, NULL, 0, iptr:&ccparams.rach_sizeOfRA_PreamblesGroupA, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, NULL, 0, iptr:&ccparams.rach_messageSizeGroupA, defintval:56, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, NULL, 0, strptr:&ccparams.rach_messagePowerOffsetGroupB, defstrval:"minusinfinity", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, NULL, 0, iptr:&ccparams.rach_powerRampingStep, defintval:4, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, NULL, 0, iptr:&ccparams.rach_preambleInitialReceivedTargetPower, defintval:-100, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, NULL, 0, iptr:&ccparams.rach_preambleTransMax, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, NULL, 0, iptr:&ccparams.rach_raResponseWindowSize, defintval:10, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, NULL, 0, iptr:&ccparams.rach_macContentionResolutionTimer, defintval:48, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, NULL, 0, iptr:&ccparams.rach_maxHARQ_Msg3Tx, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, NULL, 0, iptr:&ccparams.pcch_defaultPagingCycle, defintval:128, TYPE_INT, 0}, \
{ENB_CONFIG_STRING_PCCH_NB, NULL, 0, strptr:&ccparams.pcch_nB, defstrval:"oneT", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_CONFIG_PRESENT, NULL, 0, strptr:&ccparams.drx_Config_present, defstrval:"prNothing", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_ONDURATIONTIMER, NULL, 0, strptr:&ccparams.drx_onDurationTimer, defstrval:"psf10", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_INACTIVITYTIMER, NULL, 0, strptr:&ccparams.drx_InactivityTimer, defstrval:"psf10", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER, NULL, 0, strptr:&ccparams.drx_RetransmissionTimer, defstrval:"psf8", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT, NULL, 0, strptr:&ccparams.drx_longDrx_CycleStartOffset_present, defstrval:"prSf128", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET, NULL, 0, iptr:&ccparams.drx_longDrx_CycleStartOffset, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE, NULL, 0, strptr:&ccparams.drx_shortDrx_Cycle, defstrval:"sf32", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER, NULL, 0, iptr:&ccparams.drx_shortDrx_ShortCycleTimer, defintval:3, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, NULL, 0, iptr:&ccparams.bcch_modificationPeriodCoeff, defintval:2, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T300, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t300, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T301, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t301, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T310, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t310, defintval:1000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_T311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_t311, defintval:10000, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N310, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n310, defintval:20, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UETIMERS_N311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, NULL, 0, iptr:&ccparams.ue_TransmissionMode, defintval:1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_UE_MULTIPLE_MAX, NULL, 0, iptr:&ccparams.ue_multiple_max, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL, NULL, 0, strptr:&ccparams.mbms_dedicated_serving_cell, defstrval:"DISABLE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_NR_SCG_SSB_FREQ, NULL, 0, iptr:&ccparams.nr_scg_ssb_freq, defintval:641272, TYPE_INT, 0} \
}
#define ENB_CONFIG_FRAME_TYPE_IDX 0
#define ENB_CONFIG_TDD_CONFIG_IDX 1
#define ENB_CONFIG_TDD_CONFIG_S_IDX 2
#define ENB_CONFIG_PREFIX_TYPE_IDX 3
#define ENB_CONFIG_PBCH_REPETITION_IDX 4
#define ENB_CONFIG_EUTRA_BAND_IDX 5
#define ENB_CONFIG_DOWNLINK_FREQUENCY_IDX 6
#define ENB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 7
#define ENB_CONFIG_NID_CELL_IDX 8
#define ENB_CONFIG_N_RB_DL_IDX 9
#define ENB_CONFIG_CELL_MBSFN_IDX 10
#define ENB_CONFIG_NB_ANT_PORTS_IDX 11
#define ENB_CONFIG_PRACH_ROOT_IDX 12
#define ENB_CONFIG_PRACH_CONFIG_INDEX_IDX 13
#define ENB_CONFIG_PRACH_HIGH_SPEED_IDX 14
#define ENB_CONFIG_PRACH_ZERO_CORRELATION_IDX 15
#define ENB_CONFIG_PRACH_FREQ_OFFSET_IDX 16
#define ENB_CONFIG_PUCCH_DELTA_SHIFT_IDX 17
#define ENB_CONFIG_PUCCH_NRB_CQI_IDX 18
#define ENB_CONFIG_PUCCH_NCS_AN_IDX 19
#define ENB_CONFIG_PUCCH_N1_AN_IDX 20
#define ENB_CONFIG_PDSCH_RS_EPRE_IDX 21
#define ENB_CONFIG_PDSCH_PB_IDX 22
#define ENB_CONFIG_PUSCH_N_SB_IDX 23
#define ENB_CONFIG_PUSCH_HOPPINGMODE_IDX 24
#define ENB_CONFIG_PUSCH_HOPPINGOFFSET_IDX 25
#define ENB_CONFIG_PUSCH_ENABLE64QAM_IDX 26
#define ENB_CONFIG_PUSCH_GROUP_HOPPING_EN_IDX 27
#define ENB_CONFIG_PUSCH_GROUP_ASSIGNMENT_IDX 28
#define ENB_CONFIG_PUSCH_SEQUENCE_HOPPING_EN_IDX 29
#define ENB_CONFIG_PUSCH_NDMRS1_IDX 30
#define ENB_CONFIG_PHICH_DURATION_IDX 31
#define ENB_CONFIG_PHICH_RESOURCE_IDX 32
#define ENB_CONFIG_SRS_ENABLE_IDX 33
#define ENB_CONFIG_SRS_BANDWIDTH_CONFIG_IDX 34
#define ENB_CONFIG_SRS_SUBFRAME_CONFIG_IDX 35
#define ENB_CONFIG_SRS_ACKNACKST_CONFIG_IDX 36
#define ENB_CONFIG_SRS_MAXUPPTS_IDX 37
#define ENB_CONFIG_PUSCH_PO_NOMINAL_IDX 38
#define ENB_CONFIG_PUSCH_ALPHA_IDX 39
#define ENB_CONFIG_PUCCH_PO_NOMINAL_IDX 40
#define ENB_CONFIG_MSG3_DELTA_PREAMBLE_IDX 41
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1_IDX 42
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1b_IDX 43
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2_IDX 44
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2A_IDX 45
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2B_IDX 46
#define ENB_CONFIG_RACH_NUM_RA_PREAMBLES_IDX 47
#define ENB_CONFIG_RACH_PREAMBLESGROUPACONFIG_IDX 48
#define ENB_CONFIG_RACH_SIZEOFRA_PREAMBLESGROUPA_IDX 49
#define ENB_CONFIG_RACH_MESSAGESIZEGROUPA_IDX 50
#define ENB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 51
#define ENB_CONFIG_RACH_POWERRAMPINGSTEP_IDX 52
#define ENB_CONFIG_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_IDX 53
#define ENB_CONFIG_RACH_PREAMBLETRANSMAX_IDX 54
#define ENB_CONFIG_RACH_RARESPONSEWINDOWSIZE_IDX 55
#define ENB_CONFIG_RACH_MACCONTENTIONRESOLUTIONTIMER_IDX 56
#define ENB_CONFIG_RACH_MAXHARQMSG3TX_IDX 57
#define ENB_CONFIG_PCCH_DEFAULT_PAGING_CYCLE_IDX 58
#define ENB_CONFIG_PCCH_NB_IDX 59
#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60
#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61
#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62
#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63
#define ENB_CONFIG_FRAME_TYPE_IDX 0
#define ENB_CONFIG_TDD_CONFIG_IDX 1
#define ENB_CONFIG_TDD_CONFIG_S_IDX 2
#define ENB_CONFIG_PREFIX_TYPE_IDX 3
#define ENB_CONFIG_PBCH_REPETITION_IDX 4
#define ENB_CONFIG_EUTRA_BAND_IDX 5
#define ENB_CONFIG_DOWNLINK_FREQUENCY_IDX 6
#define ENB_CONFIG_UPLINK_FREQUENCY_OFFSET_IDX 7
#define ENB_CONFIG_NID_CELL_IDX 8
#define ENB_CONFIG_N_RB_DL_IDX 9
#define ENB_CONFIG_CELL_MBSFN_IDX 10
#define ENB_CONFIG_NB_ANT_PORTS_IDX 11
#define ENB_CONFIG_PRACH_ROOT_IDX 12
#define ENB_CONFIG_PRACH_CONFIG_INDEX_IDX 13
#define ENB_CONFIG_PRACH_HIGH_SPEED_IDX 14
#define ENB_CONFIG_PRACH_ZERO_CORRELATION_IDX 15
#define ENB_CONFIG_PRACH_FREQ_OFFSET_IDX 16
#define ENB_CONFIG_PUCCH_DELTA_SHIFT_IDX 17
#define ENB_CONFIG_PUCCH_NRB_CQI_IDX 18
#define ENB_CONFIG_PUCCH_NCS_AN_IDX 19
#define ENB_CONFIG_PUCCH_N1_AN_IDX 20
#define ENB_CONFIG_PDSCH_RS_EPRE_IDX 21
#define ENB_CONFIG_PDSCH_PB_IDX 22
#define ENB_CONFIG_PUSCH_N_SB_IDX 23
#define ENB_CONFIG_PUSCH_HOPPINGMODE_IDX 24
#define ENB_CONFIG_PUSCH_HOPPINGOFFSET_IDX 25
#define ENB_CONFIG_PUSCH_ENABLE64QAM_IDX 26
#define ENB_CONFIG_PUSCH_GROUP_HOPPING_EN_IDX 27
#define ENB_CONFIG_PUSCH_GROUP_ASSIGNMENT_IDX 28
#define ENB_CONFIG_PUSCH_SEQUENCE_HOPPING_EN_IDX 29
#define ENB_CONFIG_PUSCH_NDMRS1_IDX 30
#define ENB_CONFIG_PHICH_DURATION_IDX 31
#define ENB_CONFIG_PHICH_RESOURCE_IDX 32
#define ENB_CONFIG_SRS_ENABLE_IDX 33
#define ENB_CONFIG_SRS_BANDWIDTH_CONFIG_IDX 34
#define ENB_CONFIG_SRS_SUBFRAME_CONFIG_IDX 35
#define ENB_CONFIG_SRS_ACKNACKST_CONFIG_IDX 36
#define ENB_CONFIG_SRS_MAXUPPTS_IDX 37
#define ENB_CONFIG_PUSCH_PO_NOMINAL_IDX 38
#define ENB_CONFIG_PUSCH_ALPHA_IDX 39
#define ENB_CONFIG_PUCCH_PO_NOMINAL_IDX 40
#define ENB_CONFIG_MSG3_DELTA_PREAMBLE_IDX 41
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1_IDX 42
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT1b_IDX 43
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2_IDX 44
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2A_IDX 45
#define ENB_CONFIG_PUCCH_DELTAF_FORMAT2B_IDX 46
#define ENB_CONFIG_RACH_NUM_RA_PREAMBLES_IDX 47
#define ENB_CONFIG_RACH_PREAMBLESGROUPACONFIG_IDX 48
#define ENB_CONFIG_RACH_SIZEOFRA_PREAMBLESGROUPA_IDX 49
#define ENB_CONFIG_RACH_MESSAGESIZEGROUPA_IDX 50
#define ENB_CONFIG_RACH_MESSAGEPOWEROFFSETGROUPB_IDX 51
#define ENB_CONFIG_RACH_POWERRAMPINGSTEP_IDX 52
#define ENB_CONFIG_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER_IDX 53
#define ENB_CONFIG_RACH_PREAMBLETRANSMAX_IDX 54
#define ENB_CONFIG_RACH_RARESPONSEWINDOWSIZE_IDX 55
#define ENB_CONFIG_RACH_MACCONTENTIONRESOLUTIONTIMER_IDX 56
#define ENB_CONFIG_RACH_MAXHARQMSG3TX_IDX 57
#define ENB_CONFIG_PCCH_DEFAULT_PAGING_CYCLE_IDX 58
#define ENB_CONFIG_PCCH_NB_IDX 59
#define ENB_CONFIG_STRING_DRX_CONFIG_PRESENT_IDX 60
#define ENB_CONFIG_STRING_DRX_ONDURATIONTIMER_IDX 61
#define ENB_CONFIG_STRING_DRX_INACTIVITYTIMER_IDX 62
#define ENB_CONFIG_STRING_DRX_RETRANSMISSIONTIMER_IDX 63
#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_PRESENT_IDX 64
#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65
#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66
#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67
#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68
#define ENB_CONFIG_UETIMERS_T300_IDX 69
#define ENB_CONFIG_UETIMERS_T301_IDX 70
#define ENB_CONFIG_UETIMERS_T310_IDX 71
#define ENB_CONFIG_UETIMERS_T311_IDX 72
#define ENB_CONFIG_UETIMERS_N310_IDX 73
#define ENB_CONFIG_UETIMERS_N311_IDX 74
#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75
#define ENB_CONFIG_MBMS_DEDICATED_SERVING_CELL_IDX 76
#define ENB_CONFIG_STRING_DRX_LONGDRX_CYCLESTARTOFFSET_IDX 65
#define ENB_CONFIG_STRING_DRX_SHORTDRX_CYCLE_IDX 66
#define ENB_CONFIG_STRING_DRX_SHORTDRX_SHORTCYCLETIMER_IDX 67
#define ENB_CONFIG_BCCH_MODIFICATIONPERIODCOEFF_IDX 68
#define ENB_CONFIG_UETIMERS_T300_IDX 69
#define ENB_CONFIG_UETIMERS_T301_IDX 70
#define ENB_CONFIG_UETIMERS_T310_IDX 71
#define ENB_CONFIG_UETIMERS_T311_IDX 72
#define ENB_CONFIG_UETIMERS_N310_IDX 73
#define ENB_CONFIG_UETIMERS_N311_IDX 74
#define ENB_CONFIG_UE_TRANSMISSION_MODE_IDX 75
#define ENB_CONFIG_MBMS_DEDICATED_SERVING_CELL_IDX 76
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* SRB1 configuration parameters section name */
......@@ -896,14 +911,14 @@ typedef struct srb1_params_s {
int32_t srb1_max_retx_threshold;
} srb1_params_t;
#define SRB1PARAMS_DESC(srb1_params) { \
{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_params.srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_params.srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_params.srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_params.srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_params.srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_params.srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \
}
#define SRB1PARAMS_DESC(srb1_params) { \
{ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, NULL, 0, iptr:&srb1_params.srb1_timer_poll_retransmit, defintval:80, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, NULL, 0, iptr:&srb1_params.srb1_timer_reordering, defintval:35, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, NULL, 0, iptr:&srb1_params.srb1_timer_status_prohibit, defintval:0, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_POLL_PDU, NULL, 0, iptr:&srb1_params.srb1_poll_pdu, defintval:4, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_POLL_BYTE, NULL, 0, iptr:&srb1_params.srb1_poll_byte, defintval:99999, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, NULL, 0, iptr:&srb1_params.srb1_max_retx_threshold, defintval:4, TYPE_UINT, 0} \
}
/* MME configuration parameters section name */
#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
......@@ -919,13 +934,13 @@ typedef struct srb1_params_s {
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* MME configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define S1PARAMS_DESC { \
{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MME_BROADCAST_PLMN_INDEX, NULL, 0, uptr:NULL, defintarrayval:NULL, TYPE_UINTARRAY, 6}, \
{ENB_CONFIG_STRING_MME_PORT, NULL, 0, u16ptr:NULL, defuintval:S1AP_PORT_NUMBER, TYPE_UINT16, 0}, \
}
......@@ -954,13 +969,13 @@ typedef struct srb1_params_s {
/*-------------------------------------------------------------------------------------------------------------------------------------*/
/* X2 configuration parameters */
/* X2 configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------*/
#define X2PARAMS_DESC { \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IPV4_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IPV6_ADDRESS, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_TARGET_ENB_X2_IP_ADDRESS_PREFERENCE, NULL, 0, uptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
}
#define ENB_X2_IPV4_ADDRESS_IDX 0
......@@ -1014,9 +1029,9 @@ typedef struct srb1_params_s {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define SCTPPARAMS_DESC { \
{ENB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0} \
}
{ENB_CONFIG_STRING_SCTP_INSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_SCTP_OUTSTREAMS, NULL, 0, uptr:NULL, defintval:-1, TYPE_UINT, 0} \
}
#define ENB_SCTP_INSTREAMS_IDX 0
#define ENB_SCTP_OUTSTREAMS_IDX 1
......@@ -1030,8 +1045,8 @@ typedef struct srb1_params_s {
#define ENB_INTERFACE_NAME_FOR_S1U_IDX 2
#define ENB_IPV4_ADDR_FOR_S1U_IDX 3
#define ENB_PORT_FOR_S1U_IDX 4
#define ENB_IPV4_ADDR_FOR_X2C_IDX 5
#define ENB_PORT_FOR_X2C_IDX 6
#define ENB_IPV4_ADDR_FOR_X2C_IDX 5
#define ENB_PORT_FOR_X2C_IDX 6
#define ENB_IPV4_ADDR_FOR_M2C_IDX 7
#define ENB_PORT_FOR_M2C_IDX 8
#define MCE_IPV4_ADDR_FOR_M2C_IDX 9
......@@ -1060,28 +1075,28 @@ typedef struct srb1_params_s {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define NETPARAMS_DESC { \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:NULL, defintval:2152L, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_X2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_X2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_M2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_M2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_MCE_IPV4_ADDR_FOR_M2C, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_MCE_PORT_FOR_M2C, NULL, 0, uptr:NULL, defintval:0L, TYPE_UINT, 0}, \
}
}
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* GTPU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define GTPUPARAMS_DESC { \
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
}
{ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, NULL, 0, strptr:&enb_interface_name_for_S1U, defstrval:"lo", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, NULL, 0, strptr:&enb_ipv4_address_for_S1U, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, NULL, 0, uptr:&enb_port_for_S1U, defintval:2152, TYPE_UINT, 0} \
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -1109,64 +1124,64 @@ typedef struct srb1_params_s {
#define FLEXRAN_AWAIT_RECONF_IDX 5
#define FLEXRANPARAMS_DESC { \
{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{CONFIG_STRING_FLEXRAN_CACHE, NULL, 0, strptr:NULL, defstrval:"/mnt/oai_agent_cache", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_AWAIT_RECONF, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0} \
}
{CONFIG_STRING_FLEXRAN_ENABLED, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_INTERFACE_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_IPV4_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_PORT, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{CONFIG_STRING_FLEXRAN_CACHE, NULL, 0, strptr:NULL, defstrval:"/mnt/oai_agent_cache", TYPE_STRING, 0}, \
{CONFIG_STRING_FLEXRAN_AWAIT_RECONF, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0} \
}
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* CU/DU configuration section names*/
#define CONFIG_STRING_DU_LIST "DU"
#define CONFIG_STRING_CU_LIST "CU"
#define DU_TYPE_LTE 0
#define DU_TYPE_WIFI 1
#define CONFIG_STRING_DU_LIST "DU"
#define CONFIG_STRING_CU_LIST "CU"
#define DU_TYPE_LTE 0
#define DU_TYPE_WIFI 1
#define ENB_CONFIG_STRING_CU_INTERFACES_CONFIG "CU_INTERFACES"
#define ENB_CONFIG_STRING_CU_INTERFACE_NAME_FOR_F1U "CU_INTERFACE_NAME_FOR_F1U"
#define ENB_CONFIG_STRING_CU_IPV4_ADDRESS_FOR_F1U "CU_IPV4_ADDRESS_FOR_F1U"
#define ENB_CONFIG_STRING_CU_PORT_FOR_F1U "CU_PORT_FOR_F1U"
#define ENB_CONFIG_STRING_CU_INTERFACE_NAME_FOR_F1U "CU_INTERFACE_NAME_FOR_F1U"
#define ENB_CONFIG_STRING_CU_IPV4_ADDRESS_FOR_F1U "CU_IPV4_ADDRESS_FOR_F1U"
#define ENB_CONFIG_STRING_CU_PORT_FOR_F1U "CU_PORT_FOR_F1U"
#define ENB_CONFIG_STRING_DU_TYPE "DU_TYPE"
#define ENB_CONFIG_STRING_F1_U_CU_TRANSPORT_TYPE "F1_U_CU_TRANSPORT_TYPE"
#define ENB_CONFIG_STRING_F1_U_CU_TRANSPORT_TYPE "F1_U_CU_TRANSPORT_TYPE"
#define ENB_CONFIG_STRING_DU_INTERFACES_CONFIG "DU_INTERFACES"
#define ENB_CONFIG_STRING_DU_INTERFACE_NAME_FOR_F1U "DU_INTERFACE_NAME_FOR_F1U"
#define ENB_CONFIG_STRING_DU_IPV4_ADDRESS_FOR_F1U "DU_IPV4_ADDRESS_FOR_F1U"
#define ENB_CONFIG_STRING_DU_PORT_FOR_F1U "DU_PORT_FOR_F1U"
#define ENB_CONFIG_STRING_F1_U_DU_TRANSPORT_TYPE "F1_U_DU_TRANSPORT_TYPE"
#define ENB_CONFIG_STRING_DU_INTERFACE_NAME_FOR_F1U "DU_INTERFACE_NAME_FOR_F1U"
#define ENB_CONFIG_STRING_DU_IPV4_ADDRESS_FOR_F1U "DU_IPV4_ADDRESS_FOR_F1U"
#define ENB_CONFIG_STRING_DU_PORT_FOR_F1U "DU_PORT_FOR_F1U"
#define ENB_CONFIG_STRING_F1_U_DU_TRANSPORT_TYPE "F1_U_DU_TRANSPORT_TYPE"
#define CONFIG_STRING_CU_BALANCING "CU_BALANCING"
#define CONFIG_STRING_CU_BALANCING "CU_BALANCING"
#define CUPARAMS_DESC { \
{ENB_CONFIG_STRING_CU_INTERFACE_NAME_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"eth0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_CU_IPV4_ADDRESS_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_CU_PORT_FOR_F1U, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_F1_U_CU_TRANSPORT_TYPE, NULL, 0, strptr:NULL, defstrval:"TCP", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_TYPE, NULL, 0, strptr:NULL, defstrval:"LTE", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_CU_INTERFACE_NAME_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"eth0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_CU_IPV4_ADDRESS_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_CU_PORT_FOR_F1U, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_F1_U_CU_TRANSPORT_TYPE, NULL, 0, strptr:NULL, defstrval:"TCP", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_TYPE, NULL, 0, strptr:NULL, defstrval:"LTE", TYPE_STRING, 0}, \
}
#define DUPARAMS_DESC { \
{ENB_CONFIG_STRING_DU_INTERFACE_NAME_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"eth0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_IPV4_ADDRESS_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_PORT_FOR_F1U, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_F1_U_DU_TRANSPORT_TYPE, NULL, 0, strptr:NULL, defstrval:"TCP", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_INTERFACE_NAME_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"eth0", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_IPV4_ADDRESS_FOR_F1U, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
{ENB_CONFIG_STRING_DU_PORT_FOR_F1U, NULL, 0, uptr:NULL, defintval:2210, TYPE_UINT, 0}, \
{ENB_CONFIG_STRING_F1_U_DU_TRANSPORT_TYPE, NULL, 0, strptr:NULL, defstrval:"TCP", TYPE_STRING, 0}, \
}
#define CU_BAL_DESC { \
{CONFIG_STRING_CU_BALANCING, NULL, 0, strptr:NULL, defstrval:"ALL", TYPE_STRING, 0}, \
{CONFIG_STRING_CU_BALANCING, NULL, 0, strptr:NULL, defstrval:"ALL", TYPE_STRING, 0}, \
}
#define CU_INTERFACE_F1U 0
#define CU_ADDRESS_F1U 1
#define CU_ADDRESS_F1U 1
#define CU_PORT_F1U 2
#define CU_TYPE_F1U 3
#define DU_INTERFACE_F1U 0
#define DU_ADDRESS_F1U 1
#define DU_PORT_F1U 2
#define DU_TYPE_F1U 3
#define DU_TECH 4
#define DU_INTERFACE_F1U 0
#define DU_ADDRESS_F1U 1
#define DU_PORT_F1U 2
#define DU_TYPE_F1U 3
#define DU_TECH 4
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
......@@ -1231,9 +1246,9 @@ typedef struct srb1_params_s {
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define THREAD_CONF_DESC { \
{THREAD_CONFIG_STRING_PARALLEL, CONFIG_HLP_PARALLEL, 0, strptr:NULL, defstrval:"PARALLEL_RU_L1_TRX_SPLIT", TYPE_STRING, 0}, \
{THREAD_CONFIG_STRING_WORKER, CONFIG_HLP_WORKER, 0, strptr:NULL, defstrval:"WORKER_ENABLE", TYPE_STRING, 0} \
}
{THREAD_CONFIG_STRING_PARALLEL, CONFIG_HLP_PARALLEL, 0, strptr:NULL, defstrval:"PARALLEL_RU_L1_TRX_SPLIT", TYPE_STRING, 0}, \
{THREAD_CONFIG_STRING_WORKER, CONFIG_HLP_WORKER, 0, strptr:NULL, defstrval:"WORKER_ENABLE", TYPE_STRING, 0} \
}
#define CONFIG_HLP_WORKER "coding and FEP worker thread WORKER_DISABLE or WORKER_ENABLE\n"
......
......@@ -28,20 +28,20 @@
* \email: navid.nikaein@eurecom.fr
*/
#include "rrc_defs.h"
#include "rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "RRC/LTE/MESSAGES/asn1_msg.h"
#include "rrc_eNB_UE_context.h"
#include "rrc_eNB_S1AP.h"
#include "enb_config.h"
#include "common/ran_context.h"
#include "gtpv1u.h"
# include "rrc_defs.h"
# include "rrc_extern.h"
# include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
# include "RRC/LTE/MESSAGES/asn1_msg.h"
# include "rrc_eNB_UE_context.h"
# include "rrc_eNB_S1AP.h"
# include "enb_config.h"
# include "common/ran_context.h"
# include "gtpv1u.h"
#include "s1ap_eNB.h"
#include "s1ap_eNB_defs.h"
#include "s1ap_eNB_management_procedures.h"
#include "s1ap_eNB_ue_context.h"
# include "s1ap_eNB_defs.h"
# include "s1ap_eNB_management_procedures.h"
# include "s1ap_eNB_ue_context.h"
#include "asn1_conversions.h"
#include "intertask_interface.h"
#include "pdcp.h"
......@@ -77,7 +77,7 @@ static const uint16_t S1AP_ENCRYPTION_EEA2_MASK = 0x4000;
static const uint16_t S1AP_INTEGRITY_EIA1_MASK = 0x8000;
static const uint16_t S1AP_INTEGRITY_EIA2_MASK = 0x4000;
#define INTEGRITY_ALGORITHM_NONE LTE_SecurityAlgorithmConfig__integrityProtAlgorithm_eia0_v920
#define INTEGRITY_ALGORITHM_NONE LTE_SecurityAlgorithmConfig__integrityProtAlgorithm_eia0_v920
void extract_imsi(uint8_t *pdu_buf, uint32_t pdu_len, rrc_eNB_ue_context_t *ue_context_pP) {
......@@ -242,7 +242,7 @@ rrc_eNB_S1AP_get_ue_ids(
ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance_p, eNB_ue_s1ap_id); // get s1ap_eNB_ue_context
} else {
LOG_E(S1AP, "[eNB instance %d] Couldn't find the eNB S1AP context\n",
instance);
instance);
return NULL;
}
......@@ -436,7 +436,7 @@ static e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm rrc_eNB_select_inte
int
rrc_eNB_process_security(
const protocol_ctxt_t *const ctxt_pP,
rrc_eNB_ue_context_t *const ue_context_pP,
rrc_eNB_ue_context_t *const ue_context_pP,
security_capabilities_t *security_capabilities_pP
) {
boolean_t changed = FALSE;
......@@ -642,7 +642,7 @@ rrc_eNB_send_S1AP_UPLINK_NAS(
== LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType_PR_dedicatedInfoNAS)) {
/* This message hold a dedicated info NAS payload, forward it to NAS */
struct LTE_ULInformationTransfer_r8_IEs__dedicatedInfoType *dedicatedInfoType =
&ulInformationTransfer->criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType;
&ulInformationTransfer->criticalExtensions.choice.c1.choice.ulInformationTransfer_r8.dedicatedInfoType;
uint32_t pdu_length;
uint8_t *pdu_buffer;
MessageDef *msg_p;
......@@ -997,9 +997,9 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
// create_tunnel_req.num_tunnels = i;
ret = gtpv1u_create_s1u_tunnel(
instance,
&create_tunnel_req,
&create_tunnel_resp);
instance,
&create_tunnel_req,
&create_tunnel_resp);
if ( ret != 0 ) {
LOG_E(RRC,"rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ : gtpv1u_create_s1u_tunnel failed,start to release UE %x\n",ue_context_p->ue_context.rnti);
......@@ -1063,32 +1063,32 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
// in case, send the S1SP initial context response if it is not sent with the attach complete message
if (ue_context_p->ue_context.Status == RRC_RECONFIGURED) {
LOG_I(RRC, "Sending rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP, cause %ld\n", ue_context_p->ue_context.reestablishment_cause);
LOG_I(RRC, "Sending rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP, cause %ld\n", ue_context_p->ue_context.reestablishment_cause);
//if(ue_context_p->ue_context.reestablishment_cause == ReestablishmentCause_spare1){}
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(&ctxt,ue_context_p);
}
rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(&ctxt,ue_context_p);
}
/*
if ((RC.rrc[ctxt.module_id]->node_type == ngran_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_ng_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_gNB_CU) ){
message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container = ue_p->Srb0.Tx_buffer.Payload;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_size;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_p->rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srb_id = CCCH;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).execute_duplication = 1;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_D(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
/*
if ((RC.rrc[ctxt.module_id]->node_type == ngran_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_ng_eNB_CU) ||
(RC.rrc[ctxt.module_id]->node_type == ngran_gNB_CU) ){
message_p = itti_alloc_new_message (TASK_RRC_ENB, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container = ue_p->Srb0.Tx_buffer.Payload;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rrc_container_length = ue_p->Srb0.Tx_buffer.payload_size;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_p->rnti;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).srb_id = CCCH;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).execute_duplication = 1;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).RAT_frequency_priority_information.en_dc = 0;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_D(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
}
*/
}
*/
return (0);
}
}
......@@ -1347,9 +1347,9 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
create_tunnel_req.num_tunnels = e_rab_done;
// NN: not sure if we should create a new tunnel: need to check teid, etc.
ret = gtpv1u_create_s1u_tunnel(
instance,
&create_tunnel_req,
&create_tunnel_resp);
instance,
&create_tunnel_req,
&create_tunnel_resp);
if ( ret != 0 ) {
LOG_E(RRC,"rrc_eNB_process_S1AP_E_RAB_SETUP_REQ : gtpv1u_create_s1u_tunnel failed,start to release UE %x\n",ue_context_p->ue_context.rnti);
......@@ -1859,7 +1859,7 @@ int rrc_eNB_process_PAGING_IND(MessageDef *msg_p, const char *msg_name, instance
/* set T = min(Tc,Tue) */
T = Tc < Tue ? Ttab[Tc] : Ttab[Tue];
/* set pcch_nB = PCCH-Config->nB */
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_nB;
pcch_nB = (uint32_t)RC.rrc[instance]->configuration.radioresourceconfig[CC_id].pcch_nB;
switch (pcch_nB) {
case LTE_PCCH_Config__nB_fourT:
......@@ -2005,12 +2005,12 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
rrc_ue_s1ap_ids_p->eNB_ue_s1ap_id = UE_INITIAL_ID_INVALID;
rrc_ue_s1ap_ids_p->ue_rnti = ctxt_pP->rnti;
h_rc = hashtable_insert(RC.rrc[ctxt_pP->module_id]->initial_id2_s1ap_ids,
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
rrc_ue_s1ap_ids_p);
(hash_key_t)ue_context_pP->ue_context.ue_initial_id,
rrc_ue_s1ap_ids_p);
if (h_rc != HASH_TABLE_OK) {
LOG_E(S1AP, "[eNB %d] Error while hashtable_insert in initial_id2_s1ap_ids ue_initial_id %u\n",
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
ctxt_pP->module_id, ue_context_pP->ue_context.ue_initial_id);
}
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
......@@ -2023,8 +2023,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.encryption_algorithms=ue_context_pP->ue_context.security_capabilities.encryption_algorithms;
S1AP_PATH_SWITCH_REQ (msg_p).security_capabilities.integrity_algorithms=ue_context_pP->ue_context.security_capabilities.integrity_algorithms;
LOG_I (RRC,"Path switch request: nb nb_of_e_rabs %u status %u\n",
ue_context_pP->ue_context.nb_of_e_rabs,
ue_context_pP->ue_context.e_rab[e_rab].status);
ue_context_pP->ue_context.nb_of_e_rabs,
ue_context_pP->ue_context.e_rab[e_rab].status);
memset(&create_tunnel_req, 0, sizeof(create_tunnel_req));
// the context for UE to be handovered is obtained through ho_req message
......@@ -2044,57 +2044,57 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
create_tunnel_req.rnti = ue_context_pP->ue_context.rnti;
create_tunnel_req.num_tunnels = e_rabs_done;
gtpv1u_create_s1u_tunnel(
ctxt_pP->instance,
&create_tunnel_req,
ctxt_pP->instance,
&create_tunnel_req,
&create_tunnel_resp);
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
ctxt_pP,
&create_tunnel_resp,
&inde_list[0]);
ctxt_pP,
&create_tunnel_resp,
&inde_list[0]);
for (e_rab = 0; e_rab < e_rabs_done; e_rab++) {
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid = create_tunnel_resp.enb_S1u_teid[e_rab];
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid = create_tunnel_resp.enb_S1u_teid[e_rab];
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr = create_tunnel_resp.enb_addr;
LOG_I (RRC,"enb_gtp_addr (msg index %d, e_rab index %d, status %d): nb_of_e_rabs %d, e_rab_id %d, teid: %u, addr: %d.%d.%d.%d \n ",
e_rabs_done, e_rab, ue_context_pP->ue_context.e_rab[inde_list[e_rab]].status,
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[1],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[2],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[3]);
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].gtp_teid,
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[0],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[1],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[2],
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].eNB_addr.buffer[3]);
}
// NN: add conditions for e_rabs_failed
if (e_rabs_done > 0) {
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
// NN: add conditions for e_rabs_failed
if (e_rabs_done > 0) {
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
(const char *)&S1AP_PATH_SWITCH_REQ (msg_p),
sizeof(s1ap_path_switch_req_t),
MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_id_rnti,
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
e_rabs_done);
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
} else {
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
}
MSC_LOG_TX_MESSAGE(
MSC_RRC_ENB,
MSC_S1AP_ENB,
(const char *)&S1AP_PATH_SWITCH_REQ (msg_p),
sizeof(s1ap_path_switch_req_t),
MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
MSC_AS_TIME_ARGS(ctxt_pP),
ue_context_pP->ue_id_rnti,
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
e_rabs_done);
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
} else {
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
}
return 0;
}
int rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(instance_t instance, rrc_eNB_ue_context_t *const ue_context_target_p) {
int rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(instance_t instance, rrc_eNB_ue_context_t* const ue_context_target_p) {
gtpv1u_enb_create_x2u_tunnel_req_t create_tunnel_req;
gtpv1u_enb_create_x2u_tunnel_resp_t create_tunnel_resp;
uint8_t e_rab_done;
uint8_t inde_list[NB_RB_MAX - 3]= {0};
uint8_t e_rab_done;
uint8_t inde_list[NB_RB_MAX - 3]= {0};
if (ue_context_target_p == NULL) {
return (-1);
} else {
......@@ -2107,7 +2107,7 @@ int rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(instance_t instance, rrc_eNB_ue_contex
uint8_t nb_e_rabs_tosetup = ue_context_target_p->ue_context.nb_of_e_rabs;
e_rab_done = 0;
for (i = 0; i < nb_e_rabs_tosetup; i++) {
for (i = 0;i < nb_e_rabs_tosetup; i++) {
if(ue_context_target_p->ue_context.e_rab[i].status >= E_RAB_STATUS_DONE)
continue;
......@@ -2116,7 +2116,7 @@ int rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(instance_t instance, rrc_eNB_ue_contex
i,
ue_context_target_p->ue_context.rnti,
create_tunnel_req.eps_bearer_id[i] );
inde_list[i] = e_rab_done;
inde_list[i] = e_rab_done;
e_rab_done++;
}
......@@ -2128,19 +2128,19 @@ int rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(instance_t instance, rrc_eNB_ue_contex
&create_tunnel_req,
&create_tunnel_resp);
ue_context_target_p->ue_context.nb_x2u_e_rabs = create_tunnel_resp.num_tunnels;
for (i = 0; i < create_tunnel_resp.num_tunnels; i++) {
ue_context_target_p->ue_context.enb_gtp_x2u_teid[inde_list[i]] = create_tunnel_resp.enb_X2u_teid[i];
ue_context_target_p->ue_context.enb_gtp_x2u_addrs[inde_list[i]] = create_tunnel_resp.enb_addr;
ue_context_target_p->ue_context.enb_gtp_x2u_ebi[inde_list[i]] = create_tunnel_resp.eps_bearer_id[i];
LOG_I(RRC, "rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ tunnel (%u, %u) bearer UE context index %u, msg index %u, eps bearer id %u, gtp addr len %d \n",
create_tunnel_resp.enb_X2u_teid[i],
ue_context_target_p->ue_context.enb_gtp_x2u_teid[inde_list[i]],
inde_list[i],
i,
create_tunnel_resp.eps_bearer_id[i],
create_tunnel_resp.enb_addr.length);
}
for (i = 0; i < create_tunnel_resp.num_tunnels; i++) {
ue_context_target_p->ue_context.enb_gtp_x2u_teid[inde_list[i]] = create_tunnel_resp.enb_X2u_teid[i];
ue_context_target_p->ue_context.enb_gtp_x2u_addrs[inde_list[i]] = create_tunnel_resp.enb_addr;
ue_context_target_p->ue_context.enb_gtp_x2u_ebi[inde_list[i]] = create_tunnel_resp.eps_bearer_id[i];
LOG_I(RRC, "rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ tunnel (%u, %u) bearer UE context index %u, msg index %u, eps bearer id %u, gtp addr len %d \n",
create_tunnel_resp.enb_X2u_teid[i],
ue_context_target_p->ue_context.enb_gtp_x2u_teid[inde_list[i]],
inde_list[i],
i,
create_tunnel_resp.eps_bearer_id[i],
create_tunnel_resp.enb_addr.length);
}
}
return (0);
}
......@@ -2199,14 +2199,14 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p,
if (nb_e_rabs_tobeswitched>0) {
int e_rab_switch_index=0;
for (i = 0;
i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
i++) {
/* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */
for (i = 0;
i < ue_context_p->ue_context.setup_e_rabs; // go over total number of e_rabs received through x2_ho_req msg
i++) {
/* Harmonize with enb_gtp_teid, enb_gtp_addrs, and enb_gtp_rbi vars in the top level structure */
if (ue_context_p->ue_context.e_rab[i].param.e_rab_id == S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].e_rab_id) {
ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].e_rab_id;
ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].sgw_addr;
ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].gtp_teid;
ue_context_p->ue_context.e_rab[i].param.e_rab_id = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].e_rab_id;
ue_context_p->ue_context.e_rab[i].param.sgw_addr= S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].sgw_addr;
ue_context_p->ue_context.e_rab[i].param.gtp_teid = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobeswitched[e_rab_switch_index].gtp_teid;
e_rab_switch_index++;
}
}
......@@ -2215,16 +2215,16 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p,
ue_context_p->ue_context.ue_ambr=S1AP_PATH_SWITCH_REQ_ACK (msg_p).ue_ambr;
ue_context_p->ue_context.setup_e_rabs = ue_context_p->ue_context.setup_e_rabs - ue_context_p->ue_context.nb_release_of_e_rabs;
ue_context_p->ue_context.nb_of_e_rabs = ue_context_p->ue_context.nb_of_e_rabs - ue_context_p->ue_context.nb_release_of_e_rabs;
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
memset(&delete_tunnel_req, 0 , sizeof(delete_tunnel_req));
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) {
int e_rab_release_index=0;
for (i = 0;
i < ue_context_p->ue_context.setup_e_rabs;
i++) {
for (i = 0;
i < ue_context_p->ue_context.setup_e_rabs;
i++) {
if (ue_context_p->ue_context.e_rab[i].param.e_rab_id == S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id) {
LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
LOG_I(RRC,"Bearer released with ID: %d\n", ue_context_p->ue_context.e_rab[i].param.e_rab_id);
ue_context_p->ue_context.e_rab[i].status = E_RAB_STATUS_TORELEASE;
ue_context_p->ue_context.e_rabs_tobereleased[e_rab_release_index]=S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id;
delete_tunnel_req.eps_bearer_id[e_rab_release_index] = S1AP_PATH_SWITCH_REQ_ACK (msg_p).e_rabs_tobereleased[e_rab_release_index].e_rab_id;
......@@ -2235,12 +2235,12 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p,
}
}
if (ue_context_p->ue_context.nb_release_of_e_rabs>0) {
if (ue_context_p->ue_context.nb_release_of_e_rabs>0){
delete_tunnel_req.rnti= ue_context_p->ue_context.rnti;
delete_tunnel_req.num_erab= ue_context_p->ue_context.nb_release_of_e_rabs;
/* this could also be done through ITTI message */
gtpv1u_delete_s1u_tunnel(instance,
&delete_tunnel_req);
&delete_tunnel_req);
/* TBD: release the DRB not admitted */
//rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(&ctxt, ue_context_p, 0);
}
......@@ -2248,9 +2248,9 @@ int rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK (MessageDef *msg_p,
/* Security key */
ue_context_p->ue_context.next_hop_chain_count=S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_hop_chain_count;
memcpy ( ue_context_p->ue_context.next_security_key,
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
SECURITY_KEY_LENGTH);
rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(&ctxt, ue_context_p);
S1AP_PATH_SWITCH_REQ_ACK (msg_p).next_security_key,
SECURITY_KEY_LENGTH);
rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(&ctxt, ue_context_p);
return (0);
}
}
......@@ -2265,7 +2265,7 @@ int rrc_eNB_send_X2AP_UE_CONTEXT_RELEASE(const protocol_ctxt_t *const ctxt_pP,
return (0);
}
int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id) {
int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id){
s1ap_eNB_instance_t *s1ap_eNB_instance_p = NULL;
struct s1ap_eNB_ue_context_s *ue_context_p = NULL;
s1ap_eNB_instance_p = s1ap_eNB_get_instance(instance);
......@@ -2275,7 +2275,7 @@ int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id)
eNB_ue_s1ap_id)) == NULL) {
/* The context for this eNB ue s1ap id doesn't exist in the map of eNB UEs */
LOG_W(RRC,"Failed to find ue context associated with eNB ue s1ap id: %u\n",
eNB_ue_s1ap_id);
eNB_ue_s1ap_id);
return -1;
}
......@@ -2285,11 +2285,11 @@ int s1ap_ue_context_release(instance_t instance, const uint32_t eNB_ue_s1ap_id)
if ((ue_context2_p = RB_REMOVE(s1ap_ue_map, &s1ap_eNB_instance_p->s1ap_ue_head, ue_context_p))
!= NULL) {
LOG_W(RRC,"Removed UE context eNB_ue_s1ap_id %u\n",
ue_context2_p->eNB_ue_s1ap_id);
ue_context2_p->eNB_ue_s1ap_id);
s1ap_eNB_free_ue_context(ue_context2_p);
} else {
LOG_W(RRC,"Removing UE context eNB_ue_s1ap_id %u: did not find context\n",
ue_context_p->eNB_ue_s1ap_id);
ue_context_p->eNB_ue_s1ap_id);
}
/*RB_FOREACH(ue_context_p, s1ap_ue_map, &s1ap_eNB_instance_p->s1ap_ue_head) {
......
......@@ -84,7 +84,7 @@ extern int asn1_xer_print;
break; \
} \
} \
if (mandatory) DevAssert(ie != NULL); \
/* if (mandatory) DevAssert(ie != NULL); \*/ \
} while(0)
/** \brief Function callback prototype.
......
......@@ -536,6 +536,14 @@ int x2ap_eNB_handle_x2_setup_response(instance_t instance,
return -1;
}
if((x2ap_eNB_data->state == X2AP_ENB_STATE_CONNECTED) ||
(x2ap_eNB_data->state == X2AP_ENB_STATE_READY))
{
X2AP_ERROR("Received Unexpexted X2 Setup Response Message\n");
return -1;
}
X2AP_DEBUG("Received a new X2 setup response\n");
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupResponse_IEs_t, ie, x2SetupResponse,
......@@ -662,6 +670,14 @@ int x2ap_eNB_handle_x2_setup_failure(instance_t instance,
return -1;
}
if((x2ap_eNB_data->state == X2AP_ENB_STATE_CONNECTED) ||
(x2ap_eNB_data->state == X2AP_ENB_STATE_READY))
{
X2AP_ERROR("Received Unexpexted X2 Setup Failure Message\n");
return -1;
}
X2AP_DEBUG("Received a new X2 setup failure\n");
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_X2SetupFailure_IEs_t, ie, x2SetupFailure,
......@@ -730,6 +746,7 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
X2AP_ProtocolIE_ID_id_Old_eNB_UE_X2AP_ID, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......@@ -750,7 +767,11 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
//measResultListEUTRA.list.array[ncell_index]->physCellId;
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverRequest_IEs_t, ie, x2HandoverRequest,
X2AP_ProtocolIE_ID_id_GUMMEI_ID, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
TBCD_TO_MCC_MNC(&ie->value.choice.ECGI.pLMN_Identity, X2AP_HANDOVER_REQ(msg).ue_gummei.mcc,
X2AP_HANDOVER_REQ(msg).ue_gummei.mnc, X2AP_HANDOVER_REQ(msg).ue_gummei.mnc_len);
OCTET_STRING_TO_INT8(&ie->value.choice.GUMMEI.mME_Code, X2AP_HANDOVER_REQ(msg).ue_gummei.mme_code);
......@@ -761,6 +782,7 @@ int x2ap_eNB_handle_handover_preparation (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......@@ -872,6 +894,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......@@ -882,6 +905,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......@@ -912,6 +936,7 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n", __FILE__, __LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}else{
if (ie->value.choice.E_RABs_Admitted_List.list.count > 0) {
......@@ -959,6 +984,12 @@ int x2ap_eNB_handle_handover_response (instance_t instance,
X2AP_FIND_PROTOCOLIE_BY_ID(X2AP_HandoverRequestAcknowledge_IEs_t, ie, x2HandoverRequestAck,
X2AP_ProtocolIE_ID_id_TargeteNBtoSource_eNBTransparentContainer, true);
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
X2AP_TargeteNBtoSource_eNBTransparentContainer_t *c = &ie->value.choice.TargeteNBtoSource_eNBTransparentContainer;
if (c->size > 1024 /* TODO: this is the size of rrc_buffer in struct x2ap_handover_req_ack_s */)
......@@ -1012,6 +1043,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......@@ -1022,6 +1054,7 @@ int x2ap_eNB_handle_ue_context_release (instance_t instance,
if (ie == NULL ) {
X2AP_ERROR("%s %d: ie is a NULL pointer \n",__FILE__,__LINE__);
itti_free(ITTI_MSG_ORIGIN_ID(msg), msg);
return -1;
}
......
......@@ -106,7 +106,12 @@ extern int asn1_xer_print;
if (ie == NULL ) { \
S1AP_ERROR("S1AP_FIND_PROTOCOLIE_BY_ID: %s %d: ie is NULL\n",__FILE__,__LINE__);\
} \
if (mandatory) DevAssert(ie != NULL); \
if (mandatory) { \
if (ie == NULL) { \
S1AP_ERROR("S1AP_FIND_PROTOCOLIE_BY_ID: %s %d: ie is NULL\n",__FILE__,__LINE__);\
return -1; \
} \
} \
} while(0)
/** \brief Function callback prototype.
**/
......
......@@ -58,6 +58,8 @@
#include "s1ap_eNB_ue_context.h" // test, to be removed
#include "msc.h"
#include "s1ap_eNB_timer.h"
#include "assertions.h"
#include "conversions.h"
#if defined(TEST_S1C_MME)
......@@ -73,6 +75,11 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
static int s1ap_sctp_req(s1ap_eNB_instance_t *instance_p,
s1ap_eNB_mme_data_t *s1ap_mme_data_p);
void s1ap_eNB_timer_expired(instance_t instance,
s1ap_timer_has_expired_t *msg_p);
uint32_t s1ap_generate_eNB_id(void) {
char *out;
char hostname[50];
......@@ -114,9 +121,9 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
local_ip_addr,
sizeof(*local_ip_addr));
S1AP_INFO("[eNB %d] check the mme registration state\n",instance_p->instance);
mme = NULL;
if ( mme == NULL ) {
// mme = NULL;
//
// if ( mme == NULL ) {
/* Create new MME descriptor */
s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p));
DevAssert(s1ap_mme_data_p != NULL);
......@@ -136,28 +143,33 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
* but not yet associated.
*/
RB_INSERT(s1ap_mme_map, &instance_p->s1ap_mme_head, s1ap_mme_data_p);
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
instance_p->s1ap_mme_nb ++;
// s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
s1ap_mme_data_p->state = S1AP_ENB_STATE_DISCONNECTED;
memcpy( &(s1ap_mme_data_p->mme_ip_address), mme_ip_address, sizeof(net_ip_address_t) );
s1ap_mme_data_p->overload_state = S1AP_NO_OVERLOAD;
s1ap_mme_data_p->sctp_req_cnt++;
s1ap_mme_data_p->timer_id = S1AP_TIMERID_INIT;
// instance_p->s1ap_mme_nb ++;
instance_p->s1ap_mme_pending_nb ++;
} else if (mme->state == S1AP_ENB_STATE_WAITING) {
instance_p->s1ap_mme_pending_nb ++;
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
S1AP_INFO("[eNB %d] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
instance_p->instance,
mme->state, mme->cnx_id,
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
/*s1ap_mme_data_p->cnx_id = mme->cnx_id;
sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
s1ap_mme_data_p->assoc_id = -1;
s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
*/
} else {
S1AP_WARN("[eNB %d] MME already registered but not in the waiting state, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
instance_p->instance,
mme->state, mme->cnx_id,
instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
}
// } else if (mme->state == S1AP_ENB_STATE_WAITING) {
// instance_p->s1ap_mme_pending_nb ++;
// sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
// S1AP_INFO("[eNB %d] MME already registered, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
// instance_p->instance,
// mme->state, mme->cnx_id,
// instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
// /*s1ap_mme_data_p->cnx_id = mme->cnx_id;
// sctp_new_association_req_p->ulp_cnx_id = mme->cnx_id;
//
// s1ap_mme_data_p->assoc_id = -1;
// s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
// */
// } else {
// S1AP_WARN("[eNB %d] MME already registered but not in the waiting state, retrive the data (state %d, cnx %d, mme_nb %d, mme_pending_nb %d)\n",
// instance_p->instance,
// mme->state, mme->cnx_id,
// instance_p->s1ap_mme_nb, instance_p->s1ap_mme_pending_nb);
// }
itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
}
......@@ -168,6 +180,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
uint8_t index;
DevAssert(s1ap_register_eNB != NULL);
/* Look if the provided instance already exists */
s1ap_timer_init();
new_instance = s1ap_eNB_get_instance(instance);
if (new_instance != NULL) {
......@@ -195,7 +208,7 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
new_instance->eNB_id = s1ap_register_eNB->eNB_id;
new_instance->cell_type = s1ap_register_eNB->cell_type;
new_instance->tac = s1ap_register_eNB->tac;
memcpy(&new_instance->eNB_s1_ip,
&s1ap_register_eNB->enb_ip_address,
sizeof(s1ap_register_eNB->enb_ip_address));
......@@ -206,6 +219,15 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
new_instance->mnc_digit_length[i] = s1ap_register_eNB->mnc_digit_length[i];
}
memcpy( &(new_instance->enb_ip_address), &(s1ap_register_eNB->enb_ip_address), sizeof(net_ip_address_t) );
new_instance->s1_setuprsp_wait_timer = s1ap_register_eNB->s1_setuprsp_wait_timer;
new_instance->s1_setupreq_wait_timer = s1ap_register_eNB->s1_setupreq_wait_timer;
new_instance->s1_setupreq_count = s1ap_register_eNB->s1_setupreq_count;
new_instance->sctp_req_timer = s1ap_register_eNB->sctp_req_timer;
new_instance->sctp_req_count = s1ap_register_eNB->sctp_req_count;
new_instance->sctp_in_streams = s1ap_register_eNB->sctp_in_streams;
new_instance->sctp_out_streams = s1ap_register_eNB->sctp_out_streams;
new_instance->num_plmn = s1ap_register_eNB->num_plmn;
new_instance->default_drx = s1ap_register_eNB->default_drx;
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
......@@ -216,8 +238,14 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
s1ap_register_eNB->eNB_id);
}
DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS,
S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0);
// DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS,
// S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0);
if( s1ap_register_eNB->nb_mme > S1AP_MAX_NB_MME_IP_ADDRESS )
{
S1AP_ERROR("Invalid MME number = %d\n ", s1ap_register_eNB->nb_mme);
s1ap_register_eNB->nb_mme = S1AP_MAX_NB_MME_IP_ADDRESS;
}
new_instance->s1ap_mme_nb = s1ap_register_eNB->nb_mme;
/* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
......@@ -249,28 +277,153 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) {
s1ap_eNB_instance_t *instance_p;
s1ap_eNB_mme_data_t *s1ap_mme_data_p;
s1ap_eNB_ue_context_t *ue_p = NULL;
MessageDef *message_p = NULL;
uint32_t timer_kind = 0;
struct plmn_identity_s* plmnInfo;
struct served_group_id_s* groupInfo;
struct served_gummei_s* gummeiInfo;
struct mme_code_s* mmeCode;
int8_t cnt = 0;
unsigned enb_s1ap_id[20];
DevAssert(sctp_new_association_resp != NULL);
instance_p = s1ap_eNB_get_instance(instance);
DevAssert(instance_p != NULL);
s1ap_mme_data_p = s1ap_eNB_get_MME(instance_p, -1,
sctp_new_association_resp->ulp_cnx_id);
DevAssert(s1ap_mme_data_p != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
instance,
sctp_new_association_resp->ulp_cnx_id);
s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
return;
memset(enb_s1ap_id, 0, sizeof(enb_s1ap_id) );
if( s1ap_mme_data_p->timer_id != S1AP_TIMERID_INIT )
{
s1ap_timer_remove( s1ap_mme_data_p->timer_id );
s1ap_mme_data_p->timer_id = S1AP_TIMERID_INIT;
}
if( sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED )
{
RB_FOREACH(ue_p, s1ap_ue_map, &instance_p->s1ap_ue_head)
{
if( ue_p->mme_ref == s1ap_mme_data_p )
{
enb_s1ap_id[cnt] = ue_p->eNB_ue_s1ap_id;
cnt++;
message_p = NULL;
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
if( message_p != NULL )
{
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = ue_p->eNB_ue_s1ap_id;
if( itti_send_msg_to_task(TASK_RRC_ENB, ue_p->eNB_instance->instance, message_p) < 0 )
{
S1AP_ERROR("UE Context Release Command Transmission Failure: eNB_ue_s1ap_id=%d\n", ue_p->eNB_ue_s1ap_id);
}
}
else
{
S1AP_ERROR("Invalid message_p : eNB_ue_s1ap_id=%d\n", ue_p->eNB_ue_s1ap_id);
}
}
}
for( ; cnt > 0 ; )
{
cnt--;
s1ap_ue_context_release( instance, (uint32_t)enb_s1ap_id[cnt] );
}
s1ap_mme_data_p->mme_name = 0;
s1ap_mme_data_p->overload_state = S1AP_NO_OVERLOAD;
s1ap_mme_data_p->nextstream = 0;
s1ap_mme_data_p->in_streams = 0;
s1ap_mme_data_p->out_streams = 0;
s1ap_mme_data_p->assoc_id = -1;
while (!STAILQ_EMPTY(&s1ap_mme_data_p->served_gummei))
{
gummeiInfo = STAILQ_FIRST(&s1ap_mme_data_p->served_gummei);
STAILQ_REMOVE_HEAD(&s1ap_mme_data_p->served_gummei, next);
while (!STAILQ_EMPTY(&gummeiInfo->served_plmns))
{
plmnInfo = STAILQ_FIRST(&gummeiInfo->served_plmns);
STAILQ_REMOVE_HEAD(&gummeiInfo->served_plmns, next);
free(plmnInfo);
}
while (!STAILQ_EMPTY(&gummeiInfo->served_group_ids))
{
groupInfo = STAILQ_FIRST(&gummeiInfo->served_group_ids);
STAILQ_REMOVE_HEAD(&gummeiInfo->served_group_ids, next);
free(groupInfo);
}
while (!STAILQ_EMPTY(&gummeiInfo->mme_codes))
{
mmeCode = STAILQ_FIRST(&gummeiInfo->mme_codes);
STAILQ_REMOVE_HEAD(&gummeiInfo->mme_codes, next);
free(mmeCode);
}
free(gummeiInfo);
}
STAILQ_INIT(&s1ap_mme_data_p->served_gummei);
if( s1ap_mme_data_p->state == S1AP_ENB_STATE_DISCONNECTED )
{
if( (s1ap_mme_data_p->sctp_req_cnt <= instance_p->sctp_req_count) ||
(instance_p->sctp_req_count == 0xffff) )
{
timer_kind = s1ap_mme_data_p->cnx_id;
timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | SCTP_REQ_WAIT;
if( s1ap_timer_setup( instance_p->sctp_req_timer, 0, TASK_S1AP, instance_p->instance,
timer_kind, S1AP_TIMER_ONE_SHOT, NULL, &s1ap_mme_data_p->timer_id) < 0 )
{
S1AP_ERROR("Timer Start NG(SCTP retransmission wait timer) : MME=%d\n",s1ap_mme_data_p->cnx_id);
s1ap_sctp_req( instance_p, s1ap_mme_data_p );
}
}
else
{
S1AP_ERROR("Retransmission count exceeded of SCTP : MME=%d\n",s1ap_mme_data_p->cnx_id);
}
}
else
{
S1AP_ERROR("SCTP disconnection reception : MME = %d\n",s1ap_mme_data_p->cnx_id);
if( (s1ap_mme_data_p->sctp_req_cnt <= instance_p->sctp_req_count) ||
(instance_p->sctp_req_count == 0xffff) )
{
s1ap_sctp_req( instance_p, s1ap_mme_data_p );
}
else
{
S1AP_ERROR("Retransmission count exceeded of SCTP : MME=%d\n",s1ap_mme_data_p->cnx_id);
}
s1ap_mme_data_p->state = S1AP_ENB_STATE_DISCONNECTED;
}
}
// if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
// S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
// sctp_new_association_resp->sctp_state,
// instance,
// sctp_new_association_resp->ulp_cnx_id);
// s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
// return;
// }
else
{
/* Update parameters */
s1ap_mme_data_p->assoc_id = sctp_new_association_resp->assoc_id;
s1ap_mme_data_p->in_streams = sctp_new_association_resp->in_streams;
s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams;
/* Prepare new S1 Setup Request */
s1ap_eNB_generate_s1_setup_request(instance_p, s1ap_mme_data_p);
s1ap_mme_data_p->s1_setupreq_cnt = 0;
s1ap_mme_data_p->sctp_req_cnt = 0;
if (s1ap_eNB_generate_s1_setup_request(instance_p, s1ap_mme_data_p) == -1) {
S1AP_ERROR("s1ap eNB generate s1 setup request failed\n");
return;
}
}
static
......@@ -288,9 +441,102 @@ void s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void s1ap_eNB_timer_expired(
instance_t instance,
s1ap_timer_has_expired_t *msg_p)
{
uint32_t timer_kind = 0;
int16_t line_ind = 0;
s1ap_eNB_mme_data_t *mme_desc_p = NULL;
uint32_t timer_ind = 0;
s1ap_eNB_instance_t *instance_p = NULL;
long timer_id = S1AP_TIMERID_INIT;
instance_p = s1ap_eNB_get_instance(instance);
timer_kind = msg_p->timer_kind;
line_ind = (int16_t)(timer_kind & S1AP_LINEIND);
timer_id = msg_p->timer_id;
if( (timer_kind & S1AP_MMEIND) == S1AP_MMEIND )
{
mme_desc_p = s1ap_eNB_get_MME(instance_p, -1, line_ind);
if(mme_desc_p != NULL)
{
if( timer_id == mme_desc_p->timer_id )
{
mme_desc_p->timer_id = S1AP_TIMERID_INIT;
timer_ind = timer_kind & S1AP_TIMERIND;
switch(timer_ind)
{
case S1_SETRSP_WAIT:
{
if( (instance_p->s1_setupreq_count >= mme_desc_p->s1_setupreq_cnt) ||
(instance_p->s1_setupreq_count == 0xffff) )
{
s1ap_eNB_generate_s1_setup_request( instance_p, mme_desc_p );
}
else
{
S1AP_ERROR("Retransmission count exceeded of S1 SETUP REQUEST : MME=%d\n",line_ind);
}
break;
}
case S1_SETREQ_WAIT:
{
if( (instance_p->s1_setupreq_count >= mme_desc_p->s1_setupreq_cnt) ||
(instance_p->s1_setupreq_count == 0xffff) )
{
s1ap_eNB_generate_s1_setup_request( instance_p, mme_desc_p );
}
else
{
S1AP_ERROR("Retransmission count exceeded of S1 SETUP REQUEST : MME=%d\n",line_ind);
}
break;
}
case SCTP_REQ_WAIT:
{
if( (instance_p->sctp_req_count >= mme_desc_p->sctp_req_cnt) ||
(instance_p->sctp_req_count == 0xffff) )
{
s1ap_sctp_req( instance_p, mme_desc_p );
}
else
{
S1AP_ERROR("Retransmission count exceeded of SCTP : MME=%d\n",line_ind);
}
break;
}
default:
{
S1AP_WARN("Invalid Timer indication\n");
break;
}
}
}
else
{
S1AP_DEBUG("Unmatch timer id\n");
return;
}
}
else
{
S1AP_WARN("Not applicable MME detected : connection id = %d\n", line_ind);
return;
}
}
else
{
}
return;
}
void s1ap_eNB_init(void) {
S1AP_DEBUG("Starting S1AP layer\n");
s1ap_eNB_prepare_internal_data();
s1ap_timer_init();
itti_mark_task_ready(TASK_S1AP);
MSC_START_USE();
}
......@@ -411,6 +657,13 @@ void *s1ap_eNB_process_itti_msg(void *notUsed) {
}
break;
case TIMER_HAS_EXPIRED:
{
s1ap_eNB_timer_expired(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&TIMER_HAS_EXPIRED(received_msg));
}
break;
default:
S1AP_ERROR("Received unhandled message: %d:%s\n",
ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
......@@ -451,6 +704,7 @@ static int s1ap_eNB_generate_s1_setup_request(
uint8_t *buffer = NULL;
uint32_t len = 0;
int ret = 0;
uint32_t timer_kind = 0;
DevAssert(instance_p != NULL);
DevAssert(s1ap_mme_data_p != NULL);
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
......@@ -525,6 +779,17 @@ static int s1ap_eNB_generate_s1_setup_request(
return -1;
}
timer_kind = s1ap_mme_data_p->cnx_id;
timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETRSP_WAIT;
if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT,
NULL, &s1ap_mme_data_p->timer_id) < 0 )
{
S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id);
}
s1ap_mme_data_p->s1_setupreq_cnt++;
/* Non UE-Associated signalling -> stream = 0 */
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0);
return ret;
......@@ -533,3 +798,64 @@ static int s1ap_eNB_generate_s1_setup_request(
static int s1ap_sctp_req(s1ap_eNB_instance_t *instance_p,
s1ap_eNB_mme_data_t *s1ap_mme_data_p)
{
MessageDef *message_p = NULL;
sctp_new_association_req_t *sctp_new_association_req_p = NULL;
if( instance_p == NULL )
{
S1AP_ERROR("Invalid instance_p\n");
return -1;
}
message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
sctp_new_association_req_p->in_streams = instance_p->sctp_in_streams;
sctp_new_association_req_p->out_streams = instance_p->sctp_out_streams;
sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id;
if( s1ap_mme_data_p->mme_ip_address.ipv4 != 0 )
{
memcpy(&sctp_new_association_req_p->remote_address,
&s1ap_mme_data_p->mme_ip_address,
sizeof(net_ip_address_t));
if( instance_p->enb_ip_address.ipv4 != 0 )
{
memcpy(&sctp_new_association_req_p->local_address,
&instance_p->enb_ip_address,
sizeof(net_ip_address_t));
}
else
{
S1AP_ERROR("Invalid IP Address Format V4(MME):V6\n");
return -1;
}
}
else
{
memcpy(&sctp_new_association_req_p->remote_address,
&s1ap_mme_data_p->mme_ip_address,
sizeof(net_ip_address_t));
if( instance_p->enb_ip_address.ipv6 != 0 )
{
memcpy(&sctp_new_association_req_p->local_address,
&instance_p->enb_ip_address,
sizeof(net_ip_address_t));
}
else
{
S1AP_ERROR("Invalid IP Address Format V6(MME):V4\n");
return -1;
}
}
itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
s1ap_mme_data_p->sctp_req_cnt++;
return 0;
}
......@@ -166,6 +166,10 @@ typedef struct s1ap_eNB_mme_data_s {
struct s1ap_eNB_instance_s *s1ap_eNB_instance;
uint32_t nb_calls;
net_ip_address_t mme_ip_address;
long timer_id;
uint16_t s1_setupreq_cnt;
uint16_t sctp_req_cnt;
} s1ap_eNB_mme_data_t;
typedef struct s1ap_eNB_instance_s {
......@@ -218,6 +222,14 @@ typedef struct s1ap_eNB_instance_s {
/* Default Paging DRX of the eNB as defined in TS 36.304 */
paging_drx_t default_drx;
net_ip_address_t enb_ip_address;
uint16_t s1_setuprsp_wait_timer;
uint16_t s1_setupreq_wait_timer;
uint16_t s1_setupreq_count;
uint16_t sctp_req_timer;
uint16_t sctp_req_count;
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
} s1ap_eNB_instance_t;
typedef struct {
......
......@@ -49,6 +49,7 @@
#include "assertions.h"
#include "conversions.h"
#include "msc.h"
#include "s1ap_eNB_timer.h"
static
int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
......@@ -109,6 +110,10 @@ int s1ap_eNB_handle_s1_ENDC_e_rab_modification_confirm(uint32_t as
uint32_t stream,
S1AP_S1AP_PDU_t *pdu);
static int s1ap_eNB_snd_s1_setup_request(
s1ap_eNB_instance_t *instance_p,
s1ap_eNB_mme_data_t *s1ap_mme_data_p);
/* Handlers matrix. Only eNB related procedure present here */
s1ap_message_decoded_callback messages_callback[][3] = {
{ 0, 0, 0 }, /* HandoverPreparation */
......@@ -260,6 +265,10 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_S1SetupFailure_t *container;
S1AP_S1SetupFailureIEs_t *ie;
s1ap_eNB_mme_data_t *mme_desc_p;
uint32_t interval_sec = 0;
uint32_t timer_kind = 0;
s1ap_eNB_instance_t *instance_p;
DevAssert(pdu != NULL);
container = &pdu->choice.unsuccessfulOutcome.value.choice.S1SetupFailure;
......@@ -270,7 +279,7 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
}
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
S1AP_ERROR("[SCTP %d] Received S1 setup response for non existing "
S1AP_ERROR("[SCTP %d] Received S1 setup failure for non existing "
"MME context\n", assoc_id);
return -1;
}
......@@ -278,6 +287,11 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupFailureIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_Cause,true);
if(ie == NULL)
{
return -1;
}
if ((ie->value.choice.Cause.present == S1AP_Cause_PR_misc) &&
(ie->value.choice.Cause.choice.misc == S1AP_CauseMisc_unspecified)) {
S1AP_WARN("Received s1 setup failure for MME... MME is not ready\n");
......@@ -285,8 +299,65 @@ int s1ap_eNB_handle_s1_setup_failure(uint32_t assoc_id,
S1AP_ERROR("Received s1 setup failure for MME... please check your parameters\n");
}
mme_desc_p->state = S1AP_ENB_STATE_WAITING;
s1ap_handle_s1_setup_message(mme_desc_p, 0);
if( mme_desc_p->timer_id != S1AP_TIMERID_INIT )
{
s1ap_timer_remove( mme_desc_p->timer_id );
mme_desc_p->timer_id = S1AP_TIMERID_INIT;
}
instance_p = mme_desc_p->s1ap_eNB_instance;
if( ( instance_p->s1_setupreq_count >= mme_desc_p->s1_setupreq_cnt) ||
( instance_p->s1_setupreq_count == 0xffff) )
{
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupFailureIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_TimeToWait, false);
if( ie != NULL )
{
switch(ie->value.choice.TimeToWait)
{
case S1AP_TimeToWait_v1s:
interval_sec = 1;
break;
case S1AP_TimeToWait_v2s:
interval_sec = 2;
break;
case S1AP_TimeToWait_v5s:
interval_sec = 5;
break;
case S1AP_TimeToWait_v10s:
interval_sec = 10;
break;
case S1AP_TimeToWait_v20s:
interval_sec = 20;
break;
case S1AP_TimeToWait_v60s:
interval_sec = 60;
break;
default:
interval_sec = instance_p->s1_setupreq_wait_timer;
break;
}
}
else
{
interval_sec = instance_p->s1_setupreq_wait_timer;
}
timer_kind = mme_desc_p->cnx_id;
timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETREQ_WAIT;
if( s1ap_timer_setup(interval_sec, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT,
NULL, &mme_desc_p->timer_id) < 0 )
{
S1AP_ERROR("Timer Start NG(S1 Setup Request) : MME=%d\n",mme_desc_p->cnx_id);
s1ap_eNB_snd_s1_setup_request( instance_p, mme_desc_p );
}
}
else
{
S1AP_ERROR("Retransmission count exceeded of S1 SETUP REQUEST : MME=%d\n",mme_desc_p->cnx_id);
}
return 0;
}
......@@ -313,9 +384,29 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
return -1;
}
/* Set the capacity of this MME */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_RelativeMMECapacity, true);
if(ie == NULL)
{
return -1;
}
mme_desc_p->relative_mme_capacity = ie->value.choice.RelativeMMECapacity;
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_ServedGUMMEIs, true);
if(ie == NULL)
{
return -1;
}
if( mme_desc_p->timer_id != S1AP_TIMERID_INIT )
{
s1ap_timer_remove( mme_desc_p->timer_id );
mme_desc_p->timer_id = S1AP_TIMERID_INIT;
}
mme_desc_p->s1_setupreq_cnt = 0;
mme_desc_p->sctp_req_cnt = 0;
/* The list of served gummei can contain at most 8 elements.
* LTE related gummei is the first element in the list, i.e with an id of 0.
*/
......@@ -369,11 +460,11 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
}
/* Set the capacity of this MME */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_RelativeMMECapacity, true);
mme_desc_p->relative_mme_capacity = ie->value.choice.RelativeMMECapacity;
// S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
// S1AP_ProtocolIE_ID_id_RelativeMMECapacity, true);
//
// mme_desc_p->relative_mme_capacity = ie->value.choice.RelativeMMECapacity;
//
/* Optionaly set the mme name */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_S1SetupResponseIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_MMEname, false);
......@@ -391,7 +482,7 @@ int s1ap_eNB_handle_s1_setup_response(uint32_t assoc_id,
*/
mme_desc_p->state = S1AP_ENB_STATE_CONNECTED;
mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb ++;
s1ap_handle_s1_setup_message(mme_desc_p, 0);
// s1ap_handle_s1_setup_message(mme_desc_p, 0);
return 0;
}
......@@ -724,6 +815,10 @@ int s1ap_eNB_handle_error_indication(uint32_t assoc_id,
S1AP_ProtocolIE_ID_id_CriticalityDiagnostics, false);
if (ie) {
if( ie->value.choice.CriticalityDiagnostics.procedureCode )
{
S1AP_WARN("Received S1 Error indication CriticalityDiagnostics procedureCode = %d\n", *ie->value.choice.CriticalityDiagnostics.procedureCode);
}
// TODO continue
}
......@@ -805,6 +900,33 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
&(S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).ue_ambr.br_dl));
/* id-E-RABToBeSetupListCtxtSUReq */
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
/* id-UESecurityCapabilities */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_UESecurityCapabilities, true);
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.encryption_algorithms =
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.encryptionAlgorithms);
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.integrity_algorithms =
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.integrityProtectionAlgorithms);
/* id-SecurityKey : Copy the security key */
} else {/* ie != NULL */
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_SecurityKey, true);
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
memcpy(&S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_key,
ie->value.choice.SecurityKey.buf, ie->value.choice.SecurityKey.size);
} else {/* ie != NULL */
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -850,34 +972,11 @@ int s1ap_eNB_handle_initial_context_request(uint32_t assoc_id,
item_p->e_RABlevelQoSParameters.allocationRetentionPriority.pre_emptionVulnerability;
} /* for i... */
} else {/* ie != NULL */
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
/* id-UESecurityCapabilities */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_UESecurityCapabilities, true);
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.encryption_algorithms =
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.encryptionAlgorithms);
S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_capabilities.integrity_algorithms =
BIT_STRING_to_uint16(&ie->value.choice.UESecurityCapabilities.integrityProtectionAlgorithms);
/* id-SecurityKey : Copy the security key */
} else {/* ie != NULL */
return -1;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_InitialContextSetupRequestIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_SecurityKey, true);
if (ie != NULL) { /* checked by macro but cppcheck doesn't see it */
memcpy(&S1AP_INITIAL_CONTEXT_SETUP_REQ(message_p).security_key,
ie->value.choice.SecurityKey.buf, ie->value.choice.SecurityKey.size);
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
} else {/* ie != NULL */
return -1;
}
return 0;
}
......@@ -902,6 +1001,14 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
return -1;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_UEContextReleaseCommand_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_Cause, true);
if( ie == NULL )
{
S1AP_ERROR( "Mandatory Element Nothing : UEContextReleaseCommand(Cause)\n" );
return -1;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_UEContextReleaseCommand_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_UE_S1AP_IDs, true);
......@@ -949,9 +1056,29 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
//#warning "TODO mapping mme_ue_s1ap_id enb_ue_s1ap_id?"
case S1AP_UE_S1AP_IDs_PR_mME_UE_S1AP_ID:
mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
S1AP_ERROR("TO DO mapping mme_ue_s1ap_id enb_ue_s1ap_id");
(void)mme_ue_s1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */
// mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
// S1AP_ERROR("TO DO mapping mme_ue_s1ap_id enb_ue_s1ap_id");
// (void)mme_ue_s1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */
mme_ue_s1ap_id = ie->value.choice.UE_S1AP_IDs.choice.mME_UE_S1AP_ID;
RB_FOREACH(ue_desc_p, s1ap_ue_map, &mme_desc_p->s1ap_eNB_instance->s1ap_ue_head)
{
if( ue_desc_p->mme_ue_s1ap_id == mme_ue_s1ap_id )
{
enb_ue_s1ap_id = ue_desc_p->eNB_ue_s1ap_id;
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_UE_CONTEXT_RELEASE_COMMAND);
S1AP_UE_CONTEXT_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
return 0;
}
}
S1AP_ERROR("[SCTP %d] Received UE context release command(mME_UE_S1AP_ID) for non "
"existing UE context 0x%06lx\n",
assoc_id,
mme_ue_s1ap_id);
return -1;
case S1AP_UE_S1AP_IDs_PR_NOTHING:
default:
......@@ -959,12 +1086,10 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
return -1;
}
} else {
S1AP_ERROR( "Mandatory Element Nothing : UEContextReleaseCommand(UE_S1AP_IDs)\n" );
return -1;
}
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_UEContextReleaseCommand_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_Cause, true);
/* TBD */
}
static
......@@ -983,7 +1108,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
container = &pdu->choice.initiatingMessage.value.choice.E_RABSetupRequest;
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
S1AP_ERROR("[SCTP %d] Received E-RAB setup request for non "
"existing MME context\n", assoc_id);
return -1;
}
......@@ -1010,7 +1135,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
if ((ue_desc_p = s1ap_eNB_get_ue_context(mme_desc_p->s1ap_eNB_instance,
enb_ue_s1ap_id)) == NULL) {
S1AP_ERROR("[SCTP %d] Received initial context setup request for non "
S1AP_ERROR("[SCTP %d] Received E-RAB setup request for non "
"existing UE context 0x%06lx\n", assoc_id,
enb_ue_s1ap_id);
return -1;
......@@ -1082,6 +1207,7 @@ int s1ap_eNB_handle_e_rab_setup_request(uint32_t assoc_id,
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1129,6 +1255,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.mme_code = 0;
S1AP_PAGING_IND(message_p).ue_paging_identity.choice.s_tmsi.m_tmsi = 0;
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1156,6 +1283,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
if(i != ie->value.choice.UEPagingID.choice.iMSI.size - 1) {
/* invalid paging_p->uePagingID.choise.iMSI.buffer */
S1AP_ERROR("[SCTP %d] Received Paging : uePagingID.choise.iMSI error(i %d 0x0F)\n", assoc_id,i);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
} else {
......@@ -1166,14 +1294,17 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
if (S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length >= S1AP_IMSI_LENGTH) {
/* invalid paging_p->uePagingID.choise.iMSI.size */
S1AP_ERROR("[SCTP %d] Received Paging : uePagingID.choise.iMSI.size(%d) is over IMSI length(%d)\n", assoc_id, S1AP_PAGING_IND(message_p).ue_paging_identity.choice.imsi.length, S1AP_IMSI_LENGTH);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
} else { /* of if (ie->value.choice.UEPagingID.present == S1AP_UEPagingID_PR_iMSI) */
/* invalid paging_p->uePagingID.present */
S1AP_ERROR("[SCTP %d] Received Paging : uePagingID.present(%d) is unknown\n", assoc_id, ie->value.choice.UEPagingID.present);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
} else { /* of ie != NULL */
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1206,6 +1337,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
return -1;
}
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1233,6 +1365,7 @@ int s1ap_eNB_handle_paging(uint32_t assoc_id,
S1AP_PAGING_IND(message_p).tac[i]);
}
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1326,6 +1459,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
S1AP_E_RAB_MODIFY_RESP(message_p).e_rabs_failed[nb_of_e_rabs_failed].cause_value = S1AP_CauseRadioNetwork_unknown_mme_ue_s1ap_id;
}
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1378,6 +1512,7 @@ int s1ap_eNB_handle_e_rab_modify_request(uint32_t assoc_id,
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
} else { /* of if (ie != NULL)*/
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1450,22 +1585,6 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
message_p = itti_alloc_new_message(TASK_S1AP, S1AP_E_RAB_RELEASE_COMMAND);
S1AP_E_RAB_RELEASE_COMMAND(message_p).eNB_ue_s1ap_id = enb_ue_s1ap_id;
S1AP_E_RAB_RELEASE_COMMAND(message_p).mme_ue_s1ap_id = mme_ue_s1ap_id;
/* id-NAS-PDU */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_NAS_PDU, false);
if(ie && ie->value.choice.NAS_PDU.size > 0) {
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = ie->value.choice.NAS_PDU.size;
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer =
malloc(sizeof(uint8_t) * ie->value.choice.NAS_PDU.size);
memcpy(S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer,
ie->value.choice.NAS_PDU.buf,
ie->value.choice.NAS_PDU.size);
} else {
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = 0;
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer = NULL;
}
/* id-E-RABToBeReleasedList */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_E_RABToBeReleasedList, true);
......@@ -1480,9 +1599,25 @@ int s1ap_eNB_handle_e_rab_release_command(uint32_t assoc_id,
S1AP_DEBUG("[SCTP] Received E-RAB release command for e-rab id %ld\n", item_p->e_RAB_ID);
}
} else {
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
/* id-NAS-PDU */
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_E_RABReleaseCommandIEs_t, ie, container,
S1AP_ProtocolIE_ID_id_NAS_PDU, false);
if(ie && ie->value.choice.NAS_PDU.size > 0) {
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = ie->value.choice.NAS_PDU.size;
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer =
malloc(sizeof(uint8_t) * ie->value.choice.NAS_PDU.size);
memcpy(S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer,
ie->value.choice.NAS_PDU.buf,
ie->value.choice.NAS_PDU.size);
} else {
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.length = 0;
S1AP_E_RAB_RELEASE_COMMAND(message_p).nas_pdu.buffer = NULL;
}
itti_send_msg_to_task(TASK_RRC_ENB, ue_desc_p->eNB_instance->instance, message_p);
return 0;
}
......@@ -1523,6 +1658,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1545,6 +1681,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1562,6 +1699,7 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
if (ie == NULL) {
S1AP_ERROR("[SCTP %d] Received path switch request ack for non "
"ie context is NULL\n", assoc_id);
itti_free(ITTI_MSG_ORIGIN_ID(message_p), message_p);
return -1;
}
......@@ -1575,14 +1713,10 @@ int s1ap_eNB_handle_s1_path_switch_request_ack(uint32_t assoc_id,
S1AP_ProtocolIE_ID_id_uEaggregateMaximumBitrate, false);
if (ie) {
OCTET_STRING_TO_INT32 (
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateUL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul
);
OCTET_STRING_TO_INT32 (
&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL,
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_dl
);
asn_INTEGER2ulong(&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateUL,
&S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul);
asn_INTEGER2ulong(&ie->value.choice.UEAggregateMaximumBitrate.uEaggregateMaximumBitRateDL,
&S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_dl);
} else {
S1AP_WARN("UEAggregateMaximumBitrate not supported\n");
S1AP_PATH_SWITCH_REQ_ACK(message_p).ue_ambr.br_ul = 0;
......@@ -1726,3 +1860,144 @@ int s1ap_eNB_handle_s1_ENDC_e_rab_modification_confirm(uint32_t as
return 0;
}
//-----------------------------------------------------------------------------
/*
* eNB generate a S1 setup request towards MME
*/
static int s1ap_eNB_snd_s1_setup_request(
s1ap_eNB_instance_t *instance_p,
s1ap_eNB_mme_data_t *s1ap_mme_data_p)
//-----------------------------------------------------------------------------
{
S1AP_S1AP_PDU_t pdu;
S1AP_S1SetupRequest_t *out = NULL;
S1AP_S1SetupRequestIEs_t *ie = NULL;
S1AP_SupportedTAs_Item_t *ta = NULL;
S1AP_PLMNidentity_t *plmn = NULL;
uint8_t *buffer = NULL;
uint32_t len = 0;
int ret = 0;
uint32_t timer_kind = 0;
DevAssert(instance_p != NULL);
DevAssert(s1ap_mme_data_p != NULL);
s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
/* Prepare the S1AP message to encode */
memset(&pdu, 0, sizeof(pdu));
pdu.present = S1AP_S1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage.procedureCode = S1AP_ProcedureCode_id_S1Setup;
pdu.choice.initiatingMessage.criticality = S1AP_Criticality_reject;
pdu.choice.initiatingMessage.value.present = S1AP_InitiatingMessage__value_PR_S1SetupRequest;
out = &pdu.choice.initiatingMessage.value.choice.S1SetupRequest;
/* mandatory */
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_Global_ENB_ID;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_Global_ENB_ID;
MCC_MNC_TO_PLMNID(instance_p->mcc[s1ap_mme_data_p->broadcast_plmn_index[0]],
instance_p->mnc[s1ap_mme_data_p->broadcast_plmn_index[0]],
instance_p->mnc_digit_length[s1ap_mme_data_p->broadcast_plmn_index[0]],
&ie->value.choice.Global_ENB_ID.pLMNidentity);
ie->value.choice.Global_ENB_ID.eNB_ID.present = S1AP_ENB_ID_PR_macroENB_ID;
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
&ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID);
S1AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[0],
ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[1],
ie->value.choice.Global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[2]);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
if (instance_p->eNB_name) {
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_eNBname;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_ENBname;
OCTET_STRING_fromBuf(&ie->value.choice.ENBname, instance_p->eNB_name,
strlen(instance_p->eNB_name));
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_SupportedTAs;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_SupportedTAs;
{
ta = (S1AP_SupportedTAs_Item_t *)calloc(1, sizeof(S1AP_SupportedTAs_Item_t));
INT16_TO_OCTET_STRING(instance_p->tac, &ta->tAC);
{
for (int i = 0; i < s1ap_mme_data_p->broadcast_plmn_num; ++i) {
plmn = (S1AP_PLMNidentity_t *)calloc(1, sizeof(S1AP_PLMNidentity_t));
MCC_MNC_TO_TBCD(instance_p->mcc[s1ap_mme_data_p->broadcast_plmn_index[i]],
instance_p->mnc[s1ap_mme_data_p->broadcast_plmn_index[i]],
instance_p->mnc_digit_length[s1ap_mme_data_p->broadcast_plmn_index[i]],
plmn);
ASN_SEQUENCE_ADD(&ta->broadcastPLMNs.list, plmn);
}
}
ASN_SEQUENCE_ADD(&ie->value.choice.SupportedTAs.list, ta);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* mandatory */
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_DefaultPagingDRX;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_PagingDRX;
ie->value.choice.PagingDRX = instance_p->default_drx;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */
if (0) {
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_CSG_IdList;
ie->criticality = S1AP_Criticality_reject;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_CSG_IdList;
// ie->value.choice.CSG_IdList = ;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
#if (S1AP_VERSION >= MAKE_VERSION(13, 0, 0))
if (0) {
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_UE_RetentionInformation;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_UE_RetentionInformation;
// ie->value.choice.UE_RetentionInformation = ;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
if (0) {
ie = (S1AP_S1SetupRequestIEs_t *)calloc(1, sizeof(S1AP_S1SetupRequestIEs_t));
ie->id = S1AP_ProtocolIE_ID_id_NB_IoT_DefaultPagingDRX;
ie->criticality = S1AP_Criticality_ignore;
ie->value.present = S1AP_S1SetupRequestIEs__value_PR_NB_IoT_DefaultPagingDRX;
// ie->value.choice.NB_IoT_DefaultPagingDRX = ;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
#endif /* #if (S1AP_VERSION >= MAKE_VERSION(14, 0, 0)) */
if (s1ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
S1AP_ERROR("Failed to encode S1 setup request\n");
return -1;
}
timer_kind = s1ap_mme_data_p->cnx_id;
timer_kind = timer_kind | S1AP_MMEIND;
timer_kind = timer_kind | S1_SETRSP_WAIT;
if( s1ap_timer_setup(instance_p->s1_setuprsp_wait_timer, 0, TASK_S1AP, instance_p->instance, timer_kind, S1AP_TIMER_ONE_SHOT,
NULL, &s1ap_mme_data_p->timer_id) < 0 )
{
S1AP_ERROR("Timer Start NG(S1 Setup Response) : MME=%d\n",s1ap_mme_data_p->cnx_id);
}
s1ap_mme_data_p->s1_setupreq_cnt++;
/* Non UE-Associated signalling -> stream = 0 */
s1ap_eNB_itti_send_sctp_data_req(instance_p->instance, s1ap_mme_data_p->assoc_id, buffer, len, 0);
return ret;
}
......@@ -95,23 +95,54 @@ struct s1ap_eNB_mme_data_s *s1ap_eNB_get_MME(
{
struct s1ap_eNB_mme_data_s temp;
struct s1ap_eNB_mme_data_s *found;
struct s1ap_eNB_mme_data_s *mme_p;
memset(&temp, 0, sizeof(struct s1ap_eNB_mme_data_s));
temp.assoc_id = assoc_id;
temp.cnx_id = cnx_id;
if (instance_p == NULL) {
STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
s1ap_eNB_entries) {
found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
if( cnx_id != 0 )
{
if (instance_p == NULL) {
STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
s1ap_eNB_entries) {
found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
if (found != NULL) {
return found;
if (found != NULL) {
return found;
}
}
} else {
return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
}
}
else
{
if (instance_p == NULL)
{
STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
s1ap_eNB_entries)
{
RB_FOREACH(mme_p, s1ap_mme_map, &instance_p->s1ap_mme_head)
{
if( mme_p->assoc_id == assoc_id )
{
return mme_p;
}
}
}
}
else
{
RB_FOREACH(mme_p, s1ap_mme_map, &instance_p->s1ap_mme_head)
{
if( mme_p->assoc_id == assoc_id )
{
return mme_p;
}
}
}
} else {
return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
}
return NULL;
......
......@@ -339,10 +339,18 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
container = &pdu->choice.initiatingMessage.value.choice.DownlinkNASTransport;
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_MME_UE_S1AP_ID, true);
if(ie == NULL)
{
return -1;
}
mme_ue_s1ap_id = ie->value.choice.MME_UE_S1AP_ID;
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_eNB_UE_S1AP_ID, true);
if(ie == NULL)
{
return -1;
}
enb_ue_s1ap_id = ie->value.choice.ENB_UE_S1AP_ID;
if ((ue_desc_p = s1ap_eNB_get_ue_context(s1ap_eNB_instance,
......@@ -397,6 +405,10 @@ int s1ap_eNB_handle_nas_downlink(uint32_t assoc_id,
S1AP_FIND_PROTOCOLIE_BY_ID(S1AP_DownlinkNASTransport_IEs_t, ie, container,
S1AP_ProtocolIE_ID_id_NAS_PDU, true);
if(ie == NULL)
{
return -1;
}
/* Forward the NAS PDU to RRC */
s1ap_eNB_itti_send_nas_downlink_ind(s1ap_eNB_instance->instance,
ue_desc_p->ue_initial_id,
......
......@@ -62,6 +62,10 @@ int s1ap_eNB_handle_overload_start(uint32_t assoc_id,
S1AP_OverloadResponse_PR_overloadAction,
S1AP_OverloadResponse_PR_overloadAction, 0, 0);
}
else
{
return -1;
}
/* Non UE-associated signalling -> stream 0 */
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
......
/*
* 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 <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
#include "assertions.h"
#include "intertask_interface.h"
#include "s1ap_eNB_timer.h"
#include "common/utils/LOG/log.h"
#include "queue.h"
#include "s1ap_common.h"
struct s1ap_timer_elm_s {
task_id_t task_id; ///< Task ID which has requested the timer
int32_t instance; ///< Instance of the task which has requested the timer
uint32_t timer_kind; ///< Instance of the task which has requested the timer
timer_t timer; ///< Unique timer id
timer_type_t type; ///< Timer type
void *timer_arg; ///< Optional argument that will be passed when timer expires
STAILQ_ENTRY(s1ap_timer_elm_s) entries; ///< Pointer to next element
};
typedef struct timer_desc_s {
STAILQ_HEAD(timer_list_head, s1ap_timer_elm_s) timer_queue;
pthread_mutex_t timer_list_mutex;
struct timespec timeout;
} timer_desc_t;
static timer_desc_t timer_desc;
#define TIMER_SEARCH(vAR, tIMERfIELD, tIMERvALUE, tIMERqUEUE) \
do { \
STAILQ_FOREACH(vAR, tIMERqUEUE, entries) { \
if (((vAR)->tIMERfIELD == tIMERvALUE)) \
break; \
} \
} while(0)
int s1ap_timer_timeout(sigval_t info)
{
struct s1ap_timer_elm_s *timer_p;
MessageDef *message_p;
s1ap_timer_has_expired_t *timer_expired_p;
task_id_t task_id;
int32_t instance;
uint32_t timer_kind;
timer_kind = info.sival_int;
if( pthread_mutex_lock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex lock timeout=%x\n", timer_kind);
return -1;
}
TIMER_SEARCH(timer_p, timer_kind, timer_kind, &timer_desc.timer_queue);
if( pthread_mutex_unlock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex unlock timeout=%x\n", timer_kind);
}
if (timer_p == NULL)
{
S1AP_ERROR("Didn't find timer 0x%lx in list\n", timer_kind);
return -1;
}
S1AP_DEBUG("Timer kind 0x%x has expired\n", timer_kind);
task_id = timer_p->task_id;
instance = timer_p->instance;
message_p = itti_alloc_new_message(TASK_UNKNOWN, TIMER_HAS_EXPIRED);
timer_expired_p = &message_p->ittiMsg.timer_has_expired;
timer_expired_p->timer_id = (long)timer_p->timer;
timer_expired_p->timer_kind = timer_p->timer_kind;
timer_expired_p->arg = timer_p->timer_arg;
/* Timer is a one shot timer, remove it */
if( timer_p->type == S1AP_TIMER_ONE_SHOT )
{
if( s1ap_timer_remove((long)timer_p->timer) != 0 )
{
S1AP_DEBUG("Failed to delete timer 0x%lx\n", (long)timer_p->timer);
}
}
/* Notify task of timer expiry */
if( itti_send_msg_to_task(task_id, instance, message_p) < 0 )
{
S1AP_ERROR("Failed to send msg TIMER_HAS_EXPIRED to task %u\n", task_id);
free(message_p);
return -1;
}
return 0;
}
int s1ap_timer_setup(
uint32_t interval_sec,
uint32_t interval_us,
task_id_t task_id,
int32_t instance,
uint32_t timer_kind,
timer_type_t type,
void *timer_arg,
long *timer_id)
{
struct sigevent evp;
struct itimerspec its;
struct s1ap_timer_elm_s *timer_p;
timer_t timer;
if( timer_id == NULL )
{
S1AP_ERROR("Invalid timer_id\n");
return -1;
}
if( type >= S1AP_TIMER_TYPE_MAX )
{
S1AP_ERROR("Invalid timer type (%d/%d)!\n", type, TIMER_TYPE_MAX);
return -1;
}
if( *timer_id != S1AP_TIMERID_INIT )
{
if( s1ap_timer_remove(*timer_id) != 0 )
{
S1AP_ERROR("Failed to delete timer when the timer start 0x%lx\n", *timer_id);
}
}
/* Allocate new timer list element */
timer_p = malloc(sizeof(struct s1ap_timer_elm_s));
if( timer_p == NULL )
{
S1AP_ERROR("Failed to create new timer element\n");
return -1;
}
memset(&timer, 0, sizeof(timer_t));
memset(&evp, 0, sizeof(evp));
timer_p->task_id = task_id;
timer_p->instance = instance;
timer_p->timer_kind = timer_kind;
timer_p->type = type;
timer_p->timer_arg = timer_arg;
evp.sigev_notify = (int)SIGEV_THREAD;
evp.sigev_notify_function = (void *)s1ap_timer_timeout;
evp.sigev_signo = SIGRTMIN;
evp.sigev_notify_attributes = NULL;
evp.sigev_value.sival_int = timer_kind;
/* At the timer creation, the timer structure will be filled in with timer_id,
* which is unique for this process. This id is allocated by kernel and the
* value might be used to distinguish timers.
*/
if( timer_create(CLOCK_REALTIME, &evp, &timer) < 0 )
{
S1AP_ERROR("Failed to create timer: (%s:%d)\n", strerror(errno), errno);
free(timer_p);
return -1;
}
/* Fill in the first expiration value. */
its.it_value.tv_sec = interval_sec;
its.it_value.tv_nsec = interval_us * 1000;
if( type == S1AP_TIMER_PERIODIC )
{
/* Asked for periodic timer. We set the interval time */
its.it_interval.tv_sec = interval_sec;
its.it_interval.tv_nsec = interval_us * 1000;
}
else
{
/* Asked for one-shot timer. Do not set the interval field */
its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = 0;
}
if( timer_settime(timer, 0, &its, NULL) )
{
S1AP_ERROR("Failed to Settimer: (%s:%d)\n", strerror(errno), errno);
free(timer_p);
return -1;
}
/* Simply set the timer_id argument. so it can be used by caller */
*timer_id = (long)timer;
timer_p->timer = timer;
/* Lock the queue and insert the timer at the tail */
if( pthread_mutex_lock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex lock\n");
if( timer_delete(timer_p->timer) < 0 )
{
S1AP_ERROR("Failed to delete timer 0x%lx\n", (long)timer_p->timer);
}
free(timer_p);
timer_p = NULL;
return -1;
}
STAILQ_INSERT_TAIL(&timer_desc.timer_queue, timer_p, entries);
if( pthread_mutex_unlock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex unlock\n");
}
return 0;
}
int s1ap_timer_remove(long timer_id)
{
int rc = 0;
struct s1ap_timer_elm_s *timer_p;
if( pthread_mutex_lock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex lock\n");
if( timer_delete(timer_id) < 0 )
{
S1AP_ERROR("Failed to delete timer 0x%lx\n", (long)timer_id);
}
return -1;
}
TIMER_SEARCH(timer_p, timer, ((timer_t)timer_id), &timer_desc.timer_queue);
/* We didn't find the timer in list */
if (timer_p == NULL)
{
S1AP_ERROR("Didn't find timer 0x%lx in list\n", timer_id);
if( pthread_mutex_unlock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex unlock\n");
}
return -1;
}
timer_delete(timer_p->timer);
STAILQ_REMOVE(&timer_desc.timer_queue, timer_p, s1ap_timer_elm_s, entries);
if( pthread_mutex_unlock(&timer_desc.timer_list_mutex) != 0 )
{
S1AP_ERROR("Failed to mutex unlock\n");
}
free(timer_p);
timer_p = NULL;
return rc;
}
int s1ap_timer_init(void)
{
memset(&timer_desc, 0, sizeof(timer_desc_t));
STAILQ_INIT(&timer_desc.timer_queue);
pthread_mutex_init(&timer_desc.timer_list_mutex, NULL);
return 0;
}
/*
* 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 TIMER_H_
#define TIMER_H_
#include <signal.h>
#define SIGTIMER SIGRTMIN
typedef enum s1ap_timer_type_s {
S1AP_TIMER_PERIODIC,
S1AP_TIMER_ONE_SHOT,
S1AP_TIMER_TYPE_MAX,
} s1ap_timer_type_t;
typedef struct {
void *arg;
long timer_id;
int32_t timer_kind;
} s1ap_timer_has_expired_t;
int s1ap_timer_timeout(sigval_t info);
/** \brief Request a new timer
* \param interval_sec timer interval in seconds
* \param interval_us timer interval in micro seconds
* \param task_id task id of the task requesting the timer
* \param instance instance of the task requesting the timer
* \param type timer type
* \param timer_id unique timer identifier
* @returns -1 on failure, 0 otherwise
**/
int s1ap_timer_setup(
uint32_t interval_sec,
uint32_t interval_us,
task_id_t task_id,
int32_t instance,
uint32_t timer_kind,
timer_type_t type,
void *timer_arg,
long *timer_id);
/** \brief Remove the timer from list
* \param timer_id unique timer id
* @returns -1 on failure, 0 otherwise
**/
int s1ap_timer_remove(long timer_id);
/** \brief Initialize timer task and its API
* \param mme_config MME common configuration
* @returns -1 on failure, 0 otherwise
**/
int s1ap_timer_init(void);
#define S1AP_MMEIND 0x80000000
#define S1AP_UEIND 0x00000000
#define S1_SETRSP_WAIT 0x00010000
#define S1_SETREQ_WAIT 0x00020000
#define SCTP_REQ_WAIT 0x00030000
#define S1AP_LINEIND 0x0000ffff
#define S1AP_TIMERIND 0x00ff0000
#define S1AP_TIMERID_INIT 0xffffffffffffffff
#endif
......@@ -121,6 +121,10 @@ int s1ap_eNB_handle_trace_start(uint32_t assoc_id,
if (ie != NULL) {
ue_desc_p = s1ap_eNB_get_ue_context(mme_ref_p->s1ap_eNB_instance,
ie->value.choice.ENB_UE_S1AP_ID);
}
else
{
return -1;
}
if (ue_desc_p == NULL) {
/* Could not find context associated with this eNB_ue_s1ap_id -> generate
......
......@@ -24,8 +24,8 @@
#define SCTP_OUT_STREAMS (16)
#define SCTP_IN_STREAMS (16)
#define SCTP_MAX_ATTEMPTS (2)
#define SCTP_TIMEOUT (5)
#define SCTP_MAX_ATTEMPTS (8)
#define SCTP_TIMEOUT (60000)
#define SCTP_RECV_BUFFER_SIZE (8192)
#endif /* SCTP_DEFAULT_VALUES_H_ */
......@@ -943,10 +943,12 @@ sctp_eNB_read_from_socket(
&sinfo, &flags);
if (n < 0) {
if (errno == ENOTCONN) {
if( (errno == ENOTCONN) || (errno == ECONNRESET) || (errno == ETIMEDOUT) || (errno == ECONNREFUSED) )
{
itti_unsubscribe_event_fd(TASK_SCTP, sctp_cnx->sd);
SCTP_DEBUG("Received not connected for sd %d\n", sctp_cnx->sd);
SCTP_ERROR("sctp_recvmsg (fd %d, len %d ): %s:%d\n", sctp_cnx->sd, n, strerror(errno), errno);
sctp_itti_send_association_resp(
sctp_cnx->task_id, sctp_cnx->instance, -1,
......
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