net/templates: split off common osmo-bsc.cfg part

Prepare to add support running with two osmo-bsc's in order to test
osmo-bsc-nat.

Change-Id: Icb220657888b23ca19546cca78e10ae914f37751
diff --git a/net/templates/common_osmo_bsc b/net/templates/common_osmo_bsc
new file mode 100644
index 0000000..ad229ed
--- /dev/null
+++ b/net/templates/common_osmo_bsc
@@ -0,0 +1,98 @@
+stats interval 5
+
+stats reporter statsd
+  disable
+  remote-ip ${STATSD_IP}
+  remote-port 9125
+  level global
+  no prefix
+  enable
+
+line vty
+ no login
+
+e1_input
+ e1_line 0 driver ipa
+ e1_line 0 port 0
+ no e1_line 0 keepalive
+
+msc 0
+ allow-emergency deny
+ amr-config 12_2k forbidden
+ amr-config 10_2k forbidden
+ amr-config 7_95k forbidden
+ amr-config 7_40k forbidden
+ amr-config 6_70k allowed
+ amr-config 5_90k allowed
+ amr-config 5_15k forbidden
+ amr-config 4_75k forbidden
+
+network
+ network country code ${MCC}
+ mobile network code ${MNC}
+ encryption a5 ${ENCR_A5}
+ neci 1
+ paging any use tch 0
+ handover 0
+ periodic location update 12
+ meas-feed destination 127.0.0.1 8888
+
+${foreach(BTS)}
+ bts ${BTSn}
+  description ${BTSn_DESCRIPTION}
+  type osmo-bts
+  band ${BTS_BAND}
+  ip.access unit_id ${BTSn_IPA_UNIT}
+  location_area_code ${BTSn_LAC}
+  cell_identity ${BTSn_CI}
+  base_station_id_code ${BTSn_BSIC}
+  codec-support ${BTSn_CODEC_SUPPORT}
+  amr tch-f modes 3
+  amr tch-f start-mode 3
+  amr tch-h modes 3
+  amr tch-h start-mode 3
+  gprs mode ${BTSn_GPRS_MODE}
+  gprs nsvc 0 remote ip ${BTSn_GB_REMOTE_IP}
+  gprs nsvc 0 remote udp port ${BTSn_GB_REMOTE_PORT}
+  gprs nsvc 0 local udp port ${PCU_GB_LOCAL_PORT}
+  gprs nsvc 0 nsvci ${BTSn_NSVCI}
+  gprs nsei ${BTSn_NSEI}
+  gprs cell bvci ${BTSn_BVCI}
+  trx 0
+   arfcn ${BTSn_ARFCN}
+   description ${BTSn_DESCRIPTION}
+   rf_locked 0
+   nominal power ${BTSn_NOMINAL_POWER}
+   max_power_red ${BTSn_MAX_POWER_RED}
+   timeslot 0
+    phys_chan_config CCCH+SDCCH4
+   timeslot 1
+    phys_chan_config SDCCH8
+   timeslot 2
+    phys_chan_config ${TCH_TYPE}
+   timeslot 3
+    phys_chan_config ${TCH_TYPE}
+   timeslot 4
+    phys_chan_config ${TCH_TYPE}
+   timeslot 5
+    phys_chan_config ${TCH_TYPE}
+   timeslot 6
+    phys_chan_config ${TCH_TYPE}
+   timeslot 7
+    phys_chan_config PDCH
+${foreach_end}
+
+${foreach(LOG_OUTPUT)}
+log ${LOG_OUTPUTn_TYPE}
+${include(common_logging)}
+ logging level hodec info
+ logging level ho info
+ logging level nm info
+ logging level meas info
+ logging level lmi info
+ logging level linp notice
+ logging level lss7 notice
+ logging level lsccp notice
+ logging level lsua notice
+ logging level lm3ua notice
+${foreach_end}
diff --git a/net/templates/osmo-bsc.cfg b/net/templates/osmo-bsc.cfg
index 98f4e0c..51692fb 100644
--- a/net/templates/osmo-bsc.cfg
+++ b/net/templates/osmo-bsc.cfg
@@ -1,107 +1,16 @@
 ${include(common_template_warning)}
