core implementation

code bomb implementing the bulk of the osmo-gsm-tester

Change-Id: I53610becbf643ed51b90cfd9debc6992fe211ec9
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
new file mode 100644
index 0000000..724bba8
--- /dev/null
+++ b/src/osmo_gsm_tester/templates/osmo-bts-sysmo.cfg.tmpl
@@ -0,0 +1,18 @@
+! Configuration rendered by osmo-gsm-tester
+log stderr
+  logging color 1
+  logging timestamp 1
+  logging print extended-timestamp 1
+  logging print category 1
+  logging level all debug
+  logging level l1c info
+  logging level linp info
+!
+phy 0
+ instance 0
+bts 0
+ band ${osmo_bts_sysmo.band}
+ ipa unit-id ${osmo_bts_sysmo.ipa_unit_id} 0
+ oml remote-ip ${osmo_bts_sysmo.oml_remote_ip}
+ trx 0
+  phy 0 instance 0
diff --git a/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
new file mode 100644
index 0000000..d416361
--- /dev/null
+++ b/src/osmo_gsm_tester/templates/osmo-bts-trx.cfg.tmpl
@@ -0,0 +1,22 @@
+! Configuration rendered by osmo-gsm-tester
+log stderr
+  logging color 1
+  logging timestamp 1
+  logging print extended-timestamp 1
+  logging print category 1
+  logging level all debug
+  logging level l1c info
+  logging level linp info
+!
+phy 0
+ instance 0
+ osmotrx rx-gain 25
+bts 0
+ band ${osmo_bts_trx.band}
+ ipa unit-id ${osmo_bts_trx.ipa_unit_id} 0
+ oml remote-ip ${osmo_bts_trx.oml_remote_ip}
+ settsc
+ gsmtap-sapi ccch
+ gsmtap-sapi pdtch
+ trx 0
+  phy 0 instance 0
diff --git a/src/osmo_gsm_tester/templates/osmo-bts.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-bts.cfg.tmpl
deleted file mode 100644
index 20fa57f..0000000
--- a/src/osmo_gsm_tester/templates/osmo-bts.cfg.tmpl
+++ /dev/null
@@ -1,21 +0,0 @@
-!
-! OsmoBTS () configuration saved from vty
-!!
-!
-log stderr
-  logging color 1
-  logging timestamp 1
-  logging print extended-timestamp 1
-  logging print category 1
-  logging level all debug
-  logging level l1c info
-  logging level linp info
-!
-phy 0
- instance 0
-bts 0
- band {band}
- ipa unit-id {ipa_unit_id} 0
- oml remote-ip {oml_remote_ip}
- trx 0
-  phy 0 instance 0
diff --git a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
index 3404b7f..e7dc119 100644
--- a/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-nitb.cfg.tmpl
@@ -1,6 +1,4 @@
-!
-! OpenBSC configuration saved from vty
-!
+! Configuration rendered by osmo-gsm-tester
 password foo
 !
 log stderr
@@ -12,19 +10,19 @@
 !
 line vty
  no login
- bind ${vty_bind_ip}
+ bind ${nitb_iface.addr}
 !
 e1_input
  e1_line 0 driver ipa
- ipa bind ${abis_bind_ip}
+ ipa bind ${nitb_iface.addr}
 network
- network country code ${mcc}
- mobile network code ${mnc}
- short name ${net_name_short}
- long name ${net_name_long}
- auth policy ${net_auth_policy}
+ network country code ${nitb.net.mcc}
+ mobile network code ${nitb.net.mnc}
+ short name ${nitb.net.short_name}
+ long name ${nitb.net.long_name}
+ auth policy ${nitb.net.auth_policy}
  location updating reject cause 13
- encryption a5 ${encryption}
+ encryption ${nitb.net.encryption}
  neci 1
  rrlp mode none
  mm info 1
@@ -46,16 +44,7 @@
  timer t3117 0
  timer t3119 0
  timer t3141 0
-smpp
- local-tcp-ip ${smpp_bind_ip} 2775
- system-id test
- policy closed
- esme test
-  password test
-  default-route
-ctrl
- bind ${ctrl_bind_ip}
-%for bts in bts_list:
+%for bts in nitb.net.bts_list:
  bts ${loop.index}
   type ${bts.type}
   band ${bts.band}
@@ -69,7 +58,7 @@
   channel allocator ascending
   rach tx integer 9
   rach max transmission 7
-  ip.access unit_id ${bts.unit_id} 0
+  ip.access unit_id ${bts.ipa_unit_id} 0
   oml ip.access stream_id ${bts.stream_id} line 0
   gprs mode none
 % for trx in bts.trx_list:
@@ -85,3 +74,12 @@
 %  endfor
 % endfor
 %endfor
+smpp
+ local-tcp-ip ${nitb_iface.addr} 2775
+ system-id test
+ policy closed
+ esme test
+  password test
+  default-route
+ctrl
+ bind ${nitb_iface.addr}