Commit 0802f49d authored by Cedric Roux's avatar Cedric Roux

- Updated s1ap configuration to handle modes where oai_emulation is not compiled

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4492 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 56d45ba3
......@@ -58,6 +58,10 @@
#include "assertions.h"
#include "conversions.h"
#if !defined(OAI_EMU)
s1ap_eNB_config_t s1ap_config;
#endif
static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
......
......@@ -39,6 +39,22 @@
#ifndef S1AP_ENB_H_
#define S1AP_ENB_H_
typedef struct s1ap_eNB_config_s {
// MME related params
unsigned char mme_enabled; ///< MME enabled ?
char mme_ip_address[16]; ///< MME IP v4 address
} s1ap_eNB_config_t;
#if defined(OAI_EMU)
# define EPC_MODE_ENABLED oai_emulation.info.s1ap_config.mme_enabled
# define EPC_MODE_MME_ADDRESS oai_emulation.info.s1ap_config.mme_ip_address
#else
extern s1ap_eNB_config_t s1ap_config;
# define EPC_MODE_ENABLED s1ap_config.mme_enabled
# define EPC_MODE_MME_ADDRESS s1ap_config.mme_ip_address
#endif
void *s1ap_eNB_task(void *arg);
uint32_t s1ap_generate_eNB_id(void);
......
......@@ -72,7 +72,9 @@
#endif
#if defined(ENABLE_USE_MME)
# if !defined(ENABLE_ITTI)
# if defined(ENABLE_ITTI)
# include "s1ap_eNB.h"
# else
# include "../../S1AP/s1ap_eNB.h"
# endif
#endif
......@@ -617,10 +619,10 @@ char openair_rrc_lite_eNB_init (u8 Mod_id)
#if defined(ENABLE_USE_MME)
/* Connect eNB to MME */
if (oai_emulation.info.mme_enabled > 0)
if (EPC_MODE_ENABLED > 0)
{
# if !defined(ENABLE_ITTI)
if (s1ap_eNB_init (oai_emulation.info.mme_ip_address, Mod_id) < 0)
if (s1ap_eNB_init (EPC_MODE_MME_ADDRESS, Mod_id) < 0)
{
mac_xface->macphy_exit ("");
return -1;
......@@ -807,7 +809,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index,
Mod_id, UE_index);
#if defined(ENABLE_USE_MME)
if (oai_emulation.info.mme_enabled == 1)
if (EPC_MODE_ENABLED == 1)
{
# if defined(ENABLE_ITTI)
eNB_rrc_inst[Mod_id].Info.UE[UE_index].e_rab[eNB_rrc_inst[Mod_id].Info.UE[UE_index].index_of_e_rabs - 1].status = E_RAB_STATUS_DONE;
......@@ -817,7 +819,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index,
}
#if defined(ENABLE_USE_MME)
if (oai_emulation.info.mme_enabled == 1)
if (EPC_MODE_ENABLED == 1)
{
eNB_RRC_UE_INFO *UE_info = &eNB_rrc_inst[Mod_id].Info.UE[UE_index];
......@@ -979,7 +981,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index,
#endif
#if defined(ENABLE_USE_MME)
if (oai_emulation.info.mme_enabled == 1)
if (EPC_MODE_ENABLED == 1)
{
eNB_RRC_UE_INFO *UE_info = &eNB_rrc_inst[Mod_id].Info.UE[UE_index];
......@@ -1019,7 +1021,7 @@ int rrc_eNB_decode_dcch (u8 Mod_id, u32 frame, u8 Srb_id, u8 UE_index,
case UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
#if defined(ENABLE_USE_MME)
{
if (oai_emulation.info.mme_enabled == 1)
if (EPC_MODE_ENABLED == 1)
# if defined(ENABLE_ITTI)
{
ULInformationTransfer_t *ulInformationTransfer = &ul_dcch_msg->message.choice.c1.choice.ulInformationTransfer;
......@@ -1332,7 +1334,7 @@ void rrc_eNB_process_RRCConnectionSetupComplete (u8 Mod_id,
// Forward message to S1AP layer
#if defined(ENABLE_USE_MME)
if (oai_emulation.info.mme_enabled == 1)
if (EPC_MODE_ENABLED == 1)
# if defined(ENABLE_ITTI)
{
MessageDef *message_p;
......
......@@ -92,6 +92,10 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
#endif
#ifdef XFORMS
#include "PHY/TOOLS/lte_phy_scope.h"
#include "stats.h"
......@@ -972,7 +976,7 @@ int main(int argc, char **argv) {
mode = normal_txrx;
while ((c = getopt_long (argc, argv, "C:ST:UdF:V",long_options,NULL)) != -1)
while ((c = getopt_long (argc, argv, "C:O:ST:UdF:V",long_options,NULL)) != -1)
{
switch (c)
{
......@@ -997,6 +1001,21 @@ int main(int argc, char **argv) {
case 'T':
tcxo=atoi(optarg);
break;
case 'O':
#if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = 1;
if (optarg == NULL) /* No IP address provided: use localhost */
{
memcpy(&EPC_MODE_MME_ADDRESS[0], "127.0.0.1", 10);
} else {
u8 ip_length = strlen(optarg) + 1;
memcpy(&EPC_MODE_MME_ADDRESS[0], optarg,
ip_length > 16 ? 16 : ip_length);
}
#else
printf("You enabled mme mode without s1ap compiled...\n");
#endif
break;
case 'F':
sprintf(rxg_fname,"%srxg.lime",optarg);
rxg_fd = fopen(rxg_fname,"r");
......
......@@ -393,9 +393,9 @@ void *l2l1_task(void *args_p) {
{
char *mme_address_v4;
if (oai_emulation.info.mme_enabled)
if (EPC_MODE_ENABLED)
{
mme_address_v4 = oai_emulation.info.mme_ip_address;
mme_address_v4 = EPC_MODE_MME_ADDRESS;
}
else
{
......
......@@ -32,6 +32,10 @@
# include "intertask_interface.h"
#endif
#if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
#endif
#ifdef SMBV
extern u8 config_smbv;
extern char smbv_ip[16];
......@@ -361,13 +365,14 @@ void get_simulation_options(int argc, char *argv[]) {
break;
case 'O':
#if defined(ENABLE_USE_MME)
oai_emulation.info.mme_enabled = 1;
EPC_MODE_ENABLED = 1;
if (optarg == NULL) /* No IP address provided: use localhost */
{
memcpy(&oai_emulation.info.mme_ip_address[0], "127.0.0.1", 10);
memcpy(&EPC_MODE_MME_ADDRESS[0], "127.0.0.1", 10);
} else {
u8 ip_length = strlen(optarg) + 1;
memcpy(&oai_emulation.info.mme_ip_address[0], optarg, ip_length > 16 ? 16 : ip_length);
memcpy(&EPC_MODE_MME_ADDRESS[0], optarg,
ip_length > 16 ? 16 : ip_length);
}
#else
printf("You enabled MME mode without MME support...\n");
......
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