Change in osmo-dev[master]: net/: refactor cfg templates

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sun Mar 3 23:54:01 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13108


Change subject: net/: refactor cfg templates
......................................................................

net/: refactor cfg templates

Adopt "foreach" and "common_" features and generally take in the improved
templates as used at 35c3.

If your config file relies on the tmpl_std that is now removed, you can locally
resurrect it with

  git checkout 2c6a55baa72de0e -- tmpl_std

but it's probably better to make a new copy of config_2g3g and insert your
local config there.

Change-Id: Ie6352c584c0fce57c617387160c285abf40a5f90
---
M net/README
D net/common_bsc_logging
D net/common_logging
M net/config_2g3g
R net/templates/Makefile
A net/templates/common_logging_bsc
A net/templates/common_logging_gsmtap
A net/templates/common_logging_msc
A net/templates/common_logging_stderr
A net/templates/common_statsd
A net/templates/common_template_warning
R net/templates/kamailio.cfg
A net/templates/nano3G_dmi.txt
A net/templates/osmo-bsc.cfg
R net/templates/osmo-gbproxy.cfg
A net/templates/osmo-ggsn.cfg
A net/templates/osmo-hlr.cfg
A net/templates/osmo-hnbgw.cfg
A net/templates/osmo-mgw-for-bsc.cfg
A net/templates/osmo-mgw-for-msc.cfg
A net/templates/osmo-msc.cfg
R net/templates/osmo-sgsn.cfg
A net/templates/osmo-sip-connector.cfg
A net/templates/osmo-stp.cfg
R net/templates/run.sh
D net/tmpl_std/nano3G.txt
D net/tmpl_std/nano3G2.txt
D net/tmpl_std/osmo-bsc.cfg
D net/tmpl_std/osmo-ggsn.cfg
D net/tmpl_std/osmo-hlr.cfg
D net/tmpl_std/osmo-hnbgw.cfg
D net/tmpl_std/osmo-mgw-for-bsc.cfg
D net/tmpl_std/osmo-mgw-for-msc.cfg
D net/tmpl_std/osmo-msc.cfg
D net/tmpl_std/osmo-sip-connector.cfg
D net/tmpl_std/osmo-stp.cfg
36 files changed, 377 insertions(+), 310 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/08/13108/1

diff --git a/net/README b/net/README
index 1d07775..73a8d2f 100644
--- a/net/README
+++ b/net/README
@@ -16,7 +16,7 @@
 
 mkdir my_network
 cd my_network
-../fill_config.py ../config_mine ../tmpl_std
+../fill_config.py ../config_mine ../templates
 
 ./run.sh
 # Launches numerous x-terminals with one component running in each.
@@ -31,27 +31,27 @@
 # tweak config?
 $EDITOR ../config_mine
 ../fill_config.py
-# picks up same ../config_mine and ../tmpl_std from last time
+# picks up same ../config_mine and ../templates from last time
 
 # own templates?
