Commit 09e2b149 authored by Navid Nikaein's avatar Navid Nikaein

Create x2ap task, and fix the x2 compilation issues

parent 4259e606
......@@ -353,7 +353,7 @@ add_library(S1AP_ENB
##############
if (${ENABLE_USE_X2})
message("-- X2AP = enabled")
message("-- X2AP = ${ENABLE_USE_X2}")
add_list1_option(X2AP_VERSION R11 "X2AP Asn.1 grammar version" R10 R11)
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
......
......@@ -298,10 +298,12 @@ extern int asn1_xer_print;
#if defined(ENB_MODE)
# include "log.h"
# define X2AP_INFO(x, args...) LOG_I(X2AP, x, ##args)
# define X2AP_ERROR(x, args...) LOG_E(X2AP, x, ##args)
# define X2AP_WARN(x, args...) LOG_W(X2AP, x, ##args)
# define X2AP_DEBUG(x, args...) LOG_D(X2AP, x, ##args)
#else
# define X2AP_INFO(x, args...) do { fprintf(stdout, "[X2AP][I]"x, ##args); } while(0)
# define X2AP_ERROR(x, args...) do { fprintf(stdout, "[X2AP][E]"x, ##args); } while(0)
# define X2AP_WARN(x, args...) do { fprintf(stdout, "[X2AP][W]"x, ##args); } while(0)
# define X2AP_DEBUG(x, args...) do { fprintf(stdout, "[X2AP][D]"x, ##args); } while(0)
......
......@@ -49,9 +49,9 @@
#include "assertions.h"
int x2ap_decode_initiating(x2ap_message *x2ap_message_p, X2ap_InitiatingMessage_t *initiating_p);
int x2ap_decode_successful(x2ap_message *x2ap_message_p, X2ap_SuccessfulOutcome_t *successful_p);
int x2ap_decode_unsuccessful(x2ap_message *x2ap_message_p, X2ap_UnsuccessfulOutcome_t *unsuccessful_p);
int x2ap_eNB_decode_initiating(x2ap_message *x2ap_message_p, X2ap_InitiatingMessage_t *initiating_p);
int x2ap_eNB_decode_successful(x2ap_message *x2ap_message_p, X2ap_SuccessfulOutcome_t *successful_p);
int x2ap_eNB_decode_unsuccessful(x2ap_message *x2ap_message_p, X2ap_UnsuccessfulOutcome_t *unsuccessful_p);
int x2ap_eNB_decode_pdu(x2ap_message *x2ap_message_p, uint8_t *buffer, uint32_t len) {
X2AP_PDU_t pdu;
......@@ -227,7 +227,7 @@ x2ap_eNB_decode_successful(x2ap_message *x2ap_message_p, X2ap_SuccessfulOutcome_
}
int
x2ap_decode_unsuccessful(x2ap_message *x2ap_message_p, X2ap_UnsuccessfulOutcome_t *unsuccessful_p) {
x2ap_eNB_decode_unsuccessful(x2ap_message *x2ap_message_p, X2ap_UnsuccessfulOutcome_t *unsuccessful_p) {
int ret = -1;
MessageDef *message;
......
......@@ -43,6 +43,7 @@
#include "msc.h"
#include "assertions.h"
#include "conversions.h"
int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
......@@ -104,10 +105,11 @@ int x2ap_eNB_generate_x2_setup_request(x2ap_eNB_instance_t *instance_p,
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_plmnIdentity_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_3);
MCC_MNC_TO_PLMNID(instance_p->mcc,instance_p->mnc,instance_p->mnc_digit_length,
&served_cell->servedCellInfo.cellId.pLMN_Identity);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc,instance_p->mnc_digit_length,&broadcast_plmnIdentity_1);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc,instance_p->mnc_digit_length,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc,instance_p->mnc_digit_length,&broadcast_plmnIdentity_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_2);
......@@ -192,10 +194,10 @@ x2ap_generate_x2_setup_response (x2ap_eNB_data_t * eNB_association)
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_plmnIdentity_1);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(0,0,&broadcast_plmnIdentity_3);
MCC_MNC_TO_PLMNID(instance->mcc,instance->mnc,instance->mnc_digit_length,&served_cell->servedCellInfo.cellId.pLMN_Identity);
MCC_MNC_TO_PLMNID(instance->mcc, instance->mnc, instance->mnc_digit_length,&broadcast_plmnIdentity_1);
MCC_MNC_TO_PLMNID(instance->mcc, instance->mnc, instance->mnc_digit_length,&broadcast_plmnIdentity_2);
MCC_MNC_TO_PLMNID(instance->mcc, instance->mnc, instance->mnc_digit_length,&broadcast_plmnIdentity_3);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_1);
ASN_SEQUENCE_ADD(&served_cell->servedCellInfo.broadcastPLMNs.list, &broadcast_plmnIdentity_2);
......@@ -216,7 +218,7 @@ x2ap_generate_x2_setup_response (x2ap_eNB_data_t * eNB_association)
/*
* Non-UE signalling -> stream 0
*/
return x2ap_eNB_itti_send_sctp_req (buffer, len, eNB_association->assoc_id, 0);
return x2ap_eNB_itti_send_sctp_data_req (buffer, len, eNB_association->assoc_id, 0);
}
......@@ -249,10 +251,10 @@ int x2ap_eNB_generate_x2_setup_failure ( uint32_t assoc_id,
MSC_X2AP_TARGET_ENB, NULL, 0,
"0 X2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
assoc_id, cause_type, cause_value);
return x2ap_eNB_itti_send_sctp_request (buffer_p, length, assoc_id, 0);
return x2ap_eNB_itti_send_sctp_data_req (buffer_p, length, assoc_id, 0);
}
int x2ap_eB_set_cause (X2ap_Cause_t * cause_p,
int x2ap_eNB_set_cause (X2ap_Cause_t * cause_p,
X2ap_Cause_PR cause_type,
long cause_value)
{
......
......@@ -33,8 +33,7 @@ void x2ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uin
uint32_t buffer_length, uint16_t stream);
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance,
int32_t assoc_id);
void x2ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id);
#endif /* X2AP_ENB_ITTI_MESSAGING_H_ */
......@@ -173,15 +173,15 @@ void x2ap_dump_eNB (x2ap_eNB_data_t * eNB_ref) {
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);
X2AP_eNB_LIST_OUT ("");
X2AP_eNB_LIST_OUT ("eNB name: %s", eNB_ref->eNB_name == NULL ? "not present" : eNB_ref->eNB_name);
X2AP_eNB_LIST_OUT ("eNB STATE: %07x", eNB_ref->state);
X2AP_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->in_streams);
eNB_LIST_OUT ("SCTP outstreams: %d", eNB_ref->out_streams);
X2AP_eNB_LIST_OUT ("SCTP cnx id: %d", eNB_ref->cnx_id);
X2AP_eNB_LIST_OUT ("SCTP assoc id: %d", eNB_ref->assoc_id);
X2AP_eNB_LIST_OUT ("SCTP instreams: %d", eNB_ref->in_streams);
X2AP_eNB_LIST_OUT ("SCTP outstreams: %d", eNB_ref->out_streams);
indent--;
}
......
......@@ -197,6 +197,26 @@ do { \
(oCTETsTRING)->size = 3; \
} while(0)
#define ECI_TO_BIT_STRING(eci, bitstring) \
do { \
(bitstring)->size=4; \
(bitstring)->bits_unused=4; \
(bitstring)->buf=calloc (4, sizeof (uint8_t)); \
(bitstring)->buf[0] = (eci) >> 20; \
(bitstring)->buf[1] = (eci) >> 12; \
(bitstring)->buf[2] = (eci) >> 4; \
(bitstring)->buf[3] = (eci) << 4; \
}while(0)
#define TAC_TO_OCTET_STRING(tac, octetstring)\
do { \
(octetstring)->size=2; \
(octetstring)->buf=calloc (2, sizeof (uint8_t)); \
(octetstring)->buf[0] = (tac) >> 8; \
(octetstring)->buf[1] = (tac); \
}while(0)
#define MCC_MNC_TO_TBCD(mCC, mNC, mNCdIGITlENGTH, tBCDsTRING) \
do { \
char _buf[3]; \
......
......@@ -40,6 +40,9 @@
# include "udp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# endif
# if defined (ENABLE_USE_X2)
# include "x2ap_eNB.h"
# endif
# if ENABLE_RAL
# include "lteRALue.h"
# include "lteRALenb.h"
......@@ -87,6 +90,12 @@ int create_tasks(uint32_t enb_nb, uint32_t ue_nb)
# endif
}
# endif
#if defined(ENABLE_USE_X2)
if (itti_create_task (TASK_X2AP, x2ap_task, NULL) < 0) {
LOG_E(X2AP, "Create task for X2AP failed\n");
return -1;
}
#endif
if (enb_nb > 0) {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
......
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