Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
b8872998
Commit
b8872998
authored
Nov 07, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f8addc70
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
13 deletions
+22
-13
software/ors-amarisoft/buildout.hash.cfg
software/ors-amarisoft/buildout.hash.cfg
+3
-3
software/ors-amarisoft/instance-enb.jinja2.cfg
software/ors-amarisoft/instance-enb.jinja2.cfg
+1
-0
software/ors-amarisoft/ru/libinstance.jinja2.cfg
software/ors-amarisoft/ru/libinstance.jinja2.cfg
+10
-5
software/ors-amarisoft/ru/tapsplit
software/ors-amarisoft/ru/tapsplit
+8
-5
No files found.
software/ors-amarisoft/buildout.hash.cfg
View file @
b8872998
...
@@ -28,7 +28,7 @@ md5sum = 4fae7413d143b6c9b1734ffbe5c8e94b
...
@@ -28,7 +28,7 @@ md5sum = 4fae7413d143b6c9b1734ffbe5c8e94b
[ru_libinstance.jinja2.cfg]
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum =
5d7374594283c5b6bcb581f2eadac610
md5sum =
21f2526a5ae062eae5162a026736fbb9
[ru_sdr_libinstance.jinja2.cfg]
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
...
@@ -80,7 +80,7 @@ md5sum = da233439ca2b4978ea57bf8c6d628965
...
@@ -80,7 +80,7 @@ md5sum = da233439ca2b4978ea57bf8c6d628965
[ru_tapsplit]
[ru_tapsplit]
_update_hash_filename_ = ru/tapsplit
_update_hash_filename_ = ru/tapsplit
md5sum =
b547df6f6efe841466def2053177092
3
md5sum =
8bc11d6789dc71feb5ffe975769cf2a
3
[ru_capdo.c]
[ru_capdo.c]
_update_hash_filename_ = ru/capdo.c
_update_hash_filename_ = ru/capdo.c
...
@@ -88,7 +88,7 @@ md5sum = 4855e1b8dbc6fee88a16cefc39e96693
...
@@ -88,7 +88,7 @@ md5sum = 4855e1b8dbc6fee88a16cefc39e96693
[template-enb]
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum =
e4fa0dc8a8cdc49caf26db52aa1db3c9
md5sum =
248eb6aee0e16b0b0b955daeb1b0868c
[template-gnb]
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
_update_hash_filename_ = instance-gnb.jinja2.cfg
...
...
software/ors-amarisoft/instance-enb.jinja2.cfg
View file @
b8872998
...
@@ -355,6 +355,7 @@ output = ${directory:etc}/enb.cfg
...
@@ -355,6 +355,7 @@ output = ${directory:etc}/enb.cfg
extra-context =
extra-context =
json iru_dict {{ rulib.iru_dict | tojson }}
json iru_dict {{ rulib.iru_dict | tojson }}
json icell_dict {{ rulib.icell_dict | tojson }}
json icell_dict {{ rulib.icell_dict | tojson }}
json ipeercell_dict {{ ipeercell_dict | tojson }}
import json_module json
import json_module json
import-list =
import-list =
rawfile amari_lte.jinja2 {{ amari_lte_template }}
rawfile amari_lte.jinja2 {{ amari_lte_template }}
...
...
software/ors-amarisoft/ru/libinstance.jinja2.cfg
View file @
b8872998
...
@@ -78,11 +78,12 @@ addr = {{ slap_configuration['tap-ipv6-addr'] }}
...
@@ -78,11 +78,12 @@ addr = {{ slap_configuration['tap-ipv6-addr'] }}
{%- else %}
{%- else %}
{%- for i in range(1,
ntap+1
) %}
{%- for i in range(1,
1+ntap
) %}
{%- set tap = '%s-%d' % (slaplte.tap, i) %}
{%- set tap = '%s-%d' % (slaplte.tap, i) %}
{%- do vtap_list.append(tap) %}
{%- do vtap_list.append(tap) %}
[vtap.{{ tap }}]
[vtap.{{ tap }}]
recipe = slapos.recipe.build
recipe = slapos.recipe.build
depends = ${vtap:recipe}
init =
init =
import types
import types
def readfile(path):
def readfile(path):
...
@@ -93,11 +94,15 @@ init =
...
@@ -93,11 +94,15 @@ init =
tapsplit = types.ModuleType('tapsplit')
tapsplit = types.ModuleType('tapsplit')
exec(readfile('{{ ru_tapsplit }}'), tapsplit.__dict__)
exec(readfile('{{ ru_tapsplit }}'), tapsplit.__dict__)
net = tapsplit.ifnet6('{{ tap }}')
# simulate what tapsplit would assign to the tap
# ( tap subinterface will be created for real later at install time - when it
# is too late to update section options )
slapnet = tapsplit.ifnet6('{{ slaplte.tap }}')
tapnet = tapsplit.netsplit(slapnet, {{ 1+ntap }}) [{{ i }}]
options['network'] = str(net)
options['network'] = str(
tap
net)
options['gateway'] = str(net[1])
options['gateway'] = str(
tap
net[1])
options['addr'] = str(net[-1])
options['addr'] = str(
tap
net[-1])
{%- endfor %}
{%- endfor %}
{%- endif %}
{%- endif %}
...
...
software/ors-amarisoft/ru/tapsplit
View file @
b8872998
...
@@ -47,12 +47,9 @@ def main():
...
@@ -47,12 +47,9 @@ def main():
if
ifname
.
startswith
(
'%s-'
%
tap
):
if
ifname
.
startswith
(
'%s-'
%
tap
):
run
(
'ip'
,
'link'
,
'del'
,
ifname
)
run
(
'ip'
,
'link'
,
'del'
,
ifname
)
# see how much prefix bits we need to take to divide by n
n
+=
1
# also leaving first range for the original tap
ptake
=
ceil
(
log2
(
n
))
# do the split
# do the split
for
i
,
subnet
in
enumerate
(
net
.
subnet
(
net
.
prefixlen
+
ptake
)):
# with leaving first range for the original tap
for
i
,
subnet
in
enumerate
(
netsplit
(
net
,
1
+
n
)):
if
i
==
0
:
if
i
==
0
:
print
(
'preserve %s'
%
subnet
)
print
(
'preserve %s'
%
subnet
)
continue
# leave this range for original tap
continue
# leave this range for original tap
...
@@ -65,6 +62,12 @@ def main():
...
@@ -65,6 +62,12 @@ def main():
run
(
'ip'
,
'route'
,
'add'
,
str
(
subnet
),
'dev'
,
subtap
,
'via'
,
str
(
subnet
[
1
]))
run
(
'ip'
,
'route'
,
'add'
,
str
(
subnet
),
'dev'
,
subtap
,
'via'
,
str
(
subnet
[
1
]))
# netsplit splits network into n subnetworks.
def
netsplit
(
net
,
n
):
# -> []subnet
# see how much prefix bits we need to take to be able to divide by n
ptake
=
ceil
(
log2
(
n
))
return
list
(
net
.
subnet
(
net
.
prefixlen
+
ptake
)
)[:
n
]
# ifnet6 returns IPv6 network address associated with given interface.
# ifnet6 returns IPv6 network address associated with given interface.
def
ifnet6
(
ifname
):
def
ifnet6
(
ifname
):
addr
=
None
addr
=
None
...
...
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