mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
Compare commits
141 Commits
1.13.0
...
lynxis/pre
Author | SHA1 | Date | |
---|---|---|---|
|
c56f68abd7 | ||
|
01fc7fb239 | ||
|
370f4e3867 | ||
|
3acaadd44d | ||
|
f6a9cd53f4 | ||
|
f81151bd3f | ||
|
9c0bab9b48 | ||
|
2fa9279702 | ||
|
a622828806 | ||
|
2ab3af5263 | ||
|
8571981205 | ||
|
2930c2d8ad | ||
|
6cd30366be | ||
|
ffb3e8d2ec | ||
|
b3f606a826 | ||
|
838a381b49 | ||
|
c5aed8c10e | ||
|
5b2283ba68 | ||
|
f42457ec98 | ||
|
09db3b69ed | ||
|
4ebab46847 | ||
|
19c4fd0562 | ||
|
e198087a15 | ||
|
50643e419d | ||
|
e21c93fc96 | ||
|
956a2eb418 | ||
|
90835e0083 | ||
|
8643faad59 | ||
|
03e1d5c7c5 | ||
|
5bc821566f | ||
|
b67fb4fc63 | ||
|
4b36c7a34e | ||
|
15b06b9d3c | ||
|
241f119d8e | ||
|
5938727956 | ||
|
ec49e842fe | ||
|
3ae6040afd | ||
|
9b0db3860c | ||
|
0317b106fe | ||
|
920420284c | ||
|
ae33266f6c | ||
|
ea452c93ca | ||
|
195cab61ab | ||
|
23880357f2 | ||
|
2fd3a60ed8 | ||
|
569335bc34 | ||
|
4c098cfb32 | ||
|
d3f2ae8d6a | ||
|
faa1b9dd0a | ||
|
f85f656b18 | ||
|
51442a7886 | ||
|
88824c7c7d | ||
|
6202b37a0b | ||
|
dd93694587 | ||
|
ead844e65e | ||
|
d6278889c4 | ||
|
2535d12377 | ||
|
ed21f2eecf | ||
|
31b05fe895 | ||
|
e4b33dd303 | ||
|
184892b371 | ||
|
8a3c5a0699 | ||
|
7d5e706964 | ||
|
04d1ca7895 | ||
|
e4dc412e7b | ||
|
1f94ba58ea | ||
|
104548372c | ||
|
79b2387c0b | ||
|
39bc234f9e | ||
|
3a401548ce | ||
|
cc12b708a7 | ||
|
114c4ff913 | ||
|
9fa9783dc6 | ||
|
3d09bbbbc4 | ||
|
34ed929877 | ||
|
fef5ee84f2 | ||
|
ad228e16cf | ||
|
869842e16c | ||
|
3bac10082a | ||
|
158d842969 | ||
|
a2ec888287 | ||
|
1a331b5405 | ||
|
83d75bb19a | ||
|
7a8e4a0215 | ||
|
d4d44cacbc | ||
|
554488dee8 | ||
|
d46c75dac9 | ||
|
2a6629b27e | ||
|
95e1a3b53c | ||
|
00a0862e9c | ||
|
d4195472f5 | ||
|
741b987923 | ||
|
3398964176 | ||
|
c5bb5816cd | ||
|
1c832b34b1 | ||
|
88e9ecbfb5 | ||
|
3386a8791e | ||
|
2529f046e8 | ||
|
ae819a1be4 | ||
|
2878423b95 | ||
|
714b2281b8 | ||
|
c7aa82b109 | ||
|
d69cdf75e0 | ||
|
6cad4c3e7f | ||
|
2238185739 | ||
|
456dbb8070 | ||
|
a3df1f8732 | ||
|
e66311b1bd | ||
|
7e77a293a5 | ||
|
2932bc4955 | ||
|
1168969378 | ||
|
3d5990fc65 | ||
|
21ca60807c | ||
|
aba422a6cc | ||
|
d0a25a05a2 | ||
|
bbc26f444a | ||
|
c49975de02 | ||
|
6a87169a31 | ||
|
3a0b3b2182 | ||
|
3f8fdf0e7a | ||
|
36e6e7f074 | ||
|
03f51df03c | ||
|
46f4f14024 | ||
|
ecd8c048fc | ||
|
ed739b9dac | ||
|
5322912630 | ||
|
772205aae1 | ||
|
853883d1f6 | ||
|
6a29d326e0 | ||
|
2483f1b050 | ||
|
b8b85a1b2e | ||
|
53edff3c70 | ||
|
625e05a6b2 | ||
|
3355fd674f | ||
|
f2ba81303e | ||
|
cbafa255cc | ||
|
14ce472225 | ||
|
c00d016e20 | ||
|
f29ff888a2 | ||
|
29b9206e80 | ||
|
9e3c66b181 |
82
.gitignore
vendored
82
.gitignore
vendored
@@ -1 +1,83 @@
|
||||
debian/*.log
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
bscconfig.h
|
||||
bscconfig.h.in
|
||||
openbsc.pc
|
||||
src/osmo-nitb/osmo-nitb
|
||||
src/osmo-bsc_mgcp/osmo-bsc_mgcp
|
||||
src/osmo-bsc/osmo-bsc
|
||||
src/utils/meas_vis
|
||||
src/utils/meas_json
|
||||
src/utils/osmo-meas-pcap2db
|
||||
src/utils/osmo-meas-udp2db
|
||||
src/utils/smpp_mirror
|
||||
*.*~
|
||||
*.sw?
|
||||
.libs
|
||||
*.pyc
|
||||
*.gcda
|
||||
*.gcno
|
||||
|
||||
#configure
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
config.log
|
||||
config.status
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
compile
|
||||
depcomp
|
||||
install-sh
|
||||
missing
|
||||
stamp-h1
|
||||
libtool
|
||||
ltmain.sh
|
||||
|
||||
# git-version-gen magic
|
||||
.tarball-version
|
||||
.version
|
||||
|
||||
|
||||
# apps and app data
|
||||
hlr.sqlite3
|
||||
src/utils/bs11_config
|
||||
src/ipaccess/ipaccess-config
|
||||
src/ipaccess/abisip-find
|
||||
src/ipaccess/ipaccess-firmware
|
||||
src/ipaccess/ipaccess-proxy
|
||||
src/utils/isdnsync
|
||||
src/nat/bsc_nat
|
||||
src/gprs/osmo-sgsn
|
||||
src/gprs/osmo-gbproxy
|
||||
src/gprs/osmo-gtphub
|
||||
src/osmo-bsc_nat/osmo-bsc_nat
|
||||
src/libcommon/gsup_test_client
|
||||
src/osmo-msc/osmo-msc
|
||||
|
||||
#tests
|
||||
tests/testsuite.dir
|
||||
tests/*/*_test
|
||||
# ignore compiled binaries like msc_vlr_test_foo; do not ignore
|
||||
# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object
|
||||
# files:
|
||||
tests/msc_vlr/msc_vlr_test_*
|
||||
!tests/msc_vlr/msc_vlr_test_*.*
|
||||
tests/msc_vlr/msc_vlr_test_*.o
|
||||
|
||||
|
||||
tests/atconfig
|
||||
tests/atlocal
|
||||
tests/package.m4
|
||||
tests/testsuite
|
||||
tests/testsuite.log
|
||||
|
||||
gsn_restart
|
||||
src/openbsc.cfg*
|
||||
writtenconfig/
|
||||
gtphub_restart_count
|
||||
|
@@ -13,10 +13,11 @@ SUBDIRS = \
|
||||
include \
|
||||
src \
|
||||
tests \
|
||||
contrib \
|
||||
$(NULL)
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = openbsc.pc
|
||||
pkgconfig_DATA = libosmo-legacy-mgcp.pc
|
||||
|
||||
BUILT_SOURCES = $(top_srcdir)/.version
|
||||
EXTRA_DIST = git-version-gen osmoappdesc.py .version
|
@@ -1,5 +1,5 @@
|
||||
dnl Process this file with autoconf to produce a configure script
|
||||
AC_INIT([openbsc],
|
||||
AC_INIT([osmo-mgw],
|
||||
m4_esyscmd([./git-version-gen .tarball-version]),
|
||||
[openbsc@lists.osmocom.org])
|
||||
|
||||
@@ -37,40 +37,7 @@ AC_SUBST(LIBRARY_DL)
|
||||
|
||||
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.9.5)
|
||||
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
|
||||
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.9.5)
|
||||
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0)
|
||||
PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4)
|
||||
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1)
|
||||
PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
|
||||
|
||||
# Enabke/disable the NAT?
|
||||
AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
|
||||
[osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"])
|
||||
if test "$osmo_ac_build_nat" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_nat)
|
||||
|
||||
# Enable/disable the BSC?
|
||||
AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
|
||||
[osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"])
|
||||
if test "$osmo_ac_build_bsc" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_bsc)
|
||||
|
||||
# Enable/disable smpp support in the nitb?
|
||||
AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
|
||||
[osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"])
|
||||
if test "$osmo_ac_build_smpp" = "yes" ; then
|
||||
PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
|
||||
AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes")
|
||||
AC_SUBST(osmo_ac_build_smpp)
|
||||
|
||||
# Enable/disable transcoding within osmo-bsc_mgcp?
|
||||
AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])],
|
||||
@@ -88,53 +55,6 @@ fi
|
||||
AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes")
|
||||
AC_SUBST(osmo_ac_mgcp_transcoding)
|
||||
|
||||
# Enable/disable 3G aka IuPS + IuCS support?
|
||||
AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])],
|
||||
[osmo_ac_iu="$enableval"],[osmo_ac_iu="no"])
|
||||
if test "x$osmo_ac_iu" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(LIBASN1C, libasn1c) # TODO version?
|
||||
PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap) # TODO version?
|
||||
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran) # TODO version?
|
||||
AC_DEFINE(BUILD_IU, 1, [Define if we want to build IuPS and IuCS interfaces support])
|
||||
fi
|
||||
AM_CONDITIONAL(BUILD_IU, test "x$osmo_ac_iu" = "xyes")
|
||||
AC_SUBST(osmo_ac_iu)
|
||||
|
||||
|
||||
found_libgtp=yes
|
||||
PKG_CHECK_MODULES(LIBGTP, libgtp >= 0.92, , found_libgtp=no)
|
||||
AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes)
|
||||
AC_SUBST(found_libgtp)
|
||||
|
||||
found_libcares=yes
|
||||
PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no])
|
||||
AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes)
|
||||
AC_SUBST(found_libcares)
|
||||
|
||||
found_libgtp_and_libcares=no
|
||||
if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then
|
||||
found_libgtp_and_libcares=yes
|
||||
fi
|
||||
AC_SUBST(found_libgtp_and_libcares)
|
||||
|
||||
dnl checks for header files
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
|
||||
|
||||
found_pcap=yes
|
||||
AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no)
|
||||
AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
|
||||
|
||||
found_cdk=yes
|
||||
AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no)
|
||||
AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
|
||||
|
||||
found_sqlite3=yes
|
||||
PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no)
|
||||
AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes)
|
||||
AC_SUBST(found_sqlite3)
|
||||
|
||||
|
||||
dnl Checks for typedefs, structures and compiler characteristics
|
||||
|
||||
# The following test is taken from WebKit's webkit.m4
|
||||
@@ -169,31 +89,6 @@ if test "$enable_coverage" = "yes"; then
|
||||
AC_SUBST([COVERAGE_LDFLAGS])
|
||||
fi
|
||||
|
||||
AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
|
||||
AC_CACHE_CHECK(
|
||||
[whether struct tm has tm_gmtoff member],
|
||||
osmo_cv_tm_includes_tm_gmtoff,
|
||||
[AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([
|
||||
#include <time.h>
|
||||
], [
|
||||
time_t t = time(NULL);
|
||||
struct tm* lt = localtime(&t);
|
||||
int off = lt->tm_gmtoff;
|
||||
])
|
||||
],
|
||||
osmo_cv_tm_includes_tm_gmtoff=yes,
|
||||
osmo_cv_tm_includes_tm_gmtoff=no
|
||||
)]
|
||||
)
|
||||
if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then
|
||||
AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1,
|
||||
[Define if struct tm has tm_gmtoff member.])
|
||||
fi
|
||||
])
|
||||
|
||||
CHECK_TM_INCLUDES_TM_GMTOFF
|
||||
|
||||
AC_ARG_ENABLE([vty_tests],
|
||||
AC_HELP_STRING([--enable-vty-tests],
|
||||
[Include the VTY/CTRL tests in make check (deprecated)
|
||||
@@ -207,7 +102,7 @@ if test "x$enable_ext_tests" = "xyes" ; then
|
||||
AM_PATH_PYTHON
|
||||
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
|
||||
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
|
||||
AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.])
|
||||
AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
|
||||
fi
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
|
||||
@@ -218,49 +113,17 @@ dnl Generate the output
|
||||
AM_CONFIG_HEADER(bscconfig.h)
|
||||
|
||||
AC_OUTPUT(
|
||||
openbsc.pc
|
||||
include/openbsc/Makefile
|
||||
libosmo-legacy-mgcp.pc
|
||||
include/Makefile
|
||||
include/osmocom/Makefile
|
||||
include/osmocom/legacy_mgcp/Makefile
|
||||
src/Makefile
|
||||
src/libtrau/Makefile
|
||||
src/libbsc/Makefile
|
||||
src/libmsc/Makefile
|
||||
src/libmgcp/Makefile
|
||||
src/libcommon/Makefile
|
||||
src/libfilter/Makefile
|
||||
src/libiu/Makefile
|
||||
src/libcommon-cs/Makefile
|
||||
src/osmo-nitb/Makefile
|
||||
src/osmo-bsc/Makefile
|
||||
src/osmo-bsc_nat/Makefile
|
||||
src/libosmo-legacy-mgcp/Makefile
|
||||
src/osmo-bsc_mgcp/Makefile
|
||||
src/ipaccess/Makefile
|
||||
src/utils/Makefile
|
||||
src/gprs/Makefile
|
||||
tests/Makefile
|
||||
tests/atlocal
|
||||
tests/gsm0408/Makefile
|
||||
tests/db/Makefile
|
||||
tests/channel/Makefile
|
||||
tests/bsc/Makefile
|
||||
tests/bsc-nat/Makefile
|
||||
tests/bsc-nat-trie/Makefile
|
||||
tests/mgcp/Makefile
|
||||
tests/gprs/Makefile
|
||||
tests/gbproxy/Makefile
|
||||
tests/abis/Makefile
|
||||
tests/smpp/Makefile
|
||||
tests/trau/Makefile
|
||||
tests/sgsn/Makefile
|
||||
tests/subscr/Makefile
|
||||
tests/oap/Makefile
|
||||
tests/gtphub/Makefile
|
||||
tests/mm_auth/Makefile
|
||||
tests/xid/Makefile
|
||||
tests/sndcp_xid/Makefile
|
||||
tests/slhc/Makefile
|
||||
tests/v42bis/Makefile
|
||||
tests/nanobts_omlattr/Makefile
|
||||
tests/legacy_mgcp/Makefile
|
||||
doc/Makefile
|
||||
doc/examples/Makefile
|
||||
contrib/Makefile
|
||||
Makefile)
|
1
contrib/Makefile.am
Normal file
1
contrib/Makefile.am
Normal file
@@ -0,0 +1 @@
|
||||
EXTRA_DIST = ipa.py
|
@@ -19,34 +19,26 @@ export LD_LIBRARY_PATH="$inst/lib"
|
||||
|
||||
if [ "x$IU" = "x--enable-iu" ]; then
|
||||
sccp_branch="old_sua"
|
||||
osmo_iuh_branch="old_sua"
|
||||
fi
|
||||
|
||||
osmo-build-dep.sh libosmo-abis
|
||||
osmo-build-dep.sh libosmo-netif
|
||||
osmo-build-dep.sh libosmo-sccp $sccp_branch
|
||||
PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34
|
||||
osmo-build-dep.sh openggsn
|
||||
|
||||
if [ "x$IU" = "x--enable-iu" ]; then
|
||||
osmo-build-dep.sh libasn1c
|
||||
#osmo-build-dep.sh asn1c aper-prefix # only needed for make regen in osmo-iuh
|
||||
osmo-build-dep.sh osmo-iuh
|
||||
fi
|
||||
|
||||
set +x
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo " =============================== openbsc ==============================="
|
||||
echo " =============================== osmo-mgw ==============================="
|
||||
echo
|
||||
set -x
|
||||
|
||||
cd "$base"
|
||||
cd openbsc
|
||||
autoreconf --install --force
|
||||
./configure --enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests
|
||||
./configure $MGCP --enable-vty-tests --enable-external-tests
|
||||
$MAKE $PARALLEL_MAKE
|
||||
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|
||||
|| cat-testlogs.sh
|
||||
LD_LIBRARY_PATH="$inst/lib" $MAKE distcheck \
|
||||
LD_LIBRARY_PATH="$inst/lib" \
|
||||
DISTCHECK_CONFIGURE_FLAGS="--enable-osmo-bsc --enable-nat $SMPP $MGCP $IU --enable-vty-tests --enable-external-tests" \
|
||||
$MAKE distcheck \
|
||||
|| cat-testlogs.sh
|
||||
|
1
debian/autoreconf
vendored
1
debian/autoreconf
vendored
@@ -1 +0,0 @@
|
||||
openbsc
|
76
debian/changelog
vendored
76
debian/changelog
vendored
@@ -1,75 +1,5 @@
|
||||
openbsc (0.15.1) UNRELEASED; urgency=medium
|
||||
osmo-mgw (0.1.0) unstable; urgency=low
|
||||
|
||||
* Move forward toward a new release.
|
||||
* Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' are configured.
|
||||
Note: such configs are broken without extra workarounds anyway.
|
||||
* Initial release.
|
||||
|
||||
-- Holger Hans Peter Freyther <holger@moiji-mobile.com> Tue, 24 May 2016 23:14:31 +0200
|
||||
|
||||
openbsc (0.14.0) unstable; urgency=low
|
||||
|
||||
* New upstream tag and additional patches.
|
||||
|
||||
-- Holger Hans Peter Freyther <holger@freyther.de> Sat, 14 Mar 2015 20:33:25 +0100
|
||||
|
||||
openbsc (0.12.0+git26-7) unstable; urgency=low
|
||||
|
||||
* 64bit fix for the MGCP rewriting
|
||||
|
||||
-- Holger Hans Peter Freyther <holger@freyther.de> Wed, 07 Nov 2012 11:39:34 +0100
|
||||
|
||||
openbsc (0.12.0+git26-6) precise; urgency=low
|
||||
|
||||
* Added init script for osmocom-sgsn.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 21:04:32 -0700
|
||||
|
||||
openbsc (0.12.0+git26-5) precise; urgency=low
|
||||
|
||||
* Don't enable MNCC sock by default.
|
||||
* Automatically create important directories.
|
||||
* Fix init script 'stop' command.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Fri, 24 Aug 2012 20:56:33 -0700
|
||||
|
||||
openbsc (0.12.0+git26-4) precise; urgency=low
|
||||
|
||||
* Specify HLR path and enable RTP proxy.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Mon, 20 Aug 2012 00:21:07 -0700
|
||||
|
||||
openbsc (0.12.0+git26-3) precise; urgency=low
|
||||
|
||||
* Fix init script.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Sun, 19 Aug 2012 16:05:44 -0700
|
||||
|
||||
openbsc (0.12.0+git26-2) precise; urgency=low
|
||||
|
||||
* Fix libdbi package dependency.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Wed, 15 Aug 2012 00:35:37 -0700
|
||||
|
||||
openbsc (0.12.0+git26-1) precise; urgency=low
|
||||
|
||||
* Fix version issue.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 21:00:51 -0700
|
||||
|
||||
openbsc (0.12.0+git26) precise; urgency=low
|
||||
|
||||
* Updated ubuntu package.
|
||||
|
||||
-- Eric Butler <eric@codebutler.com> Tue, 14 Aug 2012 17:36:51 -0700
|
||||
|
||||
openbsc (0.9.13.115.eb113-1) natty; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Wed, 11 May 2011 18:41:24 +0000
|
||||
|
||||
openbsc (0.9.4-1) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- Harald Welte <laforge@gnumonks.org> Tue, 24 Aug 2010 13:34:24 +0200
|
||||
-- Alexander Couzens <lynxis@fe80.eu> Tue, 08 Aug 2017 01:12:53 +0000
|
||||
|
202
debian/control
vendored
202
debian/control
vendored
@@ -1,181 +1,49 @@
|
||||
Source: openbsc
|
||||
Maintainer: Harald Welte <laforge@gnumonks.org>
|
||||
Source: osmo-mgw
|
||||
Section: net
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>= 9),
|
||||
autotools-dev,
|
||||
autoconf-archive,
|
||||
pkg-config,
|
||||
libgtp-dev,
|
||||
libosmocore-dev,
|
||||
libosmo-sccp-dev,
|
||||
libdbi0-dev,
|
||||
Priority: extra
|
||||
Maintainer: Alexander Couzens <lynxis@fe80.eu>
|
||||
Build-Depends: debhelper (>=9),
|
||||
dh-autoreconf,
|
||||
libosmo-abis-dev,
|
||||
libosmo-netif-dev,
|
||||
libdbd-sqlite3,
|
||||
libpcap-dev,
|
||||
libssl-dev,
|
||||
libc-ares-dev,
|
||||
libsmpp34-dev
|
||||
pkg-config,
|
||||
autotools-dev,
|
||||
libosmocore-dev,
|
||||
libosmo-netif-dev
|
||||
Standards-Version: 3.9.8
|
||||
Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git
|
||||
Vcs-Browser: http://openbsc.osmocom.org/trac/browser
|
||||
Homepage: https://projects.osmocom.org/projects/openbsc
|
||||
Vcs-Git: git://git.osmocom.org/osmo-iuh.git
|
||||
Vcs-Browser: https://git.osmocom.org/osmo-iuh/
|
||||
Homepage: https://projects.osmocom.org/projects/osmohnbgw
|
||||
|
||||
Package: osmocom-bsc
|
||||
Package: osmo-mgw
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: GSM Base Station Controller
|
||||
This is the BSC-only version of OpenBSC. It requires a Mobile Switching Center
|
||||
(MSC) to operate.
|
||||
.
|
||||
You might rather prefer to use osmocom-nitb which is considered a
|
||||
"GSM Network-in-a-Box" and does not depend on a MSC.
|
||||
Multi-Arch: foreign
|
||||
Depends: libosmo-legacy-mgcp0, ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
|
||||
|
||||
Package: osmocom-nitb
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
libdbd-sqlite3
|
||||
Description: GSM Network-in-a-Box, implements BSC, MSC, SMSC, HLR, VLR
|
||||
This is the Network-in-a-Box version of OpenBSC. It has all the GSM network
|
||||
components bundled together. When using osmocom-nitb, there is no need for a
|
||||
Mobile Switching Center (MSC) which is needed when using osmocom-bsc.
|
||||
|
||||
Package: osmocom-ipaccess-utils
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: Command line utilities for ip.access nanoBTS
|
||||
This package contains utilities that are specific for nanoBTS when being used
|
||||
together with OpenBSC. It contains mainly three tools: ipaccess-find,
|
||||
ipaccess-config and ipaccess-proxy.
|
||||
|
||||
Package: osmocom-bs11-utils
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Description: Command line utilities for Siemens BS-11 BTS
|
||||
There is a tool in this package for configuring the Siemens BS-11 BTS.
|
||||
Additionally, it contains one tool for making use of an ISDN-card and the
|
||||
public telephone network as frequency standard for the E1 line.
|
||||
|
||||
Package: osmocom-sgsn
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Suggests: osmocom-bsc
|
||||
Description: Osmocom Serving GPRS Support Node
|
||||
This is an implementation of the GPRS Serving GPRS Support Node (SGSN). As
|
||||
such it implements the GPRS Mobility Management (GMM) and SM (Session
|
||||
Management).
|
||||
.
|
||||
The SGSN connects via the Gb-interface to the BSS (like the osmo-pcu or an
|
||||
ip.access nanoBTS), and it connects via the GTP protocol to a Gateway GPRS
|
||||
Support Node (GGSN) like openggsn.
|
||||
|
||||
Package: osmocom-gbproxy
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Recommends: osmocom-sgsn
|
||||
Description: Osmocom GPRS Gb Interface Proxy
|
||||
The purpose of the Gb proxy is to aggregate the Gb links of multiple
|
||||
BSS's and present them in one Gb link to the SGSN.
|
||||
.
|
||||
This package is part of OpenBSC and closely related to osmocom-sgsn.
|
||||
|
||||
Package: osmocom-bsc-nat
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends}
|
||||
Recommends: osmocom-bsc
|
||||
Description: Osmocom Base Station Controller Network Address Translation
|
||||
This NAT is useful for masquerading multiple BSCs behind one. It listens
|
||||
for incoming BSCs on port 5000 and connects to a specified Mobile Switching
|
||||
Center (MSC).
|
||||
.
|
||||
This package is part of OpenBSC and closely related to osmocom-bsc.
|
||||
|
||||
Package: openbsc-dev
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}
|
||||
Description: Header file needed by tools tightly integrated
|
||||
Some other programs depend on gsm_data_shared.h and gsm_data_shared.c
|
||||
from OpenBSC. This package installs these files to your file system so
|
||||
that the other packages can build-depend on this package.
|
||||
.
|
||||
The directory structure is copied after the structure in the repository
|
||||
and the header and .c file are installed into /usr/src/osmocom/openbsc/.
|
||||
|
||||
Package: osmo-gtphub
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Osmocom GTP Hub
|
||||
Proxy for comms between multiple SGSNs and GGSNs.
|
||||
|
||||
Package: osmocom-bsc-dbg
|
||||
Architecture: any
|
||||
Package: osmo-mgw-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-bsc (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC BSC
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-nitb-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-nitb (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC NITB
|
||||
Make debugging possible
|
||||
Multi-Arch: same
|
||||
Depends: osmo-mgw (= ${binary:Version}), ${misc:Depends}
|
||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
|
||||
|
||||
Package: osmocom-ipaccess-utils-dbg
|
||||
Package: libosmo-legacy-mgcp0
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-ipaccess-utils (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC ip.access utils
|
||||
Make debugging possible
|
||||
Multi-Arch: same
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${misc:Depends}, ${shlibs:Depends}
|
||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
|
||||
|
||||
Package: osmocom-bs11-utils-dbg
|
||||
Architecture: any
|
||||
Package: libosmo-legacy-mgcp-dbg
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-bs11-utils (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC BS11 utils
|
||||
Make debugging possible
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
|
||||
|
||||
Package: osmocom-sgsn-dbg
|
||||
Package: libosmo-legacy-mgcp-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-sgsn (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC Serving GPRS Support Node
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-gbproxy-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-gbproxy (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC GPRS GBProxy
|
||||
Make debugging possible
|
||||
|
||||
Package: osmocom-bsc-nat-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmocom-bsc-nat (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for the OpenBSC Network Address Translation
|
||||
Make debugging possible
|
||||
|
||||
Package: osmo-gtphub-dbg
|
||||
Architecture: any
|
||||
Section: debug
|
||||
Priority: extra
|
||||
Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends}
|
||||
Description: Debug symbols for Osmocom GTP Hub
|
||||
Make debugging possible
|
||||
Multi-Arch: same
|
||||
Depends: libosmo-legacy-mgcp0 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: OsmoMGW: Osmocom's Media Gateway for 2G and 3G circuit-switched mobile networks
|
||||
|
183
debian/copyright
vendored
183
debian/copyright
vendored
@@ -1,74 +1,14 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: OpenBSC
|
||||
Source: http://openbsc.osmocom.org/
|
||||
Upstream-Name: osmo-mgw
|
||||
Source: git://git.osmocom.org/osmo-mgw
|
||||
|
||||
Files: *
|
||||
Copyright: 2008-2015 Harald Welte <laforge@gnumonks.org>
|
||||
2008-2015 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2009-2015 On-Waves
|
||||
2008 Jan Luebbe <jluebbe@debian.org>
|
||||
2008,2010-2011 Daniel Willmann <daniel@totalueberwachung.de>
|
||||
2009,2011,2013 Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
2009,2011 Dieter Spaar <spaar@mirider.augusta.de>
|
||||
2009 Mike Haben <michael.haben@btinternet.com>
|
||||
2010 Sylvain Munaut <246tnt@gmail.com>
|
||||
2012-2013 Pablo Neira Ayuso <pablo@gnumonks.org>
|
||||
2013-2015 Sysmocom s.f.m.c. GmbH (Jacob Erlbeck)
|
||||
2014 Alexander Chemeris <Alexander.Chemeris@fairwaves.co>
|
||||
License: AGPL-3+
|
||||
Comment: Contributions by Stefan Schmidt <stefan@datenfreihafen.org> as well
|
||||
|
||||
Files: wireshark/0001-abis_oml.patch
|
||||
wireshark/0002-ericsson_rbs2409.patch
|
||||
wireshark/0003-lucent-hnb.patch
|
||||
wireshark/0005-rsl-hsl.patch
|
||||
Copyright: 1998 Gerald Combs <gerald@wireshark.org>
|
||||
2007,2011 Anders Broman <anders.broman@ericsson.com>
|
||||
2009 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2009-2011 Harald Welte <laforge@gnumonks.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: openbsc/include/mISDNif.h
|
||||
Copyright: 2008 Karsten Keil <kkeil@novell.com>
|
||||
License: LGPL-2.1
|
||||
|
||||
Files: openbsc/src/libmgcp/g711common.h
|
||||
Copyright: 2009 Abramo Bagnara <abramo@alsa-project.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: openbsc/git-version-gen
|
||||
Copyright: 2007-2010 Free Software Foundation
|
||||
License: GPL-3+
|
||||
|
||||
Files: openbsc/osmoappdesc.py
|
||||
openbsc/tests/smpp_test_runner.py
|
||||
openbsc/tests/ctrl_test_runner.py
|
||||
openbsc/tests/vty_test_runner.py
|
||||
Copyright: 2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
|
||||
2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
|
||||
2013-2014 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
License: GPL-3+
|
||||
|
||||
Files: openbsc/src/libbsc/bsc_ctrl_lookup.c
|
||||
Copyright: 2010-2011 Daniel Willmann <daniel@totalueberwachung.de>
|
||||
2010-2011 On-Waves
|
||||
License: GPL-2+
|
||||
|
||||
Files: openbsc/src/libmsc/mncc_sock.c
|
||||
openbsc/src/libmsc/mncc_builtin.c
|
||||
Copyright: 2008-2010 Harald Welte <laforge@gnumonks.org>
|
||||
2009 Andreas Eversberg <Andreas.Eversberg@versatel.de>
|
||||
2012 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2012-2015 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2016 Ruben Undheim <ruben.undheim@gmail.com>
|
||||
License: GPL-2+
|
||||
|
||||
|
||||
License: AGPL-3+
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
Files: *
|
||||
Copyright: 2009-2014 On-Waves
|
||||
2009-2015 Holger Hans Peter Freyther <zecke@selfish.org>
|
||||
2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
|
||||
2016 sysmocom s.m.f.c. GmbH <info@sysmocom.de>
|
||||
License: AGPL-3.0+
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
@@ -76,62 +16,67 @@ License: AGPL-3+
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
GNU Affero General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
License: GPL-2+
|
||||
This package is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or (at
|
||||
your option) any later version.
|
||||
Files: src/libosmo-legacy-mgcp/g711common.h
|
||||
Copyright: 2000 Abramo Bagnara <abramo@alsa-project.org>
|
||||
License: GPL-2.0+
|
||||
Wrapper for linphone Codec class by Simon Morlat <simon.morlat@linphone.org>
|
||||
.
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
|
||||
|
||||
License: GPL-3+
|
||||
This package is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or (at
|
||||
your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 3 can be found in "/usr/share/common-licenses/GPL-3".
|
||||
|
||||
|
||||
License: LGPL-2.1
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; version
|
||||
2.1 of the License.
|
||||
.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Lesser General
|
||||
Public License version 2.1 can be found in
|
||||
"/usr/share/common-licenses/LGPL-2.1".
|
||||
The FSF address in the above text is the old one.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
Files: tests/vty_test_runner.py
|
||||
Copyright: 2013 Holger Hans Peter Freyther
|
||||
2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
|
||||
License: GPL-3.0+
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General Public License
|
||||
Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
|
||||
|
||||
Files: osmoappdesc.py
|
||||
Copyright: 2013 Katerina Barone-Adesi <kat.obsc@gmail.com>
|
||||
License: GPL-3.0+
|
||||
|
||||
Files: src/libosmo-legacy-mgcp/mgcp_osmux.c
|
||||
Copyright: 2012-2013 On Waves ehf <http://www.on-waves.com>
|
||||
2012-2013 Pablo Neira Ayuso <pablo@gnumonks.org>
|
||||
License: AGPL-3.0+
|
||||
All rights not specifically granted under this license are reserved.
|
||||
.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Affero General Public License as published by the
|
||||
Free Software Foundation; either version 3 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
|
1
debian/docs
vendored
1
debian/docs
vendored
@@ -1 +0,0 @@
|
||||
openbsc/README
|
3
debian/libosmo-legacy-mgcp-dev.install
vendored
Normal file
3
debian/libosmo-legacy-mgcp-dev.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/include
|
||||
usr/lib/*/*.so
|
||||
usr/lib/*/pkgconfig/*.pc
|
1
debian/libosmo-legacy-mgcp0.install
vendored
Normal file
1
debian/libosmo-legacy-mgcp0.install
vendored
Normal file
@@ -0,0 +1 @@
|
||||
usr/lib/*/*.so.*
|
4
debian/openbsc-dev.install
vendored
4
debian/openbsc-dev.install
vendored
@@ -1,4 +0,0 @@
|
||||
openbsc/include/openbsc/gsm_data_shared.h usr/src/osmocom/openbsc/openbsc/include/openbsc/
|
||||
openbsc/include/openbsc/common_cs.h usr/src/osmocom/openbsc/openbsc/include/openbsc/
|
||||
openbsc/src/libcommon/gsm_data_shared.c usr/src/osmocom/openbsc/openbsc/src/libcommon/
|
||||
usr/lib/*/pkgconfig/openbsc.pc
|
2
debian/osmo-gtphub.default
vendored
2
debian/osmo-gtphub.default
vendored
@@ -1,2 +0,0 @@
|
||||
CONFIG_FILE="/etc/osmocom/osmo-gtphub.cfg"
|
||||
|
1
debian/osmo-gtphub.examples
vendored
1
debian/osmo-gtphub.examples
vendored
@@ -1 +0,0 @@
|
||||
openbsc/doc/examples/osmo-gtphub
|
150
debian/osmo-gtphub.init
vendored
150
debian/osmo-gtphub.init
vendored
@@ -1,150 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-gtphub
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom GTP hub
|
||||
# Description: Osmocom GTP hub
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-gtphub # Introduce the short server's name here
|
||||
DESC="Osmocom GTP hub" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-gtphub # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmo-gtphub
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmo-gtphub ] && . /etc/default/osmo-gtphub
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
1
debian/osmo-gtphub.install
vendored
1
debian/osmo-gtphub.install
vendored
@@ -1 +0,0 @@
|
||||
/usr/bin/osmo-gtphub
|
1
debian/osmo-mgw.install
vendored
Normal file
1
debian/osmo-mgw.install
vendored
Normal file
@@ -0,0 +1 @@
|
||||
usr/bin
|
2
debian/osmocom-bs11-utils.install
vendored
2
debian/osmocom-bs11-utils.install
vendored
@@ -1,2 +0,0 @@
|
||||
/usr/bin/bs11_config
|
||||
/usr/bin/isdnsync
|
153
debian/osmocom-bsc-nat.init
vendored
153
debian/osmocom-bsc-nat.init
vendored
@@ -1,153 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmocom-bsc-nat
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom GSM network-in-a-box
|
||||
# Description: A minimal implementation of the GSM Base Station Controller,
|
||||
# Mobile Switching Center, Home Location regster and all other
|
||||
# components to run a self-contained GSM network.
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-bsc_nat # Introduce the short server's name here
|
||||
DESC="Osmocom GSM BSC Multiplexer (NAT)" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-bsc_nat # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-bsc-nat
|
||||
CONFIG_FILE=/etc/osmocom/osmocom-bsc-nat.cfg
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-bsc-nat ] && . /etc/default/osmocom-bsc-nat
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="-D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
1
debian/osmocom-bsc-nat.install
vendored
1
debian/osmocom-bsc-nat.install
vendored
@@ -1 +0,0 @@
|
||||
/usr/bin/osmo-bsc_nat
|
1
debian/osmocom-bsc.examples
vendored
1
debian/osmocom-bsc.examples
vendored
@@ -1 +0,0 @@
|
||||
openbsc/doc/examples/osmo-bsc_mgcp
|
2
debian/osmocom-bsc.install
vendored
2
debian/osmocom-bsc.install
vendored
@@ -1,2 +0,0 @@
|
||||
/usr/bin/osmo-bsc_mgcp
|
||||
/usr/bin/osmo-bsc
|
151
debian/osmocom-gbproxy.init
vendored
151
debian/osmocom-gbproxy.init
vendored
@@ -1,151 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-gbproxy
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom GBproxy
|
||||
# Description: A tool to proxy the GPRS Gb interface.
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-gbproxy # Introduce the short server's name here
|
||||
DESC="Osmocom GBProxy" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-gbproxy # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-gbproxy
|
||||
CONFIG_FILE=/etc/osmocom/osmocom-gbproxy.cfg
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-gbproxy ] && . /etc/default/osmocom-gbproxy
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="-D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
1
debian/osmocom-gbproxy.install
vendored
1
debian/osmocom-gbproxy.install
vendored
@@ -1 +0,0 @@
|
||||
/usr/bin/osmo-gbproxy
|
3
debian/osmocom-ipaccess-utils.install
vendored
3
debian/osmocom-ipaccess-utils.install
vendored
@@ -1,3 +0,0 @@
|
||||
/usr/bin/ipaccess-config
|
||||
/usr/bin/abisip-find
|
||||
/usr/bin/ipaccess-proxy
|
8
debian/osmocom-nitb.default
vendored
8
debian/osmocom-nitb.default
vendored
@@ -1,8 +0,0 @@
|
||||
CONFIG_FILE="/etc/osmocom/osmo-nitb.cfg"
|
||||
HLR_FILE="/var/lib/osmocom/hlr.sqlite3"
|
||||
|
||||
DAEMON_ARGS="-P"
|
||||
|
||||
# Uncomment if using LCR+Asterisk
|
||||
# DAEMON_ARGS="-m -P"
|
||||
|
3
debian/osmocom-nitb.dirs
vendored
3
debian/osmocom-nitb.dirs
vendored
@@ -1,3 +0,0 @@
|
||||
/etc/osmocom
|
||||
/var/log/osmocom
|
||||
/var/lib/osmocom
|
1
debian/osmocom-nitb.examples
vendored
1
debian/osmocom-nitb.examples
vendored
@@ -1 +0,0 @@
|
||||
openbsc/doc/examples/osmo-nitb
|
152
debian/osmocom-nitb.init
vendored
152
debian/osmocom-nitb.init
vendored
@@ -1,152 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-nitb
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom GSM network-in-a-box
|
||||
# Description: A minimal implementation of the GSM Base Station Controller,
|
||||
# Mobile Switching Center, Home Location regster and all other
|
||||
# components to run a self-contained GSM network.
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-nitb # Introduce the short server's name here
|
||||
DESC="Osmocom GSM Network-in-a-Box" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-nitb # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-nitb
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-nitb ] && . /etc/default/osmocom-nitb
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE -l $HLR_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
2
debian/osmocom-nitb.install
vendored
2
debian/osmocom-nitb.install
vendored
@@ -1,2 +0,0 @@
|
||||
/usr/bin/osmo-nitb
|
||||
openbsc/contrib/*.py usr/bin/
|
2
debian/osmocom-sgsn.default
vendored
2
debian/osmocom-sgsn.default
vendored
@@ -1,2 +0,0 @@
|
||||
CONFIG_FILE="/etc/osmocom/osmo-sgsn.cfg"
|
||||
|
1
debian/osmocom-sgsn.examples
vendored
1
debian/osmocom-sgsn.examples
vendored
@@ -1 +0,0 @@
|
||||
openbsc/doc/examples/osmo-sgsn
|
150
debian/osmocom-sgsn.init
vendored
150
debian/osmocom-sgsn.init
vendored
@@ -1,150 +0,0 @@
|
||||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: osmo-sgsn
|
||||
# Required-Start: $network $local_fs
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Osmocom Serving GPRS Support Node
|
||||
# Description: Osmocom Serving GPRS Support Node
|
||||
### END INIT INFO
|
||||
|
||||
# Author: Harald Welte <laforge@gnumonks.org>
|
||||
|
||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
NAME=osmo-sgsn # Introduce the short server's name here
|
||||
DESC="Osmocom Serving GPRS Support Node" # Introduce a short description here
|
||||
DAEMON=/usr/bin/osmo-sgsn # Introduce the server's location here
|
||||
SCRIPTNAME=/etc/init.d/osmocom-sgsn
|
||||
|
||||
# Exit if the package is not installed
|
||||
[ -x $DAEMON ] || exit 0
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
[ -r /etc/default/osmocom-sgsn ] && . /etc/default/osmocom-sgsn
|
||||
|
||||
# Load the VERBOSE setting and other rcS variables
|
||||
. /lib/init/vars.sh
|
||||
|
||||
# Define LSB log_* functions.
|
||||
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
DAEMON_ARGS="$DAEMON_ARGS -D -c $CONFIG_FILE"
|
||||
|
||||
#
|
||||
# Function that starts the daemon/service
|
||||
#
|
||||
do_start()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
|
||||
|| return 1
|
||||
start-stop-daemon --start --quiet --exec $DAEMON -- \
|
||||
$DAEMON_ARGS \
|
||||
|| return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
}
|
||||
|
||||
#
|
||||
# Function that stops the daemon/service
|
||||
#
|
||||
do_stop()
|
||||
{
|
||||
# Return
|
||||
# 0 if daemon has been stopped
|
||||
# 1 if daemon was already stopped
|
||||
# 2 if daemon could not be stopped
|
||||
# other if a failure occurred
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
|
||||
RETVAL="$?"
|
||||
[ "$RETVAL" = 2 ] && return 2
|
||||
# Wait for children to finish too if this is a daemon that forks
|
||||
# and if the daemon is only ever run from this initscript.
|
||||
# If the above conditions are not satisfied then add some other code
|
||||
# that waits for the process to drop all resources that could be
|
||||
# needed by services started subsequently. A last resort is to
|
||||
# sleep for some time.
|
||||
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
|
||||
[ "$?" = 2 ] && return 2
|
||||
return "$RETVAL"
|
||||
}
|
||||
|
||||
#
|
||||
# Function that sends a SIGHUP to the daemon/service
|
||||
#
|
||||
do_reload() {
|
||||
#
|
||||
# If the daemon can reload its configuration without
|
||||
# restarting (for example, when it is sent a SIGHUP),
|
||||
# then implement that here.
|
||||
#
|
||||
start-stop-daemon --stop --signal 1 --quiet $PIDFILE --name $NAME
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
|
||||
do_start
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
|
||||
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||
;;
|
||||
#reload|force-reload)
|
||||
#
|
||||
# If do_reload() is not implemented then leave this commented out
|
||||
# and leave 'force-reload' as an alias for 'restart'.
|
||||
#
|
||||
#log_daemon_msg "Reloading $DESC" "$NAME"
|
||||
#do_reload
|
||||
#log_end_msg $?
|
||||
#;;
|
||||
restart|force-reload)
|
||||
#
|
||||
# If the "reload" option is implemented then remove the
|
||||
# 'force-reload' alias
|
||||
#
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
do_stop
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
|
||||
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
:
|
1
debian/osmocom-sgsn.install
vendored
1
debian/osmocom-sgsn.install
vendored
@@ -1 +0,0 @@
|
||||
/usr/bin/osmo-sgsn
|
46
debian/rules
vendored
46
debian/rules
vendored
@@ -1,32 +1,34 @@
|
||||
#!/usr/bin/make -f
|
||||
# You must remove unused comment lines for the released package.
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# This is an autogenerated template for debian/rules.
|
||||
#
|
||||
# Output every command that modifies files on the build system.
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
|
||||
DEBIAN := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2)
|
||||
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
|
||||
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
|
||||
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
# main packaging script based on dh7 syntax
|
||||
%:
|
||||
dh $@ --sourcedirectory=openbsc --with autoreconf
|
||||
dh $@ --with autoreconf
|
||||
|
||||
# debmake generated override targets
|
||||
# Set options for ./configure
|
||||
#CONFIGURE_FLAGS = <options for ./configure>
|
||||
#overrride_dh_configure:
|
||||
# dh_configure -- $(CONFIGURE_FLAGS)
|
||||
#
|
||||
# Do not install libtool archive, python .pyc .pyo
|
||||
#override_dh_install:
|
||||
# dh_install --list-missing -X.la -X.pyc -X.pyo
|
||||
|
||||
# This is needed for debian stable (squeeze)
|
||||
override_dh_autoreconf:
|
||||
cd openbsc && autoreconf --install --force
|
||||
echo $(VERSION) > .tarball-version
|
||||
dh_autoreconf
|
||||
|
||||
# See https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg
|
||||
override_dh_strip:
|
||||
dh_strip -posmocom-bsc --dbg-package=osmocom-bsc-dbg
|
||||
dh_strip -posmocom-nitb --dbg-package=osmocom-nitb-dbg
|
||||
dh_strip -posmocom-ipaccess-utils --dbg-package=osmocom-ipaccess-utils-dbg
|
||||
dh_strip -posmocom-bs11-utils --dbg-package=osmocom-bs11-utils-dbg
|
||||
dh_strip -posmocom-sgsn --dbg-package=osmocom-sgsn-dbg
|
||||
dh_strip -posmocom-gbproxy --dbg-package=osmocom-gbproxy-dbg
|
||||
dh_strip -posmocom-bsc-nat --dbg-package=osmocom-bsc-nat-dbg
|
||||
dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg
|
||||
|
||||
override_dh_auto_configure:
|
||||
echo $(VERSION) > openbsc/.tarball-version
|
||||
dh_auto_configure --sourcedirectory=openbsc -- --enable-nat --enable-osmo-bsc --enable-smpp
|
||||
|
||||
dh_strip --dbg-package=osmo-mgw-dbg
|
||||
dh_strip --dbg-package=libosmo-legacy-mgcp-dbg
|
||||
|
@@ -40,7 +40,6 @@ network
|
||||
timer t3119 0
|
||||
timer t3122 0
|
||||
timer t3141 0
|
||||
subscriber-keep-in-ram 0
|
||||
bts 0
|
||||
type nanobts
|
||||
band DCS1800
|
@@ -7,13 +7,13 @@ line vty
|
||||
no login
|
||||
!
|
||||
mgcp
|
||||
! local ip 213.167.134.14
|
||||
bts ip 172.16.252.43
|
||||
bind ip 127.0.0.1
|
||||
local ip 10.23.24.2
|
||||
bts ip 10.24.24.1
|
||||
bind ip 10.23.24.1
|
||||
bind port 2427
|
||||
rtp base 4000
|
||||
rtp force-ptime 20
|
||||
sdp audio payload number 98
|
||||
sdp audio payload name AMR/8000
|
||||
number endpoints 31
|
||||
loop 1
|
||||
no rtcp-omit
|
@@ -62,5 +62,5 @@ nat
|
||||
timeout ping 20
|
||||
timeout pong 5
|
||||
ip-dscp 0
|
||||
bscs-config-file bscs.config
|
||||
bscs-config-file bscs.cfg
|
||||
access-list bla imsi-allow ^11$
|
19
doc/examples/osmo-msc/osmo-msc.cfg
Normal file
19
doc/examples/osmo-msc/osmo-msc.cfg
Normal file
@@ -0,0 +1,19 @@
|
||||
!
|
||||
! OsmoMSC configuration saved from vty
|
||||
!
|
||||
line vty
|
||||
no login
|
||||
!
|
||||
network
|
||||
network country code 1
|
||||
mobile network code 1
|
||||
short name OsmoMSC
|
||||
long name OsmoMSC
|
||||
auth policy closed
|
||||
location updating reject cause 13
|
||||
encryption a5 0
|
||||
rrlp mode none
|
||||
mm info 1
|
||||
msc
|
||||
mgcpgw remote-ip 10.23.24.1
|
||||
assign-tmsi
|
@@ -6,9 +6,12 @@ line vty
|
||||
no login
|
||||
!
|
||||
sgsn
|
||||
gtp local-ip 127.0.0.1
|
||||
ggsn 0 remote-ip 127.0.0.1
|
||||
gtp local-ip 10.23.24.1
|
||||
ggsn 0 remote-ip 10.23.24.2
|
||||
ggsn 0 gtp-version 1
|
||||
auth-policy remote
|
||||
gsup remote-ip 127.0.0.1
|
||||
gsup remote-port 4222
|
||||
!
|
||||
ns
|
||||
timer tns-block 3
|
||||
@@ -18,7 +21,7 @@ ns
|
||||
timer tns-test 30
|
||||
timer tns-alive 3
|
||||
timer tns-alive-retries 10
|
||||
encapsulation udp local-ip 127.0.0.1
|
||||
encapsulation udp local-ip 10.23.24.1
|
||||
encapsulation udp local-port 23000
|
||||
encapsulation framerelay-gre enabled 0
|
||||
!
|
@@ -92,8 +92,8 @@ fi
|
||||
if test -n "$v"
|
||||
then
|
||||
: # use $v
|
||||
elif test -d ./../.git \
|
||||
&& v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|
||||
elif
|
||||
v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|
||||
|| git describe --abbrev=4 HEAD 2>/dev/null` \
|
||||
&& case $v in
|
||||
[0-9]*) ;;
|
6
include/Makefile.am
Normal file
6
include/Makefile.am
Normal file
@@ -0,0 +1,6 @@
|
||||
nobase_include_HEADERS = \
|
||||
osmocom/legacy_mgcp/mgcp.h \
|
||||
osmocom/legacy_mgcp/mgcp_internal.h \
|
||||
osmocom/legacy_mgcp/mgcpgw_client.h \
|
||||
osmocom/legacy_mgcp/osmux.h \
|
||||
$(NULL)
|
3
include/osmocom/Makefile.am
Normal file
3
include/osmocom/Makefile.am
Normal file
@@ -0,0 +1,3 @@
|
||||
SUBDIRS = \
|
||||
legacy_mgcp \
|
||||
$(NULL)
|
4
include/osmocom/legacy_mgcp/Makefile.am
Normal file
4
include/osmocom/legacy_mgcp/Makefile.am
Normal file
@@ -0,0 +1,4 @@
|
||||
noinst_HEADERS = \
|
||||
mgcp_transcode.h \
|
||||
vty.h \
|
||||
$(NULL)
|
@@ -26,8 +26,7 @@
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/core/write_queue.h>
|
||||
#include <osmocom/core/timer.h>
|
||||
|
||||
#include "debug.h"
|
||||
#include <osmocom/core/logging.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
@@ -170,6 +169,21 @@ enum mgcp_role {
|
||||
MGCP_BSC_NAT,
|
||||
};
|
||||
|
||||
enum mgcp_connection_mode {
|
||||
MGCP_CONN_NONE = 0,
|
||||
MGCP_CONN_RECV_ONLY = 1,
|
||||
MGCP_CONN_SEND_ONLY = 2,
|
||||
MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY,
|
||||
MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND,
|
||||
};
|
||||
|
||||
extern const struct value_string mgcp_connection_mode_strs[];
|
||||
|
||||
static inline const char *mgcp_cmode_name(enum mgcp_connection_mode mode)
|
||||
{
|
||||
return get_value_string(mgcp_connection_mode_strs, mode);
|
||||
}
|
||||
|
||||
struct mgcp_config {
|
||||
int source_port;
|
||||
char *local_ip;
|
||||
@@ -261,7 +275,7 @@ struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
|
||||
static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
|
||||
{
|
||||
if (timeslot == 0) {
|
||||
LOGP(DMGCP, LOGL_ERROR, "Timeslot should not be 0\n");
|
||||
LOGP(DLMGCP, LOGL_ERROR, "Timeslot should not be 0\n");
|
||||
timeslot = 255;
|
||||
}
|
||||
|
@@ -28,14 +28,6 @@
|
||||
|
||||
#define CI_UNUSED 0
|
||||
|
||||
enum mgcp_connection_mode {
|
||||
MGCP_CONN_NONE = 0,
|
||||
MGCP_CONN_RECV_ONLY = 1,
|
||||
MGCP_CONN_SEND_ONLY = 2,
|
||||
MGCP_CONN_RECV_SEND = MGCP_CONN_RECV_ONLY | MGCP_CONN_SEND_ONLY,
|
||||
MGCP_CONN_LOOPBACK = 4 | MGCP_CONN_RECV_SEND,
|
||||
};
|
||||
|
||||
enum mgcp_trunk_type {
|
||||
MGCP_TRUNK_VIRTUAL,
|
||||
MGCP_TRUNK_E1,
|
||||
@@ -72,6 +64,7 @@ struct mgcp_rtp_state {
|
||||
uint32_t stats_jitter;
|
||||
int32_t stats_transit;
|
||||
int stats_cycles;
|
||||
bool patched_first_rtp_payload;
|
||||
};
|
||||
|
||||
struct mgcp_rtp_codec {
|
||||
@@ -150,7 +143,7 @@ enum mgcp_type {
|
||||
MGCP_OSMUX_BSC_NAT,
|
||||
};
|
||||
|
||||
#include <openbsc/osmux.h>
|
||||
#include <osmocom/legacy_mgcp/osmux.h>
|
||||
|
||||
struct mgcp_endpoint {
|
||||
int allocated;
|
||||
@@ -340,3 +333,5 @@ static inline const char *mgcp_bts_src_addr(struct mgcp_endpoint *endp)
|
||||
return endp->cfg->bts_ports.bind_addr;
|
||||
return endp->cfg->source_addr;
|
||||
}
|
||||
|
||||
int mgcp_msg_terminate_nul(struct msgb *msg);
|
73
include/osmocom/legacy_mgcp/mgcpgw_client.h
Normal file
73
include/osmocom/legacy_mgcp/mgcpgw_client.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MGCPGW_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0"
|
||||
#define MGCPGW_CLIENT_LOCAL_PORT_DEFAULT 0
|
||||
#define MGCPGW_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1"
|
||||
#define MGCPGW_CLIENT_REMOTE_PORT_DEFAULT 2427
|
||||
|
||||
struct msgb;
|
||||
struct vty;
|
||||
struct mgcpgw_client;
|
||||
|
||||
struct mgcpgw_client_conf {
|
||||
const char *local_addr;
|
||||
int local_port;
|
||||
const char *remote_addr;
|
||||
int remote_port;
|
||||
uint16_t first_endpoint;
|
||||
uint16_t last_endpoint;
|
||||
uint16_t bts_base;
|
||||
};
|
||||
|
||||
typedef unsigned int mgcp_trans_id_t;
|
||||
|
||||
struct mgcp_response_head {
|
||||
int response_code;
|
||||
mgcp_trans_id_t trans_id;
|
||||
const char *comment;
|
||||
};
|
||||
|
||||
struct mgcp_response {
|
||||
char *body;
|
||||
struct mgcp_response_head head;
|
||||
uint16_t audio_port;
|
||||
};
|
||||
|
||||
void mgcpgw_client_conf_init(struct mgcpgw_client_conf *conf);
|
||||
void mgcpgw_client_vty_init(void *talloc_ctx, int node, struct mgcpgw_client_conf *conf);
|
||||
int mgcpgw_client_config_write(struct vty *vty, const char *indent);
|
||||
struct mgcpgw_client_conf *mgcpgw_client_conf_actual(struct mgcpgw_client *mgcp);
|
||||
|
||||
struct mgcpgw_client *mgcpgw_client_init(void *ctx,
|
||||
struct mgcpgw_client_conf *conf);
|
||||
int mgcpgw_client_connect(struct mgcpgw_client *mgcp);
|
||||
|
||||
const char *mgcpgw_client_remote_addr_str(struct mgcpgw_client *mgcp);
|
||||
uint16_t mgcpgw_client_remote_port(struct mgcpgw_client *mgcp);
|
||||
uint32_t mgcpgw_client_remote_addr_n(struct mgcpgw_client *mgcp);
|
||||
|
||||
int mgcpgw_client_next_endpoint(struct mgcpgw_client *client);
|
||||
void mgcpgw_client_release_endpoint(uint16_t id, struct mgcpgw_client *client);
|
||||
|
||||
/* Invoked when an MGCP response is received or sending failed. When the
|
||||
* response is passed as NULL, this indicates failure during transmission. */
|
||||
typedef void (* mgcp_response_cb_t )(struct mgcp_response *response, void *priv);
|
||||
int mgcp_response_parse_params(struct mgcp_response *r);
|
||||
|
||||
int mgcpgw_client_tx(struct mgcpgw_client *mgcp, struct msgb *msg,
|
||||
mgcp_response_cb_t response_cb, void *priv);
|
||||
|
||||
enum mgcp_connection_mode;
|
||||
|
||||
struct msgb *mgcp_msg_crcx(struct mgcpgw_client *mgcp,
|
||||
uint16_t rtp_endpoint, unsigned int call_id,
|
||||
enum mgcp_connection_mode mode);
|
||||
|
||||
struct msgb *mgcp_msg_mdcx(struct mgcpgw_client *mgcp,
|
||||
uint16_t rtp_endpoint, const char *rtp_conn_addr,
|
||||
uint16_t rtp_port, enum mgcp_connection_mode mode);
|
||||
|
||||
struct msgb *mgcp_msg_dlcx(struct mgcpgw_client *mgcp, uint16_t rtp_endpoint,
|
||||
unsigned int call_id);
|
33
include/osmocom/legacy_mgcp/mgcpgw_client_internal.h
Normal file
33
include/osmocom/legacy_mgcp/mgcpgw_client_internal.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#define MSGB_CB_MGCP_TRANS_ID 0
|
||||
|
||||
struct mgcpgw_client {
|
||||
struct mgcpgw_client_conf actual;
|
||||
uint32_t remote_addr;
|
||||
struct osmo_wqueue wq;
|
||||
mgcp_trans_id_t next_trans_id;
|
||||
struct llist_head responses_pending;
|
||||
struct llist_head inuse_endpoints;
|
||||
};
|
||||
|
||||
struct mgcp_inuse_endpoint {
|
||||
struct llist_head entry;
|
||||
uint16_t id;
|
||||
};
|
||||
|
||||
struct mgcp_response_pending {
|
||||
struct llist_head entry;
|
||||
|
||||
mgcp_trans_id_t trans_id;
|
||||
mgcp_response_cb_t response_cb;
|
||||
void *priv;
|
||||
};
|
||||
|
||||
int mgcpgw_client_rx(struct mgcpgw_client *mgcp, struct msgb *msg);
|
||||
|
||||
struct mgcp_response_pending * mgcpgw_client_pending_add(
|
||||
struct mgcpgw_client *mgcp,
|
||||
mgcp_trans_id_t trans_id,
|
||||
mgcp_response_cb_t response_cb,
|
||||
void *priv);
|
@@ -15,37 +15,17 @@ struct buffer *vty_argv_to_buffer(int argc, const char *argv[], int base);
|
||||
extern struct cmd_element cfg_description_cmd;
|
||||
extern struct cmd_element cfg_no_description_cmd;
|
||||
|
||||
enum bsc_vty_node {
|
||||
GSMNET_NODE = _LAST_OSMOVTY_NODE + 1,
|
||||
BTS_NODE,
|
||||
TRX_NODE,
|
||||
TS_NODE,
|
||||
SUBSCR_NODE,
|
||||
enum mgcp_vty_node {
|
||||
MGCP_NODE,
|
||||
GBPROXY_NODE,
|
||||
SGSN_NODE,
|
||||
OML_NODE,
|
||||
NAT_NODE,
|
||||
NAT_BSC_NODE,
|
||||
MSC_NODE,
|
||||
OM2K_NODE,
|
||||
OM2K_CON_GROUP_NODE,
|
||||
TRUNK_NODE,
|
||||
PGROUP_NODE,
|
||||
MNCC_INT_NODE,
|
||||
NITB_NODE,
|
||||
BSC_NODE,
|
||||
SMPP_NODE,
|
||||
SMPP_ESME_NODE,
|
||||
GTPHUB_NODE,
|
||||
};
|
||||
|
||||
extern int bsc_vty_is_config_node(struct vty *vty, int node);
|
||||
|
||||
struct log_info;
|
||||
int bsc_vty_init(struct gsm_network *network);
|
||||
int bsc_vty_init_extra(void);
|
||||
|
||||
void msc_vty_init(struct gsm_network *msc_network);
|
||||
|
||||
struct gsm_network *gsmnet_from_vty(struct vty *vty);
|
||||
|
||||
#endif
|
10
libosmo-legacy-mgcp.pc.in
Normal file
10
libosmo-legacy-mgcp.pc.in
Normal file
@@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: Osmocom legacy Media Gateway Control Protocol library
|
||||
Description: C Utility Library
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -losmo-legacy-mgcp
|
||||
Cflags: -I${includedir}/
|
103
openbsc/.gitignore
vendored
103
openbsc/.gitignore
vendored
@@ -1,103 +0,0 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
bscconfig.h
|
||||
bscconfig.h.in
|
||||
openbsc.pc
|
||||
src/osmo-nitb/osmo-nitb
|
||||
src/osmo-bsc_mgcp/osmo-bsc_mgcp
|
||||
src/osmo-bsc/osmo-bsc
|
||||
src/utils/meas_vis
|
||||
src/utils/meas_json
|
||||
src/utils/osmo-meas-pcap2db
|
||||
src/utils/osmo-meas-udp2db
|
||||
src/utils/smpp_mirror
|
||||
*.*~
|
||||
*.sw?
|
||||
.libs
|
||||
*.pyc
|
||||
*.gcda
|
||||
*.gcno
|
||||
|
||||
#configure
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
config.log
|
||||
config.status
|
||||
config.guess
|
||||
config.sub
|
||||
configure
|
||||
compile
|
||||
depcomp
|
||||
install-sh
|
||||
missing
|
||||
stamp-h1
|
||||
libtool
|
||||
ltmain.sh
|
||||
|
||||
# git-version-gen magic
|
||||
.tarball-version
|
||||
.version
|
||||
|
||||
|
||||
# apps and app data
|
||||
hlr.sqlite3
|
||||
src/utils/bs11_config
|
||||
src/ipaccess/ipaccess-config
|
||||
src/ipaccess/abisip-find
|
||||
src/ipaccess/ipaccess-firmware
|
||||
src/ipaccess/ipaccess-proxy
|
||||
src/utils/isdnsync
|
||||
src/nat/bsc_nat
|
||||
src/gprs/osmo-sgsn
|
||||
src/gprs/osmo-gbproxy
|
||||
src/gprs/osmo-gtphub
|
||||
src/osmo-bsc_nat/osmo-bsc_nat
|
||||
src/libcommon/gsup_test_client
|
||||
|
||||
#tests
|
||||
tests/testsuite.dir
|
||||
tests/bsc-nat/bsc_nat_test
|
||||
tests/bsc-nat-trie/bsc_nat_trie_test
|
||||
tests/channel/channel_test
|
||||
tests/db/db_test
|
||||
tests/debug/debug_test
|
||||
tests/gsm0408/gsm0408_test
|
||||
tests/mgcp/mgcp_test
|
||||
tests/sccp/sccp_test
|
||||
tests/sms/sms_test
|
||||
tests/timer/timer_test
|
||||
tests/gprs/gprs_test
|
||||
tests/gbproxy/gbproxy_test
|
||||
tests/abis/abis_test
|
||||
tests/si/si_test
|
||||
tests/smpp/smpp_test
|
||||
tests/bsc/bsc_test
|
||||
tests/trau/trau_test
|
||||
tests/mgcp/mgcp_transcoding_test
|
||||
tests/sgsn/sgsn_test
|
||||
tests/subscr/subscr_test
|
||||
tests/subscr/bsc_subscr_test
|
||||
tests/oap/oap_test
|
||||
tests/gtphub/gtphub_test
|
||||
tests/mm_auth/mm_auth_test
|
||||
tests/xid/xid_test
|
||||
tests/sndcp_xid/sndcp_xid_test
|
||||
tests/slhc/slhc_test
|
||||
tests/v42bis/v42bis_test
|
||||
tests/nanobts_omlattr/nanobts_omlattr_test
|
||||
tests/oap/oap_client_test
|
||||
|
||||
tests/atconfig
|
||||
tests/atlocal
|
||||
tests/package.m4
|
||||
tests/testsuite
|
||||
tests/testsuite.log
|
||||
|
||||
gsn_restart
|
||||
src/openbsc.cfg*
|
||||
writtenconfig/
|
||||
gtphub_restart_count
|
@@ -1,170 +0,0 @@
|
||||
-- Split trace based on SCCP Source
|
||||
-- There are still bugs to find... bugs bugs bugs... hmm
|
||||
do
|
||||
local function init_listener()
|
||||
print("CREATED LISTENER")
|
||||
local tap = Listener.new("ip", "sccp && (ip.src == 172.16.1.81 || ip.dst == 172.16.1.81)")
|
||||
local sccp_type_field = Field.new("sccp.message_type")
|
||||
local sccp_src_field = Field.new("sccp.slr")
|
||||
local sccp_dst_field = Field.new("sccp.dlr")
|
||||
local msg_type_field = Field.new("gsm_a.dtap_msg_mm_type")
|
||||
local lu_rej_field = Field.new("gsm_a.dtap.rej_cause")
|
||||
local ip_src_field = Field.new("ip.src")
|
||||
local ip_dst_field = Field.new("ip.dst")
|
||||
|
||||
--
|
||||
local bssmap_msgtype_field = Field.new("gsm_a.bssmap_msgtype")
|
||||
-- assignment failure 0x03
|
||||
--
|
||||
|
||||
--
|
||||
local dtap_cause_field = Field.new("gsm_a_dtap.cause")
|
||||
local dtap_cc_field = Field.new("gsm_a.dtap_msg_cc_type")
|
||||
|
||||
local connections = {}
|
||||
|
||||
function check_failure(con)
|
||||
check_lu_reject(con)
|
||||
check_disconnect(con)
|
||||
check_failures(con)
|
||||
end
|
||||
|
||||
-- cipher mode reject
|
||||
function check_failures(con)
|
||||
local msgtype = bssmap_msgtype_field()
|
||||
if not msgtype then
|
||||
return
|
||||
end
|
||||
|
||||
msgtype = tonumber(msgtype)
|
||||
if msgtype == 89 then
|
||||
print("Cipher mode reject")
|
||||
con[4] = true
|
||||
elseif msgtype == 0x03 then
|
||||
print("Assignment failure")
|
||||
con[4] = true
|
||||
elseif msgtype == 0x22 then
|
||||
print("Clear Request... RF failure?")
|
||||
con[4] = true
|
||||
end
|
||||
end
|
||||
|
||||
-- check if a DISCONNECT is normal
|
||||
function check_disconnect(con)
|
||||
local msg_type = dtap_cc_field()
|
||||
if not msg_type then
|
||||
return
|
||||
end
|
||||
|
||||
if tonumber(msg_type) ~= 0x25 then
|
||||
return
|
||||
end
|
||||
|
||||
local cause = dtap_cause_field()
|
||||
if not cause then
|
||||
return
|
||||
end
|
||||
|
||||
cause = tonumber(cause)
|
||||
if cause ~= 0x10 then
|
||||
print("DISCONNECT != Normal")
|
||||
con[4] = true
|
||||
end
|
||||
end
|
||||
|
||||
-- check if we have a LU Reject
|
||||
function check_lu_reject(con)
|
||||
local msg_type = msg_type_field()
|
||||
if not msg_type then
|
||||
return
|
||||
end
|
||||
|
||||
msg_type = tonumber(tostring(msg_type))
|
||||
if msg_type == 0x04 then
|
||||
print("LU REJECT with " .. tostring(lu_rej_field()))
|
||||
con[4] = true
|
||||
end
|
||||
end
|
||||
|
||||
function tap.packet(pinfo,tvb,ip)
|
||||
local ip_src = tostring(ip_src_field())
|
||||
local ip_dst = tostring(ip_dst_field())
|
||||
local sccp_type = tonumber(tostring(sccp_type_field()))
|
||||
local sccp_src = sccp_src_field()
|
||||
local sccp_dst = sccp_dst_field()
|
||||
|
||||
local con
|
||||
|
||||
if sccp_type == 0x01 then
|
||||
elseif sccp_type == 0x2 then
|
||||
local src = string.format("%s-%s", ip_src, tostring(sccp_src))
|
||||
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
|
||||
local datestring = os.date("%Y%m%d%H%M%S")
|
||||
local pcap_name = string.format("alink_trace_%s-%s_%s.pcap", src, dst, datestring)
|
||||
local dumper = Dumper.new_for_current(pcap_name)
|
||||
|
||||
local con = { ip_src, tostring(sccp_src), tostring(sccp_dst), false, dumper, pcap_name }
|
||||
|
||||
dumper:dump_current()
|
||||
connections[src] = con
|
||||
connections[dst] = con
|
||||
elseif sccp_type == 0x4 then
|
||||
-- close a connection... remove it from the list
|
||||
local src = string.format("%s-%s", ip_src, tostring(sccp_src))
|
||||
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
|
||||
|
||||
local con = connections[src]
|
||||
if not con then
|
||||
return
|
||||
end
|
||||
|
||||
con[5]:dump_current()
|
||||
con[5]:flush()
|
||||
|
||||
-- this causes a crash on unpacted wireshark
|
||||
con[5]:close()
|
||||
|
||||
-- the connection had a failure
|
||||
if con[4] == true then
|
||||
local datestring = os.date("%Y%m%d%H%M%S")
|
||||
local new_name = string.format("alink_failure_%s_%s-%s.pcap", datestring, con[2], con[3])
|
||||
os.rename(con[6], new_name)
|
||||
else
|
||||
os.remove(con[6])
|
||||
end
|
||||
|
||||
|
||||
-- clear the old connection
|
||||
connections[src] = nil
|
||||
connections[dst] = nil
|
||||
|
||||
elseif sccp_type == 0x5 then
|
||||
-- not handled yet... we should verify stuff here...
|
||||
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
|
||||
local con = connections[dst]
|
||||
if not con then
|
||||
return
|
||||
end
|
||||
con[5]:dump_current()
|
||||
elseif sccp_type == 0x6 then
|
||||
local dst = string.format("%s-%s", ip_dst, tostring(sccp_dst))
|
||||
local con = connections[dst]
|
||||
if not con then
|
||||
print("DON'T KNOW THIS CONNECTION for " .. ip_dst)
|
||||
return
|
||||
end
|
||||
con[5]:dump_current()
|
||||
check_failure(con)
|
||||
end
|
||||
|
||||
end
|
||||
function tap.draw()
|
||||
print("DRAW")
|
||||
end
|
||||
function tap.reset()
|
||||
print("RESET")
|
||||
end
|
||||
end
|
||||
|
||||
init_listener()
|
||||
end
|
@@ -1 +0,0 @@
|
||||
Some crazy scripts call testing... and MSC link failure simulation
|
@@ -1,8 +0,0 @@
|
||||
ABORT BUSY
|
||||
ABORT 'NO CARRIER'
|
||||
ABORT 'OK'
|
||||
|
||||
'' AT
|
||||
SAY "Dialing a number\n"
|
||||
'OK' ATD05660066;
|
||||
|
@@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Evil dial script..
|
||||
|
||||
while true;
|
||||
do
|
||||
chat -v -f all_dial < /dev/ttyACM0 > /dev/ttyACM0
|
||||
sleep 5s
|
||||
chat -v -f hangup < /dev/ttyACM0 > /dev/ttyACM0
|
||||
sleep 2s
|
||||
done
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
sleep 3
|
||||
echo "enable"
|
||||
sleep 1
|
||||
echo "drop bts connection 0 oml"
|
||||
sleep 1
|
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
while true;
|
||||
do
|
||||
echo "Going to drop the OML connection"
|
||||
./drop-oml.sh | telnet 127.0.0.1 4242
|
||||
sleep 58m
|
||||
done
|
@@ -1,4 +0,0 @@
|
||||
TIMEOUT 10
|
||||
'' ^Z
|
||||
SAY "Waiting for hangup confirm\n"
|
||||
'' ATH;
|
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
while true;
|
||||
do
|
||||
echo "Kill the osmo-bsc"
|
||||
/usr/bin/kill -s SIGUSR2 `pidof osmo-bsc`
|
||||
sleep 58s
|
||||
done
|
@@ -1,120 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
|
||||
"""
|
||||
/*
|
||||
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
"""
|
||||
|
||||
from optparse import OptionParser
|
||||
from ipa import Ctrl
|
||||
import socket
|
||||
|
||||
verbose = False
|
||||
|
||||
def connect(host, port):
|
||||
if verbose:
|
||||
print "Connecting to host %s:%i" % (host, port)
|
||||
|
||||
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
sck.setblocking(1)
|
||||
sck.connect((host, port))
|
||||
return sck
|
||||
|
||||
def do_set_get(sck, var, value = None):
|
||||
(r, c) = Ctrl().cmd(var, value)
|
||||
sck.send(c)
|
||||
answer = Ctrl().rem_header(sck.recv(4096))
|
||||
return (answer,) + Ctrl().verify(answer, r, var, value)
|
||||
|
||||
def set_var(sck, var, val):
|
||||
(a, _, _) = do_set_get(sck, var, val)
|
||||
return a
|
||||
|
||||
def get_var(sck, var):
|
||||
(_, _, v) = do_set_get(sck, var)
|
||||
return v
|
||||
|
||||
def _leftovers(sck, fl):
|
||||
"""
|
||||
Read outstanding data if any according to flags
|
||||
"""
|
||||
try:
|
||||
data = sck.recv(1024, fl)
|
||||
except socket.error as (s_errno, strerror):
|
||||
return False
|
||||
if len(data) != 0:
|
||||
tail = data
|
||||
while True:
|
||||
(head, tail) = Ctrl().split_combined(tail)
|
||||
print "Got message:", Ctrl().rem_header(head)
|
||||
if len(tail) == 0:
|
||||
break
|
||||
return True
|
||||
return False
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser("Usage: %prog [options] var [value]")
|
||||
parser.add_option("-d", "--host", dest="host",
|
||||
help="connect to HOST", metavar="HOST")
|
||||
parser.add_option("-p", "--port", dest="port", type="int",
|
||||
help="use PORT", metavar="PORT", default=4249)
|
||||
parser.add_option("-g", "--get", action="store_true",
|
||||
dest="cmd_get", help="perform GET operation")
|
||||
parser.add_option("-s", "--set", action="store_true",
|
||||
dest="cmd_set", help="perform SET operation")
|
||||
parser.add_option("-v", "--verbose", action="store_true",
|
||||
dest="verbose", help="be verbose", default=False)
|
||||
parser.add_option("-m", "--monitor", action="store_true",
|
||||
dest="monitor", help="monitor the connection for traps", default=False)
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
verbose = options.verbose
|
||||
|
||||
if options.cmd_set and options.cmd_get:
|
||||
parser.error("Get and set options are mutually exclusive!")
|
||||
|
||||
if not (options.cmd_get or options.cmd_set or options.monitor):
|
||||
parser.error("One of -m, -g, or -s must be set")
|
||||
|
||||
if not (options.host):
|
||||
parser.error("Destination host and port required!")
|
||||
|
||||
sock = connect(options.host, options.port)
|
||||
|
||||
if options.cmd_set:
|
||||
if len(args) < 2:
|
||||
parser.error("Set requires var and value arguments")
|
||||
_leftovers(sock, socket.MSG_DONTWAIT)
|
||||
print "Got message:", set_var(sock, args[0], ' '.join(args[1:]))
|
||||
|
||||
if options.cmd_get:
|
||||
if len(args) != 1:
|
||||
parser.error("Get requires the var argument")
|
||||
_leftovers(sock, socket.MSG_DONTWAIT)
|
||||
(a, _, _) = do_set_get(sock, args[0])
|
||||
print "Got message:", a
|
||||
|
||||
if options.monitor:
|
||||
while True:
|
||||
if not _leftovers(sock, 0):
|
||||
print "Connection is gone."
|
||||
break
|
||||
sock.close()
|
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
f = open("unbalanced")
|
||||
lines = []
|
||||
for line in f:
|
||||
lines.append(line)
|
||||
|
||||
filenames = {}
|
||||
|
||||
output = []
|
||||
for line in lines:
|
||||
if "[0x" in line:
|
||||
start = line.find("[")
|
||||
end = line.find("]")
|
||||
addr = line[start+1:end]
|
||||
try:
|
||||
file = filenames[addr]
|
||||
except KeyError:
|
||||
r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr)
|
||||
all = r.read().replace("\n", ",")
|
||||
file = all
|
||||
filenames[addr] = file
|
||||
|
||||
line = line.replace(addr, file)
|
||||
output.append(line)
|
||||
|
||||
g = open("unbalanced.2", "w")
|
||||
g.write("".join(output))
|
||||
|
||||
|
||||
|
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
#
|
||||
# Convert ETSI documents to an enum
|
||||
#
|
||||
|
||||
import re, sys
|
||||
|
||||
def convert(string):
|
||||
string = string.strip().replace(" ", "").rjust(8, "0")
|
||||
var = 0
|
||||
offset = 7
|
||||
for char in string:
|
||||
assert offset >= 0
|
||||
var = var | (int(char) << offset)
|
||||
offset = offset - 1
|
||||
|
||||
return var
|
||||
|
||||
def string(name):
|
||||
name = name.replace(" ", "_")
|
||||
name = name.replace('"', "")
|
||||
name = name.replace('/', '_')
|
||||
name = name.replace('(', '_')
|
||||
name = name.replace(')', '_')
|
||||
return "%s_%s" % (sys.argv[2], name.upper())
|
||||
|
||||
file = open(sys.argv[1])
|
||||
|
||||
|
||||
for line in file:
|
||||
m = re.match(r"[ \t]*(?P<value>[01 ]+)[ ]+(?P<name>[a-zA-Z /0-9()]+)", line[:-1])
|
||||
|
||||
if m:
|
||||
print "\t%s\t\t= %d," % (string(m.groupdict()["name"]), convert(m.groupdict()["value"]))
|
||||
else:
|
||||
print line[:-1]
|
@@ -1,147 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
mod_license = '''
|
||||
/*
|
||||
* Copyright (C) 2016 sysmocom s.f.m.c. GmbH
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
'''
|
||||
|
||||
import sys, argparse, random, logging, tornado.ioloop, tornado.web, tornado.tcpclient, tornado.httpclient, eventsource, bsc_control
|
||||
from eventsource import listener, request
|
||||
|
||||
'''
|
||||
N. B: this is not an example of building proper REST API or building secure web application.
|
||||
It's only purpose is to illustrate conversion of Osmocom's Control Interface to web-friendly API.
|
||||
Exposing this to Internet while connected to production network might lead to all sorts of mischief and mayhem
|
||||
from NSA' TAO breaking into your network to zombie apocalypse. Do NOT do that.
|
||||
'''
|
||||
|
||||
token = None
|
||||
stream = None
|
||||
url = None
|
||||
|
||||
'''
|
||||
Returns json according to following schema - see http://json-schema.org/documentation.html for details:
|
||||
{
|
||||
"title": "Ctrl Schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"variable": {
|
||||
"type": "string"
|
||||
},
|
||||
"varlue": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": ["interface", "variable", "value"]
|
||||
}
|
||||
Example validation from command-line:
|
||||
json validate --schema-file=schema.json --document-file=data.json
|
||||
The interface is represented as string because it might look different for IPv4 vs v6.
|
||||
'''
|
||||
|
||||
def read_header(data):
|
||||
t_length = bsc_control.ipa_ctrl_header(data)
|
||||
if (t_length):
|
||||
stream.read_bytes(t_length - 1, callback = read_trap)
|
||||
else:
|
||||
print >> sys.stderr, "protocol error: length missing in %s!" % data
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def read_trap(data):
|
||||
(t, z, v, p) = data.split()
|
||||
if (t != 'TRAP' or int(z) != 0):
|
||||
print >> sys.stderr, "protocol error: TRAP != %s or 0! = %d" % (t, int(z))
|
||||
else:
|
||||
yield tornado.httpclient.AsyncHTTPClient().fetch(tornado.httpclient.HTTPRequest(url = "%s/%s/%s" % (url, "ping", token),
|
||||
method = 'POST',
|
||||
headers = {'Content-Type': 'application/json'},
|
||||
body = tornado.escape.json_encode({ 'variable' : v, 'value' : p })))
|
||||
stream.read_bytes(4, callback = read_header)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def trap_setup(host, port, target_host, target_port, tk):
|
||||
global stream
|
||||
global url
|
||||
global token
|
||||
token = tk
|
||||
url = "http://%s:%s/sse" % (host, port)
|
||||
stream = yield tornado.tcpclient.TCPClient().connect(target_host, target_port)
|
||||
stream.read_bytes(4, callback = read_header)
|
||||
|
||||
def get_v(s, v):
|
||||
return { 'variable' : v, 'value' : bsc_control.get_var(s, tornado.escape.native_str(v)) }
|
||||
|
||||
class CtrlHandler(tornado.web.RequestHandler):
|
||||
def initialize(self):
|
||||
self.skt = bsc_control.connect(self.settings['ctrl_host'], self.settings['ctrl_port'])
|
||||
|
||||
def get(self, v):
|
||||
self.write(get_v(self.skt, v))
|
||||
|
||||
def post(self):
|
||||
self.write(get_v(self.skt, self.get_argument("variable")))
|
||||
|
||||
class SetCtrl(CtrlHandler):
|
||||
def get(self, var, val):
|
||||
bsc_control.set_var(self.skt, tornado.escape.native_str(var), tornado.escape.native_str(val))
|
||||
super(SetCtrl, self).get(tornado.escape.native_str(var))
|
||||
|
||||
def post(self):
|
||||
bsc_control.set_var(self.skt, tornado.escape.native_str(self.get_argument("variable")), tornado.escape.native_str(self.get_argument("value")))
|
||||
super(SetCtrl, self).post()
|
||||
|
||||
class Slash(tornado.web.RequestHandler):
|
||||
def get(self):
|
||||
self.write('<html><head><title>%s</title></head><body>Using Tornado framework v%s'
|
||||
'<form action="/get" method="POST">'
|
||||
'<input type="text" name="variable">'
|
||||
'<input type="submit" value="GET">'
|
||||
'</form>'
|
||||
'<form action="/set" method="POST">'
|
||||
'<input type="text" name="variable">'
|
||||
'<input type="text" name="value">'
|
||||
'<input type="submit" value="SET">'
|
||||
'</form>'
|
||||
'</body></html>' % ("Osmocom Control Interface Proxy", tornado.version))
|
||||
|
||||
if __name__ == '__main__':
|
||||
p = argparse.ArgumentParser(description='Osmocom Control Interface proxy.')
|
||||
p.add_argument('-c', '--control-port', type = int, default = 4252, help = "Target Control Interface port")
|
||||
p.add_argument('-a', '--control-host', default = 'localhost', help = "Target Control Interface adress")
|
||||
p.add_argument('-b', '--host', default = 'localhost', help = "Adress to bind proxy's web interface")
|
||||
p.add_argument('-p', '--port', type = int, default = 6969, help = "Port to bind proxy's web interface")
|
||||
p.add_argument('-d', '--debug', action='store_true', help = "Activate debugging (default off)")
|
||||
p.add_argument('-t', '--token', default = 'osmocom', help = "Token to be used by SSE client in URL e. g. http://127.0.0.1:8888/poll/osmocom where 'osmocom' is default token value")
|
||||
p.add_argument('-k', '--keepalive', type = int, default = 5000, help = "Timeout betwwen keepalive messages, in milliseconds, defaults to 5000")
|
||||
args = p.parse_args()
|
||||
random.seed()
|
||||
tornado.netutil.Resolver.configure('tornado.netutil.ThreadedResolver') # Use non-blocking resolver
|
||||
logging.basicConfig()
|
||||
application = tornado.web.Application([
|
||||
(r"/", Slash),
|
||||
(r"/get", CtrlHandler),
|
||||
(r"/get/(.*)", CtrlHandler),
|
||||
(r"/set", SetCtrl),
|
||||
(r"/set/(.*)/(.*)", SetCtrl),
|
||||
(r"/sse/(.*)/(.*)", listener.EventSourceHandler, dict(event_class = listener.JSONIdEvent, keepalive = args.keepalive)),
|
||||
], debug = args.debug, ctrl_host = args.control_host, ctrl_port = args.control_port)
|
||||
application.listen(address = args.host, port = args.port)
|
||||
trap_setup(args.host, args.port, application.settings['ctrl_host'], application.settings['ctrl_port'], args.token)
|
||||
tornado.ioloop.IOLoop.instance().start()
|
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
demonstrate a unblock bug on the GB Proxy..
|
||||
"""
|
||||
|
||||
bts_ns_reset = "\x02\x00\x81\x01\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
|
||||
ns_reset_ack = "\x03\x01\x82\x1f\xe7\x04\x82\x1f\xe7"
|
||||
|
||||
bts_ns_unblock = "\x06"
|
||||
ns_unblock_ack = "\x07"
|
||||
|
||||
bts_bvc_reset_0 = "\x00\x00\x00\x00\x22\x04\x82\x00\x00\x07\x81\x03\x3b\x81\x02"
|
||||
ns_bvc_reset_0_ack = "\x00\x00\x00\x00\x23\x04\x82\x00\x00"
|
||||
|
||||
bts_bvc_reset_8167 = "\x00\x00\x00\x00\x22\x04\x82\x1f\xe7\x07\x81\x08\x08\x88\x72\xf4\x80\x10\x1c\x00\x9c\x40"
|
||||
|
||||
|
||||
import socket
|
||||
socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
socket.bind(("0.0.0.0", 0))
|
||||
socket.setblocking(1)
|
||||
|
||||
|
||||
import sys
|
||||
port = int(sys.argv[1])
|
||||
print "Sending data to port: %d" % port
|
||||
|
||||
def send_and_receive(packet):
|
||||
socket.sendto(packet, ("127.0.0.1", port))
|
||||
|
||||
try:
|
||||
data, addr = socket.recvfrom(4096)
|
||||
except socket.error, e:
|
||||
print "ERROR", e
|
||||
import sys
|
||||
sys.exit(0)
|
||||
return data
|
||||
|
||||
#send stuff once
|
||||
|
||||
to_send = [
|
||||
(bts_ns_reset, ns_reset_ack, "reset ack"),
|
||||
(bts_ns_unblock, ns_unblock_ack, "unblock ack"),
|
||||
(bts_bvc_reset_0, ns_bvc_reset_0_ack, "BVCI=0 reset ack"),
|
||||
]
|
||||
|
||||
|
||||
for (out, inp, type) in to_send:
|
||||
res = send_and_receive(out)
|
||||
if res != inp:
|
||||
print "Failed to get the %s" % type
|
||||
sys.exit(-1)
|
||||
|
||||
import time
|
||||
time.sleep(3)
|
||||
res = send_and_receive(bts_bvc_reset_8167)
|
||||
print "Sent all messages... check wireshark for the last response"
|
@@ -1,78 +0,0 @@
|
||||
-- Simple LUA script to print the size of BSSGP messages over their type...
|
||||
|
||||
do
|
||||
local ip_bucket = {}
|
||||
|
||||
local pdu_types = {}
|
||||
pdu_types[ 6] = "PAGING"
|
||||
pdu_types[11] = "SUSPEND"
|
||||
pdu_types[12] = "SUSPEND-ACK"
|
||||
pdu_types[32] = "BVC-BLOCK"
|
||||
pdu_types[33] = "BVC-BLOCK-ACK"
|
||||
pdu_types[34] = "BVC-RESET"
|
||||
pdu_types[35] = "BVC-RESET-ACK"
|
||||
pdu_types[36] = "UNBLOCK"
|
||||
pdu_types[37] = "UNBLOCK-ACK"
|
||||
pdu_types[38] = "FLOW-CONTROL-BVC"
|
||||
pdu_types[39] = "FLOW-CONTROL-BVC-ACK"
|
||||
pdu_types[40] = "FLOW-CONTROL-MS"
|
||||
pdu_types[41] = "FLOW-CONTROL-MS-ACK"
|
||||
pdu_types[44] = "LLC-DISCARDED"
|
||||
|
||||
local function init_listener()
|
||||
-- handle the port as NS over IP
|
||||
local udp_port_table = DissectorTable.get("udp.port")
|
||||
local gprs_ns_dis = Dissector.get("gprs_ns")
|
||||
udp_port_table:add(23000,gprs_ns_dis)
|
||||
|
||||
-- bssgp filters
|
||||
local bssgp_pdu_get = Field.new("bssgp.pdu_type")
|
||||
local udp_length_get = Field.new("udp.length")
|
||||
|
||||
local tap = Listener.new("ip", "udp.port == 23000")
|
||||
function tap.packet(pinfo,tvb,ip)
|
||||
local pdu = bssgp_pdu_get()
|
||||
local len = udp_length_get()
|
||||
|
||||
-- only handle bssgp, but we also want the IP frame
|
||||
if not pdu then
|
||||
return
|
||||
end
|
||||
|
||||
pdu = tostring(pdu)
|
||||
if tonumber(pdu) == 0 or tonumber(pdu) == 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local ip_src = tostring(ip.ip_src)
|
||||
local bssgp_histo = ip_bucket[ip_src]
|
||||
if not bssgp_histo then
|
||||
bssgp_histo = {}
|
||||
ip_bucket[ip_src] = bssgp_histo
|
||||
end
|
||||
|
||||
local key = pdu
|
||||
local bucket = bssgp_histo[key]
|
||||
if not bucket then
|
||||
bucket = {}
|
||||
bssgp_histo[key] = bucket
|
||||
end
|
||||
|
||||
table.insert(bucket, tostring(len))
|
||||
print("IP: " .. ip_src .. " PDU: " .. pdu_types[tonumber(pdu)] .. " Length: " .. tostring(len))
|
||||
end
|
||||
|
||||
function tap.draw()
|
||||
-- well... this will not be called...
|
||||
-- for ip,bssgp_histo in pairs(dumpers) do
|
||||
-- print("IP " .. ip)
|
||||
-- end
|
||||
end
|
||||
|
||||
function tap.reset()
|
||||
-- well... this will not be called...
|
||||
end
|
||||
end
|
||||
|
||||
init_listener()
|
||||
end
|
@@ -1,80 +0,0 @@
|
||||
-- I count the buffer space needed for LLC PDUs in the worse case and print it
|
||||
|
||||
do
|
||||
local function init_listener()
|
||||
-- handle the port as NS over IP
|
||||
local udp_port_table = DissectorTable.get("udp.port")
|
||||
local gprs_ns_dis = Dissector.get("gprs_ns")
|
||||
udp_port_table:add(23000,gprs_ns_dis)
|
||||
|
||||
-- bssgp filters
|
||||
local bssgp_pdu_get = Field.new("bssgp.pdu_type")
|
||||
local bssgp_delay_get = Field.new("bssgp.delay_val")
|
||||
local llcgprs_get = Field.new("llcgprs")
|
||||
local pdus = nil
|
||||
|
||||
print("START...")
|
||||
|
||||
local tap = Listener.new("ip", "udp.port == 23000 && bssgp.pdu_type == 0")
|
||||
function tap.packet(pinfo,tvb,ip)
|
||||
local pdu = bssgp_pdu_get()
|
||||
local len = llcgprs_get().len
|
||||
local delay = bssgp_delay_get()
|
||||
|
||||
-- only handle bssgp, but we also want the IP frame
|
||||
if not pdu then
|
||||
return
|
||||
end
|
||||
|
||||
if tonumber(tostring(delay)) == 65535 then
|
||||
pdus = { next = pdus,
|
||||
len = len,
|
||||
expires = -1 }
|
||||
else
|
||||
local off = tonumber(tostring(delay)) / 100.0
|
||||
pdus = { next = pdus,
|
||||
len = len,
|
||||
expires = pinfo.rel_ts + off }
|
||||
end
|
||||
local now_time = tonumber(tostring(pinfo.rel_ts))
|
||||
local now_size = 0
|
||||
local l = pdus
|
||||
local prev = nil
|
||||
local count = 0
|
||||
while l do
|
||||
if now_time < l.expires or l.expires == -1 then
|
||||
now_size = now_size + l.len
|
||||
prev = l
|
||||
l = l.next
|
||||
count = count + 1
|
||||
else
|
||||
-- delete things
|
||||
if prev == nil then
|
||||
pdus = nil
|
||||
l = nil
|
||||
else
|
||||
prev.next = l.next
|
||||
l = l.next
|
||||
end
|
||||
end
|
||||
end
|
||||
-- print("TOTAL: " .. now_time .. " PDU_SIZE: " .. now_size)
|
||||
print(now_time .. " " .. now_size / 1024.0 .. " " .. count)
|
||||
-- print("NOW: " .. tostring(pinfo.rel_ts) .. " Delay: " .. tostring(delay) .. " Length: " .. tostring(len))
|
||||
end
|
||||
|
||||
function tap.draw()
|
||||
-- well... this will not be called...
|
||||
-- for ip,bssgp_histo in pairs(dumpers) do
|
||||
-- print("IP " .. ip)
|
||||
-- end
|
||||
print("END")
|
||||
end
|
||||
|
||||
function tap.reset()
|
||||
-- well... this will not be called...
|
||||
end
|
||||
end
|
||||
|
||||
init_listener()
|
||||
end
|
@@ -1,46 +0,0 @@
|
||||
-- Create a file named by_ip/''ip_addess''.cap with all ip traffic of each ip host. (works for tshark only)
|
||||
-- Dump files are created for both source and destination hosts
|
||||
do
|
||||
local dir = "by_tlli"
|
||||
local dumpers = {}
|
||||
local function init_listener()
|
||||
local udp_port_table = DissectorTable.get("udp.port")
|
||||
local gprs_ns_dis = Dissector.get("gprs_ns")
|
||||
udp_port_table:add(23000,gprs_ns_dis)
|
||||
|
||||
local field_tlli = Field.new("bssgp.tlli")
|
||||
local tap = Listener.new("ip", "udp.port == 23000")
|
||||
|
||||
-- we will be called once for every IP Header.
|
||||
-- If there's more than one IP header in a given packet we'll dump the packet once per every header
|
||||
function tap.packet(pinfo,tvb,ip)
|
||||
local tlli = field_tlli()
|
||||
if not tlli then
|
||||
return
|
||||
end
|
||||
|
||||
local tlli_str = tostring(tlli)
|
||||
tlli_dmp = dumpers[tlli_str]
|
||||
if not tlli_dmp then
|
||||
local tlli_hex = string.format("0x%x", tonumber(tlli_str))
|
||||
print("Creating dump for TLLI " .. tlli_hex)
|
||||
tlli_dmp = Dumper.new_for_current(dir .. "/" .. tlli_hex .. ".pcap")
|
||||
dumpers[tlli_str] = tlli_dmp
|
||||
end
|
||||
tlli_dmp:dump_current()
|
||||
tlli_dmp:flush()
|
||||
end
|
||||
function tap.draw()
|
||||
for tlli,dumper in pairs(dumpers) do
|
||||
dumper:flush()
|
||||
end
|
||||
end
|
||||
function tap.reset()
|
||||
for tlli,dumper in pairs(dumpers) do
|
||||
dumper:close()
|
||||
end
|
||||
dumpers = {}
|
||||
end
|
||||
end
|
||||
init_listener()
|
||||
end
|
@@ -1,59 +0,0 @@
|
||||
-- This script verifies that the N(U) is increasing...
|
||||
--
|
||||
do
|
||||
local nu_state_src = {}
|
||||
|
||||
local function init_listener()
|
||||
-- handle the port as NS over IP
|
||||
local udp_port_table = DissectorTable.get("udp.port")
|
||||
local gprs_ns_dis = Dissector.get("gprs_ns")
|
||||
udp_port_table:add(23000,gprs_ns_dis)
|
||||
|
||||
-- we want to look here...
|
||||
local llc_sapi_get = Field.new("llcgprs.sapib")
|
||||
local llc_nu_get = Field.new("llcgprs.nu")
|
||||
local bssgp_tlli_get = Field.new("bssgp.tlli")
|
||||
|
||||
local tap = Listener.new("ip", "udp.port == 23000")
|
||||
function tap.packet(pinfo,tvb,ip)
|
||||
local llc_sapi = llc_sapi_get()
|
||||
local llc_nu = llc_nu_get()
|
||||
local bssgp_tlli = bssgp_tlli_get()
|
||||
|
||||
if not llc_sapi or not llc_nu or not bssgp_tlli then
|
||||
return
|
||||
end
|
||||
|
||||
local ip_src = tostring(ip.ip_src)
|
||||
local bssgp_tlli = tostring(bssgp_tlli)
|
||||
local llc_nu = tostring(llc_nu)
|
||||
local llc_sapi = tostring(llc_sapi)
|
||||
|
||||
local src_key = ip_src .. "-" .. bssgp_tlli .. "-" .. llc_sapi
|
||||
local last_nu = nu_state_src[src_key]
|
||||
if not last_nu then
|
||||
-- print("Establishing mapping for " .. src_key)
|
||||
nu_state_src[src_key] = llc_nu
|
||||
return
|
||||
end
|
||||
|
||||
local function tohex(number)
|
||||
return string.format("0x%x", tonumber(number))
|
||||
end
|
||||
|
||||
nu_state_src[src_key] = llc_nu
|
||||
if tonumber(last_nu) + 1 ~= tonumber(llc_nu) then
|
||||
print("JUMP in N(U) on TLLI " .. tohex(bssgp_tlli) .. " and SAPI: " .. llc_sapi .. " src: " .. ip_src)
|
||||
print("\t last: " .. last_nu .. " now: " .. llc_nu)
|
||||
end
|
||||
end
|
||||
|
||||
function tap.draw()
|
||||
end
|
||||
|
||||
function tap.reset()
|
||||
end
|
||||
end
|
||||
init_listener()
|
||||
end
|
||||
|
@@ -1,18 +0,0 @@
|
||||
-- Remove old data from the database
|
||||
DELETE FROM Subscriber
|
||||
WHERE id != 1 AND datetime('now', '-10 days') > updated AND authorized != 1;
|
||||
DELETE FROM Equipment
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM EquipmentWatch
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM SMS
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM VLR
|
||||
WHERE datetime('now', '-10 days') > updated;
|
||||
DELETE FROM ApduBlobs
|
||||
WHERE datetime('now', '-10 days') > created;
|
||||
DELETE FROM Counters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
DELETE FROM RateCounters
|
||||
WHERE datetime('now', '-10 days') > timestamp;
|
||||
VACUUM;
|
@@ -1,125 +0,0 @@
|
||||
#!/usr/bin/python2.5
|
||||
|
||||
from __future__ import with_statement
|
||||
|
||||
from pysqlite2 import dbapi2 as sqlite3
|
||||
import sys
|
||||
|
||||
hlr = sqlite3.connect(sys.argv[1])
|
||||
web = sqlite3.connect(sys.argv[2])
|
||||
|
||||
# switch to autocommit
|
||||
hlr.isolation_level = None
|
||||
web.isolation_level = None
|
||||
|
||||
hlr.row_factory = sqlite3.Row
|
||||
web.row_factory = sqlite3.Row
|
||||
|
||||
with hlr:
|
||||
hlr_subscrs = hlr.execute("""
|
||||
SELECT * FROM Subscriber
|
||||
""").fetchall()
|
||||
hlr_tokens = hlr.execute("""
|
||||
SELECT * FROM AuthToken
|
||||
""").fetchall()
|
||||
|
||||
with web:
|
||||
web_tokens = web.execute("""
|
||||
SELECT * FROM reg_tokens
|
||||
""").fetchall()
|
||||
web_sms = web.execute("""
|
||||
SELECT * FROM sms_queue
|
||||
""").fetchall()
|
||||
|
||||
# index by subscr id
|
||||
hlr_subscrs_by_id = {}
|
||||
hlr_subscrs_by_ext = {}
|
||||
hlr_tokens_by_subscr_id = {}
|
||||
for x in hlr_subscrs:
|
||||
hlr_subscrs_by_id[x['id']] = x
|
||||
hlr_subscrs_by_ext[x['extension']] = x
|
||||
del hlr_subscrs
|
||||
for x in hlr_tokens:
|
||||
hlr_tokens_by_subscr_id[x['subscriber_id']] = x
|
||||
del hlr_tokens
|
||||
|
||||
web_tokens_by_subscr_id = {}
|
||||
for x in web_tokens:
|
||||
web_tokens_by_subscr_id[x['subscriber_id']] = x
|
||||
del web_tokens
|
||||
|
||||
# remove leftover web_tokens and correct inconsistent fields
|
||||
with web:
|
||||
for x in web_tokens_by_subscr_id.values():
|
||||
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
|
||||
if subscr is None:
|
||||
web.execute("""
|
||||
DELETE FROM reg_tokens WHERE subscriber_id = ?
|
||||
""", (x['subscriber_id'],))
|
||||
del web_tokens_by_subscr_id[x['subscriber_id']]
|
||||
continue
|
||||
if str(x['imsi']) != str(subscr['imsi']) or \
|
||||
x['extension'] != subscr['extension'] or \
|
||||
x['tmsi'] != subscr['tmsi'] or \
|
||||
x['lac'] != subscr['lac']:
|
||||
web.execute("""
|
||||
UPDATE reg_tokens
|
||||
SET imsi = ?, extension = ?, tmsi = ?, lac = ?
|
||||
WHERE subscriber_id = ?
|
||||
""", (str(subscr['imsi']), subscr['extension'],
|
||||
subscr['tmsi'], subscr['lac'], x['subscriber_id']))
|
||||
|
||||
# add missing web_tokens
|
||||
with web:
|
||||
for x in hlr_tokens_by_subscr_id.values():
|
||||
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
|
||||
if subscr is None:
|
||||
hlr.execute("""
|
||||
DELETE FROM AuthToken WHERE subscriber_id = ?
|
||||
""", (x['subscriber_id'],))
|
||||
del hlr_tokens_by_subscr_id[x['subscriber_id']]
|
||||
continue
|
||||
webtoken = web_tokens_by_subscr_id.get(x['subscriber_id'], None)
|
||||
if webtoken is None:
|
||||
web.execute("""
|
||||
INSERT INTO reg_tokens
|
||||
(subscriber_id, extension, reg_completed, name, email, lac, imsi, token, tmsi)
|
||||
VALUES
|
||||
(?, ?, 0, ?, '', ?, ?, ?, ?)
|
||||
""", (x['subscriber_id'], subscr['extension'], subscr['name'],
|
||||
subscr['lac'], str(subscr['imsi']), x['token'], subscr['tmsi']))
|
||||
|
||||
# authorize subscribers
|
||||
with hlr:
|
||||
for x in web_tokens_by_subscr_id.values():
|
||||
subscr = hlr_subscrs_by_id.get(x['subscriber_id'], None)
|
||||
if x['reg_completed'] and not subscr['authorized']:
|
||||
hlr.execute("""
|
||||
UPDATE Subscriber
|
||||
SET authorized = 1
|
||||
WHERE id = ?
|
||||
""", (x['subscriber_id'],))
|
||||
|
||||
# Sync SMS from web to hlr
|
||||
with hlr:
|
||||
for sms in web_sms:
|
||||
subscr = hlr_subscrs_by_ext.get(sms['receiver_ext'])
|
||||
if subscr is None:
|
||||
print '%s not found' % sms['receiver_ext']
|
||||
continue
|
||||
hlr.execute("""
|
||||
INSERT INTO SMS
|
||||
(created, sender_id, receiver_id, reply_path_req, status_rep_req, protocol_id, data_coding_scheme, ud_hdr_ind, text)
|
||||
VALUES
|
||||
(?, 1, ?, 0, 0, 0, 0, 0, ?)
|
||||
""", (sms['created'], subscr['id'], sms['text']))
|
||||
with web:
|
||||
for sms in web_sms:
|
||||
web.execute("""
|
||||
DELETE FROM sms_queue WHERE id = ?
|
||||
""", (sms['id'],))
|
||||
|
||||
|
||||
hlr.close()
|
||||
web.close()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user