Commit a21258ec authored by Bing-Kai Hong's avatar Bing-Kai Hong

Update the F1 messages and build scripts for proper generation of F1 messages

parent 05c0ab1a
# vim swp
*.swp
# log and exec file
log/
lte_build_oai/
targets/bin/
...@@ -507,11 +507,13 @@ include_directories ("${X2AP_DIR}") ...@@ -507,11 +507,13 @@ include_directories ("${X2AP_DIR}")
# Same limitation as described in RRC/S1AP: unknown generated file list # Same limitation as described in RRC/S1AP: unknown generated file list
# so we generate it at cmake time # so we generate it at cmake time
############## ##############
add_list1_option(F1AP_VERSION R15 "F1AP Asn.1 grammar version" R15) add_list1_option(F1AP_RELEASE R15 "F1AP ASN.1 grammar version" R15)
set(F1AP_DIR ${OPENAIR2_DIR}/F1AP) set(F1AP_DIR ${OPENAIR2_DIR}/F1AP)
#if (${F1AP_VERSION} STREQUAL "R15") if (${F1AP_RELEASE} STREQUAL "R15")
set (ASN1RELDIR R15) make_version(F1AP_VERSION 15 1 1)
#endif(${F1AP_VERSION} STREQUAL "R15") set (ASN1RELDIR R15.1.1)
endif(${F1AP_RELEASE} STREQUAL "R15")
add_definitions(-DF1AP_VERSION=${F1AP_VERSION})
set(F1AP_ASN_DIR ${F1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR}) set(F1AP_ASN_DIR ${F1AP_DIR}/MESSAGES/ASN1/${ASN1RELDIR})
set(F1AP_ASN_FILES set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-CommonDataTypes.asn ${F1AP_ASN_DIR}/F1AP-CommonDataTypes.asn
...@@ -522,22 +524,24 @@ set(F1AP_ASN_FILES ...@@ -522,22 +524,24 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn ${F1AP_ASN_DIR}/F1AP-Containers.asn
) )
set(F1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR}) set(F1AP_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
set(ENV{ASN1C_PREFIX} F1AP_)
execute_process(COMMAND ${asn1c_call} ${F1AP_C_DIR} ${F1AP_ASN_FILES} execute_process(COMMAND ${asn1c_call} ${F1AP_C_DIR} ${F1AP_ASN_FILES}
RESULT_VARIABLE ret) RESULT_VARIABLE reti)
unset(ENV{ASN1C_PREFIX})
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${asn1c_call}: error") message(FATAL_ERROR "${asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR} #execute_process(COMMAND python ${F1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${F1AP_ASN_DIR}/F1AP-PDU-Contents.asn -o ${F1AP_C_DIR}
RESULT_VARIABLE ret) # RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) #if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "asn1tostruct.py: error") # message(FATAL_ERROR "asn1tostruct.py: error")
endif (NOT ${ret} STREQUAL 0) #endif (NOT ${ret} STREQUAL 0)
execute_process(COMMAND ${fix_asn1c_call} ${F1AP_C_DIR} F1AP ${F1AP_VERSION} #execute_process(COMMAND ${fix_asn1c_call} ${F1AP_C_DIR} F1AP ${F1AP_VERSION}
RESULT_VARIABLE ret) # RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) #if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${fix_asn1c_call}: error") # message(FATAL_ERROR "${fix_asn1c_call}: error")
endif (NOT ${ret} STREQUAL 0) #endif (NOT ${ret} STREQUAL 0)
file(GLOB F1AP_source ${F1AP_C_DIR}/*.c) file(GLOB F1AP_source ${F1AP_C_DIR}/*.c)
#set(F1AP_OAI_generated #set(F1AP_OAI_generated
...@@ -907,8 +911,8 @@ set(FLPT_MSG_FILES ...@@ -907,8 +911,8 @@ set(FLPT_MSG_FILES
${FLPT_MSG_DIR}/control_delegation.proto ${FLPT_MSG_DIR}/control_delegation.proto
) )
set(FLPT_C_DIR ${protobuf_generated_dir}/${FLPTDIR}) set(FLPT_C_DIR ${protobuf_generated_dir}/FLPT_${FLPTDIR})
message("calling protoc_call=${protoc_call} FLPT_C_DIR=${FLPT_C_DIR} FLPT_MSG_FILES=${FLPT_MSG_FILES}") #message("calling protoc_call=${protoc_call} FLPT_C_DIR=${FLPT_C_DIR} FLPT_MSG_FILES=${FLPT_MSG_FILES}")
execute_process(COMMAND ${protoc_call} ${FLPT_C_DIR} ${FLPT_MSG_DIR} ${FLPT_MSG_FILES}) execute_process(COMMAND ${protoc_call} ${FLPT_C_DIR} ${FLPT_MSG_DIR} ${FLPT_MSG_FILES})
file(GLOB FLPT_source ${FLPT_C_DIR}/*.c) file(GLOB FLPT_source ${FLPT_C_DIR}/*.c)
set(FLPT_OAI_generated set(FLPT_OAI_generated
...@@ -988,10 +992,10 @@ if (PDCP_SPLIT) ...@@ -988,10 +992,10 @@ if (PDCP_SPLIT)
${FSPT_MSG_DIR}/flexsplit.proto ${FSPT_MSG_DIR}/flexsplit.proto
) )
set(FSPT_C_DIR ${protobuf_generated_dir}/${FSPTDIR}) set(FSPT_C_DIR ${protobuf_generated_dir}/FSPT_${FSPTDIR})
message("calling protoc_call=${protoc_call} FSPT_C_DIR=${FSPT_C_DIR} FSPT_MSG_FILES=${FSPT_MSG_FILES}") message("calling protoc_call=${protoc_call} FSPT_C_DIR=${FSPT_C_DIR} FSPT_MSG_DIR=${FSPT_MSG_DIR} FSPT_MSG_FILES=${FSPT_MSG_FILES}")
execute_process(COMMAND ${protoc_call} ${FSPT_C_DIR} ${FSPT_MSG_DIR} ${FSPT_MSG_FILES}) execute_process(COMMAND ${protoc_call} ${FSPT_C_DIR} ${FSPT_MSG_DIR} ${FSPT_MSG_FILES})
file(GLOB FSPT_source ${FSPT_C_DIR}/*.c) file(GLOB FSPT_source ${FSPT_C_DIR}/*.c)
set(FSPT_OAI_generated set(FSPT_OAI_generated
${FSPT_C_DIR}/flexsplit.pb-c.c ${FSPT_C_DIR}/flexsplit.pb-c.c
) )
......
...@@ -105,6 +105,10 @@ Options ...@@ -105,6 +105,10 @@ Options
Enables agent for software-defined control of the eNB Enables agent for software-defined control of the eNB
--pdcp-split --pdcp-split
Enables PDCP-RLC U plane split Enables PDCP-RLC U plane split
--CU
Build the CU entity
--DU
Build the CU entity
-r | --3gpp-release -r | --3gpp-release
default is Rel14, default is Rel14,
Rel8 limits the implementation to 3GPP Release 8 version Rel8 limits the implementation to 3GPP Release 8 version
...@@ -214,9 +218,11 @@ function main() { ...@@ -214,9 +218,11 @@ function main() {
-a | --agent) -a | --agent)
echo_info "FlexRAN support is always compiled into the eNB" echo_info "FlexRAN support is always compiled into the eNB"
shift;; shift;;
--pdcp-split) --pdcp-split | --CU | --DU )
PDCP_SPLIT=1 PDCP_SPLIT=1
echo_info "Will compile PDCP-RLC U plane split support" CU=1
DU=1
echo_info "Will compile for $1 with F1AP support "
shift;; shift;;
--UE) --UE)
UE=1 UE=1
...@@ -473,7 +479,7 @@ function main() { ...@@ -473,7 +479,7 @@ function main() {
if [ "$INSTALL_EXTERNAL" = "1" ] ; then if [ "$INSTALL_EXTERNAL" = "1" ] ; then
echo_info "Installing packages" echo_info "Installing packages"
check_install_oai_software check_install_oai_software $PDCP_SPLIT
if [ "$HW" == "OAI_USRP" ] ; then if [ "$HW" == "OAI_USRP" ] ; then
echo_info "installing packages for USRP support" echo_info "installing packages for USRP support"
check_install_usrp_uhd_driver check_install_usrp_uhd_driver
......
...@@ -567,7 +567,8 @@ check_install_oai_software() { ...@@ -567,7 +567,8 @@ check_install_oai_software() {
pydb \ pydb \
libyaml-dev \ libyaml-dev \
wget \ wget \
libxpm-dev libxpm-dev \
libboost-all-dev
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET" $SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
...@@ -653,7 +654,7 @@ check_install_oai_software() { ...@@ -653,7 +654,7 @@ check_install_oai_software() {
libyaml-devel libyaml-devel
fi fi
install_asn1c_from_source install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh $SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh $SUDO git clone https://gist.github.com/2190472.git /opt/ssh
} }
...@@ -663,10 +664,14 @@ install_asn1c_from_source(){ ...@@ -663,10 +664,14 @@ install_asn1c_from_source(){
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log " echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
( (
$SUDO rm -rf /tmp/asn1c $SUDO rm -rf /tmp/asn1c
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c if [ $1 -eq "1" ]; then
echo "building ASN1C from https://github.com/brchiu/asn1c branch"
GIT_SSL_NO_VERIFY=true git clone https://github.com/brchiu/asn1c.git --branch velichkov_s1ap_plus_option_group /tmp/asn1c
else
echo "building ASN1C from https://gitlab.eurecom.fr/oai/asn1c branch"
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git --branch master.aper /tmp/asn1c
fi
cd /tmp/asn1c cd /tmp/asn1c
git checkout master.aper
git pull
test -f configure || autoreconf -iv test -f configure || autoreconf -iv
./configure ./configure
make -j`nproc` make -j`nproc`
......
...@@ -140,6 +140,22 @@ function patch_s1ap() ...@@ -140,6 +140,22 @@ function patch_s1ap()
esac esac
} }
function patch_f1ap()
{
local directory="$1"
local version="$2"
case "$version" in
R15 )
#nothing to do anymore (fixes went to asn1c)
;;
* )
error unknwon/unhandled F1AP version \'"$version"\'
;;
esac
}
function main() function main()
{ {
if [ $# -ne 3 ] if [ $# -ne 3 ]
...@@ -167,6 +183,9 @@ function main() ...@@ -167,6 +183,9 @@ function main()
S1AP ) S1AP )
patch_s1ap "$directory" "$version" patch_s1ap "$directory" "$version"
;; ;;
F1AP )
patch_f1ap "$directory" "$version"
;;
* ) * )
error unknown module "$module" error unknown module "$module"
;; ;;
......
...@@ -29,4 +29,4 @@ ProtocolIE-ID ::= INTEGER (0..65535) ...@@ -29,4 +29,4 @@ ProtocolIE-ID ::= INTEGER (0..65535)
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome } TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome }
END END
\ No newline at end of file
...@@ -157,7 +157,7 @@ id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73 ...@@ -157,7 +157,7 @@ id-SRBs-ToBeSetup-Item ProtocolIE-ID ::= 73
id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74 id-SRBs-ToBeSetup-List ProtocolIE-ID ::= 74
id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75 id-SRBs-ToBeSetupMod-Item ProtocolIE-ID ::= 75
id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76 id-SRBs-ToBeSetupMod-List ProtocolIE-ID ::= 76
id-TimeToWait ProtocolIE-ID ::= 75 id-TimeToWait ProtocolIE-ID ::= 77
id-TransactionID ProtocolIE-ID ::= 78 id-TransactionID ProtocolIE-ID ::= 78
id-TransmissionStopIndicator ProtocolIE-ID ::= 79 id-TransmissionStopIndicator ProtocolIE-ID ::= 79
id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80 id-UE-associatedLogicalF1-ConnectionItem ProtocolIE-ID ::= 80
...@@ -176,4 +176,4 @@ id-Potential-SpCell-List ProtocolIE-ID ::= 92 ...@@ -176,4 +176,4 @@ id-Potential-SpCell-List ProtocolIE-ID ::= 92
id-Potential-SpCell-Item ProtocolIE-ID ::= 93 id-Potential-SpCell-Item ProtocolIE-ID ::= 93
END END
\ No newline at end of file
...@@ -181,4 +181,4 @@ PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE { ...@@ -181,4 +181,4 @@ PrivateIE-Field {F1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE {
value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id}) value F1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id})
} }
END END
\ No newline at end of file
...@@ -867,4 +867,4 @@ ULTunnels-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= { ...@@ -867,4 +867,4 @@ ULTunnels-ToBeSetup-ItemExtIEs F1AP-PROTOCOL-EXTENSION ::= {
-- Z -- Z
END END
\ No newline at end of file
...@@ -132,7 +132,7 @@ for filename in filenames: ...@@ -132,7 +132,7 @@ for filename in filenames:
for m in re.findall(r'([a-zA-Z0-9-]+)\s*::=\s+E-RAB-IE-ContainerList\s*\{\s*\{\s*([a-zA-Z0-9-]+)\s*\}\s*\}', lines, re.MULTILINE): for m in re.findall(r'([a-zA-Z0-9-]+)\s*::=\s+E-RAB-IE-ContainerList\s*\{\s*\{\s*([a-zA-Z0-9-]+)\s*\}\s*\}', lines, re.MULTILINE):
ieofielist[m[0]] = m[1] ieofielist[m[0]] = m[1]
for i in re.findall(r'([a-zA-Z0-9-]+)\s+([A-Z0-9-]+)\s*::=\s*\{\s+([\,\|\{\}\t\n\.{3}\ \-a-zA-Z0-9]+)\s+}\n', lines, re.MULTILINE): for i in re.findall(r'([a-zA-Z0-9-]+)\s+([A-Z0-9-]+)\s*::=\s*\{\s+([\,\|\{\}\t\n\.{3}\ \-a-zA-Z0-9]+)\s+}\n?', lines, re.MULTILINE):
ies = [] ies = []
maxLength = 0 maxLength = 0
# TODO: handle extensions # TODO: handle extensions
......
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