Commit 31965637 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' into feature-34-test_framework

parents ef6f2e2a c4cb8f47
...@@ -176,42 +176,65 @@ add_definitions(-DCMAKER) ...@@ -176,42 +176,65 @@ add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
Message("RF_BOARD is ${RF_BOARD}")
# Below has been put in comment because does not work with set(GIT_BRANCH "UNKNOWN")
# SVN authentication. set(GIT_COMMIT_HASH "UNKNOWN")
# set(GIT_COMMIT_DATE "UNKNOWN")
#find_package(Subversion)
#if(SUBVERSION_FOUND)
# Subversion_WC_INFO(${OPENAIR_DIR} openair) find_package(Git)
# set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}") if(GIT_FOUND)
# Subversion_WC_LOG(${OPENAIR_DIR} Project) message("git found: ${GIT_EXECUTABLE}")
#else() # Get the current working branch
# set (FIRMWARE_VERSION "No svn information") execute_process(
#endif() COMMAND git rev-parse --abbrev-ref HEAD
#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest commit date of the working branch
execute_process(
COMMAND git log -1 --format=%cd
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# Below is a hard-coded info # Below is a hard-coded info
set (FIRMWARE_VERSION "No svn information") set (FIRMWARE_VERSION "No svn information")
add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"") add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"") add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
# Debug related options # Debug related options
######################################### #########################################
add_boolean_option(MSG_PRINT False "print debug messages") add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format") add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(XER_PRINT False "print XER Format") add_boolean_option(MSG_PRINT False "print debug messages")
add_boolean_option(RRC_MSG_PRINT False "print RRC messages") add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log") add_boolean_option(XER_PRINT False "print XER Format")
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace
add_boolean_option(TEST_OMG False "???") add_boolean_option(TEST_OMG False "???")
add_boolean_option(DEBUG_OMG False "???") add_boolean_option(DEBUG_OMG False "???")
add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope") add_boolean_option(XFORMS False "This adds the possibility to see the signal oscilloscope")
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status") add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering") add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
...@@ -322,6 +345,7 @@ set(S1AP_OAI_generated ...@@ -322,6 +345,7 @@ set(S1AP_OAI_generated
${S1AP_C_DIR}/s1ap_decoder.c ${S1AP_C_DIR}/s1ap_decoder.c
${S1AP_C_DIR}/s1ap_encoder.c ${S1AP_C_DIR}/s1ap_encoder.c
${S1AP_C_DIR}/s1ap_xer_print.c ${S1AP_C_DIR}/s1ap_xer_print.c
${S1AP_C_DIR}/s1ap_compare.c
${S1AP_C_DIR}/s1ap_ies_defs.h ${S1AP_C_DIR}/s1ap_ies_defs.h
) )
file(GLOB s1ap_h ${S1AP_C_DIR}/*.h) file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
...@@ -1086,7 +1110,6 @@ add_library(CN_UTILS ...@@ -1086,7 +1110,6 @@ add_library(CN_UTILS
${OPENAIR3_DIR}/UTILS/conversions.c ${OPENAIR3_DIR}/UTILS/conversions.c
${OPENAIR3_DIR}/UTILS/enum_string.c ${OPENAIR3_DIR}/UTILS/enum_string.c
${OPENAIR3_DIR}/UTILS/log.c ${OPENAIR3_DIR}/UTILS/log.c
${OPENAIR3_DIR}/UTILS/mme_config.c
${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
) )
...@@ -1427,6 +1450,9 @@ include(FindPkgConfig) ...@@ -1427,6 +1450,9 @@ include(FindPkgConfig)
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED) pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIRS}) include_directories(${LIBXML2_INCLUDE_DIRS})
pkg_search_module(LIBXSLT libxslt REQUIRED)
include_directories(${LIBXSLT_INCLUDE_DIRS})
pkg_search_module(OPENSSL openssl REQUIRED) pkg_search_module(OPENSSL openssl REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIRS}) include_directories(${OPENSSL_INCLUDE_DIRS})
...@@ -1718,6 +1744,7 @@ endforeach(myExe) ...@@ -1718,6 +1744,7 @@ endforeach(myExe)
add_executable(test_epc_generate_scenario add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c
${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h
${OPENAIR2_DIR}/ENB_APP/enb_config.h ${OPENAIR2_DIR}/ENB_APP/enb_config.h
${OPENAIR2_DIR}/COMMON/commonDef.h ${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h ${OPENAIR2_DIR}/COMMON/messages_def.h
...@@ -1726,7 +1753,28 @@ add_executable(test_epc_generate_scenario ...@@ -1726,7 +1753,28 @@ add_executable(test_epc_generate_scenario
${OPENAIR_BIN_DIR}/messages_xml.h ${OPENAIR_BIN_DIR}/messages_xml.h
) )
target_link_libraries (test_epc_generate_scenario target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES} -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
)
add_executable(test_epc_play_scenario
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h
${OPENAIR2_DIR}/COMMON/messages_types.h
${OPENAIR_BIN_DIR}/messages_xml.h
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
) )
......
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" ) set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ASN_DEBUG False)
set ( ADDR_CONF False ) set ( ADDR_CONF False )
set ( DEBUG_OMG False ) set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False ) set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True ) set ( DRIVER2013 True )
set ( EMOS False ) set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True ) set ( ENABLE_FXP True )
set ( ENABLE_ITTI True ) set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True ) set ( ENABLE_NAS_UE_LOGGING True )
...@@ -47,9 +49,9 @@ set ( OAI_EMU False ) ...@@ -47,9 +49,9 @@ set ( OAI_EMU False )
set ( OAISIM False ) set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False ) set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True ) set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 False ) set ( OPENAIR1 True )
set ( OPENAIR2 False ) set ( OPENAIR2 True )
set ( OPENAIR_LTE F ) set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "epc_test" ) set ( PACKAGE_NAME "epc_test" )
set ( PBS_SIM False ) set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True ) set ( PDCP_USE_NETLINK True )
...@@ -74,4 +76,4 @@ set ( SMBV False ) ...@@ -74,4 +76,4 @@ set ( SMBV False )
set ( TEST_OMG False ) set ( TEST_OMG False )
set ( USE_MME "R10" ) set ( USE_MME "R10" )
set ( USER_MODE True ) set ( USER_MODE True )
set ( XER_PRINT False ) set ( XER_PRINT True )
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
################################################################################ ################################################################################
# file build_helper # file build_helper
# brief # brief
# author Laurent Thomas # authors Laurent Thomas, Lionel GAUTHIER
# #
####################################### #######################################
SUDO='sudo -E' SUDO='sudo -E'
...@@ -269,7 +269,9 @@ check_install_oai_software() { ...@@ -269,7 +269,9 @@ check_install_oai_software() {
pydb \ pydb \
wvdial \ wvdial \
python-numpy \ python-numpy \
sshpass sshpass \
libxslt1-dev
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
if [ `lsb_release -rs` = '12.04' ] ; then if [ `lsb_release -rs` = '12.04' ] ; then
install_nettle_from_source install_nettle_from_source
...@@ -291,10 +293,12 @@ install_asn1c_from_source(){ ...@@ -291,10 +293,12 @@ install_asn1c_from_source(){
$SUDO rm -rf /tmp/asn1c-r1516 $SUDO rm -rf /tmp/asn1c-r1516
mkdir -p /tmp/asn1c-r1516 mkdir -p /tmp/asn1c-r1516
cd /tmp/asn1c-r1516 cd /tmp/asn1c-r1516
svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 rm -rf /tmp/asn1c-r1516/*
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516 > /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 >> /tmp/log_compile_asn1c
patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 >> /tmp/log_compile_asn1c
./configure ./configure
make -j`nproc` make -j`nproc`
$SUDO make install $SUDO make install
...@@ -324,7 +328,6 @@ install_nas_tools() { ...@@ -324,7 +328,6 @@ install_nas_tools() {
} }
################################ ################################
# set_openair_env # set_openair_env
############################### ###############################
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# Contact Information # Contact Information
# OpenAirInterface Admin: openair_admin@eurecom.fr # OpenAirInterface Admin: openair_admin@eurecom.fr
# OpenAirInterface Tech : openair_tech@eurecom.fr # OpenAirInterface Tech : openair_tech@eurecom.fr
# OpenAirInterface Dev : openair4g-devel@eurecom.fr # OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
# #
# Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE # Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
# #
...@@ -121,6 +121,7 @@ function main() ...@@ -121,6 +121,7 @@ function main()
echo "Cleaning TEST_EPC" echo "Cleaning TEST_EPC"
fi fi
rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
rm -Rf build 2>&1 rm -Rf build 2>&1
mkdir -m 777 -p -v build mkdir -m 777 -p -v build
fi fi
...@@ -140,6 +141,13 @@ function main() ...@@ -140,6 +141,13 @@ function main()
compilations \ compilations \
epc_test test_epc_generate_scenario \ epc_test test_epc_generate_scenario \
test_epc_generate_scenario $dbin/test_epc_generate_scenario test_epc_generate_scenario $dbin/test_epc_generate_scenario
compilations \
epc_test test_epc_play_scenario \
test_epc_play_scenario $dbin/test_epc_play_scenario
$SUDO cp -upv test_epc_generate_scenario /usr/local/bin
$SUDO cp -upv test_epc_play_scenario /usr/local/bin
} }
......
...@@ -48,7 +48,19 @@ Description Contains global common definitions ...@@ -48,7 +48,19 @@ Description Contains global common definitions
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <stdbool.h>
typedef signed char boolean_t;
#if !defined(TRUE)
#define TRUE (boolean_t)0x01
#endif
#if !defined(FALSE)
#define FALSE (boolean_t)0x00
#endif
#define BOOL_NOT(b) (b^TRUE)
#define NAS_UE_ID_FMT "0x%06x" #define NAS_UE_ID_FMT "0x%06x"
...@@ -59,13 +71,6 @@ Description Contains global common definitions ...@@ -59,13 +71,6 @@ Description Contains global common definitions
#define RETURNok (0) #define RETURNok (0)
#define RETURNerror (-1) #define RETURNerror (-1)
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (1)
#endif
/* /*
* Name of the environment variable which defines the default directory * Name of the environment variable which defines the default directory
* where the NAS application is executed and where are located files * where the NAS application is executed and where are located files
......
...@@ -112,7 +112,7 @@ typedef struct net_ip_address_s { ...@@ -112,7 +112,7 @@ typedef struct net_ip_address_s {
unsigned ipv4:1; unsigned ipv4:1;
unsigned ipv6:1; unsigned ipv6:1;
char ipv4_address[16]; char ipv4_address[16];
char ipv6_address[40]; char ipv6_address[46];
} net_ip_address_t; } net_ip_address_t;
typedef uint64_t bitrate_t; typedef uint64_t bitrate_t;
......
...@@ -265,7 +265,7 @@ static const eutra_band_t eutra_bands[] = { ...@@ -265,7 +265,7 @@ static const eutra_band_t eutra_bands[] = {
Enb_properties_array_t enb_properties; Enb_properties_array_t enb_properties;
static void enb_config_display(void) void enb_config_display(void)
{ {
int i,j; int i,j;
......
...@@ -264,6 +264,7 @@ typedef struct Enb_properties_array_s { ...@@ -264,6 +264,7 @@ typedef struct Enb_properties_array_s {
Enb_properties_t *properties[MAX_ENB]; Enb_properties_t *properties[MAX_ENB];
} Enb_properties_array_t; } Enb_properties_array_t;
void enb_config_display(void);
const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP); const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);
const Enb_properties_array_t *enb_config_get(void); const Enb_properties_array_t *enb_config_get(void);
......
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
# include "DRB-ToAddModList.h" # include "DRB-ToAddModList.h"
# include "SRB-ToAddMod.h" # include "SRB-ToAddMod.h"
# include "SRB-ToAddModList.h" # include "SRB-ToAddModList.h"
# include "DRB-ToReleaseList.h"
#ifdef Rel10 #ifdef Rel10
#include "PMCH-InfoList-r9.h" #include "PMCH-InfoList-r9.h"
#endif #endif
......
...@@ -51,10 +51,6 @@ ...@@ -51,10 +51,6 @@
#include "UTIL/OPT/opt.h" #include "UTIL/OPT/opt.h"
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
#ifndef HAVE_STRNDUP
char * strndup (const char *s, size_t size);
#endif
static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/ static int oai_emulation_; /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/
static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/ static int environment_system_config_; /*!< \brief indicating that the parsing position is now within Envi_Config_*/
......
This diff is collapsed.
This diff is collapsed.
...@@ -72,9 +72,9 @@ s1ap_eNB_config_t s1ap_config; ...@@ -72,9 +72,9 @@ s1ap_eNB_config_t s1ap_config;
static int s1ap_eNB_generate_s1_setup_request( static int s1ap_eNB_generate_s1_setup_request(
s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p); s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
static
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB); void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
static
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp); void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
uint32_t s1ap_generate_eNB_id(void) uint32_t s1ap_generate_eNB_id(void)
...@@ -150,7 +150,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p, ...@@ -150,7 +150,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
} }
static
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB) void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB)
{ {
s1ap_eNB_instance_t *new_instance; s1ap_eNB_instance_t *new_instance;
...@@ -210,7 +210,6 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t * ...@@ -210,7 +210,6 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
} }
} }
static
void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp) 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_instance_t *instance_p;
......
...@@ -100,6 +100,7 @@ static STAILQ_HEAD(sctp_cnx_list_head, sctp_cnx_list_elm_s) sctp_cnx_list; ...@@ -100,6 +100,7 @@ static STAILQ_HEAD(sctp_cnx_list_head, sctp_cnx_list_elm_s) sctp_cnx_list;
static uint16_t sctp_nb_cnx = 0; static uint16_t sctp_nb_cnx = 0;
//------------------------------------------------------------------------------
struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd) struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd)
{ {
struct sctp_cnx_list_elm_s *elm; struct sctp_cnx_list_elm_s *elm;
...@@ -119,6 +120,7 @@ struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd) ...@@ -119,6 +120,7 @@ struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd)
return NULL; return NULL;
} }
//------------------------------------------------------------------------------
void void
sctp_handle_new_association_req( sctp_handle_new_association_req(
const instance_t instance, const instance_t instance,
...@@ -388,6 +390,7 @@ sctp_handle_new_association_req( ...@@ -388,6 +390,7 @@ sctp_handle_new_association_req(
sd, sctp_nb_cnx, assoc_id); sd, sctp_nb_cnx, assoc_id);
} }
//------------------------------------------------------------------------------
void sctp_send_data( void sctp_send_data(
instance_t instance, instance_t instance,
task_id_t task_id, task_id_t task_id,
...@@ -430,6 +433,7 @@ void sctp_send_data( ...@@ -430,6 +433,7 @@ void sctp_send_data(
sctp_cnx->assoc_id); sctp_cnx->assoc_id);
} }
//------------------------------------------------------------------------------
static int sctp_close_association( static int sctp_close_association(
const instance_t instance, const instance_t instance,
const task_id_t requestor, const task_id_t requestor,
...@@ -456,6 +460,7 @@ static int sctp_close_association( ...@@ -456,6 +460,7 @@ static int sctp_close_association(
return 0; return 0;
} }
//------------------------------------------------------------------------------
static int sctp_create_new_listener( static int sctp_create_new_listener(
const instance_t instance, const instance_t instance,
const task_id_t requestor, const task_id_t requestor,
...@@ -580,6 +585,7 @@ err: ...@@ -580,6 +585,7 @@ err:
return -1; return -1;
} }
//------------------------------------------------------------------------------
static inline static inline
void void
sctp_eNB_accept_associations( sctp_eNB_accept_associations(
...@@ -646,6 +652,7 @@ sctp_eNB_accept_associations( ...@@ -646,6 +652,7 @@ sctp_eNB_accept_associations(
} }
} }
//------------------------------------------------------------------------------
static inline static inline
void void
sctp_eNB_read_from_socket( sctp_eNB_read_from_socket(
...@@ -770,6 +777,7 @@ sctp_eNB_read_from_socket( ...@@ -770,6 +777,7 @@ sctp_eNB_read_from_socket(
} }
} }
//------------------------------------------------------------------------------
void void
sctp_eNB_flush_sockets( sctp_eNB_flush_sockets(
struct epoll_event *events, int nb_events) struct epoll_event *events, int nb_events)
...@@ -799,6 +807,7 @@ sctp_eNB_flush_sockets( ...@@ -799,6 +807,7 @@ sctp_eNB_flush_sockets(
} }
//------------------------------------------------------------------------------
void *sctp_eNB_task(void *arg) void *sctp_eNB_task(void *arg)
{ {
int nb_events; int nb_events;
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "95";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2660000000L;
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 = -26;
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 = -108;
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 = "192.188.2.2";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "tun2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.188.2.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "lo";
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1/24";
ENB_PORT_FOR_S1U = 2153; # Spec 2152
};
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";
gtpu_log_level ="info";
gtpu_log_verbosity ="medium";
udp_log_level ="info";
udp_log_verbosity ="medium";
};
}
);
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*
generate_scenario.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*/
#ifndef GENERATE_SCENARIO_H_
#define GENERATE_SCENARIO_H_
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "commonDef.h"
#include "platform_types.h"
#include "platform_constants.h"
#include "PHY/impl_defs_lte.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
#else
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
#endif
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
AssertFatal (0, MeSsAgE);\
} else {\
NwBo = inp.s_addr;\
}\
} while (0);
/** @defgroup _enb_app ENB APP
* @ingroup _oai2
* @{
*/
// Hard to find a defined value for max enb...
#define EPC_TEST_SCENARIO_MAX_ENB 4
typedef struct mme_ip_address_s {
unsigned ipv4:1;
unsigned ipv6:1;
unsigned active:1;
char *ipv4_address;
char *ipv6_address;
} mme_ip_address_t;
typedef struct Enb_properties_s {
/* Unique eNB_id to identify the eNB within EPC.
* For macro eNB ids this field should be 20 bits long.
* For home eNB ids this field should be 28 bits long.
*/
uint32_t eNB_id;
/* The type of the cell */
enum cell_type_e cell_type;
/* Optional name for the cell
* NOTE: the name can be NULL (i.e no name) and will be cropped to 150
* characters.
*/
char *eNB_name;
/* Tracking area code */
uint16_t tac;
/* Mobile Country Code
* Mobile Network Code
*/
uint16_t mcc;
uint16_t mnc;
uint8_t mnc_digit_length;
/* Nb of MME to connect to */
uint8_t nb_mme;
/* List of MME to connect to */
mme_ip_address_t mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
int sctp_in_streams;
int sctp_out_streams;
char *enb_interface_name_for_S1U;
in_addr_t enb_ipv4_address_for_S1U;
tcp_udp_port_t enb_port_for_S1U;
char *enb_interface_name_for_S1_MME;
in_addr_t enb_ipv4_address_for_S1_MME;
} Enb_properties_t;
typedef struct Enb_properties_array_s {
int number;
Enb_properties_t *properties[EPC_TEST_SCENARIO_MAX_ENB];
} Enb_properties_array_t;
void enb_config_init(const char const * lib_config_file_name_pP);
#endif /* ENB_CONFIG_H_ */
/** @} */
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import subprocess
import re
import socket
import datetime
from datetime import date
import os, errno
import argparse
import tempfile
from lxml import etree
from xml.dom.minidom import parse, parseString
#####################
# program arguments
#####################
parser = argparse.ArgumentParser()
parser.add_argument("--pcap_file", "-p", type=str,help="input pcap file to be translated")
args = parser.parse_args()
#####################
# get xml document from pcap
#####################
orig_pcap_file_name = args.pcap_file.strip()
orig_pdml_string = subprocess.check_output(["tshark", '-T', 'pdml', '-r', orig_pcap_file_name])
orig_dom = parseString(orig_pdml_string)
#####################
# filtering unwanted packets
#####################
#cases = orig_etree.findall(".//proto[@name='sctp']")
packets = orig_dom.getElementsByTagName("packet")
for packet in packets:
found_sctp = False
found_s1ap = False
protos = packet.getElementsByTagName("proto")
for proto in protos:
attrs = proto.attributes
urlnode = attrs['name']
if urlnode.nodeValue == 'sctp':
found_sctp = True
elif urlnode.nodeValue == 's1ap':
found_s1ap = True
elif urlnode.nodeValue == 'geninfo':
packet.removeChild(proto)
elif urlnode.nodeValue == 'eth':
packet.removeChild(proto)
if found_sctp == False:
# hopefully it seems to work (remove iterated packet)
packet.parentNode.removeChild(packet)
#####################
# dom to xml string
#####################
filtered_pdml_string = orig_dom.toxml()
cleaned_pdml_string = ""
#####################
# remove blank lines in xml string
#####################
lines = filtered_pdml_string.splitlines()
for line in lines:
if line[:-1]:
cleaned_pdml_string += line + '\r\n'
#print "'%s'" % cleaned_pdml_string
#####################
# write pdml string to pdml file
#####################
out_pdml_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.pdml'
out_file = open(out_pdml_file_name, "w")
out_file.write(cleaned_pdml_string)
out_file.close()
############################################################
# DECEIVING HTML BONUS: DO NOT SEEM TO WORK CORRECTLY IN FIREFOX
# DID NOT INVESTIGATE
#####################
# write xml string to html file
#####################
xsl_root = etree.fromstring(open('/usr/share/wireshark/pdml2html.xsl').read())
transform = etree.XSLT(xsl_root)
xml_root = etree.fromstring(cleaned_pdml_string)
trans_root = transform(xml_root)
filtered_html_string = etree.tostring(trans_root)
#####################
# write html string to html file
#####################
out_html_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.html'
out_file = open(out_html_file_name, "w")
out_file.write(filtered_html_string)
out_file.close()
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*
play_scenario_decode.c
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*/
#include "intertask_interface.h"
#include "platform_types.h"
#include "s1ap_ies_defs.h"
#include "s1ap_eNB_decoder.h"
#include "assertions.h"
#include "play_scenario.h"
//------------------------------------------------------------------------------
int et_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p)
{
int ret = -1;
DevAssert(initiating_p != NULL);
message->procedureCode = initiating_p->procedureCode;
message->criticality = initiating_p->criticality;
switch(initiating_p->procedureCode) {
case S1ap_ProcedureCode_id_downlinkNASTransport:
ret = s1ap_decode_s1ap_downlinknastransporties(&message->msg.s1ap_DownlinkNASTransportIEs,&initiating_p->value);
break;
case S1ap_ProcedureCode_id_InitialContextSetup:
ret = s1ap_decode_s1ap_initialcontextsetuprequesties(&message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_UEContextRelease:
ret = s1ap_decode_s1ap_uecontextreleasecommandies(&message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_Paging:
ret = s1ap_decode_s1ap_pagingies(&message->msg.s1ap_PagingIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_uplinkNASTransport:
ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_S1Setup:
ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_initialUEMessage:
ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_UEContextReleaseRequest:
ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_UECapabilityInfoIndication:
ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value);
break;
case S1ap_ProcedureCode_id_NASNonDeliveryIndication:
ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value);
break;
default:
AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n",
(int)initiating_p->procedureCode);
return -1;
}
return ret;
}
//------------------------------------------------------------------------------
int et_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p)
{
int ret = -1;
DevAssert(successfullOutcome_p != NULL);
message->procedureCode = successfullOutcome_p->procedureCode;
message->criticality = successfullOutcome_p->criticality;
switch(successfullOutcome_p->procedureCode) {
case S1ap_ProcedureCode_id_S1Setup:
ret = s1ap_decode_s1ap_s1setupresponseies(
&message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value);
break;
case S1ap_ProcedureCode_id_InitialContextSetup:
ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value);
break;
case S1ap_ProcedureCode_id_UEContextRelease:
ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value);
break;
default:
AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n",
(int)successfullOutcome_p->procedureCode);
return -1;
}
return ret;
}
//------------------------------------------------------------------------------
int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p)
{
int ret = -1;
DevAssert(unSuccessfullOutcome_p != NULL);
message->procedureCode = unSuccessfullOutcome_p->procedureCode;
message->criticality = unSuccessfullOutcome_p->criticality;
switch(unSuccessfullOutcome_p->procedureCode) {
case S1ap_ProcedureCode_id_S1Setup:
ret = s1ap_decode_s1ap_s1setupfailureies(&message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value);
break;
case S1ap_ProcedureCode_id_InitialContextSetup:
ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value);
break;
default:
AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)unSuccessfullOutcome_p->procedureCode);
break;
}
return ret;
}
//------------------------------------------------------------------------------
int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
memset((void *)pdu, 0, sizeof(S1AP_PDU_t));
dec_ret = aper_decode(NULL,
&asn_DEF_S1AP_PDU,
(void **)&pdu,
buffer,
length,
0,
0);
if (dec_ret.code != RC_OK) {
S1AP_ERROR("Failed to decode pdu\n");
return -1;
}
message->direction = pdu->present;
switch(pdu->present) {
case S1AP_PDU_PR_initiatingMessage:
return et_s1ap_decode_initiating_message(message,
&pdu->choice.initiatingMessage);
case S1AP_PDU_PR_successfulOutcome:
return et_s1ap_decode_successful_outcome(message,
&pdu->choice.successfulOutcome);
case S1AP_PDU_PR_unsuccessfulOutcome:
return et_s1ap_decode_unsuccessful_outcome(message,
&pdu->choice.unsuccessfulOutcome);
default:
AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)pdu->present);
break;
}
return -1;
}
//------------------------------------------------------------------------------
void et_decode_s1ap(et_s1ap_t * const s1ap)
{
if (NULL != s1ap) {
if (et_s1ap_decode_pdu(&s1ap->pdu, &s1ap->message, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) {
AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__);
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*
play_scenario_sctp.c
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*/
#include <errno.h>
#include "intertask_interface.h"
#include "platform_types.h"
#include "assertions.h"
#include "play_scenario.h"
//------------------------------------------------------------------------------
asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints)
{
asn_comp_rval_t *rv = NULL;
// no comparison for ports
if (sctp1->ppid != sctp2->ppid) {
S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid);
rv = calloc(1, sizeof(asn_comp_rval_t));
rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_PPID;
return rv;
}
if (sctp1->assoc_id != sctp2->assoc_id) {
S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id);
rv = calloc(1, sizeof(asn_comp_rval_t));
rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID;
return rv;
}
if (sctp1->stream != sctp2->stream) {
if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) {
rv = calloc(1, sizeof(asn_comp_rval_t));
rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID;
return rv;
} else {
S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream);
}
}
// We do not have SSN from lower layers
// if (sctp1->ssn != sctp2->ssn) {
// if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) {
// rv = calloc(1, sizeof(asn_comp_rval_t));
// rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN;
// return rv;
// } else {
// S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn);
// }
// }
return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload, constraints);
}
//------------------------------------------------------------------------------
asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints)
{
// no comparison for ports
asn_comp_rval_t *rv = NULL;
if (sctp1->chunk_type != sctp2->chunk_type){
S1AP_WARN("No Matching chunk_type %u %u\n", sctp1->chunk_type, sctp2->chunk_type);
rv = calloc(1, sizeof(asn_comp_rval_t));
rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE;
return rv;
}
switch (sctp1->chunk_type) {
case SCTP_CID_DATA:
return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints);
break;
case SCTP_CID_INIT:
AssertFatal(0, "Not needed now");
break;
case SCTP_CID_INIT_ACK:
AssertFatal(0, "Not needed now");
break;
default:
AssertFatal(0, "Not needed now cid %d", sctp1->chunk_type);
}
return NULL;
}
...@@ -275,7 +275,6 @@ do { \ ...@@ -275,7 +275,6 @@ do { \
(bITsTRING)->size = 3; \ (bITsTRING)->size = 3; \
(bITsTRING)->bits_unused = 4; \ (bITsTRING)->bits_unused = 4; \
} while(0) } while(0)
/*
/* TS 36.413 v10.9.0 section 9.2.1.38: /* TS 36.413 v10.9.0 section 9.2.1.38:
* E-UTRAN CGI/Cell Identity * E-UTRAN CGI/Cell Identity
* The leftmost bits of the Cell * The leftmost bits of the Cell
......
...@@ -130,10 +130,12 @@ eNBs = ...@@ -130,10 +130,12 @@ eNBs =
}; };
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( {ipv4 = "192.170.0.1"; mme_ip_address = ( { ipv4 = "192.170.0.1";
ipv6="192:168:30::17"; ipv6 = "192:168:30::17";
active="yes"; active = "yes";
preference="ipv4";}); preference = "ipv4";
}
);
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
...@@ -141,6 +143,7 @@ eNBs = ...@@ -141,6 +143,7 @@ eNBs =
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.170.0.2/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0:4"; ENB_INTERFACE_NAME_FOR_S1U = "eth0:4";
ENB_IPV4_ADDRESS_FOR_S1U = "192.170.1.2/24";
ENB_IPV4_ADDRESS_FOR_S1U = "192.170.0.2/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.170.0.2/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152 ENB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
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