-stats interval 5
-!
-stats reporter statsd
-  disable
-  remote-ip ${STATSD_IP}
-  remote-port 9125
-  level global
-  no prefix
-  enable
-!
-line vty
- no login
-!
+${include(common_osmo_bsc)}
+
 e1_input
- e1_line 0 driver ipa
- e1_line 0 port 0
- no e1_line 0 keepalive
  ipa bind ${BSC_IP}
+
 cs7 instance 0
  point-code ${BSC_PC}
  asp asp-clnt-bsc-0 2905 0 m3ua
   remote-ip ${STP_RAN_IP}
-network
- network country code ${MCC}
- mobile network code ${MNC}
- encryption a5 ${ENCR_A5}
- neci 1
- paging any use tch 0
- handover 0
- periodic location update 12
- meas-feed destination 127.0.0.1 8888
-
-${foreach(BTS)}
- bts ${BTSn}
-  description ${BTSn_DESCRIPTION}
-  type osmo-bts
-  band ${BTS_BAND}
-  ip.access unit_id ${BTSn_IPA_UNIT}
-  location_area_code ${BTSn_LAC}
-  cell_identity ${BTSn_CI}
-  base_station_id_code ${BTSn_BSIC}
-  codec-support ${BTSn_CODEC_SUPPORT}
-  amr tch-f modes 3
-  amr tch-f start-mode 3
-  amr tch-h modes 3
-  amr tch-h start-mode 3
-  gprs mode ${BTSn_GPRS_MODE}
-  gprs nsvc 0 remote ip ${BTSn_GB_REMOTE_IP}
-  gprs nsvc 0 remote udp port ${BTSn_GB_REMOTE_PORT}
-  gprs nsvc 0 local udp port ${PCU_GB_LOCAL_PORT}
-  gprs nsvc 0 nsvci ${BTSn_NSVCI}
-  gprs nsei ${BTSn_NSEI}
-  gprs cell bvci ${BTSn_BVCI}
-  trx 0
-   arfcn ${BTSn_ARFCN}
-   description ${BTSn_DESCRIPTION}
-   rf_locked 0
-   nominal power ${BTSn_NOMINAL_POWER}
-   max_power_red ${BTSn_MAX_POWER_RED}
-   timeslot 0
-    phys_chan_config CCCH+SDCCH4
-   timeslot 1
-    phys_chan_config SDCCH8
-   timeslot 2
-    phys_chan_config ${TCH_TYPE}
-   timeslot 3
-    phys_chan_config ${TCH_TYPE}
-   timeslot 4
-    phys_chan_config ${TCH_TYPE}
-   timeslot 5
-    phys_chan_config ${TCH_TYPE}
-   timeslot 6
-    phys_chan_config ${TCH_TYPE}
-   timeslot 7
-    phys_chan_config PDCH
-${foreach_end}
 
 msc 0
  mgw remote-ip ${MGW4BSC_IP}
  mgw remote-port ${MGW4BSC_PORT}
  mgw endpoint-domain bsc
- allow-emergency deny
  codec-list ${BSC_CODEC_LIST}
- amr-config 12_2k forbidden
- amr-config 10_2k forbidden
- amr-config 7_95k forbidden
- amr-config 7_40k forbidden
- amr-config 6_70k allowed
- amr-config 5_90k allowed
- amr-config 5_15k forbidden
- amr-config 4_75k forbidden
-
-${foreach(LOG_OUTPUT)}
-log ${LOG_OUTPUTn_TYPE}
-${include(common_logging)}
- logging level hodec info
- logging level ho info
- logging level nm info
- logging level meas info
- logging level lmi info
- logging level linp notice
- logging level lss7 notice
- logging level lsccp notice
- logging level lsua notice
- logging level lm3ua notice
-${foreach_end}