From 9b9a6b634e84a3f8fb1ebcb6ce90d3a49dff155d Mon Sep 17 00:00:00 2001 From: Lionel Gauthier Date: Tue, 11 Mar 2014 14:46:27 +0000 Subject: [PATCH] git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5142 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- .../PROJECTS/GENERIC-LTE-EPC/start_enb.bash | 23 ++++++++++++++ targets/PROJECTS/GENERIC-LTE-EPC/utils.bash | 30 +++++++++++++++++-- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/start_enb.bash b/targets/PROJECTS/GENERIC-LTE-EPC/start_enb.bash index c8560c3d8f..01bf34a23e 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/start_enb.bash +++ b/targets/PROJECTS/GENERIC-LTE-EPC/start_enb.bash @@ -93,6 +93,29 @@ test_command_install_script "ovs-vsctl" "$OPENAIRCN_DIR/SCRIPTS/install_openvsw test_command_install_package "tunctl" "uml-utilities" test_command_install_lib "/usr/lib/libconfig.so" "libconfig-dev" + +test_command_install_script "asn1c" "$OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash" + +# One mor check about version of asn1c +ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE="ASN.1 Compiler, v0.9.24" +ASN1C_COMPILER_VERSION_MESSAGE=`asn1c -h 2>&1 | grep -i ASN\.1\ Compiler` +##ASN1C_COMPILER_VERSION_MESSAGE=`trim $ASN1C_COMPILER_VERSION_MESSAGE` +if [ "$ASN1C_COMPILER_VERSION_MESSAGE" != "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE" ] +then + diff <(echo -n "$ASN1C_COMPILER_VERSION_MESSAGE") <(echo -n "$ASN1C_COMPILER_REQUIRED_VERSION_MESSAGE") + echo_error "Version of asn1c is not the required one, do you want to install the required one (overwrite installation) ? (Y/n)" + echo_error "$ASN1C_COMPILER_VERSION_MESSAGE" + while read -r -n 1 -s answer; do + if [[ $answer = [YyNn] ]]; then + [[ $answer = [Yy] ]] && $OPENAIRCN_DIR/SCRIPTS/install_asn1c_0.9.24.modified.bash + [[ $answer = [Nn] ]] && echo_error "Version of asn1c is not the required one, exiting." && exit 1 + break + fi + done +fi + + + cd $THIS_SCRIPT_PATH ####################################################### # FIND CONFIG FILE diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/utils.bash b/targets/PROJECTS/GENERIC-LTE-EPC/utils.bash index e1ce012662..75ab815728 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/utils.bash +++ b/targets/PROJECTS/GENERIC-LTE-EPC/utils.bash @@ -375,7 +375,7 @@ is_vlan_interface() { for var in "$@" do if [ "a$var" == "a" ]; then - my_bool=0 + return 0 fi if [[ $var == *.* ]] then @@ -386,11 +386,13 @@ is_vlan_interface() { if [ "a${interface_name:0:3}" != "aeth" ]; then if [ "a${interface_name:0:4}" != "awlan" ]; then if [ "a${interface_name:0:4}" != "awifi" ]; then - my_bool=0; + return 0; fi fi fi fi + else + return 0; fi done return $my_bool @@ -451,18 +453,22 @@ build_enb_vlan_network() { clean_enb_vlan_network() { is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1_MME if [ $? -eq 1 ]; then + echo_success "Found VLAN interface $ENB_INTERFACE_NAME_FOR_S1_MME ... deleting" ifconfig $ENB_INTERFACE_NAME_FOR_S1_MME down > /dev/null 2>&1 vconfig rem $ENB_INTERFACE_NAME_FOR_S1_MME > /dev/null 2>&1 fi; is_vlan_interface $ENB_INTERFACE_NAME_FOR_S1U if [ $? -eq 1 ]; then + echo_success "Found VLAN interface $ENB_INTERFACE_NAME_FOR_S1U ... deleting" ifconfig $ENB_INTERFACE_NAME_FOR_S1U down > /dev/null 2>&1 vconfig rem $ENB_INTERFACE_NAME_FOR_S1U > /dev/null 2>&1 fi; sync; + clean_network } + test_enb_vlan_network() { # TEST INTERFACES #ping -q -c 1 $MME_IPV4_ADDRESS_FOR_S1_MME > /dev/null 2>&1 @@ -712,6 +718,7 @@ clean_epc_vlan_network() { vconfig rem $PGW_INTERFACE_NAME_FOR_SGI.$i > /dev/null 2>&1 done #ip link set $PGW_INTERFACE_NAME_FOR_SGI down > /dev/null 2>&1 + clean_network } build_openvswitch_network() { @@ -1041,9 +1048,28 @@ clean_epc_ovs_network() { vconfig rem $PGW_INTERFACE_NAME_FOR_SGI.$i > /dev/null 2>&1 done + clean_network clean_openvswitch_network } +clean_network() { + interfaces=`ifconfig | grep HWaddr | cut -d " " -f1-2 | tr -d '\n'` + for interface in $interfaces + do + is_openvswitch_interface $interface + if [ $? -eq 1 ]; then + echo_success "Found open-vswitch interface $interface ... deleting" + delete_openvswitch_interface $interface + fi + + is_vlan_interface $interface + if [ $? -eq 1 ]; then + echo_success "Found VLAN interface $interface ... deleting" + ifconfig $interface down > /dev/null 2>&1 + vconfig rem $interface > /dev/null 2>&1 + fi + done +} ########################################################### IPTABLES=/sbin/iptables