Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangwenhui
OpenXG-RAN
Commits
2d6fea51
Commit
2d6fea51
authored
Dec 01, 2020
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/oc-docker-october-improvements' into ci-deploy-docker-compose
parents
b29b8838
858a1dc0
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
425 additions
and
17 deletions
+425
-17
cmake_targets/tools/build_helper
cmake_targets/tools/build_helper
+2
-0
docker/Dockerfile.eNB.rhel8.2
docker/Dockerfile.eNB.rhel8.2
+1
-0
docker/Dockerfile.eNB.rhel8.2.oc4-4
docker/Dockerfile.eNB.rhel8.2.oc4-4
+1
-0
docker/Dockerfile.eNB.ubuntu18
docker/Dockerfile.eNB.ubuntu18
+13
-11
docker/Dockerfile.gNB.rhel8.2
docker/Dockerfile.gNB.rhel8.2
+1
-0
docker/Dockerfile.gNB.rhel8.2.oc4-4
docker/Dockerfile.gNB.rhel8.2.oc4-4
+1
-0
docker/Dockerfile.gNB.ubuntu18
docker/Dockerfile.gNB.ubuntu18
+1
-0
docker/Dockerfile.lteUE.rhel8.2
docker/Dockerfile.lteUE.rhel8.2
+1
-0
docker/Dockerfile.lteUE.rhel8.2.oc4-4
docker/Dockerfile.lteUE.rhel8.2.oc4-4
+1
-0
docker/Dockerfile.lteUE.ubuntu18
docker/Dockerfile.lteUE.ubuntu18
+1
-0
docker/Dockerfile.nrUE.rhel8.2
docker/Dockerfile.nrUE.rhel8.2
+1
-0
docker/Dockerfile.nrUE.rhel8.2.oc4-4
docker/Dockerfile.nrUE.rhel8.2.oc4-4
+1
-0
docker/Dockerfile.nrUE.ubuntu18
docker/Dockerfile.nrUE.ubuntu18
+1
-0
docker/scripts/enb_entrypoint.sh
docker/scripts/enb_entrypoint.sh
+44
-0
docker/scripts/enb_parameters.yaml
docker/scripts/enb_parameters.yaml
+242
-0
docker/scripts/generateTemplate.py
docker/scripts/generateTemplate.py
+89
-0
openair3/SCTP/sctp_eNB_task.c
openair3/SCTP/sctp_eNB_task.c
+16
-4
openair3/SCTP/sctp_primitives_client.c
openair3/SCTP/sctp_primitives_client.c
+8
-2
No files found.
cmake_targets/tools/build_helper
View file @
2d6fea51
...
...
@@ -114,6 +114,8 @@ check_supported_distribution() {
"rhel7.7") return 0 ;;
"rhel7.8") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
"centos7") return 0 ;;
esac
return 1
...
...
docker/Dockerfile.eNB.rhel8.2
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
...
...
docker/Dockerfile.eNB.rhel8.2.oc4-4
View file @
2d6fea51
...
...
@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
...
...
docker/Dockerfile.eNB.ubuntu18
View file @
2d6fea51
...
...
@@ -32,9 +32,14 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --eNB --ninja -w USRP
RUN apt-get install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \
python3 ./docker/scripts/generateTemplate.py ./docker/scripts/parameters.yaml
# debug
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
#RUN ls -ls /oai-ran/targets/bin
...
...
@@ -73,6 +78,7 @@ RUN apt-get update && \
WORKDIR /opt/oai-enb/bin
COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 .
COPY --from=enb-build /oai-ran/docker/scripts/enb_entrypoint.sh entrypoint.sh
WORKDIR /usr/local/lib/
COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
...
...
@@ -104,21 +110,17 @@ RUN ldconfig
# Copy the relevant configuration files for eNB
WORKDIR /opt/oai-enb/etc
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/enb.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rcc.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/cu.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/du.* ./
COPY --from=enb-build /oai-ran/ci-scripts/conf_files/rru.* ./
COPY --from=enb-build /oai-ran/docker/etc .
WORKDIR /opt/oai-enb
#EXPOSE 2152/udp # S1U, GTP/UDP
# 2152 --> S1U, GTP/UDP
# 36412 --> S1C, SCTP/UDP
# 36422 --> X2C, SCTP/UDP
EXPOSE 2152/udp 36412/udp 36422/udp
#EXPOSE 22100/tcp # ?
#EXPOSE 36412/udp # S1C, SCTP/UDP
#EXPOSE 36422/udp # X2C, SCTP/UDP
#EXPOSE 50000/udp # IF5 / ORI (control)
#EXPOSE 50001/udp # IF5 / ECPRI (data)
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["sleep", "infinity"]
ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
CMD ["/opt/oai-enb/bin/lte-softmodem.Rel15", "-O", "/opt/oai-enb/etc/enb.conf"]
docker/Dockerfile.gNB.rhel8.2
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
...
...
docker/Dockerfile.gNB.rhel8.2.oc4-4
View file @
2d6fea51
...
...
@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
...
...
docker/Dockerfile.gNB.ubuntu18
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --gNB --ninja -w USRP
...
...
docker/Dockerfile.lteUE.rhel8.2
View file @
2d6fea51
...
...
@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
...
...
docker/Dockerfile.lteUE.rhel8.2.oc4-4
View file @
2d6fea51
...
...
@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
...
...
docker/Dockerfile.lteUE.ubuntu18
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --UE --ninja -w USRP
...
...
docker/Dockerfile.nrUE.rhel8.2
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
...
...
docker/Dockerfile.nrUE.rhel8.2.oc4-4
View file @
2d6fea51
...
...
@@ -33,6 +33,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
...
...
docker/Dockerfile.nrUE.ubuntu18
View file @
2d6fea51
...
...
@@ -32,6 +32,7 @@ WORKDIR /oai-ran
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \
./build_oai --nrUE --ninja -w USRP
...
...
docker/scripts/enb_entrypoint.sh
0 → 100755
View file @
2d6fea51
#!/bin/bash
set
-euo
pipefail
# Based another env var
if
[[
-v
USE_FDD_CU
]]
;
then
ln
-s
/opt/oai-enb/etc/cu.fdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_FDD_DU
]]
;
then
ln
-s
/opt/oai-enb/etc/du.fdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_FDD_MONO
]]
;
then
ln
-s
/opt/oai-enb/etc/enb.fdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_TDD_MONO
]]
;
then
ln
-s
/opt/oai-enb/etc/enb.tdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_FDD_RCC
]]
;
then
ln
-s
/opt/oai-enb/etc/rcc.if4p5.enb.fdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_FDD_RRU
]]
;
then
ln
-s
/opt/oai-enb/etc/rru.fdd.conf /opt/oai-enb/etc/enb.conf
;
fi
if
[[
-v
USE_TDD_RRU
]]
;
then
ln
-s
/opt/oai-enb/etc/rru.tdd.conf /opt/oai-enb/etc/enb.conf
;
fi
CONFIG_FILES
=
`
ls
/opt/oai-enb/etc/enb.conf
`
for
c
in
${
CONFIG_FILES
}
;
do
# grep variable names (format: ${VAR}) from template to be rendered
VARS
=
$(
grep
-oP
'@[a-zA-Z0-9_]+@'
${
c
}
|
sort
|
uniq
| xargs
)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS
=
""
for
v
in
${
VARS
}
;
do
NEW_VAR
=
`
echo
$v
|
sed
-e
"s#@##g"
`
if
[[
"
${
!NEW_VAR
}
x"
==
"x"
]]
;
then
echo
"Error: Environment variable '
${
NEW_VAR
}
' is not set."
\
"Config file '
$(
basename
$c
)
' requires all of
$VARS
."
exit
1
fi
EXPRESSIONS
=
"
${
EXPRESSIONS
}
;s|
${
v
}
|
${
!NEW_VAR
}
|g"
done
EXPRESSIONS
=
"
${
EXPRESSIONS
#
';'
}
"
# render template and inline replace config file
sed
-i
"
${
EXPRESSIONS
}
"
${
c
}
done
# Later-on, how to add command lines options?
# Load the USRP binaries
# --> later conditional (when doing simulators)
/usr/lib/uhd/utils/uhd_images_downloader.py
exec
"
$@
"
docker/scripts/enb_parameters.yaml
0 → 100644
View file @
2d6fea51
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
---
-
paths
:
source_dir
:
"
ci-scripts/conf_files/"
dest_dir
:
docker/etc
-
configurations
:
-
filePrefix
:
cu
outputfilename
:
"
cu.fdd.conf"
config
:
-
key
:
Active_eNBs
env
:
"
@ENB_NAME@"
-
key
:
eNB_name
env
:
"
@ENB_NAME@"
-
key
:
plmn_list
env
:
mcc
:
"
@MCC@"
mnc
:
"
@MNC@"
mnc_length
:
"
@MNC_LENGTH@"
-
key
:
tracking_area_code
env
:
"
@TAC@"
-
key
:
local_s_if_name
env
:
"
@F1_IF_NAME@"
-
key
:
remote_s_address
env
:
"
@F1_DU_IP_ADDRESS@"
-
key
:
local_s_address
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
eutra_band
env
:
"
@UTRA_BAND_ID@"
-
key
:
downlink_frequency
env
:
"
@DL_FREQUENCY_IN_MHZ@000000"
-
key
:
uplink_frequency_offset
env
:
"
@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
-
key
:
Nid_cell
env
:
"
@NID_CELL@"
-
key
:
N_RB_DL
env
:
"
@NB_PRB@"
-
key
:
ipv4
env
:
"
@MME_S1C_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1_MME
env
:
"
@S1C_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1_MME
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1U
env
:
"
@S1U_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1U
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_IPV4_ADDRESS_FOR_X2C
env
:
"
@F1_CU_IP_ADDRESS@"
-
filePrefix
:
du
outputfilename
:
"
du.fdd.conf"
config
:
-
key
:
Active_eNBs
env
:
"
@ENB_NAME@"
-
key
:
eNB_name
env
:
"
@ENB_NAME@"
-
key
:
plmn_list
env
:
mcc
:
"
@MCC@"
mnc
:
"
@MNC@"
mnc_length
:
"
@MNC_LENGTH@"
-
key
:
tracking_area_code
env
:
"
@TAC@"
-
key
:
local_n_if_name
env
:
"
@F1_IF_NAME@"
-
key
:
remote_n_address
env
:
"
@F1_DU_IP_ADDRESS@"
-
key
:
local_n_address
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
eutra_band
env
:
"
@UTRA_BAND_ID@"
-
key
:
downlink_frequency
env
:
"
@DL_FREQUENCY_IN_MHZ@000000"
-
key
:
uplink_frequency_offset
env
:
"
@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
-
key
:
Nid_cell
env
:
"
@NID_CELL@"
-
key
:
N_RB_DL
env
:
"
@NB_PRB@"
-
filePrefix
:
rru.fdd
outputfilename
:
"
rru.fdd.conf"
config
:
-
key
:
local_if_name
env
:
"
@@"
-
key
:
remote_address
env
:
"
@@"
-
key
:
local_address
env
:
"
@@"
-
key
:
bands
env
:
"
@@"
-
filePrefix
:
rru.tdd
outputfilename
:
"
rru.tdd.conf"
config
:
-
key
:
local_if_name
env
:
"
@@"
-
key
:
remote_address
env
:
"
@@"
-
key
:
local_address
env
:
"
@@"
-
key
:
bands
env
:
"
@@"
-
filePrefix
:
enb.band7.tm1.25PRB.usrpb210
outputfilename
:
"
enb.fdd.conf"
config
:
-
key
:
Active_eNBs
env
:
"
@ENB_NAME@"
-
key
:
eNB_name
env
:
"
@ENB_NAME@"
-
key
:
plmn_list
env
:
mcc
:
"
@MCC@"
mnc
:
"
@MNC@"
mnc_length
:
"
@MNC_LENGTH@"
-
key
:
tracking_area_code
env
:
"
@TAC@"
-
key
:
eutra_band
env
:
"
@UTRA_BAND_ID@"
-
key
:
downlink_frequency
env
:
"
@DL_FREQUENCY_IN_MHZ@000000"
-
key
:
uplink_frequency_offset
env
:
"
@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
-
key
:
Nid_cell
env
:
"
@NID_CELL@"
-
key
:
N_RB_DL
env
:
"
@NB_PRB@"
-
key
:
ipv4
env
:
"
@MME_S1C_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1_MME
env
:
"
@S1C_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1_MME
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1U
env
:
"
@S1U_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1U
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_IPV4_ADDRESS_FOR_X2C
env
:
"
@F1_CU_IP_ADDRESS@"
-
filePrefix
:
enb.band40.tm1.25PRB.FairScheduler.usrpb210
outputfilename
:
"
enb.tdd.conf"
config
:
-
key
:
Active_eNBs
env
:
"
@ENB_NAME@"
-
key
:
eNB_name
env
:
"
@ENB_NAME@"
-
key
:
plmn_list
env
:
mcc
:
"
@MCC@"
mnc
:
"
@MNC@"
mnc_length
:
"
@MNC_LENGTH@"
-
key
:
tracking_area_code
env
:
"
@TAC@"
-
key
:
eutra_band
env
:
"
@UTRA_BAND_ID@"
-
key
:
downlink_frequency
env
:
"
@DL_FREQUENCY_IN_MHZ@000000"
-
key
:
uplink_frequency_offset
env
:
"
@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
-
key
:
Nid_cell
env
:
"
@NID_CELL@"
-
key
:
N_RB_DL
env
:
"
@NB_PRB@"
-
key
:
ipv4
env
:
"
@MME_S1C_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1_MME
env
:
"
@S1C_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1_MME
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1U
env
:
"
@S1U_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1U
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_IPV4_ADDRESS_FOR_X2C
env
:
"
@F1_CU_IP_ADDRESS@"
-
filePrefix
:
"
rcc.band7.tm1.nfapi"
outputfilename
:
"
rcc.if4p5.enb.fdd.conf"
config
:
-
key
:
Active_eNBs
env
:
"
@ENB_NAME@"
-
key
:
eNB_name
env
:
"
@ENB_NAME@"
-
key
:
plmn_list
env
:
mcc
:
"
@MCC@"
mnc
:
"
@MNC@"
mnc_length
:
"
@MNC_LENGTH@"
-
key
:
tracking_area_code
env
:
"
@TAC@"
-
key
:
local_s_if_name
env
:
"
@F1_IF_NAME@"
-
key
:
remote_s_address
env
:
"
@F1_DU_IP_ADDRESS@"
-
key
:
local_s_address
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
eutra_band
env
:
"
@UTRA_BAND_ID@"
-
key
:
downlink_frequency
env
:
"
@DL_FREQUENCY_IN_MHZ@000000"
-
key
:
uplink_frequency_offset
env
:
"
@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
-
key
:
Nid_cell
env
:
"
@NID_CELL@"
-
key
:
N_RB_DL
env
:
"
@NB_PRB@"
-
key
:
ipv4
env
:
"
@MME_S1C_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1_MME
env
:
"
@S1C_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1_MME
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_INTERFACE_NAME_FOR_S1U
env
:
"
@S1U_IF_NAME@"
-
key
:
ENB_IPV4_ADDRESS_FOR_S1U
env
:
"
@F1_CU_IP_ADDRESS@"
-
key
:
ENB_IPV4_ADDRESS_FOR_X2C
env
:
"
@F1_CU_IP_ADDRESS@"
docker/scripts/generateTemplate.py
0 → 100644
View file @
2d6fea51
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#-----------------------------------------------------------
# Import
#-----------------------------------------------------------
import
re
import
yaml
import
os
import
sys
def
main
():
#read yaml input parameters
f
=
open
(
f'
{
sys
.
argv
[
1
]
}
'
,)
data
=
yaml
.
full_load
(
f
)
dir
=
os
.
listdir
(
f'
{
data
[
0
][
"paths"
][
"source_dir"
]
}
'
)
#identify configs, read and replace corresponding values
for
config
in
data
[
1
][
"configurations"
]:
filePrefix
=
config
[
"filePrefix"
]
outputfilename
=
config
[
"outputfilename"
]
for
inputfile
in
dir
:
if
inputfile
.
find
(
filePrefix
)
>=
0
:
prefix_outputfile
=
{
"cu"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"du"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"rru.fdd"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"rru.tdd"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"enb.band7.tm1.25PRB.usrpb210"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"enb.band40.tm1.25PRB.FairScheduler.usrpb210"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
,
"rcc.band7.tm1.nfapi"
:
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
/
{
outputfilename
}
'
}
if
filePrefix
in
prefix_outputfile
:
outputfile1
=
prefix_outputfile
[
filePrefix
]
directory
=
f'
{
data
[
0
][
"paths"
][
"dest_dir"
]
}
'
if
not
os
.
path
.
exists
(
directory
):
os
.
makedirs
(
directory
,
exist_ok
=
True
)
with
open
(
f'
{
data
[
0
][
"paths"
][
"source_dir"
]
}{
inputfile
}
'
,
mode
=
'r'
)
as
inputfile
,
\
open
(
outputfile1
,
mode
=
'w'
)
as
outputfile
:
for
line
in
inputfile
:
count
=
0
for
key
in
config
[
"config"
]:
if
line
.
find
(
key
[
"key"
])
>=
0
:
count
+=
1
if
re
.
search
(
r'preference'
,
line
):
templine
=
line
elif
re
.
search
(
r'plmn_list'
,
line
):
templine
=
re
.
sub
(
r'[0-9]+'
,
'""'
,
line
)
templine
=
re
.
sub
(
r'\"\"'
,
key
[
"env"
][
"mcc"
],
templine
,
1
)
templine
=
re
.
sub
(
r'\"\"'
,
key
[
"env"
][
"mnc"
],
templine
,
1
)
templine
=
re
.
sub
(
r'\"\"'
,
key
[
"env"
][
"mnc_length"
],
templine
,
1
)
elif
re
.
search
(
'downlink_frequency'
,
line
):
templine
=
re
.
sub
(
r'[0-9]+'
,
key
[
"env"
],
line
)
elif
re
.
search
(
'uplink_frequency_offset'
,
line
):
templine
=
re
.
sub
(
r'[0-9]+'
,
key
[
"env"
],
line
)
elif
re
.
search
(
r'"(.*?)"'
,
line
):
templine
=
re
.
sub
(
r'(?<=")[^"]*(?=")'
,
key
[
"env"
],
line
)
elif
re
.
search
(
r'[0-9]'
,
line
):
templine
=
re
.
sub
(
r'\d+'
,
key
[
"env"
],
line
)
outputfile
.
write
(
templine
)
if
count
==
0
:
outputfile
.
write
(
line
)
if
__name__
==
"__main__"
:
main
()
openair3/SCTP/sctp_eNB_task.c
View file @
2d6fea51
...
...
@@ -413,10 +413,16 @@ sctp_handle_new_association_req(
}
/* Subscribe to all events */
memset
((
void
*
)
&
events
,
1
,
sizeof
(
struct
sctp_event_subscribe
));
events
.
sctp_data_io_event
=
1
;
events
.
sctp_association_event
=
1
;
events
.
sctp_address_event
=
1
;
events
.
sctp_send_failure_event
=
1
;
events
.
sctp_peer_error_event
=
1
;
events
.
sctp_shutdown_event
=
1
;
events
.
sctp_partial_delivery_event
=
1
;
if
(
setsockopt
(
sd
,
IPPROTO_SCTP
,
SCTP_EVENTS
,
&
events
,
sizeof
(
struct
sctp_event_subscribe
)
)
<
0
)
{
8
)
<
0
)
{
SCTP_ERROR
(
"Setsockopt IPPROTO_SCTP_EVENTS failed: %s
\n
"
,
strerror
(
errno
));
close
(
sd
);
...
...
@@ -759,10 +765,16 @@ static int sctp_create_new_listener(
}
}
memset
((
void
*
)
&
event
,
1
,
sizeof
(
struct
sctp_event_subscribe
));
event
.
sctp_data_io_event
=
1
;
event
.
sctp_association_event
=
1
;
event
.
sctp_address_event
=
1
;
event
.
sctp_send_failure_event
=
1
;
event
.
sctp_peer_error_event
=
1
;
event
.
sctp_shutdown_event
=
1
;
event
.
sctp_partial_delivery_event
=
1
;
if
(
setsockopt
(
sd
,
IPPROTO_SCTP
,
SCTP_EVENTS
,
&
event
,
sizeof
(
struct
sctp_event_subscribe
)
)
<
0
)
{
8
)
<
0
)
{
SCTP_ERROR
(
"setsockopt: %s:%d
\n
"
,
strerror
(
errno
),
errno
);
if
(
sd
!=
-
1
)
{
close
(
sd
);
...
...
openair3/SCTP/sctp_primitives_client.c
View file @
2d6fea51
...
...
@@ -241,10 +241,16 @@ int sctp_connect_to_remote_host(char *local_ip_addr[],
}
/* Subscribe to all events */
memset
((
void
*
)
&
events
,
1
,
sizeof
(
struct
sctp_event_subscribe
));
events
.
sctp_data_io_event
=
1
;
events
.
sctp_association_event
=
1
;
events
.
sctp_address_event
=
1
;
events
.
sctp_send_failure_event
=
1
;
events
.
sctp_peer_error_event
=
1
;
events
.
sctp_shutdown_event
=
1
;
events
.
sctp_partial_delivery_event
=
1
;
if
(
setsockopt
(
sd
,
IPPROTO_SCTP
,
SCTP_EVENTS
,
&
events
,
sizeof
(
struct
sctp_event_subscribe
)
)
<
0
)
{
8
)
<
0
)
{
SCTP_ERROR
(
"Setsockopt IPPROTO_SCTP_EVENTS failed: %s
\n
"
,
strerror
(
errno
));
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment