aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-07-28 15:30:09 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-07-28 15:30:09 +0200
commitd0288076583f3813725598cecf2c0c5a807aa024 (patch)
treedfa4fcc94d857f34f0912fd70012953d8ff04bc6
parent64c17fa598d2920d8843d022ea92b6846a4d1331 (diff)
misc: Introduce a script tha generates the VTY reference
Update/Move/Create example configuration files for NiTB, BSC, MGCP, NAT and the GbProxy. Create a script that starts, generates the vty reference and terminates the application.
-rwxr-xr-xopenbsc/contrib/dump_all_docs.py56
-rw-r--r--openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg32
-rw-r--r--openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg2
-rw-r--r--openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg3
-rw-r--r--openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg (renamed from openbsc/src/gprs/osmo_gbproxy.cfg)3
5 files changed, 62 insertions, 34 deletions
diff --git a/openbsc/contrib/dump_all_docs.py b/openbsc/contrib/dump_all_docs.py
new file mode 100755
index 000000000..314f60bab
--- /dev/null
+++ b/openbsc/contrib/dump_all_docs.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+
+"""
+Start the process and dump the documentation to the doc dir. This is
+copied from the BTS directory and a fix might need to be applied there
+too.
+"""
+
+import socket, subprocess, time,os
+
+
+def dump_doc(end, port, filename):
+ sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sck.setblocking(1)
+ sck.connect(("localhost", port))
+ sck.recv(4096)
+
+ # Now send the command
+ sck.send("show online-help\r")
+ xml = ""
+ while True:
+ data = sck.recv(4096)
+ xml = "%s%s" % (xml, data)
+ if data.endswith(end):
+ break
+
+ # Now write everything until the end to the file
+ out = open(filename, 'w')
+ out.write(xml[18:len(filename)*-1])
+ out.close()
+
+
+apps = [
+ # The same could be done with an empty config file but this way
+ # the example files are properly tested.
+ (4242, "src/osmo-nitb/osmo-nitb", "doc/examples/osmo-nitb/nanobts/openbsc.cfg", "OpenBSC", "nitb"),
+ (4242, "src/osmo-bsc/osmo-bsc", "doc/examples/osmo-bsc/osmo-bsc.cfg", "OsmoBSC", "bsc"),
+ (4243, "src/osmo-bsc_mgcp/osmo-bsc_mgcp", "doc/examples/osmo-bsc_mgcp/mgcp.cfg", "OpenBSC MGCP", "mgcp"),
+ (4244, "src/osmo-bsc_nat/osmo-bsc_nat", "doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg", "OsmoBSCNAT", "nat"),
+ (4246, "src/gprs/osmo-gbproxy", "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg", "OsmoGbProxy", "gbproxy"),
+]
+
+# Dump the config of all our apps
+for app in apps:
+ print "Starting app for %s" % app[4]
+
+ cmd = [app[1], "-c", app[2]]
+ proc = subprocess.Popen(cmd, stdin=None, stdout=None)
+ time.sleep(1)
+ try:
+ dump_doc('\r\n%s> ' % app[3], app[0], 'doc/%s_vty_reference.xml' % app[4])
+ finally:
+ # Clean-up
+ proc.kill()
+ proc.wait()
+
diff --git a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg
index 97704fb8f..ce24f5c1b 100644
--- a/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/openbsc/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -3,38 +3,6 @@
!!
password foo
!
-log stderr
- logging color 1
- logging timestamp 0
- logging level all everything
- logging level rll notice
- logging level cc notice
- logging level mm notice
- logging level rr notice
- logging level rsl notice
- logging level nm info
- logging level mncc notice
- logging level sms notice
- logging level pag notice
- logging level meas notice
- logging level mi notice
- logging level mib notice
- logging level mux notice
- logging level inp notice
- logging level sccp notice
- logging level msc notice
- logging level mgcp notice
- logging level ho notice
- logging level db notice
- logging level ref notice
- logging level gprs debug
- logging level ns info
- logging level bssgp debug
- logging level llc debug
- logging level sndcp debug
- logging level nat notice
- logging level lglobal notice
- logging level llapdm notice
!
line vty
no login
diff --git a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg b/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
index 678f54637..c46b46d4c 100644
--- a/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
+++ b/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
@@ -9,7 +9,7 @@ line vty
mgcp
! local ip 213.167.134.14
bts ip 172.16.252.43
- bind ip 213.167.134.141
+ bind ip 127.0.0.1
bind port 2427
bind early 1
rtp base 4000
diff --git a/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg b/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg
new file mode 100644
index 000000000..e254fba7d
--- /dev/null
+++ b/openbsc/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg
@@ -0,0 +1,3 @@
+nat
+mgcp
+ call agent ip 127.0.0.1
diff --git a/openbsc/src/gprs/osmo_gbproxy.cfg b/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
index d6b561990..0c3917a3e 100644
--- a/openbsc/src/gprs/osmo_gbproxy.cfg
+++ b/openbsc/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
@@ -20,5 +20,6 @@ ns
timer tns-test 30
timer tns-alive 3
timer tns-alive-retries 10
- encapsulation framerelay-gre enabled 1
+ encapsulation framerelay-gre enabled 0
encapsulation framerelay-gre local-ip 0.0.0.0
+ encapsulation udp local-port 23000