Commit 36b88696 authored by Joanne Hugé's avatar Joanne Hugé

software/ors-amarisoft: parse EPC slave instances (SIM cards) into ue_db template

parent e5bbfc30
......@@ -16,11 +16,11 @@
[template]
filename = instance.cfg
md5sum = 0ee897b4738b6e568456d7aa8c01bfd4
md5sum = b5cc50c24e76fcf36e9fe7c37d689593
[template-lte-default]
_update_hash_filename_ = instance-default.jinja2.cfg
md5sum = 6675abd2d45a65efbe5b3a8e2acfd001
md5sum = 3fd6a586a9d83b6b5f7b9f853a679d00
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
......@@ -28,11 +28,11 @@ md5sum = cda352579b01f0d93f2be8a71e56b5c5
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = 034ffe7d8684d424999942f892a2ffd2
md5sum = baf94ee66622224bc19c3a455c96d80a
[template-lte-ims]
_update_hash_filename_ = instance-ims.jinja2.cfg
md5sum = 9e9dbd764350c23e80c160a602fcf8b1
md5sum = 648ec2c15e0f3bca71c5b7676ff10c9d
[ue_db.jinja2.cfg]
filename = config/ue_db.jinja2.cfg
......@@ -48,8 +48,8 @@ md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
filename = config/mme.jinja2.cfg
md5sum = b27c6c8b4f023a726d9b1e4e87e52845
md5sum = 61d0f4101acc71342b3ff8ac0922ebdb
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
md5sum = b4aaaeec1b356f96d910634e68f46040
md5sum = fe6d7f651765eda331bef9720848131a
......@@ -38,12 +38,7 @@
/* Global domain name (May be overriden for each user) */
domain: "{{ instance['configuration.domain'] }}",
{% if instance.get("ue_db_path") %}
include "{{ instance.get("ue_db_path") }}",
{% else %}
/* user data base */
include "{{ directory['software'] }}/mme/config/ue_db-ims.cfg",
{% endif %}
include "{{ instance['ue_db_path'] }}",
{# Example of of s6a connection #}
{# s6: { #}
......
......@@ -152,13 +152,7 @@
/* NAS integrity algorithm preference. EIA0 is always the last. */
nas_integ_algo_pref: [ 2, 1 ],
{% if instance.get("ue_db_path") %}
include "{{ instance.get("ue_db_path") }}",
{% else %}
/* user data base */
include "{{ directory['software'] }}/mme/config/ue_db-ims.cfg",
{% endif %}
include "{{ instance['ue_db_path'] }}",
/* persistent user database */
ue_db_filename: "{{ directory['var'] }}/lte_ue.db"
......
ue_db: [{
sim_algo: "xor", /* USIM authentication algorithm: xor, milenage or tuak */
imsi: "001010123456789", /* Anritsu Test USIM */
// imsi: "001012345678901", /* Agilent or R&S Test USIM */
amf: 0x9001, /* Authentication Management Field */
sqn: "000000000000", /* Sequence Number */
K: "00112233445566778899aabbccddeeff", /* Anritsu Test USIM */
// K: "4147494C454E5420544543484E4F0000", /* Agilent Test USIM */
// K: "000102030405060708090A0B0C0D0E0F", /* R&S Test USIM */
impi: "001010123456789@ims.mnc001.mcc001.3gppnetwork.org",
impu: ["001010123456789", "tel:0600000000", "tel:600"],
domain: "ims.mnc001.mcc001.3gppnetwork.org",
multi_sim: true, /* Experimental */
/* For standard SIP client */
/*pwd: "amarisoft",
authent_type: "MD5",*/
}, {
sim_algo: "milenage",
imsi: "001010000000001",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: ["sip:impu01", "tel:0600000001"],
impi: "impi01@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000002",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: ["sip:impu02", "tel:0600000002"],
impi: "impi02@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000003",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: ["sip:impu03", "tel:0600000003"],
impi: "impi03@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000004",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu04",
impi: "impi04@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000006",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu06",
impi: "impi06@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000007",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu07",
impi: "impi07@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000008",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu08",
impi: "impi08@amarisoft.com",
}, {
sim_algo: "milenage",
imsi: "001010000000009",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu09",
impi: "impi09@amarisoft.com",
}, {
{% for slave_instance in slave_instance_list -%}
{% if slave_instance.get('imsi', '') != '' %}
sim_algo: "{{ slave_instance.get('sim_algo', 'milenage') }}",
imsi: "{{ slave_instance.get('imsi', '') }}",
opc: "{{ slave_instance.get('opc', '') }}",
amf: {{ slave_instance.get('amf', '0x9001') }},
sqn: "{{ slave_instance.get('sqn', '000000000000') }}",
K: "{{ slave_instance.get('k', '') }}",
impu: "{{ slave_instance.get('impu', '') }}",
impi: "{{ slave_instance.get('impi', '') }}",
}, {
{% endif %}
{% endfor -%}
sim_algo: "milenage",
imsi: "001010000000010",
opc: "000102030405060708090A0B0C0D0E0F",
amf: 0x9001,
sqn: "000000000000",
K: "00112233445566778899AABBCCDDEEFF",
impu: "impu10",
impi: "impi10@amarisoft.com",
}]
......@@ -76,18 +76,12 @@ config-dl_earfcn = {{ dumps(slapparameter_dict["dl_earfcn"]) }}
{% if slapparameter_dict.get("n_rb_dl", None) %}
config-n_rb_dl = {{ dumps(slapparameter_dict["n_rb_dl"]) }}
{% endif %}
{% if slapparameter_dict.get("ue_db_path", None) %}
config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
{% endif %}
[lte-ims-request]
<= request-common-base
name = IMS
software-type = ims
config-name = ims
{% if slapparameter_dict.get("ue_db_path", None) %}
config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
{% endif %}
[monitor-base-url-dict]
lte-epc-request = ${lte-epc-request:connection-monitor-base-url}
......
......@@ -145,12 +145,6 @@
"type": "object"
},
"type": "object"
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "EPC SIM Card Parameters",
"required": [
"sim_algo",
"imsi",
"opc",
"amf",
"sqn",
"k",
"impu",
"impi"
],
"properties": {
"sim_algo": {
"title": "Sim Algorithm",
"description": "xor, milenage or tuak. Set the USIM authentication algorithm.",
"type": "string",
"default": "milenage"
},
"imsi": {
"title": "IMSI",
"description": "IMSI",
"type": "string",
"default": ""
},
"opc": {
"title": "OPC",
"description": "Operator key preprocessed with the user secret key (as a 16 byte hexadecimal string). When the Milenage authentication algorithm is used, opc must be set.",
"type": "string",
"default": ""
},
"amf": {
"title": "AMF",
"description": "Range: 0 to 65535. Set the Authentication Management Field.",
"type": "string",
"default": "0x9001"
},
"sqn": {
"title": "SQN",
"description": "Optional String (6 byte hexadecimal string). Set the initial sequence number. For the XOR algorithm, the actual value does not matter. For the Milenage or TUAK algorithm, a sequence number resynchronization is initiated if the sequence number does not match the one stored in the USIM.",
"type": "string",
"default": "000000000000"
},
"k": {
"title": "K",
"description": "Set the user secret key (as a 16 bytes hexadecimal string, or eventually 32 bytes hexadecimal string for TUAK).",
"type": "string",
"default": ""
},
"impu": {
"title": "IMPU",
"description": "sip URI or a telephone number. Note that sip URI must not include hostname. If IMPU does not start by a scheme, it is assumed to be a sip URI.",
"type": "string",
"default": ""
},
"impi": {
"title": "IMPI",
"description": "Defines user IMPI. Must be fully filled with hostname if necessary.",
"type": "string",
"default": ""
}
}
}
......@@ -15,12 +15,6 @@
"default": "all.level=debug,all.max_size=32"
}
}
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
}
}
}
......@@ -10,7 +10,6 @@ parts =
lte-ims-service
monitor-base
publish-connection-information
neouedb
extends = {{ monitor_template }}
......@@ -45,6 +44,8 @@ configuration.ims_bind = 127.0.0.2
configuration.enb_addr = 127.0.1.1
ue_db_path = {{ ue_db_path }}
#tun-ipv4-addr = 172.0.0.1
[directory]
......@@ -80,15 +81,9 @@ mode = 0775
pidfile = ${directory:run}/ims.pid
hash-files =
${lte-ims-config:rendered}
{{ ue_db_path }}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[neouedb]
recipe = slapos.cookbook:wrapper
command-line = {{ ue_db_py }}
wrapper-path = ${directory:bin}/neouedb
mode = 0775
pidfile = ${directory:run}/neouedb.pid
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
......
......@@ -10,12 +10,6 @@
"type": "string",
"default": "127.0.1.1"
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
},
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
......
......@@ -11,7 +11,6 @@ parts =
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
......@@ -49,6 +48,8 @@ configuration.enb_addr = 127.0.1.1
#tun-ipv4-addr = 172.0.0.1
#tun-name = tunabc
ue_db_path = ${copy-ue-db-config:destination}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
......@@ -72,6 +73,11 @@ extensions = jinja2.ext.do
context =
section directory directory
[copy-ue-db-config]
recipe = slapos.recipe.build:download
url = {{ ue_db_rendered_path }}
destination = {{ ue_db_path }}
mode = 0644
### MME
[lte-mme-service]
......@@ -83,17 +89,11 @@ mode = 0775
pidfile = ${directory:run}/mme.pid
hash-files =
${lte-mme-config:rendered}
${copy-ue-db-config:destination}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[neouedb]
recipe = slapos.cookbook:wrapper
command-line = {{ ue_db_py }}
wrapper-path = ${directory:bin}/neouedb
mode = 0775
pidfile = ${directory:run}/neouedb.pid
### EMPTY mme-ifup script
[lte-mme-ifup-empty]
recipe = slapos.cookbook:wrapper
......
......@@ -68,9 +68,19 @@ extra-context =
raw mme ${mme:destination}
raw mme_template ${mme.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ue_db_py ${ue_db.py.in:rendered}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
key ue_db_rendered_path ue-db-config:rendered
raw ue_db_path ${ue-db:ue-db-path}
[ue-db-config]
recipe = slapos.recipe.template:jinja2
template = ${ue_db.jinja2.cfg:target}
filename = ue_db.cfg
extensions = jinja2.ext.do
rendered = $${buildout:directory}/$${:filename}
context =
key slave_instance_list instance:slave-instance-list
[dynamic-template-lte-ims]
< = jinja2-template-base
......@@ -82,4 +92,4 @@ extra-context =
raw mme ${mme:destination}
raw ims_template ${ims.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ue_db_py ${ue_db.py.in:rendered}
raw ue_db_path ${ue-db:ue-db-path}
......@@ -3,6 +3,7 @@ extends =
software.cfg
[enb]
default-dl-earfcn = 38050 # 2600 MHz (band 38)
# 2600 Mhz (band 38)
default-dl-earfcn = 38050
min-frequency = 2570
max-frequency = 2620
{
"name": "LTE",
"description": "LTE",
"serialisation": "json-in-xml",
"serialisation": "xml",
"software-type": {
"enb": {
"title": "eNB",
......
......@@ -15,6 +15,7 @@ parts +=
mme.jinja2.cfg
ims.jinja2.cfg
enb.jinja2.cfg
ue_db.jinja2.cfg
# sdr driver is dependent on ENB thus should be added explicitely by software.cfg
sdr-driver
lteenb-cap-sys-nice
......@@ -23,15 +24,6 @@ parts +=
# apache-php
# logrotate
[ue_db.py.in]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/bin/neouedb
mode = 0755
context =
key python python-with-eggs:interpreter
key directory buildout:directory
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
......@@ -58,6 +50,9 @@ mode = 0644
[ue-db]
ue-db-path = /opt/amarisoft/ue-db/ue_db.cfg
[ue-db]
ue-db-path = /opt/amarisoft/ue-db/ue_db.cfg
[amarisoft]
recipe = slapos.recipe.build
path = /opt/amarisoft/lte
......@@ -87,6 +82,9 @@ filename = enb.jinja2.cfg
[ltelogs.jinja2.sh]
<= copy-to-instance
filename = ltelogs.jinja2.sh
[ue_db.jinja2.cfg]
<= copy-config-to-instance
filename = ue_db.jinja2.cfg
[mme.jinja2.cfg]
<= copy-config-to-instance
filename = mme.jinja2.cfg
......
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