Commit d03f78a4 authored by gauthier's avatar gauthier

Cleaned xml output, now a S1C test scenario is generated, ready to be parsed.

parent 12b87108
...@@ -162,24 +162,47 @@ add_definitions(-DCMAKER) ...@@ -162,24 +162,47 @@ 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")
# Below has been put in comment because does not work with
# SVN authentication.
# set(GIT_BRANCH "UNKNOWN")
#find_package(Subversion) set(GIT_COMMIT_HASH "UNKNOWN")
#if(SUBVERSION_FOUND) set(GIT_COMMIT_DATE "UNKNOWN")
# Subversion_WC_INFO(${OPENAIR_DIR} openair)
# set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}")
# Subversion_WC_LOG(${OPENAIR_DIR} Project) find_package(Git)
#else() if(GIT_FOUND)
# set (FIRMWARE_VERSION "No svn information") message("git found: ${GIT_EXECUTABLE}")
#endif() # Get the current working branch
#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"") execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
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\"")
...@@ -1615,6 +1638,7 @@ endforeach(myExe) ...@@ -1615,6 +1638,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
...@@ -1626,6 +1650,20 @@ target_link_libraries (test_epc_generate_scenario ...@@ -1626,6 +1650,20 @@ 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 ${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} -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.h
${OPENAIR2_DIR}/ENB_APP/enb_config.h
${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h
${OPENAIR2_DIR}/COMMON/messages_types.h
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
${OPENAIR_BIN_DIR}/messages_xml.h
)
target_link_libraries (test_epc_play_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 ${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}
)
#unitary tests for Core NEtwork pieces #unitary tests for Core NEtwork pieces
################################# #################################
......
...@@ -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,9 @@ function main() ...@@ -140,6 +141,9 @@ 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
} }
......
...@@ -253,7 +253,7 @@ static const eutra_band_t eutra_bands[] = { ...@@ -253,7 +253,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;
......
...@@ -239,6 +239,7 @@ typedef struct Enb_properties_array_s { ...@@ -239,6 +239,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);
......
This diff is collapsed.
File mode changed from 100755 to 100644
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
*******************************************************************************/
/*
generate_scenario.h
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
*/
#ifndef GENERATE_SCENARIO_H_
#define GENERATE_SCENARIO_H_
/** @defgroup _enb_app ENB APP
* @ingroup _oai2
* @{
*/
inline void free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}};
#endif /* ENB_CONFIG_H_ */
/** @} */
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:output
method="xml"
indent="yes"
encoding="iso-8859-1"
/>
<!-- Ugly but no time to find a better way in XSLT 1.0 (map/list)-->
<xsl:param name="enb_s1c0" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c1" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c2" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c3" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c4" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c5" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c6" select="'0.0.0.0'"/>
<xsl:param name="enb_s1c7" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c0_0" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c0_1" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c0_2" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c0_3" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c1_0" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c1_1" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c1_2" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c1_3" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c2_0" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c2_1" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c2_2" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c2_3" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c3_0" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c3_1" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c3_2" select="'0.0.0.0'"/>
<xsl:param name="mme_s1c3_3" select="'0.0.0.0'"/>
<xsl:template match="ip.src[parent::payload]/@value">
<xsl:choose>
<xsl:when test=".='enb_s1c0'"><xsl:value-of select="$enb_s1c0"/></xsl:when>
<xsl:when test=".='enb_s1c1'"><xsl:value-of select="$enb_s1c1"/></xsl:when>
<xsl:when test=".='enb_s1c2'"><xsl:value-of select="$enb_s1c2"/></xsl:when>
<xsl:when test=".='enb_s1c3'"><xsl:value-of select="$enb_s1c3"/></xsl:when>
<xsl:when test=".='enb_s1c4'"><xsl:value-of select="$enb_s1c4"/></xsl:when>
<xsl:when test=".='enb_s1c5'"><xsl:value-of select="$enb_s1c5"/></xsl:when>
<xsl:when test=".='enb_s1c6'"><xsl:value-of select="$enb_s1c6"/></xsl:when>
<xsl:when test=".='enb_s1c7'"><xsl:value-of select="$enb_s1c7"/></xsl:when>
<xsl:when test=".='mme_s1c0_0'"><xsl:value-of select="$mme_s1c0_0"/></xsl:when>
<xsl:when test=".='mme_s1c0_1'"><xsl:value-of select="$mme_s1c0_1"/></xsl:when>
<xsl:when test=".='mme_s1c0_2'"><xsl:value-of select="$mme_s1c0_2"/></xsl:when>
<xsl:when test=".='mme_s1c0_3'"><xsl:value-of select="$mme_s1c0_3"/></xsl:when>
<xsl:when test=".='mme_s1c1_0'"><xsl:value-of select="$mme_s1c1_0"/></xsl:when>
<xsl:when test=".='mme_s1c1_1'"><xsl:value-of select="$mme_s1c1_1"/></xsl:when>
<xsl:when test=".='mme_s1c1_2'"><xsl:value-of select="$mme_s1c1_2"/></xsl:when>
<xsl:when test=".='mme_s1c1_3'"><xsl:value-of select="$mme_s1c1_3"/></xsl:when>
<xsl:when test=".='mme_s1c2_0'"><xsl:value-of select="$mme_s1c2_0"/></xsl:when>
<xsl:when test=".='mme_s1c2_1'"><xsl:value-of select="$mme_s1c2_1"/></xsl:when>
<xsl:when test=".='mme_s1c2_2'"><xsl:value-of select="$mme_s1c2_2"/></xsl:when>
<xsl:when test=".='mme_s1c2_3'"><xsl:value-of select="$mme_s1c2_3"/></xsl:when>
<xsl:when test=".='mme_s1c3_0'"><xsl:value-of select="$mme_s1c3_0"/></xsl:when>
<xsl:when test=".='mme_s1c3_1'"><xsl:value-of select="$mme_s1c3_1"/></xsl:when>
<xsl:when test=".='mme_s1c3_2'"><xsl:value-of select="$mme_s1c3_2"/></xsl:when>
<xsl:when test=".='mme_s1c3_3'"><xsl:value-of select="$mme_s1c3_3"/></xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">ERROR: Cannot resolv IP <xsl:value-of select="."/> !
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="ip.dst[parent::payload]/@value">
<xsl:choose>
<xsl:when test=".='enb_s1c0'"><xsl:value-of select="$enb_s1c0"/></xsl:when>
<xsl:when test=".='enb_s1c1'"><xsl:value-of select="$enb_s1c1"/></xsl:when>
<xsl:when test=".='enb_s1c2'"><xsl:value-of select="$enb_s1c2"/></xsl:when>
<xsl:when test=".='enb_s1c3'"><xsl:value-of select="$enb_s1c3"/></xsl:when>
<xsl:when test=".='enb_s1c4'"><xsl:value-of select="$enb_s1c4"/></xsl:when>
<xsl:when test=".='enb_s1c5'"><xsl:value-of select="$enb_s1c5"/></xsl:when>
<xsl:when test=".='enb_s1c6'"><xsl:value-of select="$enb_s1c6"/></xsl:when>
<xsl:when test=".='enb_s1c7'"><xsl:value-of select="$enb_s1c7"/></xsl:when>
<xsl:when test=".='mme_s1c0_0'"><xsl:value-of select="$mme_s1c0_0"/></xsl:when>
<xsl:when test=".='mme_s1c0_1'"><xsl:value-of select="$mme_s1c0_1"/></xsl:when>
<xsl:when test=".='mme_s1c0_2'"><xsl:value-of select="$mme_s1c0_2"/></xsl:when>
<xsl:when test=".='mme_s1c0_3'"><xsl:value-of select="$mme_s1c0_3"/></xsl:when>
<xsl:when test=".='mme_s1c1_0'"><xsl:value-of select="$mme_s1c1_0"/></xsl:when>
<xsl:when test=".='mme_s1c1_1'"><xsl:value-of select="$mme_s1c1_1"/></xsl:when>
<xsl:when test=".='mme_s1c1_2'"><xsl:value-of select="$mme_s1c1_2"/></xsl:when>
<xsl:when test=".='mme_s1c1_3'"><xsl:value-of select="$mme_s1c1_3"/></xsl:when>
<xsl:when test=".='mme_s1c2_0'"><xsl:value-of select="$mme_s1c2_0"/></xsl:when>
<xsl:when test=".='mme_s1c2_1'"><xsl:value-of select="$mme_s1c2_1"/></xsl:when>
<xsl:when test=".='mme_s1c2_2'"><xsl:value-of select="$mme_s1c2_2"/></xsl:when>
<xsl:when test=".='mme_s1c2_3'"><xsl:value-of select="$mme_s1c2_3"/></xsl:when>
<xsl:when test=".='mme_s1c3_0'"><xsl:value-of select="$mme_s1c3_0"/></xsl:when>
<xsl:when test=".='mme_s1c3_1'"><xsl:value-of select="$mme_s1c3_1"/></xsl:when>
<xsl:when test=".='mme_s1c3_2'"><xsl:value-of select="$mme_s1c3_2"/></xsl:when>
<xsl:when test=".='mme_s1c3_3'"><xsl:value-of select="$mme_s1c3_3"/></xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">ERROR: Cannot resolv IP <xsl:value-of select="."/> !
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
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