Commit 4259e606 authored by Navid Nikaein's avatar Navid Nikaein

x2 setup messages and fix the compilation issues

parent 2eb2f992
......@@ -351,7 +351,9 @@ add_library(S1AP_ENB
# Same limitation as described in RRC/S1AP: unknown generated file list
# so we generate it at cmake time
##############
if (${ENABLE_X2_IF})
if (${ENABLE_USE_X2})
message("-- X2AP = enabled")
add_list1_option(X2AP_VERSION R11 "X2AP Asn.1 grammar version" R10 R11)
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
......@@ -412,6 +414,7 @@ add_library(X2AP_ENB_LIB
${X2AP_DIR}/x2ap_eNB_generate_messages.c
)
set(X2AP_ENB X2AP_ENB_LIB)
endif()
# Hardware dependant options
......@@ -613,7 +616,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi
##########################
# X2AP LAYER OPTIONS
##########################
add_boolean_option(ENABLE_X2_IF False "Enable X2 interface for X2 hanodover")
add_boolean_option(ENABLE_USE_X2 False "Enable X2 interface for X2 hanodover")
##########################
# PROJECTS (IST, FRENCH COLL., etc)
......
#!/bin/sh
echo "building ctags for openair1 and openair2 ..."
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair2/RRC/CELLULAR/ --exclude=openair2/NAS/DRIVER/CELLULAR/ --exclude=openair2/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 targets
ctags -e -R --exclude=openair1/DOCS/ --exclude=openair2/DOCS/ --exclude=openair2/RRC/CELLULAR/ --exclude=openair2/NAS/DRIVER/CELLULAR/ --exclude=openair2/SIMULATION/ --exclude=targets/DOCS/ --exclude=targets/PROJECTS/ openair1 openair2 openair3 targets cmake_targets
......@@ -57,7 +57,7 @@
# include "gtpv1u_eNB_task.h"
# endif
# if defined(ENABLE_USE_X2)
# include "x2ap.h"
# include "x2ap_eNB.h"
//# include "sctp_eNB_task.h"
//# include "gtpv1u_eNB_task.h"
#endif
......
......@@ -270,7 +270,7 @@ static void enb_config_display(void)
int i,j;
printf( "\n----------------------------------------------------------------------\n");
printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n");
printf( " ENB CONFIG FILE CONTENT LOADED for %d eNBs (TBC):\n",enb_properties.number);
printf( "----------------------------------------------------------------------\n");
for (i = 0; i < enb_properties.number; i++) {
......
......@@ -75,21 +75,6 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance,
sctp_new_association_resp_t *sctp_new_association_resp);
static
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_enb_data_p);
static
int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_enb_data_p);
static
int x2ap_eNB_generate_x2_setup_failure(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_enb_data_p);
static
void x2ap_eNB_handle_sctp_data_ind(instance_t instance,
sctp_data_ind_t *sctp_data_ind) {
......@@ -122,7 +107,7 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
DevAssert(x2ap_enb_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",
X2AP_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);
......@@ -255,7 +240,6 @@ void x2ap_eNB_handle_register_eNB(instance_t instance,
DevAssert(new_instance != NULL);
RB_INIT(&new_instance->x2ap_enb_head);
//RB_INIT(&new_instance->x2ap_ue_head);
/* Copy usefull parameters */
new_instance->instance = instance;
......@@ -314,7 +298,7 @@ void *x2ap_task(void *arg)
X2AP_DEBUG("Starting X2AP layer\n");
x2ap_prepare_internal_data();
x2ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_X2AP);
......
......@@ -120,7 +120,7 @@ x2ap_eNB_decode_initiating(x2ap_message *x2ap_message_p, X2ap_InitiatingMessage_
x2ap_xer_print_x2setuprequest_(x2ap_xer__print2sp,message_string,message);
message_id = X2AP_SETUP_REQUEST_LOG;
message_string_size = strlen(message_string);
message = itti_alloc_new_message_sized(TASK_S1AP,
message = itti_alloc_new_message_sized(TASK_X2AP,
message_id,
message_string_size + sizeof (IttiMsgText));
message->ittiMsg.x2ap_setup_request_log.size = message_string_size;
......
......@@ -51,14 +51,15 @@ typedef enum {
/* The eNB is successfully connected to another eNB. */
X2AP_ENB_STATE_CONNECTED = 0x2,
/* X2AP is ready, and the eNB is successfully connected to another eNB. */
X2AP_ENB_STATE_READY = 0x3,
/*
*/
X2AP_ENB_STATE_OVERLOAD = 0x3,
X2AP_ENB_STATE_RESETTING = 0x4,
X2AP_ENB_STATE_OVERLOAD = 0x4,
X2AP_ENB_STATE_READY = 0x5,
X2AP_ENB_STATE_RESETTING = 0x5,
/* Max number of states available */
X2AP_ENB_STATE_MAX,
......@@ -122,7 +123,7 @@ typedef struct x2ap_eNB_data_s {
} x2ap_eNB_data_t;
typedef struct x2ap_eNB_instance_s {
/* used in simulation to store multiple eNB instances*/
STAILQ_ENTRY(x2ap_eNB_instance_s) x2ap_eNB_entries;
/* Number of target eNBs requested by eNB (tree size) */
......@@ -149,7 +150,7 @@ typedef struct x2ap_eNB_instance_s {
*/
uint32_t eNB_id;
/* The type of the cell */
enum cell_type_e cell_type;
cell_type_t cell_type;
/* Tracking area code */
uint16_t tac;
......@@ -179,8 +180,7 @@ typedef struct {
int x2ap_eNB_compare_assoc_id(struct x2ap_eNB_data_s *p1, struct x2ap_eNB_data_s *p2);
/* Generate the tree management functions */
RB_PROTOTYPE(x2ap_eNB_map, x2ap_eNB_data_s, 0entry,
x2ap_eNB_compare_assoc_id);
RB_PROTOTYPE(x2ap_eNB_map, x2ap_eNB_data_s, entry, x2ap_eNB_compare_assoc_id);
#endif /* X2AP_ENB_DEFS_H_ */
......@@ -39,11 +39,9 @@
#include "intertask_interface.h"
#include "x2ap_eNB.h"
#include "x2ap_eNB_generate_messages.h"
#include "msc.h"
#include "assertions.h"
......@@ -60,7 +58,7 @@ int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
X2ap_PLMN_Identity_t broadcast_plmnIdentity_2;
X2ap_PLMN_Identity_t broadcast_plmnIdentity_3;
ServedCellItem_t *served_cell= malloc(sizeof(ServedCellItem_t));;
X2ap_ServedCellItem_t *served_cell= malloc(sizeof(X2ap_ServedCellItem_t));
uint8_t *buffer;
uint32_t len;
......@@ -72,7 +70,7 @@ int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
memset(&message, 0, sizeof(x2ap_message));
message.direction = X2AP_PDU_PR_initiatingMessage;
message.procedureCode = X2ap_ProcedureCode_id_X2Setup;
message.procedureCode = X2ap_ProcedureCode_id_x2Setup;
message.criticality = X2ap_Criticality_reject;
x2SetupRequest = &message.msg.x2SetupRequest_IEs;
......@@ -86,34 +84,34 @@ int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
x2ap_enb_data_p->state = X2AP_ENB_STATE_WAITING;
//----globalENB_ID------
x2SetupRequest->global_ENB_ID.eNB_ID.present = X2ap_ENB_ID_PR_macro_eNB_ID;
x2SetupRequest->globalENB_ID.eNB_ID.present = X2ap_ENB_ID_PR_macro_eNB_ID ;
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
&x2SetupRequest->global_ENB_ID.eNB_ID.choice.macroENB_ID);
&x2SetupRequest->globalENB_ID.eNB_ID.choice.macro_eNB_ID);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
&x2SetupRequest->global_ENB_ID.pLMNidentity);
&x2SetupRequest->globalENB_ID.pLMN_Identity);
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
x2SetupRequest->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[0],
x2SetupRequest->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[1],
x2SetupRequest->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[2]);
x2SetupRequest->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0],
x2SetupRequest->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1],
x2SetupRequest->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]);
//----served cells------
#warning update the value of the message
served_cell->servedCellInfo.pCI = 6;
served_cell->servedCellInfo.eUTRA_Mode_Info.present = EUTRA_Mode_Info_PR_fDD;
served_cell->servedCellInfo.eUTRA_Mode_Info.present = X2ap_EUTRA_Mode_Info_PR_fDD;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_EARFCN = 3350;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_EARFCN = 3350;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = 0;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = 0;
MCC_MNC_TO_PLMNID(instance_p->mcc,instance_p->mnc,&served_cell->servedCellInfo.cellId.pLMN_Identity);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_3);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_2);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_2);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_3);
ECI_TO_BIT_STRING(instance_p->eNB_id, &served_cell->servedCellInfo.cellId.eUTRANcellIdentifier);
TAC_TO_OCTET_STRING(instance_p->tac, &served_cell->servedCellInfo.tAC);
......@@ -143,16 +141,16 @@ x2ap_generate_x2_setup_response (x2ap_eNB_data_t * eNB_association)
X2SetupResponse_IEs_t *x2SetupResponse;
X2ap_PLMN_Identity_t plmnIdentity;
// X2ap_PLMN_Identity_t plmnIdentity;
X2ap_PLMN_Identity_t broadcast_plmnIdentity_1;
X2ap_PLMN_Identity_t broadcast_plmnIdentity_2;
X2ap_PLMN_Identity_t broadcast_plmnIdentity_3;
ServedCellItem_t *served_cell= malloc(sizeof(ServedCellItem_t));;
X2ap_ServedCellItem_t *served_cell= malloc(sizeof(X2ap_ServedCellItem_t));;
uint8_t *buffer;
uint32_t length;
uint32_t len;
int ret = 0;
// get the eNB instance
//
......@@ -161,70 +159,71 @@ x2ap_generate_x2_setup_response (x2ap_eNB_data_t * eNB_association)
// Generating response
memset (&message, 0, sizeof (x2ap_message));
message.direction = X2AP_PDU_PR_successfulOutcome
message.procedureCode = X2ap_ProcedureCode_id_X2Setup;
message.direction = X2AP_PDU_PR_successfulOutcome;
message.procedureCode = X2ap_ProcedureCode_id_x2Setup;
message.criticality = X2ap_Criticality_reject;
x2SetupResponse = &message.msg.x2SetupResponse_IEs;
memset((void *)&plmnIdentity, 0, sizeof(X2ap_PLMN_Identity_t));
// memset((void *)&plmnIdentity, 0, sizeof(X2ap_PLMN_Identity_t));
memset((void *)&broadcast_plmnIdentity_1, 0, sizeof(X2ap_PLMN_Identity_t));
memset((void *)&broadcast_plmnIdentity_2, 0, sizeof(X2ap_PLMN_Identity_t));
memset((void *)&broadcast_plmnIdentity_3, 0, sizeof(X2ap_PLMN_Identity_t));
//----globalENB_ID------
x2SetupResponse->global_ENB_ID.eNB_ID.present = X2ap_ENB_ID_PR_macro_eNB_ID;
MACRO_ENB_ID_TO_BIT_STRING(instance_p->eNB_id,
&x2SetupResponse->global_ENB_ID.eNB_ID.choice.macroENB_ID);
x2SetupResponse->globalENB_ID.eNB_ID.present = X2ap_ENB_ID_PR_macro_eNB_ID;
MACRO_ENB_ID_TO_BIT_STRING(instance->eNB_id,
&x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID);
MCC_MNC_TO_PLMNID(instance->mcc, instance->mnc, instance->mnc_digit_length,
&x2SetupResponse->global_ENB_ID.pLMNidentity);
&x2SetupResponse->globalENB_ID.pLMN_Identity);
X2AP_INFO("%d -> %02x%02x%02x\n", instance->eNB_id,
x2SetupResponse->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[0],
x2SetupResponse->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[1],
x2SetupResponse->global_ENB_ID.eNB_ID.choice.macroENB_ID.buf[2]);
x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[0],
x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[1],
x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf[2]);
//----served cells------
#warning update the value of the message
served_cell->servedCellInfo.pCI = 6;
served_cell->servedCellInfo.eUTRA_Mode_Info.present = EUTRA_Mode_Info_PR_fDD;
served_cell->servedCellInfo.eUTRA_Mode_Info.present = X2ap_EUTRA_Mode_Info_PR_fDD;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_EARFCN = 3350;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_EARFCN = 3350;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.uL_Transmission_Bandwidth = 0;
served_cell->servedCellInfo.eUTRA_Mode_Info.choice.fDD.dL_Transmission_Bandwidth = 0;
MCC_MNC_TO_PLMNID(instance->mcc,instance->mnc,&served_cell->servedCellInfo.cellId.pLMN_Identity);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnid_3);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_2);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnid_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_2);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_3);
ECI_TO_BIT_STRING(instance->eNB_id, &served_cell->servedCellInfo.cellId.eUTRANcellIdentifier);
TAC_TO_OCTET_STRING(instance->tac, &served_cell->servedCellInfo.tAC);
ASN_SEQUENCE_ADD(&x2SetupRequest->servedCells.list, served_cell);
ASN_SEQUENCE_ADD(&x2SetupResponse->servedCells.list, served_cell);
if (x2ap_eNB_encode_pdu(&message, &buffer, &len) < 0) {
X2AP_ERROR("Failed to encode X2 setup request\n");
return -1;
}
eNB_association->state = X2AP_ENB_STATE_READY;
MSC_LOG_TX_MESSAGE (MSC_X2AP_TARGET_ENB, MSC_X2AP_SRC_ENB, NULL, 0, "0 X2Setup/successfulOutcome assoc_id %u", eNB_association->assoc_id);
/*
* Non-UE signalling -> stream 0
*/
return x2ap_eNB_itti_send_sctp_req (buffer, length, eNB_association->assoc_id, 0);
return x2ap_eNB_itti_send_sctp_req (buffer, len, eNB_association->assoc_id, 0);
}
int x2ap_eNB_generate_x2_setup_failure ( uint32_t assoc_id,
X2ap_Cause_PR cause_type,
long cause_value,
long time_to_waitx){
long time_to_wait){
uint8_t *buffer_p;
uint32_t length;
......@@ -233,7 +232,7 @@ int x2ap_eNB_generate_x2_setup_failure ( uint32_t assoc_id,
memset (&message, 0, sizeof (x2ap_message));
x2_setup_failure_p = &message.msg.x2SetupFailure_IEs;
message.procedureCode = X2ap_ProcedureCode_id_X2Setup;
message.procedureCode = X2ap_ProcedureCode_id_x2Setup;
message.direction = X2AP_PDU_PR_unsuccessfulOutcome;
x2ap_eNB_set_cause (&x2_setup_failure_p->cause, cause_type, cause_value);
......@@ -253,31 +252,8 @@ int x2ap_eNB_generate_x2_setup_failure ( uint32_t assoc_id,
return x2ap_eNB_itti_send_sctp_request (buffer_p, length, assoc_id, 0);
}
int x2ap_eB_set_cause (S1ap_Cause_t * cause_p,
S1ap_Cause_PR cause_type,
int x2ap_eB_set_cause (X2ap_Cause_t * cause_p,
X2ap_Cause_PR cause_type,
long cause_value)
{
......
......@@ -29,6 +29,9 @@
#ifndef X2AP_ENB_GENERATE_MESSAGES_H_
#define X2AP_ENB_GENERATE_MESSAGES_H_
#include "x2ap_eNB_defs.h"
#include "x2ap_ies_defs.h"
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
x2ap_eNB_data_t *x2ap_enb_data_p);
......
......@@ -27,10 +27,10 @@
*******************************************************************************/
/*! \file s1ap_eNB_handlers.c
* \brief s1ap messages handlers for eNB part
* \author Sebastien ROUX <sebastien.roux@eurecom.fr>
* \date 2013
/*! \file x2ap_eNB_handlers.c
* \brief x2ap messages handlers for eNB part
* \author Navid Nikaein
* \date 2016
* \version 0.1
*/
......@@ -42,7 +42,6 @@
#include "x2ap_common.h"
#include "x2ap_ies_defs.h"
// #include "s1ap_eNB.h"
#include "x2ap_eNB_defs.h"
#include "x2ap_eNB_handler.h"
#include "x2ap_eNB_decoder.h"
......@@ -81,7 +80,7 @@ int x2ap_eNB_handle_initial_context_request(uint32_t assoc_id,
static
int x2ap_eNB_handle_ue_context_release_command(uint32_t assoc_id,
uint32_t stream,
struct s1ap_message_s *message_p);
struct x2ap_message_s *message_p);
/* Handlers matrix. Only eNB related procedure present here */
// x2ap_messages_callback[message.procedureCode][message.direction]
......@@ -212,15 +211,16 @@ x2ap_eNB_handle_x2_setup_request (uint32_t assoc_id,
DevAssert (message != NULL);
x2SetupRequest = &message->msg.x2SetupRequest_IEs;
/*
* We received a new valid X2 Setup Request on a stream != 0.
* * * * This should not happen -> reject eNB s1 setup request.
*/
MSC_LOG_RX_MESSAGE (MSC_X2AP_TARGET_ENB,
MSC_X2AP_SRC_ENB, NULL, 0,
"0 X2Setup/%s assoc_id %u stream %u",
x2ap_direction2String[message->direction],
assoc_id, stream);
/*
* We received a new valid X2 Setup Request on a stream != 0.
* * * * This should not happen -> reject eNB x2 setup request.
*/
if (stream != 0) {
X2AP_ERROR ("Received new x2 setup request on stream != 0\n");
......@@ -259,7 +259,7 @@ x2ap_eNB_handle_x2_setup_request (uint32_t assoc_id,
/*
* If none of the provided PLMNs/TAC match the one configured in MME,
* * * * the s1 setup should be rejected with a cause set to Unknown PLMN.
* * * * the x2 setup should be rejected with a cause set to Unknown PLMN.
*/
// ta_ret = x2ap_eNB_compare_ta_lists (&x2SetupRequest_p->supportedTAs);
......@@ -297,7 +297,7 @@ x2ap_eNB_handle_x2_setup_request (uint32_t assoc_id,
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
/*
* eNB has been fount in list, consider the s1 setup request as a reset connection,
* eNB has been fount in list, consider the x2 setup request as a reset connection,
* * * * reseting any previous UE state if sctp association is != than the previous one
*/
if (x2ap_eNB_data->assoc_id != assoc_id) {
......@@ -331,19 +331,19 @@ int x2ap_eNB_handle_x2_setup_failure(uint32_t assoc_id,
{
X2SetupFailure_IEs_t *x2_setup_failure;
x2ap_eNB_data_t *enb_desc;
x2ap_eNB_data_t *x2ap_eNB_data;
DevAssert(message_p != NULL);
x2_setup_failure = &message_p->msg.x2SetupFailure_IEs;
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
/* x2 Setup Failure == Non UE-related procedure -> stream 0 */
if (stream != 0) {
X2AP_WARN("[SCTP %d] Received s1 setup failure on stream != 0 (%d)\n",
X2AP_WARN("[SCTP %d] Received x2 setup failure on stream != 0 (%d)\n",
assoc_id, stream);
}
if ((enb_desc = x2ap_get_eNB (NULL, assoc_id, 0)) == NULL) {
if ((x2ap_eNB_data = x2ap_get_eNB (NULL, assoc_id, 0)) == NULL) {
X2AP_ERROR("[SCTP %d] Received X2 setup response for non existing "
"eNB context\n", assoc_id);
return -1;
......@@ -354,11 +354,11 @@ int x2ap_eNB_handle_x2_setup_failure(uint32_t assoc_id,
(x2_setup_failure->cause.choice.misc == X2ap_CauseMisc_unspecified)) {
X2AP_WARN("Received X2 setup failure for eNB ... eNB is not ready\n");
} else {
S1AP_ERROR("Received x2 setup failure for eNB... please check your parameters\n");
X2AP_ERROR("Received x2 setup failure for eNB... please check your parameters\n");
}
enb_desc->state = X2AP_ENB_STATE_WAITING;
x2ap_handle_x2_setup_message(enb_desc, 0);
x2ap_eNB_data->state = X2AP_ENB_STATE_WAITING;
x2ap_handle_x2_setup_message(x2ap_eNB_data, 0);
return 0;
}
......@@ -366,113 +366,108 @@ int x2ap_eNB_handle_x2_setup_failure(uint32_t assoc_id,
static
int x2ap_eNB_handle_x2_setup_response(uint32_t assoc_id,
uint32_t stream,
struct x2ap_message_s *message_p)
struct x2ap_message_s *message)
{
#ifdef TBD
S1ap_S1SetupResponseIEs_t *s1SetupResponse;
s1ap_eNB_mme_data_t *mme_desc_p;
int i;
DevAssert(message_p != NULL);
X2SetupResponse_IEs_t *x2SetupResponse;
x2ap_eNB_data_t *x2ap_eNB_data;
uint32_t eNB_id = 0;
DevAssert(message != NULL);
x2SetupResponse = &message->msg.x2SetupRequest_IEs;
s1SetupResponse_p = &message_p->msg.s1ap_S1SetupResponseIEs;
MSC_LOG_RX_MESSAGE (MSC_X2AP_TARGET_ENB,
MSC_X2AP_SRC_ENB, NULL, 0,
"0 X2Setup/%s assoc_id %u stream %u",
x2ap_direction2String[message->direction],
assoc_id, stream);
/* S1 Setup Response == Non UE-related procedure -> stream 0 */
/* X2 Setup Response == Non UE-related procedure -> stream 0 */
if (stream != 0) {
S1AP_ERROR("[SCTP %d] Received s1 setup response on stream != 0 (%d)\n",
X2AP_ERROR("[SCTP %d] Received X2 setup response on stream != 0 (%d)\n",
assoc_id, stream);
return -1;
}
if ((mme_desc_p = s1ap_eNB_get_MME(NULL, assoc_id, 0)) == NULL) {
S1AP_ERROR("[SCTP %d] Received S1 setup response for non existing "
if ((x2ap_eNB_data = x2ap_get_eNB(NULL, assoc_id, 0)) == NULL) {
X2AP_ERROR("[SCTP %d] Received X2 setup response for non existing "
"MME context\n", assoc_id);
return -1;
}
/* 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.
*/
S1AP_DEBUG("servedGUMMEIs.list.count %d\n",s1SetupResponse_p->servedGUMMEIs.list.count);
DevAssert(s1SetupResponse_p->servedGUMMEIs.list.count > 0);
DevAssert(s1SetupResponse_p->servedGUMMEIs.list.count <= 8);
for (i = 0; i < s1SetupResponse_p->servedGUMMEIs.list.count; i++) {
struct S1ap_ServedGUMMEIsItem *gummei_item_p;
struct served_gummei_s *new_gummei_p;
int j;
gummei_item_p = (struct S1ap_ServedGUMMEIsItem *)
s1SetupResponse_p->servedGUMMEIs.list.array[i];
new_gummei_p = calloc(1, sizeof(struct served_gummei_s));
/* check and store eNB info here*/
if (x2SetupResponse->globalENB_ID.eNB_ID.present == X2ap_ENB_ID_PR_home_eNB_ID) {
// Home eNB ID = 28 bits
uint8_t *eNB_id_buf = x2SetupResponse->globalENB_ID.eNB_ID.choice.home_eNB_ID.buf;
STAILQ_INIT(&new_gummei_p->served_plmns);
STAILQ_INIT(&new_gummei_p->served_group_ids);
STAILQ_INIT(&new_gummei_p->mme_codes);
if (x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 28) {
//TODO: handle case were size != 28 -> notify ? reject ?
}
S1AP_DEBUG("servedPLMNs.list.count %d\n",gummei_item_p->servedPLMNs.list.count);
for (j = 0; j < gummei_item_p->servedPLMNs.list.count; j++) {
S1ap_PLMNidentity_t *plmn_identity_p;
struct plmn_identity_s *new_plmn_identity_p;
eNB_id = (eNB_id_buf[0] << 20) + (eNB_id_buf[1] << 12) + (eNB_id_buf[2] << 4) + ((eNB_id_buf[3] & 0xf0) >> 4);
X2AP_DEBUG ("Home eNB id: %07x\n", eNB_id);
} else {
// Macro eNB = 20 bits
uint8_t *eNB_id_buf = x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.buf;
plmn_identity_p = gummei_item_p->servedPLMNs.list.array[j];
new_plmn_identity_p = calloc(1, sizeof(struct plmn_identity_s));
TBCD_TO_MCC_MNC(plmn_identity_p, new_plmn_identity_p->mcc,
new_plmn_identity_p->mnc, new_plmn_identity_p->mnc_digit_length);
STAILQ_INSERT_TAIL(&new_gummei_p->served_plmns, new_plmn_identity_p, next);
new_gummei_p->nb_served_plmns++;
if (x2SetupResponse->globalENB_ID.eNB_ID.choice.macro_eNB_ID.size != 20) {
//TODO: handle case were size != 20 -> notify ? reject ?
}
for (j = 0; j < gummei_item_p->servedGroupIDs.list.count; j++) {
S1ap_MME_Group_ID_t *mme_group_id_p;
struct served_group_id_s *new_group_id_p;
eNB_id = (eNB_id_buf[0] << 12) + (eNB_id_buf[1] << 4) + ((eNB_id_buf[2] & 0xf0) >> 4);
X2AP_DEBUG ("macro eNB id: %05x\n", eNB_id);
}
mme_group_id_p = gummei_item_p->servedGroupIDs.list.array[j];
new_group_id_p = calloc(1, sizeof(struct served_group_id_s));
OCTET_STRING_TO_INT16(mme_group_id_p, new_group_id_p->mme_group_id);
STAILQ_INSERT_TAIL(&new_gummei_p->served_group_ids, new_group_id_p, next);
new_gummei_p->nb_group_id++;
if ((x2ap_eNB_data = x2ap_is_eNB_id_in_list (eNB_id)) == NULL) {
/*
* eNB has not been fount in list of associated eNB,
* * * * Add it to the tail of list and initialize data
*/
if ((x2ap_eNB_data = x2ap_is_eNB_assoc_id_in_list (assoc_id)) == NULL) {
/*
* ??
*/
return -1;
} else {
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
x2ap_eNB_data->eNB_id = eNB_id;
}
for (j = 0; j < gummei_item_p->servedMMECs.list.count; j++) {
S1ap_MME_Code_t *mme_code_p;
struct mme_code_s *new_mme_code_p;
mme_code_p = gummei_item_p->servedMMECs.list.array[j];
new_mme_code_p = calloc(1, sizeof(struct mme_code_s));
} else {
x2ap_eNB_data->state = X2AP_ENB_STATE_RESETTING;
/*
if (x2ap_eNB_data->assoc_id != assoc_id) {
X2SetupFailure_IEs_t x2SetupFailure;
OCTET_STRING_TO_INT8(mme_code_p, new_mme_code_p->mme_code);
STAILQ_INSERT_TAIL(&new_gummei_p->mme_codes, new_mme_code_p, next);
new_gummei_p->nb_mme_code++;
memset (&x2SetupFailure, 0, sizeof (x2SetupFailure));
// Send an overload cause
X2AP_ERROR ("Rejeting x2 setup response as eNB id %d is already associated to an active sctp association" "Previous known: %d, new one: %d\n", eNB_id, x2ap_eNB_data->assoc_id, assoc_id);
x2ap_eNB_generate_x2_setup_failure (assoc_id,
X2ap_Cause_PR_protocol,
X2ap_CauseProtocol_unspecified,
-1);
return -1;
}
*/
STAILQ_INSERT_TAIL(&mme_desc_p->served_gummei, new_gummei_p, next);
/*
* TODO: call the reset procedure
*/
}
/* Free contents of the list */
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1ap_ServedGUMMEIs,
(void *)&s1SetupResponse_p->servedGUMMEIs);
/* Set the capacity of this MME */
mme_desc_p->relative_mme_capacity = s1SetupResponse_p->relativeMMECapacity;
/* Optionaly set the mme name */
if (s1SetupResponse_p->presenceMask & S1AP_S1SETUPRESPONSEIES_MMENAME_PRESENT) {
mme_desc_p->mme_name = calloc(s1SetupResponse_p->mmEname.size + 1, sizeof(char));
memcpy(mme_desc_p->mme_name, s1SetupResponse_p->mmEname.buf,
s1SetupResponse_p->mmEname.size);
/* Convert the mme name to a printable string */
mme_desc_p->mme_name[s1SetupResponse_p->mmEname.size] = '\0';
}
/* Optionaly set the target eNB name */
/* The association is now ready as eNB and MME know parameters of each other.
* Mark the association as UP to enable UE contexts creation.
/* The association is now ready as source and target eNBs know parameters of each other.
* Mark the association as connected.
*/
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);
x2ap_eNB_data->state = X2AP_ENB_STATE_READY;
x2ap_eNB_data->x2ap_eNB_instance->x2_target_enb_associated_nb ++;
x2ap_handle_x2_setup_message(x2ap_eNB_data, 0);
#endif
return 0;
}
......@@ -484,256 +479,199 @@ int x2ap_eNB_handle_error_indication(uint32_t assoc_id,
struct x2ap_message_s *message_p)
{
#ifdef TBD
X2ap_ErrorIndicationIEs_t *x2_error_indication_p;
x2ap_eNB_data_t *enb_desc_p;
X2ap_ErrorIndication_IEs_t *x2_error_indication;
x2ap_eNB_data_t *x2ap_eNB_data;
char *message_string = NULL;
DevAssert(message_p != NULL);
s1_error_indication_p = &message_p->msg.s1ap_ErrorIndicationIEs;
x2_error_indication = &message_p->msg.x2ap_ErrorIndication_IEs;
/* S1 Setup Failure == Non UE-related procedure -> stream 0 */
/* X2 Setup Failure == Non UE-related procedure -> stream 0 */
if (stream != 0) {
S1AP_WARN("[SCTP %d] Received s1 Error indication on stream != 0 (%d)\n",
X2AP_WARN("[SCTP %d] Received X2 Error indication on stream != 0 (%d)\n",
assoc_id, stream);
}
if ((mme_desc_p = x2ap_get_eNB(NULL, assoc_id, 0)) == NULL) {
S1AP_ERROR("[SCTP %d] Received S1 Error indication for non existing "
"MME context\n", assoc_id);
return -1;
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_MME_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication MME UE S1AP ID 0x%x\n", s1_error_indication_p->mme_ue_s1ap_id);
x2ap_xer_print_x2ap_errorindication_(x2ap_xer__print2sp,
message_string,
message_p);
if ( x2_error_indication->presenceMask & X2AP_ERRORINDICATION_IES_OLD_ENB_UE_X2AP_ID_PRESENT ) {
X2AP_WARN("Received X2 Error indication OLD ENB UE X2AP ID 0x%x\n", x2_error_indication->old_eNB_UE_X2AP_ID);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_ENB_UE_S1AP_ID_PRESENT) {
S1AP_WARN("Received S1 Error indication eNB UE S1AP ID 0x%x\n", s1_error_indication_p->eNB_UE_S1AP_ID);
if ( x2_error_indication->presenceMask & X2AP_ERRORINDICATION_IES_NEW_ENB_UE_X2AP_ID_PRESENT) {
X2AP_WARN("Received X2 Error indication NEW eNB UE X2AP ID 0x%x\n", x2_error_indication->new_eNB_UE_X2AP_ID);
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_CAUSE_PRESENT) {
switch(s1_error_indication_p->cause.present) {
case S1ap_Cause_PR_NOTHING:
S1AP_WARN("Received S1 Error indication cause NOTHING\n");
break;
case S1ap_Cause_PR_radioNetwork:
switch (s1_error_indication_p->cause.choice.radioNetwork) {
case S1ap_CauseRadioNetwork_unspecified:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unspecified\n");
break;
case S1ap_CauseRadioNetwork_tx2relocoverall_expiry:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_tx2relocoverall_expiry\n");
break;
case S1ap_CauseRadioNetwork_successful_handover:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_successful_handover\n");
break;
case S1ap_CauseRadioNetwork_release_due_to_eutran_generated_reason:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_release_due_to_eutran_generated_reason\n");
break;
case S1ap_CauseRadioNetwork_handover_cancelled:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_handover_cancelled\n");
break;
case S1ap_CauseRadioNetwork_partial_handover:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_partial_handover\n");
break;
case S1ap_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_ho_failure_in_target_EPC_eNB_or_target_system\n");
break;
case S1ap_CauseRadioNetwork_ho_target_not_allowed:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_ho_target_not_allowed\n");
break;
case S1ap_CauseRadioNetwork_tS1relocoverall_expiry:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_tS1relocoverall_expiry\n");
if ( x2_error_indication->presenceMask & X2AP_ERRORINDICATION_IES_CAUSE_PRESENT) {
switch(x2_error_indication->cause.present) {
case X2ap_Cause_PR_NOTHING:
X2AP_WARN("Received X2 Error indication cause NOTHING\n");
break;
case S1ap_CauseRadioNetwork_tS1relocprep_expiry:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_tS1relocprep_expiry\n");
case X2ap_Cause_PR_radioNetwork:
switch (x2_error_indication->cause.choice.radioNetwork) {
case X2ap_CauseRadioNetwork_handover_desirable_for_radio_reasons:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_handover_desirable_for_radio_reasons\n");
break;
case S1ap_CauseRadioNetwork_cell_not_available:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_cell_not_available\n");
case X2ap_CauseRadioNetwork_time_critical_handover:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_time_critical_handover\n");
break;
case S1ap_CauseRadioNetwork_unknown_targetID:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unknown_targetID\n");
case X2ap_CauseRadioNetwork_resource_optimisation_handover:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_resource_optimisation_handover\n");
break;
case S1ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell\n");
case X2ap_CauseRadioNetwork_reduce_load_in_serving_cell:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_reduce_load_in_serving_cell\n");
break;
case S1ap_CauseRadioNetwork_unknown_mme_ue_s1ap_id:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unknown_mme_ue_s1ap_id\n");
case X2ap_CauseRadioNetwork_partial_handover:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_partial_handover\n");
break;
case S1ap_CauseRadioNetwork_unknown_enb_ue_s1ap_id:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unknown_enb_ue_s1ap_id\n");
case X2ap_CauseRadioNetwork_unknown_new_eNB_UE_X2AP_ID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unknown_new_eNB_UE_X2AP_ID\n");
break;
case S1ap_CauseRadioNetwork_unknown_pair_ue_s1ap_id:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unknown_pair_ue_s1ap_id\n");
case X2ap_CauseRadioNetwork_unknown_old_eNB_UE_X2AP_ID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unknown_old_eNB_UE_X2AP_ID\n");
break;
case S1ap_CauseRadioNetwork_handover_desirable_for_radio_reason:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_handover_desirable_for_radio_reason\n");
case X2ap_CauseRadioNetwork_unknown_pair_of_UE_X2AP_ID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unknown_pair_of_UE_X2AP_ID\n");
break;
case S1ap_CauseRadioNetwork_time_critical_handover:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_time_critical_handover\n");
case X2ap_CauseRadioNetwork_ho_target_not_allowed:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_ho_target_not_allowed\n");
break;
case S1ap_CauseRadioNetwork_resource_optimisation_handover:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_resource_optimisation_handover\n");
case X2ap_CauseRadioNetwork_tx2relocoverall_expiry:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_tx2relocoverall_expiry\n");
break;
case S1ap_CauseRadioNetwork_reduce_load_in_serving_cell:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_reduce_load_in_serving_cell\n");
case X2ap_CauseRadioNetwork_trelocprep_expiry:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_trelocprep_expiry\n");
break;
case S1ap_CauseRadioNetwork_user_inactivity:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_user_inactivity\n");
case X2ap_CauseRadioNetwork_cell_not_available:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_cell_not_available\n");
break;
case S1ap_CauseRadioNetwork_radio_connection_with_ue_lost:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_radio_connection_with_ue_lost\n");
case X2ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_no_radio_resources_available_in_target_cell\n");
break;
case S1ap_CauseRadioNetwork_load_balancing_tau_required:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_load_balancing_tau_required\n");
case X2ap_CauseRadioNetwork_invalid_MME_GroupID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_invalid_MME_GroupID\n");
break;
case S1ap_CauseRadioNetwork_cs_fallback_triggered:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_cs_fallback_triggered\n");
case X2ap_CauseRadioNetwork_unknown_MME_Code:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unknown_MME_Code\n");
break;
case S1ap_CauseRadioNetwork_ue_not_available_for_ps_service:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_ue_not_available_for_ps_service\n");
case X2ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported\n");
break;
case S1ap_CauseRadioNetwork_radio_resources_not_available:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_radio_resources_not_available\n");
case X2ap_CauseRadioNetwork_reportCharacteristicsEmpty:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_reportCharacteristicsEmpty\n");
break;
case S1ap_CauseRadioNetwork_failure_in_radio_interface_procedure:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_failure_in_radio_interface_procedure\n");
case X2ap_CauseRadioNetwork_noReportPeriodicity:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_noReportPeriodicity\n");
break;
case S1ap_CauseRadioNetwork_invals1ap_id_qos_combination:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_invals1ap_id_qos_combination\n");
case X2ap_CauseRadioNetwork_existingMeasurementID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_existingMeasurementID\n");
break;
case S1ap_CauseRadioNetwork_interrat_redirection:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_interrat_redirection\n");
case X2ap_CauseRadioNetwork_unknown_eNB_Measurement_ID:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unknown_eNB_Measurement_ID\n");
break;
case S1ap_CauseRadioNetwork_interaction_with_other_procedure:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_interaction_with_other_procedure\n");
case X2ap_CauseRadioNetwork_measurement_temporarily_not_available:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_measurement_temporarily_not_available\n");
break;
case S1ap_CauseRadioNetwork_unknown_E_RAB_ID:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_unknown_E_RAB_ID\n");
case X2ap_CauseRadioNetwork_unspecified:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_unspecified\n");
break;
case S1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_multiple_E_RAB_ID_instances\n");
case X2ap_CauseRadioNetwork_load_balancing:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_load_balancing\n");
break;
case S1ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_encryption_and_or_integrity_protection_algorithms_not_supported\n");
case X2ap_CauseRadioNetwork_handover_optimisation:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_handover_optimisation\n");
break;
case S1ap_CauseRadioNetwork_s1_intra_system_handover_triggered:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_s1_intra_system_handover_triggered\n");
case X2ap_CauseRadioNetwork_value_out_of_allowed_range:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_value_out_of_allowed_range\n");
break;
case S1ap_CauseRadioNetwork_s1_inter_system_handover_triggered:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_s1_inter_system_handover_triggered\n");
case X2ap_CauseRadioNetwork_multiple_E_RAB_ID_instances:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_multiple_E_RAB_ID_instances\n");
break;
case S1ap_CauseRadioNetwork_x2_handover_triggered:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_x2_handover_triggered\n");
case X2ap_CauseRadioNetwork_switch_off_ongoing:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_switch_off_ongoing\n");
break;
case S1ap_CauseRadioNetwork_redirection_towards_1xRTT:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_redirection_towards_1xRTT\n");
break;
case S1ap_CauseRadioNetwork_not_supported_QCI_value:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_not_supported_QCI_value\n");
break;
case S1ap_CauseRadioNetwork_invals1ap_id_CSG_Id:
S1AP_WARN("Received S1 Error indication S1ap_CauseRadioNetwork_invals1ap_id_CSG_Id\n");
break;
default:
S1AP_WARN("Received S1 Error indication cause radio network case not handled\n");
}
case X2ap_CauseRadioNetwork_not_supported_QCI_value:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_not_supported_QCI_value\n");
break;
case X2ap_CauseRadioNetwork_measurement_not_supported_for_the_object:
X2AP_WARN("Received X2 Error indication X2ap_CauseRadioNetwork_measurement_not_supported_for_the_object\n");
case S1ap_Cause_PR_transport:
switch (s1_error_indication_p->cause.choice.transport) {
case S1ap_CauseTransport_transport_resource_unavailable:
S1AP_WARN("Received S1 Error indication S1ap_CauseTransport_transport_resource_unavailable\n");
break;
case S1ap_CauseTransport_unspecified:
S1AP_WARN("Received S1 Error indication S1ap_CauseTransport_unspecified\n");
break;
default:
S1AP_WARN("Received S1 Error indication cause transport case not handled\n");
X2AP_WARN("Received X2 Error indication cause radio network case not handled\n");
}
break;
case S1ap_Cause_PR_nas:
switch (s1_error_indication_p->cause.choice.nas) {
case S1ap_CauseNas_normal_release:
S1AP_WARN("Received S1 Error indication S1ap_CauseNas_normal_release\n");
break;
case S1ap_CauseNas_authentication_failure:
S1AP_WARN("Received S1 Error indication S1ap_CauseNas_authentication_failure\n");
break;
case S1ap_CauseNas_detach:
S1AP_WARN("Received S1 Error indication S1ap_CauseNas_detach\n");
case X2ap_Cause_PR_transport:
switch (x2_error_indication->cause.choice.transport) {
case X2ap_CauseTransport_transport_resource_unavailable:
X2AP_WARN("Received X2 Error indication X2ap_CauseTransport_transport_resource_unavailable\n");
break;
case S1ap_CauseNas_unspecified:
S1AP_WARN("Received S1 Error indication S1ap_CauseNas_unspecified\n");
break;
case S1ap_CauseNas_csg_subscription_expiry:
S1AP_WARN("Received S1 Error indication S1ap_CauseNas_csg_subscription_expiry\n");
case X2ap_CauseTransport_unspecified:
X2AP_WARN("Received X2 Error indication SX2ap_CauseTransport_unspecified\n");
break;
default:
S1AP_WARN("Received S1 Error indication cause nas case not handled\n");
X2AP_WARN("Received X2 Error indication cause transport case not handled\n");
}
break;
case S1ap_Cause_PR_protocol:
switch (s1_error_indication_p->cause.choice.protocol) {
case S1ap_CauseProtocol_transfer_syntax_error:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_transfer_syntax_error\n");
case X2ap_Cause_PR_protocol:
switch (x2_error_indication->cause.choice.protocol) {
case X2ap_CauseProtocol_transfer_syntax_error:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_transfer_syntax_error\n");
break;
case S1ap_CauseProtocol_abstract_syntax_error_reject:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_abstract_syntax_error_reject\n");
case X2ap_CauseProtocol_abstract_syntax_error_reject:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_abstract_syntax_error_reject\n");
break;
case S1ap_CauseProtocol_abstract_syntax_error_ignore_and_notify:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_abstract_syntax_error_ignore_and_notify\n");
case X2ap_CauseProtocol_abstract_syntax_error_ignore_and_notify:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_abstract_syntax_error_ignore_and_notify\n");
break;
case S1ap_CauseProtocol_message_not_compatible_with_receiver_state:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_message_not_compatible_with_receiver_state\n");
case X2ap_CauseProtocol_message_not_compatible_with_receiver_state:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_message_not_compatible_with_receiver_state\n");
break;
case S1ap_CauseProtocol_semantic_error:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_semantic_error\n");
case X2ap_CauseProtocol_semantic_error:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_semantic_error\n");
break;
case S1ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message\n");
case X2ap_CauseProtocol_unspecified:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_unspecified\n");
break;
case S1ap_CauseProtocol_unspecified:
S1AP_WARN("Received S1 Error indication S1ap_CauseProtocol_unspecified\n");
case X2ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message:
X2AP_WARN("Received X2 Error indication X2ap_CauseProtocol_abstract_syntax_error_falsely_constructed_message\n");
break;
default:
S1AP_WARN("Received S1 Error indication cause protocol case not handled\n");
X2AP_WARN("Received X2 Error indication cause protocol case not handled\n");
}
break;
case S1ap_Cause_PR_misc:
switch (s1_error_indication_p->cause.choice.protocol) {
case S1ap_CauseMisc_control_processing_overload:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_control_processing_overload\n");
break;
case S1ap_CauseMisc_not_enough_user_plane_processing_resources:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_not_enough_user_plane_processing_resources\n");
case X2ap_Cause_PR_misc:
switch (x2_error_indication->cause.choice.protocol) {
case X2ap_CauseMisc_control_processing_overload:
X2AP_WARN("Received X2 Error indication X2ap_CauseMisc_control_processing_overload\n");
break;
case S1ap_CauseMisc_hardware_failure:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_hardware_failure\n");
case X2ap_CauseMisc_hardware_failure:
X2AP_WARN("Received X2 Error indication X2ap_CauseMisc_hardware_failure\n");
break;
case S1ap_CauseMisc_om_intervention:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_om_intervention\n");
case X2ap_CauseMisc_om_intervention:
X2AP_WARN("Received X2 Error indication X2ap_CauseMisc_om_intervention\n");
break;
case S1ap_CauseMisc_unspecified:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_unspecified\n");
case X2ap_CauseMisc_not_enough_user_plane_processing_resources:
X2AP_WARN("Received X2 Error indication X2ap_CauseMisc_not_enough_user_plane_processing_resources\n");
break;
case S1ap_CauseMisc_unknown_PLMN:
S1AP_WARN("Received S1 Error indication S1ap_CauseMisc_unknown_PLMN\n");
case X2ap_CauseMisc_unspecified:
X2AP_WARN("Received X2 Error indication X2ap_CauseMisc_unspecified\n");
break;
default:
S1AP_WARN("Received S1 Error indication cause misc case not handled\n");
X2AP_WARN("Received X2 Error indication cause misc case not handled\n");
}
break;
}
}
if ( s1_error_indication_p->presenceMask & S1AP_ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT) {
if ( x2_error_indication->presenceMask &X2AP_ERRORINDICATION_IES_CRITICALITYDIAGNOSTICS_PRESENT) {
// TODO continue
}
// TODO continue
#endif
return 0;
}
......
......@@ -26,6 +26,13 @@
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file x2ap_eNB_itti_messaging.c
* \brief itti interface between x2ap and sctp
* \author Navid Nikaein
* \date 2016
* \version 0.1
*/
#include "intertask_interface.h"
#include "x2ap_eNB_itti_messaging.h"
......
......@@ -27,6 +27,13 @@
*******************************************************************************/
/*! \file x2ap_eNB_management_procedures.c
* \brief x2ap eNb management procedures
* \author Navid Nikaein
* \date 2016
* \version 0.1
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
......@@ -48,8 +55,6 @@
# define X2AP_eNB_LIST_OUT(x, args...)
#endif
STAILQ_HEAD (x2ap_eNB_list_s, x2ap_eNB_data_s)
x2ap_eNB_list_head;
static int indent = 0;
......@@ -150,34 +155,42 @@ x2ap_eNB_instance_t *x2ap_eNB_get_instance(instance_t instance)
void
x2ap_dump_eNB_list (void) {
x2ap_eNB_data_t *eNB_ref;
x2ap_eNB_instance_t *inst = NULL;
struct x2ap_eNB_data_s *found = NULL;
struct x2ap_eNB_data_s *temp = NULL;
memset(&temp, 0, sizeof(struct x2ap_eNB_data_s));
STAILQ_FOREACH (eNB_ref, &x2ap_eNB_list_head, x2ap_eNB_entries) {
x2ap_dump_eNB (eNB_ref);
STAILQ_FOREACH (inst, &x2ap_eNB_internal_data.x2ap_eNB_instances_head, x2ap_eNB_entries) {
found = RB_FIND(x2ap_enb_map, &inst->x2ap_enb_head, &temp);
x2ap_dump_eNB (found);
}
}
void x2ap_dump_eNB ( x2ap_eNB_data_t * eNB_ref)
{
void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref) {
if (eNB_ref == NULL) {
return;
}
eNB_LIST_OUT ("");
eNB_LIST_OUT ("eNB name: %s", eNB_ref->eNB_name == NULL ? "not present" : eNB_ref->eNB_name);
eNB_LIST_OUT ("eNB STATE: %07x", eNB_ref->state);
eNB_LIST_OUT ("eNB ID: %07x", eNB_ref->eNB_id);
indent++;
eNB_LIST_OUT ("SCTP cnx id: %d", eNB_ref->cnx_id);
eNB_LIST_OUT ("SCTP assoc id: %d", eNB_ref->assoc_id);
eNB_LIST_OUT ("SCTP instreams: %d", eNB_ref->instreams);
eNB_LIST_OUT ("SCTP outstreams: %d", eNB_ref->outstreams);
eNB_LIST_OUT ("SCTP instreams: %d", eNB_ref->in_streams);
eNB_LIST_OUT ("SCTP outstreams: %d", eNB_ref->out_streams);
indent--;
}
x2ap_eNB_data_t * x2ap_is_eNB_id_in_list (const uint32_t eNB_id)
{
x2ap_eNB_data_t *eNB_ref;
x2ap_eNB_instance_t *eNB_ref;
STAILQ_FOREACH (eNB_ref, &x2ap_eNB_list_head, x2ap_eNB_entries) {
STAILQ_FOREACH (eNB_ref, &x2ap_eNB_internal_data.x2ap_eNB_instances_head, x2ap_eNB_entries) {
if (eNB_ref->eNB_id == eNB_id) {
return eNB_ref;
......@@ -188,12 +201,17 @@ x2ap_eNB_data_t * x2ap_is_eNB_id_in_list (const uint32_t eNB_id)
x2ap_eNB_data_t * x2ap_is_eNB_assoc_id_in_list (const uint32_t sctp_assoc_id)
{
x2ap_eNB_data_t *eNB_ref;
x2ap_eNB_instance_t *inst = NULL;
struct x2ap_eNB_data_s *found = NULL;
struct x2ap_eNB_data_s *temp = NULL;
STAILQ_FOREACH (eNB_ref, &x2ap_eNB_list_head, x2ap_eNB_entries) {
if (eNB_ref->sctp_assoc_id == sctp_assoc_id) {
STAILQ_FOREACH (inst, &x2ap_eNB_internal_data.x2ap_eNB_instances_head, x2ap_eNB_entries) {
return eNB_ref;
found = RB_FIND(x2ap_enb_map, &inst->x2ap_enb_head, &temp);
if (found != NULL){
if (found->assoc_id == sctp_assoc_id) {
return found;
}
}
}
return NULL;
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ( "eNB_X2_HO1","eNB_X2_HO2");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -10,7 +10,7 @@ eNBs =
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
eNB_name = "eNB_X2_HO1";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
......@@ -142,7 +142,7 @@ eNBs =
///X2
target_enb_x2_ip_address = ( { ipv4 = "10.0.1.1";
target_enb_x2_ip_address = ( { ipv4 = "127.0.0.1";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -158,8 +158,189 @@ eNBs =
ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.100/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_INTERFACE_NAME_FOR_X2C = "eth0";
ENB_IPV4_ADDRESS_FOR_X2C = "10.0.1.100/24";
ENB_INTERFACE_NAME_FOR_X2C = "lo";
ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1/24";
ENB_PORT_FOR_X2C = 1234; # Spec ?
ENB_INTERFACE_NAME_FOR_X2U = "eth0";
ENB_IPV4_ADDRESS_FOR_X2U = "10.0.1.100/24";
ENB_PORT_FOR_X2U = 1234; # Spec ?
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
},
{
////////// Identification parameters:
eNB_ID = 0xe10;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_X2_HO2";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 90;
rx_gain = 120;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = -29;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 1;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -90;
pusch_alpha = "AL1";
pucch_p0_Nominal = -96;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 4;
rach_preambleInitialReceivedTargetPower = -108;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "10.0.1.1";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
///X2
target_enb_x2_ip_address = ( { ipv4 = "127.0.0.1";
ipv6 = "192:168:30::17";
active = "no";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "10.0.1.100/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "10.0.1.100/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_INTERFACE_NAME_FOR_X2C = "lo";
ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1/24";
ENB_PORT_FOR_X2C = 1234; # Spec ?
ENB_INTERFACE_NAME_FOR_X2U = "eth0";
......
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