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
ZhouShuya
OpenXG-RAN
Commits
af1495f1
Commit
af1495f1
authored
Nov 05, 2020
by
Mohammed Ismail
Committed by
Raphael Defosseux
Nov 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script for config files generation
Signed-off-by:
Mohammed Ismail
<
mohammed.ismail@eurecom.fr
>
parent
524354ae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
372 additions
and
0 deletions
+372
-0
docker/scripts/generateTemplate.py
docker/scripts/generateTemplate.py
+68
-0
docker/scripts/parameters.json
docker/scripts/parameters.json
+304
-0
No files found.
docker/scripts/generateTemplate.py
0 → 100644
View file @
af1495f1
import
re
import
json
import
os
dir
=
os
.
listdir
(
'/home/mohammed/Documents/conf_files/'
)
#read json config file
f
=
open
(
'parameters.json'
,)
data
=
json
.
load
(
f
)
for
config
in
data
:
filePrefix
=
config
[
"filePrefix"
]
print
(
filePrefix
)
for
inputfile
in
dir
:
if
inputfile
.
find
(
filePrefix
)
>=
0
:
if
filePrefix
==
"cu"
:
outputfile1
=
'config/cu.fdd.config'
elif
filePrefix
==
"du"
:
outputfile1
=
'config/du.fdd.config'
elif
filePrefix
==
"du"
:
outputfile1
=
'config/du.fdd.config'
elif
filePrefix
==
"rru.fdd"
:
outputfile1
=
'config/rru.fdd.config'
elif
filePrefix
==
"rru.tdd"
:
outputfile1
=
'config/rru.tdd.config'
elif
filePrefix
==
"enb.band7.tm1.25PRB.usrpb210"
:
outputfile1
=
'config/enb.fdd.config'
elif
filePrefix
==
"enb.band40.tm1.25PRB.FairScheduler.usrpb210"
:
outputfile1
=
'config/enb.tdd.config'
# elif filePrefix == "rcc.band7.tm1.nfapi":
# outputfile1 = 'config/rcc.if4p5.enb.fdd.config'
# elif filePrefix == "rcc.band7.tm1.nfapi":
# outputfile1 = 'config/rcc.if4p5.enb.tdd.config'
directory
=
'config/'
if
not
os
.
path
.
exists
(
directory
):
os
.
makedirs
(
directory
,
exist_ok
=
True
)
with
open
(
"/home/mohammed/Documents/conf_files/%s"
%
(
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
)
# for quotes
elif
re
.
search
(
r'[0-9]'
,
line
):
templine
=
re
.
sub
(
r'\d+'
,
key
[
"env"
],
line
)
outputfile
.
write
(
templine
)
if
count
==
0
:
outputfile
.
write
(
line
)
#read file and replace with ...
docker/scripts/parameters.json
0 → 100644
View file @
af1495f1
[
{
"filePrefix"
:
"cu"
,
"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"
,
"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"
,
"config"
:
[
{
"key"
:
"local_if_name"
,
"env"
:
"@@"
},
{
"key"
:
"remote_address"
,
"env"
:
"@@"
},
{
"key"
:
"local_address"
,
"env"
:
"@@"
},
{
"key"
:
"bands"
,
"env"
:
"@@"
}
]
},
{
"filePrefix"
:
"rru.tdd"
,
"config"
:
[
{
"key"
:
"local_if_name"
,
"env"
:
"@@"
},
{
"key"
:
"remote_address"
,
"env"
:
"@@"
},
{
"key"
:
"local_address"
,
"env"
:
"@@"
},
{
"key"
:
"bands"
,
"env"
:
"@@"
}
]
},
{
"filePrefix"
:
"enb.band7.tm1.25PRB.usrpb210"
,
"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"
,
"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@"
}
]
}
]
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