-cp -r ../tmpl_std ../tmpl_mine
-$EDITOR ../tmpl_mine/*
-../fill_config.py ../tmpl_mine
-# picks up same ../config_mine from last time, and ../tmpl_mine from cmdline
+cp -r ../templates ../templates_mine
+$EDITOR ../templates_mine/*
+../fill_config.py ../templates_mine
+# picks up same ../config_mine from last time, and ../templates_mine from cmdline
 
 
 If you wanted to change to dynamic timeslots, you can:
 
 cd ..
-mkdir tmpl_dyn
-cd tmpl_dyn
-ln -s ../tmpl_std/* .
+mkdir templates_dyn
+cd templates_dyn
+ln -s ../templates/* .
 rm ./osmo-bsc.cfg
-cp ../tmpl_std/osmo-bsc.cfg .
+cp ../templates/osmo-bsc.cfg .
 sed -i 's#TCH/F#TCH/F_TCH/H_PDCH#' osmo-bsc.cfg
 
 cd ../my_network
-../fill_config.py ../tmpl_dyn
+../fill_config.py ../templates_dyn
 
 
 If you moved your laptop to a different location, you can:
@@ -64,7 +64,7 @@
 === Config file templates
 
 A *directory* contains template files that are filled with specific values by the
-fill_config.py script. See e.g. tmpl_std/.
+fill_config.py script. See e.g. templates/.
 
 A *file* contains local config items as name=val pairs that are put into the
 templates. See e.g. config_2g3g.
@@ -83,7 +83,7 @@
 
 === Launch
 
-A run.sh script template (tmpl_std/run.sh) also gets filled with specifics and
+A run.sh script template (templates/run.sh) also gets filled with specifics and
 placed next to the .cfg files.
 
 run.sh uses sudo to start tcpdump, configure ip forwarding and masquerading
diff --git a/net/common_bsc_logging b/net/common_bsc_logging
deleted file mode 100644
index 2f891c7..0000000
--- a/net/common_bsc_logging
+++ /dev/null
@@ -1,11 +0,0 @@
-${include(common_logging)}
-log stderr
- logging level lsua notice
- logging level lss7 notice
- logging level linp notice
- logging level hodec notice
-log gsmtap 127.0.0.1
- logging level lsua notice
- logging level lss7 notice
- logging level linp notice
- logging level hodec notice
diff --git a/net/common_logging b/net/common_logging
deleted file mode 100644
index 8d074ab..0000000
--- a/net/common_logging
+++ /dev/null
@@ -1,23 +0,0 @@
-log stderr
- logging filter all 1
- logging color 1
- logging print level 1
- logging print category 1
- logging print category-hex 0
- logging print file basename last
- #logging print timestamp date
- logging print extended-timestamp 1
- logging level set-all debug
-log file current_log/${_name}.log
- logging filter all 1
- logging color 1
- logging print level 1
- logging print category 1
- logging print category-hex 0
- logging print file basename last
- #logging print timestamp date
- logging print extended-timestamp 1
- logging level set-all debug
-log gsmtap 127.0.0.1
- logging filter all 1
- logging level set-all debug
diff --git a/net/config_2g3g b/net/config_2g3g
index 622a4be..891e962 100644
--- a/net/config_2g3g
+++ b/net/config_2g3g
@@ -1,81 +1,112 @@
 ETH_DEV=eth0
 APN_DEV=apn0
 
-PUBLIC_IP="192.168.0.23"
-PUBLIC_IP2="192.168.0.42"
+TO_RAN_IP="192.168.0.3"
+TO_RAN_IP2="192.168.0.4"
+TO_SIP_IP="127.0.0.2"
+
+STATSD_IP="127.0.0.1"
 
 MCC=001
 MNC=01
 
-BTS0_BAND=GSM-1800
-BTS0_LAC=23
-BTS0_CI=5
-BTS0_ARFCN=860
-BTS0_MAX_POWER_RED=21
-BTS0_IPA_UNIT="1234 0"
-BTS0_NSVCI=1234
-BTS0_NSEI="${BTS0_NSVCI}"
-BTS0_BVCI="${BTS0_NSVCI}"
+TCH_TYPE=TCH/H
 
-BTS1_BAND=GSM-1800
-BTS1_LAC=42
-BTS1_CI=13
-BTS1_ARFCN=862
-BTS1_MAX_POWER_RED=21
-BTS1_IPA_UNIT="1235 0"
-BTS1_NSVCI=1235
-BTS1_NSEI="${BTS1_NSVCI}"
-BTS1_BVCI="${BTS1_NSVCI}"
+BTS_BAND=GSM-1800
+BTS_LAC=23
+BTS_MAX_POWER_RED=21
+BTS_CODEC_SUPPORT=fr amr
+BTS_200mW=23
 
-HLR_IP="127.0.0.1"
+BTS0_DESCRIPTION="my test BTS 0"
+BTS0_IPA_UNIT="0 0"
+BTS0_ARFCN=123
+BTS0_CI=${BTSn}
+BTS0_BSIC=${BTSn}
+BTS0_GPRS_MODE=gprs
+BTS0_GB_REMOTE_IP=${SGSN_IP}
+BTS0_GB_REMOTE_PORT=${SGSN_GB_PORT}
+BTS0_NSVCI=${BTSn}
+BTS0_NSEI="${BTSn_NSVCI}"
+# according to osmo-bsc vty, BVCI must be >= 2
+BTS0_BVCI="100${BTSn}"
+BTS0_BAND=${BTS_BAND}
+BTS0_LAC=${BTS_LAC}
+BTS0_MAX_POWER_RED=${BTS_MAX_POWER_RED}
+BTS0_NOMINAL_POWER=${BTS_200mW}
+BTS0_CODEC_SUPPORT=${BTS_CODEC_SUPPORT}
+
+BTS1_DESCRIPTION="my test BTS 1"
+BTS1_IPA_UNIT="1 0"
+BTS1_ARFCN=125
+BTS1_CI=${BTSn}
+BTS1_BSIC=${BTSn}
+BTS1_GPRS_MODE=gprs
+BTS1_GB_REMOTE_IP=${GBPROXY_IP}
+BTS1_GB_REMOTE_PORT=${GBPROXY_GB_PORT}
+BTS1_NSVCI=${BTSn}
+BTS1_NSEI="${BTSn_NSVCI}"
+BTS1_BVCI="100${BTSn}"
+BTS1_BAND=${BTS_BAND}
+BTS1_LAC=${BTS_LAC}
+BTS1_MAX_POWER_RED=${BTS_MAX_POWER_RED}
+BTS1_NOMINAL_POWER=${BTS_200mW}
+BTS1_CODEC_SUPPORT=${BTS_CODEC_SUPPORT}
+
+HLR_IP=127.0.0.1
 
 MSC_PC="0.23.1"
-MSC_MNCC_SOCKET="${NET_DIR}/msc_mncc_socket"
+MSC_MNCC_SOCKET="/tmp/mncc_socket"
+MSC_MNCC="internal"
+# MSC_MNCC="external ${MSC_MNCC_SOCKET}"
 
-AUTH=optional
-ENCR_A5=0
+AUTH=required
+ENCR_A5=1
 
-SGSN_IP="${PUBLIC_IP}"
+SGSN_IP="${TO_RAN_IP}"
 SGSN_PC="0.23.2"
 SGSN_GB_PORT=23000
 
-GBPROXY_IP="${PUBLIC_IP}"
+GBPROXY_IP="${TO_RAN_IP}"
 GBPROXY_GB_PORT=7777
 
-PCU_GB_PORT=23000
+PCU_GB_LOCAL_PORT=23000
 
-MGW4MSC_IP="${PUBLIC_IP}"
+MGW4MSC_IP="${TO_SIP_IP}"
+MGW4MSC_PORT="2427"
 MGW4MSC_VTY_IP="127.0.0.1"
 
-BSC_IP="${PUBLIC_IP}"
-BSC_PC="0.42.0"
-BSC_CODEC_LIST="fr1 hr1"
-MGW4BSC_IP="${PUBLIC_IP2}"
+MGW4BSC_IP="${TO_RAN_IP}"
 MGW4BSC_PORT="2427"
 MGW4BSC_VTY_IP="127.0.0.2"
 
-HNBGW_PC="0.3.0"
-HNBGW_IP="${PUBLIC_IP}"
+BSC_IP="${TO_RAN_IP}"
+BSC_PC="0.23.3"
+BSC_CODEC_LIST="hr3"
 
-GGSN_IP="${PUBLIC_IP2}"
+HNBGW_PC="0.3.0"
+HNBGW_IP="${TO_RAN_IP}"
+
+HNODEB0_IP="192.168.0.124"
+HNODEB0_UARFCN=4357
+HNODEB0_SCRAMBLE=157
+HNODEB0_LAC=1${HNODEB0_UARFCN}
+HNODEB0_RAC=11
+
+HNODEB1_IP="192.168.0.23"
+HNODEB1_UARFCN=4358
+HNODEB1_SCRAMBLE=258
+HNODEB1_LAC=1${HNODEB1_UARFCN}
+HNODEB1_RAC=22
+
+GGSN_IP="${TO_RAN_IP2}"
 GGSN_DNS0="192.168.0.1"
 GGSN_DNS1="9.9.9.9"
 GGSN_NET="192.168.42.0/24"
+GGSN_GTP_STATE_DIR=/tmp
 
-HNODEB_IP="192.168.0.124"
-UARFCN=4357
-SCRAMBLE=157
-LAC=1${UARFCN}
-RAC=11
-
-HNODEB_IP2="192.168.0.23"
-UARFCN2=4358
-SCRAMBLE2=258
-LAC2=2${UARFCN2}
-RAC2=22
-
-SIPCON_ENABLE="false"
-SIPCON_LOCAL="${PUBLIC_IP}"
-SIPCON_LOCAL_PORT="5069"
-SIPCON_REMOTE="${PUBLIC_IP}"
-SIPCON_REMOTE_PORT="5060"
+# Enabled only when MSC_MNCC != "internal"
+SIPCON_LOCAL="${TO_SIP_IP}"
+SIPCON_LOCAL_PORT="5060"
+SIPCON_REMOTE="127.0.0.1"
+SIPCON_REMOTE_PORT="5069"
diff --git a/net/tmpl_std/Makefile b/net/templates/Makefile
similarity index 100%
rename from net/tmpl_std/Makefile
rename to net/templates/Makefile
diff --git a/net/templates/common_logging_bsc b/net/templates/common_logging_bsc
new file mode 100644
index 0000000..bf60d7a
--- /dev/null
+++ b/net/templates/common_logging_bsc
@@ -0,0 +1,8 @@
+ logging level hodec info
+ logging level ho 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
diff --git a/net/templates/common_logging_gsmtap b/net/templates/common_logging_gsmtap
new file mode 100644
index 0000000..f85da41
--- /dev/null
+++ b/net/templates/common_logging_gsmtap
@@ -0,0 +1,3 @@
+log gsmtap 127.0.0.1
+ logging filter all 1
+ logging level set-all notice
diff --git a/net/templates/common_logging_msc b/net/templates/common_logging_msc
new file mode 100644
index 0000000..5100d47
--- /dev/null
+++ b/net/templates/common_logging_msc
@@ -0,0 +1,5 @@
+ logging level linp notice
+ logging level lss7 notice
+ logging level lsccp notice
+ logging level lsua notice
+ logging level lm3ua notice
diff --git a/net/templates/common_logging_stderr b/net/templates/common_logging_stderr
new file mode 100644
index 0000000..695d19c
--- /dev/null
+++ b/net/templates/common_logging_stderr
@@ -0,0 +1,9 @@
+log stderr
+ logging filter all 1
+ logging color 1
+ logging print level 1
+ logging print category 1
+ logging print category-hex 0
+ logging print file basename last
+ logging print extended-timestamp 1
+ logging level set-all debug
diff --git a/net/templates/common_statsd b/net/templates/common_statsd
new file mode 100644
index 0000000..1c35610
--- /dev/null
+++ b/net/templates/common_statsd
@@ -0,0 +1,8 @@
+stats reporter statsd
+ disable
+ remote-ip ${STATSD_IP}
+ remote-port 9125
+ level global
+ no prefix
+ enable
+stats interval 5
diff --git a/net/templates/common_template_warning b/net/templates/common_template_warning
new file mode 100644
index 0000000..6ce6fae
--- /dev/null
+++ b/net/templates/common_template_warning
@@ -0,0 +1,3 @@
+# DO NET EDIT THIS FILE DIRECTLY!
+# This is generated from templates, and manual edits will be overwritten.
+# See /etc/osmocom/README
diff --git a/net/tmpl_std/kamailio.cfg b/net/templates/kamailio.cfg
similarity index 100%
rename from net/tmpl_std/kamailio.cfg
rename to net/templates/kamailio.cfg
diff --git a/net/templates/nano3G_dmi.txt b/net/templates/nano3G_dmi.txt
new file mode 100644
index 0000000..ea47f29
--- /dev/null
+++ b/net/templates/nano3G_dmi.txt
@@ -0,0 +1,20 @@
+${foreach(HNODEB)}
+
+### nano3G ${HNODEBn}
+ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc root@${HNODEBn_IP}
+telnet ${HNODEBn_IP} 8090
+
+set rfParamsCandidateList=({${HNODEBn_UARFCN}, ${HNODEBn_SCRAMBLE}, 1})
+set lacRacCandidateList=({${HNODEBn_LAC}, (${HNODEBn_RAC})})
+set hnbGwAddress="${HNBGW_IP}"
+set mcc="${MCC}"
+set mnc="${MNC}"
+action 2061
+action 1216
+action establishPermanentHnbGwConnection
+set csgAccessMode=CSG_ACCESS_MODE_CLOSED_ACCESS
+set accessControlList = ({"901700000014701",1,"14701"},{"901700000014701",1,"14701"},{"901700000014705",1,"14705"},{"901700000014706",1,"14706"},{"204046848488900",1,"88900"},{"204046848488903",1,"88903"})
+
+${foreach_end}
+
+set csgAccessMode=CSG_ACCESS_MODE_OPEN_ACCESS
diff --git a/net/templates/osmo-bsc.cfg b/net/templates/osmo-bsc.cfg
new file mode 100644
index 0000000..d0995d5
--- /dev/null
+++ b/net/templates/osmo-bsc.cfg
@@ -0,0 +1,102 @@
+${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
+!
+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-msc-0 2905 0 m3ua
+ as as-clnt-msc-0 m3ua
+  asp asp-clnt-msc-0
+  routing-key 4 ${BSC_PC}
+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 sysmobts
+  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
+
+${include(common_logging_stderr)}
+${include(common_logging_bsc)}
+
+${include(common_logging_gsmtap)}
+${include(common_logging_bsc)}
+
+${include(common_statsd)}
diff --git a/net/tmpl_std/osmo-gbproxy.cfg b/net/templates/osmo-gbproxy.cfg
similarity index 100%
rename from net/tmpl_std/osmo-gbproxy.cfg
rename to net/templates/osmo-gbproxy.cfg
diff --git a/net/templates/osmo-ggsn.cfg b/net/templates/osmo-ggsn.cfg
new file mode 100644
index 0000000..7492761
--- /dev/null
+++ b/net/templates/osmo-ggsn.cfg
@@ -0,0 +1,18 @@
+${include(common_template_warning)}
+ggsn ggsn0
+ gtp state-dir ${GGSN_GTP_STATE_DIR}
+ gtp bind-ip ${GGSN_IP}
+ apn internet
+  gtpu-mode tun
+  tun-device ${APN_DEV}
+  type-support v4
+  ip dns 0 ${GGSN_DNS0}
+  ip dns 1 ${GGSN_DNS1}
+  ip prefix dynamic ${GGSN_NET}
+  no shutdown
+ default-apn internet
+ no shutdown ggsn
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
+${include(common_statsd)}
diff --git a/net/templates/osmo-hlr.cfg b/net/templates/osmo-hlr.cfg
new file mode 100644
index 0000000..bacad7a
--- /dev/null
+++ b/net/templates/osmo-hlr.cfg
@@ -0,0 +1,11 @@
+${include(common_template_warning)}
+hlr
+ gsup
+  bind ip ${HLR_IP}
+ ussd route prefix *0# internal own-msisdn
+ ussd route prefix *1# internal own-imsi
+ ussd route prefix *#100# internal own-msisdn
+ ussd route prefix *#101# internal own-imsi
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-hnbgw.cfg b/net/templates/osmo-hnbgw.cfg
new file mode 100644
index 0000000..66516ce
--- /dev/null
+++ b/net/templates/osmo-hnbgw.cfg
@@ -0,0 +1,8 @@
+${include(common_template_warning)}
+hnbgw
+ iuh
+  local-ip ${HNBGW_IP}
+  hnbap-allow-tmsi 1
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-mgw-for-bsc.cfg b/net/templates/osmo-mgw-for-bsc.cfg
new file mode 100644
index 0000000..be67d0c
--- /dev/null
+++ b/net/templates/osmo-mgw-for-bsc.cfg
@@ -0,0 +1,12 @@
+${include(common_template_warning)}
+mgcp
+ domain bsc
+ bind ip ${MGW4BSC_IP}
+ bind port ${MGW4BSC_PORT}
+ rtp net-range 50004 60000
+ number endpoints 1024
+line vty
+ bind ${MGW4BSC_VTY_IP}
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-mgw-for-msc.cfg b/net/templates/osmo-mgw-for-msc.cfg
new file mode 100644
index 0000000..a69ec93
--- /dev/null
+++ b/net/templates/osmo-mgw-for-msc.cfg
@@ -0,0 +1,12 @@
+${include(common_template_warning)}
+mgcp
+ domain msc
+ bind ip ${MGW4MSC_IP}
+ bind port ${MGW4MSC_PORT}
+ rtp net-range 50004 60000
+ number endpoints 1024
+line vty
+ bind ${MGW4MSC_VTY_IP}
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-msc.cfg b/net/templates/osmo-msc.cfg
new file mode 100644
index 0000000..a9798c9
--- /dev/null
+++ b/net/templates/osmo-msc.cfg
@@ -0,0 +1,32 @@
+${include(common_template_warning)}
+network
+ network country code ${MCC}
+ mobile network code ${MNC}
+ authentication ${AUTH}
+ encryption a5 ${ENCR_A5}
+ short name 35c3
+ long name 35c3
+ mm info 1
+msc
+ mncc ${MSC_MNCC}
+ mgw remote-ip ${MGW4MSC_IP}
+ mgw remote-port ${MGW4MSC_PORT}
+ mgw endpoint-domain msc
+ # For nano3G:
+ iu rab-assign-addr-enc x213
+mncc-int
+ default-codec tch-f fr
+ default-codec tch-h amr
+smpp
+ local-tcp-ip 127.0.0.1 2775
+ system-id test-msc
+ policy closed
+ no smpp-first
+hlr
+ remote-ip ${HLR_IP}
+
+${include(common_logging_stderr)}
+${include(common_logging_msc)}
+
+${include(common_logging_gsmtap)}
+${include(common_logging_msc)}
diff --git a/net/tmpl_std/osmo-sgsn.cfg b/net/templates/osmo-sgsn.cfg
similarity index 70%
rename from net/tmpl_std/osmo-sgsn.cfg
rename to net/templates/osmo-sgsn.cfg
index 3b61ef3..f6ee1df 100644
--- a/net/tmpl_std/osmo-sgsn.cfg
+++ b/net/templates/osmo-sgsn.cfg
@@ -1,3 +1,4 @@
+${include(common_template_warning)}
 sgsn
  gtp local-ip ${SGSN_IP}
  ggsn 0 remote-ip ${GGSN_IP}
@@ -9,4 +10,5 @@
  encapsulation udp local-port ${SGSN_GB_PORT}
  encapsulation framerelay-gre enabled 0
 
-${include(../common_logging)}
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-sip-connector.cfg b/net/templates/osmo-sip-connector.cfg
new file mode 100644
index 0000000..bac1385
--- /dev/null
+++ b/net/templates/osmo-sip-connector.cfg
@@ -0,0 +1,10 @@
+${include(common_template_warning)}
+app
+mncc
+  socket-path ${MSC_MNCC_SOCKET}
+sip
+  local ${SIPCON_LOCAL} ${SIPCON_LOCAL_PORT}
+  remote ${SIPCON_REMOTE} ${SIPCON_REMOTE_PORT}
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/templates/osmo-stp.cfg b/net/templates/osmo-stp.cfg
new file mode 100644
index 0000000..35eb4e7
--- /dev/null
+++ b/net/templates/osmo-stp.cfg
@@ -0,0 +1,8 @@
+${include(common_template_warning)}
+cs7 instance 0
+ xua rkm routing-key-allocation dynamic-permitted
+ listen m3ua 2905
+  accept-asp-connections dynamic-permitted
+
+${include(common_logging_stderr)}
+${include(common_logging_gsmtap)}
diff --git a/net/tmpl_std/run.sh b/net/templates/run.sh
similarity index 89%
rename from net/tmpl_std/run.sh
rename to net/templates/run.sh
index 03f75c1..fcb410b 100755
--- a/net/tmpl_std/run.sh
+++ b/net/templates/run.sh
@@ -9,7 +9,6 @@
 fi
 
 dev="${ETH_DEV}"
-ip2="${PUBLIC_IP2}"
 apn="${APN_DEV}"
 
 sudo true || exit 1
@@ -28,14 +27,14 @@
   sudo ip link set $apn up
 fi
 
-if [ -z "$(ip addr show | grep "$PUBLIC_IP")" ]; then
-  echo "No interface has IP address $PUBLIC_IP! Hit enter to continue anyway."
+if [ -z "$(ip addr show | grep "$TO_RAN_IP")" ]; then
+  echo "No interface has IP address $TO_RAN_IP! Hit enter to continue anyway."
   read enter_to_continue
 fi
-if [ -z "$(ip addr show | grep "$ip2")" ]; then
-  echo "No interface has IP address $ip2! Hit enter to 'ip addr add $ip2/32 dev $dev'"
+if [ -z "$(ip addr show | grep "$TO_RAN_IP2")" ]; then
+  echo "No interface has IP address $TO_RAN_IP2! Hit enter to 'ip addr add $TO_RAN_IP2/32 dev $dev'"
   read enter_to_continue
-  sudo ip addr add $ip2/32 dev $dev
+  sudo ip addr add $TO_RAN_IP2/32 dev $dev
 fi
 
 logdir="current_log"
@@ -78,14 +77,14 @@
 stp="osmo-stp"
 bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc -c osmo-bsc.cfg"
 
-if [ "${SIPCON_ENABLE}" == "true" ]; then
+if [ "x${MSC_MNCC}" != "xinternal" ]; then
   sipcon="osmo-sip-connector -c osmo-sip-connector.cfg"
   msc="$msc -M ${MSC_MNCC_SOCKET}"
 
   # Require kamailio (PATH hack is needed for Debian)
   kamailio="$(PATH="$PATH:/usr/sbin:/sbin" which kamailio)"
   if [ -z "$kamailio" ]; then
-    echo "ERROR: kamailio is not installed, but it's required for SIPCON_ENABLE."
+    echo "ERROR: kamailio is not installed, but it's required for external MNCC."
     echo "After installing it, make sure that it does *not* run as daemon."
     exit 1
   fi
@@ -115,7 +114,7 @@
 sleep .2
 term "$bsc" BSC &
 
-if [ "${SIPCON_ENABLE}" == "true" ]; then
+if [ "x${MSC_MNCC}" != "xinternal" ]; then
   sleep .2
   term "$sipcon" SIPCON &
   sleep .2
@@ -129,7 +128,7 @@
 read enter_to_close
 echo Closing...
 
-if [ "${SIPCON_ENABLE}" == "true" ]; then
+if [ "x${MSC_MNCC}" != "xinternal" ]; then
   kill %13 %14
   killall osmo-sip-connector
   killall kamailio
diff --git a/net/tmpl_std/nano3G.txt b/net/tmpl_std/nano3G.txt
deleted file mode 100644
index df6feb6..0000000
--- a/net/tmpl_std/nano3G.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc root@${HNODEB_IP}
-
-telnet ${HNODEB_IP} 8090
-
-set mcc="${MCC}"
-set mnc="${MNC}"
-set rfParamsCandidateList=({${UARFCN}, ${SCRAMBLE}, 1})
-set lacRacCandidateList=({${LAC}, (${RAC})})
-set hnbGwAddress="${HNBGW_IP}"
-action 2061
-action 1216
-action establishPermanentHnbGwConnection
-set csgAccessMode=CSG_ACCESS_MODE_CLOSED_ACCESS
-set accessControlList = ({"901700000014701",1,"14701"})
-
-set accessControlList = ({"901700000014701",1,"14701"},{"901700000014702",1,"14702"})
-
-set csgAccessMode=CSG_ACCESS_MODE_OPEN_ACCESS
diff --git a/net/tmpl_std/nano3G2.txt b/net/tmpl_std/nano3G2.txt
deleted file mode 100644
index a5be62d..0000000
--- a/net/tmpl_std/nano3G2.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c aes128-cbc root@${HNODEB_IP2}
-
-telnet ${HNODEB_IP2} 8090
-
-set mcc="${MCC}"
-set mnc="${MNC}"
-set rfParamsCandidateList=({${UARFCN2}, ${SCRAMBLE2}, 1})
-set lacRacCandidateList=({${LAC2}, (${RAC2})})
-set hnbGwAddress="${HNBGW_IP}"
-action 2061
-action 1216
-action establishPermanentHnbGwConnection
-set csgAccessMode=CSG_ACCESS_MODE_CLOSED_ACCESS
-set accessControlList = ({"901700000014702",1,"14702"})
-
-set accessControlList = ({"901700000014701",1,"14701"},{"901700000014702",1,"14702"})
-
-set csgAccessMode=CSG_ACCESS_MODE_OPEN_ACCESS
diff --git a/net/tmpl_std/osmo-bsc.cfg b/net/tmpl_std/osmo-bsc.cfg
deleted file mode 100644
index cfaf8b7..0000000
--- a/net/tmpl_std/osmo-bsc.cfg
+++ /dev/null
@@ -1,86 +0,0 @@
-network
- #meas-feed destination 172.18.18.18 8888
- #meas-feed scenario foo23
- network country code ${MCC}
- mobile network code ${MNC}
- encryption a5 ${ENCR_A5}
- bts 0
-  type sysmobts
-  band ${BTS0_BAND}
-  location_area_code ${BTS0_LAC}
-  cell_identity ${BTS0_CI}
-  cell reselection hysteresis 14
-  ip.access unit_id ${BTS0_IPA_UNIT}
-  gprs mode gprs
-  gprs nsvc 0 remote ip ${GBPROXY_IP}
-  gprs nsvc 0 remote udp port ${GBPROXY_GB_PORT}
-  gprs nsvc 0 local udp port ${PCU_GB_PORT}
-  gprs nsvc 0 nsvci ${BTS0_NSVCI}
-  gprs nsei ${BTS0_NSEI}
-  gprs cell bvci ${BTS0_BVCI}
-  trx 0
-   rf_locked 0
-   arfcn ${BTS0_ARFCN}
-   nominal power 23
-   max_power_red ${BTS0_MAX_POWER_RED}
-   timeslot 0
-    phys_chan_config CCCH+SDCCH4
-   timeslot 1
-    phys_chan_config SDCCH8
-   timeslot 2
-    phys_chan_config TCH/F
-   timeslot 3
-    phys_chan_config TCH/F
-   timeslot 4
-    phys_chan_config TCH/F
-   timeslot 5
-    phys_chan_config PDCH
-   timeslot 6
-    phys_chan_config PDCH
-   timeslot 7
-    phys_chan_config PDCH
- bts 1
-  type sysmobts
-  band ${BTS1_BAND}
-  location_area_code ${BTS1_LAC}
-  cell_identity ${BTS1_CI}
-  cell reselection hysteresis 14
-  ip.access unit_id ${BTS1_IPA_UNIT}
-  gprs mode gprs
-  gprs nsvc 0 remote ip ${GBPROXY_IP}
-  gprs nsvc 0 remote udp port ${GBPROXY_GB_PORT}
-  gprs nsvc 0 local udp port ${PCU_GB_PORT}
-  gprs nsvc 0 nsvci ${BTS1_NSVCI}
-  gprs nsei ${BTS1_NSEI}
-  gprs cell bvci ${BTS1_BVCI}
-  trx 0
-   rf_locked 0
-   arfcn ${BTS1_ARFCN}
-   nominal power 23
-   max_power_red ${BTS1_MAX_POWER_RED}
-   timeslot 0
-    phys_chan_config CCCH+SDCCH4
-   timeslot 1
-    phys_chan_config SDCCH8
-   timeslot 2
-    phys_chan_config TCH/F
-   timeslot 3
-    phys_chan_config TCH/F
-   timeslot 4
-    phys_chan_config TCH/F
-   timeslot 5
-    phys_chan_config PDCH
-   timeslot 6
-    phys_chan_config PDCH
-   timeslot 7
-    phys_chan_config PDCH
-e1_input
- e1_line 0 driver ipa
-msc 0
- mgw remote-ip ${MGW4BSC_IP}
- mgw remote-port ${MGW4BSC_PORT}
- mgw endpoint-range 33 64
- allow-emergency deny
- codec-list ${BSC_CODEC_LIST}
-
-${include(../common_bsc_logging)}
diff --git a/net/tmpl_std/osmo-ggsn.cfg b/net/tmpl_std/osmo-ggsn.cfg
deleted file mode 100644
index 1e69f65..0000000
--- a/net/tmpl_std/osmo-ggsn.cfg
+++ /dev/null
@@ -1,17 +0,0 @@
-log stderr
- logging level all debug
- logging filter all 1
- logging print category 1
-ggsn ggsn0
- gtp bind-ip ${GGSN_IP}
- apn internet
-  tun-device ${APN_DEV}
-  type-support v4
-  ip dns 0 ${GGSN_DNS0}
-  ip dns 1 ${GGSN_DNS1}
-  #ip ifconfig ${GGSN_NET}
-  ip prefix dynamic ${GGSN_NET}
-  no shutdown
- default-apn internet
- no shutdown ggsn
-${include(../common_logging)}
diff --git a/net/tmpl_std/osmo-hlr.cfg b/net/tmpl_std/osmo-hlr.cfg
deleted file mode 100644
index 4f8a14a..0000000
--- a/net/tmpl_std/osmo-hlr.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-hlr
- ussd route prefix *1# internal own-msisdn
- ussd route prefix *2# internal own-imsi
- ussd route prefix *#100# internal own-msisdn
- ussd route prefix *#101# internal own-imsi
- store-imei
-${include(../common_logging)}
diff --git a/net/tmpl_std/osmo-hnbgw.cfg b/net/tmpl_std/osmo-hnbgw.cfg
deleted file mode 100644
index a918b10..0000000
--- a/net/tmpl_std/osmo-hnbgw.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-hnbgw
- iuh
-  local-ip ${HNBGW_IP}
-
-${include(../common_logging)}
diff --git a/net/tmpl_std/osmo-mgw-for-bsc.cfg b/net/tmpl_std/osmo-mgw-for-bsc.cfg
deleted file mode 100644
index a6eddbf..0000000
--- a/net/tmpl_std/osmo-mgw-for-bsc.cfg
+++ /dev/null
@@ -1,11 +0,0 @@
-mgcp
- bind ip ${MGW4BSC_IP}
- # default port is 2427 (is used for MSC's MGW)
- bind port ${MGW4BSC_PORT}
- number endpoints 64
-line vty
- # default VTY interface is on 127.0.0.1 (used for MSC's MGW)
- bind ${MGW4BSC_VTY_IP}
-
-${include(../common_logging)}
- logging level all info
diff --git a/net/tmpl_std/osmo-mgw-for-msc.cfg b/net/tmpl_std/osmo-mgw-for-msc.cfg
deleted file mode 100644
index 5803932..0000000
--- a/net/tmpl_std/osmo-mgw-for-msc.cfg
+++ /dev/null
@@ -1,8 +0,0 @@
-mgcp
- bind ip ${MGW4MSC_IP}
- number endpoints 64
-line vty
- bind ${MGW4MSC_VTY_IP}
-
-${include(../common_logging)}
- logging level all info
diff --git a/net/tmpl_std/osmo-msc.cfg b/net/tmpl_std/osmo-msc.cfg
deleted file mode 100644
index 99c1b00..0000000
--- a/net/tmpl_std/osmo-msc.cfg
+++ /dev/null
@@ -1,18 +0,0 @@
-network
- network country code ${MCC}
- mobile network code ${MNC}
- authentication ${AUTH}
- encryption a5 ${ENCR_A5}
-msc
- mgw remote-ip ${MGW4MSC_IP}
- # For nano3G:
- iu rab-assign-addr-enc x213
-
- check-imei-rqd 1
-
-${include(../common_logging)}
- logging level ref debug
- logging level vlr debug
-log stderr
- logging level ref debug
- logging level vlr debug
diff --git a/net/tmpl_std/osmo-sip-connector.cfg b/net/tmpl_std/osmo-sip-connector.cfg
deleted file mode 100644
index 953eccd..0000000
--- a/net/tmpl_std/osmo-sip-connector.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-app
-mncc
-  socket-path ${MSC_MNCC_SOCKET}
-sip
-  local ${SIPCON_LOCAL} ${SIPCON_LOCAL_PORT}
-  remote ${SIPCON_REMOTE} ${SIPCON_REMOTE_PORT}
diff --git a/net/tmpl_std/osmo-stp.cfg b/net/tmpl_std/osmo-stp.cfg
deleted file mode 100644
index 093bf86..0000000
--- a/net/tmpl_std/osmo-stp.cfg
+++ /dev/null
@@ -1,6 +0,0 @@
-cs7 instance 0
- xua rkm routing-key-allocation dynamic-permitted
- listen m3ua 2905
-  accept-asp-connections dynamic-permitted
-
-${include(../common_logging)}

-- 
To view, visit https://gerrit.osmocom.org/13108
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6352c584c0fce57c617387160c285abf40a5f90
Gerrit-Change-Number: 13108
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190303/de1731e5/attachment.htm>


More information about the gerrit-log mailing list