aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/FUNDING.yml1
-rw-r--r--.gitignore6
-rw-r--r--Makefile.am3
-rw-r--r--README17
-rw-r--r--README.md100
-rw-r--r--README.vty-tests2
-rw-r--r--TODO-RELEASE4
-rw-r--r--configure.ac62
-rwxr-xr-xcontrib/gprs/gb-proxy-unblock-bug.py58
-rwxr-xr-xcontrib/jenkins.sh12
-rw-r--r--contrib/osmo-sgsn.spec.in47
-rw-r--r--contrib/systemd/Makefile.am2
-rw-r--r--contrib/systemd/osmo-gbproxy.service12
-rw-r--r--contrib/systemd/osmo-gtphub.service4
-rw-r--r--contrib/systemd/osmo-sgsn.service4
-rw-r--r--debian/changelog361
-rw-r--r--debian/compat2
-rw-r--r--debian/control43
-rw-r--r--debian/copyright20
-rwxr-xr-xdebian/osmo-gbproxy.init151
-rw-r--r--debian/osmo-gbproxy.install5
-rwxr-xr-xdebian/rules1
-rw-r--r--doc/examples/Makefile.am2
-rw-r--r--doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg44
-rw-r--r--doc/examples/osmo-gbproxy/osmo-gbproxy.cfg26
-rw-r--r--doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg8
-rw-r--r--doc/examples/osmo-gtphub/osmo-gtphub.cfg10
-rw-r--r--doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg14
-rw-r--r--doc/examples/osmo-sgsn/osmo-sgsn.cfg14
-rw-r--r--doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg16
-rw-r--r--doc/manuals/Makefile.am14
-rw-r--r--doc/manuals/chapters/configuration.adoc62
-rw-r--r--doc/manuals/chapters/gbproxy-configuration.adoc6
-rw-r--r--doc/manuals/chapters/gbproxy-control.adoc29
-rw-r--r--doc/manuals/chapters/gbproxy-overview.adoc127
-rw-r--r--doc/manuals/chapters/gbproxy-running.adoc39
-rw-r--r--doc/manuals/osmogbproxy-usermanual-docinfo.xml46
-rw-r--r--doc/manuals/osmogbproxy-usermanual.adoc34
-rw-r--r--doc/manuals/osmogbproxy-vty-reference.xml38
-rwxr-xr-xdoc/manuals/regen_doc.sh82
-rw-r--r--doc/manuals/vty-osmogbproxy/gbproxy_vty_additions.xml5
-rw-r--r--doc/manuals/vty-osmogbproxy/gbproxy_vty_reference.xml1627
-rw-r--r--doc/manuals/vty/sgsn_vty_reference.xml2536
-rw-r--r--include/osmocom/Makefile.am1
-rw-r--r--include/osmocom/gtphub/Makefile.am3
-rw-r--r--include/osmocom/gtphub/gtphub.h (renamed from include/osmocom/sgsn/gtphub.h)6
-rw-r--r--include/osmocom/sgsn/Makefile.am15
-rw-r--r--include/osmocom/sgsn/apn.h20
-rw-r--r--include/osmocom/sgsn/auth.h39
-rw-r--r--include/osmocom/sgsn/crc24.h2
-rw-r--r--include/osmocom/sgsn/debug.h17
-rw-r--r--include/osmocom/sgsn/gb_proxy.h334
-rw-r--r--include/osmocom/sgsn/gprs_bssgp.h12
-rw-r--r--include/osmocom/sgsn/gprs_gb.h14
-rw-r--r--include/osmocom/sgsn/gprs_gmm.h13
-rw-r--r--include/osmocom/sgsn/gprs_gmm_fsm.h4
-rw-r--r--include/osmocom/sgsn/gprs_llc.h19
-rw-r--r--include/osmocom/sgsn/gprs_mm_state_gb_fsm.h5
-rw-r--r--include/osmocom/sgsn/gprs_mm_state_iu_fsm.h7
-rw-r--r--include/osmocom/sgsn/gprs_ns.h9
-rw-r--r--include/osmocom/sgsn/gprs_ranap.h4
-rw-r--r--include/osmocom/sgsn/gprs_sm.h5
-rw-r--r--include/osmocom/sgsn/gprs_sndcp.h24
-rw-r--r--include/osmocom/sgsn/gprs_subscriber.h79
-rw-r--r--include/osmocom/sgsn/gprs_utils.h4
-rw-r--r--include/osmocom/sgsn/gtp.h30
-rw-r--r--include/osmocom/sgsn/gtp_ggsn.h41
-rw-r--r--include/osmocom/sgsn/gtp_mme.h41
-rw-r--r--include/osmocom/sgsn/mmctx.h (renamed from include/osmocom/sgsn/gprs_sgsn.h)255
-rw-r--r--include/osmocom/sgsn/pdpctx.h94
-rw-r--r--include/osmocom/sgsn/sgsn.h65
-rw-r--r--include/osmocom/sgsn/sgsn_rim.h6
-rw-r--r--include/osmocom/sgsn/v42bis.h4
-rw-r--r--include/osmocom/sgsn/v42bis_private.h4
-rw-r--r--include/osmocom/sgsn/vty.h4
-rw-r--r--m4/ax_check_compile_flag.m474
-rw-r--r--osmoappdesc.py7
-rw-r--r--src/Makefile.am1
-rw-r--r--src/gbproxy/Makefile.am46
-rw-r--r--src/gbproxy/gb_proxy.c1454
-rw-r--r--src/gbproxy/gb_proxy_ctrl.c98
-rw-r--r--src/gbproxy/gb_proxy_main.c398
-rw-r--r--src/gbproxy/gb_proxy_patch.c463
-rw-r--r--src/gbproxy/gb_proxy_peer.c240
-rw-r--r--src/gbproxy/gb_proxy_tlli.c725
-rw-r--r--src/gbproxy/gb_proxy_vty.c927
-rw-r--r--src/gprs/Makefile.am1
-rw-r--r--src/gprs/crc24.c2
-rw-r--r--src/gprs/gprs_llc_parse.c4
-rw-r--r--src/gprs/gprs_utils.c65
-rw-r--r--src/gprs/sgsn_ares.c10
-rw-r--r--src/gtphub/gtphub.c64
-rw-r--r--src/gtphub/gtphub_ares.c7
-rw-r--r--src/gtphub/gtphub_main.c60
-rw-r--r--src/gtphub/gtphub_sock.c7
-rw-r--r--src/gtphub/gtphub_vty.c2
-rw-r--r--src/sgsn/Makefile.am11
-rw-r--r--src/sgsn/apn.c123
-rw-r--r--src/sgsn/gprs_bssgp.c95
-rw-r--r--src/sgsn/gprs_gb.c105
-rw-r--r--src/sgsn/gprs_gmm.c273
-rw-r--r--src/sgsn/gprs_gmm_attach.c21
-rw-r--r--src/sgsn/gprs_gmm_fsm.c19
-rw-r--r--src/sgsn/gprs_llc.c91
-rw-r--r--src/sgsn/gprs_llc_vty.c17
-rw-r--r--src/sgsn/gprs_mm_state_gb_fsm.c34
-rw-r--r--src/sgsn/gprs_mm_state_iu_fsm.c72
-rw-r--r--src/sgsn/gprs_ns.c103
-rw-r--r--src/sgsn/gprs_ranap.c24
-rw-r--r--src/sgsn/gprs_sm.c34
-rw-r--r--src/sgsn/gprs_sndcp.c235
-rw-r--r--src/sgsn/gprs_subscriber.c13
-rw-r--r--src/sgsn/gtp_ggsn.c178
-rw-r--r--src/sgsn/gtp_mme.c143
-rw-r--r--src/sgsn/mmctx.c (renamed from src/sgsn/gprs_sgsn.c)505
-rw-r--r--src/sgsn/pdpctx.c158
-rw-r--r--src/sgsn/sgsn.c215
-rw-r--r--src/sgsn/sgsn_auth.c2
-rw-r--r--src/sgsn/sgsn_cdr.c14
-rw-r--r--src/sgsn/sgsn_ctrl.c9
-rw-r--r--src/sgsn/sgsn_libgtp.c236
-rw-r--r--src/sgsn/sgsn_main.c274
-rw-r--r--src/sgsn/sgsn_rim.c127
-rw-r--r--src/sgsn/sgsn_vty.c462
-rw-r--r--src/sgsn/v42bis.c4
-rw-r--r--tests/Makefile.am21
-rw-r--r--tests/gbproxy/Makefile.am51
-rw-r--r--tests/gbproxy/gbproxy_test.c5082
-rw-r--r--tests/gbproxy/gbproxy_test.ok7492
-rw-r--r--tests/gprs/Makefile.am3
-rw-r--r--tests/gprs/gprs_test.c18
-rw-r--r--tests/gtphub/Makefile.am5
-rw-r--r--tests/gtphub/gtphub_test.c15
-rw-r--r--tests/osmo-sgsn_test-nodes.vty133
-rw-r--r--tests/sgsn/Makefile.am26
-rw-r--r--tests/sgsn/gprs_gb_parse.c (renamed from src/gprs/gprs_gb_parse.c)45
-rw-r--r--tests/sgsn/gprs_gb_parse.h (renamed from include/osmocom/sgsn/gprs_gb_parse.h)2
-rw-r--r--tests/sgsn/sgsn_test.c98
-rw-r--r--tests/slhc/Makefile.am3
-rw-r--r--tests/sndcp_xid/Makefile.am3
-rw-r--r--tests/test_nodes.vty63
-rw-r--r--tests/testsuite.at6
-rw-r--r--tests/v42bis/Makefile.am3
-rwxr-xr-xtests/vty_test_runner.py59
-rw-r--r--tests/xid/Makefile.am4
145 files changed, 3956 insertions, 24304 deletions
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 000000000..7592debf9
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+open_collective: osmocom
diff --git a/.gitignore b/.gitignore
index 546d5dfbb..010f151ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,14 +6,15 @@ debian/*.log
.deps
Makefile
Makefile.in
-bscconfig.h
-bscconfig.h.in
+config.h
+config.h.in
*.*~
*.sw?
.libs
*.pyc
*.gcda
*.gcno
+*~
#configure
aclocal.m4
@@ -40,7 +41,6 @@ ltmain.sh
# apps and app data
src/sgsn/osmo-sgsn
-src/gbproxy/osmo-gbproxy
src/gtphub/osmo-gtphub
src/libcommon/gsup_test_client
diff --git a/Makefile.am b/Makefile.am
index 17b3fc635..b70eb4b5d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,16 +9,17 @@ AM_CPPFLAGS = \
$(NULL)
SUBDIRS = \
- doc \
include \
src \
contrib \
tests \
+ doc \
$(NULL)
BUILT_SOURCES = $(top_srcdir)/.version
EXTRA_DIST = \
.version \
+ README.md \
contrib/osmo-sgsn.spec.in \
debian \
git-version-gen \
diff --git a/README b/README
deleted file mode 100644
index a14ba3803..000000000
--- a/README
+++ /dev/null
@@ -1,17 +0,0 @@
-About OsmoSGSN
-==============
-
-OsmoSGSN originated from the OpenBSC project, as a separate program within
-openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence
-OsmoSGSN was given its own separate git repository.
-
-OsmoSGSN exposes
-- GSUP towards OsmoHLR (or a MAP proxy);
-- GTP towards a GGSN (e.g. OsmoGGSN);
-- Gb towards a BSS (e.g. OsmoPCU);
-- IuPS towards an RNC or HNB-GW (e.g. OsmoHNBGW) for 3G data;
-- The Osmocom typical telnet VTY and CTRL interfaces.
-
-Find OsmoSGSN issue tracker and wiki online at
-https://osmocom.org/projects/osmosgsn
-https://osmocom.org/projects/osmosgsn/wiki
diff --git a/README.md b/README.md
new file mode 100644
index 000000000..3143d048a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,100 @@
+osmo-sgsn - Osmocom SGSN Implementation
+=======================================
+
+This repository contains a C-language implementation of a *Serving GPRS
+Support Node (SGSN)* for 2.5/2.75G (GPRS/EDGE) and 3G (UMTS). It is part of the
+[Osmocom](https://osmocom.org/) Open Source Mobile Communications
+project.
+
+OsmoSGSN exposes
+
+ * *Gb* towards PCUs (e.g. [OsmoPCU](https://osmocom.org/projects/osmopcu/wiki/OsmoPCU)): Various GbIP flavors + Gb/FR/E1
+ * *GTP* towards a GGSN (e.g. [OsmoGGSN](https://osmocom.org/projects/openggsn/wiki))
+ * IuPS over IP towards RNCs / HNBGW (e.g. [osmo-hnbgw](https://osmocom.org/projects/osmohnbgw/wiki))
+ * The Osmocom typical telnet *VTY* and *CTRL* interfaces.
+ * The Osmocom typical *statsd* exporter.
+ * GSUP (custom MAP-like protocol) towards [osmo-hlr](https://osmocom.org/projects/osmo-hlr/wiki/OsmoHLR)
+
+OsmoSGSN implements
+
+ * GPRS mobility management
+ * GPRS session management
+
+
+Homepage
+--------
+
+You can find the OsmoSGSN homepage online at <https://osmocom.org/projects/osmosgsn/wiki>.
+
+
+GIT Repository
+--------------
+
+You can clone from the official osmo-sgsn.git repository using
+
+ git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-sgsn
+
+There is a web interface at <https://gitea.osmocom.org/cellular-infrastructure/osmo-sgsn>
+
+
+Documentation
+-------------
+
+User Manuals and VTY reference manuals are [optionally] built in PDF form
+as part of the build process.
+
+Pre-rendered PDF version of the current "master" can be found at
+[User Manual](https://ftp.osmocom.org/docs/latest/osmosgsn-usermanual.pdf)
+as well as the [VTY Reference Manual](https://ftp.osmocom.org/docs/latest/osmosgsn-vty-reference.pdf)
+
+
+Forum
+-----
+
+We welcome any osmo-sgsn related discussions in the
+[Cellular Network Infratructure -> 2G/3G Core Network](https://discourse.osmocom.org/c/cni/2g-3g-cn).
+section of the osmocom discourse (web based Forum).
+
+
+Mailing List
+------------
+
+Discussions related to osmo-sgsn are happening on the
+osmocom-net-gprs@lists.osmocom.org mailing list, please see
+<https://lists.osmocom.org/postorius/lists/osmocom-net-gprs.lists.osmocom.org/> for subscription
+options and the list archive.
+
+Please observe the [Osmocom Mailing List
+Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
+when posting.
+
+
+Issue Tracker
+-------------
+
+We use the [issue tracker of the osmo-sgsn project on osmocom.org](https://osmocom.org/projects/osmosgsn/issues) for
+tracking the state of bug reports and feature requests. Feel free to submit any issues you may find, or help
+us out by resolving existing issues.
+
+
+Contributing
+------------
+
+Our coding standards are described at
+<https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards>
+
+We us a gerrit based patch submission/review process for managing
+contributions. Please see
+<https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit> for
+more details
+
+The current patch queue for osmo-sgsn can be seen at
+<https://gerrit.osmocom.org/#/q/project:osmo-sgsn+status:open>
+
+
+History
+-------
+
+OsmoSGSN originated from the OpenBSC project, as a separate program within
+openbsc.git. In 2017, OpenBSC was split in separate repositories, and hence
+OsmoSGSN was given its own separate git repository.
diff --git a/README.vty-tests b/README.vty-tests
index 0669ea8e8..dc34916ee 100644
--- a/README.vty-tests
+++ b/README.vty-tests
@@ -1,6 +1,6 @@
To run the configuration parsing and output (VTY) test suite, first install
- git://git.osmocom.org/python/osmo-python-tests
+ https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests
and pass the following configure options here:
diff --git a/TODO-RELEASE b/TODO-RELEASE
index e5e3b39c6..df983c1c4 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -1,4 +1,2 @@
#component what description / commit summary line
-manual needs common chapter cs7-config.adoc from osmo-gsm-manuals > 0.3.0
-libosmocore osmo_mobile_identity Depends on libosmocore > 1.3.0
-osmo-bsc Mobile Identity Coding OsmoBSC is stricter in rejecting invalid coding of Mobile Identity IEs
+libosmocore > 1.9.0 gsup.h: Using new fields in struct osmo_gsup_pdp_info (ABI break) \ No newline at end of file
diff --git a/configure.ac b/configure.ac
index 9432715d6..ddd91ab2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
-dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang
+dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang
AS_CASE(["$LD"],[*clang*],
[AS_CASE(["${host_os}"],
[*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
@@ -34,42 +34,32 @@ if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
fi
PKG_PROG_PKG_CONFIG([0.20])
-dnl check for AX_CHECK_COMPILE_FLAG
-m4_ifdef([AX_CHECK_COMPILE_FLAG], [], [
- AC_MSG_ERROR([Please install autoconf-archive; re-run 'autoreconf -fi' for it to take effect.])
- ])
+dnl use a defined standard across all builds and don't depend on compiler default
+CFLAGS="$CFLAGS -std=gnu11"
dnl checks for libraries
-AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
-AC_SUBST(LIBRARY_DL)
-
-AC_SEARCH_LIBS([dlsym], [dl dld], [LIBRARY_DLSYM="$LIBS";LIBS=""])
-AC_SUBST(LIBRARY_DLSYM)
-
-
-PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.2.0)
-PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.2.0)
-PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.2.0)
-PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.2.0)
-PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 1.2.0)
-PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.6.0)
-PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.4.0)
-PKG_CHECK_MODULES(LIBOSMOGSUPCLIENT, libosmo-gsup-client >= 1.0.0)
+PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0)
+PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.9.0)
+PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0)
+PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 1.9.0)
+PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.5.0)
+PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.4.0)
+PKG_CHECK_MODULES(LIBOSMOGSUPCLIENT, libosmo-gsup-client >= 1.7.0)
+PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.11.0)
# 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(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.0.0)
+ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.8.0)
PKG_CHECK_MODULES(LIBASN1C, libasn1c >= 0.9.30)
- PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 0.6.0)
+ PKG_CHECK_MODULES(LIBOSMORANAP, libosmo-ranap >= 1.5.0)
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)
-
-PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.5.0)
PKG_CHECK_MODULES(LIBCARES, libcares)
dnl checks for header files
@@ -118,15 +108,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
-CPPFLAGS="$CPPFLAGS -Wall"
-CFLAGS="$CFLAGS -Wall"
-
-AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
-AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"])
-AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"])
-AX_CHECK_COMPILE_FLAG([-Wnull-dereference], [CFLAGS="$CFLAGS -Wnull-dereference"])
-AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"])
-AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"])
+CPPFLAGS="$CPPFLAGS -Wall -Wno-trigraphs"
+CFLAGS="$CFLAGS -Wall -Wno-trigraphs"
# Coverage build taken from WebKit's configure.in
AC_MSG_CHECKING([whether to enable code coverage support])
@@ -172,13 +155,13 @@ AC_ARG_ENABLE([external_tests],
[Include the VTY/CTRL tests in make check [default=no]]),
[enable_ext_tests="$enableval"],[enable_ext_tests="no"])
if test "x$enable_ext_tests" = "xyes" ; then
- AC_CHECK_PROG(PYTHON2_AVAIL,python2,yes)
- if test "x$PYTHON2_AVAIL" != "xyes" ; then
- AC_MSG_ERROR([Please install python2 to run the VTY/CTRL tests.])
+ AC_CHECK_PROG(PYTHON3_AVAIL,python3,yes)
+ if test "x$PYTHON3_AVAIL" != "xyes" ; then
+ AC_MSG_ERROR([Please install python3 to run the VTY/CTRL tests.])
fi
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
- AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
+ AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
@@ -247,21 +230,20 @@ AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
dnl Generate the output
-AM_CONFIG_HEADER(bscconfig.h)
+AM_CONFIG_HEADER(config.h)
AC_OUTPUT(
include/Makefile
include/osmocom/Makefile
+ include/osmocom/gtphub/Makefile
include/osmocom/sgsn/Makefile
src/Makefile
src/gprs/Makefile
src/sgsn/Makefile
- src/gbproxy/Makefile
src/gtphub/Makefile
tests/Makefile
tests/atlocal
tests/gprs/Makefile
- tests/gbproxy/Makefile
tests/sgsn/Makefile
tests/gtphub/Makefile
tests/xid/Makefile
diff --git a/contrib/gprs/gb-proxy-unblock-bug.py b/contrib/gprs/gb-proxy-unblock-bug.py
deleted file mode 100755
index 0cd4b871f..000000000
--- a/contrib/gprs/gb-proxy-unblock-bug.py
+++ /dev/null
@@ -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"
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 51583f8f4..321beef1b 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -37,20 +37,16 @@ osmo-build-dep.sh libosmo-netif
osmo-build-dep.sh osmo-ggsn
osmo-build-dep.sh osmo-hlr
-enable_werror=""
if [ "x$IU" = "x--enable-iu" ]; then
osmo-build-dep.sh libosmo-sccp
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
-else
- enable_werror="--enable-werror"
fi
# Additional configure options and depends
CONFIG=""
if [ "$WITH_MANUALS" = "1" ]; then
- osmo-build-dep.sh osmo-gsm-manuals
CONFIG="--enable-manuals"
fi
@@ -64,18 +60,18 @@ set -x
cd "$base"
autoreconf --install --force
-./configure --enable-sanitize $enable_werror $IU --enable-external-tests $CONFIG
+./configure --enable-sanitize --enable-werror $IU --enable-external-tests $CONFIG
$MAKE $PARALLEL_MAKE
LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|| cat-testlogs.sh
LD_LIBRARY_PATH="$inst/lib" \
- DISTCHECK_CONFIGURE_FLAGS="$enable_werror $IU --enable-external-tests $CONFIG" \
- $MAKE distcheck \
+ DISTCHECK_CONFIGURE_FLAGS="--enable-werror $IU --enable-external-tests $CONFIG" \
+ $MAKE $PARALLEL_MAKE distcheck \
|| cat-testlogs.sh
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
make -C "$base/doc/manuals" publish
fi
-$MAKE maintainer-clean
+$MAKE $PARALLEL_MAKE maintainer-clean
osmo-clean-workspace.sh
diff --git a/contrib/osmo-sgsn.spec.in b/contrib/osmo-sgsn.spec.in
index d6a807899..7ba994f73 100644
--- a/contrib/osmo-sgsn.spec.in
+++ b/contrib/osmo-sgsn.spec.in
@@ -34,20 +34,20 @@ BuildRequires: systemd-rpm-macros
%endif
BuildRequires: pkgconfig(libcares)
BuildRequires: pkgconfig(libcrypto) >= 0.9.5
-BuildRequires: pkgconfig(libgtp) >= 1.4.0
-BuildRequires: pkgconfig(libosmo-gsup-client) >= 1.0.0
-BuildRequires: pkgconfig(libosmo-netif) >= 0.4.0
-BuildRequires: pkgconfig(libosmoabis) >= 0.6.0
-BuildRequires: pkgconfig(libosmocore) >= 1.2.0
-BuildRequires: pkgconfig(libosmoctrl) >= 1.2.0
-BuildRequires: pkgconfig(libosmogb) >= 1.2.0
-BuildRequires: pkgconfig(libosmogsm) >= 1.2.0
-BuildRequires: pkgconfig(libosmovty) >= 1.2.0
+BuildRequires: pkgconfig(libgtp) >= 1.11.0
+BuildRequires: pkgconfig(libosmo-gsup-client) >= 1.7.0
+BuildRequires: pkgconfig(libosmo-netif) >= 1.4.0
+BuildRequires: pkgconfig(libosmoabis) >= 1.5.0
+BuildRequires: pkgconfig(libosmocore) >= 1.9.0
+BuildRequires: pkgconfig(libosmoctrl) >= 1.9.0
+BuildRequires: pkgconfig(libosmogb) >= 1.9.0
+BuildRequires: pkgconfig(libosmogsm) >= 1.9.0
+BuildRequires: pkgconfig(libosmovty) >= 1.9.0
%{?systemd_requires}
%if %{with_iu}
BuildRequires: pkgconfig(libasn1c)
-BuildRequires: pkgconfig(libosmo-ranap) >= 0.4.0
-BuildRequires: pkgconfig(libosmo-sigtran) >= 1.0.0
+BuildRequires: pkgconfig(libosmo-ranap) >= 1.5.0
+BuildRequires: pkgconfig(libosmo-sigtran) >= 1.8.0
%endif
%description
@@ -61,14 +61,6 @@ Group: Productivity/Telephony/Servers
%description -n osmo-gtphub
Osmocom GTP Hub: Proxy for GTP traffic between multiple SGSNs and GGSNs.
-%package -n osmo-gbproxy
-Summary: Osmocom GPRS Gb Interface Proxy
-Group: Productivity/Telephony/Servers
-
-%description -n osmo-gbproxy
-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.
-
%prep
%setup -q
@@ -95,21 +87,16 @@ make %{?_smp_mflags}
%postun -n osmo-gtphub %service_del_postun osmo-gtphub.service
%pre -n osmo-gtphub %service_add_pre osmo-gtphub.service
%post -n osmo-gtphub %service_add_post osmo-gtphub.service
-%preun -n osmo-gbproxy %service_del_preun osmo-gbproxy.service
-%postun -n osmo-gbproxy %service_del_postun osmo-gbproxy.service
-%pre -n osmo-gbproxy %service_add_pre osmo-gbproxy.service
-%post -n osmo-gbproxy %service_add_post osmo-gbproxy.service
%endif
%check
make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
%files
-%doc AUTHORS README
+%doc AUTHORS README.md
%dir %{_docdir}/%{name}/examples
%dir %{_docdir}/%{name}/examples/osmo-sgsn
%exclude %{_docdir}/%{name}/examples/osmo-gtphub
-%exclude %{_docdir}/%{name}/examples/osmo-gbproxy
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn.cfg
%{_docdir}/%{name}/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
@@ -128,14 +115,4 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
%config(noreplace) %{_sysconfdir}/osmocom/osmo-gtphub.cfg
%{_unitdir}/osmo-gtphub.service
-%files -n osmo-gbproxy
-%dir %{_docdir}/%{name}/examples
-%dir %{_docdir}/%{name}/examples/osmo-gbproxy
-%{_docdir}/%{name}/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
-%{_docdir}/%{name}/examples/osmo-gbproxy/osmo-gbproxy.cfg
-%{_bindir}/osmo-gbproxy
-%dir %{_sysconfdir}/osmocom
-%config(noreplace) %{_sysconfdir}/osmocom/osmo-gbproxy.cfg
-%{_unitdir}/osmo-gbproxy.service
-
%changelog
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
index 11e8f9815..ae4694c2a 100644
--- a/contrib/systemd/Makefile.am
+++ b/contrib/systemd/Makefile.am
@@ -1,11 +1,9 @@
EXTRA_DIST = \
- osmo-gbproxy.service \
osmo-gtphub.service \
osmo-sgsn.service
if HAVE_SYSTEMD
SYSTEMD_SERVICES = \
- osmo-gbproxy.service \
osmo-gtphub.service \
osmo-sgsn.service
diff --git a/contrib/systemd/osmo-gbproxy.service b/contrib/systemd/osmo-gbproxy.service
deleted file mode 100644
index a0b7829db..000000000
--- a/contrib/systemd/osmo-gbproxy.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Osmocom Gb proxy
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/osmo-gbproxy -c /etc/osmocom/osmo-gbproxy.cfg
-Restart=always
-RestartSec=2
-RestartPreventExitStatus=1
-
-[Install]
-WantedBy=multi-user.target
diff --git a/contrib/systemd/osmo-gtphub.service b/contrib/systemd/osmo-gtphub.service
index 488178584..9ade246d4 100644
--- a/contrib/systemd/osmo-gtphub.service
+++ b/contrib/systemd/osmo-gtphub.service
@@ -1,9 +1,13 @@
[Unit]
Description=Osmocom GTP Hub
+After=network-online.target
+Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/osmo-gtphub -c /etc/osmocom/osmo-gtphub.cfg
+StateDirectory=osmocom
+WorkingDirectory=%S/osmocom
Restart=always
RestartSec=2
RestartPreventExitStatus=1
diff --git a/contrib/systemd/osmo-sgsn.service b/contrib/systemd/osmo-sgsn.service
index 0991c70c6..21ecbb752 100644
--- a/contrib/systemd/osmo-sgsn.service
+++ b/contrib/systemd/osmo-sgsn.service
@@ -3,9 +3,13 @@ Description=Osmocom SGSN (Serving GPRS Support Node)
Wants=osmo-hlr.service
After=osmo-hlr.service
After=osmo-hnbgw.service
+After=network-online.target
+Wants=network-online.target
[Service]
Type=simple
+StateDirectory=osmocom
+WorkingDirectory=%S/osmocom
Restart=always
ExecStart=/usr/bin/osmo-sgsn -c /etc/osmocom/osmo-sgsn.cfg
RestartSec=2
diff --git a/debian/changelog b/debian/changelog
index 2827f43b0..cb629fbdc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,364 @@
+osmo-sgsn (1.11.1) unstable; urgency=medium
+
+ [ Philipp Maier ]
+ * sgsn_rim: forward message based on RIM ROUTING ADDRESS
+
+ [ Daniel Willmann ]
+ * sgsn_vty: Fix output in config_write_sgsn
+ * sgsn_vty: Correctly indent encryption cipher-plugin-path
+ * vty-tests: Test encryption options
+ * libgtp: Check for all successful create_pdp_conf causes
+
+ -- Oliver Smith <osmith@sysmocom.de> Tue, 28 Nov 2023 13:32:46 +0100
+
+osmo-sgsn (1.11.0) unstable; urgency=medium
+
+ [ Oliver Smith ]
+ * Run struct_endianness.py
+ * debian: set compat level to 10
+ * systemd: depend on networking-online.target
+
+ [ arehbein ]
+ * Transition to use of 'telnet_init_default'
+
+ [ Vadim Yanitskiy ]
+ * tests: use -no-install libtool flag to avoid ./lt-* scripts
+ * tests: $(BUILT_SOURCES) is not defined, depend on osmo-sgsn
+ * copyright: fix typo: sysmocom s/s.m.f.c./s.f.m.c./ GmbH
+
+ [ Pau Espin Pedrol ]
+ * gmm: Ciphering Key Sequence Number IE has half octet tag
+ * gprs_sm.c: Fix load of misaligned ptr address
+ * Write explicit role & sctp-role fields in ASP configurations
+ * gmm: Update DRX params during rx RAU REQ
+ * gmm: Add missing GSM48_IE_GMM_RX_NPDU_NUM_LIST IE in gsm48_gmm_att_tlvdef
+
+ [ Philipp Maier ]
+ * sgsn_rim: fix typo
+ * sgsn_rim: cosmetic: improve comment
+ * sgsn_rim: get rid of MME check in sgsn_rim_rx_from_gtp:
+ * sgsn_rim: do not check the origin of a RIM message
+
+ -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 12 Sep 2023 16:57:02 +0200
+
+osmo-sgsn (1.10.0) unstable; urgency=medium
+
+ [ Vadim Yanitskiy ]
+ * configure.ac: do not require unused dlsym/dlopen
+ * gprs_llc: fix misleading spacing in gprs_llc_rcvmsg()
+ * gprs_llc.h: use '#pragma once'
+ * llc: gprs_llc_fcs(): make the input data pointer const
+
+ [ Max ]
+ * Set working directory in systemd service file
+ * SNDCP: log more details on failure
+ * GTP: migrate from deprecated function
+ * Constify LLC/SNDCP parameters
+ * GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state
+ * ctrl: take both address and port from vty config
+
+ [ Pau Espin Pedrol ]
+ * vty: Make new libgtp tdefs configurable through VTY
+ * sndcp: Put decompress handling code into helper function
+ * Move gprs_gb_parse.[c,h] to tests/sgsn/
+ * Create new specific file for BSSGP code
+ * Move some functions gprs_gb.[c,h] -> gprs_gmm.[c,h]
+ * Rename gprs_gb.[c,h] -> gprs_ns.[c,h]
+ * Move gprs_tmr_to_secs() to tests/gprs/gprs_test.c
+ * cosmetic: gprs_llc_vty.c: Fix trailing whitespace
+ * vty: Fix wrong value_string used to print llme state
+ * Standarize lle and llme state enum & value_string
+ * Remove unused function gprs_parse_mi_tmsi()
+ * Replace gprs_str_to_apn() with libosmocore API osmo_apn_from_str()
+ * Move struct sgsn_ggsn_ctx to its own file gtp_ggsn.{c,h}
+ * gprs_subscriber: Move API declarations to correct header
+ * Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h
+ * Introduce new header file sgsn/gtp.h
+ * Fix -Werror=old-style-definition
+ * Move related structs to gprs_subscriber.h
+ * Remove unneeded extern declaration from libosmocotrl
+ * Keep sgsn subsystems under struct sgsn_instance lifecycle
+ * Move global ggsn_list into struct sgsn_instance
+ * Move struct apn_ctx and APN related definitions to its own file
+ * Move struct sgsn_subscriber_pdp_data to gprs_subscriber.h
+ * sgsn.h: Drop declaration of non existing function
+ * Properly split llc->sndcp->gtp unitdata pathi through extra func call
+ * Move func defintions of funcs implemented in gprs_sndcp.c to gprs_sndcp.h
+ * sndcp: Standarize unitdata function naming
+ * Move gtp related functions to gtp.h
+ * Move global apn_list inside struct sgsn_instance
+ * gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance
+ * Move extern declarations of tall_sgsn_ctx to sgsn.h
+ * Drop extern declarations of global sgsn_instance in source files
+ * Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
+ * Move global pdp_list inside struct sgsn_instance
+ * Move gtphub header to include/osmocom/gtphub/
+ * Move sgsn_ctrl_cmds_install() declaration to sgsn.h
+ * Move LOGGSUBSCRP to gprs_subscriber.h
+ * Rename bscconfig.h -> config.h
+ * gtphub.h: Remove dependency on sgsn/gprs_sgsn.h
+ * Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}
+ * Move global mmctx list into struct sgsn_instance
+ * vty: Introduce encryption cipher-plugin-path command
+ * Fix extra whitespace in pdpctx_ctr_description
+
+ [ Oliver Smith ]
+ * contrib/jenkins.sh: use enable-werror with IU too
+ * sgsn_libgtp: cb_data_ind: remove mm_idle assert
+ * osmo-gtphub.cfg: fix conflict with osmo-ggsn.cfg
+
+ -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 07 Feb 2023 17:34:26 +0100
+
+osmo-sgsn (1.9.0) unstable; urgency=medium
+
+ [ Oliver Smith ]
+ * llme_free: clean up related sndcp
+ * treewide: remove FSF address
+
+ [ Pau Espin Pedrol ]
+ * Drop unneeded ax_check_compile_flag.m4
+ * Revert "sgsn: Handle different levels of QoS"
+
+ [ Neels Hofmeyr ]
+ * s/cipher_support_mask/gea_encryption_mask
+ * Iu: add UEA encryption
+
+ [ Vadim Yanitskiy ]
+ * tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
+
+ [ Harald Welte ]
+ * update git URLs (git -> https; gitea)
+ * README: Major update
+
+ -- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 29 Jun 2022 11:45:08 +0200
+
+osmo-sgsn (1.8.0) unstable; urgency=medium
+
+ [ Harald Welte ]
+ * Remove bogus DNS log category
+
+ [ Daniel Willmann ]
+ * manuals: Regenerate counters/VTY through docker
+
+ [ Vadim Yanitskiy ]
+ * main: resurrect removed 'ns' logging category as deprecated
+ * doc/manuals: update configuration.adoc to use new command syntax
+ * tests/Makefile.am: do not try removing non-existing files
+
+ [ Pau Espin Pedrol ]
+ * ranap: log ranap iu event type name instead of number
+ * gmm: log GMM msg type name instead of number
+ * gmm: Expect E_VLR_ANSWERED when in ST_IU_SECURITY_CMD
+ * gmm_fsm: Expect E_GMM_COMMON_PROC_INIT_REQ when in ST_GMM_COMMON_PROC_INIT
+ * mm_iu: Send event E_PMM_PS_CONN_ESTABLISH upon rx GMM SERVICE REQUEST
+ * mm_iu: Expect E_PMM_PS_ATTACH when in ST_PMM_IDLE
+ * gprs_gmm.c: State proper GMM prefix logging rx/tx of GMM messages
+ * mm_state_iu_fsm: T3314 expiry must lead to PMM IDLE, not PMM DETACHED
+ * Iu: Drop timer X3314
+ * gprs_ranap.c: Clean up code path releasing IU conn
+ * mm_state_{gb,iu}_fsm: Add missing license block, improve spec references
+ * mm_state_{gb,iu}_fsm: Improve naming for detach event
+ * Drop unused GBRPOXY enum field
+ * gtp: Delete ctx upon receive UpdateCtxResp with cause Non-existent
+ * Support forwarding RIM messages over GTPCv1 EUTRAN<->GERAN
+ * Use new stat item/ctr getter APIs
+
+ [ Keith ]
+ * vty: Fix optional display of pdp with mm-context
+ * VTY: Don't display 'PDP Address: invalid' for IPv4v6
+
+ [ Eric ]
+ * add support for multiple encryption algorithms and a5/4
+
+ [ Oliver Smith ]
+ * gtphub: remove llist_first, llist_last macros
+ * vty: add "page imsi"
+ * debian/control: remove dh-systemd build-depend
+ * Revert "Turn some compiler warnings into errors"
+
+ -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 16 Nov 2021 17:57:50 +0100
+
+osmo-sgsn (1.7.0) unstable; urgency=medium
+
+ [ Daniel Willmann ]
+ * gprs_gmm: Check for RAT change and ensure this only happens for RAU/ATT
+ * gbproxy-usermanual: Explain BSSGP/BVC handling
+ * gbproxy: Whitespace fixes
+ * gbproxy: Add todo for BVC RESET logic
+ * gbproxy: Get the peer if paging by BVCI on SIG_BVC
+ * Let libosmocore handle VTY parent node tracking
+ * osmo-gbproxy: Free msgb in ns2 prim callback
+ * configure.ac: Require python3 for ext_tests
+ * osmo-gbproxy: Implement nsvc-state ctrl command
+ * gbproxy: Remove test testing NSVCI change
+ * gbproxy: Add NSE peer that can have multiple gbproxy_peers
+ * gbproxy: Ensure BVC0 is reset before handling PtP BVCs
+ * gbproxy: Only send paging to each matching NSE once
+ * gbproxy: Separate function to move gbproxy_peer to different nse
+ * gbproxy: Add logging macros for NSE and BVC
+ * gbproxy: Use LOG macros for NSE/BVC
+ * gbproxy: Change generic LOG messages so BVCI/NSEI fmt is consistent
+ * gbproxy: Add todos encountered while going through the code
+ * gbproxy: Add BVC log filters
+ * gbproxy: Add newline to log message
+ * gbproxy: Allow gbproxy_nse_free(NULL)
+ * gbproxy: Delete gbproxy_nse in delete-gbproxy-peer VTY command
+ * mm_state_gb_fsm: Handle implicit detach from mm_standby
+ * gbproxy: Fix bvci check in gbprox_rx_ptp_from_*
+ * osmo-gbproxy: Initialize all hash_maps
+ * gbproxy: Fix confusing log message in gbprox_relay2nse
+ * gbproxy: Add SGSN NRI configuration
+ * gbproxy: Add SGSN pooling support
+ * gbproxy: Add comments to sgsn functions
+ * gbproxy: Add config option to name an SGSN
+ * gbproxy: Add VTY command to override the node selection function
+ * Fix gbproxy_sgsn_by_tlli wraparound
+ * gbproxy: Implement TLLI cache and use it for SUSPEND/RESUME
+ * gbproxy: Increase TLLI cache timeout to 10s
+ * gbproxy: Implement IMSI cache
+ * gbproxy: Use IMSI cache to handle PAGING_PS_REJECT
+ * gbproxy: Use C-style comments
+ * gbproxy: Move helper function to a more logical place
+ * gbproxy: Remove unused variable assignment
+ * gbproxy: Fix VTY cmd name
+ * gbproxy: Define and use help string for gbproxy
+ * gbproxy: Add VTY commands to query the TLLI/IMSI cache
+ * gbproxy: Use IMSI cache for PTP paging and implement DUMMY_PAGING_PS
+ * gbproxy: Print the correct message type for dummy paging/paging reject
+ * gbproxy: Improve log messages in gbproxy_select_sgsn
+ * gbproxy: Fix radio status routing by TMSI
+ * manual/gbproxy: Update overview chapter
+ * Rename OsmoGbPROXY -> *Proxy
+ * manuals/gbproxy: Update configuration chapter
+ * manuals/gbproxy: Add osmo-bsc MSC pooling chapter from Neels as a base
+ * manuals/gbproxy: MSC -> SGSN for pooling chapter
+ * manuals/gbproxy: Move pooling to separate chapter
+
+ [ Alexander Couzens ]
+ * gprs_gmm_fsm.c: Implement RAT change between 2g and 3g
+ * gtphub: rename sgsn's oww osmo_sockaddr into sgsn_sockaddr
+ * gprs_llc: _bssgp_tx_dl_ud: ensure the LLME is valid before using it
+ * gmm: on invalid RA id reject the MS with an implicit detach
+ * gtphub_test: fix compilation error on gcc 10.2.0
+ * gtphub: fix compilation with gcc 10.2.0
+ * Port gbproxy to NS2
+ * sgsn: check for NULL of gprs_subscr_get_or_create()
+ * sgsn: Use the new NS2 api
+ * gbproxy: use ns2 vty2
+ * configure.ac: define a c standard instead of using the compilers default
+ * follow libosmocore/gprs_ns2 API changes of GPRS enums
+ * gbproxy: follow gprs_ns2 API vty changes
+ * sgsn: migrate to the new gprs_ns2_vty configuration
+ * follow libosmocore/gprs_ns2 API changes (gprs_ns2_dynamic_create_nse)
+
+ [ Neels Hofmeyr ]
+ * manual: explain IuPS, add SCCP/M3UA section from common chapters
+ * fix nullpointer: in gsm48_rx_gmm_ra_upd_req()
+ * gsup: send RAT type on LU
+ * gbproxy_test.c: fix mobile identity test data
+ * use new osmo_mobile_identity API everywhere
+
+ [ Eric ]
+ * tests: dlopen does not imply availability of dlsym..
+ * configure.ac: fix libtool issue with clang and sanitizer
+
+ [ Harald Welte ]
+ * gtphub_test: Fix compilation with gcc-10
+ * Fix memory leak when SNDCP de-fragmentation is used
+ * Treat RAU as implicit RESUME if GMM is suspended
+ * *.spec.in: Use %config(noreplace) to retain current config file
+ * Send a BVC-RESET to all persistent Gb interfaces at start-up
+ * Use osmo_fd_setup() whenever applicable
+ * Use osmo_fd_*_{disable,enable}
+ * gbproxy: Properly implement paging to LAC/RAC
+ * gbproxy: Implement paging to entire BSS area
+ * gprs_gb_parse: Add function to determine TLLI from encoded BSSGP
+ * gbproxy: Pass TLLI as LSP towards NS to facilitate load sharing
+ * gb_proxy_peer: Add some FIXMEs regarding invalid assumptions
+ * gb_proxy: More precise + readable log messages
+ * gb_proxy: Broadcast SGSN-INVOKE-TRACE and OVERLOAD
+ * gbproxy: Move BSS-side BVC-RESET processing to its own function
+ * gb_proxy: Slightly restructure processing of BSS-originated BVC-RESET
+ * gbproxy: Cosmetics: use longer lines
+ * gbproxy: Send BVC-STATUS if BSS sends us BVC-RESET without mandatory IEs
+ * gb_proxy: Use TLVP_PRES_LEN instead of TLVP_PRESENT
+ * gb_proxy: Rename gbproxy_peer to gbproxy_bvc
+ * gbproxy: Rename gbproxy_cfg.nses to gbproxy_cfg.bss_nses
+ * gbproxy: convert bss_nses from llist_head to hashtable
+ * gbproxy: convert nse->bvcs from llist_head to hashtable
+ * gbproxy: Remove patching, TLLI-tracking and SGSN2 support
+ * gb_proxy: cosmetic: Use function rather than open-coding is_sgsn
+ * gbproxy: Delete gbproxy_test
+ * gb_proxy: Introduce more validation / constraint checks
+ * gbproxy: use gbprox_relay2peer() whenever possible
+ * gb_proxy: Use osmo_tlv_prot_parse() to validate mandatory IEs
+ * gbproxy: Log FSM timeouts
+ * migrate to DLBSSGP as log sub-system for BSSGP
+ * gbproxy major rewrite for SGSN pool support
+ * gbproxy: Use "(nsei << 16) | bvci" as rate_ctr_group index
+ * gbproxy: Introduce new DOBJ log category; log object allocation/release
+ * gbproxy: Don't create an extra msgb copy for SGSN DL SIG
+ * gbproxy: Implement handling of BVC Flow Control
+ * gbproxy: Copy RA-ID from BSS side BVC to CELL and SGSN-side BVC
+ * gbproxy: (Re)allocate SGSN-side PTP BVC even if CELL already exists
+ * gbproxy: Fix segfault when receiving PAGING for unknown destination
+ * gbproxy: Add FSM related VTY commands
+ * gbproxy: Implement scaling of BVC flow control in SGSN pool
+ * gbproxy: Improve VTY state introspection
+ * gbproxy: rename vty command "show gbproxy ..." to "show gbproxy bvc ..."
+ * gbproxy: Add "show gbproxy cell ..." VTY command
+ * gbproxy: Fix build on Deiban 8
+ * gb_proxy: Don't use orphan log subsystem DPCU
+ * gbproxy: Avoid depending on any of the SGSN code
+ * main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
+ * manuals: generate vty reference xml at build time
+
+ [ Pau Espin Pedrol ]
+ * Use OSMO_FD_* instead of deprecated BSC_FD_*
+ * sgsn_libgtp: Improve ps-paging logging
+ * gprs_gmm_fsm.c: Add missing license header
+ * sgsn_libgtp: Avoid ps-paging MS on GMM Suspended state
+ * configure.ac: Fix trailing whitespace
+ * doc: Update VTY reference xml file
+ * Support setting rt-prio and cpu-affinity mask through VTY
+ * Change default SCTP conn NULL->127.0.0.1 to localhost->localhost
+ * contrib/jenkins: Enable parallel make in make distcheck
+ * Log error if pdp ctx is freed while holding an active timer
+ * Fix crash rx DeactPdpReq while waiting for DeactPdpAck after gtp side is freed
+ * sgsn_delete_pdp_ctx: Add documentation and assert assumptions
+ * process_ms_ctx_status: refactor to avoid code duplication
+ * process_ms_ctx_status: Fix crash deleting PDP Ctx if GTP side was already released
+ * gbproxy: generate coredump and exit upon SIGABRT received
+ * gtphub: generate coredump and exit upon SIGABRT received
+ * sgsn: generate coredump and exit upon SIGABRT received
+ * gmm: fix build without define PTMSI_ALLOC
+ * gmm: Introduce comment to ease addition of Network feature support IE later
+ * .gitignore: Ignore new autofoo tmp files
+ * sndcp: Fix struct bit fields on big endian
+ * Fix nsei+bvci not updated on rx UL SNDCP data
+
+ [ Oliver Smith ]
+ * contrib: import RPM spec
+ * contrib: integrate RPM spec
+ * Makefile.am: EXTRA_DIST: debian, contrib/*.spec.in
+ * contrib/jenkins: don't build osmo-gsm-manuals
+ * gbproxy: remove (moved to own repository)
+
+ [ Vadim Yanitskiy ]
+ * debian/control: change maintainer to the Osmocom team / mailing list
+ * gb_proxy_peer: sgsn can never be NULL in gbproxy_sgsn_by_nri()
+ * gb_proxy_peer: fix NULL pointer dereference in gbproxy_sgsn_alloc()
+
+ [ Keith ]
+ * Fix Radio Priority in MM Attach and PDP Context Activation
+ * VTY: Add gtp state-dir command
+
+ [ Philipp Maier ]
+ * gprs_sndcp: fix use after free
+ * sgsn_rim: Add routing for (GERAN) BSSGP RIM messages
+
+ -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 23 Feb 2021 20:29:33 +0100
+
osmo-sgsn (1.6.0) unstable; urgency=medium
[ Pau Espin Pedrol ]
diff --git a/debian/compat b/debian/compat
index ec635144f..f599e28b8 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-9
+10
diff --git a/debian/control b/debian/control
index a37ff6589..aa594553b 100644
--- a/debian/control
+++ b/debian/control
@@ -1,10 +1,9 @@
Source: osmo-sgsn
Section: net
Priority: extra
-Maintainer: Alexander Couzens <lynxis@fe80.eu>
-Build-Depends: debhelper (>=9),
+Maintainer: Osmocom team <openbsc@lists.osmocom.org>
+Build-Depends: debhelper (>= 10),
dh-autoreconf,
- dh-systemd (>= 1.5),
autotools-dev,
autoconf,
automake,
@@ -12,19 +11,19 @@ Build-Depends: debhelper (>=9),
pkg-config,
libtalloc-dev,
libc-ares-dev,
- libgtp-dev (>= 1.5.0),
- libosmocore-dev (>= 1.2.0),
- libosmo-abis-dev (>= 0.6.0),
- libosmo-netif-dev (>= 0.4.0),
- libosmo-gsup-client-dev (>= 1.0.0),
+ libgtp-dev (>= 1.11.0),
+ libosmocore-dev (>= 1.9.0),
+ libosmo-abis-dev (>= 1.5.0),
+ libosmo-netif-dev (>= 1.4.0),
+ libosmo-gsup-client-dev (>= 1.7.0),
libasn1c-dev (>= 0.9.30),
- libosmo-ranap-dev (>= 0.6.0),
- libosmo-sigtran-dev (>= 1.0.0),
- libosmo-sccp-dev (>= 1.0.0),
- osmo-gsm-manuals-dev
+ libosmo-ranap-dev (>= 1.5.0),
+ libosmo-sigtran-dev (>= 1.8.0),
+ libosmo-sccp-dev (>= 1.8.0),
+ osmo-gsm-manuals-dev (>= 1.5.0)
Standards-Version: 3.9.8
-Vcs-Git: git://git.osmocom.org/osmo-sgsn.git
-Vcs-Browser: https://git.osmocom.org/osmo-sgsn
+Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-sgsn
+Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-sgsn
Homepage: https://projects.osmocom.org/projects/osmo-sgsn
@@ -53,22 +52,6 @@ Priority: extra
Depends: osmo-gtphub (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for Osmocom GTP Hub
-Package: osmo-gbproxy
-Architecture: any
-Depends: ${shlibs:Depends},
- ${misc:Depends}
-Recommends: osmo-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.
-
-Package: osmo-gbproxy-dbg
-Architecture: any
-Section: debug
-Priority: extra
-Depends: osmo-gbproxy (= ${binary:Version}), ${misc:Depends}
-Description: Debug symbols for Osmocom GPRS Gb Interface Proxy
-
Package: osmo-sgsn-doc
Architecture: all
Section: doc
diff --git a/debian/copyright b/debian/copyright
index fa7405fed..cd8d7e84c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: osmo-sgsn
-Source: git://git.osmocom.org/osmo-sgsn
+Source: https://gitea.osmocom.org/cellular-infrastructure/osmo-sgsn
Files: .gitignore
.gitreview
@@ -19,13 +19,10 @@ Files: .gitignore
contrib/ipa.py
contrib/jenkins.sh
contrib/soap.py
- contrib/systemd/osmo-gbproxy.service
contrib/systemd/osmo-sgsn.service
contrib/twisted_ipa.py
doc/Makefile.am
doc/examples/Makefile.am
- doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
- doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
doc/examples/osmo-gtphub/gtphub-example.txt
doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
doc/examples/osmo-gtphub/osmo-gtphub.cfg
@@ -36,7 +33,6 @@ Files: .gitignore
include/osmocom/sgsn/crc24.h
include/osmocom/sgsn/debug.h
include/osmocom/sgsn/gb_proxy.h
- include/osmocom/sgsn/gprs_gb_parse.h
include/osmocom/sgsn/gprs_gmm.h
include/osmocom/sgsn/gprs_llc.h
include/osmocom/sgsn/gprs_sgsn.h
@@ -51,13 +47,12 @@ Files: .gitignore
src/gprs/osmo_sgsn.cfg
tests/Makefile.am
tests/atlocal.in
- tests/gbproxy/Makefile.am
- tests/gbproxy/gbproxy_test.ok
tests/gprs/Makefile.am
tests/gprs/gprs_test.c
tests/gprs/gprs_test.ok
tests/gtphub/Makefile.am
tests/gtphub/gtphub_test.ok
+ tests/sgsn/gprs_gb_parse.h
tests/sgsn/Makefile.am
tests/sgsn/sgsn_test.ok
tests/slhc/Makefile.am
@@ -79,19 +74,12 @@ Files: include/osmocom/sgsn/a_reset.h
include/osmocom/sgsn/gprs_sndcp_pcomp.h
include/osmocom/sgsn/gprs_sndcp_xid.h
include/osmocom/sgsn/gprs_utils.h
- include/osmocom/sgsn/gtphub.h
+ include/osmocom/gtphub/gtphub.h
include/osmocom/sgsn/signal.h
src/gprs/gprs_llc_parse.c
src/gprs/crc24.c
- src/gprs/gprs_gb_parse.c
src/gprs/gprs_utils.c
src/gprs/sgsn_ares.c
- src/gbproxy/gb_proxy.c
- src/gbproxy/gb_proxy_main.c
- src/gbproxy/gb_proxy_patch.c
- src/gbproxy/gb_proxy_peer.c
- src/gbproxy/gb_proxy_tlli.c
- src/gbproxy/gb_proxy_vty.c
src/gtphub/gtphub.c
src/gtphub/gtphub_main.c
src/gtphub/gtphub_vty.c
@@ -114,6 +102,7 @@ Files: include/osmocom/sgsn/a_reset.h
src/sgsn/sgsn_main.c
src/sgsn/sgsn_vty.c
tests/gtphub/gtphub_test.c
+ tests/sgsn/gprs_gb_parse.c
tests/sgsn/sgsn_test.c
tests/slhc/slhc_test.c
tests/sndcp_xid/sndcp_xid_test.c
@@ -142,7 +131,6 @@ License: AGPL-3.0+
Files: src/gtphub/gtphub_ares.c
src/gtphub/gtphub_sock.c
- tests/gbproxy/gbproxy_test.c
Copyright: 2013 Jacob Erlbeck <jerlbeck@sysmocom.de>
2013 sysmocom s.f.m.c. GmbH
2014 Holger Hans Peter Freyther
diff --git a/debian/osmo-gbproxy.init b/debian/osmo-gbproxy.init
deleted file mode 100755
index 924f32d10..000000000
--- a/debian/osmo-gbproxy.init
+++ /dev/null
@@ -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
-
-:
diff --git a/debian/osmo-gbproxy.install b/debian/osmo-gbproxy.install
deleted file mode 100644
index a8c0dadd1..000000000
--- a/debian/osmo-gbproxy.install
+++ /dev/null
@@ -1,5 +0,0 @@
-etc/osmocom/osmo-gbproxy.cfg
-lib/systemd/system/osmo-gbproxy.service
-usr/bin/osmo-gbproxy
-usr/share/doc/osmo-sgsn/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg usr/share/doc/osmo-gbproxy/examples
-usr/share/doc/osmo-sgsn/examples/osmo-gbproxy/osmo-gbproxy.cfg usr/share/doc/osmo-gbproxy/examples
diff --git a/debian/rules b/debian/rules
index cfd692a48..24161a190 100755
--- a/debian/rules
+++ b/debian/rules
@@ -58,7 +58,6 @@ override_dh_auto_configure:
override_dh_strip:
dh_strip -posmo-sgsn --dbg-package=osmo-sgsn-dbg
dh_strip -posmo-gtphub --dbg-package=osmo-gtphub-dbg
- dh_strip -posmo-gbproxy --dbg-package=osmo-gbproxy-dbg
# Print test results in case of a failure
override_dh_auto_test:
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 2b5781a59..c725bc1ad 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -1,7 +1,7 @@
OSMOCONF_FILES = \
osmo-gtphub/osmo-gtphub.cfg \
osmo-sgsn/osmo-sgsn.cfg \
- osmo-gbproxy/osmo-gbproxy.cfg
+ $(NULL)
osmoconfdir = $(sysconfdir)/osmocom
osmoconf_DATA = $(OSMOCONF_FILES)
diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
deleted file mode 100644
index c471c38b5..000000000
--- a/doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
+++ /dev/null
@@ -1,44 +0,0 @@
-!
-! OsmoGbProxy (UNKNOWN) configuration saved from vty
-!!
-!
-log stderr
- logging filter all 1
- logging color 1
- logging timestamp 0
- logging level all debug
- logging level gprs debug
- logging level ns info
- logging level bssgp debug
- logging level lglobal notice
- logging level llapd notice
- logging level linp notice
- logging level lmux notice
- logging level lmi notice
- logging level lmib notice
- logging level lsms notice
-!
-line vty
- no login
-!
-ns
- nse 666 nsvci 666
- nse 666 remote-role sgsn
-! nse 666 encapsulation framerelay-gre
-! nse 666 remote-ip 172.16.1.70
-! nse 666 fr-dlci 666
- timer tns-block 3
- timer tns-block-retries 3
- timer tns-reset 3
- timer tns-reset-retries 3
- timer tns-test 30
- timer tns-alive 3
- timer tns-alive-retries 10
- encapsulation udp local-port 23000
-! encapsulation framerelay-gre enabled 1
-gbproxy
- sgsn nsei 666
- core-mobile-country-code 666
- core-mobile-network-code 6
- core-access-point-name none match-imsi ^666066|^66607
- tlli-list max-length 200
diff --git a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg b/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
deleted file mode 100644
index 29f698f32..000000000
--- a/doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-!
-! Osmocom Gb Proxy (0.9.0.404-6463) configuration saved from vty
-!!
-!
-line vty
- no login
-!
-gbproxy
- sgsn nsei 101
-ns
- nse 101 nsvci 101
- nse 101 remote-role sgsn
- nse 101 encapsulation udp
- nse 101 remote-ip 192.168.100.239
- nse 101 remote-port 7777
- timer tns-block 3
- timer tns-block-retries 3
- timer tns-reset 3
- timer tns-reset-retries 3
- timer tns-test 30
- timer tns-alive 3
- timer tns-alive-retries 10
- encapsulation framerelay-gre enabled 0
- encapsulation framerelay-gre local-ip 0.0.0.0
- encapsulation udp local-ip 127.0.0.100
- encapsulation udp local-port 23000
diff --git a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
index 3913d2c3c..d4dadf901 100644
--- a/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
+++ b/doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
@@ -5,6 +5,14 @@
! For the test, try to use most config commands.
!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
line vty
no login
diff --git a/doc/examples/osmo-gtphub/osmo-gtphub.cfg b/doc/examples/osmo-gtphub/osmo-gtphub.cfg
index 0bb63e312..da9bba59a 100644
--- a/doc/examples/osmo-gtphub/osmo-gtphub.cfg
+++ b/doc/examples/osmo-gtphub/osmo-gtphub.cfg
@@ -2,6 +2,14 @@
! Osmocom gtphub configuration
!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
line vty
no login
@@ -9,7 +17,7 @@ gtphub
! Local addresses to listen on and send from, each on standard ports
! 2123 and 2152. Setting these addresses is mandatory.
bind-to-sgsns 127.0.0.10
- bind-to-ggsns 127.0.0.2
+ bind-to-ggsns 127.0.0.20
! Local nonstandard ports or separate IPs:
!bind-to-sgsns ctrl 127.0.0.1 2342 user 127.0.0.1 4223
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
index 85112f41c..69000b439 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg
@@ -2,6 +2,14 @@
! Osmocom SGSN configuration
!
!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
line vty
no login
!
@@ -21,9 +29,9 @@ 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-port 23000
- encapsulation framerelay-gre enabled 0
+ bind udp local
+ listen 127.0.0.1 23000
+ accept-ipaccess
!
bssgp
!
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
index 3be4d4935..0b5ef4b19 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
@@ -2,6 +2,14 @@
! Osmocom SGSN configuration
!
!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
line vty
no login
!
@@ -23,9 +31,9 @@ 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-port 23000
- encapsulation framerelay-gre enabled 0
+ bind udp local
+ listen 127.0.0.1 23000
+ accept-ipaccess
!
bssgp
!
diff --git a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
index f60c076c2..a7ed9cf1e 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn_custom-sccp.cfg
@@ -2,6 +2,14 @@
! Osmocom SGSN configuration
!
!
+log stderr
+ logging color 1
+ logging print category-hex 0
+ logging print category 1
+ logging timestamp 0
+ logging print file basename last
+ logging print level 1
+
line vty
no login
!
@@ -9,6 +17,8 @@ cs7 instance 0
point-code 0.23.4
asp asp-clnt-OsmoSGSN-A 2905 0 m3ua
remote-ip 172.18.8.200 ! where to reach the STP
+ role asp
+ sctp-role client
as as-clnt-OsmoSGSN-A m3ua
asp asp-clnt-OsmoSGSN-A
routing-key 3 0.23.4
@@ -31,9 +41,9 @@ 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-port 23000
- encapsulation framerelay-gre enabled 0
+ bind udp local
+ listen 127.0.0.1 23000
+ accept-ipaccess
!
bssgp
!
diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am
index cd57cf148..8fce741cf 100644
--- a/doc/manuals/Makefile.am
+++ b/doc/manuals/Makefile.am
@@ -1,21 +1,23 @@
EXTRA_DIST = osmosgsn-usermanual.adoc \
osmosgsn-usermanual-docinfo.xml \
osmosgsn-vty-reference.xml \
- osmogbproxy-usermanual.adoc \
- osmogbproxy-usermanual-docinfo.xml \
regen_doc.sh \
chapters \
vty \
- osmogbproxy-vty-reference.xml \
- vty-osmogbproxy \
$(NULL)
if BUILD_MANUALS
- ASCIIDOC = osmosgsn-usermanual.adoc osmogbproxy-usermanual.adoc
+ ASCIIDOC = osmosgsn-usermanual.adoc
ASCIIDOC_DEPS = $(srcdir)/chapters/*.adoc
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
- VTY_REFERENCE = osmosgsn-vty-reference.xml osmogbproxy-vty-reference.xml
+ VTY_REFERENCE = osmosgsn-vty-reference.xml
+
+ BUILT_REFERENCE_XML = $(builddir)/vty/sgsn_vty_reference.xml
+ $(builddir)/vty/sgsn_vty_reference.xml: $(top_builddir)/src/sgsn/osmo-sgsn
+ mkdir -p $(builddir)/vty
+ $(top_builddir)/src/sgsn/osmo-sgsn --vty-ref-xml > $@
+
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
OSMO_REPOSITORY = osmo-sgsn
diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc
index 7d3072ec0..d6ddcd34a 100644
--- a/doc/manuals/chapters/configuration.adoc
+++ b/doc/manuals/chapters/configuration.adoc
@@ -11,7 +11,8 @@ explicit configuration of each PCU connecting to the SGSN. The
administrator only has to ensure that the NS and BSSGP layer identities
(NSEI, NSVCI, BVCI) are unique for each PCU connecting to the SGSN.
-=== Configuring the Gp interface
+[[gp-if-ggsn]]
+=== Configuring the Gp interface (towards GGSN)
The Gp interface is the GTP-C and GTP-U based interface between the SGSN
and the GGSNs. It is implemented via UDP on well-known source and
@@ -67,6 +68,58 @@ OsmoSGSN(config-sgsn)# grx-dns-add 1.2.3.4 <3>
<2> Enable the dynamic GGSN resolving mode
<3> Specify the IP address of a DNS server for APN resolution
+[[gp-if-mme]]
+=== Configuring the Gp interface (towards MME)
+
+The Gp interface also contains the GTP-C v1 based interface between the SGSN
+and the MMEs. This interface between SGSN and MMEs is used to transfer _RAN
+Information Relay_ GTP-C messages between them, which are used as containers to
+allow PCUs under the SGSN and eNodeBs under MMEs to exchange cell information
+(RIM).
+
+In the SGSN, this interface re-uses the same socket local configuration as per
+the GGSN connections (see _gtp local-ip_ VTY command in <<gp-if-ggsn>>).
+
+Similarly as with GGSNs, (again see <<gp-if-ggsn>>), selection of destination
+peers for the _RAN Information Relay_ message can be configured statically or
+dynamically over GRX.
+
+
+==== Static MME/TAI configuration
+
+In this mode, there is a static list of MMEs and TAIs configured in
+OsmoSGSN via the VTY / config file. One MME in the list can be configured as the
+_default route_, where all unspecified TAIs are routed too.
+
+This is a non-standard method outside of the 3GPP specifications for the
+SGSN, and is typically only used in private/small GPRS networks without
+any access to a GRX.
+
+.Example: Static MME/TAI configuration (single catch-all GGSN)
+----
+sgsn
+...
+ gtp local-ip 192.168.0.10 <1>
+ mme test-mme0 <2>
+ gtp remote-ip 192.168.0.20 <3>
+ gtp ran-info-relay 262 42 3 <4>
+ gtp ran-info-relay 262 42 4
+ mme test-mme1 <5>
+ gtp remote-ip 192.168.0.30
+ gtp ran-info-relay default <6>
+----
+<1> Configure the local IP address at the SGSN used for Gp/GTP
+<2> Configure an MME named "test-mme0"
+<3> Specify the remote IP address of the MME (for MME "test-mme0")
+<4> Route specified TAIs towards this MME
+<5> Configure an MME named "test-mme1"
+<6> Route all TAIs with an unspecified MME towards MM "test-mme1"
+
+==== Dynamic MME/TAI configuration
+
+Dynamic MME/TAI peer look up over GRX is not yet supported by OsmoSGSN.
+
+
[[auth-pol]]
=== Authorization Policy
@@ -345,16 +398,16 @@ Encryption can be enabled if the auth-policy is set to remote and the
HLR subscriber entries contain the keys of the SIM card. See
<<sgsn-ex-gsup>> on how to connect to an external HLR.
-.Example: Turn on encryption (GEA3)
+.Example: Turn on encryption (GEA3 and GEA4)
----
sgsn
- encryption GEA3
+ encryption gea 3 4
----
.Example: Turn off encryption (GEA0)
----
sgsn
- encryption GEA0
+ encryption gea 0
----
=== Configure SCCP/M3UA to accept _IuPS_ links
@@ -369,6 +422,7 @@ cs7 instance 0
point-code 0.23.4
asp asp-clnt-OsmoSGSN 2905 0 m3ua
remote-ip 127.0.0.1
+ role asp
sctp-role client
as as-clnt-OsmoSGSN m3ua
asp asp-clnt-OsmoSGSN
diff --git a/doc/manuals/chapters/gbproxy-configuration.adoc b/doc/manuals/chapters/gbproxy-configuration.adoc
deleted file mode 100644
index 599b3f7ba..000000000
--- a/doc/manuals/chapters/gbproxy-configuration.adoc
+++ /dev/null
@@ -1,6 +0,0 @@
-== Configuring OsmoGbPROXY
-
-TBD. Unfortunately this chapter of the manual still needs to be written.
-Osmocom has very limited funding and support resources; Feel free to help
-us completing this documentation by contributing with code, documentation
-or by supporting the developers financially.
diff --git a/doc/manuals/chapters/gbproxy-control.adoc b/doc/manuals/chapters/gbproxy-control.adoc
deleted file mode 100644
index afe23adfe..000000000
--- a/doc/manuals/chapters/gbproxy-control.adoc
+++ /dev/null
@@ -1,29 +0,0 @@
-[[control]]
-== Control interface
-
-The actual protocol is described in <<common-control-if>>, the variables
-common to all programs using it are described in <<ctrl_common_vars>>. Here we
-describe variables specific to OsmoGbPROXY.
-
-.Variables available over control interface
-[options="header",width="100%",cols="20%,5%,5%,50%,20%"]
-|===
-|Name|Access|Trap|Value|Comment
-|nsvc-state|RO|No|"<nsei>,<nsvci>,<local-alive>,<local-blocked>,<remote-role>,<remote-alive>,<remote-blocked>"|See <<nsvc_state>> for details.
-|gbproxy-state|RO|No|"<nsei>,<bvci>,<mcc>,<mnc>,<lac>,<rac>,<blocked>"|See <<gbproxy_state>> for details.
-|number-of-peers|RO|No|"<num-of-bss>"|Count of concurrent BSS(BTS) peers.
-|===
-
-[[nsvc_state]]
-=== nsvc-state
-
-Return the list of active NS-VCs (NS Virtual Circuits), including information
-on the key parameters, such as NSEI, NSVCI and the local + remote ALIVE
-and BLOCKED state.
-
-[[gbproxy_state]]
-=== gbproxy-state
-
-Return the list of active Peers, including information on the key
-parameters, such as NSEI, BVCI, and the MCC-MNC-LAC-RAC of the attached
-BSS, as well as the overall state (BLOCKED or UNBLOCKED).
diff --git a/doc/manuals/chapters/gbproxy-overview.adoc b/doc/manuals/chapters/gbproxy-overview.adoc
deleted file mode 100644
index 580afae61..000000000
--- a/doc/manuals/chapters/gbproxy-overview.adoc
+++ /dev/null
@@ -1,127 +0,0 @@
-[[chapter_overview]]
-== Overview
-
-=== About OsmoGbPROXY
-
-OsmoGbPROXY is the Osmocom proxy for the 3GPP Gb interface. The Gb
-interface is defined by 3GPP as the protocol between the BSS and the
-SGSN inside the 2G/2.5G/2.75G packet switched network domain.
-
-As Osmocom implements a BTS-colocated PCU, there are potentially many
-Gb interface connections between all those many PCUs in the network
-and the SGSN. This can be cumbersome to configure/maintain at the
-SGSN sine.
-
-OsmoGbPROXY aggregates many PCU-facing Gb connections into one Gb
-connection to the SGSN. This is achieved by
-
-* maintaining sepaate NS-VCs on the PCU side and on the SGSN side
-* more or less transparently routing BSSGP peer-to-peer Virtual Circuits
- (BVCs) through the proxy
-* having some special handling for the signaling BVC (BVCI=0) which is
- shared among all the PCUs connected to the proxy
-
-=== Data Model
-
-==== gbproxy_config
-
-This contains the parsed configuration of the OsmoGbPROXY.
-
-==== gproxy_peer
-
-A "peer" is any remote NS-entity that the proxy interacts with. A peer
-includes information about:
-
-* the [unique] NSEI of the peer
-* the [unique] BVCI of the peer
-* the Routeing Area (RA) of the peer
-
-==== gbproxy_tlli_state
-
-One of the (unique) TLLI of any of the subscribers/UEs attached to any of
-the BTSs/PCUs served by the proxy.
-
-==== gbproxy_link_info
-
-One of the [unique] subscribers/connections that are served through this
-proxy. The information includes
-
-* the TLLI on BSS side
-* the TLLI on SGSN side (may be different due to P-TMSI rewriting)
-* the NSEI of the SGSN for this link
-* a timestamp when we last conversed with this subscriber
-* state related to IMSI acquisition
-** a temporary queue of stored messages (until IMSI acquisition succeeds)
-** N(U) rewriting state (inserting IDENTTIY REQ changes LLC sequence numbers)
-
-==== gbproxy_match
-
-A single matching rule against which IMSIs are matched. The matching rule
-is expressed as regular expression. There can be one such matching rule for
-each
-
-* routing between two different SGSNs, see below
-* patching of messages (e.g. APN, PLMN)
-
-
-=== Advanced Features
-
-==== PLMN patching
-
-This feature permits to modify the PLMN inside any BSSGP messages
-containing the Routing Area ID (RAID).
-
-The configured core-mcc and core-mnc will be used towards the SGSN,
-irrespective of which MCC/MNC the PCU is using/reporting on Gb.
-
-==== APN patching
-
-This will transparently re-write the APN name inside SM ACTIVATE PDP
-REQUEST messages on the way from the MS to the SGSN. The patching is
-performed based on matching on the IMSI of the subscriber.
-
-The configured core-apn will be used towards the SGSN, irrespective
-of which APN the MS is requesting in its Layer3 signaling.
-
-APN patching can only be performed if no GPRS encryption is enabled in
-the network!
-
-APN patching is useful in case a valid APN cannot reliably be
-provisioned via other means, such as via the SIM Card, OTA-DM or via
-CAMEL rewriting in the SGSN.
-
-==== P-TMSI patching
-
-This feature transparently rewrite the P-TMSI between MS and SGSN. This
-is required when using the Secondary SGSN support, as both SGSNs could
-allocate overlapping TMSIs and we must make sure they're unique across
-both SGSNs.
-
-P-TMSI patching is required by (and hence automatically enablede if
-secondary SGSN support is enabled.
-
-P-TMSI patching can only be performed if no GPRS encryption is enabled in
-the network!
-
-==== IMSI Acquisition
-
-This is a special feature where the proxy will by itself inject GMM IDENTITY
-REQUEST messages for the IMSI into the downlink BSSGP traffic in order
-to establish the IMSI of subscribers for which it is not otherwise known
-
-IMSI acquisition is automatically enabled if secondary SGSN support is
-enabled.
-
-==== Secondary SGSN Support
-
-This allows the proxy to connect not only to one SGSN, but to two
-different SGSNs. IMSI matching rules are applied to determine which of
-the SGSNs is to be used for traffic of this subscriber.
-
-One possible use case of this feature is to have a "local break-out" for
-subscribers who are native to this network (and hence save
-latencies/overhead of back-hauling all related traffic via the
-SGSN+GGSN) while at the same time maintaining the classic behavior for
-inbound roaming subscribers, where the roaming agreements mandate that
-data traffic is brought back to the GGSN in the HPLMN via the SGSN of
-the VPLMN.
diff --git a/doc/manuals/chapters/gbproxy-running.adoc b/doc/manuals/chapters/gbproxy-running.adoc
deleted file mode 100644
index 9182b4867..000000000
--- a/doc/manuals/chapters/gbproxy-running.adoc
+++ /dev/null
@@ -1,39 +0,0 @@
-== Running OsmoGbPROXY
-
-The OsmoGbPROXY executable (`osmo-gbproxy`) offers the following command-line
-options:
-
-
-=== SYNOPSIS
-
-*osmo-gbproxy* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE'] [-s] [-e 'LOGLEVEL'] [-T]
-
-
-=== OPTIONS
-
-*-h, --help*::
- Print a short help message about the supported options
-*-V, --version*::
- Print the compile-time version number of the program
-*-d, --debug 'DBGMASK','DBGLEVELS'*::
- Set the log subsystems and levels for logging to stderr. This
- has mostly been superseded by VTY-based logging configuration,
- see <<logging>> for further information.
-*-D, --daemonize*::
- Fork the process as a daemon into background.
-*-c, --config-file 'CONFIGFILE'*::
- Specify the file and path name of the configuration file to be
- used. If none is specified, use `osmo_sgsn.cfg` in the current
- working directory.
-*-s, --disable-color*::
- Disable colors for logging to stderr. This has mostly been
- deprecated by VTY based logging configuration, see <<logging>>
- for more information.
-*-e, --log-level 'LOGLEVEL'*::
- Set the global log level for logging to stderr. This has mostly
- been deprecated by VTY based logging configuration, see
- <<logging>> for more information.
-*-T, --timestamp*::
- Enable prefixing each log line on stderr with a timestamp. This
- has mostly been deprecated by VTY based logging configuration, see
- <<logging>> for more information.
diff --git a/doc/manuals/osmogbproxy-usermanual-docinfo.xml b/doc/manuals/osmogbproxy-usermanual-docinfo.xml
deleted file mode 100644
index 29bb2aa74..000000000
--- a/doc/manuals/osmogbproxy-usermanual-docinfo.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<revhistory>
- <revision>
- <revnumber>1</revnumber>
- <date>March 21, 2019</date>
- <authorinitials>HW</authorinitials>
- <revremark>
- Initial version.
- </revremark>
- </revision>
-</revhistory>
-
-<authorgroup>
- <author>
- <firstname>Harald</firstname>
- <surname>Welte</surname>
- <email>hwelte@sysmocom.de</email>
- <authorinitials>HW</authorinitials>
- <affiliation>
- <shortaffil>sysmocom</shortaffil>
- <orgname>sysmocom - s.f.m.c. GmbH</orgname>
- <jobtitle>Managing Director</jobtitle>
- </affiliation>
- </author>
-</authorgroup>
-
-<copyright>
- <year>2013-2019</year>
- <holder>sysmocom - s.f.m.c. GmbH</holder>
-</copyright>
-
-<legalnotice>
- <para>
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU Free Documentation License,
- Version 1.3 or any later version published by the Free Software
- Foundation; with no Invariant Sections, no Front-Cover Texts,
- and no Back-Cover Texts. A copy of the license is included in
- the section entitled "GNU Free Documentation License".
- </para>
- <para>
- The Asciidoc source code of this manual can be found at
- <ulink url="https://git.osmocom.org/osmo-sgsn/doc/">
- https://git.osmocom.org/osmo-sgsn/doc/
- </ulink>
- </para>
-</legalnotice>
diff --git a/doc/manuals/osmogbproxy-usermanual.adoc b/doc/manuals/osmogbproxy-usermanual.adoc
deleted file mode 100644
index c4e0b9d0b..000000000
--- a/doc/manuals/osmogbproxy-usermanual.adoc
+++ /dev/null
@@ -1,34 +0,0 @@
-:gfdl-enabled:
-
-OsmoGbPROXY User Manual
-=======================
-Harald Welte <hwelte@sysmocom.de>
-
-
-include::./common/chapters/preface.adoc[]
-
-include::{srcdir}/chapters/gbproxy-overview.adoc[]
-
-include::{srcdir}/chapters/gbproxy-running.adoc[]
-
-include::{srcdir}/chapters/gbproxy-control.adoc[]
-
-include::./common/chapters/vty.adoc[]
-
-include::./common/chapters/logging.adoc[]
-
-include::{srcdir}/chapters/gbproxy-configuration.adoc[]
-
-include::./common/chapters/gb.adoc[]
-
-include::./common/chapters/control_if.adoc[]
-
-//include::{srcdir}/chapters/counters.adoc[]
-
-include::./common/chapters/port_numbers.adoc[]
-
-include::./common/chapters/bibliography.adoc[]
-
-include::./common/chapters/glossary.adoc[]
-
-include::./common/chapters/gfdl.adoc[]
diff --git a/doc/manuals/osmogbproxy-vty-reference.xml b/doc/manuals/osmogbproxy-vty-reference.xml
deleted file mode 100644
index ecf226808..000000000
--- a/doc/manuals/osmogbproxy-vty-reference.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ex:ts=2:sw=42sts=2:et
- -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
--->
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
-"http://docbook.org/xml/5.0/dtd/docbook.dtd" [
-<!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml" >
-<!ENTITY sections-vty SYSTEM "generated/docbook_osmogbproxy-vty-reference.xml" >
-]>
-
-<book>
- <info>
- <revhistory>
- <revision>
- <revnumber>v1</revnumber>
- <date>2nd December 2019</date>
- <authorinitials>hw</authorinitials>
- <revremark>Initial</revremark>
- </revision>
- </revhistory>
-
- <title>OsmoGbProxy VTY Reference</title>
-
- <copyright>
- <year>2019</year>
- </copyright>
-
- <legalnotice>
- <para>This work is copyright by <orgname>sysmocom - s.f.m.c. GmbH</orgname>. All rights reserved.
- </para>
- </legalnotice>
- </info>
-
- <!-- Main chapters-->
- &chapter-vty;
-</book>
-
diff --git a/doc/manuals/regen_doc.sh b/doc/manuals/regen_doc.sh
index 847b764aa..5c84a2321 100755
--- a/doc/manuals/regen_doc.sh
+++ b/doc/manuals/regen_doc.sh
@@ -1,77 +1,17 @@
-#!/bin/sh -e
+#!/bin/sh -x
-require_osmo_interact_vty() {
- if command -v osmo_interact_vty.py >/dev/null 2>&1; then
- return
- fi
- echo "ERROR: osmo_interact_vty.py not found. Are osmo-python-tests in PATH?"
+if [ -z "$DOCKER_PLAYGROUND" ]; then
+ echo "You need to set DOCKER_PLAYGROUND"
exit 1
-}
+fi
-# $1: "update_vty_reference" or "update_counters"
-# $2: output file
-# $3: port
-# $4-$n: command
-interact_vty() {
- action="$1"
- output="$2"
- port="$3"
- log="/tmp/$4.log"
- shift 3
+SCRIPT=$(realpath "$0")
+MANUAL_DIR=$(dirname "$SCRIPT")
- echo "Starting in background: $@"
- "$@" > "$log" 2>&1 &
- pid="$!"
+COMMIT=${COMMIT:-$(git log -1 --format=format:%H)}
- sleep 0.5
- if ! kill -0 "$pid" 2>/dev/null; then
- echo "ERROR: start failed!"
- cat "$log"
- exit 1
- fi
+cd "$DOCKER_PLAYGROUND/scripts" || exit 1
- case "$action" in
- "update_vty_reference")
- echo "Updating VTY reference: $output"
- osmo_interact_vty.py -X -p "$port" -H 127.0.0.1 -O "$output"
- ;;
- "update_counters")
- echo "Updating asciidoc counters: $output"
- osmo_interact_vty.py -c "enable;show asciidoc counters" -p "$port" -H 127.0.0.1 -O "$output"
- ;;
- *)
- echo "ERROR: invalid argument: $action"
- exit 1
- ;;
- esac
-
- kill "$pid"
- echo "Done (killed $1)"
- echo
-}
-
-DIR="$(cd "$(dirname "$0")"; pwd)"
-cd "$DIR"
-
-require_osmo_interact_vty
-
-interact_vty \
- "update_vty_reference" \
- "vty/sgsn_vty_reference.xml" \
- 4245 \
- osmo-sgsn -c "../examples/osmo-sgsn/osmo-sgsn.cfg"
-
-interact_vty \
- "update_vty_reference" \
- "vty-osmogbproxy/gbproxy_vty_reference.xml" \
- 4246 \
- osmo-gbproxy -c "../examples/osmo-gbproxy/osmo-gbproxy.cfg"
-
-interact_vty \
- "update_counters" \
- "chapters/counters_generated.adoc" \
- 4245 \
- osmo-sgsn -c "../examples/osmo-sgsn/osmo-sgsn.cfg"
-
-
-echo "Done with all"
+OSMO_BSC_BRANCH=$COMMIT ./regen_doc.sh osmo-sgsn 4245 \
+ "$MANUAL_DIR/chapters/counters_generated.adoc" \
+ "$MANUAL_DIR/vty/sgsn_vty_reference.xml"
diff --git a/doc/manuals/vty-osmogbproxy/gbproxy_vty_additions.xml b/doc/manuals/vty-osmogbproxy/gbproxy_vty_additions.xml
deleted file mode 100644
index 6da2d2f2f..000000000
--- a/doc/manuals/vty-osmogbproxy/gbproxy_vty_additions.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
- <node id='config-gbproxy'>
- <description>Configure the Gb proxy</description>
- </node>
-</vtydoc>
diff --git a/doc/manuals/vty-osmogbproxy/gbproxy_vty_reference.xml b/doc/manuals/vty-osmogbproxy/gbproxy_vty_reference.xml
deleted file mode 100644
index 1db3c0d2f..000000000
--- a/doc/manuals/vty-osmogbproxy/gbproxy_vty_reference.xml
+++ /dev/null
@@ -1,1627 +0,0 @@
-<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
- <node id='_common_cmds_'>
- <name>Common Commands</name>
- <description>These commands are available on all VTY nodes. They are listed here only once, to unclutter the VTY reference.</description>
- <command id='help'>
- <params>
- <param name='help' doc='Description of the interactive help system' />
- </params>
- </command>
- <command id='list'>
- <params>
- <param name='list' doc='Print command list' />
- </params>
- </command>
- <command id='write terminal'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='terminal' doc='Write to terminal' />
- </params>
- </command>
- <command id='write file [PATH]'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='file' doc='Write to configuration file' />
- <param name='[PATH]' doc='Set file path to store the config, or replace if already exists' />
- </params>
- </command>
- <command id='write memory'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='memory' doc='Write configuration to the file (same as write file)' />
- </params>
- </command>
- <command id='write'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- </params>
- </command>
- <command id='show running-config'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='running-config' doc='running configuration' />
- </params>
- </command>
- <command id='exit'>
- <params>
- <param name='exit' doc='Exit current mode and down to previous mode' />
- </params>
- </command>
- <command id='end'>
- <params>
- <param name='end' doc='End current mode and change to enable mode.' />
- </params>
- </command>
- </node>
- <node id='view'>
- <name>view</name>
- <command id='show version'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='version' doc='Displays program version' />
- </params>
- </command>
- <command id='show online-help'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='online-help' doc='Online help' />
- </params>
- </command>
- <command id='enable'>
- <params>
- <param name='enable' doc='Turn on privileged mode command' />
- </params>
- </command>
- <command id='terminal length &lt;0-512&gt;'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='length' doc='Set number of lines on a screen' />
- <param name='&lt;0-512&gt;' doc='Number of lines on screen (0 for no pausing)' />
- </params>
- </command>
- <command id='terminal no length'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='length' doc='Set number of lines on a screen' />
- </params>
- </command>
- <command id='who'>
- <params>
- <param name='who' doc='Display who is on vty' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='logging enable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='enable' doc='Enables logging to this vty' />
- </params>
- </command>
- <command id='logging disable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='disable' doc='Disables logging to this vty' />
- </params>
- </command>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging set-log-mask MASK'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='set-log-mask' doc='Set the logmask of this logging target' />
- <param name='MASK' doc='List of logging categories to log, e.g. &apos;abc:mno:xyz&apos;. Available log categories depend on the specific application, refer to the &apos;logging level&apos; command. Optionally add individual log levels like &apos;abc,1:mno,3:xyz,5&apos;, where the level numbers are LOGL_DEBUG=1 LOGL_INFO=3 LOGL_NOTICE=5 LOGL_ERROR=7 LOGL_FATAL=8' />
- </params>
- </command>
- <command id='logging level (|gprs|ns|bssgp|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='logp (|gprs|ns|bssgp|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal) .LOGMESSAGE'>
- <params>
- <param name='logp' doc='Print a message on all log outputs; useful for placing markers in test logs' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- <param name='.LOGMESSAGE' doc='Arbitrary message to log on given category and log level' />
- </params>
- </command>
- <command id='show logging vty'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='logging' doc='Show current logging configuration' />
- <param name='vty' doc='Show current logging configuration for this vty' />
- </params>
- </command>
- <command id='show alarms'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='alarms' doc='Show current logging configuration' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='tree' doc='Display only a specific memory chunk' />
- <param name='ADDRESS' doc='Chunk address (e.g. 0xdeadbeef)' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='filter' doc='Filter chunks using regular expression' />
- <param name='REGEXP' doc='Regular expression' />
- </params>
- </command>
- <command id='show stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- </params>
- </command>
- <command id='show stats level (global|peer|subscriber)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Show global groups only' />
- <param name='peer' doc='Show global and network peer related groups' />
- <param name='subscriber' doc='Show global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='show asciidoc counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='asciidoc' doc='Asciidoc generation' />
- <param name='counters' doc='Generate table of all registered counters' />
- </params>
- </command>
- <command id='show rate-counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='rate-counters' doc='Show all rate counters' />
- </params>
- </command>
- <command id='show gbproxy [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='gbproxy' doc='Display information about the Gb proxy' />
- <param name='[stats]' doc='Show statistics' />
- </params>
- </command>
- <command id='show gbproxy links'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='gbproxy' doc='Display information about the Gb proxy' />
- <param name='links' doc='Show logical links' />
- </params>
- </command>
- <command id='show ns'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- </params>
- </command>
- <command id='show ns stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show ns persistent'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='persistent' doc='Show only persistent NS' />
- </params>
- </command>
- <command id='show ns (nsei|nsvc) &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='nsei' doc='Select one NSE by its NSE Identifier' />
- <param name='nsvc' doc='Select one NSE by its NS-VC Identifier' />
- <param name='&lt;0-65535&gt;' doc='The Identifier of selected type' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- </node>
- <node id='enable'>
- <name>enable</name>
- <command id='disable'>
- <params>
- <param name='disable' doc='Turn off privileged mode command' />
- </params>
- </command>
- <command id='configure terminal'>
- <params>
- <param name='configure' doc='Configuration from vty interface' />
- <param name='terminal' doc='Configuration terminal' />
- </params>
- </command>
- <command id='copy running-config startup-config'>
- <params>
- <param name='copy' doc='Copy configuration' />
- <param name='running-config' doc='Copy running config to... ' />
- <param name='startup-config' doc='Copy running config to startup config (same as write file)' />
- </params>
- </command>
- <command id='show startup-config'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='startup-config' doc='Contentes of startup configuration' />
- </params>
- </command>
- <command id='show version'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='version' doc='Displays program version' />
- </params>
- </command>
- <command id='show online-help'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='online-help' doc='Online help' />
- </params>
- </command>
- <command id='terminal length &lt;0-512&gt;'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='length' doc='Set number of lines on a screen' />
- <param name='&lt;0-512&gt;' doc='Number of lines on screen (0 for no pausing)' />
- </params>
- </command>
- <command id='terminal no length'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='length' doc='Set number of lines on a screen' />
- </params>
- </command>
- <command id='who'>
- <params>
- <param name='who' doc='Display who is on vty' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='terminal monitor'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='monitor' doc='Copy debug output to the current terminal line' />
- </params>
- </command>
- <command id='terminal no monitor'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='monitor' doc='Copy debug output to the current terminal line' />
- </params>
- </command>
- <command id='logging enable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='enable' doc='Enables logging to this vty' />
- </params>
- </command>
- <command id='logging disable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='disable' doc='Disables logging to this vty' />
- </params>
- </command>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging set-log-mask MASK'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='set-log-mask' doc='Set the logmask of this logging target' />
- <param name='MASK' doc='List of logging categories to log, e.g. &apos;abc:mno:xyz&apos;. Available log categories depend on the specific application, refer to the &apos;logging level&apos; command. Optionally add individual log levels like &apos;abc,1:mno,3:xyz,5&apos;, where the level numbers are LOGL_DEBUG=1 LOGL_INFO=3 LOGL_NOTICE=5 LOGL_ERROR=7 LOGL_FATAL=8' />
- </params>
- </command>
- <command id='logging level (|gprs|ns|bssgp|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='logp (|gprs|ns|bssgp|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal) .LOGMESSAGE'>
- <params>
- <param name='logp' doc='Print a message on all log outputs; useful for placing markers in test logs' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- <param name='.LOGMESSAGE' doc='Arbitrary message to log on given category and log level' />
- </params>
- </command>
- <command id='show logging vty'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='logging' doc='Show current logging configuration' />
- <param name='vty' doc='Show current logging configuration for this vty' />
- </params>
- </command>
- <command id='show alarms'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='alarms' doc='Show current logging configuration' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='tree' doc='Display only a specific memory chunk' />
- <param name='ADDRESS' doc='Chunk address (e.g. 0xdeadbeef)' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='filter' doc='Filter chunks using regular expression' />
- <param name='REGEXP' doc='Regular expression' />
- </params>
- </command>
- <command id='show stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- </params>
- </command>
- <command id='show stats level (global|peer|subscriber)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Show global groups only' />
- <param name='peer' doc='Show global and network peer related groups' />
- <param name='subscriber' doc='Show global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='show asciidoc counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='asciidoc' doc='Asciidoc generation' />
- <param name='counters' doc='Generate table of all registered counters' />
- </params>
- </command>
- <command id='show rate-counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='rate-counters' doc='Show all rate counters' />
- </params>
- </command>
- <command id='show gbproxy [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='gbproxy' doc='Display information about the Gb proxy' />
- <param name='[stats]' doc='Show statistics' />
- </params>
- </command>
- <command id='show gbproxy links'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='gbproxy' doc='Display information about the Gb proxy' />
- <param name='links' doc='Show logical links' />
- </params>
- </command>
- <command id='delete-gbproxy-peer &lt;0-65534&gt; bvci &lt;2-65534&gt;'>
- <params>
- <param name='delete-gbproxy-peer' doc='Delete a GBProxy peer by NSEI and optionally BVCI' />
- <param name='&lt;0-65534&gt;' doc='NSEI number' />
- <param name='bvci' doc='Only delete peer with a matching BVCI' />
- <param name='&lt;2-65534&gt;' doc='BVCI number' />
- </params>
- </command>
- <command id='delete-gbproxy-peer &lt;0-65534&gt; (only-bvc|only-nsvc|all) [dry-run]'>
- <params>
- <param name='delete-gbproxy-peer' doc='Delete a GBProxy peer by NSEI and optionally BVCI' />
- <param name='&lt;0-65534&gt;' doc='NSEI number' />
- <param name='only-bvc' doc='Only delete BSSGP connections (BVC)' />
- <param name='only-nsvc' doc='Only delete dynamic NS connections (NS-VC)' />
- <param name='all' doc='Delete BVC and dynamic NS connections' />
- <param name='[dry-run]' doc='Show what would be deleted instead of actually deleting' />
- </params>
- </command>
- <command id='delete-gbproxy-link &lt;0-65534&gt; (tlli|imsi|sgsn-nsei) IDENT'>
- <params>
- <param name='delete-gbproxy-link' doc='Delete a GBProxy logical link entry by NSEI and identification' />
- <param name='&lt;0-65534&gt;' doc='NSEI number' />
- <param name='tlli' doc='Delete entries with a matching TLLI (hex)' />
- <param name='imsi' doc='Delete entries with a matching IMSI' />
- <param name='sgsn-nsei' doc='Delete entries with a matching SGSN NSEI' />
- <param name='IDENT' doc='Identification to match' />
- </params>
- </command>
- <command id='delete-gbproxy-link &lt;0-65534&gt; (stale|de-registered)'>
- <params>
- <param name='delete-gbproxy-link' doc='Delete a GBProxy logical link entry by NSEI and identification' />
- <param name='&lt;0-65534&gt;' doc='NSEI number' />
- <param name='stale' doc='Delete stale entries' />
- <param name='de-registered' doc='Delete de-registered entries' />
- </params>
- </command>
- <command id='show ns'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- </params>
- </command>
- <command id='show ns stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show ns persistent'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='persistent' doc='Show only persistent NS' />
- </params>
- </command>
- <command id='show ns (nsei|nsvc) &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='nsei' doc='Select one NSE by its NSE Identifier' />
- <param name='nsvc' doc='Select one NSE by its NS-VC Identifier' />
- <param name='&lt;0-65535&gt;' doc='The Identifier of selected type' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- <command id='nsvc (nsei|nsvci) &lt;0-65535&gt; (block|unblock|reset)'>
- <params>
- <param name='nsvc' doc='Perform an operation on a NSVC' />
- <param name='nsei' doc='NSEI to identify NS-VC Identifier (NS-VCI)' />
- <param name='nsvci' doc='NS-VC Identifier (NS-VCI)' />
- <param name='&lt;0-65535&gt;' doc='The NSEI' />
- <param name='block' doc='Initiate BLOCK procedure' />
- <param name='unblock' doc='Initiate UNBLOCK procedure' />
- <param name='reset' doc='Initiate RESET procedure' />
- </params>
- </command>
- </node>
- <node id='config'>
- <name>config</name>
- <command id='hostname WORD'>
- <params>
- <param name='hostname' doc='Set system&apos;s network name' />
- <param name='WORD' doc='This system&apos;s network name' />
- </params>
- </command>
- <command id='no hostname [HOSTNAME]'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='hostname' doc='Reset system&apos;s network name' />
- <param name='[HOSTNAME]' doc='Host name of this router' />
- </params>
- </command>
- <command id='password (8|) WORD'>
- <params>
- <param name='password' doc='Assign the terminal connection password' />
- <param name='8' doc='Specifies a HIDDEN password will follow' />
- <param name='' doc='dummy string ' />
- <param name='WORD' doc='The HIDDEN line password string' />
- </params>
- </command>
- <command id='password LINE'>
- <params>
- <param name='password' doc='Assign the terminal connection password' />
- <param name='LINE' doc='The UNENCRYPTED (cleartext) line password' />
- </params>
- </command>
- <command id='enable password (8|) WORD'>
- <params>
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- <param name='8' doc='Specifies a HIDDEN password will follow' />
- <param name='' doc='dummy string ' />
- <param name='WORD' doc='The HIDDEN &apos;enable&apos; password string' />
- </params>
- </command>
- <command id='enable password LINE'>
- <params>
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- <param name='LINE' doc='The UNENCRYPTED (cleartext) &apos;enable&apos; password' />
- </params>
- </command>
- <command id='no enable password'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- </params>
- </command>
- <command id='banner motd default'>
- <params>
- <param name='banner' doc='Set banner string' />
- <param name='motd' doc='Strings for motd' />
- <param name='default' doc='Default string' />
- </params>
- </command>
- <command id='banner motd file [FILE]'>
- <params>
- <param name='banner' doc='Set banner' />
- <param name='motd' doc='Banner for motd' />
- <param name='file' doc='Banner from a file' />
- <param name='[FILE]' doc='Filename' />
- </params>
- </command>
- <command id='no banner motd'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='banner' doc='Set banner string' />
- <param name='motd' doc='Strings for motd' />
- </params>
- </command>
- <command id='service terminal-length &lt;0-512&gt;'>
- <params>
- <param name='service' doc='Set up miscellaneous service' />
- <param name='terminal-length' doc='System wide terminal length configuration' />
- <param name='&lt;0-512&gt;' doc='Number of lines of VTY (0 means no line control)' />
- </params>
- </command>
- <command id='no service terminal-length [&lt;0-512&gt;]'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='service' doc='Set up miscellaneous service' />
- <param name='terminal-length' doc='System wide terminal length configuration' />
- <param name='[&lt;0-512&gt;]' doc='Number of lines of VTY (0 means no line control)' />
- </params>
- </command>
- <command id='line vty'>
- <params>
- <param name='line' doc='Configure a terminal line' />
- <param name='vty' doc='Virtual terminal' />
- </params>
- </command>
- <command id='service advanced-vty'>
- <params>
- <param name='service' doc='Set up miscellaneous service' />
- <param name='advanced-vty' doc='Enable advanced mode vty interface' />
- </params>
- </command>
- <command id='no service advanced-vty'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='service' doc='Set up miscellaneous service' />
- <param name='advanced-vty' doc='Enable advanced mode vty interface' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='log stderr'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='stderr' doc='Logging via STDERR of the process' />
- </params>
- </command>
- <command id='no log stderr'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='stderr' doc='Logging via STDERR of the process' />
- </params>
- </command>
- <command id='log file .FILENAME'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='file' doc='Logging to text file' />
- <param name='.FILENAME' doc='Filename' />
- </params>
- </command>
- <command id='no log file .FILENAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='file' doc='Logging to text file' />
- <param name='.FILENAME' doc='Filename' />
- </params>
- </command>
- <command id='log alarms &lt;2-32700&gt;'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='alarms' doc='Logging alarms to osmo_strrb' />
- <param name='&lt;2-32700&gt;' doc='Maximum number of messages to log' />
- </params>
- </command>
- <command id='no log alarms'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='alarms' doc='Logging alarms to osmo_strrb' />
- </params>
- </command>
- <command id='log syslog (authpriv|cron|daemon|ftp|lpr|mail|news|user|uucp)'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- <param name='authpriv' doc='Security/authorization messages facility' />
- <param name='cron' doc='Clock daemon (cron/at) facility' />
- <param name='daemon' doc='General system daemon facility' />
- <param name='ftp' doc='Ftp daemon facility' />
- <param name='lpr' doc='Line printer facility' />
- <param name='mail' doc='Mail facility' />
- <param name='news' doc='News facility' />
- <param name='user' doc='Generic facility' />
- <param name='uucp' doc='UUCP facility' />
- </params>
- </command>
- <command id='log syslog local &lt;0-7&gt;'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- <param name='local' doc='Syslog LOCAL facility' />
- <param name='&lt;0-7&gt;' doc='Local facility number' />
- </params>
- </command>
- <command id='no log syslog'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- </params>
- </command>
- <command id='log gsmtap [HOSTNAME]'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='gsmtap' doc='Logging via GSMTAP' />
- <param name='[HOSTNAME]' doc='Host name to send the GSMTAP logging to (UDP port 4729)' />
- </params>
- </command>
- <command id='stats reporter statsd'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='statsd' doc='Report to a STATSD server' />
- </params>
- </command>
- <command id='no stats reporter statsd'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='statsd' doc='Report to a STATSD server' />
- </params>
- </command>
- <command id='stats reporter log'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='log' doc='Report to the logger' />
- </params>
- </command>
- <command id='no stats reporter log'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='log' doc='Report to the logger' />
- </params>
- </command>
- <command id='stats interval &lt;1-65535&gt;'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='interval' doc='Set the reporting interval' />
- <param name='&lt;1-65535&gt;' doc='Interval in seconds' />
- </params>
- </command>
- <command id='gbproxy'>
- <params>
- <param name='gbproxy' doc='Configure the Gb proxy' />
- </params>
- </command>
- <command id='ns'>
- <params>
- <param name='ns' doc='Configure the GPRS Network Service' />
- </params>
- </command>
- </node>
- <node id='config-log'>
- <name>config-log</name>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging level (|gprs|ns|bssgp|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- </node>
- <node id='config-stats'>
- <name>config-stats</name>
- <command id='local-ip ADDR'>
- <params>
- <param name='local-ip' doc='Set the IP address to which we bind locally' />
- <param name='ADDR' doc='IP Address' />
- </params>
- </command>
- <command id='no local-ip'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='local-ip' doc='Set the IP address to which we bind locally' />
- </params>
- </command>
- <command id='remote-ip ADDR'>
- <params>
- <param name='remote-ip' doc='Set the remote IP address to which we connect' />
- <param name='ADDR' doc='IP Address' />
- </params>
- </command>
- <command id='remote-port &lt;1-65535&gt;'>
- <params>
- <param name='remote-port' doc='Set the remote port to which we connect' />
- <param name='&lt;1-65535&gt;' doc='Remote port number' />
- </params>
- </command>
- <command id='mtu &lt;100-65535&gt;'>
- <params>
- <param name='mtu' doc='Set the maximum packet size' />
- <param name='&lt;100-65535&gt;' doc='Size in byte' />
- </params>
- </command>
- <command id='no mtu'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='mtu' doc='Set the maximum packet size' />
- </params>
- </command>
- <command id='prefix PREFIX'>
- <params>
- <param name='prefix' doc='Set the item name prefix' />
- <param name='PREFIX' doc='The prefix string' />
- </params>
- </command>
- <command id='no prefix'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='prefix' doc='Set the item name prefix' />
- </params>
- </command>
- <command id='level (global|peer|subscriber)'>
- <params>
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Report global groups only' />
- <param name='peer' doc='Report global and network peer related groups' />
- <param name='subscriber' doc='Report global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='enable'>
- <params>
- <param name='enable' doc='Enable the reporter' />
- </params>
- </command>
- <command id='disable'>
- <params>
- <param name='disable' doc='Disable the reporter' />
- </params>
- </command>
- </node>
- <node id='config-line'>
- <name>config-line</name>
- <command id='login'>
- <params>
- <param name='login' doc='Enable password checking' />
- </params>
- </command>
- <command id='no login'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='login' doc='Enable password checking' />
- </params>
- </command>
- <command id='bind A.B.C.D [&lt;0-65535&gt;]'>
- <params>
- <param name='bind' doc='Accept VTY telnet connections on local interface' />
- <param name='A.B.C.D' doc='Local interface IP address (default: 127.0.0.1)' />
- <param name='[&lt;0-65535&gt;]' doc='Local TCP port number' />
- </params>
- </command>
- </node>
- <node id='config-ns'>
- <name>config-ns</name>
- <command id='nse &lt;0-65535&gt; nsvci &lt;0-65534&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='nsvci' doc='NS Virtual Connection' />
- <param name='&lt;0-65534&gt;' doc='NS Virtual Connection ID (NSVCI)' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-ip A.B.C.D'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-ip' doc='Remote IP Address' />
- <param name='A.B.C.D' doc='Remote IP Address' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-port &lt;0-65535&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-port' doc='Remote UDP Port' />
- <param name='&lt;0-65535&gt;' doc='Remote UDP Port Number' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; fr-dlci &lt;16-1007&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='fr-dlci' doc='Frame Relay DLCI' />
- <param name='&lt;16-1007&gt;' doc='Frame Relay DLCI Number' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; encapsulation (udp|framerelay-gre)'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='encapsulation' doc='Encapsulation for NS' />
- <param name='udp' doc='UDP/IP Encapsulation' />
- <param name='framerelay-gre' doc='Frame-Relay/GRE/IP Encapsulation' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-role (sgsn|bss)'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-role' doc='Remote NSE Role' />
- <param name='sgsn' doc='Remote Peer is SGSN' />
- <param name='bss' doc='Remote Peer is BSS' />
- </params>
- </command>
- <command id='no nse &lt;0-65535&gt;'>
- <params>
- <param name='no' doc='Delete Persistent NS Entity' />
- <param name='nse' doc='Delete Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- </params>
- </command>
- <command id='timer (tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov) &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Network Service Timer' />
- <param name='tns-block' doc='(un)blocking Timer (Tns-block) timeout' />
- <param name='tns-block-retries' doc='(un)blocking Timer (Tns-block) number of retries' />
- <param name='tns-reset' doc='Reset Timer (Tns-reset) timeout' />
- <param name='tns-reset-retries' doc='Reset Timer (Tns-reset) number of retries' />
- <param name='tns-test' doc='Test Timer (Tns-test) timeout' />
- <param name='tns-alive' doc='Alive Timer (Tns-alive) timeout' />
- <param name='tns-alive-retries' doc='Alive Timer (Tns-alive) number of retries' />
- <param name='tsns-prov' doc='SNS Provision Timer (Tsns-prov) timeout' />
- <param name='&lt;0-65535&gt;' doc='Timer Value' />
- </params>
- </command>
- <command id='encapsulation udp local-ip A.B.C.D'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='local-ip' doc='Set the IP address on which we listen for NS/UDP' />
- <param name='A.B.C.D' doc='IP Address' />
- </params>
- </command>
- <command id='encapsulation udp local-port &lt;0-65535&gt;'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='local-port' doc='Set the UDP port on which we listen for NS/UDP' />
- <param name='&lt;0-65535&gt;' doc='UDP port number' />
- </params>
- </command>
- <command id='encapsulation udp dscp &lt;0-255&gt;'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='dscp' doc='Set DSCP/TOS on the UDP socket' />
- <param name='&lt;0-255&gt;' doc='DSCP Value' />
- </params>
- </command>
- <command id='encapsulation framerelay-gre enabled (1|0)'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='framerelay-gre' doc='NS over Frame Relay over GRE Encapsulation' />
- <param name='enabled' doc='Enable or disable Frame Relay over GRE' />
- <param name='1' doc='Enable' />
- <param name='0' doc='Disable' />
- </params>
- </command>
- <command id='encapsulation framerelay-gre local-ip A.B.C.D'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='framerelay-gre' doc='NS over Frame Relay over GRE Encapsulation' />
- <param name='local-ip' doc='Set the IP address on which we listen for NS/FR/GRE' />
- <param name='A.B.C.D' doc='IP Address' />
- </params>
- </command>
- </node>
- <node id='config-gbproxy'>
- <name>config-gbproxy</name>
- <command id='sgsn nsei &lt;0-65534&gt;'>
- <params>
- <param name='sgsn' doc='SGSN information' />
- <param name='nsei' doc='NSEI to be used in the connection with the SGSN' />
- <param name='&lt;0-65534&gt;' doc='The NSEI' />
- </params>
- </command>
- <command id='core-mobile-country-code &lt;1-999&gt;'>
- <params>
- <param name='core-mobile-country-code' doc='Use this country code for the core network' />
- <param name='&lt;1-999&gt;' doc='MCC value' />
- </params>
- </command>
- <command id='core-mobile-network-code &lt;1-999&gt;'>
- <params>
- <param name='core-mobile-network-code' doc='Use this network code for the core network' />
- <param name='&lt;1-999&gt;' doc='NCC value' />
- </params>
- </command>
- <command id='match-imsi (patching|routing) .REGEXP'>
- <params>
- <param name='match-imsi' doc='Restrict actions to certain IMSIs' />
- <param name='patching' doc='Patch MS related information elements on match only' />
- <param name='routing' doc='Route to the secondary SGSN on match only' />
- <param name='.REGEXP' doc='Regular expression for the IMSI match' />
- </params>
- </command>
- <command id='core-access-point-name (APN|none)'>
- <params>
- <param name='core-access-point-name' doc='Use this access point name (APN) for the backbone' />
- <param name='APN' doc='Replace APN by this string' />
- <param name='none' doc='Remove APN' />
- </params>
- </command>
- <command id='secondary-sgsn nsei &lt;0-65534&gt;'>
- <params>
- <param name='secondary-sgsn' doc='Route matching LLC connections to a second SGSN (Experimental)' />
- <param name='nsei' doc='NSEI to be used in the connection with the SGSN' />
- <param name='&lt;0-65534&gt;' doc='The NSEI' />
- </params>
- </command>
- <command id='patch-ptmsi'>
- <params>
- <param name='patch-ptmsi' doc='Patch P-TMSI/TLLI' />
- </params>
- </command>
- <command id='acquire-imsi'>
- <params>
- <param name='acquire-imsi' doc='Acquire the IMSI before establishing a LLC connection (Experimental)' />
- </params>
- </command>
- <command id='link-list clean-stale-timer &lt;1-999999&gt;'>
- <params>
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='clean-stale-timer' doc='Periodic timer to clean stale links' />
- <param name='&lt;1-999999&gt;' doc='Frequency at which the periodic timer is fired (in seconds)' />
- </params>
- </command>
- <command id='link-list max-age &lt;1-999999&gt;'>
- <params>
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='max-age' doc='Limit maximum age' />
- <param name='&lt;1-999999&gt;' doc='Maximum age in seconds' />
- </params>
- </command>
- <command id='link-list max-length &lt;1-99999&gt;'>
- <params>
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='max-length' doc='Limit list length' />
- <param name='&lt;1-99999&gt;' doc='Maximum number of logical links in the list' />
- </params>
- </command>
- <command id='link-list keep-mode (never|re-attach|identified|always)'>
- <params>
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='keep-mode' doc='How to keep entries for detached logical links' />
- <param name='never' doc='Discard entry immediately after detachment' />
- <param name='re-attach' doc='Keep entry if a re-attachment has be requested' />
- <param name='identified' doc='Keep entry if it associated with an IMSI' />
- <param name='always' doc='Don&apos;t discard entries after detachment' />
- </params>
- </command>
- <command id='link stored-msgs-max-length &lt;1-99999&gt;'>
- <params>
- <param name='link' doc='Set TLLI parameters' />
- <param name='stored-msgs-max-length' doc='Limit list length' />
- <param name='&lt;1-99999&gt;' doc='Maximum number of msgb stored in the logical link waiting to acquire its IMSI' />
- </params>
- </command>
- <command id='no core-mobile-country-code'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='core-mobile-country-code' doc='Use this country code for the core network' />
- </params>
- </command>
- <command id='no core-mobile-network-code'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='core-mobile-network-code' doc='Use this network code for the core network' />
- </params>
- </command>
- <command id='no match-imsi'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='match-imsi' doc='Restrict actions to certain IMSIs' />
- </params>
- </command>
- <command id='no core-access-point-name'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='core-access-point-name' doc='Use this access point name (APN) for the backbone' />
- </params>
- </command>
- <command id='no secondary-sgsn'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='secondary-sgsn' doc='Route matching LLC connections to a second SGSN (Experimental)' />
- </params>
- </command>
- <command id='no patch-ptmsi'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='patch-ptmsi' doc='Patch P-TMSI/TLLI' />
- </params>
- </command>
- <command id='no acquire-imsi'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='acquire-imsi' doc='Acquire the IMSI before establishing a LLC connection (Experimental)' />
- </params>
- </command>
- <command id='no link-list clean-stale-timer'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='clean-stale-timer' doc='Periodic timer to clean stale links' />
- </params>
- </command>
- <command id='no link-list max-age'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='max-age' doc='Limit maximum age' />
- </params>
- </command>
- <command id='no link-list max-length'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='link-list' doc='Set TLLI list parameters' />
- <param name='max-length' doc='Limit list length' />
- </params>
- </command>
- <command id='no link stored-msgs-max-length'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='link' doc='Set TLLI parameters' />
- <param name='stored-msgs-max-length' doc='Limit list length' />
- </params>
- </command>
- </node>
-</vtydoc>
diff --git a/doc/manuals/vty/sgsn_vty_reference.xml b/doc/manuals/vty/sgsn_vty_reference.xml
deleted file mode 100644
index 38e21c2f1..000000000
--- a/doc/manuals/vty/sgsn_vty_reference.xml
+++ /dev/null
@@ -1,2536 +0,0 @@
-<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'>
- <node id='_common_cmds_'>
- <name>Common Commands</name>
- <description>These commands are available on all VTY nodes. They are listed here only once, to unclutter the VTY reference.</description>
- <command id='help'>
- <params>
- <param name='help' doc='Description of the interactive help system' />
- </params>
- </command>
- <command id='list'>
- <params>
- <param name='list' doc='Print command list' />
- </params>
- </command>
- <command id='write terminal'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='terminal' doc='Write to terminal' />
- </params>
- </command>
- <command id='write file'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='file' doc='Write to configuration file' />
- </params>
- </command>
- <command id='write memory'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- <param name='memory' doc='Write configuration to the file (same as write file)' />
- </params>
- </command>
- <command id='write'>
- <params>
- <param name='write' doc='Write running configuration to memory, network, or terminal' />
- </params>
- </command>
- <command id='show running-config'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='running-config' doc='running configuration' />
- </params>
- </command>
- <command id='exit'>
- <params>
- <param name='exit' doc='Exit current mode and down to previous mode' />
- </params>
- </command>
- <command id='end'>
- <params>
- <param name='end' doc='End current mode and change to enable mode.' />
- </params>
- </command>
- </node>
- <node id='view'>
- <name>view</name>
- <command id='show version'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='version' doc='Displays program version' />
- </params>
- </command>
- <command id='show online-help'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='online-help' doc='Online help' />
- </params>
- </command>
- <command id='enable'>
- <params>
- <param name='enable' doc='Turn on privileged mode command' />
- </params>
- </command>
- <command id='terminal length &lt;0-512&gt;'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='length' doc='Set number of lines on a screen' />
- <param name='&lt;0-512&gt;' doc='Number of lines on screen (0 for no pausing)' />
- </params>
- </command>
- <command id='terminal no length'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='length' doc='Set number of lines on a screen' />
- </params>
- </command>
- <command id='who'>
- <params>
- <param name='who' doc='Display who is on vty' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='logging enable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='enable' doc='Enables logging to this vty' />
- </params>
- </command>
- <command id='logging disable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='disable' doc='Disables logging to this vty' />
- </params>
- </command>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging set-log-mask MASK'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='set-log-mask' doc='Set the logmask of this logging target' />
- <param name='MASK' doc='List of logging categories to log, e.g. &apos;abc:mno:xyz&apos;. Available log categories depend on the specific application, refer to the &apos;logging level&apos; command. Optionally add individual log levels like &apos;abc,1:mno,3:xyz,5&apos;, where the level numbers are LOGL_DEBUG=1 LOGL_INFO=3 LOGL_NOTICE=5 LOGL_ERROR=7 LOGL_FATAL=8' />
- </params>
- </command>
- <command id='logging level (|mm|pag|meas|ref|gprs|ns|bssgp|llc|sndcp|slhc|ranap|sua|v42bis|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='mm' doc='Layer3 Mobility Management (MM)' />
- <param name='pag' doc='Paging Subsystem' />
- <param name='meas' doc='Radio Measurement Processing' />
- <param name='ref' doc='Reference Counting' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='llc' doc='GPRS Logical Link Control Protocol (LLC)' />
- <param name='sndcp' doc='GPRS Sub-Network Dependent Control Protocol (SNDCP)' />
- <param name='slhc' doc='RFC1144 TCP/IP Header compression (SLHC)' />
- <param name='ranap' doc='RAN Application Part (RANAP)' />
- <param name='sua' doc='SCCP User Adaptation (SUA)' />
- <param name='v42bis' doc='V.42bis data compression (SNDCP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='show logging vty'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='logging' doc='Show current logging configuration' />
- <param name='vty' doc='Show current logging configuration for this vty' />
- </params>
- </command>
- <command id='show alarms'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='alarms' doc='Show current logging configuration' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='tree' doc='Display only a specific memory chunk' />
- <param name='ADDRESS' doc='Chunk address (e.g. 0xdeadbeef)' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='filter' doc='Filter chunks using regular expression' />
- <param name='REGEXP' doc='Regular expression' />
- </params>
- </command>
- <command id='show stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- </params>
- </command>
- <command id='show stats level (global|peer|subscriber)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Show global groups only' />
- <param name='peer' doc='Show global and network peer related groups' />
- <param name='subscriber' doc='Show global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='show asciidoc counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='asciidoc' doc='Asciidoc generation' />
- <param name='counters' doc='Generate table of all registered counters' />
- </params>
- </command>
- <command id='show rate-counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='rate-counters' doc='Show all rate counters' />
- </params>
- </command>
- <command id='show sgsn'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='sgsn' doc='Display information about the SGSN' />
- </params>
- </command>
- <command id='show mm-context imsi IMSI [pdp]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='mm-context' doc='MM Context' />
- <param name='imsi' doc='Identify by IMSI' />
- <param name='IMSI' doc='IMSI of the MM Context' />
- <param name='[pdp]' doc='Include PDP Context Information' />
- </params>
- </command>
- <command id='show mm-context all [pdp]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='mm-context' doc='MM Context' />
- <param name='all' doc='All MM Contexts' />
- <param name='[pdp]' doc='Include PDP Context Information' />
- </params>
- </command>
- <command id='show pdp-context all'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='pdp-context' doc='Display information on PDP Context' />
- <param name='all' doc='Show everything' />
- </params>
- </command>
- <command id='show subscriber cache'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='subscriber' doc='Show information about subscribers' />
- <param name='cache' doc='Display contents of subscriber cache' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; users'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='users' doc='User Table' />
- </params>
- </command>
- <command id='show cs7 (sua|m3ua|ipa) [&lt;0-65534&gt;]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='sua' doc='SCCP User Adaptation' />
- <param name='m3ua' doc='MTP3 User Adaptation' />
- <param name='ipa' doc='IPA Multiplex (SCCP Lite)' />
- <param name='[&lt;0-65534&gt;]' doc='Port Number' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; asp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='asp' doc='Application Server Process (ASP)' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; as (active|all|m3ua|sua)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='as' doc='Application Server (AS)' />
- <param name='active' doc='Display all active ASs' />
- <param name='all' doc='Display all ASs (default)' />
- <param name='m3ua' doc='Display all m3ua ASs' />
- <param name='sua' doc='Display all SUA ASs' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp addressbook'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='addressbook' doc='List all SCCP addressbook entries' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp users'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='users' doc='Show List of SCCP Users registered' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp ssn &lt;0-65535&gt;'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='ssn' doc='Find an SCCP User registered for the given SSN' />
- <param name='&lt;0-65535&gt;' doc='Subsystem Number (SSN)' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp connections'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='connections' doc='Show List of active SCCP connections' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp timers'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signaling Connection Control Part' />
- <param name='timers' doc='Show List of SCCP timers' />
- </params>
- </command>
- <command id='show ns'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- </params>
- </command>
- <command id='show ns stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show ns persistent'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='persistent' doc='Show only persistent NS' />
- </params>
- </command>
- <command id='show ns (nsei|nsvc) &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='nsei' doc='Select one NSE by its NSE Identifier' />
- <param name='nsvc' doc='Select one NSE by its NS-VC Identifier' />
- <param name='&lt;0-65535&gt;' doc='The Identifier of selected type' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- <command id='show bssgp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- </params>
- </command>
- <command id='show bssgp stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show bssgp nsei &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- <param name='nsei' doc='Show all BVCs on one NSE' />
- <param name='&lt;0-65535&gt;' doc='The NSEI' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter bvc nsei &lt;0-65535&gt; bvci &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='bvc' doc='Filter based on BSSGP Virtual Connection' />
- <param name='nsei' doc='NSEI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='Network Service Entity Identifier (NSEI)' />
- <param name='bvci' doc='BVCI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='BSSGP Virtual Connection Identifier (BVCI)' />
- </params>
- </command>
- <command id='bssgp bvc nsei &lt;0-65535&gt; bvci &lt;0-65535&gt; reset'>
- <params>
- <param name='bssgp' doc='Initiate BVC RESET procedure for a given NSEI and BVCI' />
- <param name='bvc' doc='Filter based on BSSGP Virtual Connection' />
- <param name='nsei' doc='NSEI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='Network Service Entity Identifier (NSEI)' />
- <param name='bvci' doc='BVCI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='BSSGP Virtual Connection Identifier (BVCI)' />
- <param name='reset' doc='Perform reset procedure' />
- </params>
- </command>
- <command id='show llc'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='llc' doc='Display information about the LLC protocol' />
- </params>
- </command>
- <command id='show sndcp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='sndcp' doc='Display information about the SNDCP protocol' />
- </params>
- </command>
- </node>
- <node id='enable'>
- <name>enable</name>
- <command id='disable'>
- <params>
- <param name='disable' doc='Turn off privileged mode command' />
- </params>
- </command>
- <command id='configure terminal'>
- <params>
- <param name='configure' doc='Configuration from vty interface' />
- <param name='terminal' doc='Configuration terminal' />
- </params>
- </command>
- <command id='copy running-config startup-config'>
- <params>
- <param name='copy' doc='Copy configuration' />
- <param name='running-config' doc='Copy running config to... ' />
- <param name='startup-config' doc='Copy running config to startup config (same as write file)' />
- </params>
- </command>
- <command id='show startup-config'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='startup-config' doc='Contentes of startup configuration' />
- </params>
- </command>
- <command id='show version'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='version' doc='Displays program version' />
- </params>
- </command>
- <command id='show online-help'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='online-help' doc='Online help' />
- </params>
- </command>
- <command id='terminal length &lt;0-512&gt;'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='length' doc='Set number of lines on a screen' />
- <param name='&lt;0-512&gt;' doc='Number of lines on screen (0 for no pausing)' />
- </params>
- </command>
- <command id='terminal no length'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='length' doc='Set number of lines on a screen' />
- </params>
- </command>
- <command id='who'>
- <params>
- <param name='who' doc='Display who is on vty' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='terminal monitor'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='monitor' doc='Copy debug output to the current terminal line' />
- </params>
- </command>
- <command id='terminal no monitor'>
- <params>
- <param name='terminal' doc='Set terminal line parameters' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='monitor' doc='Copy debug output to the current terminal line' />
- </params>
- </command>
- <command id='logging enable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='enable' doc='Enables logging to this vty' />
- </params>
- </command>
- <command id='logging disable'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='disable' doc='Disables logging to this vty' />
- </params>
- </command>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging set-log-mask MASK'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='set-log-mask' doc='Set the logmask of this logging target' />
- <param name='MASK' doc='List of logging categories to log, e.g. &apos;abc:mno:xyz&apos;. Available log categories depend on the specific application, refer to the &apos;logging level&apos; command. Optionally add individual log levels like &apos;abc,1:mno,3:xyz,5&apos;, where the level numbers are LOGL_DEBUG=1 LOGL_INFO=3 LOGL_NOTICE=5 LOGL_ERROR=7 LOGL_FATAL=8' />
- </params>
- </command>
- <command id='logging level (|mm|pag|meas|ref|gprs|ns|bssgp|llc|sndcp|slhc|ranap|sua|v42bis|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='mm' doc='Layer3 Mobility Management (MM)' />
- <param name='pag' doc='Paging Subsystem' />
- <param name='meas' doc='Radio Measurement Processing' />
- <param name='ref' doc='Reference Counting' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='llc' doc='GPRS Logical Link Control Protocol (LLC)' />
- <param name='sndcp' doc='GPRS Sub-Network Dependent Control Protocol (SNDCP)' />
- <param name='slhc' doc='RFC1144 TCP/IP Header compression (SLHC)' />
- <param name='ranap' doc='RAN Application Part (RANAP)' />
- <param name='sua' doc='SCCP User Adaptation (SUA)' />
- <param name='v42bis' doc='V.42bis data compression (SNDCP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='show logging vty'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='logging' doc='Show current logging configuration' />
- <param name='vty' doc='Show current logging configuration for this vty' />
- </params>
- </command>
- <command id='show alarms'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='alarms' doc='Show current logging configuration' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) tree ADDRESS'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='tree' doc='Display only a specific memory chunk' />
- <param name='ADDRESS' doc='Chunk address (e.g. 0xdeadbeef)' />
- </params>
- </command>
- <command id='show talloc-context (application|all) (full|brief|DEPTH) filter REGEXP'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='talloc-context' doc='Show talloc memory hierarchy' />
- <param name='application' doc='Application&apos;s context' />
- <param name='all' doc='All contexts, if NULL-context tracking is enabled' />
- <param name='full' doc='Display a full talloc memory hierarchy' />
- <param name='brief' doc='Display a brief talloc memory hierarchy' />
- <param name='DEPTH' doc='Specify required maximal depth value' />
- <param name='filter' doc='Filter chunks using regular expression' />
- <param name='REGEXP' doc='Regular expression' />
- </params>
- </command>
- <command id='show stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- </params>
- </command>
- <command id='show stats level (global|peer|subscriber)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='stats' doc='Show statistical values' />
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Show global groups only' />
- <param name='peer' doc='Show global and network peer related groups' />
- <param name='subscriber' doc='Show global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='show asciidoc counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='asciidoc' doc='Asciidoc generation' />
- <param name='counters' doc='Generate table of all registered counters' />
- </params>
- </command>
- <command id='show rate-counters'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='rate-counters' doc='Show all rate counters' />
- </params>
- </command>
- <command id='show sgsn'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='sgsn' doc='Display information about the SGSN' />
- </params>
- </command>
- <command id='show mm-context imsi IMSI [pdp]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='mm-context' doc='MM Context' />
- <param name='imsi' doc='Identify by IMSI' />
- <param name='IMSI' doc='IMSI of the MM Context' />
- <param name='[pdp]' doc='Include PDP Context Information' />
- </params>
- </command>
- <command id='show mm-context all [pdp]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='mm-context' doc='MM Context' />
- <param name='all' doc='All MM Contexts' />
- <param name='[pdp]' doc='Include PDP Context Information' />
- </params>
- </command>
- <command id='show pdp-context all'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='pdp-context' doc='Display information on PDP Context' />
- <param name='all' doc='Show everything' />
- </params>
- </command>
- <command id='show subscriber cache'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='subscriber' doc='Show information about subscribers' />
- <param name='cache' doc='Display contents of subscriber cache' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI insert auth-triplet &lt;1-5&gt; sres SRES rand RAND kc KC'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='insert' doc='Insert data into the subscriber record' />
- <param name='auth-triplet' doc='Update authentication triplet' />
- <param name='&lt;1-5&gt;' doc='Triplet index' />
- <param name='sres' doc='Set SRES value' />
- <param name='SRES' doc='SRES value (4 byte) in hex' />
- <param name='rand' doc='Set RAND value' />
- <param name='RAND' doc='RAND value (16 byte) in hex' />
- <param name='kc' doc='Set Kc value' />
- <param name='KC' doc='Kc value (8 byte) in hex' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI create'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='create' doc='Create a subscriber entry' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI destroy'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='destroy' doc='Destroy a subscriber entry' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI cancel (update-procedure|subscription-withdraw)'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='cancel' doc='Cancel (remove) subscriber record' />
- <param name='update-procedure' doc='The MS moved to another SGSN' />
- <param name='subscription-withdraw' doc='The subscription is no longer valid' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI update-location-result (ok|system-failure|data-missing|unexpected-data-value|unknown-subscriber|roaming-not-allowed)'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='update-location-result' doc='Complete the update location procedure' />
- <param name='ok' doc='The update location request succeeded' />
- <param name='system-failure' doc='Force error code SystemFailure' />
- <param name='data-missing' doc='Force error code DataMissing' />
- <param name='unexpected-data-value' doc='Force error code UnexpectedDataValue' />
- <param name='unknown-subscriber' doc='Force error code UnknownSubscriber' />
- <param name='roaming-not-allowed' doc='Force error code RoamingNotAllowed' />
- </params>
- </command>
- <command id='update-subscriber imsi IMSI update-auth-info'>
- <params>
- <param name='update-subscriber' doc='Update subscriber list' />
- <param name='imsi' doc='Use the IMSI to select the subscriber' />
- <param name='IMSI' doc='The IMSI' />
- <param name='update-auth-info' doc='Complete the send authentication info procedure' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; users'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='users' doc='User Table' />
- </params>
- </command>
- <command id='show cs7 (sua|m3ua|ipa) [&lt;0-65534&gt;]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='sua' doc='SCCP User Adaptation' />
- <param name='m3ua' doc='MTP3 User Adaptation' />
- <param name='ipa' doc='IPA Multiplex (SCCP Lite)' />
- <param name='[&lt;0-65534&gt;]' doc='Port Number' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; asp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='asp' doc='Application Server Process (ASP)' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; as (active|all|m3ua|sua)'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='as' doc='Application Server (AS)' />
- <param name='active' doc='Display all active ASs' />
- <param name='all' doc='Display all ASs (default)' />
- <param name='m3ua' doc='Display all m3ua ASs' />
- <param name='sua' doc='Display all SUA ASs' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp addressbook'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='addressbook' doc='List all SCCP addressbook entries' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp users'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='users' doc='Show List of SCCP Users registered' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp ssn &lt;0-65535&gt;'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='ssn' doc='Find an SCCP User registered for the given SSN' />
- <param name='&lt;0-65535&gt;' doc='Subsystem Number (SSN)' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp connections'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='connections' doc='Show List of active SCCP connections' />
- </params>
- </command>
- <command id='show cs7 instance &lt;0-15&gt; sccp timers'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='An instance of the SS7 stack' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- <param name='sccp' doc='Signaling Connection Control Part' />
- <param name='timers' doc='Show List of SCCP timers' />
- </params>
- </command>
- <command id='show ns'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- </params>
- </command>
- <command id='show ns stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show ns persistent'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='persistent' doc='Show only persistent NS' />
- </params>
- </command>
- <command id='show ns (nsei|nsvc) &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='ns' doc='Display information about the NS protocol' />
- <param name='nsei' doc='Select one NSE by its NSE Identifier' />
- <param name='nsvc' doc='Select one NSE by its NS-VC Identifier' />
- <param name='&lt;0-65535&gt;' doc='The Identifier of selected type' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- <command id='nsvc (nsei|nsvci) &lt;0-65535&gt; (block|unblock|reset)'>
- <params>
- <param name='nsvc' doc='Perform an operation on a NSVC' />
- <param name='nsei' doc='NSEI to identify NS-VC Identifier (NS-VCI)' />
- <param name='nsvci' doc='NS-VC Identifier (NS-VCI)' />
- <param name='&lt;0-65535&gt;' doc='The NSEI' />
- <param name='block' doc='Initiate BLOCK procedure' />
- <param name='unblock' doc='Initiate UNBLOCK procedure' />
- <param name='reset' doc='Initiate RESET procedure' />
- </params>
- </command>
- <command id='show bssgp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- </params>
- </command>
- <command id='show bssgp stats'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- <param name='stats' doc='Include statistics' />
- </params>
- </command>
- <command id='show bssgp nsei &lt;0-65535&gt; [stats]'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='bssgp' doc='Show information about the BSSGP protocol' />
- <param name='nsei' doc='Show all BVCs on one NSE' />
- <param name='&lt;0-65535&gt;' doc='The NSEI' />
- <param name='[stats]' doc='Include Statistics' />
- </params>
- </command>
- <command id='logging filter bvc nsei &lt;0-65535&gt; bvci &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='bvc' doc='Filter based on BSSGP Virtual Connection' />
- <param name='nsei' doc='NSEI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='Network Service Entity Identifier (NSEI)' />
- <param name='bvci' doc='BVCI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='BSSGP Virtual Connection Identifier (BVCI)' />
- </params>
- </command>
- <command id='bssgp bvc nsei &lt;0-65535&gt; bvci &lt;0-65535&gt; reset'>
- <params>
- <param name='bssgp' doc='Initiate BVC RESET procedure for a given NSEI and BVCI' />
- <param name='bvc' doc='Filter based on BSSGP Virtual Connection' />
- <param name='nsei' doc='NSEI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='Network Service Entity Identifier (NSEI)' />
- <param name='bvci' doc='BVCI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='BSSGP Virtual Connection Identifier (BVCI)' />
- <param name='reset' doc='Perform reset procedure' />
- </params>
- </command>
- <command id='show llc'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='llc' doc='Display information about the LLC protocol' />
- </params>
- </command>
- <command id='show sndcp'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='sndcp' doc='Display information about the SNDCP protocol' />
- </params>
- </command>
- </node>
- <node id='config'>
- <name>config</name>
- <command id='hostname WORD'>
- <params>
- <param name='hostname' doc='Set system&apos;s network name' />
- <param name='WORD' doc='This system&apos;s network name' />
- </params>
- </command>
- <command id='no hostname [HOSTNAME]'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='hostname' doc='Reset system&apos;s network name' />
- <param name='[HOSTNAME]' doc='Host name of this router' />
- </params>
- </command>
- <command id='password (8|) WORD'>
- <params>
- <param name='password' doc='Assign the terminal connection password' />
- <param name='8' doc='Specifies a HIDDEN password will follow' />
- <param name='' doc='dummy string ' />
- <param name='WORD' doc='The HIDDEN line password string' />
- </params>
- </command>
- <command id='password LINE'>
- <params>
- <param name='password' doc='Assign the terminal connection password' />
- <param name='LINE' doc='The UNENCRYPTED (cleartext) line password' />
- </params>
- </command>
- <command id='enable password (8|) WORD'>
- <params>
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- <param name='8' doc='Specifies a HIDDEN password will follow' />
- <param name='' doc='dummy string ' />
- <param name='WORD' doc='The HIDDEN &apos;enable&apos; password string' />
- </params>
- </command>
- <command id='enable password LINE'>
- <params>
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- <param name='LINE' doc='The UNENCRYPTED (cleartext) &apos;enable&apos; password' />
- </params>
- </command>
- <command id='no enable password'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='enable' doc='Modify enable password parameters' />
- <param name='password' doc='Assign the privileged level password' />
- </params>
- </command>
- <command id='banner motd default'>
- <params>
- <param name='banner' doc='Set banner string' />
- <param name='motd' doc='Strings for motd' />
- <param name='default' doc='Default string' />
- </params>
- </command>
- <command id='banner motd file [FILE]'>
- <params>
- <param name='banner' doc='Set banner' />
- <param name='motd' doc='Banner for motd' />
- <param name='file' doc='Banner from a file' />
- <param name='[FILE]' doc='Filename' />
- </params>
- </command>
- <command id='no banner motd'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='banner' doc='Set banner string' />
- <param name='motd' doc='Strings for motd' />
- </params>
- </command>
- <command id='service terminal-length &lt;0-512&gt;'>
- <params>
- <param name='service' doc='Set up miscellaneous service' />
- <param name='terminal-length' doc='System wide terminal length configuration' />
- <param name='&lt;0-512&gt;' doc='Number of lines of VTY (0 means no line control)' />
- </params>
- </command>
- <command id='no service terminal-length [&lt;0-512&gt;]'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='service' doc='Set up miscellaneous service' />
- <param name='terminal-length' doc='System wide terminal length configuration' />
- <param name='[&lt;0-512&gt;]' doc='Number of lines of VTY (0 means no line control)' />
- </params>
- </command>
- <command id='line vty'>
- <params>
- <param name='line' doc='Configure a terminal line' />
- <param name='vty' doc='Virtual terminal' />
- </params>
- </command>
- <command id='service advanced-vty'>
- <params>
- <param name='service' doc='Set up miscellaneous service' />
- <param name='advanced-vty' doc='Enable advanced mode vty interface' />
- </params>
- </command>
- <command id='no service advanced-vty'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='service' doc='Set up miscellaneous service' />
- <param name='advanced-vty' doc='Enable advanced mode vty interface' />
- </params>
- </command>
- <command id='show history'>
- <params>
- <param name='show' doc='Show running system information' />
- <param name='history' doc='Display the session command history' />
- </params>
- </command>
- <command id='log stderr'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='stderr' doc='Logging via STDERR of the process' />
- </params>
- </command>
- <command id='no log stderr'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='stderr' doc='Logging via STDERR of the process' />
- </params>
- </command>
- <command id='log file .FILENAME'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='file' doc='Logging to text file' />
- <param name='.FILENAME' doc='Filename' />
- </params>
- </command>
- <command id='no log file .FILENAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='file' doc='Logging to text file' />
- <param name='.FILENAME' doc='Filename' />
- </params>
- </command>
- <command id='log alarms &lt;2-32700&gt;'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='alarms' doc='Logging alarms to osmo_strrb' />
- <param name='&lt;2-32700&gt;' doc='Maximum number of messages to log' />
- </params>
- </command>
- <command id='no log alarms'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='alarms' doc='Logging alarms to osmo_strrb' />
- </params>
- </command>
- <command id='log syslog (authpriv|cron|daemon|ftp|lpr|mail|news|user|uucp)'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- <param name='authpriv' doc='Security/authorization messages facility' />
- <param name='cron' doc='Clock daemon (cron/at) facility' />
- <param name='daemon' doc='General system daemon facility' />
- <param name='ftp' doc='Ftp daemon facility' />
- <param name='lpr' doc='Line printer facility' />
- <param name='mail' doc='Mail facility' />
- <param name='news' doc='News facility' />
- <param name='user' doc='Generic facility' />
- <param name='uucp' doc='UUCP facility' />
- </params>
- </command>
- <command id='log syslog local &lt;0-7&gt;'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- <param name='local' doc='Syslog LOCAL facility' />
- <param name='&lt;0-7&gt;' doc='Local facility number' />
- </params>
- </command>
- <command id='no log syslog'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='log' doc='Configure logging sub-system' />
- <param name='syslog' doc='Logging via syslog' />
- </params>
- </command>
- <command id='log gsmtap [HOSTNAME]'>
- <params>
- <param name='log' doc='Configure logging sub-system' />
- <param name='gsmtap' doc='Logging via GSMTAP' />
- <param name='[HOSTNAME]' doc='Host name to send the GSMTAP logging to (UDP port 4729)' />
- </params>
- </command>
- <command id='stats reporter statsd'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='statsd' doc='Report to a STATSD server' />
- </params>
- </command>
- <command id='no stats reporter statsd'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='statsd' doc='Report to a STATSD server' />
- </params>
- </command>
- <command id='stats reporter log'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='log' doc='Report to the logger' />
- </params>
- </command>
- <command id='no stats reporter log'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='stats' doc='Configure stats sub-system' />
- <param name='reporter' doc='Configure a stats reporter' />
- <param name='log' doc='Report to the logger' />
- </params>
- </command>
- <command id='stats interval &lt;1-65535&gt;'>
- <params>
- <param name='stats' doc='Configure stats sub-system' />
- <param name='interval' doc='Set the reporting interval' />
- <param name='&lt;1-65535&gt;' doc='Interval in seconds' />
- </params>
- </command>
- <command id='sgsn'>
- <params>
- <param name='sgsn' doc='Configure the SGSN' />
- </params>
- </command>
- <command id='ctrl'>
- <params>
- <param name='ctrl' doc='Configure the Control Interface' />
- </params>
- </command>
- <command id='cs7 instance &lt;0-15&gt;'>
- <params>
- <param name='cs7' doc='ITU-T Signaling System 7' />
- <param name='instance' doc='Configure a SS7 Instance' />
- <param name='&lt;0-15&gt;' doc='An instance of the SS7 stack' />
- </params>
- </command>
- <command id='ns'>
- <params>
- <param name='ns' doc='Configure the GPRS Network Service' />
- </params>
- </command>
- <command id='bssgp'>
- <params>
- <param name='bssgp' doc='Configure the GPRS BSS Gateway Protocol' />
- </params>
- </command>
- </node>
- <node id='config-log'>
- <name>config-log</name>
- <command id='logging filter all (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='all' doc='Do you want to log all messages?' />
- <param name='0' doc='Only print messages matched by other filters' />
- <param name='1' doc='Bypass filter and print all messages' />
- </params>
- </command>
- <command id='logging color (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='color' doc='Configure color-printing for log messages' />
- <param name='0' doc='Don&apos;t use color for printing messages' />
- <param name='1' doc='Use color for printing messages' />
- </params>
- </command>
- <command id='logging timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp' />
- </params>
- </command>
- <command id='logging print extended-timestamp (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='extended-timestamp' doc='Configure log message timestamping' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn' />
- </params>
- </command>
- <command id='logging print category (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem name' />
- </params>
- </command>
- <command id='logging print category-hex (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='category-hex' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with category/subsystem nr in hex (&apos;&lt;000b&gt;&apos;)' />
- </params>
- </command>
- <command id='logging print level (0|1)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='level' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the log level name' />
- </params>
- </command>
- <command id='logging print file (0|1|basename) [last]'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='print' doc='Log output settings' />
- <param name='file' doc='Configure log message' />
- <param name='0' doc='Don&apos;t prefix each log message' />
- <param name='1' doc='Prefix each log message with the source file and line' />
- <param name='basename' doc='Prefix each log message with the source file&apos;s basename (strip leading paths) and line' />
- <param name='[last]' doc='Log source file info at the end of a log line. If omitted, log source file info just before the log text.' />
- </params>
- </command>
- <command id='logging level (|mm|pag|meas|ref|gprs|ns|bssgp|llc|sndcp|slhc|ranap|sua|v42bis|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='mm' doc='Layer3 Mobility Management (MM)' />
- <param name='pag' doc='Paging Subsystem' />
- <param name='meas' doc='Radio Measurement Processing' />
- <param name='ref' doc='Reference Counting' />
- <param name='gprs' doc='GPRS Packet Service' />
- <param name='ns' doc='GPRS Network Service (NS)' />
- <param name='bssgp' doc='GPRS BSS Gateway Protocol (BSSGP)' />
- <param name='llc' doc='GPRS Logical Link Control Protocol (LLC)' />
- <param name='sndcp' doc='GPRS Sub-Network Dependent Control Protocol (SNDCP)' />
- <param name='slhc' doc='RFC1144 TCP/IP Header compression (SLHC)' />
- <param name='ranap' doc='RAN Application Part (RANAP)' />
- <param name='sua' doc='SCCP User Adaptation (SUA)' />
- <param name='v42bis' doc='V.42bis data compression (SNDCP)' />
- <param name='lglobal' doc='Library-internal global log family' />
- <param name='llapd' doc='LAPD in libosmogsm' />
- <param name='linp' doc='A-bis Intput Subsystem' />
- <param name='lmux' doc='A-bis B-Subchannel TRAU Frame Multiplex' />
- <param name='lmi' doc='A-bis Input Driver for Signalling' />
- <param name='lmib' doc='A-bis Input Driver for B-Channels (voice)' />
- <param name='lsms' doc='Layer3 Short Message Service (SMS)' />
- <param name='lctrl' doc='Control Interface' />
- <param name='lgtp' doc='GPRS GTP library' />
- <param name='lstats' doc='Statistics messages and logging' />
- <param name='lgsup' doc='Generic Subscriber Update Protocol' />
- <param name='loap' doc='Osmocom Authentication Protocol' />
- <param name='lss7' doc='libosmo-sigtran Signalling System 7' />
- <param name='lsccp' doc='libosmo-sigtran SCCP Implementation' />
- <param name='lsua' doc='libosmo-sigtran SCCP User Adaptation' />
- <param name='lm3ua' doc='libosmo-sigtran MTP3 User Adaptation' />
- <param name='lmgcp' doc='libosmo-mgcp Media Gateway Control Protocol' />
- <param name='ljibuf' doc='libosmo-netif Jitter Buffer' />
- <param name='lrspro' doc='Remote SIM protocol' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level set-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='set-all' doc='Once-off set all categories to the given log level. There is no single command to take back these changes -- each category is set to the given level, period.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='logging level force-all (debug|info|notice|error|fatal)'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Globally force all logging categories to a specific level. This is released by the &apos;no logging level force-all&apos; command. Note: any &apos;logging level &lt;category&gt; &lt;level&gt;&apos; commands will have no visible effect after this, until the forced level is released.' />
- <param name='debug' doc='Log debug messages and higher levels' />
- <param name='info' doc='Log informational messages and higher levels' />
- <param name='notice' doc='Log noticeable messages and higher levels' />
- <param name='error' doc='Log error messages and higher levels' />
- <param name='fatal' doc='Log only fatal messages' />
- </params>
- </command>
- <command id='no logging level force-all'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='logging' doc='Configure logging' />
- <param name='level' doc='Set the log level for a specified category' />
- <param name='force-all' doc='Release any globally forced log level set with &apos;logging level force-all &lt;level&gt;&apos;' />
- </params>
- </command>
- <command id='logging filter nsvc (nsei|nsvci) &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='nsvc' doc='Filter based on NS Virtual Connection' />
- <param name='nsei' doc='Identify NS-VC by NSEI' />
- <param name='nsvci' doc='Identify NS-VC by NSVCI' />
- <param name='&lt;0-65535&gt;' doc='Numeric identifier' />
- </params>
- </command>
- <command id='logging filter bvc nsei &lt;0-65535&gt; bvci &lt;0-65535&gt;'>
- <params>
- <param name='logging' doc='Configure logging' />
- <param name='filter' doc='Filter log messages' />
- <param name='bvc' doc='Filter based on BSSGP Virtual Connection' />
- <param name='nsei' doc='NSEI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='Network Service Entity Identifier (NSEI)' />
- <param name='bvci' doc='BVCI of the BVC to be filtered' />
- <param name='&lt;0-65535&gt;' doc='BSSGP Virtual Connection Identifier (BVCI)' />
- </params>
- </command>
- </node>
- <node id='config-stats'>
- <name>config-stats</name>
- <command id='local-ip ADDR'>
- <params>
- <param name='local-ip' doc='Set the IP address to which we bind locally' />
- <param name='ADDR' doc='IP Address' />
- </params>
- </command>
- <command id='no local-ip'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='local-ip' doc='Set the IP address to which we bind locally' />
- </params>
- </command>
- <command id='remote-ip ADDR'>
- <params>
- <param name='remote-ip' doc='Set the remote IP address to which we connect' />
- <param name='ADDR' doc='IP Address' />
- </params>
- </command>
- <command id='remote-port &lt;1-65535&gt;'>
- <params>
- <param name='remote-port' doc='Set the remote port to which we connect' />
- <param name='&lt;1-65535&gt;' doc='Remote port number' />
- </params>
- </command>
- <command id='mtu &lt;100-65535&gt;'>
- <params>
- <param name='mtu' doc='Set the maximum packet size' />
- <param name='&lt;100-65535&gt;' doc='Size in byte' />
- </params>
- </command>
- <command id='no mtu'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='mtu' doc='Set the maximum packet size' />
- </params>
- </command>
- <command id='prefix PREFIX'>
- <params>
- <param name='prefix' doc='Set the item name prefix' />
- <param name='PREFIX' doc='The prefix string' />
- </params>
- </command>
- <command id='no prefix'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='prefix' doc='Set the item name prefix' />
- </params>
- </command>
- <command id='level (global|peer|subscriber)'>
- <params>
- <param name='level' doc='Set the maximum group level' />
- <param name='global' doc='Report global groups only' />
- <param name='peer' doc='Report global and network peer related groups' />
- <param name='subscriber' doc='Report global, peer, and subscriber groups' />
- </params>
- </command>
- <command id='enable'>
- <params>
- <param name='enable' doc='Enable the reporter' />
- </params>
- </command>
- <command id='disable'>
- <params>
- <param name='disable' doc='Disable the reporter' />
- </params>
- </command>
- </node>
- <node id='config-line'>
- <name>config-line</name>
- <command id='login'>
- <params>
- <param name='login' doc='Enable password checking' />
- </params>
- </command>
- <command id='no login'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='login' doc='Enable password checking' />
- </params>
- </command>
- <command id='bind A.B.C.D [&lt;0-65535&gt;]'>
- <params>
- <param name='bind' doc='Accept VTY telnet connections on local interface' />
- <param name='A.B.C.D' doc='Local interface IP address (default: 127.0.0.1)' />
- <param name='[&lt;0-65535&gt;]' doc='Local TCP port number' />
- </params>
- </command>
- </node>
- <node id='config-ns'>
- <name>config-ns</name>
- <command id='nse &lt;0-65535&gt; nsvci &lt;0-65534&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='nsvci' doc='NS Virtual Connection' />
- <param name='&lt;0-65534&gt;' doc='NS Virtual Connection ID (NSVCI)' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-ip A.B.C.D'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-ip' doc='Remote IP Address' />
- <param name='A.B.C.D' doc='Remote IP Address' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-port &lt;0-65535&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-port' doc='Remote UDP Port' />
- <param name='&lt;0-65535&gt;' doc='Remote UDP Port Number' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; fr-dlci &lt;16-1007&gt;'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='fr-dlci' doc='Frame Relay DLCI' />
- <param name='&lt;16-1007&gt;' doc='Frame Relay DLCI Number' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; encapsulation (udp|framerelay-gre)'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='encapsulation' doc='Encapsulation for NS' />
- <param name='udp' doc='UDP/IP Encapsulation' />
- <param name='framerelay-gre' doc='Frame-Relay/GRE/IP Encapsulation' />
- </params>
- </command>
- <command id='nse &lt;0-65535&gt; remote-role (sgsn|bss)'>
- <params>
- <param name='nse' doc='Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- <param name='remote-role' doc='Remote NSE Role' />
- <param name='sgsn' doc='Remote Peer is SGSN' />
- <param name='bss' doc='Remote Peer is BSS' />
- </params>
- </command>
- <command id='no nse &lt;0-65535&gt;'>
- <params>
- <param name='no' doc='Delete Persistent NS Entity' />
- <param name='nse' doc='Delete Persistent NS Entity' />
- <param name='&lt;0-65535&gt;' doc='NS Entity ID (NSEI)' />
- </params>
- </command>
- <command id='timer (tns-block|tns-block-retries|tns-reset|tns-reset-retries|tns-test|tns-alive|tns-alive-retries|tsns-prov) &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Network Service Timer' />
- <param name='tns-block' doc='(un)blocking Timer (Tns-block) timeout' />
- <param name='tns-block-retries' doc='(un)blocking Timer (Tns-block) number of retries' />
- <param name='tns-reset' doc='Reset Timer (Tns-reset) timeout' />
- <param name='tns-reset-retries' doc='Reset Timer (Tns-reset) number of retries' />
- <param name='tns-test' doc='Test Timer (Tns-test) timeout' />
- <param name='tns-alive' doc='Alive Timer (Tns-alive) timeout' />
- <param name='tns-alive-retries' doc='Alive Timer (Tns-alive) number of retries' />
- <param name='tsns-prov' doc='SNS Provision Timer (Tsns-prov) timeout' />
- <param name='&lt;0-65535&gt;' doc='Timer Value' />
- </params>
- </command>
- <command id='encapsulation udp local-ip A.B.C.D'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='local-ip' doc='Set the IP address on which we listen for NS/UDP' />
- <param name='A.B.C.D' doc='IP Address' />
- </params>
- </command>
- <command id='encapsulation udp local-port &lt;0-65535&gt;'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='local-port' doc='Set the UDP port on which we listen for NS/UDP' />
- <param name='&lt;0-65535&gt;' doc='UDP port number' />
- </params>
- </command>
- <command id='encapsulation udp dscp &lt;0-255&gt;'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='udp' doc='NS over UDP Encapsulation' />
- <param name='dscp' doc='Set DSCP/TOS on the UDP socket' />
- <param name='&lt;0-255&gt;' doc='DSCP Value' />
- </params>
- </command>
- <command id='encapsulation framerelay-gre enabled (1|0)'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='framerelay-gre' doc='NS over Frame Relay over GRE Encapsulation' />
- <param name='enabled' doc='Enable or disable Frame Relay over GRE' />
- <param name='1' doc='Enable' />
- <param name='0' doc='Disable' />
- </params>
- </command>
- <command id='encapsulation framerelay-gre local-ip A.B.C.D'>
- <params>
- <param name='encapsulation' doc='NS encapsulation options' />
- <param name='framerelay-gre' doc='NS over Frame Relay over GRE Encapsulation' />
- <param name='local-ip' doc='Set the IP address on which we listen for NS/FR/GRE' />
- <param name='A.B.C.D' doc='IP Address' />
- </params>
- </command>
- </node>
- <node id='config-bssgp'>
- <name>config-bssgp</name>
- </node>
- <node id='config-ctrl'>
- <name>config-ctrl</name>
- <command id='bind A.B.C.D'>
- <params>
- <param name='bind' doc='Set bind address to listen for Control connections' />
- <param name='A.B.C.D' doc='Local IP address (default 127.0.0.1)' />
- </params>
- </command>
- </node>
- <node id='config-cs7'>
- <name>config-cs7</name>
- <command id='description .TEXT'>
- <params>
- <param name='description' doc='Save human-readable description of the object' />
- <param name='.TEXT' doc='Text until the end of the line' />
- </params>
- </command>
- <command id='network-indicator (international | national | reserved | spare)'>
- <params>
- <param name='network-indicator' doc='Configure the Network Indicator' />
- <param name='international' doc='International Network' />
- <param name='national' doc='National Network' />
- <param name='reserved' doc='Reserved Network' />
- <param name='spare' doc='Spare Network' />
- </params>
- </command>
- <command id='point-code POINT_CODE'>
- <params>
- <param name='point-code' doc='Configure the local Point Code' />
- <param name='POINT_CODE' doc='Point Code' />
- </params>
- </command>
- <command id='point-code format &lt;1-24&gt; [&lt;1-23&gt;] [&lt;1-22&gt;]'>
- <params>
- <param name='point-code' doc='Point Code' />
- <param name='format' doc='Configure Point Code Format' />
- <param name='&lt;1-24&gt;' doc='Length of first PC component' />
- <param name='[&lt;1-23&gt;]' doc='Length of second PC component' />
- <param name='[&lt;1-22&gt;]' doc='Length of third PC component' />
- </params>
- </command>
- <command id='point-code format default'>
- <params>
- <param name='point-code' doc='Point Code' />
- <param name='format' doc='Configure Point Code Format' />
- <param name='default' doc='Default Point Code Format (3.8.3)' />
- </params>
- </command>
- <command id='point-code delimiter (default|dash)'>
- <params>
- <param name='point-code' doc='Point Code' />
- <param name='delimiter' doc='Configure Point Code Delimiter' />
- <param name='default' doc='Use dot as delimiter' />
- <param name='dash' doc='User dash as delimiter' />
- </params>
- </command>
- <command id='xua rkm routing-key-allocation (static-only|dynamic-permitted)'>
- <params>
- <param name='xua' doc='SIGTRAN xxxUA related' />
- <param name='rkm' doc='Routing Key Management' />
- <param name='routing-key-allocation' doc='Routing Key Management Allocation Policy' />
- <param name='static-only' doc='Only static (pre-confgured) Routing Keys permitted' />
- <param name='dynamic-permitted' doc='Dynamically allocate Routing Keys for what ASPs request' />
- </params>
- </command>
- <command id='asp NAME &lt;0-65535&gt; &lt;0-65535&gt; (sua|m3ua|ipa)'>
- <params>
- <param name='asp' doc='Configure Application Server Process' />
- <param name='NAME' doc='Name of ASP' />
- <param name='&lt;0-65535&gt;' doc='Remote SCTP port number' />
- <param name='&lt;0-65535&gt;' doc='Local SCTP port number' />
- <param name='sua' doc='SCCP User Adaptation' />
- <param name='m3ua' doc='MTP3 User Adaptation' />
- <param name='ipa' doc='IPA Multiplex (SCCP Lite)' />
- </params>
- </command>
- <command id='no asp NAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='asp' doc='Disable Application Server Process' />
- <param name='NAME' doc='Name of ASP' />
- </params>
- </command>
- <command id='as NAME (sua|m3ua|ipa)'>
- <params>
- <param name='as' doc='Configure an Application Server' />
- <param name='NAME' doc='Name of the Application Server' />
- <param name='sua' doc='SCCP User Adaptation' />
- <param name='m3ua' doc='MTP3 User Adaptation' />
- <param name='ipa' doc='IPA Multiplex (SCCP Lite)' />
- </params>
- </command>
- <command id='no as NAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='as' doc='Disable Application Server' />
- <param name='NAME' doc='Name of AS' />
- </params>
- </command>
- <command id='sccp-address NAME'>
- <params>
- <param name='sccp-address' doc='Create/Modify an SCCP addressbook entry' />
- <param name='NAME' doc='Name of the SCCP Address' />
- </params>
- </command>
- <command id='no sccp-address NAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='sccp-address' doc='Delete an SCCP addressbook entry' />
- <param name='NAME' doc='Name of the SCCP Address' />
- </params>
- </command>
- <command id='sccp-timer (conn_est|ias|iar|rel|repeat_rel|int|guard|reset|reassembly) &lt;1-999999&gt;'>
- <params>
- <param name='sccp-timer' doc='Configure SCCP timer values, see ITU-T Q.714' />
- <param name='conn_est' doc='Waiting for connection confirm message, 1 to 2 minutes (default: 60)' />
- <param name='ias' doc='Send keep-alive: on an idle connection, delay before sending an Idle Timer message, 5 to 10 minutes (default: 420)' />
- <param name='iar' doc='Receive keep-alive: on an idle connection, delay until considering a connection as stale, 11 to 21 minutes (default: 900)' />
- <param name='rel' doc='Waiting for release complete message, 10 to 20 seconds (default: 10)' />
- <param name='repeat_rel' doc='Waiting for release complete message; or to repeat sending released message after the initial expiry, 10 to 20 seconds (default: 10)' />
- <param name='int' doc='Waiting for release complete message; or to release connection resources, freeze the LRN and alert a maintenance function after the initial expiry, extending to 1 minute (default: 60)' />
- <param name='guard' doc='Waiting to resume normal procedure for temporary connection sections during the restart procedure, 23 to 25 minutes (default: 1380)' />
- <param name='reset' doc='Waiting to release temporary connection section or alert maintenance function after reset request message is sent, 10 to 20 seconds (default: 10)' />
- <param name='reassembly' doc='Waiting to receive all the segments of the remaining segments, single segmented message after receiving the first segment, 10 to 20 seconds (default: 10)' />
- <param name='&lt;1-999999&gt;' doc='Timer value, in seconds' />
- </params>
- </command>
- </node>
- <node id='config-cs7-as'>
- <name>config-cs7-as</name>
- <command id='description .TEXT'>
- <params>
- <param name='description' doc='Save human-readable description of the object' />
- <param name='.TEXT' doc='Text until the end of the line' />
- </params>
- </command>
- <command id='asp NAME'>
- <params>
- <param name='asp' doc='Specify that a given ASP is part of this AS' />
- <param name='NAME' doc='Name of ASP to be added to AS' />
- </params>
- </command>
- <command id='no asp NAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='asp' doc='Specify ASP to be removed from this AS' />
- <param name='NAME' doc='Name of ASP to be removed' />
- </params>
- </command>
- <command id='traffic-mode (broadcast | loadshare | roundrobin | override)'>
- <params>
- <param name='traffic-mode' doc='Specifies traffic mode of operation of the ASP within the AS' />
- <param name='broadcast' doc='Broadcast to all ASP within AS' />
- <param name='loadshare' doc='Share Load among all ASP within AS' />
- <param name='roundrobin' doc='Round-Robin between all ASP within AS' />
- <param name='override' doc='Override' />
- </params>
- </command>
- <command id='recovery-timeout &lt;1-2000&gt;'>
- <params>
- <param name='recovery-timeout' doc='Specifies the recovery timeout value in milliseconds' />
- <param name='&lt;1-2000&gt;' doc='Recovery Timeout in Milliseconds' />
- </params>
- </command>
- <command id='qos-class &lt;0-255&gt;'>
- <params>
- <param name='qos-class' doc='Specity QoS Class of AS' />
- <param name='&lt;0-255&gt;' doc='QoS Class of AS' />
- </params>
- </command>
- <command id='routing-key RCONTEXT DPC'>
- <params>
- <param name='routing-key' doc='Define a routing key' />
- <param name='RCONTEXT' doc='Routing context number' />
- <param name='DPC' doc='Destination Point Code' />
- </params>
- </command>
- <command id='routing-key RCONTEXT DPC si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup)'>
- <params>
- <param name='routing-key' doc='Define a routing key' />
- <param name='RCONTEXT' doc='Routing context number' />
- <param name='DPC' doc='Destination Point Code' />
- <param name='si' doc='Match on Service Indicator' />
- <param name='aal2' doc='ATM Adaption Layer 2' />
- <param name='bicc' doc='Bearer Independent Call Control' />
- <param name='b-isup' doc='Broadband ISDN User Part' />
- <param name='h248' doc='H.248' />
- <param name='isup' doc='ISDN User Part' />
- <param name='sat-isup' doc='Sattelite ISDN User Part' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='tup' doc='Telephony User Part' />
- </params>
- </command>
- <command id='routing-key RCONTEXT DPC ssn SSN'>
- <params>
- <param name='routing-key' doc='Define a routing key' />
- <param name='RCONTEXT' doc='Routing context number' />
- <param name='DPC' doc='Destination Point Code' />
- <param name='ssn' doc='Match on Sub-System Number' />
- <param name='SSN' doc='Sub-System Number to match on' />
- </params>
- </command>
- <command id='routing-key RCONTEXT DPC si (aal2|bicc|b-isup|h248|isup|sat-isup|sccp|tup) ssn SSN'>
- <params>
- <param name='routing-key' doc='Define a routing key' />
- <param name='RCONTEXT' doc='Routing context number' />
- <param name='DPC' doc='Destination Point Code' />
- <param name='si' doc='Match on Service Indicator' />
- <param name='aal2' doc='ATM Adaption Layer 2' />
- <param name='bicc' doc='Bearer Independent Call Control' />
- <param name='b-isup' doc='Broadband ISDN User Part' />
- <param name='h248' doc='H.248' />
- <param name='isup' doc='ISDN User Part' />
- <param name='sat-isup' doc='Sattelite ISDN User Part' />
- <param name='sccp' doc='Signalling Connection Control Part' />
- <param name='tup' doc='Telephony User Part' />
- <param name='ssn' doc='Match on Sub-System Number' />
- <param name='SSN' doc='Sub-System Number to match on' />
- </params>
- </command>
- <command id='point-code override dpc PC'>
- <params>
- <param name='point-code' doc='Point Code Specific Features' />
- <param name='override' doc='Override (force) a point-code to hard-coded value' />
- <param name='dpc' doc='Override Source Point Code' />
- <param name='PC' doc='Override Destination Point Code' />
- </params>
- </command>
- </node>
- <node id='config-cs7-asp'>
- <name>config-cs7-asp</name>
- <command id='description .TEXT'>
- <params>
- <param name='description' doc='Save human-readable description of the object' />
- <param name='.TEXT' doc='Text until the end of the line' />
- </params>
- </command>
- <command id='remote-ip A.B.C.D'>
- <params>
- <param name='remote-ip' doc='Specify Remote IP Address of ASP' />
- <param name='A.B.C.D' doc='Remote IP Address of ASP' />
- </params>
- </command>
- <command id='local-ip A.B.C.D'>
- <params>
- <param name='local-ip' doc='Specify Local IP Address from which to contact ASP' />
- <param name='A.B.C.D' doc='Local IP Address from which to contact of ASP' />
- </params>
- </command>
- <command id='qos-class &lt;0-255&gt;'>
- <params>
- <param name='qos-class' doc='Specify QoS Class of ASP' />
- <param name='&lt;0-255&gt;' doc='QoS Class of ASP' />
- </params>
- </command>
- <command id='block'>
- <params>
- <param name='block' doc='Allows a SCTP Association with ASP, but doesn&apos;t let it become active' />
- </params>
- </command>
- <command id='shutdown'>
- <params>
- <param name='shutdown' doc='Terminates SCTP association; New associations will be rejected' />
- </params>
- </command>
- </node>
- <node id='config-cs7-sccpaddr'>
- <name>config-cs7-sccpaddr</name>
- <command id='no point-code'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='point-code' doc='Remove point-code Number' />
- </params>
- </command>
- <command id='no subsystem-number'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='subsystem-number' doc='Remove Subsystem Number' />
- </params>
- </command>
- <command id='no global-title'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='global-title' doc='Remove Global Title' />
- </params>
- </command>
- <command id='routing-indicator (GT|PC|IP)'>
- <params>
- <param name='routing-indicator' doc='Add Routing Indicator' />
- <param name='GT' doc='by global-title' />
- <param name='PC' doc='by point-code' />
- <param name='IP' doc='by ip-address' />
- </params>
- </command>
- <command id='point-code POINT_CODE'>
- <params>
- <param name='point-code' doc='Add point-code Number' />
- <param name='POINT_CODE' doc='PC' />
- </params>
- </command>
- <command id='subsystem-number &lt;0-4294967295&gt;'>
- <params>
- <param name='subsystem-number' doc='Add Subsystem Number' />
- <param name='&lt;0-4294967295&gt;' doc='SSN' />
- </params>
- </command>
- <command id='global-title'>
- <params>
- <param name='global-title' doc='Add/Modify Global Title' />
- </params>
- </command>
- </node>
- <node id='config-cs7-sccpaddr-gt'>
- <name>config-cs7-sccpaddr-gt</name>
- <command id='global-title-indicator &lt;0-15&gt;'>
- <params>
- <param name='global-title-indicator' doc='Set Global Title Indicator' />
- <param name='&lt;0-15&gt;' doc='GTI' />
- </params>
- </command>
- <command id='translation-type &lt;0-255&gt;'>
- <params>
- <param name='translation-type' doc='Set Global Title Translation Type' />
- <param name='&lt;0-255&gt;' doc='TT' />
- </params>
- </command>
- <command id='numbering-plan-indicator &lt;0-15&gt;'>
- <params>
- <param name='numbering-plan-indicator' doc='Set Global Title Numbering Plan Indicator' />
- <param name='&lt;0-15&gt;' doc='NPI' />
- </params>
- </command>
- <command id='nature-of-address-indicator &lt;0-127&gt;'>
- <params>
- <param name='nature-of-address-indicator' doc='Set Global Title Nature of Address Indicator' />
- <param name='&lt;0-127&gt;' doc='NAI' />
- </params>
- </command>
- <command id='digits DIGITS'>
- <params>
- <param name='digits' doc='Set Global Title Digits' />
- <param name='DIGITS' doc='Number digits' />
- </params>
- </command>
- </node>
- <node id='config-sgsn'>
- <name>config-sgsn</name>
- <command id='gtp local-ip A.B.C.D'>
- <params>
- <param name='gtp' doc='GTP Parameters' />
- <param name='local-ip' doc='Set the IP address for the local GTP bind for the Gp interface (towards the GGSNs). Note: in case you would like to run the GGSN on the same machine as the SGSN, you can not run both on the same IP address, since both sides are specified to use the same GTP port numbers (2123 and 2152). For example, you could use 127.0.0.1 for the SGSN and 127.0.0.2 for the GGSN in such situations.' />
- <param name='A.B.C.D' doc='IPv4 Address' />
- </params>
- </command>
- <command id='ggsn &lt;0-255&gt; remote-ip A.B.C.D'>
- <params>
- <param name='ggsn' doc='Configure the GGSN information' />
- <param name='&lt;0-255&gt;' doc='GGSN Number' />
- <param name='remote-ip' doc='Configure this static GGSN to use the specified remote IP address.' />
- <param name='A.B.C.D' doc='IPv4 Address' />
- </params>
- </command>
- <command id='ggsn &lt;0-255&gt; gtp-version (0|1)'>
- <params>
- <param name='ggsn' doc='Configure the GGSN information' />
- <param name='&lt;0-255&gt;' doc='GGSN Number' />
- <param name='gtp-version' doc='GTP Version' />
- <param name='0' doc='Version 0' />
- <param name='1' doc='Version 1' />
- </params>
- </command>
- <command id='ggsn &lt;0-255&gt; echo-interval &lt;1-36000&gt;'>
- <params>
- <param name='ggsn' doc='Configure the GGSN information' />
- <param name='&lt;0-255&gt;' doc='GGSN Number' />
- <param name='echo-interval' doc='Send an echo request to this static GGSN every interval.' />
- <param name='&lt;1-36000&gt;' doc='Interval between echo requests in seconds.' />
- </params>
- </command>
- <command id='ggsn &lt;0-255&gt; no echo-interval'>
- <params>
- <param name='ggsn' doc='Configure the GGSN information' />
- <param name='&lt;0-255&gt;' doc='GGSN Number' />
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='echo-interval' doc='Send an echo request to this static GGSN every interval.' />
- </params>
- </command>
- <command id='imsi-acl (add|del) IMSI'>
- <params>
- <param name='imsi-acl' doc='Access Control List of foreign IMSIs' />
- <param name='add' doc='Add IMSI to ACL' />
- <param name='del' doc='Remove IMSI from ACL' />
- <param name='IMSI' doc='IMSI of subscriber' />
- </params>
- </command>
- <command id='auth-policy (accept-all|closed|acl-only|remote)'>
- <params>
- <param name='auth-policy' doc='Configure the Authorization policy of the SGSN. This setting determines which subscribers are permitted to register to the network.' />
- <param name='accept-all' doc='Accept all IMSIs (DANGEROUS)' />
- <param name='closed' doc='Accept only home network subscribers or those in the ACL' />
- <param name='acl-only' doc='Accept only subscribers in the ACL' />
- <param name='remote' doc='Use remote subscription data only (HLR)' />
- </params>
- </command>
- <command id='authentication (optional|required)'>
- <params>
- <param name='authentication' doc='Whether to enforce MS authentication in GERAN (only with auth-policy remote)' />
- <param name='optional' doc='Allow MS to attach via GERAN without authentication (default and only possible value for non-remote auth-policy)' />
- <param name='required' doc='Always require authentication (only available for auth-policy remote, default with that auth-policy)' />
- </params>
- </command>
- <command id='encryption (GEA0|GEA1|GEA2|GEA3|GEA4)'>
- <params>
- <param name='encryption' doc='Set encryption algorithm for SGSN' />
- <param name='GEA0' doc='Use GEA0 (no encryption)' />
- <param name='GEA1' doc='Use GEA1' />
- <param name='GEA2' doc='Use GEA2' />
- <param name='GEA3' doc='Use GEA3' />
- <param name='GEA4' doc='Use GEA4' />
- </params>
- </command>
- <command id='gsup ipa-name NAME'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='ipa-name' doc='Set the IPA name of this SGSN' />
- <param name='NAME' doc='A unique name for this SGSN. For example: PLMN + redundancy server number: SGSN-901-70-0. This name is used for GSUP routing and must be set if more than one SGSN is connected to the network. The default is &apos;SGSN-00-00-00-00-00-00&apos;.' />
- </params>
- </command>
- <command id='gsup remote-ip A.B.C.D'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='remote-ip' doc='Set the IP address of the remote GSUP server (e.g. OsmoHLR). This setting only applies if &apos;auth-policy remote&apos; is used.' />
- <param name='A.B.C.D' doc='IPv4 Address' />
- </params>
- </command>
- <command id='gsup remote-port &lt;0-65535&gt;'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='remote-port' doc='Set the TCP port of the remote GSUP server, see also &apos;gsup remote-ip&apos;' />
- <param name='&lt;0-65535&gt;' doc='Remote TCP port' />
- </params>
- </command>
- <command id='gsup oap-id &lt;0-65535&gt;'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='oap-id' doc='Set the OAP client ID for authentication on the GSUP protocol. This setting only applies if &apos;auth-policy remote&apos; is used.' />
- <param name='&lt;0-65535&gt;' doc='OAP client ID (0 == disabled)' />
- </params>
- </command>
- <command id='gsup oap-k K'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='oap-k' doc='Set the OAP shared secret key K for authentication on the GSUP protocol. This setting only applies if auth-policy remote is used.' />
- <param name='K' doc='K value (16 byte) hex' />
- </params>
- </command>
- <command id='gsup oap-opc OPC'>
- <params>
- <param name='gsup' doc='GSUP Parameters' />
- <param name='oap-opc' doc='Set the OAP shared secret OPC for authentication on the GSUP protocol. This setting only applies if auth-policy remote is used.' />
- <param name='OPC' doc='OPC value (16 byte) hex' />
- </params>
- </command>
- <command id='apn APNAME ggsn &lt;0-255&gt;'>
- <params>
- <param name='apn' doc='Configure the information per APN' />
- <param name='APNAME' doc='The APN gateway name optionally prefixed by &apos;*&apos; (wildcard)' />
- <param name='ggsn' doc='Select the GGSN to use for the given APN gateway prefix' />
- <param name='&lt;0-255&gt;' doc='The GGSN id' />
- </params>
- </command>
- <command id='apn APNAME imsi-prefix IMSIPRE ggsn &lt;0-255&gt;'>
- <params>
- <param name='apn' doc='Configure the information per APN' />
- <param name='APNAME' doc='The APN gateway name optionally prefixed by &apos;*&apos; (wildcard)' />
- <param name='imsi-prefix' doc='Select the GGSN to use for the given APN gateway prefix if and only if the IMSI matches the given prefix.' />
- <param name='IMSIPRE' doc='An IMSI prefix' />
- <param name='ggsn' doc='Select the GGSN to use when APN gateway and IMSI prefix match' />
- <param name='&lt;0-255&gt;' doc='The GGSN id' />
- </params>
- </command>
- <command id='access-point-name NAME'>
- <params>
- <param name='access-point-name' doc='Globally allow the given APN name for all subscribers.' />
- <param name='NAME' doc='Add this NAME to the list' />
- </params>
- </command>
- <command id='no access-point-name NAME'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='access-point-name' doc='Configure a global list of allowed APNs' />
- <param name='NAME' doc='Remove entry with NAME' />
- </params>
- </command>
- <command id='cdr filename NAME'>
- <params>
- <param name='cdr' doc='CDR' />
- <param name='filename' doc='Set the file name for the call-data-record file, logging the data usage of each subscriber.' />
- <param name='NAME' doc='filename' />
- </params>
- </command>
- <command id='no cdr filename'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='cdr' doc='CDR' />
- <param name='filename' doc='Disable saving CDR to file' />
- </params>
- </command>
- <command id='cdr trap'>
- <params>
- <param name='cdr' doc='CDR' />
- <param name='trap' doc='Enable sending CDR via TRAP CTRL messages' />
- </params>
- </command>
- <command id='no cdr trap'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='cdr' doc='CDR' />
- <param name='trap' doc='Disable sending CDR via TRAP CTRL messages' />
- </params>
- </command>
- <command id='cdr interval &lt;1-2147483647&gt;'>
- <params>
- <param name='cdr' doc='CDR' />
- <param name='interval' doc='Set the interval for the call-data-record file' />
- <param name='&lt;1-2147483647&gt;' doc='interval in seconds' />
- </params>
- </command>
- <command id='ggsn dynamic'>
- <params>
- <param name='ggsn' doc='Configure the GGSN information' />
- <param name='dynamic' doc='Enable dynamic resolving of GGSNs based on DNS resolving the APN name like in a GRX-style setup. Changing this setting requires a restart.' />
- </params>
- </command>
- <command id='grx-dns-add A.B.C.D'>
- <params>
- <param name='grx-dns-add' doc='Use the specified IP address for DNS-resolving the AP names to GGSN IP addresses' />
- <param name='A.B.C.D' doc='IPv4 address' />
- </params>
- </command>
- <command id='timer t3312 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3312' doc='Periodic RA Update timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3322 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3322' doc='Detach request -&gt; accept timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3350 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3350' doc='Waiting for ATT/RAU/TMSI_COMPL timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3360 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3360' doc='Waiting for AUTH/CIPH response timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3370 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3370' doc='Waiting for IDENTITY response timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3313 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3313' doc='Waiting for paging response timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3314 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3314' doc='Force to STANDBY on expiry timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3316 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3316' doc='AA-Ready timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3385 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3385' doc='Wait for ACT PDP CTX REQ timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3386 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3386' doc='Wait for MODIFY PDP CTX ACK timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3395 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3395' doc='Wait for DEACT PDP CTX ACK timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='timer t3397 &lt;0-65535&gt;'>
- <params>
- <param name='timer' doc='Configure GPRS Timers' />
- <param name='t3397' doc='Wait for DEACT AA PDP CTX ACK timer (s)' />
- <param name='&lt;0-65535&gt;' doc='Timer Value in seconds' />
- </params>
- </command>
- <command id='no compression rfc1144'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='compression' doc='Configure compression' />
- <param name='rfc1144' doc='disable rfc1144 TCP/IP header compression' />
- </params>
- </command>
- <command id='compression rfc1144 active slots &lt;1-256&gt;'>
- <params>
- <param name='compression' doc='Configure compression' />
- <param name='rfc1144' doc='RFC1144 Header compression scheme' />
- <param name='active' doc='Compression is actively proposed' />
- <param name='slots' doc='Number of compression state slots' />
- <param name='&lt;1-256&gt;' doc='Number of compression state slots' />
- </params>
- </command>
- <command id='compression rfc1144 passive'>
- <params>
- <param name='compression' doc='Configure compression' />
- <param name='rfc1144' doc='RFC1144 Header compression scheme' />
- <param name='passive' doc='Compression is available on request' />
- </params>
- </command>
- <command id='no compression v42bis'>
- <params>
- <param name='no' doc='Negate a command or set its defaults' />
- <param name='compression' doc='Configure compression' />
- <param name='v42bis' doc='disable V.42bis data compression' />
- </params>
- </command>
- <command id='compression v42bis active direction (ms|sgsn|both) codewords &lt;512-65535&gt; strlen &lt;6-250&gt;'>
- <params>
- <param name='compression' doc='Configure compression' />
- <param name='v42bis' doc='V.42bis data compression scheme' />
- <param name='active' doc='Compression is actively proposed' />
- <param name='direction' doc='Direction in which the compression shall be active (p0)' />
- <param name='ms' doc='Compress ms-&gt;sgsn direction only' />
- <param name='sgsn' doc='Compress sgsn-&gt;ms direction only' />
- <param name='both' doc='Both directions' />
- <param name='codewords' doc='Number of codewords (p1)' />
- <param name='&lt;512-65535&gt;' doc='Number of codewords' />
- <param name='strlen' doc='Maximum string length (p2)' />
- <param name='&lt;6-250&gt;' doc='Maximum string length' />
- </params>
- </command>
- <command id='compression v42bis passive'>
- <params>
- <param name='compression' doc='Configure compression' />
- <param name='v42bis' doc='V.42bis data compression scheme' />
- <param name='passive' doc='Compression is available on request' />
- </params>
- </command>
- <command id='cs7-instance-iu &lt;0-15&gt;'>
- <params>
- <param name='cs7-instance-iu' doc='Set SS7 to be used by the Iu-Interface.' />
- <param name='&lt;0-15&gt;' doc='SS7 instance reference number (default: 0)' />
- </params>
- </command>
- <command id='iu rab-assign-addr-enc (x213|v4raw)'>
- <params>
- <param name='iu' doc='Iu interface protocol options' />
- <param name='rab-assign-addr-enc' doc='Choose RAB Assignment&apos;s Transport Layer Address encoding' />
- <param name='x213' doc='ITU-T X.213 compliant address encoding (default)' />
- <param name='v4raw' doc='32bit length raw IPv4 address (for ip.access nano3G)' />
- </params>
- </command>
- <command id='asn1 debug (1|0)'>
- <params>
- <param name='asn1' doc='ASN.1 settings' />
- <param name='debug' doc='Enable ASN.1 debug messages' />
- <param name='1' doc='Log ASN.1 debug messages to stderr' />
- <param name='0' doc='Do not log ASN.1 debug messages to stderr' />
- </params>
- </command>
- <command id='asn1 xer-print (1|0)'>
- <params>
- <param name='asn1' doc='ASN.1 settings' />
- <param name='xer-print' doc='Log human readable representations of all ASN.1 messages to stderr' />
- <param name='1' doc='Log XML representation of all ASN.1 messages to stderr' />
- <param name='0' doc='Do not log decoded ASN.1 messages to stderr' />
- </params>
- </command>
- </node>
-</vtydoc>
diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am
index 09db97a95..f5bc76a4f 100644
--- a/include/osmocom/Makefile.am
+++ b/include/osmocom/Makefile.am
@@ -1,3 +1,4 @@
SUBDIRS = \
+ gtphub \
sgsn \
$(NULL)
diff --git a/include/osmocom/gtphub/Makefile.am b/include/osmocom/gtphub/Makefile.am
new file mode 100644
index 000000000..c61dad9d4
--- /dev/null
+++ b/include/osmocom/gtphub/Makefile.am
@@ -0,0 +1,3 @@
+noinst_HEADERS = \
+ gtphub.h \
+ $(NULL)
diff --git a/include/osmocom/sgsn/gtphub.h b/include/osmocom/gtphub/gtphub.h
index 6a439b576..dbf8469bc 100644
--- a/include/osmocom/sgsn/gtphub.h
+++ b/include/osmocom/gtphub/gtphub.h
@@ -27,9 +27,7 @@
#include <osmocom/core/select.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/rate_ctr.h>
-
-#include <osmocom/sgsn/gprs_sgsn.h>
-
+#include <osmocom/gsm/apn.h>
/* support */
@@ -428,7 +426,7 @@ struct gtphub_resolved_ggsn {
/* The APN OI, the Operator Identifier, is the combined address,
* including parts of the IMSI and APN NI, and ending with ".gprs". */
- char apn_oi_str[GSM_APN_LENGTH];
+ char apn_oi_str[APN_MAXLEN+1];
/* Which address and port we resolved that to. */
struct gtphub_peer_port *peer;
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index 3fdb6b348..aa6cd0f0f 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -1,19 +1,19 @@
noinst_HEADERS = \
+ apn.h \
+ auth.h \
common.h \
crc24.h \
debug.h \
- gb_proxy.h \
- gprs_gb.h \
- gprs_gb_parse.h \
+ gprs_bssgp.h \
gprs_gmm.h \
gprs_gmm_fsm.h \
gprs_gmm_attach.h \
gprs_mm_state_gb_fsm.h \
gprs_mm_state_iu_fsm.h \
+ gprs_ns.h \
gprs_llc.h \
gprs_llc_xid.h \
gprs_ranap.h \
- gprs_sgsn.h \
gprs_sm.h \
gprs_sndcp_comp.h \
gprs_sndcp_dcomp.h \
@@ -22,8 +22,13 @@ noinst_HEADERS = \
gprs_sndcp_xid.h \
gprs_subscriber.h \
gprs_utils.h \
- gtphub.h \
+ gtp.h \
+ gtp_ggsn.h \
+ gtp_mme.h \
+ mmctx.h \
+ pdpctx.h \
sgsn.h \
+ sgsn_rim.h \
signal.h \
slhc.h \
v42bis.h \
diff --git a/include/osmocom/sgsn/apn.h b/include/osmocom/sgsn/apn.h
new file mode 100644
index 000000000..3dc7a70ca
--- /dev/null
+++ b/include/osmocom/sgsn/apn.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <osmocom/core/linuxlist.h>
+
+struct sgsn_ggsn_ctx;
+
+#define GSM_APN_LENGTH 102
+
+struct apn_ctx {
+ struct llist_head list;
+ struct sgsn_ggsn_ctx *ggsn;
+ char *name;
+ char *imsi_prefix;
+ char *description;
+};
+
+struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix);
+void sgsn_apn_ctx_free(struct apn_ctx *actx);
+struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix);
+struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix);
diff --git a/include/osmocom/sgsn/auth.h b/include/osmocom/sgsn/auth.h
new file mode 100644
index 000000000..a46fb16bb
--- /dev/null
+++ b/include/osmocom/sgsn/auth.h
@@ -0,0 +1,39 @@
+/* MS authorization and subscriber data handling */
+#pragma once
+
+#include <osmocom/core/linuxlist.h>
+
+struct sgsn_config;
+struct sgsn_instance;
+struct sgsn_mm_ctx;
+struct gsm_auth_tuple;
+
+/* Authorization/ACL handling */
+enum sgsn_auth_state {
+ SGSN_AUTH_UNKNOWN,
+ SGSN_AUTH_AUTHENTICATE,
+ SGSN_AUTH_UMTS_RESYNC,
+ SGSN_AUTH_ACCEPTED,
+ SGSN_AUTH_REJECTED
+};
+
+extern const struct value_string *sgsn_auth_state_names;
+
+void sgsn_auth_init(struct sgsn_instance *sgsn);
+/* Request authorization */
+enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mm);
+int sgsn_auth_request(struct sgsn_mm_ctx *mm);
+void sgsn_auth_update(struct sgsn_mm_ctx *mm);
+struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx,
+ unsigned key_seq);
+
+/*
+ * Authorization/ACL handling
+ */
+struct imsi_acl_entry {
+ struct llist_head list;
+ char imsi[OSMO_IMSI_BUF_SIZE];
+};
+struct imsi_acl_entry *sgsn_acl_lookup(const char *imsi, const struct sgsn_config *cfg);
+int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg);
+int sgsn_acl_del(const char *imsi, struct sgsn_config *cfg);
diff --git a/include/osmocom/sgsn/crc24.h b/include/osmocom/sgsn/crc24.h
index 756638c03..c913eaf76 100644
--- a/include/osmocom/sgsn/crc24.h
+++ b/include/osmocom/sgsn/crc24.h
@@ -5,6 +5,6 @@
#define INIT_CRC24 0xffffff
-uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len);
+uint32_t crc24_calc(uint32_t fcs, const uint8_t *cp, unsigned int len);
#endif
diff --git a/include/osmocom/sgsn/debug.h b/include/osmocom/sgsn/debug.h
index 29d500da7..80c5d9fc6 100644
--- a/include/osmocom/sgsn/debug.h
+++ b/include/osmocom/sgsn/debug.h
@@ -8,38 +8,25 @@
/* Debug Areas of the code */
enum {
- DRLL,
- DCC,
DMM,
- DRR,
- DRSL,
- DNM,
- DMNCC,
DPAG,
DMEAS,
- DSCCP,
- DMSC,
- DHO,
- DDB,
DREF,
DGPRS,
- DNS,
- DBSSGP,
DLLC,
DSNDCP,
DSLHC,
- DNAT,
DCTRL,
DFILTER,
DGTPHUB,
DRANAP,
DSUA,
DV42BIS,
- DPCU,
- DVLR,
DIUCS,
DSIGTRAN,
DGTP,
+ DOBJ,
+ DRIM,
Debug_LastEntry,
};
diff --git a/include/osmocom/sgsn/gb_proxy.h b/include/osmocom/sgsn/gb_proxy.h
deleted file mode 100644
index 1e8fb253c..000000000
--- a/include/osmocom/sgsn/gb_proxy.h
+++ /dev/null
@@ -1,334 +0,0 @@
-#ifndef _GB_PROXY_H
-#define _GB_PROXY_H
-
-
-#include <osmocom/core/msgb.h>
-#include <osmocom/gsm/gsm23003.h>
-
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/vty/command.h>
-
-#include <sys/types.h>
-#include <regex.h>
-#include <stdbool.h>
-
-#define GBPROXY_INIT_VU_GEN_TX 256
-
-struct rate_ctr_group;
-struct gprs_gb_parse_context;
-struct tlv_parsed;
-
-enum gbproxy_global_ctr {
- GBPROX_GLOB_CTR_INV_BVCI,
- GBPROX_GLOB_CTR_INV_LAI,
- GBPROX_GLOB_CTR_INV_RAI,
- GBPROX_GLOB_CTR_INV_NSEI,
- GBPROX_GLOB_CTR_PROTO_ERR_BSS,
- GBPROX_GLOB_CTR_PROTO_ERR_SGSN,
- GBPROX_GLOB_CTR_NOT_SUPPORTED_BSS,
- GBPROX_GLOB_CTR_NOT_SUPPORTED_SGSN,
- GBPROX_GLOB_CTR_RESTART_RESET_SGSN,
- GBPROX_GLOB_CTR_TX_ERR_SGSN,
- GBPROX_GLOB_CTR_OTHER_ERR,
- GBPROX_GLOB_CTR_PATCH_PEER_ERR,
-};
-
-enum gbproxy_peer_ctr {
- GBPROX_PEER_CTR_BLOCKED,
- GBPROX_PEER_CTR_UNBLOCKED,
- GBPROX_PEER_CTR_DROPPED,
- GBPROX_PEER_CTR_INV_NSEI,
- GBPROX_PEER_CTR_TX_ERR,
- GBPROX_PEER_CTR_RAID_PATCHED_BSS,
- GBPROX_PEER_CTR_RAID_PATCHED_SGSN,
- GBPROX_PEER_CTR_APN_PATCHED,
- GBPROX_PEER_CTR_TLLI_PATCHED_BSS,
- GBPROX_PEER_CTR_TLLI_PATCHED_SGSN,
- GBPROX_PEER_CTR_PTMSI_PATCHED_BSS,
- GBPROX_PEER_CTR_PTMSI_PATCHED_SGSN,
- GBPROX_PEER_CTR_PATCH_CRYPT_ERR,
- GBPROX_PEER_CTR_PATCH_ERR,
- GBPROX_PEER_CTR_ATTACH_REQS,
- GBPROX_PEER_CTR_ATTACH_REJS,
- GBPROX_PEER_CTR_ATTACH_ACKS,
- GBPROX_PEER_CTR_ATTACH_COMPLS,
- GBPROX_PEER_CTR_RA_UPD_REQS,
- GBPROX_PEER_CTR_RA_UPD_REJS,
- GBPROX_PEER_CTR_RA_UPD_ACKS,
- GBPROX_PEER_CTR_RA_UPD_COMPLS,
- GBPROX_PEER_CTR_GMM_STATUS_BSS,
- GBPROX_PEER_CTR_GMM_STATUS_SGSN,
- GBPROX_PEER_CTR_DETACH_REQS,
- GBPROX_PEER_CTR_DETACH_ACKS,
- GBPROX_PEER_CTR_PDP_ACT_REQS,
- GBPROX_PEER_CTR_PDP_ACT_REJS,
- GBPROX_PEER_CTR_PDP_ACT_ACKS,
- GBPROX_PEER_CTR_PDP_DEACT_REQS,
- GBPROX_PEER_CTR_PDP_DEACT_ACKS,
- GBPROX_PEER_CTR_TLLI_UNKNOWN,
- GBPROX_PEER_CTR_TLLI_CACHE_SIZE,
- GBPROX_PEER_CTR_LAST,
-};
-
-enum gbproxy_keep_mode {
- GBPROX_KEEP_NEVER, /* don't ever keep TLLI/IMSI state of de-registered subscribers */
- GBPROX_KEEP_REATTACH, /* keep if re-attach has been requested by SGSN */
- GBPROX_KEEP_IDENTIFIED, /* keep if we had resolved an IMSI */
- GBPROX_KEEP_ALWAYS, /* always keep */
-};
-
-enum gbproxy_match_id {
- GBPROX_MATCH_PATCHING, /* match rule on whether or not we should patch */
- GBPROX_MATCH_ROUTING, /* match rule on whether or not we should route (2-SGSN) */
- GBPROX_MATCH_LAST
-};
-
-struct gbproxy_match {
- bool enable; /* is this match enabled? */
- char *re_str; /* regular expression (for IMSI) in string format */
- regex_t re_comp; /* compiled regular expression (for IMSI) */
-};
-
-/* global gb-proxy configuration */
-struct gbproxy_config {
- /* parsed from config file */
- uint16_t nsip_sgsn_nsei;
-
- /* NS instance of libosmogb */
- struct gprs_ns_inst *nsi;
-
- /* Linked list of all Gb peers (except SGSN) */
- struct llist_head bts_peers;
-
- /* Counter */
- struct rate_ctr_group *ctrg;
-
- /* MCC/MNC to be patched into RA-ID on the way from BSS to SGSN? */
- struct osmo_plmn_id core_plmn;
-
- /* APN to be patched into PDP CTX ACT REQ on the way from BSS to SGSN */
- uint8_t* core_apn;
- size_t core_apn_size;
-
- /* Frequency (sec) at which timer to clean stale links is fired (0 disabled) */
- unsigned int clean_stale_timer_freq;
- /* If !0, Max age to consider a struct gbproxy_link_info as stale */
- int tlli_max_age;
- /* If !0, Max len of gbproxy_peer->list (list of struct gbproxy_link_info) */
- int tlli_max_len;
- /* If !0, Max len of gbproxy_link_info->stored_msgs (list of msgb) */
- uint32_t stored_msgs_max_len;
-
- /* Should the P-TMSI be patched on the fly (required for 2-SGSN config) */
- bool patch_ptmsi;
- /* Should the IMSI be acquired by the proxy (required for 2-SGSN config) */
- bool acquire_imsi;
- /* Should we route subscribers to two different SGSNs? */
- bool route_to_sgsn2;
- /* NSEI of the second SGSN */
- uint16_t nsip_sgsn2_nsei;
- /* should we keep a cache of per-subscriber state even after de-registration? */
- enum gbproxy_keep_mode keep_link_infos;
-
- /* IMSI checking/matching for 2-SGSN routing and patching */
- struct gbproxy_match matches[GBPROX_MATCH_LAST];
-};
-
-struct gbproxy_patch_state {
- struct osmo_plmn_id local_plmn;
-
- /* List of TLLIs for which patching is enabled */
- struct llist_head logical_links;
- int logical_link_count;
-};
-
-/* one peer at NS level that we interact with (BSS/PCU) */
-struct gbproxy_peer {
- /* linked to gbproxy_config.bts_peers */
- struct llist_head list;
-
- /* point back to the config */
- struct gbproxy_config *cfg;
-
- /* NSEI of the peer entity */
- uint16_t nsei;
-
- /* BVCI used for Point-to-Point to this peer */
- uint16_t bvci;
- bool blocked;
-
- /* Routeing Area that this peer is part of (raw 04.08 encoding) */
- uint8_t ra[6];
-
- /* Counter */
- struct rate_ctr_group *ctrg;
-
- /* State related to on-the-fly patching of certain messages */
- struct gbproxy_patch_state patch_state;
-
- /* Fired periodically to clean up stale links from list */
- struct osmo_timer_list clean_stale_timer;
-};
-
-struct gbproxy_tlli_state {
- /* currently active TLLI */
- uint32_t current;
- /* newly-assigned TLLI (e.g. during P-TMSI allocation procedure) */
- uint32_t assigned;
- /* has the BSS side validated (confirmed) the new TLLI? */
- bool bss_validated;
- /* has the SGSN side validated (confirmed) the new TLLI? */
- bool net_validated;
- /* NOTE: once both are validated, we set current = assigned and assigned = 0 */
-
- /* The P-TMSI for this subscriber */
- uint32_t ptmsi;
-};
-
-/* One TLLI (= UE, = Subscriber) served via this proxy */
-struct gbproxy_link_info {
- /* link to gbproxy_peer.patch_state.logical_links */
- struct llist_head list;
-
- /* TLLI on the BSS/PCU side */
- struct gbproxy_tlli_state tlli;
- /* TLLI on the SGSN side (can be different in case of P-TMSI patching) */
- struct gbproxy_tlli_state sgsn_tlli;
- /* NSEI of the SGSN serving this link */
- uint32_t sgsn_nsei;
-
- /* timestamp when we last had any contact with this UE */
- time_t timestamp;
-
- /* IMSI of the subscriber (if/once known) */
- uint8_t *imsi;
- size_t imsi_len;
-
- /* is the IMSI acquisition still pending? */
- bool imsi_acq_pending;
-
- /* queue of stored UL messages (until IMSI acquisition completes and we can
- * determine which of the SGSNs we should route this to */
- struct llist_head stored_msgs;
- uint32_t stored_msgs_len;
-
- /* generated N(U) we use (required due to IMSI acquisition */
- unsigned vu_gen_tx_bss;
-
- /* is this subscriber deregistered (TLLI invalidated)? */
- bool is_deregistered;
-
- /* does this link match either the (2-SGSN) routing or the patching rule? */
- bool is_matching[GBPROX_MATCH_LAST];
-};
-
-
-/* gb_proxy_vty .c */
-
-int gbproxy_vty_init(void);
-int gbproxy_parse_config(const char *config_file, struct gbproxy_config *cfg);
-
-/* gb_proxy_ctrl.c */
-int gb_ctrl_cmds_install(void);
-
-
-/* gb_proxy.c */
-int gbproxy_init_config(struct gbproxy_config *cfg);
-
-/* Main input function for Gb proxy */
-int gbprox_rcvmsg(struct gbproxy_config *cfg, struct msgb *msg, uint16_t nsei, uint16_t ns_bvci, uint16_t nsvci);
-
-int gbprox_signal(unsigned int subsys, unsigned int signal,
- void *handler_data, void *signal_data);
-
-/* Reset all persistent NS-VC's */
-int gbprox_reset_persistent_nsvcs(struct gprs_ns_inst *nsi);
-
-void gbprox_reset(struct gbproxy_config *cfg);
-
-/* TLLI info handling */
-void gbproxy_delete_link_infos(struct gbproxy_peer *peer);
-struct gbproxy_link_info *gbproxy_update_link_state_ul(
- struct gbproxy_peer *peer, time_t now,
- struct gprs_gb_parse_context *parse_ctx);
-struct gbproxy_link_info *gbproxy_update_link_state_dl(
- struct gbproxy_peer *peer, time_t now,
- struct gprs_gb_parse_context *parse_ctx);
-int gbproxy_update_link_state_after(
- struct gbproxy_peer *peer, struct gbproxy_link_info *link_info,
- time_t now, struct gprs_gb_parse_context *parse_ctx);
-int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now);
-void gbproxy_delete_link_info(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info);
-void gbproxy_link_info_discard_messages(struct gbproxy_link_info *link_info);
-
-void gbproxy_attach_link_info(struct gbproxy_peer *peer, time_t now,
- struct gbproxy_link_info *link_info);
-void gbproxy_update_link_info(struct gbproxy_link_info *link_info,
- const uint8_t *imsi, size_t imsi_len);
-void gbproxy_detach_link_info(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info);
-struct gbproxy_link_info *gbproxy_link_info_alloc( struct gbproxy_peer *peer);
-
-struct gbproxy_link_info *gbproxy_link_info_by_tlli(
- struct gbproxy_peer *peer, uint32_t tlli);
-struct gbproxy_link_info *gbproxy_link_info_by_imsi(
- struct gbproxy_peer *peer, const uint8_t *imsi, size_t imsi_len);
-struct gbproxy_link_info *gbproxy_link_info_by_any_sgsn_tlli(
- struct gbproxy_peer *peer, uint32_t tlli);
-struct gbproxy_link_info *gbproxy_link_info_by_sgsn_tlli(
- struct gbproxy_peer *peer,
- uint32_t tlli, uint32_t sgsn_nsei);
-struct gbproxy_link_info *gbproxy_link_info_by_ptmsi(
- struct gbproxy_peer *peer,
- uint32_t ptmsi);
-
-int gbproxy_imsi_matches(
- struct gbproxy_config *cfg,
- enum gbproxy_match_id match_id,
- struct gbproxy_link_info *link_info);
-uint32_t gbproxy_map_tlli(
- uint32_t other_tlli, struct gbproxy_link_info *link_info, int to_bss);
-
-/* needed by gb_proxy_tlli.h */
-uint32_t gbproxy_make_bss_ptmsi(struct gbproxy_peer *peer, uint32_t sgsn_ptmsi);
-uint32_t gbproxy_make_sgsn_tlli(
- struct gbproxy_peer *peer, struct gbproxy_link_info *link_info,
- uint32_t bss_tlli);
-void gbproxy_reset_link(struct gbproxy_link_info *link_info);
-int gbproxy_check_imsi(
- struct gbproxy_match *match, const uint8_t *imsi, size_t imsi_len);
-
-/* Message patching */
-void gbproxy_patch_bssgp(
- struct msgb *msg, uint8_t *bssgp, size_t bssgp_len,
- struct gbproxy_peer *peer, struct gbproxy_link_info *link_info,
- int *len_change, struct gprs_gb_parse_context *parse_ctx);
-
-int gbproxy_patch_llc(
- struct msgb *msg, uint8_t *llc, size_t llc_len,
- struct gbproxy_peer *peer, struct gbproxy_link_info *link_info,
- int *len_change, struct gprs_gb_parse_context *parse_ctx);
-
-int gbproxy_set_patch_filter(
- struct gbproxy_match *match, const char *filter, const char **err_msg);
-void gbproxy_clear_patch_filter(struct gbproxy_match *match);
-
-/* Peer handling */
-struct gbproxy_peer *gbproxy_peer_by_bvci(
- struct gbproxy_config *cfg, uint16_t bvci);
-struct gbproxy_peer *gbproxy_peer_by_nsei(
- struct gbproxy_config *cfg, uint16_t nsei);
-struct gbproxy_peer *gbproxy_peer_by_rai(
- struct gbproxy_config *cfg, const uint8_t *ra);
-struct gbproxy_peer *gbproxy_peer_by_lai(
- struct gbproxy_config *cfg, const uint8_t *la);
-struct gbproxy_peer *gbproxy_peer_by_lac(
- struct gbproxy_config *cfg, const uint8_t *la);
-struct gbproxy_peer *gbproxy_peer_by_bssgp_tlv(
- struct gbproxy_config *cfg, struct tlv_parsed *tp);
-struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvci);
-void gbproxy_peer_free(struct gbproxy_peer *peer);
-int gbproxy_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvci);
-
-#endif
diff --git a/include/osmocom/sgsn/gprs_bssgp.h b/include/osmocom/sgsn/gprs_bssgp.h
new file mode 100644
index 000000000..0feaa9762
--- /dev/null
+++ b/include/osmocom/sgsn/gprs_bssgp.h
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <osmocom/core/msgb.h>
+
+/* Called by bssgp layer when a prim is received from lower layers. */
+int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph);
+
+/* called by the bssgp layer to send NS PDUs */
+int sgsn_bssgp_dispatch_ns_unitdata_req_cb(void *ctx, struct msgb *msg);
+
+/* page a MS in its routing area */
+int sgsn_bssgp_page_ps_ra(struct sgsn_mm_ctx *mmctx);
diff --git a/include/osmocom/sgsn/gprs_gb.h b/include/osmocom/sgsn/gprs_gb.h
deleted file mode 100644
index 461eee319..000000000
--- a/include/osmocom/sgsn/gprs_gb.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include <stdbool.h>
-
-#include <osmocom/core/msgb.h>
-#include <osmocom/sgsn/gprs_llc.h>
-
-int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
- bool drop_cipherable);
-/* Has to be called whenever any PDU (signaling, data, ...) has been received */
-void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx);
-
-/* page a MS in its routing area */
-int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx);
diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h
index e2b17d217..71dd1fa7f 100644
--- a/include/osmocom/sgsn/gprs_gmm.h
+++ b/include/osmocom/sgsn/gprs_gmm.h
@@ -1,10 +1,14 @@
#ifndef _GPRS_GMM_H
#define _GPRS_GMM_H
+#include <stdbool.h>
+
#include <osmocom/core/msgb.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/gsm/gsm48.h>
+#include <osmocom/crypt/auth.h>
-#include <stdbool.h>
+struct sgsn_mm_ctx;
+struct gprs_llc_llme;
int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm,
const struct osmo_auth_vector *vec,
@@ -28,6 +32,11 @@ int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli);
int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
uint8_t suspend_ref);
+int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
+ bool drop_cipherable);
+/* Has to be called whenever any PDU (signaling, data, ...) has been received */
+void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg);
+
time_t gprs_max_time_to_idle(void);
int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type);
diff --git a/include/osmocom/sgsn/gprs_gmm_fsm.h b/include/osmocom/sgsn/gprs_gmm_fsm.h
index f10851e5c..2f0e81a09 100644
--- a/include/osmocom/sgsn/gprs_gmm_fsm.h
+++ b/include/osmocom/sgsn/gprs_gmm_fsm.h
@@ -1,8 +1,10 @@
#pragma once
#include <osmocom/core/fsm.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
+
+struct gprs_llc_llme;
/* 3GPP TS 24.008 § 4.1.3.3 GMM mobility management states on the network side */
enum gmm_fsm_states {
diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h
index ce0e63c51..6f0e4922f 100644
--- a/include/osmocom/sgsn/gprs_llc.h
+++ b/include/osmocom/sgsn/gprs_llc.h
@@ -1,11 +1,16 @@
-#ifndef _GPRS_LLC_H
-#define _GPRS_LLC_H
+#pragma once
#include <stdint.h>
#include <stdbool.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+
+#include <osmocom/core/timer.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/crypt/gprs_cipher.h>
+
#include <osmocom/sgsn/gprs_llc_xid.h>
+struct sgsn_mm_ctx;
+
/* Section 4.7 LLC Layer Structure */
enum gprs_llc_sapi {
GPRS_SAPI_GMM = 1,
@@ -91,6 +96,7 @@ enum gprs_llc_lle_state {
GPRS_LLES_LOCAL_REL = 6, /* Local Release */
GPRS_LLES_TIMER_REC = 7, /* Timer Recovery */
};
+extern const struct value_string gprs_llc_lle_state_names[];
enum gprs_llc_llme_state {
GPRS_LLMS_UNASSIGNED = 1, /* No TLLI yet */
@@ -272,18 +278,15 @@ static inline int gprs_llc_is_retransmit(uint16_t nu, uint16_t vur)
}
/* LLC low level functions */
-void gprs_llme_copy_key(struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme);
+void gprs_llme_copy_key(const struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme);
/* parse a GPRS LLC header, also check for invalid frames */
int gprs_llc_hdr_parse(struct gprs_llc_hdr_parsed *ghp,
uint8_t *llc_hdr, int len);
void gprs_llc_hdr_dump(struct gprs_llc_hdr_parsed *gph, struct gprs_llc_lle *lle);
-int gprs_llc_fcs(uint8_t *data, unsigned int len);
+int gprs_llc_fcs(const uint8_t *data, unsigned int len);
/* LLME handling routines */
struct llist_head *gprs_llme_list(void);
struct gprs_llc_lle *gprs_lle_get_or_create(const uint32_t tlli, uint8_t sapi);
-
-
-#endif
diff --git a/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
index e69e1e11c..4237c2f94 100644
--- a/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
+++ b/include/osmocom/sgsn/gprs_mm_state_gb_fsm.h
@@ -5,7 +5,7 @@
struct sgsn_mm_ctx;
-/* TS 23.060 6.1.1 Mobility Management States (A/Gb mode) */
+/* TS 23.060 § 6.1.1 Mobility Management States (A/Gb mode) */
enum mm_state_gb_fsm_states {
ST_MM_IDLE,
ST_MM_READY,
@@ -14,9 +14,8 @@ enum mm_state_gb_fsm_states {
enum mm_state_gb_fsm_events {
E_MM_GPRS_ATTACH,
- /* E_GPRS_DETACH, TODO: not used */
+ E_MM_GPRS_DETACH, /* MS becomes detached: due to Detach Req, RAU reject, implicit detach, etc. */
E_MM_PDU_RECEPTION,
- E_MM_IMPLICIT_DETACH, /* = E_MM_CANCEL_LOCATION */
E_MM_READY_TIMER_EXPIRY,
/* E_FORCE_TO_STANDBY, TODO: not used */
/* E_ABNSORMAL_RLC_CONDITION, TODO: not used */
diff --git a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
index 05342f9fb..6dae759b0 100644
--- a/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
+++ b/include/osmocom/sgsn/gprs_mm_state_iu_fsm.h
@@ -4,8 +4,7 @@
struct sgsn_mm_ctx;
-
-/* TS 23.060 6.1.1 Mobility Management States (A/Gb mode) */
+/* TS 23.060 § 6.1.2 Mobility Management States (Iu mode) */
enum mm_state_iu_fsm_states {
ST_PMM_DETACHED,
ST_PMM_CONNECTED,
@@ -14,12 +13,10 @@ enum mm_state_iu_fsm_states {
enum mm_state_iu_fsm_events {
E_PMM_PS_ATTACH,
- /* E_PS_DETACH, TODO: not used */
+ E_PMM_PS_DETACH, /* UE becomes detached: due to Detach Req, RAU reject, implicit detach, etc. */
E_PMM_PS_CONN_RELEASE,
E_PMM_PS_CONN_ESTABLISH,
- E_PMM_IMPLICIT_DETACH, /* = E_PS_ATTACH_REJECT, E_RAU_REJECT */
E_PMM_RA_UPDATE, /* = Serving RNC relocation */
- E_PMM_USER_INACTIVITY, /* when the inactivity timer runs out */
};
extern struct osmo_fsm mm_state_iu_fsm;
diff --git a/include/osmocom/sgsn/gprs_ns.h b/include/osmocom/sgsn/gprs_ns.h
new file mode 100644
index 000000000..235b118ec
--- /dev/null
+++ b/include/osmocom/sgsn/gprs_ns.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#include <stdbool.h>
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/sgsn/gprs_llc.h>
+
+/* called by the ns layer */
+int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
diff --git a/include/osmocom/sgsn/gprs_ranap.h b/include/osmocom/sgsn/gprs_ranap.h
index 62fdf6f2d..68f9115d7 100644
--- a/include/osmocom/sgsn/gprs_ranap.h
+++ b/include/osmocom/sgsn/gprs_ranap.h
@@ -1,13 +1,15 @@
#pragma once
#include <osmocom/core/msgb.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
#ifdef BUILD_IU
#include <osmocom/ranap/ranap_ies_defs.h>
#include <osmocom/ranap/ranap_msg_factory.h>
#include <osmocom/ranap/iu_client.h>
+struct sgsn_mm_ctx;
+struct sgsn_pdp_ctx;
+
void activate_pdp_rabs(struct sgsn_mm_ctx *ctx);
int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp);
diff --git a/include/osmocom/sgsn/gprs_sm.h b/include/osmocom/sgsn/gprs_sm.h
index 55c95b89d..78bb2d8c3 100644
--- a/include/osmocom/sgsn/gprs_sm.h
+++ b/include/osmocom/sgsn/gprs_sm.h
@@ -1,7 +1,10 @@
#pragma once
#include <osmocom/core/msgb.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+
+struct sgsn_mm_ctx;
+struct sgsn_pdp_ctx;
+struct gprs_llc_llme;
int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause, bool teardown);
int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid,
diff --git a/include/osmocom/sgsn/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h
index d970240e4..30ea05308 100644
--- a/include/osmocom/sgsn/gprs_sndcp.h
+++ b/include/osmocom/sgsn/gprs_sndcp.h
@@ -3,6 +3,9 @@
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
+#include <osmocom/gsm/gsm48.h>
+
+struct gprs_llc_lle;
/* A fragment queue header, maintaining list of fragments for one N-PDU */
struct defrag_state {
@@ -60,6 +63,8 @@ struct gprs_sndcp_entity {
extern struct llist_head gprs_sndcp_entities;
+int gprs_sndcp_vty_init(void);
+
/* Set of SNDCP-XID negotiation (See also: TS 144 065,
* Section 6.8 XID parameter negotiation) */
int sndcp_sn_xid_req(struct gprs_llc_lle *lle, uint8_t nsapi);
@@ -68,7 +73,7 @@ int sndcp_sn_xid_req(struct gprs_llc_lle *lle, uint8_t nsapi);
* Section 6.8 XID parameter negotiation) */
int sndcp_sn_xid_ind(struct gprs_llc_xid_field *xid_field_indication,
struct gprs_llc_xid_field *xid_field_response,
- struct gprs_llc_lle *lle);
+ const struct gprs_llc_lle *lle);
/* Process SNDCP-XID indication
* (See also: TS 144 065, Section 6.8 XID parameter negotiation) */
@@ -76,4 +81,21 @@ int sndcp_sn_xid_conf(struct gprs_llc_xid_field *xid_field_conf,
struct gprs_llc_xid_field *xid_field_request,
struct gprs_llc_lle *lle);
+/* Clean up all gprs_sndcp_entities related to llme (OS#4824) */
+void gprs_sndcp_sm_deactivate_ind_by_llme(const struct gprs_llc_llme *llme);
+
+/* Called by SNDCP when it has received/re-assembled a N-PDU */
+int sndcp_sn_unitdata_ind(struct gprs_sndcp_entity *sne, struct msgb *msg,
+ uint32_t npdu_len, uint8_t *npdu);
+int sndcp_sn_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi,
+ void *mmcontext);
+
+/* Entry point for the SNSM-ACTIVATE.indication */
+int sndcp_sm_activate_ind(struct gprs_llc_lle *lle, uint8_t nsapi);
+/* Entry point for the SNSM-DEACTIVATE.indication */
+int sndcp_sm_deactivate_ind(const struct gprs_llc_lle *lle, uint8_t nsapi);
+
+int sndcp_ll_unitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
+ uint8_t *hdr, uint16_t len);
+
#endif /* INT_SNDCP_H */
diff --git a/include/osmocom/sgsn/gprs_subscriber.h b/include/osmocom/sgsn/gprs_subscriber.h
index d36db7500..0d4a5947e 100644
--- a/include/osmocom/sgsn/gprs_subscriber.h
+++ b/include/osmocom/sgsn/gprs_subscriber.h
@@ -4,10 +4,70 @@
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/socket.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
+
+#include <osmocom/sgsn/apn.h>
+
+struct sgsn_instance;
+struct sgsn_mm_ctx;
extern struct llist_head * const gprs_subscribers;
+#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001
+#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16)
+#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17)
+#define GPRS_SUBSCRIBER_CANCELLED (1 << 18)
+#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19)
+
+#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \
+ GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \
+ GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \
+)
+
+struct gsm_auth_tuple {
+ int use_count;
+ int key_seq;
+ struct osmo_auth_vector vec;
+};
+#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */
+
+struct sgsn_subscriber_data {
+ struct sgsn_mm_ctx *mm;
+ struct gsm_auth_tuple auth_triplets[5];
+ int auth_triplets_updated;
+ struct llist_head pdp_list;
+ int error_cause;
+
+ uint8_t msisdn[9];
+ size_t msisdn_len;
+
+ uint8_t hlr[9];
+ size_t hlr_len;
+
+ uint8_t pdp_charg[2];
+ bool has_pdp_charg;
+};
+
+/* see GSM 09.02, 17.7.1, PDP-Context and GPRSSubscriptionData */
+/* see GSM 09.02, B.1, gprsSubscriptionData */
+struct sgsn_subscriber_pdp_data {
+ struct llist_head list;
+
+ unsigned int context_id;
+ enum gsm48_pdp_type_org pdp_type_org;
+ enum gsm48_pdp_type_nr pdp_type_nr;
+ struct osmo_sockaddr pdp_address[2];
+ char apn_str[GSM_APN_LENGTH];
+ uint8_t qos_subscribed[20];
+ size_t qos_subscribed_len;
+ uint8_t pdp_charg[2];
+ bool has_pdp_charg;
+};
+
+struct sgsn_subscriber_pdp_data *sgsn_subscriber_pdp_data_alloc(struct sgsn_subscriber_data *sdata);
+
struct gprs_subscr {
struct llist_head entry;
int use_count;
@@ -29,3 +89,22 @@ struct gprs_subscr *_gprs_subscr_put(struct gprs_subscr *gsub,
const char *file, int line);
#define gprs_subscr_get(gsub) _gprs_subscr_get(gsub, __FILE__, __LINE__)
#define gprs_subscr_put(gsub) _gprs_subscr_put(gsub, __FILE__, __LINE__)
+
+int gprs_subscr_init(struct sgsn_instance *sgi);
+int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx);
+int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx,
+ const uint8_t *auts,
+ const uint8_t *auts_rand);
+void gprs_subscr_cleanup(struct gprs_subscr *subscr);
+struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi);
+struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx(struct sgsn_mm_ctx *mmctx);
+struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi);
+void gprs_subscr_cancel(struct gprs_subscr *subscr);
+void gprs_subscr_update(struct gprs_subscr *subscr);
+void gprs_subscr_update_auth_info(struct gprs_subscr *subscr);
+int gprs_subscr_rx_gsup_message(struct msgb *msg);
+
+#define LOGGSUBSCRP(level, subscr, fmt, args...) \
+ LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \
+ (subscr) ? (subscr)->imsi : "---", \
+ ## args)
diff --git a/include/osmocom/sgsn/gprs_utils.h b/include/osmocom/sgsn/gprs_utils.h
index eacaec7a2..1e6c8319c 100644
--- a/include/osmocom/sgsn/gprs_utils.h
+++ b/include/osmocom/sgsn/gprs_utils.h
@@ -29,15 +29,11 @@
struct msgb;
struct gprs_ra_id;
-int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str);
-
/* GSM 04.08, 10.5.7.3 GPRS Timer */
-int gprs_tmr_to_secs(uint8_t tmr);
uint8_t gprs_secs_to_tmr_floor(int secs);
int gprs_is_mi_tmsi(const uint8_t *value, size_t value_len);
int gprs_is_mi_imsi(const uint8_t *value, size_t value_len);
-int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi);
void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi);
int gprs_ra_id_equals(const struct gprs_ra_id *id1, const struct gprs_ra_id *id2);
diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h
new file mode 100644
index 000000000..2aec55333
--- /dev/null
+++ b/include/osmocom/sgsn/gtp.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/gprs/gprs_bssgp_rim.h>
+
+struct gprs_ra_id;
+struct sgsn_instance;
+struct sgsn_ggsn_ctx;
+struct sgsn_pdp_ctx;
+struct sgsn_mm_ctx;
+struct sgsn_mme_ctx;
+
+int sgsn_gtp_init(struct sgsn_instance *sgi);
+
+int sgsn_mme_ran_info_req(struct sgsn_mme_ctx *mme, const struct bssgp_ran_information_pdu *pdu);
+
+void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc);
+struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
+ struct sgsn_mm_ctx *mmctx,
+ uint16_t nsapi,
+ struct tlv_parsed *tp);
+
+int sgsn_gtp_data_req(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
+ struct msgb *msg, uint32_t npdu_len, uint8_t *npdu);
+int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
+void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen);
+int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx);
diff --git a/include/osmocom/sgsn/gtp_ggsn.h b/include/osmocom/sgsn/gtp_ggsn.h
new file mode 100644
index 000000000..6afb8664a
--- /dev/null
+++ b/include/osmocom/sgsn/gtp_ggsn.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <stdint.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/gprs/protocol/gsm_24_301.h>
+
+struct gsn_t;
+struct sgsn_pdp_ctx;
+struct sgsn_instance;
+
+struct sgsn_ggsn_ctx {
+ struct llist_head list;
+ uint32_t id;
+ unsigned int gtp_version;
+ struct in_addr remote_addr;
+ int remote_restart_ctr;
+ struct gsn_t *gsn;
+ struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */
+ struct osmo_timer_list echo_timer;
+ unsigned int echo_interval;
+};
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(struct sgsn_instance *sgsn, uint32_t id);
+void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(struct sgsn_instance *sgsn, uint32_t id);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct sgsn_instance *sgsn, struct in_addr *addr);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(struct sgsn_instance *sgsn, uint32_t id);
+void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx);
+int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except);
+int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
+void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
+void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
+void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc);
+
+#define LOGGGSN(ggc, level, fmt, args...) { \
+ char _buf[INET_ADDRSTRLEN]; \
+ LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, (ggc)->id, inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \
+ } while (0)
diff --git a/include/osmocom/sgsn/gtp_mme.h b/include/osmocom/sgsn/gtp_mme.h
new file mode 100644
index 000000000..ceea4051b
--- /dev/null
+++ b/include/osmocom/sgsn/gtp_mme.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <netinet/in.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/gprs/protocol/gsm_24_301.h>
+
+struct gsn_t;
+
+struct mme_rim_route {
+ struct llist_head list; /* item in struct sgsn_mme_ctx */
+ struct osmo_eutran_tai tai;
+};
+
+struct sgsn_mme_ctx {
+ struct llist_head list; /* item in sgsn_mme_ctxts */
+ struct llist_head routes; /* list of struct mme_rim_route */
+ struct sgsn_instance *sgsn; /* backpointer */
+ char *name;
+ struct in_addr remote_addr;
+
+ /* is it the default route for outgoing message? are all incoming messages accepted? */
+ bool default_route;
+};
+struct sgsn_mme_ctx *sgsn_mme_ctx_alloc(struct sgsn_instance *sgsn, const char *name);
+struct sgsn_mme_ctx *sgsn_mme_ctx_find_alloc(struct sgsn_instance *sgsn, const char *name);
+void sgsn_mme_ctx_free(struct sgsn_mme_ctx *mme);
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_name(const struct sgsn_instance *sgsn, const char *name);
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_addr(const struct sgsn_instance *sgsn, const struct in_addr *addr);
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_route(const struct sgsn_instance *sgsn, const struct osmo_eutran_tai *tai);
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_default_route(const struct sgsn_instance *sgsn);
+
+void sgsn_mme_ctx_route_add(struct sgsn_mme_ctx *mme, const struct osmo_eutran_tai *tai);
+void sgsn_mme_ctx_route_del(struct sgsn_mme_ctx *mme, const struct osmo_eutran_tai *tai);
+
+#define LOGMME(mme, cat, level, fmt, args...) { \
+ char _buf[INET_ADDRSTRLEN]; \
+ LOGP(cat, level, "MME(%s:%s): " fmt, (mme)->name, inet_ntop(AF_INET, &(mme)->remote_addr, _buf, sizeof(_buf)), ## args); \
+ } while (0)
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/mmctx.h
index 289e0c474..c19f599c5 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/mmctx.h
@@ -1,5 +1,4 @@
-#ifndef _GPRS_SGSN_H
-#define _GPRS_SGSN_H
+#pragma once
#include <stdint.h>
#include <netinet/in.h>
@@ -14,12 +13,17 @@
#include <osmocom/gsm/protocol/gsm_23_003.h>
#include <osmocom/crypt/auth.h>
+#include <osmocom/sgsn/apn.h>
+#include <osmocom/sgsn/auth.h>
+#include <osmocom/sgsn/gprs_subscriber.h>
+
#define GSM_EXTENSION_LENGTH 15
-#define GSM_APN_LENGTH 102
struct gprs_llc_lle;
struct ctrl_handle;
struct gprs_subscr;
+struct sgsn_ggsn_ctx;
+struct sgsn_pdp_ctx;
enum gsm48_gsm_cause;
@@ -37,13 +41,6 @@ enum gprs_mm_ctr {
GMM_CTR_RA_UPDATE,
};
-enum gprs_pdp_ctx {
- PDP_CTR_PKTS_UDATA_IN,
- PDP_CTR_PKTS_UDATA_OUT,
- PDP_CTR_BYTES_UDATA_IN,
- PDP_CTR_BYTES_UDATA_OUT,
-};
-
enum gprs_t3350_mode {
GMM_T3350_MODE_NONE,
GMM_T3350_MODE_ATT,
@@ -51,17 +48,6 @@ enum gprs_t3350_mode {
GMM_T3350_MODE_PTMSI_REALL,
};
-/* Authorization/ACL handling */
-enum sgsn_auth_state {
- SGSN_AUTH_UNKNOWN,
- SGSN_AUTH_AUTHENTICATE,
- SGSN_AUTH_UMTS_RESYNC,
- SGSN_AUTH_ACCEPTED,
- SGSN_AUTH_REJECTED
-};
-
-#define MS_RADIO_ACCESS_CAPA
-
enum sgsn_ggsn_lookup_state {
SGSN_GGSN_2DIGIT,
SGSN_GGSN_3DIGIT,
@@ -104,13 +90,6 @@ struct service_info {
struct ranap_ue_conn_ctx;
-struct gsm_auth_tuple {
- int use_count;
- int key_seq;
- struct osmo_auth_vector vec;
-};
-#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */
-
/* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */
/* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */
struct sgsn_mm_ctx {
@@ -175,6 +154,7 @@ struct sgsn_mm_ctx {
/* Iu: CK, IK, KSI */
/* CKSN */
enum gprs_ciph_algo ciph_algo;
+ uint8_t ue_cipher_mask;
/* Auth & Ciphering Request reference from 3GPP TS 24.008 § 10.5.5.19: */
uint8_t ac_ref_nr_used;
@@ -294,64 +274,6 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
enum gsm48_gsm_cause *gsm_cause,
char *apn_str);
-enum pdp_ctx_state {
- PDP_STATE_NONE,
- PDP_STATE_CR_REQ,
- PDP_STATE_CR_CONF,
-
- /* 04.08 / Figure 6.2 / 6.1.2.2 */
- PDP_STATE_INACT_PEND,
- PDP_STATE_INACTIVE = PDP_STATE_NONE,
-};
-
-enum pdp_type {
- PDP_TYPE_NONE,
- PDP_TYPE_ETSI_PPP,
- PDP_TYPE_IANA_IPv4,
- PDP_TYPE_IANA_IPv6,
-};
-
-struct sgsn_pdp_ctx {
- struct llist_head list; /* list_head for mmctx->pdp_list */
- struct llist_head g_list; /* list_head for global list */
- struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */
- int destroy_ggsn; /* destroy it on destruction */
- struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */
- struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */
- struct rate_ctr_group *ctrg;
-
- //unsigned int id;
- struct pdp_t *lib; /* pointer to libgtp PDP ctx */
- enum pdp_ctx_state state;
- enum pdp_type type;
- uint32_t address;
- char *apn_subscribed;
- //char *apn_used;
- uint16_t nsapi; /* SNDCP */
- uint16_t sapi; /* LLC */
- uint8_t ti; /* transaction identifier */
- int vplmn_allowed;
- uint32_t qos_profile_subscr;
- //uint32_t qos_profile_req;
- //uint32_t qos_profile_neg;
- uint8_t radio_prio;
- //uint32_t charging_id;
-
- struct osmo_timer_list timer;
- unsigned int T; /* Txxxx number */
- unsigned int num_T_exp; /* number of consecutive T expirations */
-
- struct osmo_timer_list cdr_timer; /* CDR record wird timer */
- struct timespec cdr_start; /* The start of the CDR */
- uint64_t cdr_bytes_in;
- uint64_t cdr_bytes_out;
- uint32_t cdr_charging_id;
-};
-
-#define LOGPDPCTXP(level, pdp, fmt, args...) \
- LOGP(DGPRS, level, "PDP(%s/%u) " \
- fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args)
-
/* look up PDP context by MM context and NSAPI */
struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm,
uint8_t nsapi);
@@ -359,168 +281,7 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm,
struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm,
uint8_t tid);
-struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
- struct sgsn_ggsn_ctx *ggsn,
- uint8_t nsapi);
-void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp);
-void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp);
-
-
-struct sgsn_ggsn_ctx {
- struct llist_head list;
- uint32_t id;
- unsigned int gtp_version;
- struct in_addr remote_addr;
- int remote_restart_ctr;
- struct gsn_t *gsn;
- struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */
- struct osmo_timer_list echo_timer;
- unsigned int echo_interval;
-};
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
-void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
-void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx);
-int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except);
-int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
-void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
-void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp);
-void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc);
-
-#define LOGGGSN(ggc, level, fmt, args...) { \
- char _buf[INET_ADDRSTRLEN]; \
- LOGP(DGTP, level, "GGSN(%" PRIu32 ":%s): " fmt, (ggc)->id, inet_ntop(AF_INET, &(ggc)->remote_addr, _buf, sizeof(_buf)), ## args); \
- } while (0)
-
-struct apn_ctx {
- struct llist_head list;
- struct sgsn_ggsn_ctx *ggsn;
- char *name;
- char *imsi_prefix;
- char *description;
-};
-
-struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix);
-void sgsn_apn_ctx_free(struct apn_ctx *actx);
-struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix);
-struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi_prefix);
-
-extern struct llist_head sgsn_mm_ctxts;
-extern struct llist_head sgsn_ggsn_ctxts;
-extern struct llist_head sgsn_apn_ctxts;
-extern struct llist_head sgsn_pdp_ctxts;
-
uint32_t sgsn_alloc_ptmsi(void);
-struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx);
-void sgsn_inst_init(struct sgsn_instance *sgsn);
-
-char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len);
-
-/*
- * ctrl interface related work
- */
-int sgsn_ctrl_cmds_install(void);
-
-/*
- * Authorization/ACL handling
- */
-struct imsi_acl_entry {
- struct llist_head list;
- char imsi[OSMO_IMSI_BUF_SIZE];
-};
-
-/* see GSM 09.02, 17.7.1, PDP-Context and GPRSSubscriptionData */
-/* see GSM 09.02, B.1, gprsSubscriptionData */
-struct sgsn_subscriber_pdp_data {
- struct llist_head list;
-
- unsigned int context_id;
- uint16_t pdp_type;
- char apn_str[GSM_APN_LENGTH];
- uint8_t qos_subscribed[20];
- size_t qos_subscribed_len;
- uint8_t pdp_charg[2];
- bool has_pdp_charg;
-};
-
-struct sgsn_subscriber_data {
- struct sgsn_mm_ctx *mm;
- struct gsm_auth_tuple auth_triplets[5];
- int auth_triplets_updated;
- struct llist_head pdp_list;
- int error_cause;
-
- uint8_t msisdn[9];
- size_t msisdn_len;
-
- uint8_t hlr[9];
- size_t hlr_len;
-
- uint8_t pdp_charg[2];
- bool has_pdp_charg;
-};
-
-#define SGSN_ERROR_CAUSE_NONE (-1)
-
-#define LOGGSUBSCRP(level, subscr, fmt, args...) \
- LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \
- (subscr) ? (subscr)->imsi : "---", \
- ## args)
-
-struct sgsn_config;
-struct sgsn_instance;
-extern const struct value_string *sgsn_auth_state_names;
-
-void sgsn_auth_init(struct sgsn_instance *sgsn);
-struct imsi_acl_entry *sgsn_acl_lookup(const char *imsi, const struct sgsn_config *cfg);
-int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg);
-int sgsn_acl_del(const char *imsi, struct sgsn_config *cfg);
-/* Request authorization */
-int sgsn_auth_request(struct sgsn_mm_ctx *mm);
-enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mm);
-void sgsn_auth_update(struct sgsn_mm_ctx *mm);
-struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx,
- unsigned key_seq);
-
-/*
- * GPRS subscriber data
- */
-#define GPRS_SUBSCRIBER_FIRST_CONTACT 0x00000001
-#define GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING (1 << 16)
-#define GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING (1 << 17)
-#define GPRS_SUBSCRIBER_CANCELLED (1 << 18)
-#define GPRS_SUBSCRIBER_ENABLE_PURGE (1 << 19)
-
-#define GPRS_SUBSCRIBER_UPDATE_PENDING_MASK ( \
- GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING | \
- GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING \
-)
-
-int gprs_subscr_init(struct sgsn_instance *sgi);
-int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx);
-int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx,
- const uint8_t *auts,
- const uint8_t *auts_rand);
-int gprs_subscr_auth_sync(struct gprs_subscr *subscr,
- const uint8_t *auts, const uint8_t *auts_rand);
-void gprs_subscr_cleanup(struct gprs_subscr *subscr);
-struct gprs_subscr *gprs_subscr_get_or_create(const char *imsi);
-struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx( struct sgsn_mm_ctx *mmctx);
-struct gprs_subscr *gprs_subscr_get_by_imsi(const char *imsi);
-void gprs_subscr_cancel(struct gprs_subscr *subscr);
-void gprs_subscr_update(struct gprs_subscr *subscr);
-void gprs_subscr_update_auth_info(struct gprs_subscr *subscr);
-int gprs_subscr_rx_gsup_message(struct msgb *msg);
/* Called on subscriber data updates */
void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx);
-
-int gprs_sndcp_vty_init(void);
-struct sgsn_instance;
-int sgsn_gtp_init(struct sgsn_instance *sgi);
-
-void sgsn_rate_ctr_init();
-
-#endif /* _GPRS_SGSN_H */
diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h
new file mode 100644
index 000000000..255a77d3f
--- /dev/null
+++ b/include/osmocom/sgsn/pdpctx.h
@@ -0,0 +1,94 @@
+#pragma once
+
+#include <stdint.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+
+#include <osmocom/core/timer.h>
+#include <osmocom/core/rate_ctr.h>
+
+#include <osmocom/gsm/gsm48.h>
+
+#include <osmocom/crypt/gprs_cipher.h>
+#include <osmocom/gsm/protocol/gsm_23_003.h>
+#include <osmocom/crypt/auth.h>
+
+#include <osmocom/sgsn/apn.h>
+#include <osmocom/sgsn/gprs_subscriber.h>
+
+struct sgsn_mm_ctx;
+struct sgsn_ggsn_ctx;
+
+enum gprs_pdp_ctx {
+ PDP_CTR_PKTS_UDATA_IN,
+ PDP_CTR_PKTS_UDATA_OUT,
+ PDP_CTR_BYTES_UDATA_IN,
+ PDP_CTR_BYTES_UDATA_OUT,
+};
+
+enum pdp_ctx_state {
+ PDP_STATE_NONE,
+ PDP_STATE_CR_REQ,
+ PDP_STATE_CR_CONF,
+
+ /* 04.08 / Figure 6.2 / 6.1.2.2 */
+ PDP_STATE_INACT_PEND,
+ PDP_STATE_INACTIVE = PDP_STATE_NONE,
+};
+
+enum pdp_type {
+ PDP_TYPE_NONE,
+ PDP_TYPE_ETSI_PPP,
+ PDP_TYPE_IANA_IPv4,
+ PDP_TYPE_IANA_IPv6,
+};
+
+struct sgsn_pdp_ctx {
+ struct llist_head list; /* list_head for mmctx->pdp_list */
+ struct llist_head g_list; /* list_head for global list */
+ struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */
+ int destroy_ggsn; /* destroy it on destruction */
+ struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */
+ struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */
+ struct rate_ctr_group *ctrg;
+
+ //unsigned int id;
+ struct pdp_t *lib; /* pointer to libgtp PDP ctx */
+ enum pdp_ctx_state state;
+ enum pdp_type type;
+ uint32_t address;
+ char *apn_subscribed;
+ //char *apn_used;
+ uint16_t nsapi; /* SNDCP */
+ uint16_t sapi; /* LLC */
+ uint8_t ti; /* transaction identifier */
+ int vplmn_allowed;
+ uint32_t qos_profile_subscr;
+ //uint32_t qos_profile_req;
+ //uint32_t qos_profile_neg;
+ uint8_t radio_prio;
+ //uint32_t charging_id;
+
+ struct osmo_timer_list timer;
+ unsigned int T; /* Txxxx number */
+ unsigned int num_T_exp; /* number of consecutive T expirations */
+
+ struct osmo_timer_list cdr_timer; /* CDR record wird timer */
+ struct timespec cdr_start; /* The start of the CDR */
+ uint64_t cdr_bytes_in;
+ uint64_t cdr_bytes_out;
+ uint32_t cdr_charging_id;
+};
+
+#define LOGPDPCTXP(level, pdp, fmt, args...) \
+ LOGP(DGPRS, level, "PDP(%s/%u) " \
+ fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args)
+
+struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
+ struct sgsn_ggsn_ctx *ggsn,
+ uint8_t nsapi);
+void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp);
+void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp);
+
+char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6);
+
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index f5ff524da..6e93178af 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -3,14 +3,18 @@
#include <osmocom/core/msgb.h>
+#include <osmocom/core/select.h>
#include <osmocom/crypt/gprs_cipher.h>
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/gprs/gprs_ns2.h>
+#include <osmocom/gprs/gprs_bssgp.h>
+
+#include <osmocom/sgsn/auth.h>
+#include <osmocom/sgsn/gtp_mme.h>
#include <osmocom/gsm/oap_client.h>
#include <osmocom/gsupclient/gsup_client.h>
#include <osmocom/sgsn/common.h>
-#include "../../bscconfig.h"
+#include "../../config.h"
#if BUILD_IU
#include <osmocom/ranap/iu_client.h>
@@ -21,6 +25,8 @@
struct hostent;
+#define SGSN_ERROR_CAUSE_NONE (-1)
+
enum sgsn_auth_policy {
SGSN_AUTH_POLICY_OPEN,
SGSN_AUTH_POLICY_CLOSED,
@@ -69,10 +75,12 @@ struct sgsn_config {
struct sockaddr_in gtp_listenaddr;
/* misc */
- struct gprs_ns_inst *nsi;
+ struct gprs_ns2_inst *nsi;
+ char *crypt_cipher_plugin_path;
enum sgsn_auth_policy auth_policy;
- enum gprs_ciph_algo cipher;
+ uint8_t gea_encryption_mask;
+ uint8_t uea_encryption_mask;
struct llist_head imsi_acl;
struct sockaddr_in gsup_server_addr;
@@ -88,6 +96,7 @@ struct sgsn_config {
/* Timer defintions */
struct osmo_tdef *T_defs;
+ struct osmo_tdef *T_defs_gtp;
int dynamic_lookup;
@@ -144,9 +153,23 @@ struct sgsn_instance {
struct ares_addr_node *ares_servers;
struct rate_ctr_group *rate_ctrs;
+
+ struct llist_head apn_list; /* list of struct sgsn_apn_ctx */
+ struct llist_head ggsn_list; /* list of struct sgsn_ggsn_ctx */
+ struct llist_head mme_list; /* list of struct sgsn_mme_ctx */
+ struct llist_head mm_list; /* list of struct sgsn_mm_ctx */
+ struct llist_head pdp_list; /* list of struct sgsn_pdp_ctx */
+
+ struct ctrl_handle *ctrlh;
};
extern struct sgsn_instance *sgsn;
+extern void *tall_sgsn_ctx;
+
+/*
+ * ctrl interface related work (sgsn_ctrl.c)
+ */
+int sgsn_ctrl_cmds_install(void);
/* sgsn_vty.c */
@@ -155,39 +178,13 @@ int sgsn_parse_config(const char *config_file);
char *sgsn_gtp_ntoa(struct ul16_t *ul);
/* sgsn.c */
-
-/* Main input function for Gb proxy */
-int sgsn_rcvmsg(struct msgb *msg, struct gprs_nsvc *nsvc, uint16_t ns_bvci);
-
-/* sgsn_libgtp.c */
-struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
- struct sgsn_mm_ctx *mmctx,
- uint16_t nsapi,
- struct tlv_parsed *tp);
-int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx);
-void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen);
-void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc);
-int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx);
-
-/* gprs_sndcp.c */
-
-/* Entry point for the SNSM-ACTIVATE.indication */
-int sndcp_sm_activate_ind(struct gprs_llc_lle *lle, uint8_t nsapi);
-/* Entry point for the SNSM-DEACTIVATE.indication */
-int sndcp_sm_deactivate_ind(struct gprs_llc_lle *lle, uint8_t nsapi);
-/* Called by SNDCP when it has received/re-assembled a N-PDU */
-int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
- struct msgb *msg, uint32_t npdu_len, uint8_t *npdu);
-int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi,
- void *mmcontext);
-int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
- uint8_t *hdr, uint16_t len);
-
-
+struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx);
+int sgsn_inst_init(struct sgsn_instance *sgsn);
/*
* CDR related functionality
*/
int sgsn_cdr_init(struct sgsn_instance *sgsn);
+void sgsn_cdr_release(struct sgsn_instance *sgsn);
/*
diff --git a/include/osmocom/sgsn/sgsn_rim.h b/include/osmocom/sgsn/sgsn_rim.h
new file mode 100644
index 000000000..fc87b468e
--- /dev/null
+++ b/include/osmocom/sgsn/sgsn_rim.h
@@ -0,0 +1,6 @@
+#pragma once
+
+struct sgsn_mme_ctx;
+
+int sgsn_rim_rx_from_gb(struct osmo_bssgp_prim *bp, struct msgb *msg);
+int sgsn_rim_rx_from_gtp(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address);
diff --git a/include/osmocom/sgsn/v42bis.h b/include/osmocom/sgsn/v42bis.h
index b64c43e69..d782981b0 100644
--- a/include/osmocom/sgsn/v42bis.h
+++ b/include/osmocom/sgsn/v42bis.h
@@ -17,10 +17,6 @@
* 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.
- *
- * You should have received a copy of the GNU Lesser 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.
*/
/*! \page v42bis_page V.42bis modem data compression
diff --git a/include/osmocom/sgsn/v42bis_private.h b/include/osmocom/sgsn/v42bis_private.h
index c6b675a1b..cc7e63448 100644
--- a/include/osmocom/sgsn/v42bis_private.h
+++ b/include/osmocom/sgsn/v42bis_private.h
@@ -17,10 +17,6 @@
* 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.
- *
- * You should have received a copy of the GNU Lesser 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.
*/
#if !defined(_SPANDSP_PRIVATE_V42BIS_H_)
diff --git a/include/osmocom/sgsn/vty.h b/include/osmocom/sgsn/vty.h
index d2e3d9a73..a2732224c 100644
--- a/include/osmocom/sgsn/vty.h
+++ b/include/osmocom/sgsn/vty.h
@@ -3,7 +3,7 @@
#include <osmocom/vty/command.h>
enum bsc_vty_node {
- GBPROXY_NODE = _LAST_OSMOVTY_NODE + 1,
- SGSN_NODE,
+ SGSN_NODE = _LAST_OSMOVTY_NODE + 1,
GTPHUB_NODE,
+ MME_NODE,
};
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
deleted file mode 100644
index ca3639715..000000000
--- a/m4/ax_check_compile_flag.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
-#
-# DESCRIPTION
-#
-# Check whether the given FLAG works with the current language's compiler
-# or gives an error. (Warnings, however, are ignored)
-#
-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-# success/failure.
-#
-# If EXTRA-FLAGS is defined, it is added to the current language's default
-# flags (e.g. CFLAGS) when the check is done. The check is thus made with
-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
-# force the compiler to issue an error when a bad flag is given.
-#
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
-# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# 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/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 4
-
-AC_DEFUN([AX_CHECK_COMPILE_FLAG],
-[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
- ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
- _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
- AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
- [AS_VAR_SET(CACHEVAR,[yes])],
- [AS_VAR_SET(CACHEVAR,[no])])
- _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
-AS_VAR_IF(CACHEVAR,yes,
- [m4_default([$2], :)],
- [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/osmoappdesc.py b/osmoappdesc.py
index e91043f95..c3275978b 100644
--- a/osmoappdesc.py
+++ b/osmoappdesc.py
@@ -16,19 +16,16 @@
app_configs = {
- "gbproxy": ["doc/examples/osmo-gbproxy/osmo-gbproxy.cfg",
- "doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg"],
"sgsn": ["doc/examples/osmo-sgsn/osmo-sgsn.cfg"],
"gtphub": ["doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg"]
}
-apps = [(4246, "src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy"),
- (4245, "src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn"),
+apps = [(4245, "src/sgsn/osmo-sgsn", "OsmoSGSN", "sgsn"),
(4253, "src/gtphub/osmo-gtphub", "OsmoGTPhub", "gtphub")
]
vty_command = ["./src/sgsn/osmo-sgsn", "-c",
"doc/examples/osmo-sgsn/osmo-sgsn.cfg"]
-vty_app = apps[1]
+vty_app = apps[0]
diff --git a/src/Makefile.am b/src/Makefile.am
index c45d3ab46..e389b7f65 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,5 @@
SUBDIRS = \
gprs \
sgsn \
- gbproxy \
gtphub \
$(NULL)
diff --git a/src/gbproxy/Makefile.am b/src/gbproxy/Makefile.am
deleted file mode 100644
index 6876f68a5..000000000
--- a/src/gbproxy/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-AM_CPPFLAGS = \
- $(all_includes) \
- -I$(top_srcdir)/include \
- -I$(top_builddir) \
- $(NULL)
-
-AM_CFLAGS = \
- -Wall \
- -fno-strict-aliasing \
- $(LIBOSMOCORE_CFLAGS) \
- $(LIBOSMOGSM_CFLAGS) \
- $(LIBOSMOVTY_CFLAGS) \
- $(LIBOSMOCTRL_CFLAGS) \
- $(LIBOSMOABIS_CFLAGS) \
- $(LIBOSMOGB_CFLAGS) \
- $(LIBOSMOGSUPCLIENT_CFLAGS) \
- $(COVERAGE_CFLAGS) \
- $(LIBGTP_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = \
- osmo-gbproxy \
- $(NULL)
-
-osmo_gbproxy_SOURCES = \
- gb_proxy.c \
- gb_proxy_main.c \
- gb_proxy_vty.c \
- gb_proxy_ctrl.c \
- gb_proxy_patch.c \
- gb_proxy_tlli.c \
- gb_proxy_peer.c \
- $(NULL)
-osmo_gbproxy_LDADD = \
- $(top_builddir)/src/gprs/gprs_gb_parse.o \
- $(top_builddir)/src/gprs/gprs_llc_parse.o \
- $(top_builddir)/src/gprs/crc24.o \
- $(top_builddir)/src/gprs/gprs_utils.o \
- $(LIBOSMOCORE_LIBS) \
- $(LIBOSMOGSM_LIBS) \
- $(LIBOSMOVTY_LIBS) \
- $(LIBOSMOCTRL_LIBS) \
- $(LIBOSMOGB_LIBS) \
- $(LIBGTP_LIBS) \
- -lrt \
- $(NULL)
diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
deleted file mode 100644
index 3f471ff82..000000000
--- a/src/gbproxy/gb_proxy.c
+++ /dev/null
@@ -1,1454 +0,0 @@
-/* NS-over-IP proxy */
-
-/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010-2013 by On-Waves
- * (C) 2013 by Holger Hans Peter Freyther
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <getopt.h>
-#include <errno.h>
-#include <sys/fcntl.h>
-#include <sys/stat.h>
-#include <arpa/inet.h>
-#include <time.h>
-
-#include <osmocom/core/talloc.h>
-#include <osmocom/core/select.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/core/stats.h>
-
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/gprs/gprs_bssgp.h>
-
-#include <osmocom/gsm/gsm_utils.h>
-
-#include <osmocom/sgsn/signal.h>
-#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
-#include <osmocom/sgsn/gb_proxy.h>
-
-#include <osmocom/sgsn/gprs_llc.h>
-#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
-#include <osmocom/sgsn/gprs_utils.h>
-
-extern void *tall_sgsn_ctx;
-
-static const struct rate_ctr_desc global_ctr_description[] = {
- { "inv-bvci", "Invalid BVC Identifier " },
- { "inv-lai", "Invalid Location Area Identifier" },
- { "inv-rai", "Invalid Routing Area Identifier " },
- { "inv-nsei", "No BVC established for NSEI " },
- { "proto-err:bss", "BSSGP protocol error (BSS )" },
- { "proto-err:sgsn", "BSSGP protocol error (SGSN)" },
- { "not-supp:bss", "Feature not supported (BSS )" },
- { "not-supp:sgsn", "Feature not supported (SGSN)" },
- { "restart:sgsn", "Restarted RESET procedure (SGSN)" },
- { "tx-err:sgsn", "NS Transmission error (SGSN)" },
- { "error", "Other error " },
- { "mod-peer-err", "Patch error: no peer " },
-};
-
-static const struct rate_ctr_group_desc global_ctrg_desc = {
- .group_name_prefix = "gbproxy:global",
- .group_description = "GBProxy Global Statistics",
- .num_ctr = ARRAY_SIZE(global_ctr_description),
- .ctr_desc = global_ctr_description,
- .class_id = OSMO_STATS_CLASS_GLOBAL,
-};
-
-static int gbprox_relay2peer(struct msgb *old_msg, struct gbproxy_peer *peer,
- uint16_t ns_bvci);
-static int gbprox_relay2sgsn(struct gbproxy_config *cfg, struct msgb *old_msg,
- uint16_t ns_bvci, uint16_t sgsn_nsei);
-static void gbproxy_reset_imsi_acquisition(struct gbproxy_link_info* link_info);
-
-static int check_peer_nsei(struct gbproxy_peer *peer, uint16_t nsei)
-{
- if (peer->nsei != nsei) {
- LOGP(DGPRS, LOGL_NOTICE, "Peer entry doesn't match current NSEI "
- "BVCI=%u via NSEI=%u (expected NSEI=%u)\n",
- peer->bvci, nsei, peer->nsei);
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_INV_NSEI]);
- return 0;
- }
-
- return 1;
-}
-
-/* strip off the NS header */
-static void strip_ns_hdr(struct msgb *msg)
-{
- int strip_len = msgb_bssgph(msg) - msg->data;
- msgb_pull(msg, strip_len);
-}
-
-/* Transmit Chapter 9.2.10 Identity Request */
-static void gprs_put_identity_req(struct msgb *msg, uint8_t id_type)
-{
- struct gsm48_hdr *gh;
-
- id_type &= GSM_MI_TYPE_MASK;
-
- gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
- gh->proto_discr = GSM48_PDISC_MM_GPRS;
- gh->msg_type = GSM48_MT_GMM_ID_REQ;
- gh->data[0] = id_type;
-}
-
-/* Transmit Chapter 9.4.6.2 Detach Accept (mobile originated detach) */
-static void gprs_put_mo_detach_acc(struct msgb *msg)
-{
- struct gsm48_hdr *gh;
-
- gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
- gh->proto_discr = GSM48_PDISC_MM_GPRS;
- gh->msg_type = GSM48_MT_GMM_DETACH_ACK;
- gh->data[0] = 0; /* no force to standby */
-}
-
-static void gprs_push_llc_ui(struct msgb *msg,
- int is_uplink, unsigned sapi, unsigned nu)
-{
- const uint8_t e_bit = 0;
- const uint8_t pm_bit = 1;
- const uint8_t cr_bit = is_uplink ? 0 : 1;
- uint8_t *llc;
- uint8_t *fcs_field;
- uint32_t fcs;
-
- nu &= 0x01ff; /* 9 Bit */
-
- llc = msgb_push(msg, 3);
- llc[0] = (cr_bit << 6) | (sapi & 0x0f);
- llc[1] = 0xc0 | (nu >> 6); /* UI frame */
- llc[2] = (nu << 2) | ((e_bit & 1) << 1) | (pm_bit & 1);
-
- fcs = gprs_llc_fcs(llc, msgb_length(msg));
- fcs_field = msgb_put(msg, 3);
- fcs_field[0] = (uint8_t)(fcs >> 0);
- fcs_field[1] = (uint8_t)(fcs >> 8);
- fcs_field[2] = (uint8_t)(fcs >> 16);
-}
-
-static void gprs_push_bssgp_dl_unitdata(struct msgb *msg,
- uint32_t tlli)
-{
- struct bssgp_ud_hdr *budh;
- uint8_t *llc = msgb_data(msg);
- size_t llc_size = msgb_length(msg);
- const size_t llc_ie_hdr_size = 3;
- const uint8_t qos_profile[] = {0x00, 0x50, 0x20}; /* hard-coded */
- const uint8_t lifetime[] = {0x02, 0x58}; /* 6s hard-coded */
-
- const size_t bssgp_overhead = sizeof(*budh) +
- TVLV_GROSS_LEN(sizeof(lifetime)) + llc_ie_hdr_size;
- uint8_t *ie;
- uint32_t tlli_be = htonl(tlli);
-
- budh = (struct bssgp_ud_hdr *)msgb_push(msg, bssgp_overhead);
-
- budh->pdu_type = BSSGP_PDUT_DL_UNITDATA;
- memcpy(&budh->tlli, &tlli_be, sizeof(budh->tlli));
- memcpy(&budh->qos_profile, qos_profile, sizeof(budh->qos_profile));
-
- ie = budh->data;
- tvlv_put(ie, BSSGP_IE_PDU_LIFETIME, sizeof(lifetime), lifetime);
- ie += TVLV_GROSS_LEN(sizeof(lifetime));
-
- /* Note: Add alignment before the LLC IE if inserting other IE */
-
- *(ie++) = BSSGP_IE_LLC_PDU;
- *(ie++) = llc_size / 256;
- *(ie++) = llc_size % 256;
-
- OSMO_ASSERT(ie == llc);
-
- msgb_bssgph(msg) = (uint8_t *)budh;
- msgb_tlli(msg) = tlli;
-}
-
-/* update peer according to the BSS message */
-static void gbprox_update_current_raid(uint8_t *raid_enc,
- struct gbproxy_peer *peer,
- const char *log_text)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
- const struct osmo_plmn_id old_plmn = state->local_plmn;
- struct gprs_ra_id raid;
-
- if (!raid_enc)
- return;
-
- gsm48_parse_ra(&raid, raid_enc);
-
- /* save source side MCC/MNC */
- if (!peer->cfg->core_plmn.mcc || raid.mcc == peer->cfg->core_plmn.mcc) {
- state->local_plmn.mcc = 0;
- } else {
- state->local_plmn.mcc = raid.mcc;
- }
-
- if (!peer->cfg->core_plmn.mnc
- || !osmo_mnc_cmp(raid.mnc, raid.mnc_3_digits,
- peer->cfg->core_plmn.mnc, peer->cfg->core_plmn.mnc_3_digits)) {
- state->local_plmn.mnc = 0;
- state->local_plmn.mnc_3_digits = false;
- } else {
- state->local_plmn.mnc = raid.mnc;
- state->local_plmn.mnc_3_digits = raid.mnc_3_digits;
- }
-
- if (osmo_plmn_cmp(&old_plmn, &state->local_plmn))
- LOGP(DGPRS, LOGL_NOTICE,
- "Patching RAID %sactivated, msg: %s, "
- "local: %s, core: %s\n",
- state->local_plmn.mcc || state->local_plmn.mnc ?
- "" : "de",
- log_text,
- osmo_plmn_name(&state->local_plmn),
- osmo_plmn_name2(&peer->cfg->core_plmn));
-}
-
-uint32_t gbproxy_make_bss_ptmsi(struct gbproxy_peer *peer,
- uint32_t sgsn_ptmsi)
-{
- uint32_t bss_ptmsi;
- int max_retries = 23, rc = 0;
- if (!peer->cfg->patch_ptmsi) {
- bss_ptmsi = sgsn_ptmsi;
- } else {
- do {
- rc = osmo_get_rand_id((uint8_t *) &bss_ptmsi, sizeof(bss_ptmsi));
- if (rc < 0) {
- bss_ptmsi = GSM_RESERVED_TMSI;
- break;
- }
-
- bss_ptmsi = bss_ptmsi | GSM23003_TMSI_SGSN_MASK;
-
- if (gbproxy_link_info_by_ptmsi(peer, bss_ptmsi))
- bss_ptmsi = GSM_RESERVED_TMSI;
- } while (bss_ptmsi == GSM_RESERVED_TMSI && max_retries--);
- }
-
- if (bss_ptmsi == GSM_RESERVED_TMSI)
- LOGP(DGPRS, LOGL_ERROR, "Failed to allocate a BSS P-TMSI: %d (%s)\n", rc, strerror(-rc));
-
- return bss_ptmsi;
-}
-
-uint32_t gbproxy_make_sgsn_tlli(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info,
- uint32_t bss_tlli)
-{
- uint32_t sgsn_tlli;
- int max_retries = 23, rc = 0;
- if (!peer->cfg->patch_ptmsi) {
- sgsn_tlli = bss_tlli;
- } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI &&
- gprs_tlli_type(bss_tlli) == TLLI_FOREIGN) {
- sgsn_tlli = gprs_tmsi2tlli(link_info->sgsn_tlli.ptmsi,
- TLLI_FOREIGN);
- } else if (link_info->sgsn_tlli.ptmsi != GSM_RESERVED_TMSI &&
- gprs_tlli_type(bss_tlli) == TLLI_LOCAL) {
- sgsn_tlli = gprs_tmsi2tlli(link_info->sgsn_tlli.ptmsi,
- TLLI_LOCAL);
- } else {
- do {
- /* create random TLLI, 0b01111xxx... */
- rc = osmo_get_rand_id((uint8_t *) &sgsn_tlli, sizeof(sgsn_tlli));
- if (rc < 0) {
- sgsn_tlli = 0;
- break;
- }
-
- sgsn_tlli = (sgsn_tlli & 0x7fffffff) | 0x78000000;
-
- if (gbproxy_link_info_by_any_sgsn_tlli(peer, sgsn_tlli))
- sgsn_tlli = 0;
- } while (!sgsn_tlli && max_retries--);
- }
-
- if (!sgsn_tlli)
- LOGP(DGPRS, LOGL_ERROR, "Failed to allocate an SGSN TLLI: %d (%s)\n", rc, strerror(-rc));
-
- return sgsn_tlli;
-}
-
-void gbproxy_reset_link(struct gbproxy_link_info *link_info)
-{
- gbproxy_reset_imsi_acquisition(link_info);
-}
-
-/* Returns != 0 iff IMSI acquisition was in progress */
-static int gbproxy_restart_imsi_acquisition(struct gbproxy_link_info* link_info)
-{
- int in_progress = 0;
- if (!link_info)
- return 0;
-
- if (link_info->imsi_acq_pending)
- in_progress = 1;
-
- gbproxy_link_info_discard_messages(link_info);
- link_info->imsi_acq_pending = false;
-
- return in_progress;
-}
-
-static void gbproxy_reset_imsi_acquisition(struct gbproxy_link_info* link_info)
-{
- gbproxy_restart_imsi_acquisition(link_info);
- link_info->vu_gen_tx_bss = GBPROXY_INIT_VU_GEN_TX;
-}
-
-/* Got identity response with IMSI, assuming the request had
- * been generated by the gbproxy */
-static int gbproxy_flush_stored_messages(struct gbproxy_peer *peer,
- time_t now,
- struct gbproxy_link_info* link_info)
-{
- int rc;
- struct msgb *stored_msg;
-
- /* Patch and flush stored messages towards the SGSN */
- while ((stored_msg = msgb_dequeue_count(&link_info->stored_msgs,
- &link_info->stored_msgs_len))) {
- struct gprs_gb_parse_context tmp_parse_ctx = {0};
- tmp_parse_ctx.to_bss = 0;
- tmp_parse_ctx.peer_nsei = msgb_nsei(stored_msg);
- int len_change = 0;
-
- gprs_gb_parse_bssgp(msgb_bssgph(stored_msg),
- msgb_bssgp_len(stored_msg),
- &tmp_parse_ctx);
- gbproxy_patch_bssgp(stored_msg, msgb_bssgph(stored_msg),
- msgb_bssgp_len(stored_msg),
- peer, link_info, &len_change,
- &tmp_parse_ctx);
-
- rc = gbproxy_update_link_state_after(peer, link_info, now,
- &tmp_parse_ctx);
- if (rc == 1) {
- LOGP(DLLC, LOGL_NOTICE, "link_info deleted while flushing stored messages\n");
- msgb_free(stored_msg);
- return -1;
- }
-
- rc = gbprox_relay2sgsn(peer->cfg, stored_msg,
- msgb_bvci(stored_msg), link_info->sgsn_nsei);
-
- if (rc < 0)
- LOGP(DLLC, LOGL_ERROR,
- "NSEI=%d(BSS) failed to send stored message "
- "(%s)\n",
- tmp_parse_ctx.peer_nsei,
- tmp_parse_ctx.llc_msg_name ?
- tmp_parse_ctx.llc_msg_name : "BSSGP");
- msgb_free(stored_msg);
- }
-
- return 0;
-}
-
-static int gbproxy_gsm48_to_peer(struct gbproxy_peer *peer,
- struct gbproxy_link_info* link_info,
- uint16_t bvci,
- struct msgb *msg /* Takes msg ownership */)
-{
- int rc;
-
- /* Workaround to avoid N(U) collisions and to enable a restart
- * of the IMSI acquisition procedure. This will work unless the
- * SGSN has an initial V(UT) within [256-32, 256+n_retries]
- * (see GSM 04.64, 8.4.2). */
- gprs_push_llc_ui(msg, 0, GPRS_SAPI_GMM, link_info->vu_gen_tx_bss);
- link_info->vu_gen_tx_bss = (link_info->vu_gen_tx_bss + 1) % 512;
-
- gprs_push_bssgp_dl_unitdata(msg, link_info->tlli.current);
- rc = gbprox_relay2peer(msg, peer, bvci);
- msgb_free(msg);
- return rc;
-}
-
-static void gbproxy_acquire_imsi(struct gbproxy_peer *peer,
- struct gbproxy_link_info* link_info,
- uint16_t bvci)
-{
- struct msgb *idreq_msg;
-
- /* Send IDENT REQ */
- idreq_msg = gsm48_msgb_alloc_name("GSM 04.08 ACQ IMSI");
- gprs_put_identity_req(idreq_msg, GSM_MI_TYPE_IMSI);
- gbproxy_gsm48_to_peer(peer, link_info, bvci, idreq_msg);
-}
-
-static void gbproxy_tx_detach_acc(struct gbproxy_peer *peer,
- struct gbproxy_link_info* link_info,
- uint16_t bvci)
-{
- struct msgb *detacc_msg;
-
- /* Send DETACH ACC */
- detacc_msg = gsm48_msgb_alloc_name("GSM 04.08 DET ACC");
- gprs_put_mo_detach_acc(detacc_msg);
- gbproxy_gsm48_to_peer(peer, link_info, bvci, detacc_msg);
-}
-
-/* Return != 0 iff msg still needs to be processed */
-static int gbproxy_imsi_acquisition(struct gbproxy_peer *peer,
- struct msgb *msg,
- time_t now,
- struct gbproxy_link_info* link_info,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct msgb *stored_msg;
-
- if (!link_info)
- return 1;
-
- if (!link_info->imsi_acq_pending && link_info->imsi_len > 0)
- return 1;
-
- if (parse_ctx->g48_hdr)
- switch (parse_ctx->g48_hdr->msg_type)
- {
- case GSM48_MT_GMM_RA_UPD_REQ:
- case GSM48_MT_GMM_ATTACH_REQ:
- if (gbproxy_restart_imsi_acquisition(link_info)) {
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) IMSI acquisition was in progress "
- "when receiving an %s.\n",
- msgb_nsei(msg), parse_ctx->llc_msg_name);
- }
- break;
- case GSM48_MT_GMM_DETACH_REQ:
- /* Nothing has been sent to the SGSN yet */
- if (link_info->imsi_acq_pending) {
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) IMSI acquisition was in progress "
- "when receiving a DETACH_REQ.\n",
- msgb_nsei(msg));
- }
- if (!parse_ctx->invalidate_tlli) {
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) IMSI not yet acquired, "
- "faking a DETACH_ACC.\n",
- msgb_nsei(msg));
- gbproxy_tx_detach_acc(peer, link_info, msgb_bvci(msg));
- parse_ctx->invalidate_tlli = 1;
- }
- gbproxy_reset_imsi_acquisition(link_info);
- gbproxy_update_link_state_after(peer, link_info, now,
- parse_ctx);
- return 0;
- }
-
- if (link_info->imsi_acq_pending && link_info->imsi_len > 0) {
- int is_ident_resp =
- parse_ctx->g48_hdr &&
- gsm48_hdr_pdisc(parse_ctx->g48_hdr) == GSM48_PDISC_MM_GPRS &&
- gsm48_hdr_msg_type(parse_ctx->g48_hdr) == GSM48_MT_GMM_ID_RESP;
-
- LOGP(DLLC, LOGL_DEBUG,
- "NSEI=%d(BSS) IMSI acquisition succeeded, "
- "flushing stored messages\n",
- msgb_nsei(msg));
- /* The IMSI is now available. If flushing the messages fails,
- * then link_info has been deleted and we should return
- * immediately. */
- if (gbproxy_flush_stored_messages(peer, now, link_info) < 0)
- return 0;
-
- gbproxy_reset_imsi_acquisition(link_info);
-
- /* This message is most probably the response to the ident
- * request sent by gbproxy_acquire_imsi(). Don't forward it to
- * the SGSN. */
- return !is_ident_resp;
- }
-
- /* The message cannot be processed since the IMSI is still missing */
-
- /* If queue is getting too large, drop oldest msgb before adding new one */
- if (peer->cfg->stored_msgs_max_len > 0) {
- int exceeded_max_len = link_info->stored_msgs_len
- + 1 - peer->cfg->stored_msgs_max_len;
-
- for (; exceeded_max_len > 0; exceeded_max_len--) {
- struct msgb *msgb_drop;
- msgb_drop = msgb_dequeue_count(&link_info->stored_msgs,
- &link_info->stored_msgs_len);
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) Dropping stored msgb from list "
- "(!acq imsi, length %d, max_len exceeded)\n",
- msgb_nsei(msgb_drop), link_info->stored_msgs_len);
-
- msgb_free(msgb_drop);
- }
- }
-
- /* Enqueue unpatched messages */
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) IMSI acquisition in progress, "
- "storing message (%s)\n",
- msgb_nsei(msg),
- parse_ctx->llc_msg_name ? parse_ctx->llc_msg_name : "BSSGP");
-
- stored_msg = bssgp_msgb_copy(msg, "process_bssgp_ul");
- msgb_enqueue_count(&link_info->stored_msgs, stored_msg,
- &link_info->stored_msgs_len);
-
- if (!link_info->imsi_acq_pending) {
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(BSS) IMSI is required but not available, "
- "initiating identification procedure (%s)\n",
- msgb_nsei(msg),
- parse_ctx->llc_msg_name ? parse_ctx->llc_msg_name : "BSSGP");
-
- gbproxy_acquire_imsi(peer, link_info, msgb_bvci(msg));
-
- /* There is no explicit retransmission handling, the
- * implementation relies on the MS doing proper retransmissions
- * of the triggering message instead */
-
- link_info->imsi_acq_pending = true;
- }
-
- return 0;
-}
-
-struct gbproxy_peer *gbproxy_find_peer(struct gbproxy_config *cfg,
- struct msgb *msg,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gbproxy_peer *peer = NULL;
-
- if (msgb_bvci(msg) >= 2)
- peer = gbproxy_peer_by_bvci(cfg, msgb_bvci(msg));
-
- if (!peer && !parse_ctx->to_bss)
- peer = gbproxy_peer_by_nsei(cfg, msgb_nsei(msg));
-
- if (!peer)
- peer = gbproxy_peer_by_bssgp_tlv(cfg, &parse_ctx->bssgp_tp);
-
- if (!peer) {
- LOGP(DLLC, LOGL_INFO,
- "NSEI=%d(%s) patching: didn't find peer for message, "
- "PDU %d\n",
- msgb_nsei(msg), parse_ctx->to_bss ? "BSS" : "SGSN",
- parse_ctx->pdu_type);
- /* Increment counter */
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_PATCH_PEER_ERR]);
- }
- return peer;
-}
-
-/* patch BSSGP message */
-static int gbprox_process_bssgp_ul(struct gbproxy_config *cfg,
- struct msgb *msg,
- struct gbproxy_peer *peer)
-{
- struct gprs_gb_parse_context parse_ctx = {0};
- int rc;
- int len_change = 0;
- time_t now;
- struct timespec ts = {0,};
- struct gbproxy_link_info *link_info = NULL;
- uint32_t sgsn_nsei = cfg->nsip_sgsn_nsei;
-
- if (!cfg->core_plmn.mcc && !cfg->core_plmn.mnc && !cfg->core_apn &&
- !cfg->acquire_imsi && !cfg->patch_ptmsi && !cfg->route_to_sgsn2)
- return 1;
-
- parse_ctx.to_bss = 0;
- parse_ctx.peer_nsei = msgb_nsei(msg);
-
- /* Parse BSSGP/LLC */
- rc = gprs_gb_parse_bssgp(msgb_bssgph(msg), msgb_bssgp_len(msg),
- &parse_ctx);
-
- if (!rc && !parse_ctx.need_decryption) {
- LOGP(DGPRS, LOGL_ERROR,
- "NSEI=%u(BSS) patching: failed to parse invalid %s message\n",
- msgb_nsei(msg), gprs_gb_message_name(&parse_ctx, "NS_UNITDATA"));
- gprs_gb_log_parse_context(LOGL_NOTICE, &parse_ctx, "NS_UNITDATA");
- LOGP(DGPRS, LOGL_NOTICE,
- "NSEI=%u(BSS) invalid message was: %s\n",
- msgb_nsei(msg), msgb_hexdump(msg));
- return 0;
- }
-
- /* Get peer */
- if (!peer)
- peer = gbproxy_find_peer(cfg, msg, &parse_ctx);
-
- if (!peer)
- return 0;
-
-
- osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec;
-
- gbprox_update_current_raid(parse_ctx.bssgp_raid_enc, peer,
- parse_ctx.llc_msg_name);
-
- gprs_gb_log_parse_context(LOGL_DEBUG, &parse_ctx, "NS_UNITDATA");
-
- link_info = gbproxy_update_link_state_ul(peer, now, &parse_ctx);
-
- if (parse_ctx.g48_hdr) {
- switch (parse_ctx.g48_hdr->msg_type) {
- case GSM48_MT_GMM_ATTACH_REQ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_REQS]);
- break;
- case GSM48_MT_GMM_DETACH_REQ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_DETACH_REQS]);
- break;
- case GSM48_MT_GMM_ATTACH_COMPL:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_COMPLS]);
- break;
- case GSM48_MT_GMM_RA_UPD_REQ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_RA_UPD_REQS]);
- break;
- case GSM48_MT_GMM_RA_UPD_COMPL:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_RA_UPD_COMPLS]);
- break;
- case GSM48_MT_GMM_STATUS:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_GMM_STATUS_BSS]);
- break;
- case GSM48_MT_GSM_ACT_PDP_REQ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_PDP_ACT_REQS]);
- break;
- case GSM48_MT_GSM_DEACT_PDP_REQ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_PDP_DEACT_REQS]);
- break;
-
- default:
- break;
- }
- }
-
- if (link_info && cfg->route_to_sgsn2) {
- if (cfg->acquire_imsi && link_info->imsi_len == 0)
- sgsn_nsei = 0xffff;
- else if (gbproxy_imsi_matches(cfg, GBPROX_MATCH_ROUTING,
- link_info))
- sgsn_nsei = cfg->nsip_sgsn2_nsei;
- }
-
- if (link_info)
- link_info->sgsn_nsei = sgsn_nsei;
-
- /* Handle IMSI acquisition */
- if (cfg->acquire_imsi) {
- rc = gbproxy_imsi_acquisition(peer, msg, now, link_info,
- &parse_ctx);
- if (rc <= 0)
- return rc;
- }
-
- gbproxy_patch_bssgp(msg, msgb_bssgph(msg), msgb_bssgp_len(msg),
- peer, link_info, &len_change, &parse_ctx);
-
- gbproxy_update_link_state_after(peer, link_info, now, &parse_ctx);
-
- if (sgsn_nsei != cfg->nsip_sgsn_nsei) {
- /* Send message directly to the selected SGSN */
- rc = gbprox_relay2sgsn(cfg, msg, msgb_bvci(msg), sgsn_nsei);
- /* Don't let the calling code handle the transmission */
- return 0;
- }
-
- return 1;
-}
-
-/* patch BSSGP message to use core_plmn.mcc/mnc on the SGSN side */
-static void gbprox_process_bssgp_dl(struct gbproxy_config *cfg,
- struct msgb *msg,
- struct gbproxy_peer *peer)
-{
- struct gprs_gb_parse_context parse_ctx = {0};
- int rc;
- int len_change = 0;
- time_t now;
- struct timespec ts = {0,};
- struct gbproxy_link_info *link_info = NULL;
-
- if (!cfg->core_plmn.mcc && !cfg->core_plmn.mnc && !cfg->core_apn &&
- !cfg->acquire_imsi && !cfg->patch_ptmsi && !cfg->route_to_sgsn2)
- return;
-
- parse_ctx.to_bss = 1;
- parse_ctx.peer_nsei = msgb_nsei(msg);
-
- rc = gprs_gb_parse_bssgp(msgb_bssgph(msg), msgb_bssgp_len(msg),
- &parse_ctx);
-
- if (!rc && !parse_ctx.need_decryption) {
- LOGP(DGPRS, LOGL_ERROR,
- "NSEI=%u(SGSN) patching: failed to parse invalid %s message\n",
- msgb_nsei(msg), gprs_gb_message_name(&parse_ctx, "NS_UNITDATA"));
- gprs_gb_log_parse_context(LOGL_NOTICE, &parse_ctx, "NS_UNITDATA");
- LOGP(DGPRS, LOGL_NOTICE,
- "NSEI=%u(SGSN) invalid message was: %s\n",
- msgb_nsei(msg), msgb_hexdump(msg));
- return;
- }
-
- /* Get peer */
- if (!peer)
- peer = gbproxy_find_peer(cfg, msg, &parse_ctx);
-
- if (!peer)
- return;
-
- osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec;
-
- if (parse_ctx.g48_hdr) {
- switch (parse_ctx.g48_hdr->msg_type) {
- case GSM48_MT_GMM_ATTACH_ACK:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_ACKS]);
- break;
- case GSM48_MT_GMM_ATTACH_REJ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_ATTACH_REJS]);
- break;
- case GSM48_MT_GMM_DETACH_ACK:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_DETACH_ACKS]);
- break;
- case GSM48_MT_GMM_RA_UPD_ACK:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_RA_UPD_ACKS]);
- break;
- case GSM48_MT_GMM_RA_UPD_REJ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_RA_UPD_REJS]);
- break;
- case GSM48_MT_GMM_STATUS:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_GMM_STATUS_SGSN]);
- break;
- case GSM48_MT_GSM_ACT_PDP_ACK:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_PDP_ACT_ACKS]);
- break;
- case GSM48_MT_GSM_ACT_PDP_REJ:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_PDP_ACT_REJS]);
- break;
- case GSM48_MT_GSM_DEACT_PDP_ACK:
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_PDP_DEACT_ACKS]);
- break;
-
- default:
- break;
- }
- }
-
- gprs_gb_log_parse_context(LOGL_DEBUG, &parse_ctx, "NS_UNITDATA");
-
- link_info = gbproxy_update_link_state_dl(peer, now, &parse_ctx);
-
- gbproxy_patch_bssgp(msg, msgb_bssgph(msg), msgb_bssgp_len(msg),
- peer, link_info, &len_change, &parse_ctx);
-
- gbproxy_update_link_state_after(peer, link_info, now, &parse_ctx);
-
- return;
-}
-
-/* feed a message down the NS-VC associated with the specified peer */
-static int gbprox_relay2sgsn(struct gbproxy_config *cfg, struct msgb *old_msg,
- uint16_t ns_bvci, uint16_t sgsn_nsei)
-{
- /* create a copy of the message so the old one can
- * be free()d safely when we return from gbprox_rcvmsg() */
- struct msgb *msg = bssgp_msgb_copy(old_msg, "msgb_relay2sgsn");
- int rc;
-
- DEBUGP(DGPRS, "NSEI=%u proxying BTS->SGSN (NS_BVCI=%u, NSEI=%u)\n",
- msgb_nsei(msg), ns_bvci, sgsn_nsei);
-
- msgb_bvci(msg) = ns_bvci;
- msgb_nsei(msg) = sgsn_nsei;
-
- strip_ns_hdr(msg);
-
- rc = gprs_ns_sendmsg(bssgp_nsi, msg);
- if (rc < 0)
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_TX_ERR_SGSN]);
-
- return rc;
-}
-
-/* feed a message down the NS-VC associated with the specified peer */
-static int gbprox_relay2peer(struct msgb *old_msg, struct gbproxy_peer *peer,
- uint16_t ns_bvci)
-{
- /* create a copy of the message so the old one can
- * be free()d safely when we return from gbprox_rcvmsg() */
- struct msgb *msg = bssgp_msgb_copy(old_msg, "msgb_relay2peer");
- int rc;
-
- DEBUGP(DGPRS, "NSEI=%u proxying SGSN->BSS (NS_BVCI=%u, NSEI=%u)\n",
- msgb_nsei(msg), ns_bvci, peer->nsei);
-
- msgb_bvci(msg) = ns_bvci;
- msgb_nsei(msg) = peer->nsei;
-
- /* Strip the old NS header, it will be replaced with a new one */
- strip_ns_hdr(msg);
-
- rc = gprs_ns_sendmsg(bssgp_nsi, msg);
- if (rc < 0)
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_TX_ERR]);
-
- return rc;
-}
-
-static int block_unblock_peer(struct gbproxy_config *cfg, uint16_t ptp_bvci, uint8_t pdu_type)
-{
- struct gbproxy_peer *peer;
-
- peer = gbproxy_peer_by_bvci(cfg, ptp_bvci);
- if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "BVCI=%u: Cannot find BSS\n",
- ptp_bvci);
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_INV_BVCI]);
- return -ENOENT;
- }
-
- switch (pdu_type) {
- case BSSGP_PDUT_BVC_BLOCK_ACK:
- peer->blocked = true;
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_BLOCKED]);
- break;
- case BSSGP_PDUT_BVC_UNBLOCK_ACK:
- peer->blocked = false;
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_UNBLOCKED]);
- break;
- default:
- break;
- }
- return 0;
-}
-
-/* Send a message to a peer identified by ptp_bvci but using ns_bvci
- * in the NS hdr */
-static int gbprox_relay2bvci(struct gbproxy_config *cfg, struct msgb *msg, uint16_t ptp_bvci,
- uint16_t ns_bvci)
-{
- struct gbproxy_peer *peer;
-
- peer = gbproxy_peer_by_bvci(cfg, ptp_bvci);
- if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "BVCI=%u: Cannot find BSS\n",
- ptp_bvci);
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_INV_BVCI]);
- return -ENOENT;
- }
-
- return gbprox_relay2peer(msg, peer, ns_bvci);
-}
-
-int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
-{
- return 0;
-}
-
-/* Receive an incoming PTP message from a BSS-side NS-VC */
-static int gbprox_rx_ptp_from_bss(struct gbproxy_config *cfg,
- struct msgb *msg, uint16_t nsei,
- uint16_t nsvci, uint16_t ns_bvci)
-{
- struct gbproxy_peer *peer;
- struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg);
- uint8_t pdu_type = bgph->pdu_type;
- int rc;
-
- peer = gbproxy_peer_by_bvci(cfg, ns_bvci);
- if (!peer) {
- LOGP(DGPRS, LOGL_NOTICE, "Didn't find peer for "
- "BVCI=%u for PTP message from NSVC=%u/NSEI=%u (BSS), "
- "discarding message\n",
- ns_bvci, nsvci, nsei);
- return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI,
- &ns_bvci, msg);
- }
-
- check_peer_nsei(peer, nsei);
-
- rc = gbprox_process_bssgp_ul(cfg, msg, peer);
- if (!rc)
- return 0;
-
- switch (pdu_type) {
- case BSSGP_PDUT_FLOW_CONTROL_BVC:
- if (!cfg->route_to_sgsn2)
- break;
-
- /* Send a copy to the secondary SGSN */
- gbprox_relay2sgsn(cfg, msg, ns_bvci, cfg->nsip_sgsn2_nsei);
- break;
- default:
- break;
- }
-
-
- return gbprox_relay2sgsn(cfg, msg, ns_bvci, cfg->nsip_sgsn_nsei);
-}
-
-/* Receive an incoming PTP message from a SGSN-side NS-VC */
-static int gbprox_rx_ptp_from_sgsn(struct gbproxy_config *cfg,
- struct msgb *msg, uint16_t nsei,
- uint16_t nsvci, uint16_t ns_bvci)
-{
- struct gbproxy_peer *peer;
- struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg);
- uint8_t pdu_type = bgph->pdu_type;
-
- peer = gbproxy_peer_by_bvci(cfg, ns_bvci);
-
- /* Send status messages before patching */
-
- if (!peer) {
- LOGP(DGPRS, LOGL_INFO, "Didn't find peer for "
- "BVCI=%u for message from NSVC=%u/NSEI=%u (SGSN)\n",
- ns_bvci, nsvci, nsei);
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_INV_BVCI]);
- return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI,
- &ns_bvci, msg);
- }
-
- if (peer->blocked) {
- LOGP(DGPRS, LOGL_NOTICE, "Dropping PDU for "
- "blocked BVCI=%u via NSVC=%u/NSEI=%u\n",
- ns_bvci, nsvci, nsei);
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_DROPPED]);
- return bssgp_tx_status(BSSGP_CAUSE_BVCI_BLOCKED, &ns_bvci, msg);
- }
-
- switch (pdu_type) {
- case BSSGP_PDUT_FLOW_CONTROL_BVC_ACK:
- case BSSGP_PDUT_BVC_BLOCK_ACK:
- case BSSGP_PDUT_BVC_UNBLOCK_ACK:
- if (cfg->route_to_sgsn2 && nsei == cfg->nsip_sgsn2_nsei)
- /* Hide ACKs from the secondary SGSN, the primary SGSN
- * is responsible to send them. */
- return 0;
- break;
- default:
- break;
- }
-
- /* Optionally patch the message */
- gbprox_process_bssgp_dl(cfg, msg, peer);
-
- return gbprox_relay2peer(msg, peer, ns_bvci);
-}
-
-/* Receive an incoming signalling message from a BSS-side NS-VC */
-static int gbprox_rx_sig_from_bss(struct gbproxy_config *cfg,
- struct msgb *msg, uint16_t nsei,
- uint16_t ns_bvci)
-{
- struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg);
- struct tlv_parsed tp;
- uint8_t pdu_type = bgph->pdu_type;
- int data_len = msgb_bssgp_len(msg) - sizeof(*bgph);
- struct gbproxy_peer *from_peer = NULL;
- struct gprs_ra_id raid;
- int copy_to_sgsn2 = 0;
- int rc;
-
- if (ns_bvci != 0 && ns_bvci != 1) {
- LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u BVCI=%u is not signalling\n",
- nsei, ns_bvci);
- return -EINVAL;
- }
-
- /* we actually should never see those two for BVCI == 0, but double-check
- * just to make sure */
- if (pdu_type == BSSGP_PDUT_UL_UNITDATA ||
- pdu_type == BSSGP_PDUT_DL_UNITDATA) {
- LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u UNITDATA not allowed in "
- "signalling\n", nsei);
- return -EINVAL;
- }
-
- bssgp_tlv_parse(&tp, bgph->data, data_len);
-
- switch (pdu_type) {
- case BSSGP_PDUT_SUSPEND:
- case BSSGP_PDUT_RESUME:
- /* We implement RAI snooping during SUSPEND/RESUME, since it
- * establishes a relationsip between BVCI/peer and the routeing
- * area identification. The snooped information is then used
- * for routing the {SUSPEND,RESUME}_[N]ACK back to the correct
- * BSSGP */
- if (!TLVP_PRESENT(&tp, BSSGP_IE_ROUTEING_AREA))
- goto err_mand_ie;
- from_peer = gbproxy_peer_by_nsei(cfg, nsei);
- if (!from_peer)
- goto err_no_peer;
- memcpy(from_peer->ra, TLVP_VAL(&tp, BSSGP_IE_ROUTEING_AREA),
- sizeof(from_peer->ra));
- gsm48_parse_ra(&raid, from_peer->ra);
- LOGP(DGPRS, LOGL_INFO, "NSEI=%u BSSGP SUSPEND/RESUME "
- "RAI snooping: RAI %s behind BVCI=%u\n",
- nsei, osmo_rai_name(&raid), from_peer->bvci);
- /* FIXME: This only supports one BSS per RA */
- break;
- case BSSGP_PDUT_BVC_RESET:
- /* If we receive a BVC reset on the signalling endpoint, we
- * don't want the SGSN to reset, as the signalling endpoint
- * is common for all point-to-point BVCs (and thus all BTS) */
- if (TLVP_PRESENT(&tp, BSSGP_IE_BVCI)) {
- uint16_t bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
- LOGP(DGPRS, LOGL_INFO, "NSEI=%u Rx BVC RESET (BVCI=%u)\n",
- nsei, bvci);
- if (bvci == 0) {
- /* FIXME: only do this if SGSN is alive! */
- LOGP(DGPRS, LOGL_INFO, "NSEI=%u Tx fake "
- "BVC RESET ACK of BVCI=0\n", nsei);
- return bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_RESET_ACK,
- nsei, 0, ns_bvci);
- }
- from_peer = gbproxy_peer_by_bvci(cfg, bvci);
- if (!from_peer) {
- /* if a PTP-BVC is reset, and we don't know that
- * PTP-BVCI yet, we should allocate a new peer */
- LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei);
- from_peer = gbproxy_peer_alloc(cfg, bvci);
- OSMO_ASSERT(from_peer);
- from_peer->nsei = nsei;
- }
-
- if (!check_peer_nsei(from_peer, nsei))
- from_peer->nsei = nsei;
-
- if (TLVP_PRESENT(&tp, BSSGP_IE_CELL_ID)) {
- struct gprs_ra_id raid;
- /* We have a Cell Identifier present in this
- * PDU, this means we can extend our local
- * state information about this particular cell
- * */
- memcpy(from_peer->ra,
- TLVP_VAL(&tp, BSSGP_IE_CELL_ID),
- sizeof(from_peer->ra));
- gsm48_parse_ra(&raid, from_peer->ra);
- LOGP(DGPRS, LOGL_INFO, "NSEI=%u/BVCI=%u Cell ID %s\n",
- nsei, bvci, osmo_rai_name(&raid));
- }
- if (cfg->route_to_sgsn2)
- copy_to_sgsn2 = 1;
- }
- break;
- }
-
- /* Normally, we can simply pass on all signalling messages from BSS to
- * SGSN */
- rc = gbprox_process_bssgp_ul(cfg, msg, from_peer);
- if (!rc)
- return 0;
-
- if (copy_to_sgsn2)
- gbprox_relay2sgsn(cfg, msg, ns_bvci, cfg->nsip_sgsn2_nsei);
-
- return gbprox_relay2sgsn(cfg, msg, ns_bvci, cfg->nsip_sgsn_nsei);
-err_no_peer:
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u(BSS) cannot find peer based on NSEI\n",
- nsei);
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_INV_NSEI]);
- return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, msg);
-err_mand_ie:
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u(BSS) missing mandatory RA IE\n",
- nsei);
- rate_ctr_inc(&cfg->ctrg->ctr[GBPROX_GLOB_CTR_PROTO_ERR_BSS]);
- return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE, NULL, msg);
-}
-
-/* Receive paging request from SGSN, we need to relay to proper BSS */
-static int gbprox_rx_paging(struct gbproxy_config *cfg, struct msgb *msg, struct tlv_parsed *tp,
- uint32_t nsei, uint16_t ns_bvci)
-{
- struct gbproxy_peer *peer = NULL;
- int errctr = GBPROX_GLOB_CTR_PROTO_ERR_SGSN;
-
- LOGP(DGPRS, LOGL_INFO, "NSEI=%u(SGSN) BSSGP PAGING ",
- nsei);
- if (TLVP_PRESENT(tp, BSSGP_IE_BVCI)) {
- uint16_t bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
- LOGPC(DGPRS, LOGL_INFO, "routing by BVCI to peer BVCI=%u\n",
- bvci);
- errctr = GBPROX_GLOB_CTR_OTHER_ERR;
- } else if (TLVP_PRESENT(tp, BSSGP_IE_ROUTEING_AREA)) {
- peer = gbproxy_peer_by_rai(cfg, TLVP_VAL(tp, BSSGP_IE_ROUTEING_AREA));
- LOGPC(DGPRS, LOGL_INFO, "routing by RAI to peer BVCI=%u\n",
- peer ? peer->bvci : -1);
- errctr = GBPROX_GLOB_CTR_INV_RAI;
- } else if (TLVP_PRESENT(tp, BSSGP_IE_LOCATION_AREA)) {
- peer = gbproxy_peer_by_lai(cfg, TLVP_VAL(tp, BSSGP_IE_LOCATION_AREA));
- LOGPC(DGPRS, LOGL_INFO, "routing by LAI to peer BVCI=%u\n",
- peer ? peer->bvci : -1);
- errctr = GBPROX_GLOB_CTR_INV_LAI;
- } else
- LOGPC(DGPRS, LOGL_INFO, "\n");
-
- if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u(SGSN) BSSGP PAGING: "
- "unable to route, missing IE\n", nsei);
- rate_ctr_inc(&cfg->ctrg->ctr[errctr]);
- return -EINVAL;
- }
- return gbprox_relay2peer(msg, peer, ns_bvci);
-}
-
-/* Receive an incoming BVC-RESET message from the SGSN */
-static int rx_reset_from_sgsn(struct gbproxy_config *cfg,
- struct msgb *orig_msg,
- struct msgb *msg, struct tlv_parsed *tp,
- uint32_t nsei, uint16_t ns_bvci)
-{
- struct gbproxy_peer *peer;
- uint16_t ptp_bvci;
-
- if (!TLVP_PRESENT(tp, BSSGP_IE_BVCI)) {
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]);
- return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE,
- NULL, orig_msg);
- }
- ptp_bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
-
- if (ptp_bvci >= 2) {
- /* A reset for a PTP BVC was received, forward it to its
- * respective peer */
- peer = gbproxy_peer_by_bvci(cfg, ptp_bvci);
- if (!peer) {
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u BVCI=%u: Cannot find BSS\n",
- nsei, ptp_bvci);
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_INV_BVCI]);
- return bssgp_tx_status(BSSGP_CAUSE_UNKNOWN_BVCI,
- &ptp_bvci, orig_msg);
- }
- return gbprox_relay2peer(msg, peer, ns_bvci);
- }
-
- /* A reset for the Signalling entity has been received
- * from the SGSN. As the signalling BVCI is shared
- * among all the BSS's that we multiplex, it needs to
- * be relayed */
- llist_for_each_entry(peer, &cfg->bts_peers, list)
- gbprox_relay2peer(msg, peer, ns_bvci);
-
- return 0;
-}
-
-/* Receive an incoming signalling message from the SGSN-side NS-VC */
-static int gbprox_rx_sig_from_sgsn(struct gbproxy_config *cfg,
- struct msgb *orig_msg, uint32_t nsei,
- uint16_t ns_bvci)
-{
- struct bssgp_normal_hdr *bgph =
- (struct bssgp_normal_hdr *) msgb_bssgph(orig_msg);
- struct tlv_parsed tp;
- uint8_t pdu_type = bgph->pdu_type;
- int data_len;
- struct gbproxy_peer *peer;
- uint16_t bvci;
- struct msgb *msg;
- int rc = 0;
- int cause;
-
- if (ns_bvci != 0 && ns_bvci != 1) {
- LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u(SGSN) BVCI=%u is not "
- "signalling\n", nsei, ns_bvci);
- /* FIXME: Send proper error message */
- return -EINVAL;
- }
-
- /* we actually should never see those two for BVCI == 0, but double-check
- * just to make sure */
- if (pdu_type == BSSGP_PDUT_UL_UNITDATA ||
- pdu_type == BSSGP_PDUT_DL_UNITDATA) {
- LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u(SGSN) UNITDATA not allowed in "
- "signalling\n", nsei);
- return bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg);
- }
-
- msg = bssgp_msgb_copy(orig_msg, "rx_sig_from_sgsn");
- gbprox_process_bssgp_dl(cfg, msg, NULL);
- /* Update message info */
- bgph = (struct bssgp_normal_hdr *) msgb_bssgph(msg);
- data_len = msgb_bssgp_len(orig_msg) - sizeof(*bgph);
- rc = bssgp_tlv_parse(&tp, bgph->data, data_len);
-
- switch (pdu_type) {
- case BSSGP_PDUT_BVC_RESET:
- rc = rx_reset_from_sgsn(cfg, msg, orig_msg, &tp, nsei, ns_bvci);
- break;
- case BSSGP_PDUT_BVC_RESET_ACK:
- if (cfg->route_to_sgsn2 && nsei == cfg->nsip_sgsn2_nsei)
- break;
- /* fall through */
- case BSSGP_PDUT_FLUSH_LL:
- /* simple case: BVCI IE is mandatory */
- if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
- goto err_mand_ie;
- bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
- rc = gbprox_relay2bvci(cfg, msg, bvci, ns_bvci);
- break;
- case BSSGP_PDUT_PAGING_PS:
- case BSSGP_PDUT_PAGING_CS:
- /* process the paging request (LAI/RAI lookup) */
- rc = gbprox_rx_paging(cfg, msg, &tp, nsei, ns_bvci);
- break;
- case BSSGP_PDUT_STATUS:
- /* Some exception has occurred */
- LOGP(DGPRS, LOGL_NOTICE,
- "NSEI=%u(SGSN) BSSGP STATUS ", nsei);
- if (!TLVP_PRESENT(&tp, BSSGP_IE_CAUSE)) {
- LOGPC(DGPRS, LOGL_NOTICE, "\n");
- goto err_mand_ie;
- }
- cause = *TLVP_VAL(&tp, BSSGP_IE_CAUSE);
- LOGPC(DGPRS, LOGL_NOTICE,
- "cause=0x%02x(%s) ", *TLVP_VAL(&tp, BSSGP_IE_CAUSE),
- bssgp_cause_str(cause));
- if (TLVP_PRESENT(&tp, BSSGP_IE_BVCI)) {
- bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
- LOGPC(DGPRS, LOGL_NOTICE, "BVCI=%u\n", bvci);
-
- if (cause == BSSGP_CAUSE_UNKNOWN_BVCI)
- rc = gbprox_relay2bvci(cfg, msg, bvci, ns_bvci);
- } else
- LOGPC(DGPRS, LOGL_NOTICE, "\n");
- break;
- /* those only exist in the SGSN -> BSS direction */
- case BSSGP_PDUT_SUSPEND_ACK:
- case BSSGP_PDUT_SUSPEND_NACK:
- case BSSGP_PDUT_RESUME_ACK:
- case BSSGP_PDUT_RESUME_NACK:
- /* RAI IE is mandatory */
- if (!TLVP_PRESENT(&tp, BSSGP_IE_ROUTEING_AREA))
- goto err_mand_ie;
- peer = gbproxy_peer_by_rai(cfg, TLVP_VAL(&tp, BSSGP_IE_ROUTEING_AREA));
- if (!peer)
- goto err_no_peer;
- rc = gbprox_relay2peer(msg, peer, ns_bvci);
- break;
- case BSSGP_PDUT_BVC_BLOCK_ACK:
- case BSSGP_PDUT_BVC_UNBLOCK_ACK:
- if (!TLVP_PRESENT(&tp, BSSGP_IE_BVCI))
- goto err_mand_ie;
- bvci = ntohs(tlvp_val16_unal(&tp, BSSGP_IE_BVCI));
- if (bvci == 0) {
- LOGP(DGPRS, LOGL_NOTICE, "NSEI=%u(SGSN) BSSGP "
- "%sBLOCK_ACK for signalling BVCI ?!?\n", nsei,
- pdu_type == BSSGP_PDUT_BVC_UNBLOCK_ACK ? "UN":"");
- /* should we send STATUS ? */
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_INV_BVCI]);
- } else {
- /* Mark BVC as (un)blocked */
- block_unblock_peer(cfg, bvci, pdu_type);
- }
- rc = gbprox_relay2bvci(cfg, msg, bvci, ns_bvci);
- break;
- case BSSGP_PDUT_SGSN_INVOKE_TRACE:
- LOGP(DGPRS, LOGL_ERROR,
- "NSEI=%u(SGSN) BSSGP INVOKE TRACE not supported\n",nsei);
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_NOT_SUPPORTED_SGSN]);
- rc = bssgp_tx_status(BSSGP_CAUSE_PDU_INCOMP_FEAT, NULL, orig_msg);
- break;
- default:
- LOGP(DGPRS, LOGL_NOTICE, "BSSGP PDU type %s not supported\n", bssgp_pdu_str(pdu_type));
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]);
- rc = bssgp_tx_status(BSSGP_CAUSE_PROTO_ERR_UNSPEC, NULL, orig_msg);
- break;
- }
-
- msgb_free(msg);
-
- return rc;
-err_mand_ie:
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u(SGSN) missing mandatory IE\n",
- nsei);
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_PROTO_ERR_SGSN]);
- msgb_free(msg);
- return bssgp_tx_status(BSSGP_CAUSE_MISSING_MAND_IE, NULL, orig_msg);
-err_no_peer:
- LOGP(DGPRS, LOGL_ERROR, "NSEI=%u(SGSN) cannot find peer based on RAI\n",
- nsei);
- rate_ctr_inc(&cfg->ctrg-> ctr[GBPROX_GLOB_CTR_INV_RAI]);
- msgb_free(msg);
- return bssgp_tx_status(BSSGP_CAUSE_INV_MAND_INF, NULL, orig_msg);
-}
-
-static int gbproxy_is_sgsn_nsei(struct gbproxy_config *cfg, uint16_t nsei)
-{
- return nsei == cfg->nsip_sgsn_nsei ||
- (cfg->route_to_sgsn2 && nsei == cfg->nsip_sgsn2_nsei);
-}
-
-/* Main input function for Gb proxy */
-int gbprox_rcvmsg(struct gbproxy_config *cfg, struct msgb *msg, uint16_t nsei,
- uint16_t ns_bvci, uint16_t nsvci)
-{
- int rc;
- int remote_end_is_sgsn = gbproxy_is_sgsn_nsei(cfg, nsei);
-
- /* Only BVCI=0 messages need special treatment */
- if (ns_bvci == 0 || ns_bvci == 1) {
- if (remote_end_is_sgsn)
- rc = gbprox_rx_sig_from_sgsn(cfg, msg, nsei, ns_bvci);
- else
- rc = gbprox_rx_sig_from_bss(cfg, msg, nsei, ns_bvci);
- } else {
- /* All other BVCI are PTP */
- if (remote_end_is_sgsn)
- rc = gbprox_rx_ptp_from_sgsn(cfg, msg, nsei, nsvci,
- ns_bvci);
- else
- rc = gbprox_rx_ptp_from_bss(cfg, msg, nsei, nsvci,
- ns_bvci);
- }
-
- return rc;
-}
-
-int gbprox_reset_persistent_nsvcs(struct gprs_ns_inst *nsi)
-{
- struct gprs_nsvc *nsvc;
-
- llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) {
- if (!nsvc->persistent)
- continue;
- gprs_nsvc_reset(nsvc, NS_CAUSE_OM_INTERVENTION);
- }
- return 0;
-}
-
-/* Signal handler for signals from NS layer */
-int gbprox_signal(unsigned int subsys, unsigned int signal,
- void *handler_data, void *signal_data)
-{
- struct gbproxy_config *cfg = handler_data;
- struct ns_signal_data *nssd = signal_data;
- struct gprs_nsvc *nsvc = nssd->nsvc;
- struct gbproxy_peer *peer;
- int remote_end_is_sgsn = gbproxy_is_sgsn_nsei(cfg, nsvc->nsei);
-
- if (subsys != SS_L_NS)
- return 0;
-
- if (signal == S_NS_RESET && remote_end_is_sgsn) {
- /* We have received a NS-RESET from the NSEI and NSVC
- * of the SGSN. This might happen with SGSN that start
- * their own NS-RESET procedure without waiting for our
- * NS-RESET */
- nsvc->remote_end_is_sgsn = 1;
- }
-
- if (signal == S_NS_ALIVE_EXP && nsvc->remote_end_is_sgsn) {
- LOGP(DGPRS, LOGL_NOTICE, "Tns alive expired too often, "
- "re-starting RESET procedure\n");
- rate_ctr_inc(&cfg->ctrg->
- ctr[GBPROX_GLOB_CTR_RESTART_RESET_SGSN]);
- gprs_ns_nsip_connect(nsvc->nsi, &nsvc->ip.bts_addr,
- nsvc->nsei, nsvc->nsvci);
- }
-
- if (!nsvc->remote_end_is_sgsn) {
- /* from BSS to SGSN */
- peer = gbproxy_peer_by_nsei(cfg, nsvc->nsei);
- if (!peer) {
- LOGP(DGPRS, LOGL_NOTICE, "signal '%s' for unknown peer NSEI=%u/NSVCI=%u\n",
- get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci);
- return 0;
- }
- switch (signal) {
- case S_NS_RESET:
- case S_NS_BLOCK:
- if (!peer->blocked)
- break;
- LOGP(DGPRS, LOGL_NOTICE, "Converting '%s' from NSEI=%u/NSVCI=%u into BSSGP_BVC_BLOCK to SGSN\n",
- get_value_string(gprs_ns_signal_ns_names, signal), nsvc->nsei, nsvc->nsvci);
- bssgp_tx_simple_bvci(BSSGP_PDUT_BVC_BLOCK, nsvc->nsei,
- peer->bvci, 0);
- break;
- }
- } else {
- /* Forward this message to all NS-VC to BSS */
- struct gprs_ns_inst *nsi = cfg->nsi;
- struct gprs_nsvc *next_nsvc;
-
- llist_for_each_entry(next_nsvc, &nsi->gprs_nsvcs, list) {
- if (next_nsvc->remote_end_is_sgsn)
- continue;
-
- /* Note that the following does not start the full
- * procedures including timer based retransmissions. */
- switch (signal) {
- case S_NS_RESET:
- gprs_ns_tx_reset(next_nsvc, nssd->cause);
- break;
- case S_NS_BLOCK:
- gprs_ns_tx_block(next_nsvc, nssd->cause);
- break;
- case S_NS_UNBLOCK:
- gprs_ns_tx_unblock(next_nsvc);
- break;
- }
- }
- }
- return 0;
-}
-
-void gbprox_reset(struct gbproxy_config *cfg)
-{
- struct gbproxy_peer *peer, *tmp;
-
- llist_for_each_entry_safe(peer, tmp, &cfg->bts_peers, list)
- gbproxy_peer_free(peer);
-
- rate_ctr_group_free(cfg->ctrg);
- gbproxy_init_config(cfg);
-}
-
-int gbproxy_init_config(struct gbproxy_config *cfg)
-{
- struct timespec tp;
-
- INIT_LLIST_HEAD(&cfg->bts_peers);
- cfg->ctrg = rate_ctr_group_alloc(tall_sgsn_ctx, &global_ctrg_desc, 0);
- if (!cfg->ctrg) {
- LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n");
- return -1;
- }
- osmo_clock_gettime(CLOCK_REALTIME, &tp);
-
- return 0;
-}
diff --git a/src/gbproxy/gb_proxy_ctrl.c b/src/gbproxy/gb_proxy_ctrl.c
deleted file mode 100644
index 4b7c2f430..000000000
--- a/src/gbproxy/gb_proxy_ctrl.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Control Interface Implementation for the Gb-proxy */
-/*
- * (C) 2018 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
- * All Rights Reserved
- *
- * Author: Daniel Willmann
- *
- * 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.
- *
- * 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 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/>.
- *
- */
-
-#include <osmocom/core/talloc.h>
-
-
-#include <osmocom/gprs/gprs_bssgp.h>
-#include <osmocom/gprs/gprs_ns.h>
-
-#include <osmocom/ctrl/control_if.h>
-#include <osmocom/ctrl/control_cmd.h>
-#include <osmocom/sgsn/gb_proxy.h>
-#include <osmocom/sgsn/debug.h>
-
-extern vector ctrl_node_vec;
-
-static int get_nsvc_state(struct ctrl_cmd *cmd, void *data)
-{
- struct gbproxy_config *cfg = data;
- struct gprs_ns_inst *nsi = cfg->nsi;
- struct gprs_nsvc *nsvc;
-
- cmd->reply = talloc_strdup(cmd, "");
-
- llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) {
- if (nsvc == nsi->unknown_nsvc)
- continue;
-
- cmd->reply = gprs_nsvc_state_append(cmd->reply, nsvc);
- }
-
- return CTRL_CMD_REPLY;
-}
-
-CTRL_CMD_DEFINE_RO(nsvc_state, "nsvc-state");
-
-static int get_gbproxy_state(struct ctrl_cmd *cmd, void *data)
-{
- struct gbproxy_config *cfg = data;
- struct gbproxy_peer *peer;
-
- cmd->reply = talloc_strdup(cmd, "");
-
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- struct gprs_ra_id raid;
- gsm48_parse_ra(&raid, peer->ra);
-
- cmd->reply = talloc_asprintf_append(cmd->reply, "%u,%u,%u,%u,%u,%u,%s\n",
- peer->nsei, peer->bvci,
- raid.mcc, raid.mnc,
- raid.lac, raid.rac,
- peer->blocked ? "BLOCKED" : "UNBLOCKED");
- }
-
- return CTRL_CMD_REPLY;
-}
-
-CTRL_CMD_DEFINE_RO(gbproxy_state, "gbproxy-state");
-
-static int get_num_peers(struct ctrl_cmd *cmd, void *data)
-{
- struct gbproxy_config *cfg = data;
-
- cmd->reply = talloc_strdup(cmd, "");
- cmd->reply = talloc_asprintf_append(cmd->reply, "%u", llist_count(&cfg->bts_peers));
-
- return CTRL_CMD_REPLY;
-}
-CTRL_CMD_DEFINE_RO(num_peers, "number-of-peers");
-
-int gb_ctrl_cmds_install(void)
-{
- int rc = 0;
- rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_nsvc_state);
- rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_gbproxy_state);
- rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_num_peers);
-
- return rc;
-}
diff --git a/src/gbproxy/gb_proxy_main.c b/src/gbproxy/gb_proxy_main.c
deleted file mode 100644
index 8c8398043..000000000
--- a/src/gbproxy/gb_proxy_main.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/* NS-over-IP proxy */
-
-/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010 by On-Waves
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <getopt.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/fcntl.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <osmocom/core/application.h>
-#include <osmocom/core/talloc.h>
-#include <osmocom/core/select.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/core/stats.h>
-
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/gprs/gprs_bssgp.h>
-
-#include <osmocom/sgsn/signal.h>
-#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/vty.h>
-#include <osmocom/sgsn/gb_proxy.h>
-
-#include <osmocom/ctrl/control_vty.h>
-#include <osmocom/ctrl/control_if.h>
-#include <osmocom/ctrl/ports.h>
-
-#include <osmocom/vty/command.h>
-#include <osmocom/vty/telnet_interface.h>
-#include <osmocom/vty/logging.h>
-#include <osmocom/vty/stats.h>
-#include <osmocom/vty/ports.h>
-#include <osmocom/vty/misc.h>
-
-#include "../../bscconfig.h"
-
-#define _GNU_SOURCE
-#include <getopt.h>
-
-void *tall_sgsn_ctx;
-
-const char *openbsc_copyright =
- "Copyright (C) 2010 Harald Welte and On-Waves\r\n"
- "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n"
- "This is free software: you are free to change and redistribute it.\r\n"
- "There is NO WARRANTY, to the extent permitted by law.\r\n";
-
-#define CONFIG_FILE_DEFAULT "osmo-gbproxy.cfg"
-#define CONFIG_FILE_LEGACY "osmo_gbproxy.cfg"
-
-static char *config_file = NULL;
-struct gbproxy_config *gbcfg;
-static int daemonize = 0;
-
-/* Pointer to the SGSN peer */
-extern struct gbprox_peer *gbprox_peer_sgsn;
-
-/* call-back function for the NS protocol */
-static int proxy_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
- struct msgb *msg, uint16_t bvci)
-{
- int rc = 0;
-
- switch (event) {
- case GPRS_NS_EVT_UNIT_DATA:
- rc = gbprox_rcvmsg(gbcfg, msg, nsvc->nsei, bvci, nsvc->nsvci);
- break;
- default:
- LOGP(DGPRS, LOGL_ERROR, "SGSN: Unknown event %u from NS\n", event);
- if (msg)
- msgb_free(msg);
- rc = -EIO;
- break;
- }
- return rc;
-}
-
-static void signal_handler(int signal)
-{
- fprintf(stdout, "signal %u received\n", signal);
-
- switch (signal) {
- case SIGINT:
- case SIGTERM:
- osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL);
- sleep(1);
- exit(0);
- break;
- case SIGABRT:
- /* in case of abort, we want to obtain a talloc report
- * and then return to the caller, who will abort the process */
- case SIGUSR1:
- talloc_report(tall_vty_ctx, stderr);
- talloc_report_full(tall_sgsn_ctx, stderr);
- break;
- case SIGUSR2:
- talloc_report_full(tall_vty_ctx, stderr);
- break;
- default:
- break;
- }
-}
-
-static void print_usage()
-{
- printf("Usage: bsc_hack\n");
-}
-
-static void print_help()
-{
- printf(" Some useful help...\n");
- printf(" -h --help this text\n");
- printf(" -d option --debug=DNS:DGPRS,0:0 enable debugging\n");
- printf(" -D --daemonize Fork the process into a background daemon\n");
- printf(" -c --config-file filename The config file to use [%s]\n", CONFIG_FILE_DEFAULT);
- printf(" -s --disable-color\n");
- printf(" -T --timestamp Prefix every log line with a timestamp\n");
- printf(" -V --version. Print the version.\n");
- printf(" -e --log-level number. Set a global loglevel.\n");
-}
-
-static void handle_options(int argc, char **argv)
-{
- while (1) {
- int option_index = 0, c;
- static struct option long_options[] = {
- { "help", 0, 0, 'h' },
- { "debug", 1, 0, 'd' },
- { "daemonize", 0, 0, 'D' },
- { "config-file", 1, 0, 'c' },
- { "disable-color", 0, 0, 's' },
- { "timestamp", 0, 0, 'T' },
- { "version", 0, 0, 'V' },
- { "log-level", 1, 0, 'e' },
- { 0, 0, 0, 0 }
- };
-
- c = getopt_long(argc, argv, "hd:Dc:sTVe:",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c) {
- case 'h':
- print_usage();
- print_help();
- exit(0);
- case 's':
- log_set_use_color(osmo_stderr_target, 0);
- break;
- case 'd':
- log_parse_category_mask(osmo_stderr_target, optarg);
- break;
- case 'D':
- daemonize = 1;
- break;
- case 'c':
- config_file = optarg;
- break;
- case 'T':
- log_set_print_timestamp(osmo_stderr_target, 1);
- break;
- case 'e':
- log_set_log_level(osmo_stderr_target, atoi(optarg));
- break;
- case 'V':
- print_version(1);
- exit(0);
- break;
- default:
- break;
- }
- }
-
- if (argc > optind) {
- fprintf(stderr, "Unsupported positional arguments on command line\n");
- exit(2);
- }
-}
-
-int gbproxy_vty_is_config_node(struct vty *vty, int node)
-{
- switch (node) {
- /* add items that are not config */
- case CONFIG_NODE:
- return 0;
-
- default:
- return 1;
- }
-}
-
-int gbproxy_vty_go_parent(struct vty *vty)
-{
- switch (vty->node) {
- case GBPROXY_NODE:
- default:
- if (gbproxy_vty_is_config_node(vty, vty->node))
- vty->node = CONFIG_NODE;
- else
- vty->node = ENABLE_NODE;
-
- vty->index = NULL;
- }
-
- return vty->node;
-}
-
-static struct vty_app_info vty_info = {
- .name = "OsmoGbProxy",
- .version = PACKAGE_VERSION,
- .go_parent_cb = gbproxy_vty_go_parent,
- .is_config_node = gbproxy_vty_is_config_node,
-};
-
-/* default categories */
-static struct log_info_cat gprs_categories[] = {
- [DGPRS] = {
- .name = "DGPRS",
- .description = "GPRS Packet Service",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
- [DNS] = {
- .name = "DNS",
- .description = "GPRS Network Service (NS)",
- .enabled = 1, .loglevel = LOGL_INFO,
- },
- [DBSSGP] = {
- .name = "DBSSGP",
- .description = "GPRS BSS Gateway Protocol (BSSGP)",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
-};
-
-static const struct log_info gprs_log_info = {
- .filter_fn = gprs_log_filter_fn,
- .cat = gprs_categories,
- .num_cat = ARRAY_SIZE(gprs_categories),
-};
-
-static bool file_exists(const char *path)
-{
- struct stat sb;
- return stat(path, &sb) ? false : true;
-}
-
-int main(int argc, char **argv)
-{
- int rc;
- struct ctrl_handle *ctrl;
-
- tall_sgsn_ctx = talloc_named_const(NULL, 0, "nsip_proxy");
- msgb_talloc_ctx_init(tall_sgsn_ctx, 0);
- vty_info.tall_ctx = tall_sgsn_ctx;
-
- signal(SIGINT, &signal_handler);
- signal(SIGTERM, &signal_handler);
- signal(SIGABRT, &signal_handler);
- signal(SIGUSR1, &signal_handler);
- signal(SIGUSR2, &signal_handler);
- osmo_init_ignore_signals();
-
- osmo_init_logging2(tall_sgsn_ctx, &gprs_log_info);
-
- vty_info.copyright = openbsc_copyright;
- vty_init(&vty_info);
- logging_vty_add_cmds();
- osmo_talloc_vty_add_cmds();
- osmo_stats_vty_add_cmds();
- gbproxy_vty_init();
-
- handle_options(argc, argv);
-
- /* Backwards compatibility: for years, the default config file name was
- * osmo_gbproxy.cfg. All other Osmocom programs use osmo-*.cfg with a
- * dash. To be able to use the new config file name without breaking
- * previous setups that might rely on the legacy default config file
- * name, we need to look for the old config file if no -c option was
- * passed AND no file exists with the new default file name. */
- if (!config_file) {
- /* No -c option was passed */
- if (file_exists(CONFIG_FILE_LEGACY)
- && !file_exists(CONFIG_FILE_DEFAULT))
- config_file = CONFIG_FILE_LEGACY;
- else
- config_file = CONFIG_FILE_DEFAULT;
- }
-
- rate_ctr_init(tall_sgsn_ctx);
- osmo_stats_init(tall_sgsn_ctx);
-
- bssgp_nsi = gprs_ns_instantiate(&proxy_ns_cb, tall_sgsn_ctx);
- if (!bssgp_nsi) {
- LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
- exit(1);
- }
-
- gbcfg = talloc_zero(tall_sgsn_ctx, struct gbproxy_config);
- if (!gbcfg) {
- LOGP(DGPRS, LOGL_FATAL, "Unable to allocate config\n");
- exit(1);
- }
- gbproxy_init_config(gbcfg);
- gbcfg->nsi = bssgp_nsi;
- gprs_ns_vty_init(bssgp_nsi);
- gprs_ns_set_log_ss(DNS);
- bssgp_set_log_ss(DBSSGP);
- osmo_signal_register_handler(SS_L_NS, &gbprox_signal, gbcfg);
-
- rc = gbproxy_parse_config(config_file, gbcfg);
- if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot parse config file '%s'\n", config_file);
- exit(2);
- }
-
- /* start telnet after reading config for vty_get_bind_addr() */
- rc = telnet_init_dynif(tall_sgsn_ctx, NULL,
- vty_get_bind_addr(), OSMO_VTY_PORT_GBPROXY);
- if (rc < 0)
- exit(1);
-
- /* Start control interface after getting config for
- * ctrl_vty_get_bind_addr() */
- ctrl = ctrl_interface_setup_dynip(gbcfg, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_GBPROXY, NULL);
- if (!ctrl) {
- LOGP(DGPRS, LOGL_FATAL, "Failed to create CTRL interface.\n");
- exit(1);
- }
-
- if (gb_ctrl_cmds_install() != 0) {
- LOGP(DGPRS, LOGL_FATAL, "Failed to install CTRL commands.\n");
- exit(1);
- }
-
- if (!gprs_nsvc_by_nsei(gbcfg->nsi, gbcfg->nsip_sgsn_nsei)) {
- LOGP(DGPRS, LOGL_FATAL, "You cannot proxy to NSEI %u "
- "without creating that NSEI before\n",
- gbcfg->nsip_sgsn_nsei);
- exit(2);
- }
-
- rc = gprs_ns_nsip_listen(bssgp_nsi);
- if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on NSIP socket\n");
- exit(2);
- }
-
- rc = gprs_ns_frgre_listen(bssgp_nsi);
- if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen GRE "
- "socket. Do you have CAP_NET_RAW?\n");
- exit(2);
- }
-
- if (daemonize) {
- rc = osmo_daemonize();
- if (rc < 0) {
- perror("Error during daemonize");
- exit(1);
- }
- }
-
- /* Reset all the persistent NS-VCs that we've read from the config */
- gbprox_reset_persistent_nsvcs(bssgp_nsi);
-
- while (1) {
- rc = osmo_select_main(0);
- if (rc < 0)
- exit(3);
- }
-
- exit(0);
-}
diff --git a/src/gbproxy/gb_proxy_patch.c b/src/gbproxy/gb_proxy_patch.c
deleted file mode 100644
index 2bc3b4b74..000000000
--- a/src/gbproxy/gb_proxy_patch.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/* Gb-proxy message patching */
-
-/* (C) 2014 by On-Waves
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <osmocom/sgsn/gb_proxy.h>
-
-#include <osmocom/sgsn/gprs_utils.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
-
-#include <osmocom/sgsn/debug.h>
-
-#include <osmocom/gprs/protocol/gsm_08_18.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/gsm/apn.h>
-
-extern void *tall_sgsn_ctx;
-
-/* patch RA identifier in place */
-static void gbproxy_patch_raid(struct gsm48_ra_id *raid_enc, struct gbproxy_peer *peer,
- int to_bss, const char *log_text)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
- struct osmo_plmn_id old_plmn;
- struct gprs_ra_id raid;
- enum gbproxy_peer_ctr counter =
- to_bss ?
- GBPROX_PEER_CTR_RAID_PATCHED_SGSN :
- GBPROX_PEER_CTR_RAID_PATCHED_BSS;
-
- if (!state->local_plmn.mcc || !state->local_plmn.mnc)
- return;
-
- gsm48_parse_ra(&raid, (uint8_t *)raid_enc);
-
- old_plmn = (struct osmo_plmn_id){
- .mcc = raid.mcc,
- .mnc = raid.mnc,
- .mnc_3_digits = raid.mnc_3_digits,
- };
-
- if (!to_bss) {
- /* BSS -> SGSN */
- if (state->local_plmn.mcc)
- raid.mcc = peer->cfg->core_plmn.mcc;
-
- if (state->local_plmn.mnc) {
- raid.mnc = peer->cfg->core_plmn.mnc;
- raid.mnc_3_digits = peer->cfg->core_plmn.mnc_3_digits;
- }
- } else {
- /* SGSN -> BSS */
- if (state->local_plmn.mcc)
- raid.mcc = state->local_plmn.mcc;
-
- if (state->local_plmn.mnc) {
- raid.mnc = state->local_plmn.mnc;
- raid.mnc_3_digits = state->local_plmn.mnc_3_digits;
- }
- }
-
- LOGP(DGPRS, LOGL_DEBUG,
- "Patching %s to %s: "
- "%s-%d-%d -> %s\n",
- log_text,
- to_bss ? "BSS" : "SGSN",
- osmo_plmn_name(&old_plmn), raid.lac, raid.rac,
- osmo_rai_name(&raid));
-
- gsm48_encode_ra(raid_enc, &raid);
- rate_ctr_inc(&peer->ctrg->ctr[counter]);
-}
-
-static void gbproxy_patch_apn_ie(struct msgb *msg,
- uint8_t *apn_ie, size_t apn_ie_len,
- struct gbproxy_peer *peer,
- size_t *new_apn_ie_len, const char *log_text)
-{
- struct apn_ie_hdr {
- uint8_t iei;
- uint8_t apn_len;
- uint8_t apn[0];
- } *hdr = (void *)apn_ie;
-
- size_t apn_len = hdr->apn_len;
- uint8_t *apn = hdr->apn;
-
- OSMO_ASSERT(apn_ie_len == apn_len + sizeof(struct apn_ie_hdr));
- OSMO_ASSERT(apn_ie_len > 2 && apn_ie_len <= 102);
-
- if (peer->cfg->core_apn_size == 0) {
- char str1[110];
- /* Remove the IE */
- LOGP(DGPRS, LOGL_DEBUG,
- "Patching %s to SGSN: Removing APN '%s'\n",
- log_text,
- osmo_apn_to_str(str1, apn, apn_len));
-
- *new_apn_ie_len = 0;
- msgb_resize_area(msg, apn_ie, apn_ie_len, 0);
- } else {
- /* Resize the IE */
- char str1[110];
- char str2[110];
-
- OSMO_ASSERT(peer->cfg->core_apn_size <= 100);
-
- LOGP(DGPRS, LOGL_DEBUG,
- "Patching %s to SGSN: "
- "Replacing APN '%s' -> '%s'\n",
- log_text,
- osmo_apn_to_str(str1, apn, apn_len),
- osmo_apn_to_str(str2, peer->cfg->core_apn,
- peer->cfg->core_apn_size));
-
- *new_apn_ie_len = peer->cfg->core_apn_size + 2;
- msgb_resize_area(msg, apn, apn_len, peer->cfg->core_apn_size);
- memcpy(apn, peer->cfg->core_apn, peer->cfg->core_apn_size);
- hdr->apn_len = peer->cfg->core_apn_size;
- }
-
- rate_ctr_inc(&peer->ctrg->ctr[GBPROX_PEER_CTR_APN_PATCHED]);
-}
-
-static int gbproxy_patch_tlli(uint8_t *tlli_enc,
- struct gbproxy_peer *peer,
- uint32_t new_tlli,
- int to_bss, const char *log_text)
-{
- uint32_t tlli_be;
- uint32_t tlli;
- enum gbproxy_peer_ctr counter =
- to_bss ?
- GBPROX_PEER_CTR_TLLI_PATCHED_SGSN :
- GBPROX_PEER_CTR_TLLI_PATCHED_BSS;
-
- memcpy(&tlli_be, tlli_enc, sizeof(tlli_be));
- tlli = ntohl(tlli_be);
-
- if (tlli == new_tlli)
- return 0;
-
- LOGP(DGPRS, LOGL_DEBUG,
- "Patching %ss: "
- "Replacing %08x -> %08x\n",
- log_text, tlli, new_tlli);
-
- tlli_be = htonl(new_tlli);
- memcpy(tlli_enc, &tlli_be, sizeof(tlli_be));
-
- rate_ctr_inc(&peer->ctrg->ctr[counter]);
-
- return 1;
-}
-
-static int gbproxy_patch_ptmsi(uint8_t *ptmsi_enc,
- struct gbproxy_peer *peer,
- uint32_t new_ptmsi,
- int to_bss, const char *log_text)
-{
- uint32_t ptmsi_be;
- uint32_t ptmsi;
- enum gbproxy_peer_ctr counter =
- to_bss ?
- GBPROX_PEER_CTR_PTMSI_PATCHED_SGSN :
- GBPROX_PEER_CTR_PTMSI_PATCHED_BSS;
- memcpy(&ptmsi_be, ptmsi_enc, sizeof(ptmsi_be));
- ptmsi = ntohl(ptmsi_be);
-
- if (ptmsi == new_ptmsi)
- return 0;
-
- LOGP(DGPRS, LOGL_DEBUG,
- "Patching %ss: "
- "Replacing %08x -> %08x\n",
- log_text, ptmsi, new_ptmsi);
-
- ptmsi_be = htonl(new_ptmsi);
- memcpy(ptmsi_enc, &ptmsi_be, sizeof(ptmsi_be));
-
- rate_ctr_inc(&peer->ctrg->ctr[counter]);
-
- return 1;
-}
-
-int gbproxy_patch_llc(struct msgb *msg, uint8_t *llc, size_t llc_len,
- struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info, int *len_change,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gprs_llc_hdr_parsed *ghp = &parse_ctx->llc_hdr_parsed;
- int have_patched = 0;
- int fcs;
- struct gbproxy_config *cfg = peer->cfg;
-
- if (parse_ctx->ptmsi_enc && link_info &&
- !parse_ctx->old_raid_is_foreign && peer->cfg->patch_ptmsi) {
- uint32_t ptmsi;
- if (parse_ctx->to_bss)
- ptmsi = link_info->tlli.ptmsi;
- else
- ptmsi = link_info->sgsn_tlli.ptmsi;
-
- if (ptmsi != GSM_RESERVED_TMSI) {
- if (gbproxy_patch_ptmsi(parse_ctx->ptmsi_enc, peer,
- ptmsi, parse_ctx->to_bss, "P-TMSI"))
- have_patched = 1;
- } else {
- /* TODO: invalidate old RAI if present (see below) */
- }
- }
-
- if (parse_ctx->new_ptmsi_enc && link_info && cfg->patch_ptmsi) {
- uint32_t ptmsi;
- if (parse_ctx->to_bss)
- ptmsi = link_info->tlli.ptmsi;
- else
- ptmsi = link_info->sgsn_tlli.ptmsi;
-
- OSMO_ASSERT(ptmsi);
- if (gbproxy_patch_ptmsi(parse_ctx->new_ptmsi_enc, peer,
- ptmsi, parse_ctx->to_bss, "new P-TMSI"))
- have_patched = 1;
- }
-
- if (parse_ctx->raid_enc) {
- gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->raid_enc, peer, parse_ctx->to_bss,
- parse_ctx->llc_msg_name);
- have_patched = 1;
- }
-
- if (parse_ctx->old_raid_enc && !parse_ctx->old_raid_is_foreign) {
- /* TODO: Patch to invalid if P-TMSI unknown. */
- gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->old_raid_enc, peer, parse_ctx->to_bss,
- parse_ctx->llc_msg_name);
- have_patched = 1;
- }
-
- if (parse_ctx->apn_ie &&
- cfg->core_apn &&
- !parse_ctx->to_bss &&
- gbproxy_imsi_matches(cfg, GBPROX_MATCH_PATCHING, link_info) &&
- cfg->core_apn) {
- size_t new_len;
- gbproxy_patch_apn_ie(msg,
- parse_ctx->apn_ie, parse_ctx->apn_ie_len,
- peer, &new_len, parse_ctx->llc_msg_name);
- *len_change += (int)new_len - (int)parse_ctx->apn_ie_len;
-
- have_patched = 1;
- }
-
- if (have_patched) {
- llc_len += *len_change;
- ghp->crc_length += *len_change;
-
- /* Fix FCS */
- fcs = gprs_llc_fcs(llc, ghp->crc_length);
- LOGP(DLLC, LOGL_DEBUG, "Updated LLC message, CRC: %06x -> %06x\n",
- ghp->fcs, fcs);
-
- llc[llc_len - 3] = fcs & 0xff;
- llc[llc_len - 2] = (fcs >> 8) & 0xff;
- llc[llc_len - 1] = (fcs >> 16) & 0xff;
- }
-
- return have_patched;
-}
-
-/* patch BSSGP message to use core_plmn.mcc/mnc on the SGSN side */
-void gbproxy_patch_bssgp(struct msgb *msg, uint8_t *bssgp, size_t bssgp_len,
- struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info, int *len_change,
- struct gprs_gb_parse_context *parse_ctx)
-{
- const char *err_info = NULL;
- int err_ctr = -1;
-
- if (parse_ctx->bssgp_raid_enc)
- gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->bssgp_raid_enc, peer,
- parse_ctx->to_bss, "BSSGP");
-
- if (parse_ctx->need_decryption &&
- (peer->cfg->patch_ptmsi || peer->cfg->core_apn)) {
- /* Patching LLC messages has been requested
- * explicitly, but the message (including the
- * type) is encrypted, so we possibly fail to
- * patch the LLC part of the message. */
- err_ctr = GBPROX_PEER_CTR_PATCH_CRYPT_ERR;
- err_info = "GMM message is encrypted";
- goto patch_error;
- }
-
- if (!link_info && parse_ctx->tlli_enc && parse_ctx->to_bss) {
- /* Happens with unknown (not cached) TLLI coming from
- * the SGSN */
- /* TODO: What shall be done with the message in this case? */
- err_ctr = GBPROX_PEER_CTR_TLLI_UNKNOWN;
- err_info = "TLLI sent by the SGSN is unknown";
- goto patch_error;
- }
-
- if (!link_info)
- return;
-
- if (parse_ctx->tlli_enc && peer->cfg->patch_ptmsi) {
- uint32_t tlli = gbproxy_map_tlli(parse_ctx->tlli,
- link_info, parse_ctx->to_bss);
-
- if (tlli) {
- gbproxy_patch_tlli(parse_ctx->tlli_enc, peer, tlli,
- parse_ctx->to_bss, "TLLI");
- parse_ctx->tlli = tlli;
- } else {
- /* Internal error */
- err_ctr = GBPROX_PEER_CTR_PATCH_ERR;
- err_info = "Replacement TLLI is 0";
- goto patch_error;
- }
- }
-
- if (parse_ctx->bssgp_ptmsi_enc && peer->cfg->patch_ptmsi) {
- uint32_t ptmsi;
- if (parse_ctx->to_bss)
- ptmsi = link_info->tlli.ptmsi;
- else
- ptmsi = link_info->sgsn_tlli.ptmsi;
-
- if (ptmsi != GSM_RESERVED_TMSI)
- gbproxy_patch_ptmsi(
- parse_ctx->bssgp_ptmsi_enc, peer,
- ptmsi, parse_ctx->to_bss, "BSSGP P-TMSI");
- }
-
- if (parse_ctx->llc) {
- uint8_t *llc = parse_ctx->llc;
- size_t llc_len = parse_ctx->llc_len;
- int llc_len_change = 0;
-
- gbproxy_patch_llc(msg, llc, llc_len, peer, link_info,
- &llc_len_change, parse_ctx);
- /* Note that the APN might have been resized here, but no
- * pointer int the parse_ctx will refer to an adress after the
- * APN. So it's possible to patch first and do the TLLI
- * handling afterwards. */
-
- if (llc_len_change) {
- llc_len += llc_len_change;
-
- /* Fix LLC IE len */
- /* TODO: This is a kludge, but the a pointer to the
- * start of the IE is not available here */
- if (llc[-2] == BSSGP_IE_LLC_PDU && llc[-1] & 0x80) {
- /* most probably a one byte length */
- if (llc_len > 127) {
- err_info = "Cannot increase size";
- err_ctr = GBPROX_PEER_CTR_PATCH_ERR;
- goto patch_error;
- }
- llc[-1] = llc_len | 0x80;
- } else {
- llc[-2] = (llc_len >> 8) & 0x7f;
- llc[-1] = llc_len & 0xff;
- }
- *len_change += llc_len_change;
- }
- /* Note that the tp struct might contain invalid pointers here
- * if the LLC field has changed its size */
- parse_ctx->llc_len = llc_len;
- }
- return;
-
-patch_error:
- OSMO_ASSERT(err_ctr >= 0);
- rate_ctr_inc(&peer->ctrg->ctr[err_ctr]);
- LOGP(DGPRS, LOGL_ERROR,
- "NSEI=%u(%s) failed to patch BSSGP message as requested: %s.\n",
- msgb_nsei(msg), parse_ctx->to_bss ? "SGSN" : "BSS",
- err_info);
-}
-
-void gbproxy_clear_patch_filter(struct gbproxy_match *match)
-{
- if (match->enable) {
- regfree(&match->re_comp);
- match->enable = false;
- }
- talloc_free(match->re_str);
- match->re_str = NULL;
-}
-
-int gbproxy_set_patch_filter(struct gbproxy_match *match, const char *filter,
- const char **err_msg)
-{
- static char err_buf[300];
- int rc;
-
- gbproxy_clear_patch_filter(match);
-
- if (!filter)
- return 0;
-
- rc = regcomp(&match->re_comp, filter,
- REG_EXTENDED | REG_NOSUB | REG_ICASE);
-
- if (rc == 0) {
- match->enable = true;
- match->re_str = talloc_strdup(tall_sgsn_ctx, filter);
- return 0;
- }
-
- if (err_msg) {
- regerror(rc, &match->re_comp,
- err_buf, sizeof(err_buf));
- *err_msg = err_buf;
- }
-
- return -1;
-}
-
-int gbproxy_check_imsi(struct gbproxy_match *match,
- const uint8_t *imsi, size_t imsi_len)
-{
- int rc;
- struct osmo_mobile_identity mi;
-
- if (!match->enable)
- return 1;
-
- rc = osmo_mobile_identity_decode(&mi, imsi, imsi_len, false);
- if (rc || mi.type != GSM_MI_TYPE_IMSI) {
- LOGP(DGPRS, LOGL_NOTICE, "Invalid IMSI %s\n",
- osmo_hexdump(imsi, imsi_len));
- return -1;
- }
-
- LOGP(DGPRS, LOGL_DEBUG, "Checking IMSI '%s' (%d)\n", mi.imsi, rc);
-
- rc = regexec(&match->re_comp, mi.imsi, 0, NULL, 0);
- if (rc == REG_NOMATCH) {
- LOGP(DGPRS, LOGL_INFO,
- "IMSI '%s' doesn't match pattern '%s'\n",
- mi.imsi, match->re_str);
- return 0;
- }
-
- return 1;
-}
diff --git a/src/gbproxy/gb_proxy_peer.c b/src/gbproxy/gb_proxy_peer.c
deleted file mode 100644
index 48482b6a1..000000000
--- a/src/gbproxy/gb_proxy_peer.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/* Gb proxy peer handling */
-
-/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010-2013 by On-Waves
- * (C) 2013 by Holger Hans Peter Freyther
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <osmocom/sgsn/gb_proxy.h>
-
-#include <osmocom/sgsn/debug.h>
-
-#include <osmocom/gprs/protocol/gsm_08_18.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/core/stats.h>
-#include <osmocom/core/talloc.h>
-#include <osmocom/gsm/tlv.h>
-
-#include <string.h>
-
-extern void *tall_sgsn_ctx;
-
-static const struct rate_ctr_desc peer_ctr_description[] = {
- { "blocked", "BVC Block " },
- { "unblocked", "BVC Unblock " },
- { "dropped", "BVC blocked, dropped packet " },
- { "inv-nsei", "NSEI mismatch " },
- { "tx-err", "NS Transmission error " },
- { "raid-mod:bss", "RAID patched (BSS )" },
- { "raid-mod:sgsn", "RAID patched (SGSN)" },
- { "apn-mod:sgsn", "APN patched " },
- { "tlli-mod:bss", "TLLI patched (BSS )" },
- { "tlli-mod:sgsn", "TLLI patched (SGSN)" },
- { "ptmsi-mod:bss", "P-TMSI patched (BSS )" },
- { "ptmsi-mod:sgsn","P-TMSI patched (SGSN)" },
- { "mod-crypt-err", "Patch error: encrypted " },
- { "mod-err", "Patch error: other " },
- { "attach-reqs", "Attach Request count " },
- { "attach-rejs", "Attach Reject count " },
- { "attach-acks", "Attach Accept count " },
- { "attach-cpls", "Attach Completed count " },
- { "ra-upd-reqs", "RoutingArea Update Request count" },
- { "ra-upd-rejs", "RoutingArea Update Reject count " },
- { "ra-upd-acks", "RoutingArea Update Accept count " },
- { "ra-upd-cpls", "RoutingArea Update Compltd count" },
- { "gmm-status", "GMM Status count (BSS)" },
- { "gmm-status", "GMM Status count (SGSN)" },
- { "detach-reqs", "Detach Request count " },
- { "detach-acks", "Detach Accept count " },
- { "pdp-act-reqs", "PDP Activation Request count " },
- { "pdp-act-rejs", "PDP Activation Reject count " },
- { "pdp-act-acks", "PDP Activation Accept count " },
- { "pdp-deact-reqs","PDP Deactivation Request count " },
- { "pdp-deact-acks","PDP Deactivation Accept count " },
- { "tlli-unknown", "TLLI from SGSN unknown " },
- { "tlli-cache", "TLLI cache size " },
-};
-
-osmo_static_assert(ARRAY_SIZE(peer_ctr_description) == GBPROX_PEER_CTR_LAST, everything_described);
-
-static const struct rate_ctr_group_desc peer_ctrg_desc = {
- .group_name_prefix = "gbproxy:peer",
- .group_description = "GBProxy Peer Statistics",
- .num_ctr = ARRAY_SIZE(peer_ctr_description),
- .ctr_desc = peer_ctr_description,
- .class_id = OSMO_STATS_CLASS_PEER,
-};
-
-
-/* Find the gbprox_peer by its BVCI */
-struct gbproxy_peer *gbproxy_peer_by_bvci(struct gbproxy_config *cfg, uint16_t bvci)
-{
- struct gbproxy_peer *peer;
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- if (peer->bvci == bvci)
- return peer;
- }
- return NULL;
-}
-
-/* Find the gbprox_peer by its NSEI */
-struct gbproxy_peer *gbproxy_peer_by_nsei(struct gbproxy_config *cfg,
- uint16_t nsei)
-{
- struct gbproxy_peer *peer;
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- if (peer->nsei == nsei)
- return peer;
- }
- return NULL;
-}
-
-/* look-up a peer by its Routeing Area Identification (RAI) */
-struct gbproxy_peer *gbproxy_peer_by_rai(struct gbproxy_config *cfg,
- const uint8_t *ra)
-{
- struct gbproxy_peer *peer;
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- if (!memcmp(peer->ra, ra, 6))
- return peer;
- }
- return NULL;
-}
-
-/* look-up a peer by its Location Area Identification (LAI) */
-struct gbproxy_peer *gbproxy_peer_by_lai(struct gbproxy_config *cfg,
- const uint8_t *la)
-{
- struct gbproxy_peer *peer;
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- if (!memcmp(peer->ra, la, 5))
- return peer;
- }
- return NULL;
-}
-
-/* look-up a peer by its Location Area Code (LAC) */
-struct gbproxy_peer *gbproxy_peer_by_lac(struct gbproxy_config *cfg,
- const uint8_t *la)
-{
- struct gbproxy_peer *peer;
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- if (!memcmp(peer->ra + 3, la + 3, 2))
- return peer;
- }
- return NULL;
-}
-
-struct gbproxy_peer *gbproxy_peer_by_bssgp_tlv(struct gbproxy_config *cfg,
- struct tlv_parsed *tp)
-{
- if (TLVP_PRESENT(tp, BSSGP_IE_BVCI)) {
- uint16_t bvci;
-
- bvci = ntohs(tlvp_val16_unal(tp, BSSGP_IE_BVCI));
- if (bvci >= 2)
- return gbproxy_peer_by_bvci(cfg, bvci);
- }
-
- if (TLVP_PRESENT(tp, BSSGP_IE_ROUTEING_AREA)) {
- uint8_t *rai = (uint8_t *)TLVP_VAL(tp, BSSGP_IE_ROUTEING_AREA);
- /* Only compare LAC part, since MCC/MNC are possibly patched.
- * Since the LAC of different BSS must be different when
- * MCC/MNC are patched, collisions shouldn't happen. */
- return gbproxy_peer_by_lac(cfg, rai);
- }
-
- if (TLVP_PRESENT(tp, BSSGP_IE_LOCATION_AREA)) {
- uint8_t *lai = (uint8_t *)TLVP_VAL(tp, BSSGP_IE_LOCATION_AREA);
- return gbproxy_peer_by_lac(cfg, lai);
- }
-
- return NULL;
-}
-
-static void clean_stale_timer_cb(void *data)
-{
- time_t now;
- struct timespec ts = {0,};
- struct gbproxy_peer *peer = (struct gbproxy_peer *) data;
-
- osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec;
- gbproxy_remove_stale_link_infos(peer, now);
- if (peer->cfg->clean_stale_timer_freq != 0)
- osmo_timer_schedule(&peer->clean_stale_timer,
- peer->cfg->clean_stale_timer_freq, 0);
-}
-
-struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvci)
-{
- struct gbproxy_peer *peer;
-
- peer = talloc_zero(tall_sgsn_ctx, struct gbproxy_peer);
- if (!peer)
- return NULL;
-
- peer->bvci = bvci;
- peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci);
- if (!peer->ctrg) {
- talloc_free(peer);
- return NULL;
- }
- peer->cfg = cfg;
-
- llist_add(&peer->list, &cfg->bts_peers);
-
- INIT_LLIST_HEAD(&peer->patch_state.logical_links);
-
- osmo_timer_setup(&peer->clean_stale_timer, clean_stale_timer_cb, peer);
- if (peer->cfg->clean_stale_timer_freq != 0)
- osmo_timer_schedule(&peer->clean_stale_timer,
- peer->cfg->clean_stale_timer_freq, 0);
-
- return peer;
-}
-
-void gbproxy_peer_free(struct gbproxy_peer *peer)
-{
- llist_del(&peer->list);
- osmo_timer_del(&peer->clean_stale_timer);
- gbproxy_delete_link_infos(peer);
-
- rate_ctr_group_free(peer->ctrg);
- peer->ctrg = NULL;
-
- talloc_free(peer);
-}
-
-int gbproxy_cleanup_peers(struct gbproxy_config *cfg, uint16_t nsei, uint16_t bvci)
-{
- int counter = 0;
- struct gbproxy_peer *peer, *tmp;
-
- llist_for_each_entry_safe(peer, tmp, &cfg->bts_peers, list) {
- if (peer->nsei != nsei)
- continue;
- if (bvci && peer->bvci != bvci)
- continue;
-
- gbproxy_peer_free(peer);
- counter += 1;
- }
-
- return counter;
-}
diff --git a/src/gbproxy/gb_proxy_tlli.c b/src/gbproxy/gb_proxy_tlli.c
deleted file mode 100644
index e9271c22c..000000000
--- a/src/gbproxy/gb_proxy_tlli.c
+++ /dev/null
@@ -1,725 +0,0 @@
-/* Gb-proxy TLLI state handling */
-
-/* (C) 2014 by On-Waves
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <osmocom/gsm/gsm48.h>
-
-#include <osmocom/sgsn/gb_proxy.h>
-
-#include <osmocom/sgsn/gprs_utils.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
-
-#include <osmocom/sgsn/debug.h>
-
-#include <osmocom/gsm/gsm_utils.h>
-
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/core/talloc.h>
-
-struct gbproxy_link_info *gbproxy_link_info_by_tlli(struct gbproxy_peer *peer,
- uint32_t tlli)
-{
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- if (!tlli)
- return NULL;
-
- llist_for_each_entry(link_info, &state->logical_links, list)
- if (link_info->tlli.current == tlli ||
- link_info->tlli.assigned == tlli)
- return link_info;
-
- return NULL;
-}
-
-struct gbproxy_link_info *gbproxy_link_info_by_ptmsi(
- struct gbproxy_peer *peer,
- uint32_t ptmsi)
-{
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- if (ptmsi == GSM_RESERVED_TMSI)
- return NULL;
-
- llist_for_each_entry(link_info, &state->logical_links, list)
- if (link_info->tlli.ptmsi == ptmsi)
- return link_info;
-
- return NULL;
-}
-
-struct gbproxy_link_info *gbproxy_link_info_by_any_sgsn_tlli(
- struct gbproxy_peer *peer,
- uint32_t tlli)
-{
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- if (!tlli)
- return NULL;
-
- /* Don't care about the NSEI */
- llist_for_each_entry(link_info, &state->logical_links, list)
- if (link_info->sgsn_tlli.current == tlli ||
- link_info->sgsn_tlli.assigned == tlli)
- return link_info;
-
- return NULL;
-}
-
-struct gbproxy_link_info *gbproxy_link_info_by_sgsn_tlli(
- struct gbproxy_peer *peer,
- uint32_t tlli, uint32_t sgsn_nsei)
-{
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- if (!tlli)
- return NULL;
-
- llist_for_each_entry(link_info, &state->logical_links, list)
- if ((link_info->sgsn_tlli.current == tlli ||
- link_info->sgsn_tlli.assigned == tlli) &&
- link_info->sgsn_nsei == sgsn_nsei)
- return link_info;
-
- return NULL;
-}
-
-struct gbproxy_link_info *gbproxy_link_info_by_imsi(
- struct gbproxy_peer *peer,
- const uint8_t *imsi,
- size_t imsi_len)
-{
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- if (!gprs_is_mi_imsi(imsi, imsi_len))
- return NULL;
-
- llist_for_each_entry(link_info, &state->logical_links, list) {
- if (link_info->imsi_len != imsi_len)
- continue;
- if (memcmp(link_info->imsi, imsi, imsi_len) != 0)
- continue;
-
- return link_info;
- }
-
- return NULL;
-}
-
-void gbproxy_link_info_discard_messages(struct gbproxy_link_info *link_info)
-{
- struct msgb *msg, *nxt;
-
- llist_for_each_entry_safe(msg, nxt, &link_info->stored_msgs, list) {
- llist_del(&msg->list);
- msgb_free(msg);
- }
-}
-
-void gbproxy_delete_link_info(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- gbproxy_link_info_discard_messages(link_info);
-
- llist_del(&link_info->list);
- talloc_free(link_info);
- state->logical_link_count -= 1;
-
- peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->logical_link_count;
-}
-
-void gbproxy_delete_link_infos(struct gbproxy_peer *peer)
-{
- struct gbproxy_link_info *link_info, *nxt;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- llist_for_each_entry_safe(link_info, nxt, &state->logical_links, list)
- gbproxy_delete_link_info(peer, link_info);
-
- OSMO_ASSERT(state->logical_link_count == 0);
- OSMO_ASSERT(llist_empty(&state->logical_links));
-}
-
-void gbproxy_attach_link_info(struct gbproxy_peer *peer, time_t now,
- struct gbproxy_link_info *link_info)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- link_info->timestamp = now;
- llist_add(&link_info->list, &state->logical_links);
- state->logical_link_count += 1;
-
- peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->logical_link_count;
-}
-
-int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
- int exceeded_max_len = 0;
- int deleted_count = 0;
- int check_for_age;
-
- if (peer->cfg->tlli_max_len > 0)
- exceeded_max_len =
- state->logical_link_count - peer->cfg->tlli_max_len;
-
- check_for_age = peer->cfg->tlli_max_age > 0;
-
- for (; exceeded_max_len > 0; exceeded_max_len--) {
- struct gbproxy_link_info *link_info;
- OSMO_ASSERT(!llist_empty(&state->logical_links));
- link_info = llist_entry(state->logical_links.prev,
- struct gbproxy_link_info,
- list);
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list "
- "(stale, length %d, max_len exceeded)\n",
- link_info->tlli.current, state->logical_link_count);
-
- gbproxy_delete_link_info(peer, link_info);
- deleted_count += 1;
- }
-
- while (check_for_age && !llist_empty(&state->logical_links)) {
- time_t age;
- struct gbproxy_link_info *link_info;
- link_info = llist_entry(state->logical_links.prev,
- struct gbproxy_link_info,
- list);
- age = now - link_info->timestamp;
- /* age < 0 only happens after system time jumps, discard entry */
- if (age <= peer->cfg->tlli_max_age && age >= 0) {
- check_for_age = 0;
- continue;
- }
-
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list "
- "(stale, age %d, max_age exceeded)\n",
- link_info->tlli.current, (int)age);
-
- gbproxy_delete_link_info(peer, link_info);
- deleted_count += 1;
- }
-
- return deleted_count;
-}
-
-struct gbproxy_link_info *gbproxy_link_info_alloc( struct gbproxy_peer *peer)
-{
- struct gbproxy_link_info *link_info;
-
- link_info = talloc_zero(peer, struct gbproxy_link_info);
- link_info->tlli.ptmsi = GSM_RESERVED_TMSI;
- link_info->sgsn_tlli.ptmsi = GSM_RESERVED_TMSI;
-
- link_info->vu_gen_tx_bss = GBPROXY_INIT_VU_GEN_TX;
-
- INIT_LLIST_HEAD(&link_info->stored_msgs);
-
- return link_info;
-}
-
-void gbproxy_detach_link_info(
- struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info)
-{
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- llist_del(&link_info->list);
- OSMO_ASSERT(state->logical_link_count > 0);
- state->logical_link_count -= 1;
-
- peer->ctrg->ctr[GBPROX_PEER_CTR_TLLI_CACHE_SIZE].current =
- state->logical_link_count;
-}
-
-void gbproxy_update_link_info(struct gbproxy_link_info *link_info,
- const uint8_t *imsi, size_t imsi_len)
-{
- if (!gprs_is_mi_imsi(imsi, imsi_len))
- return;
-
- link_info->imsi_len = imsi_len;
- link_info->imsi =
- talloc_realloc_size(link_info, link_info->imsi, imsi_len);
- OSMO_ASSERT(link_info->imsi != NULL);
- memcpy(link_info->imsi, imsi, imsi_len);
-}
-
-void gbproxy_reassign_tlli(struct gbproxy_tlli_state *tlli_state,
- struct gbproxy_peer *peer, uint32_t new_tlli)
-{
- if (new_tlli == tlli_state->current)
- return;
-
- LOGP(DGPRS, LOGL_INFO,
- "The TLLI has been reassigned from %08x to %08x\n",
- tlli_state->current, new_tlli);
-
- /* Remember assigned TLLI */
- tlli_state->assigned = new_tlli;
- tlli_state->bss_validated = false;
- tlli_state->net_validated = false;
-}
-
-uint32_t gbproxy_map_tlli(uint32_t other_tlli,
- struct gbproxy_link_info *link_info, int to_bss)
-{
- uint32_t tlli = 0;
- struct gbproxy_tlli_state *src, *dst;
- if (to_bss) {
- src = &link_info->sgsn_tlli;
- dst = &link_info->tlli;
- } else {
- src = &link_info->tlli;
- dst = &link_info->sgsn_tlli;
- }
- if (src->current == other_tlli)
- tlli = dst->current;
- else if (src->assigned == other_tlli)
- tlli = dst->assigned;
-
- return tlli;
-}
-
-static void gbproxy_validate_tlli(struct gbproxy_tlli_state *tlli_state,
- uint32_t tlli, int to_bss)
-{
- LOGP(DGPRS, LOGL_DEBUG,
- "%s({current = %08x, assigned = %08x, net_vld = %d, bss_vld = %d}, %08x)\n",
- __func__, tlli_state->current, tlli_state->assigned,
- tlli_state->net_validated, tlli_state->bss_validated, tlli);
-
- if (!tlli_state->assigned || tlli_state->assigned != tlli)
- return;
-
- /* TODO: Is this ok? Check spec */
- if (gprs_tlli_type(tlli) != TLLI_LOCAL)
- return;
-
- /* See GSM 04.08, 4.7.1.5 */
- if (to_bss)
- tlli_state->net_validated = true;
- else
- tlli_state->bss_validated = true;
-
- if (!tlli_state->bss_validated || !tlli_state->net_validated)
- return;
-
- LOGP(DGPRS, LOGL_INFO,
- "The TLLI %08x has been validated (was %08x)\n",
- tlli_state->assigned, tlli_state->current);
-
- tlli_state->current = tlli;
- tlli_state->assigned = 0;
-}
-
-static void gbproxy_touch_link_info(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info,
- time_t now)
-{
- gbproxy_detach_link_info(peer, link_info);
- gbproxy_attach_link_info(peer, now, link_info);
-}
-
-static int gbproxy_unregister_link_info(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info)
-{
- if (!link_info)
- return 1;
-
- if (link_info->tlli.ptmsi == GSM_RESERVED_TMSI && !link_info->imsi_len) {
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list (P-TMSI or IMSI are not set)\n",
- link_info->tlli.current);
- gbproxy_delete_link_info(peer, link_info);
- return 1;
- }
-
- link_info->tlli.current = 0;
- link_info->tlli.assigned = 0;
- link_info->sgsn_tlli.current = 0;
- link_info->sgsn_tlli.assigned = 0;
-
- link_info->is_deregistered = true;
-
- gbproxy_reset_link(link_info);
-
- return 0;
-}
-
-int gbproxy_imsi_matches(struct gbproxy_config *cfg,
- enum gbproxy_match_id match_id,
- struct gbproxy_link_info *link_info)
-{
- struct gbproxy_match *match;
- OSMO_ASSERT(match_id >= 0 && match_id < ARRAY_SIZE(cfg->matches));
-
- match = &cfg->matches[match_id];
- if (!match->enable)
- return 1;
-
- return link_info != NULL && link_info->is_matching[match_id];
-}
-
-static void gbproxy_assign_imsi(struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info,
- struct gprs_gb_parse_context *parse_ctx)
-{
- int imsi_matches;
- struct gbproxy_link_info *other_link_info;
- enum gbproxy_match_id match_id;
-
- /* Make sure that there is a second entry with the same IMSI */
- other_link_info = gbproxy_link_info_by_imsi(
- peer, parse_ctx->imsi, parse_ctx->imsi_len);
-
- if (other_link_info && other_link_info != link_info) {
- struct osmo_mobile_identity mi;
- if (osmo_mobile_identity_decode(&mi, parse_ctx->imsi, parse_ctx->imsi_len, false)
- || mi.type != GSM_MI_TYPE_IMSI) {
- LOGP(DGPRS, LOGL_ERROR, "Failed to decode Mobile Identity\n");
- } else {
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list (IMSI %s re-used)\n",
- other_link_info->tlli.current, mi.imsi);
- gbproxy_delete_link_info(peer, other_link_info);
- }
- }
-
- /* Update the IMSI field */
- gbproxy_update_link_info(link_info,
- parse_ctx->imsi, parse_ctx->imsi_len);
-
- /* Check, whether the IMSI matches */
- OSMO_ASSERT(ARRAY_SIZE(link_info->is_matching) ==
- ARRAY_SIZE(peer->cfg->matches));
- for (match_id = 0; match_id < ARRAY_SIZE(link_info->is_matching);
- ++match_id) {
- imsi_matches = gbproxy_check_imsi(
- &peer->cfg->matches[match_id],
- parse_ctx->imsi, parse_ctx->imsi_len);
- if (imsi_matches >= 0)
- link_info->is_matching[match_id] = imsi_matches ? true : false;
- }
-}
-
-static int gbproxy_tlli_match(const struct gbproxy_tlli_state *a,
- const struct gbproxy_tlli_state *b)
-{
- if (a->current && a->current == b->current)
- return 1;
-
- if (a->assigned && a->assigned == b->assigned)
- return 1;
-
- if (a->ptmsi != GSM_RESERVED_TMSI && a->ptmsi == b->ptmsi)
- return 1;
-
- return 0;
-}
-
-static void gbproxy_remove_matching_link_infos(
- struct gbproxy_peer *peer, struct gbproxy_link_info *link_info)
-{
- struct gbproxy_link_info *info, *nxt;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- /* Make sure that there is no second entry with the same P-TMSI or TLLI */
- llist_for_each_entry_safe(info, nxt, &state->logical_links, list) {
- if (info == link_info)
- continue;
-
- if (!gbproxy_tlli_match(&link_info->tlli, &info->tlli) &&
- (link_info->sgsn_nsei != info->sgsn_nsei ||
- !gbproxy_tlli_match(&link_info->sgsn_tlli, &info->sgsn_tlli)))
- continue;
-
- LOGP(DGPRS, LOGL_INFO,
- "Removing TLLI %08x from list (P-TMSI/TLLI re-used)\n",
- info->tlli.current);
- gbproxy_delete_link_info(peer, info);
- }
-}
-
-static struct gbproxy_link_info *gbproxy_get_link_info_ul(
- struct gbproxy_peer *peer,
- int *tlli_is_valid,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gbproxy_link_info *link_info = NULL;
-
- if (parse_ctx->tlli_enc) {
- link_info = gbproxy_link_info_by_tlli(peer, parse_ctx->tlli);
-
- if (link_info) {
- *tlli_is_valid = 1;
- return link_info;
- }
- }
-
- *tlli_is_valid = 0;
-
- if (!link_info && parse_ctx->imsi) {
- link_info = gbproxy_link_info_by_imsi(
- peer, parse_ctx->imsi, parse_ctx->imsi_len);
- }
-
- if (!link_info && parse_ctx->ptmsi_enc && !parse_ctx->old_raid_is_foreign) {
- uint32_t bss_ptmsi;
- gprs_parse_tmsi(parse_ctx->ptmsi_enc, &bss_ptmsi);
- link_info = gbproxy_link_info_by_ptmsi(peer, bss_ptmsi);
- }
-
- if (!link_info)
- return NULL;
-
- link_info->is_deregistered = false;
-
- return link_info;
-}
-
-struct gbproxy_link_info *gbproxy_update_link_state_ul(
- struct gbproxy_peer *peer,
- time_t now,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gbproxy_link_info *link_info;
- int tlli_is_valid;
-
- link_info = gbproxy_get_link_info_ul(peer, &tlli_is_valid, parse_ctx);
-
- if (parse_ctx->tlli_enc && parse_ctx->llc) {
- uint32_t sgsn_tlli;
-
- if (!link_info) {
- LOGP(DGPRS, LOGL_INFO, "Adding TLLI %08x to list\n",
- parse_ctx->tlli);
- link_info = gbproxy_link_info_alloc(peer);
- gbproxy_attach_link_info(peer, now, link_info);
-
- /* Setup TLLIs */
- sgsn_tlli = gbproxy_make_sgsn_tlli(peer, link_info,
- parse_ctx->tlli);
- link_info->sgsn_tlli.current = sgsn_tlli;
- link_info->tlli.current = parse_ctx->tlli;
- } else if (!tlli_is_valid) {
- /* New TLLI (info found by IMSI or P-TMSI) */
- link_info->tlli.current = parse_ctx->tlli;
- link_info->tlli.assigned = 0;
- link_info->sgsn_tlli.current =
- gbproxy_make_sgsn_tlli(peer, link_info,
- parse_ctx->tlli);
- link_info->sgsn_tlli.assigned = 0;
- gbproxy_touch_link_info(peer, link_info, now);
- } else {
- sgsn_tlli = gbproxy_map_tlli(parse_ctx->tlli, link_info, 0);
- if (!sgsn_tlli)
- sgsn_tlli = gbproxy_make_sgsn_tlli(peer, link_info,
- parse_ctx->tlli);
-
- gbproxy_validate_tlli(&link_info->tlli,
- parse_ctx->tlli, 0);
- gbproxy_validate_tlli(&link_info->sgsn_tlli,
- sgsn_tlli, 0);
- gbproxy_touch_link_info(peer, link_info, now);
- }
- } else if (link_info) {
- gbproxy_touch_link_info(peer, link_info, now);
- }
-
- if (parse_ctx->imsi && link_info && link_info->imsi_len == 0)
- gbproxy_assign_imsi(peer, link_info, parse_ctx);
-
- return link_info;
-}
-
-static struct gbproxy_link_info *gbproxy_get_link_info_dl(
- struct gbproxy_peer *peer,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gbproxy_link_info *link_info = NULL;
-
- /* Which key to use depends on its availability only, if that fails, do
- * not retry it with another key (e.g. IMSI). */
- if (parse_ctx->tlli_enc)
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, parse_ctx->tlli,
- parse_ctx->peer_nsei);
-
- /* TODO: Get link_info by (SGSN) P-TMSI if that is available (see
- * GSM 08.18, 7.2) instead of using the IMSI as key. */
- else if (parse_ctx->imsi)
- link_info = gbproxy_link_info_by_imsi(
- peer, parse_ctx->imsi, parse_ctx->imsi_len);
-
- if (link_info)
- link_info->is_deregistered = false;
-
- return link_info;
-}
-
-struct gbproxy_link_info *gbproxy_update_link_state_dl(
- struct gbproxy_peer *peer,
- time_t now,
- struct gprs_gb_parse_context *parse_ctx)
-{
- struct gbproxy_link_info *link_info = NULL;
-
- link_info = gbproxy_get_link_info_dl(peer, parse_ctx);
-
- if (parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && link_info) {
- /* A new P-TMSI has been signalled in the message,
- * register new TLLI */
- uint32_t new_sgsn_ptmsi;
- uint32_t new_bss_ptmsi = GSM_RESERVED_TMSI;
- gprs_parse_tmsi(parse_ctx->new_ptmsi_enc, &new_sgsn_ptmsi);
-
- if (link_info->sgsn_tlli.ptmsi == new_sgsn_ptmsi)
- new_bss_ptmsi = link_info->tlli.ptmsi;
-
- if (new_bss_ptmsi == GSM_RESERVED_TMSI)
- new_bss_ptmsi = gbproxy_make_bss_ptmsi(peer, new_sgsn_ptmsi);
-
- LOGP(DGPRS, LOGL_INFO,
- "Got new PTMSI %08x from SGSN, using %08x for BSS\n",
- new_sgsn_ptmsi, new_bss_ptmsi);
- /* Setup PTMSIs */
- link_info->sgsn_tlli.ptmsi = new_sgsn_ptmsi;
- link_info->tlli.ptmsi = new_bss_ptmsi;
- } else if (parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && !link_info &&
- !peer->cfg->patch_ptmsi) {
- /* A new P-TMSI has been signalled in the message with an unknown
- * TLLI, create a new link_info */
- /* TODO: Add a test case for this branch */
- uint32_t new_ptmsi;
- gprs_parse_tmsi(parse_ctx->new_ptmsi_enc, &new_ptmsi);
-
- LOGP(DGPRS, LOGL_INFO,
- "Adding TLLI %08x to list (SGSN, new P-TMSI is %08x)\n",
- parse_ctx->tlli, new_ptmsi);
-
- link_info = gbproxy_link_info_alloc(peer);
- link_info->sgsn_tlli.current = parse_ctx->tlli;
- link_info->tlli.current = parse_ctx->tlli;
- link_info->sgsn_tlli.ptmsi = new_ptmsi;
- link_info->tlli.ptmsi = new_ptmsi;
- gbproxy_attach_link_info(peer, now, link_info);
- } else if (parse_ctx->tlli_enc && parse_ctx->llc && !link_info &&
- !peer->cfg->patch_ptmsi) {
- /* Unknown SGSN TLLI, create a new link_info */
- uint32_t new_ptmsi;
- link_info = gbproxy_link_info_alloc(peer);
- LOGP(DGPRS, LOGL_INFO, "Adding TLLI %08x to list (SGSN)\n",
- parse_ctx->tlli);
-
- gbproxy_attach_link_info(peer, now, link_info);
-
- /* Setup TLLIs */
- link_info->sgsn_tlli.current = parse_ctx->tlli;
- link_info->tlli.current = parse_ctx->tlli;
-
- if (!parse_ctx->new_ptmsi_enc)
- return link_info;
- /* A new P-TMSI has been signalled in the message */
-
- gprs_parse_tmsi(parse_ctx->new_ptmsi_enc, &new_ptmsi);
- LOGP(DGPRS, LOGL_INFO,
- "Assigning new P-TMSI %08x\n", new_ptmsi);
- /* Setup P-TMSIs */
- link_info->sgsn_tlli.ptmsi = new_ptmsi;
- link_info->tlli.ptmsi = new_ptmsi;
- } else if (parse_ctx->tlli_enc && parse_ctx->llc && link_info) {
- uint32_t bss_tlli = gbproxy_map_tlli(parse_ctx->tlli,
- link_info, 1);
- gbproxy_validate_tlli(&link_info->sgsn_tlli, parse_ctx->tlli, 1);
- gbproxy_validate_tlli(&link_info->tlli, bss_tlli, 1);
- gbproxy_touch_link_info(peer, link_info, now);
- } else if (link_info) {
- gbproxy_touch_link_info(peer, link_info, now);
- }
-
- if (parse_ctx->imsi && link_info && link_info->imsi_len == 0)
- gbproxy_assign_imsi(peer, link_info, parse_ctx);
-
- return link_info;
-}
-
-int gbproxy_update_link_state_after(
- struct gbproxy_peer *peer,
- struct gbproxy_link_info *link_info,
- time_t now,
- struct gprs_gb_parse_context *parse_ctx)
-{
- int rc = 0;
- if (parse_ctx->invalidate_tlli && link_info) {
- int keep_info =
- peer->cfg->keep_link_infos == GBPROX_KEEP_ALWAYS ||
- (peer->cfg->keep_link_infos == GBPROX_KEEP_REATTACH &&
- parse_ctx->await_reattach) ||
- (peer->cfg->keep_link_infos == GBPROX_KEEP_IDENTIFIED &&
- link_info->imsi_len > 0);
- if (keep_info) {
- LOGP(DGPRS, LOGL_INFO, "Unregistering TLLI %08x\n",
- link_info->tlli.current);
- rc = gbproxy_unregister_link_info(peer, link_info);
- } else {
- LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n",
- link_info->tlli.current);
- gbproxy_delete_link_info(peer, link_info);
- rc = 1;
- }
- } else if (parse_ctx->to_bss && parse_ctx->tlli_enc &&
- parse_ctx->new_ptmsi_enc && link_info) {
- /* A new PTMSI has been signaled in the message,
- * register new TLLI */
- uint32_t new_sgsn_ptmsi = link_info->sgsn_tlli.ptmsi;
- uint32_t new_bss_ptmsi = link_info->tlli.ptmsi;
- uint32_t new_sgsn_tlli;
- uint32_t new_bss_tlli = 0;
-
- new_sgsn_tlli = gprs_tmsi2tlli(new_sgsn_ptmsi, TLLI_LOCAL);
- if (new_bss_ptmsi != GSM_RESERVED_TMSI)
- new_bss_tlli = gprs_tmsi2tlli(new_bss_ptmsi, TLLI_LOCAL);
- LOGP(DGPRS, LOGL_INFO,
- "Assigning new TLLI %08x to SGSN, %08x to BSS\n",
- new_sgsn_tlli, new_bss_tlli);
-
- gbproxy_reassign_tlli(&link_info->sgsn_tlli,
- peer, new_sgsn_tlli);
- gbproxy_reassign_tlli(&link_info->tlli,
- peer, new_bss_tlli);
- gbproxy_remove_matching_link_infos(peer, link_info);
- }
-
- gbproxy_remove_stale_link_infos(peer, now);
-
- return rc;
-}
-
-
diff --git a/src/gbproxy/gb_proxy_vty.c b/src/gbproxy/gb_proxy_vty.c
deleted file mode 100644
index 355b23fb1..000000000
--- a/src/gbproxy/gb_proxy_vty.c
+++ /dev/null
@@ -1,927 +0,0 @@
-/*
- * (C) 2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010 by On-Waves
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <time.h>
-#include <inttypes.h>
-
-#include <osmocom/core/talloc.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/gsm/gsm48.h>
-
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/gsm/apn.h>
-
-#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gb_proxy.h>
-#include <osmocom/sgsn/gprs_utils.h>
-#include <osmocom/sgsn/vty.h>
-
-#include <osmocom/vty/command.h>
-#include <osmocom/vty/vty.h>
-#include <osmocom/vty/misc.h>
-
-static struct gbproxy_config *g_cfg = NULL;
-
-/*
- * vty code for gbproxy below
- */
-static struct cmd_node gbproxy_node = {
- GBPROXY_NODE,
- "%s(config-gbproxy)# ",
- 1,
-};
-
-static const struct value_string keep_modes[] = {
- {GBPROX_KEEP_NEVER, "never"},
- {GBPROX_KEEP_REATTACH, "re-attach"},
- {GBPROX_KEEP_IDENTIFIED, "identified"},
- {GBPROX_KEEP_ALWAYS, "always"},
- {0, NULL}
-};
-
-static const struct value_string match_ids[] = {
- {GBPROX_MATCH_PATCHING, "patching"},
- {GBPROX_MATCH_ROUTING, "routing"},
- {0, NULL}
-};
-
-static void gbprox_vty_print_peer(struct vty *vty, struct gbproxy_peer *peer)
-{
- struct gprs_ra_id raid;
- gsm48_parse_ra(&raid, peer->ra);
-
- vty_out(vty, "NSEI %5u, PTP-BVCI %5u, "
- "RAI %s", peer->nsei, peer->bvci, osmo_rai_name(&raid));
- if (peer->blocked)
- vty_out(vty, " [BVC-BLOCKED]");
-
- vty_out(vty, "%s", VTY_NEWLINE);
-}
-
-static int config_write_gbproxy(struct vty *vty)
-{
- enum gbproxy_match_id match_id;
-
- vty_out(vty, "gbproxy%s", VTY_NEWLINE);
-
- vty_out(vty, " sgsn nsei %u%s", g_cfg->nsip_sgsn_nsei,
- VTY_NEWLINE);
-
- if (g_cfg->core_plmn.mcc > 0)
- vty_out(vty, " core-mobile-country-code %s%s",
- osmo_mcc_name(g_cfg->core_plmn.mcc), VTY_NEWLINE);
- if (g_cfg->core_plmn.mnc > 0)
- vty_out(vty, " core-mobile-network-code %s%s",
- osmo_mnc_name(g_cfg->core_plmn.mnc, g_cfg->core_plmn.mnc_3_digits), VTY_NEWLINE);
-
- for (match_id = 0; match_id < ARRAY_SIZE(g_cfg->matches); ++match_id) {
- struct gbproxy_match *match = &g_cfg->matches[match_id];
- if (match->re_str)
- vty_out(vty, " match-imsi %s %s%s",
- get_value_string(match_ids, match_id),
- match->re_str, VTY_NEWLINE);
- }
-
- if (g_cfg->core_apn != NULL) {
- if (g_cfg->core_apn_size > 0) {
- char str[500] = {0};
- vty_out(vty, " core-access-point-name %s%s",
- osmo_apn_to_str(str, g_cfg->core_apn,
- g_cfg->core_apn_size),
- VTY_NEWLINE);
- } else {
- vty_out(vty, " core-access-point-name none%s",
- VTY_NEWLINE);
- }
- }
-
- if (g_cfg->route_to_sgsn2)
- vty_out(vty, " secondary-sgsn nsei %u%s", g_cfg->nsip_sgsn2_nsei,
- VTY_NEWLINE);
-
- if (g_cfg->clean_stale_timer_freq > 0)
- vty_out(vty, " link-list clean-stale-timer %u%s",
- g_cfg->clean_stale_timer_freq, VTY_NEWLINE);
- if (g_cfg->tlli_max_age > 0)
- vty_out(vty, " link-list max-age %d%s",
- g_cfg->tlli_max_age, VTY_NEWLINE);
- if (g_cfg->tlli_max_len > 0)
- vty_out(vty, " link-list max-length %d%s",
- g_cfg->tlli_max_len, VTY_NEWLINE);
- vty_out(vty, " link-list keep-mode %s%s",
- get_value_string(keep_modes, g_cfg->keep_link_infos),
- VTY_NEWLINE);
- if (g_cfg->stored_msgs_max_len > 0)
- vty_out(vty, " link stored-msgs-max-length %"PRIu32"%s",
- g_cfg->stored_msgs_max_len, VTY_NEWLINE);
-
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy,
- cfg_gbproxy_cmd,
- "gbproxy",
- "Configure the Gb proxy")
-{
- vty->node = GBPROXY_NODE;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_nsip_sgsn_nsei,
- cfg_nsip_sgsn_nsei_cmd,
- "sgsn nsei <0-65534>",
- "SGSN information\n"
- "NSEI to be used in the connection with the SGSN\n"
- "The NSEI\n")
-{
- unsigned int nsei = atoi(argv[0]);
-
- if (g_cfg->route_to_sgsn2 && g_cfg->nsip_sgsn2_nsei == nsei) {
- vty_out(vty, "SGSN NSEI %d conflicts with secondary SGSN NSEI%s",
- nsei, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- g_cfg->nsip_sgsn_nsei = nsei;
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_CORE_MNC_STR "Use this network code for the core network\n"
-
-DEFUN(cfg_gbproxy_core_mnc,
- cfg_gbproxy_core_mnc_cmd,
- "core-mobile-network-code <1-999>",
- GBPROXY_CORE_MNC_STR "NCC value\n")
-{
- uint16_t mnc;
- bool mnc_3_digits;
- if (osmo_mnc_from_str(argv[0], &mnc, &mnc_3_digits)) {
- vty_out(vty, "%% Invalid MNC: %s%s", argv[0], VTY_NEWLINE);
- return CMD_WARNING;
- }
- g_cfg->core_plmn.mnc = mnc;
- g_cfg->core_plmn.mnc_3_digits = mnc_3_digits;
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_core_mnc,
- cfg_gbproxy_no_core_mnc_cmd,
- "no core-mobile-network-code",
- NO_STR GBPROXY_CORE_MNC_STR)
-{
- g_cfg->core_plmn.mnc = 0;
- g_cfg->core_plmn.mnc_3_digits = false;
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_CORE_MCC_STR "Use this country code for the core network\n"
-
-DEFUN(cfg_gbproxy_core_mcc,
- cfg_gbproxy_core_mcc_cmd,
- "core-mobile-country-code <1-999>",
- GBPROXY_CORE_MCC_STR "MCC value\n")
-{
- g_cfg->core_plmn.mcc = atoi(argv[0]);
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_core_mcc,
- cfg_gbproxy_no_core_mcc_cmd,
- "no core-mobile-country-code",
- NO_STR GBPROXY_CORE_MCC_STR)
-{
- g_cfg->core_plmn.mcc = 0;
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_MATCH_IMSI_STR "Restrict actions to certain IMSIs\n"
-
-DEFUN(cfg_gbproxy_match_imsi,
- cfg_gbproxy_match_imsi_cmd,
- "match-imsi (patching|routing) .REGEXP",
- GBPROXY_MATCH_IMSI_STR
- "Patch MS related information elements on match only\n"
- "Route to the secondary SGSN on match only\n"
- "Regular expression for the IMSI match\n")
-{
- const char *filter = argv[1];
- const char *err_msg = NULL;
- struct gbproxy_match *match;
- enum gbproxy_match_id match_id = get_string_value(match_ids, argv[0]);
-
- OSMO_ASSERT(match_id >= GBPROX_MATCH_PATCHING &&
- match_id < GBPROX_MATCH_LAST);
- match = &g_cfg->matches[match_id];
-
- if (gbproxy_set_patch_filter(match, filter, &err_msg) != 0) {
- vty_out(vty, "Match expression invalid: %s%s",
- err_msg, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- g_cfg->acquire_imsi = true;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_match_imsi,
- cfg_gbproxy_no_match_imsi_cmd,
- "no match-imsi",
- NO_STR GBPROXY_MATCH_IMSI_STR)
-{
- enum gbproxy_match_id match_id;
-
- for (match_id = 0; match_id < ARRAY_SIZE(g_cfg->matches); ++match_id)
- gbproxy_clear_patch_filter(&g_cfg->matches[match_id]);
-
- g_cfg->acquire_imsi = false;
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_CORE_APN_STR "Use this access point name (APN) for the backbone\n"
-#define GBPROXY_CORE_APN_ARG_STR "Replace APN by this string\n" "Remove APN\n"
-
-static int set_core_apn(struct vty *vty, const char *apn)
-{
- int apn_len;
-
- if (!apn) {
- talloc_free(g_cfg->core_apn);
- g_cfg->core_apn = NULL;
- g_cfg->core_apn_size = 0;
- return CMD_SUCCESS;
- }
-
- apn_len = strlen(apn);
-
- if (apn_len >= 100) {
- vty_out(vty, "APN string too long (max 99 chars)%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- if (apn_len == 0) {
- talloc_free(g_cfg->core_apn);
- /* TODO: replace NULL */
- g_cfg->core_apn = talloc_zero_size(NULL, 2);
- g_cfg->core_apn_size = 0;
- } else {
- /* TODO: replace NULL */
- g_cfg->core_apn =
- talloc_realloc_size(NULL, g_cfg->core_apn, apn_len + 1);
- g_cfg->core_apn_size =
- gprs_str_to_apn(g_cfg->core_apn, apn_len + 1, apn);
- }
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_core_apn,
- cfg_gbproxy_core_apn_cmd,
- "core-access-point-name (APN|none)",
- GBPROXY_CORE_APN_STR GBPROXY_CORE_APN_ARG_STR)
-{
- if (strcmp(argv[0], "none") == 0)
- return set_core_apn(vty, "");
- else
- return set_core_apn(vty, argv[0]);
-}
-
-DEFUN(cfg_gbproxy_no_core_apn,
- cfg_gbproxy_no_core_apn_cmd,
- "no core-access-point-name",
- NO_STR GBPROXY_CORE_APN_STR)
-{
- return set_core_apn(vty, NULL);
-}
-
-/* TODO: Remove the patch-ptmsi command, since P-TMSI patching is enabled
- * automatically when needed. This command is only left for manual testing
- * (e.g. doing P-TMSI patching without using a secondary SGSN)
- */
-#define GBPROXY_PATCH_PTMSI_STR "Patch P-TMSI/TLLI\n"
-
-DEFUN(cfg_gbproxy_patch_ptmsi,
- cfg_gbproxy_patch_ptmsi_cmd,
- "patch-ptmsi",
- GBPROXY_PATCH_PTMSI_STR)
-{
- g_cfg->patch_ptmsi = true;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_patch_ptmsi,
- cfg_gbproxy_no_patch_ptmsi_cmd,
- "no patch-ptmsi",
- NO_STR GBPROXY_PATCH_PTMSI_STR)
-{
- g_cfg->patch_ptmsi = false;
-
- return CMD_SUCCESS;
-}
-
-/* TODO: Remove the acquire-imsi command, since that feature is enabled
- * automatically when IMSI matching is enabled. This command is only left for
- * manual testing (e.g. doing IMSI acquisition without IMSI based patching)
- */
-#define GBPROXY_ACQUIRE_IMSI_STR "Acquire the IMSI before establishing a LLC connection (Experimental)\n"
-
-DEFUN(cfg_gbproxy_acquire_imsi,
- cfg_gbproxy_acquire_imsi_cmd,
- "acquire-imsi",
- GBPROXY_ACQUIRE_IMSI_STR)
-{
- g_cfg->acquire_imsi = true;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_acquire_imsi,
- cfg_gbproxy_no_acquire_imsi_cmd,
- "no acquire-imsi",
- NO_STR GBPROXY_ACQUIRE_IMSI_STR)
-{
- g_cfg->acquire_imsi = false;
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_SECOND_SGSN_STR "Route matching LLC connections to a second SGSN (Experimental)\n"
-
-DEFUN(cfg_gbproxy_secondary_sgsn,
- cfg_gbproxy_secondary_sgsn_cmd,
- "secondary-sgsn nsei <0-65534>",
- GBPROXY_SECOND_SGSN_STR
- "NSEI to be used in the connection with the SGSN\n"
- "The NSEI\n")
-{
- unsigned int nsei = atoi(argv[0]);
-
- if (g_cfg->nsip_sgsn_nsei == nsei) {
- vty_out(vty, "Secondary SGSN NSEI %d conflicts with primary SGSN NSEI%s",
- nsei, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- g_cfg->route_to_sgsn2 = true;
- g_cfg->nsip_sgsn2_nsei = nsei;
-
- g_cfg->patch_ptmsi = true;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_no_secondary_sgsn,
- cfg_gbproxy_no_secondary_sgsn_cmd,
- "no secondary-sgsn",
- NO_STR GBPROXY_SECOND_SGSN_STR)
-{
- g_cfg->route_to_sgsn2 = false;
- g_cfg->nsip_sgsn2_nsei = 0xFFFF;
-
- g_cfg->patch_ptmsi = false;
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_LINK_LIST_STR "Set TLLI list parameters\n"
-#define GBPROXY_LINK_STR "Set TLLI parameters\n"
-
-#define GBPROXY_CLEAN_STALE_TIMER_STR "Periodic timer to clean stale links\n"
-
-DEFUN(cfg_gbproxy_link_list_clean_stale_timer,
- cfg_gbproxy_link_list_clean_stale_timer_cmd,
- "link-list clean-stale-timer <1-999999>",
- GBPROXY_LINK_LIST_STR GBPROXY_CLEAN_STALE_TIMER_STR
- "Frequency at which the periodic timer is fired (in seconds)\n")
-{
- struct gbproxy_peer *peer;
- g_cfg->clean_stale_timer_freq = (unsigned int) atoi(argv[0]);
-
- /* Re-schedule running timers soon in case prev frequency was really big
- and new frequency is desired to be lower. After initial run, periodic
- time is used. Use random() to avoid firing timers for all peers at
- the same time */
- llist_for_each_entry(peer, &g_cfg->bts_peers, list)
- osmo_timer_schedule(&peer->clean_stale_timer,
- random() % 5, random() % 1000000);
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_list_no_clean_stale_timer,
- cfg_gbproxy_link_list_no_clean_stale_timer_cmd,
- "no link-list clean-stale-timer",
- NO_STR GBPROXY_LINK_LIST_STR GBPROXY_CLEAN_STALE_TIMER_STR)
-
-{
- struct gbproxy_peer *peer;
- g_cfg->clean_stale_timer_freq = 0;
-
- llist_for_each_entry(peer, &g_cfg->bts_peers, list)
- osmo_timer_del(&peer->clean_stale_timer);
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_MAX_AGE_STR "Limit maximum age\n"
-
-DEFUN(cfg_gbproxy_link_list_max_age,
- cfg_gbproxy_link_list_max_age_cmd,
- "link-list max-age <1-999999>",
- GBPROXY_LINK_LIST_STR GBPROXY_MAX_AGE_STR
- "Maximum age in seconds\n")
-{
- g_cfg->tlli_max_age = atoi(argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_list_no_max_age,
- cfg_gbproxy_link_list_no_max_age_cmd,
- "no link-list max-age",
- NO_STR GBPROXY_LINK_LIST_STR GBPROXY_MAX_AGE_STR)
-{
- g_cfg->tlli_max_age = 0;
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_MAX_LEN_STR "Limit list length\n"
-
-DEFUN(cfg_gbproxy_link_list_max_len,
- cfg_gbproxy_link_list_max_len_cmd,
- "link-list max-length <1-99999>",
- GBPROXY_LINK_LIST_STR GBPROXY_MAX_LEN_STR
- "Maximum number of logical links in the list\n")
-{
- g_cfg->tlli_max_len = atoi(argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_list_no_max_len,
- cfg_gbproxy_link_list_no_max_len_cmd,
- "no link-list max-length",
- NO_STR GBPROXY_LINK_LIST_STR GBPROXY_MAX_LEN_STR)
-{
- g_cfg->tlli_max_len = 0;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_list_keep_mode,
- cfg_gbproxy_link_list_keep_mode_cmd,
- "link-list keep-mode (never|re-attach|identified|always)",
- GBPROXY_LINK_LIST_STR "How to keep entries for detached logical links\n"
- "Discard entry immediately after detachment\n"
- "Keep entry if a re-attachment has be requested\n"
- "Keep entry if it associated with an IMSI\n"
- "Don't discard entries after detachment\n")
-{
- int val = get_string_value(keep_modes, argv[0]);
- OSMO_ASSERT(val >= GBPROX_KEEP_NEVER && val <= GBPROX_KEEP_ALWAYS);
- g_cfg->keep_link_infos = val;
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_stored_msgs_max_len,
- cfg_gbproxy_link_stored_msgs_max_len_cmd,
- "link stored-msgs-max-length <1-99999>",
- GBPROXY_LINK_STR GBPROXY_MAX_LEN_STR
- "Maximum number of msgb stored in the logical link waiting to acquire its IMSI\n")
-{
- g_cfg->stored_msgs_max_len = (uint32_t) atoi(argv[0]);
-
- return CMD_SUCCESS;
-}
-
-DEFUN(cfg_gbproxy_link_no_stored_msgs_max_len,
- cfg_gbproxy_link_no_stored_msgs_max_len_cmd,
- "no link stored-msgs-max-length",
- NO_STR GBPROXY_LINK_STR GBPROXY_MAX_LEN_STR)
-{
- g_cfg->stored_msgs_max_len = 0;
-
- return CMD_SUCCESS;
-}
-
-
-DEFUN(show_gbproxy, show_gbproxy_cmd, "show gbproxy [stats]",
- SHOW_STR "Display information about the Gb proxy\n" "Show statistics\n")
-{
- struct gbproxy_peer *peer;
- int show_stats = argc >= 1;
-
- if (show_stats)
- vty_out_rate_ctr_group(vty, "", g_cfg->ctrg);
-
- llist_for_each_entry(peer, &g_cfg->bts_peers, list) {
- gbprox_vty_print_peer(vty, peer);
-
- if (show_stats)
- vty_out_rate_ctr_group(vty, " ", peer->ctrg);
- }
- return CMD_SUCCESS;
-}
-
-DEFUN(show_gbproxy_links, show_gbproxy_links_cmd, "show gbproxy links",
- SHOW_STR "Display information about the Gb proxy\n" "Show logical links\n")
-{
- struct gbproxy_peer *peer;
- time_t now;
- struct timespec ts = {0,};
-
- osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec;
-
- llist_for_each_entry(peer, &g_cfg->bts_peers, list) {
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
-
- gbprox_vty_print_peer(vty, peer);
-
- llist_for_each_entry(link_info, &state->logical_links, list) {
- time_t age = now - link_info->timestamp;
- struct osmo_mobile_identity mi;
- const char *imsi_str;
-
- if (link_info->imsi > 0) {
- if (osmo_mobile_identity_decode(&mi, link_info->imsi, link_info->imsi_len, false)
- || mi.type != GSM_MI_TYPE_IMSI)
- imsi_str = "(invalid)";
- else
- imsi_str = mi.imsi;
- } else {
- imsi_str = "(none)";
- }
- vty_out(vty, " TLLI %08x, IMSI %s, AGE %d",
- link_info->tlli.current, imsi_str, (int)age);
-
- if (link_info->stored_msgs_len)
- vty_out(vty, ", STORED %"PRIu32"/%"PRIu32,
- link_info->stored_msgs_len,
- g_cfg->stored_msgs_max_len);
-
- if (g_cfg->route_to_sgsn2)
- vty_out(vty, ", SGSN NSEI %d",
- link_info->sgsn_nsei);
-
- if (link_info->is_deregistered)
- vty_out(vty, ", DE-REGISTERED");
-
- vty_out(vty, "%s", VTY_NEWLINE);
- }
- }
- return CMD_SUCCESS;
-}
-
-DEFUN(delete_gb_bvci, delete_gb_bvci_cmd,
- "delete-gbproxy-peer <0-65534> bvci <2-65534>",
- "Delete a GBProxy peer by NSEI and optionally BVCI\n"
- "NSEI number\n"
- "Only delete peer with a matching BVCI\n"
- "BVCI number\n")
-{
- const uint16_t nsei = atoi(argv[0]);
- const uint16_t bvci = atoi(argv[1]);
- int counter;
-
- counter = gbproxy_cleanup_peers(g_cfg, nsei, bvci);
-
- if (counter == 0) {
- vty_out(vty, "BVC not found%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- return CMD_SUCCESS;
-}
-
-DEFUN(delete_gb_nsei, delete_gb_nsei_cmd,
- "delete-gbproxy-peer <0-65534> (only-bvc|only-nsvc|all) [dry-run]",
- "Delete a GBProxy peer by NSEI and optionally BVCI\n"
- "NSEI number\n"
- "Only delete BSSGP connections (BVC)\n"
- "Only delete dynamic NS connections (NS-VC)\n"
- "Delete BVC and dynamic NS connections\n"
- "Show what would be deleted instead of actually deleting\n"
- )
-{
- const uint16_t nsei = atoi(argv[0]);
- const char *mode = argv[1];
- int dry_run = argc > 2;
- int delete_bvc = 0;
- int delete_nsvc = 0;
- int counter;
-
- if (strcmp(mode, "only-bvc") == 0)
- delete_bvc = 1;
- else if (strcmp(mode, "only-nsvc") == 0)
- delete_nsvc = 1;
- else
- delete_bvc = delete_nsvc = 1;
-
- if (delete_bvc) {
- if (!dry_run)
- counter = gbproxy_cleanup_peers(g_cfg, nsei, 0);
- else {
- struct gbproxy_peer *peer;
- counter = 0;
- llist_for_each_entry(peer, &g_cfg->bts_peers, list) {
- if (peer->nsei != nsei)
- continue;
-
- vty_out(vty, "BVC: ");
- gbprox_vty_print_peer(vty, peer);
- counter += 1;
- }
- }
- vty_out(vty, "%sDeleted %d BVC%s",
- dry_run ? "Not " : "", counter, VTY_NEWLINE);
- }
-
- if (delete_nsvc) {
- struct gprs_ns_inst *nsi = g_cfg->nsi;
- struct gprs_nsvc *nsvc, *nsvc2;
-
- counter = 0;
- llist_for_each_entry_safe(nsvc, nsvc2, &nsi->gprs_nsvcs, list) {
- if (nsvc->nsei != nsei)
- continue;
- if (nsvc->persistent)
- continue;
-
- if (!dry_run)
- gprs_nsvc_delete(nsvc);
- else
- vty_out(vty, "NS-VC: NSEI %5u, NS-VCI %5u, "
- "remote %s%s",
- nsvc->nsei, nsvc->nsvci,
- gprs_ns_ll_str(nsvc), VTY_NEWLINE);
- counter += 1;
- }
- vty_out(vty, "%sDeleted %d NS-VC%s",
- dry_run ? "Not " : "", counter, VTY_NEWLINE);
- }
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_DELETE_LINK_STR \
- "Delete a GBProxy logical link entry by NSEI and identification\nNSEI number\n"
-
-DEFUN(delete_gb_link_by_id, delete_gb_link_by_id_cmd,
- "delete-gbproxy-link <0-65534> (tlli|imsi|sgsn-nsei) IDENT",
- GBPROXY_DELETE_LINK_STR
- "Delete entries with a matching TLLI (hex)\n"
- "Delete entries with a matching IMSI\n"
- "Delete entries with a matching SGSN NSEI\n"
- "Identification to match\n")
-{
- const uint16_t nsei = atoi(argv[0]);
- enum {MATCH_TLLI = 't', MATCH_IMSI = 'i', MATCH_SGSN = 's'} match;
- uint32_t ident = 0;
- const char *imsi = NULL;
- struct gbproxy_peer *peer = 0;
- struct gbproxy_link_info *link_info, *nxt;
- struct gbproxy_patch_state *state;
- int found = 0;
-
- match = argv[1][0];
-
- switch (match) {
- case MATCH_TLLI: ident = strtoll(argv[2], NULL, 16); break;
- case MATCH_IMSI: imsi = argv[2]; break;
- case MATCH_SGSN: ident = strtoll(argv[2], NULL, 0); break;
- };
-
- peer = gbproxy_peer_by_nsei(g_cfg, nsei);
- if (!peer) {
- vty_out(vty, "Didn't find peer with NSEI %d%s",
- nsei, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- state = &peer->patch_state;
-
- llist_for_each_entry_safe(link_info, nxt, &state->logical_links, list) {
- struct osmo_mobile_identity mi;
-
- switch (match) {
- case MATCH_TLLI:
- if (link_info->tlli.current != ident)
- continue;
- break;
- case MATCH_SGSN:
- if (link_info->sgsn_nsei != ident)
- continue;
- break;
- case MATCH_IMSI:
- if (!link_info->imsi)
- continue;
- if (osmo_mobile_identity_decode(&mi, link_info->imsi, link_info->imsi_len, false)
- || mi.type != GSM_MI_TYPE_IMSI)
- continue;
- if (strcmp(mi.imsi, imsi) != 0)
- continue;
- break;
- }
-
- vty_out(vty, "Deleting link with TLLI %08x%s", link_info->tlli.current,
- VTY_NEWLINE);
- gbproxy_delete_link_info(peer, link_info);
- found += 1;
- }
-
- if (!found && argc >= 2) {
- vty_out(vty, "Didn't find link entry with %s %s%s",
- argv[1], argv[2], VTY_NEWLINE);
- }
-
- return CMD_SUCCESS;
-}
-
-DEFUN(delete_gb_link, delete_gb_link_cmd,
- "delete-gbproxy-link <0-65534> (stale|de-registered)",
- GBPROXY_DELETE_LINK_STR
- "Delete stale entries\n"
- "Delete de-registered entries\n")
-{
- const uint16_t nsei = atoi(argv[0]);
- enum {MATCH_STALE = 's', MATCH_DEREGISTERED = 'd'} match;
- struct gbproxy_peer *peer = 0;
- struct gbproxy_link_info *link_info, *nxt;
- struct gbproxy_patch_state *state;
- time_t now;
- struct timespec ts = {0,};
-
- int found = 0;
-
- match = argv[1][0];
-
- peer = gbproxy_peer_by_nsei(g_cfg, nsei);
- if (!peer) {
- vty_out(vty, "Didn't find peer with NSEI %d%s",
- nsei, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- state = &peer->patch_state;
-
- osmo_clock_gettime(CLOCK_MONOTONIC, &ts);
- now = ts.tv_sec;
-
- if (match == MATCH_STALE) {
- found = gbproxy_remove_stale_link_infos(peer, now);
- if (found)
- vty_out(vty, "Deleted %d stale logical link%s%s",
- found, found == 1 ? "" : "s", VTY_NEWLINE);
- } else {
- llist_for_each_entry_safe(link_info, nxt,
- &state->logical_links, list) {
- if (!link_info->is_deregistered)
- continue;
-
- gbproxy_delete_link_info(peer, link_info);
- found += 1;
- }
- }
-
- if (found)
- vty_out(vty, "Deleted %d %s logical link%s%s",
- found, argv[1], found == 1 ? "" : "s", VTY_NEWLINE);
-
- return CMD_SUCCESS;
-}
-
-/*
- * legacy commands to provide an upgrade path from "broken" releases
- * or pre-releases
- */
-DEFUN_DEPRECATED(cfg_gbproxy_broken_apn_match,
- cfg_gbproxy_broken_apn_match_cmd,
- "core-access-point-name none match-imsi .REGEXP",
- GBPROXY_CORE_APN_STR GBPROXY_MATCH_IMSI_STR "Remove APN\n"
- "Patch MS related information elements on match only\n"
- "Route to the secondary SGSN on match only\n"
- "Regular expression for the IMSI match\n")
-{
- const char *filter = argv[0];
- const char *err_msg = NULL;
- struct gbproxy_match *match;
- enum gbproxy_match_id match_id = get_string_value(match_ids, "patching");
-
- /* apply APN none */
- set_core_apn(vty, "");
-
- /* do the matching... with copy and paste */
- OSMO_ASSERT(match_id >= GBPROX_MATCH_PATCHING &&
- match_id < GBPROX_MATCH_LAST);
- match = &g_cfg->matches[match_id];
-
- if (gbproxy_set_patch_filter(match, filter, &err_msg) != 0) {
- vty_out(vty, "Match expression invalid: %s%s",
- err_msg, VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- g_cfg->acquire_imsi = true;
-
- return CMD_SUCCESS;
-}
-
-#define GBPROXY_TLLI_LIST_STR "Set TLLI list parameters\n"
-#define GBPROXY_MAX_LEN_STR "Limit list length\n"
-DEFUN_DEPRECATED(cfg_gbproxy_depr_tlli_list_max_len,
- cfg_gbproxy_depr_tlli_list_max_len_cmd,
- "tlli-list max-length <1-99999>",
- GBPROXY_TLLI_LIST_STR GBPROXY_MAX_LEN_STR
- "Maximum number of TLLIs in the list\n")
-{
- g_cfg->tlli_max_len = atoi(argv[0]);
-
- return CMD_SUCCESS;
-}
-
-int gbproxy_vty_init(void)
-{
- install_element_ve(&show_gbproxy_cmd);
- install_element_ve(&show_gbproxy_links_cmd);
-
- install_element(ENABLE_NODE, &delete_gb_bvci_cmd);
- install_element(ENABLE_NODE, &delete_gb_nsei_cmd);
- install_element(ENABLE_NODE, &delete_gb_link_by_id_cmd);
- install_element(ENABLE_NODE, &delete_gb_link_cmd);
-
- install_element(CONFIG_NODE, &cfg_gbproxy_cmd);
- install_node(&gbproxy_node, config_write_gbproxy);
- install_element(GBPROXY_NODE, &cfg_nsip_sgsn_nsei_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_core_mcc_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_core_mnc_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_match_imsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_core_apn_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_secondary_sgsn_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_patch_ptmsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_acquire_imsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_clean_stale_timer_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_max_age_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_max_len_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_keep_mode_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_stored_msgs_max_len_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_mcc_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_mnc_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_match_imsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_core_apn_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_secondary_sgsn_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_patch_ptmsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_no_acquire_imsi_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_no_clean_stale_timer_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_no_max_age_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_list_no_max_len_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_link_no_stored_msgs_max_len_cmd);
-
- /* broken or deprecated to allow an upgrade path */
- install_element(GBPROXY_NODE, &cfg_gbproxy_broken_apn_match_cmd);
- install_element(GBPROXY_NODE, &cfg_gbproxy_depr_tlli_list_max_len_cmd);
-
- return 0;
-}
-
-int gbproxy_parse_config(const char *config_file, struct gbproxy_config *cfg)
-{
- int rc;
-
- g_cfg = cfg;
- rc = vty_read_config_file(config_file, NULL);
- if (rc < 0) {
- fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);
- return rc;
- }
-
- return 0;
-}
diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am
index 170ded8fc..1533dc070 100644
--- a/src/gprs/Makefile.am
+++ b/src/gprs/Makefile.am
@@ -29,7 +29,6 @@ endif
noinst_LTLIBRARIES = libcommon.la
libcommon_la_SOURCES = \
- gprs_gb_parse.c \
gprs_llc_parse.c \
crc24.c \
gprs_utils.c \
diff --git a/src/gprs/crc24.c b/src/gprs/crc24.c
index da269b375..d47d4ff82 100644
--- a/src/gprs/crc24.c
+++ b/src/gprs/crc24.c
@@ -59,7 +59,7 @@ static const uint32_t tbl_crc24[256] = {
#define INIT_CRC24 0xffffff
-uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len)
+uint32_t crc24_calc(uint32_t fcs, const uint8_t *cp, unsigned int len)
{
while (len--)
fcs = (fcs >> 8) ^ tbl_crc24[(fcs ^ *cp++) & 0xff];
diff --git a/src/gprs/gprs_llc_parse.c b/src/gprs/gprs_llc_parse.c
index 1d97004e0..d099cdaf3 100644
--- a/src/gprs/gprs_llc_parse.c
+++ b/src/gprs/gprs_llc_parse.c
@@ -29,7 +29,7 @@
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/crc24.h>
@@ -55,7 +55,7 @@ static const struct value_string llc_cmd_strs[] = {
#define N202 4
#define CRC24_LENGTH 3
-int gprs_llc_fcs(uint8_t *data, unsigned int len)
+int gprs_llc_fcs(const uint8_t *data, unsigned int len)
{
uint32_t fcs_calc;
diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c
index 13641c1e1..46028c63c 100644
--- a/src/gprs/gprs_utils.c
+++ b/src/gprs/gprs_utils.c
@@ -22,7 +22,7 @@
#include <osmocom/sgsn/gprs_utils.h>
#include <osmocom/core/msgb.h>
-#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
@@ -30,56 +30,6 @@
#include <string.h>
-int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str)
-{
- uint8_t *last_len_field;
- int len;
-
- /* Can we even write the length field to the output? */
- if (max_len == 0)
- return -1;
-
- /* Remember where we need to put the length once we know it */
- last_len_field = apn_enc;
- len = 1;
- apn_enc += 1;
-
- while (str[0]) {
- if (len >= max_len)
- return -1;
-
- if (str[0] == '.') {
- *last_len_field = (apn_enc - last_len_field) - 1;
- last_len_field = apn_enc;
- } else {
- *apn_enc = str[0];
- }
- apn_enc += 1;
- str += 1;
- len += 1;
- }
-
- *last_len_field = (apn_enc - last_len_field) - 1;
-
- return len;
-}
-
-/* GSM 04.08, 10.5.7.3 GPRS Timer */
-int gprs_tmr_to_secs(uint8_t tmr)
-{
- switch (tmr & GPRS_TMR_UNIT_MASK) {
- case GPRS_TMR_2SECONDS:
- return 2 * (tmr & GPRS_TMR_FACT_MASK);
- default:
- case GPRS_TMR_MINUTE:
- return 60 * (tmr & GPRS_TMR_FACT_MASK);
- case GPRS_TMR_6MINUTE:
- return 360 * (tmr & GPRS_TMR_FACT_MASK);
- case GPRS_TMR_DEACTIVATED:
- return -1;
- }
-}
-
/* This functions returns a tmr value such that
* - f is monotonic
* - f(s) <= s
@@ -132,19 +82,6 @@ int gprs_is_mi_imsi(const uint8_t *value, size_t value_len)
return 1;
}
-int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi)
-{
- uint32_t tmsi_be;
-
- if (!gprs_is_mi_tmsi(value, value_len))
- return 0;
-
- memcpy(&tmsi_be, value + 1, sizeof(tmsi_be));
-
- *tmsi = ntohl(tmsi_be);
- return 1;
-}
-
void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi)
{
uint32_t tmsi_be;
diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c
index 38e31e131..81ab83540 100644
--- a/src/gprs/sgsn_ares.c
+++ b/src/gprs/sgsn_ares.c
@@ -24,8 +24,6 @@
#include <netdb.h>
-extern void *tall_sgsn_ctx;
-
struct cares_event_fd {
struct llist_head head;
struct osmo_fd fd;
@@ -120,14 +118,14 @@ static void setup_ares_osmo_fd(void *data, int fd, int read, int write)
update_fd:
if (read)
- ufd->fd.when |= OSMO_FD_READ;
+ osmo_fd_read_enable(&ufd->fd);
else
- ufd->fd.when &= ~OSMO_FD_READ;
+ osmo_fd_read_disable(&ufd->fd);
if (write)
- ufd->fd.when |= OSMO_FD_WRITE;
+ osmo_fd_write_enable(&ufd->fd);
else
- ufd->fd.when &= ~OSMO_FD_WRITE;
+ osmo_fd_write_disable(&ufd->fd);
osmo_ares_reschedule(sgsn);
}
diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c
index c95696af4..937e6a4ff 100644
--- a/src/gtphub/gtphub.c
+++ b/src/gtphub/gtphub.c
@@ -32,7 +32,7 @@
#include <gtp.h>
#include <gtpie.h>
-#include <osmocom/sgsn/gtphub.h>
+#include <osmocom/gtphub/gtphub.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_utils.h>
@@ -59,15 +59,6 @@ void *osmo_gtphub_ctx;
/* TODO move this to osmocom/core/select.h ? */
typedef int (*osmo_fd_cb_t)(struct osmo_fd *fd, unsigned int what);
-/* TODO move this to osmocom/core/linuxlist.h ? */
-#define __llist_first(head) (((head)->next == (head)) ? NULL : (head)->next)
-#define llist_first(head, type, entry) \
- llist_entry(__llist_first(head), type, entry)
-
-#define __llist_last(head) (((head)->next == (head)) ? NULL : (head)->prev)
-#define llist_last(head, type, entry) \
- llist_entry(__llist_last(head), type, entry)
-
/* TODO move GTP header stuff to openggsn/gtp/ ? See gtp_decaps*() */
enum gtp_rc {
@@ -484,7 +475,7 @@ static int get_ie_imsi_str(union gtpie_member *ie[], int i,
* present but cannot be decoded. */
static int get_ie_apn_str(union gtpie_member *ie[], const char **apn_str)
{
- static char apn_buf[GSM_APN_LENGTH];
+ static char apn_buf[APN_MAXLEN+1];
unsigned int len;
if (gtpie_gettlv(ie, GTPIE_APN, 0,
&len, apn_buf, sizeof(apn_buf)) != 0)
@@ -613,7 +604,7 @@ void expiry_add(struct expiry *exq, struct expiring_item *item, time_t now)
OSMO_ASSERT(llist_empty(&exq->items)
|| (item->expiry
- >= llist_last(&exq->items, struct expiring_item, entry)->expiry));
+ >= llist_last_entry(&exq->items, struct expiring_item, entry)->expiry));
/* Add/move to the tail to always sort by expiry, ascending. */
llist_del(&item->entry);
@@ -853,10 +844,7 @@ static int gtphub_sock_init(struct osmo_fd *ofd,
return -1;
}
- ofd->when = OSMO_FD_READ;
- ofd->cb = cb;
- ofd->data = data;
- ofd->priv_nr = ofd_id;
+ osmo_fd_setup(ofd, -1, OSMO_FD_READ, cb, data, ofd_id);
int rc;
rc = osmo_sock_init_ofd(ofd,
@@ -983,7 +971,7 @@ static inline void set_tei(struct gtp_packet_desc *p, uint32_t tei)
static void gtphub_mapping_del_cb(struct expiring_item *expi);
-static struct nr_mapping *gtphub_mapping_new()
+static struct nr_mapping *gtphub_mapping_new(void)
{
struct nr_mapping *nrm;
nrm = talloc_zero(osmo_gtphub_ctx, struct nr_mapping);
@@ -1007,7 +995,7 @@ static const char *gtphub_tunnel_side_str(struct gtphub_tunnel *tun,
char *pos = buf;
int left = sizeof(buf);
int l;
-
+
struct gtphub_tunnel_endpoint *c, *u;
c = &tun->endpoint[side_idx][GTPH_PLANE_CTRL];
u = &tun->endpoint[side_idx][GTPH_PLANE_USER];
@@ -1116,7 +1104,7 @@ static void gtphub_tunnel_del_cb(struct expiring_item *expi)
/* rate counter index for hubs: [7; 10] */
#define CTR_IDX_HUB(s, p) CTR_IDX(s, p, 3, 2)
-static struct gtphub_tunnel *gtphub_tunnel_new()
+static struct gtphub_tunnel *gtphub_tunnel_new(void)
{
struct gtphub_tunnel *tun;
tun = talloc_zero(osmo_gtphub_ctx, struct gtphub_tunnel);
@@ -1145,9 +1133,7 @@ static const char *gtphub_peer_strb(struct gtphub_peer *peer, char *buf,
if (llist_empty(&peer->addresses))
return "(addressless)";
- struct gtphub_peer_addr *a = llist_first(&peer->addresses,
- struct gtphub_peer_addr,
- entry);
+ struct gtphub_peer_addr *a = llist_first_entry_or_null(&peer->addresses, struct gtphub_peer_addr, entry);
return gsn_addr_to_strb(&a->addr, buf, buflen);
}
@@ -2128,7 +2114,7 @@ int gtphub_handle_buf(struct gtphub *hub,
struct gtphub_bind *from_bind = &hub->to_gsns[side_idx][plane_idx];
struct gtphub_bind *to_bind = &hub->to_gsns[other_side_idx(side_idx)][plane_idx];
- rate_ctr_add(&from_bind->counters_io->ctr[GTPH_CTR_BYTES_IN],
+ rate_ctr_add(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_BYTES_IN),
received);
struct gtp_packet_desc p;
@@ -2150,7 +2136,7 @@ int gtphub_handle_buf(struct gtphub *hub,
return -1;
}
- rate_ctr_inc(&from_bind->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_PKTS_IN));
int reply_len;
reply_len = gtphub_handle_echo_req(hub, &p, reply_buf);
@@ -2159,8 +2145,8 @@ int gtphub_handle_buf(struct gtphub *hub,
sgsn_sockaddr_copy(to_addr, from_addr);
*to_ofd = &from_bind->ofd;
- rate_ctr_inc(&from_bind->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
- rate_ctr_add(&from_bind->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+ rate_ctr_inc(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_PKTS_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_BYTES_OUT),
reply_len);
LOG(LOGL_DEBUG, "%s Echo response to %s: %d bytes to %s\n",
(side_idx == GTPH_SIDE_GGSN)? "-->" : "<--",
@@ -2239,9 +2225,9 @@ int gtphub_handle_buf(struct gtphub *hub,
return -1;
}
- rate_ctr_add(&from_peer->counters_io->ctr[GTPH_CTR_BYTES_IN],
+ rate_ctr_add(rate_ctr_group_get_ctr(from_peer->counters_io, GTPH_CTR_BYTES_IN),
received);
- rate_ctr_inc(&from_peer->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(from_peer->counters_io, GTPH_CTR_PKTS_IN));
LOG(LOGL_DEBUG, "from %s peer: %s\n", gtphub_side_idx_names[side_idx],
gtphub_port_str(from_peer));
@@ -2260,9 +2246,9 @@ int gtphub_handle_buf(struct gtphub *hub,
if (p.tun) {
struct gtphub_tunnel_endpoint *te = &p.tun->endpoint[p.side_idx][p.plane_idx];
- rate_ctr_add(&te->counters_io->ctr[GTPH_CTR_BYTES_IN],
+ rate_ctr_add(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_BYTES_IN),
received);
- rate_ctr_inc(&te->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_PKTS_IN));
}
if ((!to_peer) && (side_idx == GTPH_SIDE_SGSN)) {
@@ -2297,7 +2283,7 @@ int gtphub_handle_buf(struct gtphub *hub,
!= 0)
return -1;
}
-
+
/* Either to_peer was resolved from an existing tunnel,
* or a PDP Ctx and thus a tunnel has just been created,
* or the tunnel has been deleted due to this message. */
@@ -2314,19 +2300,19 @@ int gtphub_handle_buf(struct gtphub *hub,
*reply_buf = (uint8_t*)p.data;
if (received) {
- rate_ctr_inc(&to_bind->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
- rate_ctr_add(&to_bind->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+ rate_ctr_inc(rate_ctr_group_get_ctr(to_bind->counters_io, GTPH_CTR_PKTS_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(to_bind->counters_io, GTPH_CTR_BYTES_OUT),
received);
- rate_ctr_inc(&to_peer->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
- rate_ctr_add(&to_peer->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+ rate_ctr_inc(rate_ctr_group_get_ctr(to_peer->counters_io, GTPH_CTR_PKTS_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(to_peer->counters_io, GTPH_CTR_BYTES_OUT),
received);
}
if (p.tun) {
struct gtphub_tunnel_endpoint *te = &p.tun->endpoint[other_side_idx(p.side_idx)][p.plane_idx];
- rate_ctr_inc(&te->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
- rate_ctr_add(&te->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+ rate_ctr_inc(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_PKTS_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_BYTES_OUT),
received);
}
@@ -2704,7 +2690,7 @@ static struct gtphub_peer_addr *gtphub_addr_have(struct gtphub *hub,
struct gtphub_peer *peer = gtphub_peer_new(hub, bind);
a = gtphub_peer_add_addr(peer, addr);
-
+
LOG(LOGL_DEBUG, "New peer address: %s %s\n",
bind->label,
gsn_addr_to_str(&a->addr));
@@ -2899,9 +2885,9 @@ int sgsn_sockaddr_to_strs(char *addr_str, size_t addr_str_len,
const char *sgsn_sockaddr_to_strb(const struct sgsn_sockaddr *addr,
char *buf, size_t buf_len)
{
+ char portbuf[6];
const int portbuf_len = 6;
OSMO_ASSERT(buf_len > portbuf_len);
- char *portbuf = buf + buf_len - portbuf_len;
buf_len -= portbuf_len;
if (sgsn_sockaddr_to_strs(buf, buf_len,
portbuf, portbuf_len,
diff --git a/src/gtphub/gtphub_ares.c b/src/gtphub/gtphub_ares.c
index 87dc860c4..774563db4 100644
--- a/src/gtphub/gtphub_ares.c
+++ b/src/gtphub/gtphub_ares.c
@@ -28,11 +28,12 @@
#include <string.h>
#include <unistd.h>
-#include <osmocom/sgsn/gtphub.h>
+#include <osmocom/gtphub/gtphub.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/protocol/gsm_23_003.h>
/* TODO split GRX ares from sgsn into a separate struct and allow use without
* globals. */
@@ -56,8 +57,8 @@ struct ggsn_lookup {
struct gtphub *hub;
char imsi_str[GSM23003_IMSI_MAX_DIGITS+1];
- char apn_ni_str[GSM_APN_LENGTH];
- char apn_oi_str[GSM_APN_LENGTH];
+ char apn_ni_str[APN_MAXLEN+1];
+ char apn_oi_str[APN_MAXLEN+1];
int have_3dig_mnc;
};
diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c
index 664c801e8..9b0532b24 100644
--- a/src/gtphub/gtphub_main.c
+++ b/src/gtphub/gtphub_main.c
@@ -34,6 +34,7 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/msgb.h>
#include <osmocom/vty/logging.h>
#include <osmocom/vty/telnet_interface.h>
@@ -41,10 +42,10 @@
#include <osmocom/vty/misc.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gtphub.h>
+#include <osmocom/gtphub/gtphub.h>
#include <osmocom/sgsn/vty.h>
-#include "../../bscconfig.h"
+#include "../../config.h"
#if BUILD_IU
#include <osmocom/sigtran/osmo_ss7.h>
@@ -95,11 +96,11 @@ void log_cfg(struct gtphub_cfg *cfg)
}
}
-static void signal_handler(int signal)
+static void signal_handler(int signum)
{
- fprintf(stdout, "signal %d received\n", signal);
+ fprintf(stdout, "signal %d received\n", signum);
- switch (signal) {
+ switch (signum) {
case SIGINT:
case SIGTERM:
osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL);
@@ -107,8 +108,16 @@ static void signal_handler(int signal)
exit(0);
break;
case SIGABRT:
- /* in case of abort, we want to obtain a talloc report
- * and then return to the caller, who will abort the process */
+ /* in case of abort, we want to obtain a talloc report and
+ * then run default SIGABRT handler, who will generate coredump
+ * and abort the process. abort() should do this for us after we
+ * return, but program wouldn't exit if an external SIGABRT is
+ * received.
+ */
+ talloc_report_full(osmo_gtphub_ctx, stderr);
+ signal(SIGABRT, SIG_DFL);
+ raise(SIGABRT);
+ break;
case SIGUSR1:
case SIGUSR2:
talloc_report_full(osmo_gtphub_ctx, stderr);
@@ -118,44 +127,12 @@ static void signal_handler(int signal)
}
}
-#if BUILD_IU
-int gtphub_vty_go_parent(struct vty *vty)
-{
- switch (vty->node) {
- default:
- osmo_ss7_vty_go_parent(vty);
- }
-
- return vty->node;
-}
-#endif
-
-int gtphub_vty_is_config_node(struct vty *vty, int node)
-{
- /* Check if libosmo-sccp declares the node in
- * question as config node */
-#if BUILD_IU
- if (osmo_ss7_is_config_node(vty, node))
- return 1;
-#endif
-
- switch (node) {
- /* add items that are not config */
- case CONFIG_NODE:
- return 0;
-
- default:
- return 1;
- }
-}
-
static struct vty_app_info vty_info = {
.name = "OsmoGTPhub",
.version = PACKAGE_VERSION,
#if BUILD_IU
- .go_parent_cb = gtphub_vty_go_parent,
+ .go_parent_cb = osmo_ss7_vty_go_parent,
#endif
- .is_config_node = gtphub_vty_is_config_node,
};
struct cmdline_cfg {
@@ -377,8 +354,7 @@ int main(int argc, char **argv)
}
/* start telnet after reading config for vty_get_bind_addr() */
- rc = telnet_init_dynif(osmo_gtphub_ctx, 0, vty_get_bind_addr(),
- OSMO_VTY_PORT_GTPHUB);
+ rc = telnet_init_default(osmo_gtphub_ctx, NULL, OSMO_VTY_PORT_GTPHUB);
if (rc < 0)
exit(1);
diff --git a/src/gtphub/gtphub_sock.c b/src/gtphub/gtphub_sock.c
index 183753348..6f299d2d6 100644
--- a/src/gtphub/gtphub_sock.c
+++ b/src/gtphub/gtphub_sock.c
@@ -25,7 +25,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <osmocom/sgsn/gtphub.h>
+#include <errno.h>
+#include <string.h>
+
+#include <osmocom/core/utils.h>
+
+#include <osmocom/gtphub/gtphub.h>
#include <osmocom/sgsn/debug.h>
/* Convenience makro, note: only within this C file. */
diff --git a/src/gtphub/gtphub_vty.c b/src/gtphub/gtphub_vty.c
index abc08fd69..b5f102ae6 100644
--- a/src/gtphub/gtphub_vty.c
+++ b/src/gtphub/gtphub_vty.c
@@ -31,7 +31,7 @@
#include <osmocom/vty/misc.h>
#include <osmocom/sgsn/vty.h>
-#include <osmocom/sgsn/gtphub.h>
+#include <osmocom/gtphub/gtphub.h>
/* TODO split GRX ares from sgsn into a separate struct and allow use without
* globals. */
diff --git a/src/sgsn/Makefile.am b/src/sgsn/Makefile.am
index 6a7392baf..93b9fa058 100644
--- a/src/sgsn/Makefile.am
+++ b/src/sgsn/Makefile.am
@@ -40,12 +40,13 @@ bin_PROGRAMS = \
$(NULL)
osmo_sgsn_SOURCES = \
- gprs_gb.c \
+ apn.c \
+ gprs_bssgp.c \
gprs_gmm_attach.c \
gprs_gmm.c \
gprs_gmm_fsm.c \
gprs_mm_state_gb_fsm.c \
- gprs_sgsn.c \
+ gprs_ns.c \
gprs_sm.c \
gprs_sndcp.c \
gprs_sndcp_comp.c \
@@ -53,15 +54,21 @@ osmo_sgsn_SOURCES = \
gprs_sndcp_pcomp.c \
gprs_sndcp_vty.c \
gprs_sndcp_xid.c \
+ gtp_ggsn.c \
+ gtp_mme.c \
+ sgsn.c \
sgsn_main.c \
sgsn_vty.c \
sgsn_libgtp.c \
gprs_llc.c \
gprs_llc_vty.c \
+ mmctx.c \
+ pdpctx.c \
sgsn_ctrl.c \
sgsn_auth.c \
gprs_subscriber.c \
sgsn_cdr.c \
+ sgsn_rim.c \
slhc.c \
gprs_llc_xid.c \
v42bis.c \
diff --git a/src/sgsn/apn.c b/src/sgsn/apn.c
new file mode 100644
index 000000000..a89d15866
--- /dev/null
+++ b/src/sgsn/apn.c
@@ -0,0 +1,123 @@
+/* APN contexts */
+
+/* (C) 2009-2015 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2010 by On-Waves
+ * (C) 2019 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+
+#include <string.h>
+#include <talloc.h>
+
+#include <osmocom/sgsn/apn.h>
+#include <osmocom/sgsn/sgsn.h>
+
+static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char *imsi_prefix)
+{
+ struct apn_ctx *actx;
+
+ actx = talloc_zero(sgsn, struct apn_ctx);
+ if (!actx)
+ return NULL;
+ actx->name = talloc_strdup(actx, ap_name);
+ actx->imsi_prefix = talloc_strdup(actx, imsi_prefix);
+
+ llist_add_tail(&actx->list, &sgsn->apn_list);
+
+ return actx;
+}
+
+void sgsn_apn_ctx_free(struct apn_ctx *actx)
+{
+ llist_del(&actx->list);
+ talloc_free(actx);
+}
+
+struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi)
+{
+ struct apn_ctx *actx;
+ struct apn_ctx *found_actx = NULL;
+ size_t imsi_prio = 0;
+ size_t name_prio = 0;
+ size_t name_req_len = strlen(name);
+
+ llist_for_each_entry(actx, &sgsn->apn_list, list) {
+ size_t name_ref_len, imsi_ref_len;
+ const char *name_ref_start, *name_match_start;
+
+ imsi_ref_len = strlen(actx->imsi_prefix);
+ if (strncmp(actx->imsi_prefix, imsi, imsi_ref_len) != 0)
+ continue;
+
+ if (imsi_ref_len < imsi_prio)
+ continue;
+
+ /* IMSI matches */
+
+ name_ref_start = &actx->name[0];
+ if (name_ref_start[0] == '*') {
+ /* Suffix match */
+ name_ref_start += 1;
+ name_ref_len = strlen(name_ref_start);
+ if (name_ref_len > name_req_len)
+ continue;
+ } else {
+ name_ref_len = strlen(name_ref_start);
+ if (name_ref_len != name_req_len)
+ continue;
+ }
+
+ name_match_start = name + (name_req_len - name_ref_len);
+ if (strcasecmp(name_match_start, name_ref_start) != 0)
+ continue;
+
+ /* IMSI and name match */
+
+ if (imsi_ref_len == imsi_prio && name_ref_len < name_prio)
+ /* Lower priority, skip */
+ continue;
+
+ imsi_prio = imsi_ref_len;
+ name_prio = name_ref_len;
+ found_actx = actx;
+ }
+ return found_actx;
+}
+
+struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix)
+{
+ struct apn_ctx *actx;
+
+ llist_for_each_entry(actx, &sgsn->apn_list, list) {
+ if (strcasecmp(name, actx->name) == 0 &&
+ strcasecmp(imsi_prefix, actx->imsi_prefix) == 0)
+ return actx;
+ }
+ return NULL;
+}
+
+struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix)
+{
+ struct apn_ctx *actx;
+
+ actx = sgsn_apn_ctx_by_name(name, imsi_prefix);
+ if (!actx)
+ actx = sgsn_apn_ctx_alloc(name, imsi_prefix);
+
+ return actx;
+}
diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c
new file mode 100644
index 000000000..5db751cce
--- /dev/null
+++ b/src/sgsn/gprs_bssgp.c
@@ -0,0 +1,95 @@
+/* GPRS BSSGP protocol implementation as per 3GPP TS 08.18 */
+
+/* (C) 2010 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2010 by On-Waves
+ * (C) 2022 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+#include <osmocom/core/prim.h>
+#include <osmocom/core/rate_ctr.h>
+
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_ns2.h>
+
+#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/sgsn_rim.h>
+#include <osmocom/sgsn/mmctx.h>
+
+/* call-back function for the BSSGP protocol */
+int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph)
+{
+ struct osmo_bssgp_prim *bp;
+ bp = container_of(oph, struct osmo_bssgp_prim, oph);
+
+ switch (oph->sap) {
+ case SAP_BSSGP_LL:
+ switch (oph->primitive) {
+ case PRIM_BSSGP_UL_UD:
+ return gprs_llc_rcvmsg(oph->msg, bp->tp);
+ }
+ break;
+ case SAP_BSSGP_GMM:
+ switch (oph->primitive) {
+ case PRIM_BSSGP_GMM_SUSPEND:
+ return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli);
+ case PRIM_BSSGP_GMM_RESUME:
+ return gprs_gmm_rx_resume(bp->ra_id, bp->tlli,
+ bp->u.resume.suspend_ref);
+ }
+ break;
+ case SAP_BSSGP_NM:
+ break;
+ case SAP_BSSGP_RIM:
+ return sgsn_rim_rx_from_gb(bp, oph->msg);
+ }
+ return 0;
+}
+
+int sgsn_bssgp_page_ps_ra(struct sgsn_mm_ctx *mmctx)
+{
+ struct bssgp_paging_info pinfo;
+ int rc;
+
+ /* FIXME: page whole routing area, not only the last known cell */
+
+ /* initiate PS PAGING procedure */
+ memset(&pinfo, 0, sizeof(pinfo));
+ pinfo.mode = BSSGP_PAGING_PS;
+ pinfo.scope = BSSGP_PAGING_BVCI;
+ pinfo.bvci = mmctx->gb.bvci;
+ pinfo.imsi = mmctx->imsi;
+ pinfo.ptmsi = &mmctx->p_tmsi;
+ pinfo.drx_params = mmctx->drx_parms;
+ pinfo.qos[0] = 0; // FIXME
+ rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS));
+
+ return rc;
+}
+
+/* called by the bssgp layer to send NS PDUs */
+int sgsn_bssgp_dispatch_ns_unitdata_req_cb(void *ctx, struct msgb *msg)
+{
+ struct gprs_ns2_inst *nsi = (struct gprs_ns2_inst *) ctx;
+ struct osmo_gprs_ns2_prim nsp = {};
+ nsp.nsei = msgb_nsei(msg);
+ nsp.bvci = msgb_bvci(msg);
+ osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
+ return gprs_ns2_recv_prim(nsi, &nsp.oph);
+}
diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c
deleted file mode 100644
index d470cfab9..000000000
--- a/src/sgsn/gprs_gb.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Messages on the Gb interface (A/Gb mode) */
-
-/* (C) 2009-2015 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010 by On-Waves
- * (C) 2019 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
- *
- * All Rights 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.
- *
- * 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 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/>.
- *
- */
-
-#include <osmocom/core/rate_ctr.h>
-
-#include <osmocom/gprs/gprs_msgb.h>
-#include <osmocom/gprs/gprs_bssgp.h>
-
-#include "bscconfig.h"
-
-#include <osmocom/sgsn/gprs_mm_state_gb_fsm.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
-#include <osmocom/sgsn/gprs_gmm.h>
-#include <osmocom/sgsn/gprs_sm.h>
-#include <osmocom/sgsn/debug.h>
-
-/* Has to be called whenever any PDU (signaling, data, ...) has been received */
-void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx) {
- if (mmctx->gb.llme)
- osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_PDU_RECEPTION, NULL);
-}
-
-/* Main entry point for incoming 04.08 GPRS messages from Gb */
-int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
- bool drop_cipherable)
-{
- struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
- uint8_t pdisc = gsm48_hdr_pdisc(gh);
- struct sgsn_mm_ctx *mmctx;
- struct gprs_ra_id ra_id;
- int rc = -EINVAL;
-
- bssgp_parse_cell_id(&ra_id, msgb_bcid(msg));
- mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &ra_id);
- if (mmctx) {
- msgid2mmctx(mmctx, msg);
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
- mmctx->gb.llme = llme;
- gprs_gb_recv_pdu(mmctx);
- }
-
- /* MMCTX can be NULL */
-
- switch (pdisc) {
- case GSM48_PDISC_MM_GPRS:
- rc = gsm0408_rcv_gmm(mmctx, msg, llme, drop_cipherable);
- break;
- case GSM48_PDISC_SM_GPRS:
- rc = gsm0408_rcv_gsm(mmctx, msg, llme);
- break;
- default:
- LOGMMCTXP(LOGL_NOTICE, mmctx,
- "Unknown GSM 04.08 discriminator 0x%02x: %s\n",
- pdisc, osmo_hexdump((uint8_t *)gh, msgb_l3len(msg)));
- /* FIXME: return status message */
- break;
- }
-
- /* MMCTX can be invalid */
-
- return rc;
-}
-
-
-int gprs_gb_page_ps_ra(struct sgsn_mm_ctx *mmctx)
-{
- struct bssgp_paging_info pinfo;
- int rc;
-
- /* FIXME: page whole routing area, not only the last known cell */
-
- /* initiate PS PAGING procedure */
- memset(&pinfo, 0, sizeof(pinfo));
- pinfo.mode = BSSGP_PAGING_PS;
- pinfo.scope = BSSGP_PAGING_BVCI;
- pinfo.bvci = mmctx->gb.bvci;
- pinfo.imsi = mmctx->imsi;
- pinfo.ptmsi = &mmctx->p_tmsi;
- pinfo.drx_params = mmctx->drx_parms;
- pinfo.qos[0] = 0; // FIXME
- rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo);
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PAGING_PS]);
-
- return rc;
-}
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 182276cfa..c3f5cd3d2 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -30,7 +30,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-#include "bscconfig.h"
+#include "config.h"
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
@@ -41,13 +41,14 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/tdef.h>
#include <osmocom/crypt/auth.h>
+#include <osmocom/crypt/utran_cipher.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_llc.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_utils.h>
#include <osmocom/sgsn/gprs_subscriber.h>
@@ -59,17 +60,17 @@
#include <osmocom/sgsn/signal.h>
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_ranap.h>
+#include <osmocom/sgsn/gprs_sm.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
#include <pdp.h>
#define PTMSI_ALLOC
-extern struct sgsn_instance *sgsn;
-extern void *tall_sgsn_ctx;
-
static const struct tlv_definition gsm48_gmm_att_tlvdef = {
.def = {
- [GSM48_IE_GMM_CIPH_CKSN] = { TLV_TYPE_FIXED, 1 },
+ [GSM48_IE_GMM_CIPH_CKSN] = { TLV_TYPE_SINGLE_TV, 1 },
[GSM48_IE_GMM_TIMER_READY] = { TLV_TYPE_TV, 1 },
[GSM48_IE_GMM_ALLOC_PTMSI] = { TLV_TYPE_TLV, 0 },
[GSM48_IE_GMM_PTMSI_SIG] = { TLV_TYPE_FIXED, 3 },
@@ -78,6 +79,7 @@ static const struct tlv_definition gsm48_gmm_att_tlvdef = {
[GSM48_IE_GMM_AUTH_RES_EXT] = { TLV_TYPE_TLV, 0 },
[GSM48_IE_GMM_AUTH_FAIL_PAR] = { TLV_TYPE_TLV, 0 },
[GSM48_IE_GMM_IMEISV] = { TLV_TYPE_TLV, 0 },
+ [GSM48_IE_GMM_RX_NPDU_NUM_LIST] = { TLV_TYPE_TLV, 0 },
[GSM48_IE_GMM_DRX_PARAM] = { TLV_TYPE_FIXED, 2 },
[GSM48_IE_GMM_MS_NET_CAPA] = { TLV_TYPE_TLV, 0 },
[GSM48_IE_GMM_PDP_CTX_STATUS] = { TLV_TYPE_TLV, 0 },
@@ -131,7 +133,7 @@ int gsm48_gmm_sendmsg(struct msgb *msg, int command,
struct sgsn_mm_ctx *mm, bool encryptable)
{
if (mm) {
- rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_PKTS_SIG_OUT));
#ifdef BUILD_IU
if (mm->ran_type == MM_CTX_T_UTRAN_Iu)
return ranap_iu_tx(msg, GPRS_SAPI_GMM);
@@ -197,10 +199,10 @@ static void mm_ctx_cleanup_free(struct sgsn_mm_ctx *ctx, const char *log_text)
switch(ctx->ran_type) {
case MM_CTX_T_UTRAN_Iu:
- osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_IMPLICIT_DETACH, NULL);
+ osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_PS_DETACH, NULL);
break;
case MM_CTX_T_GERAN_Gb:
- osmo_fsm_inst_dispatch(ctx->gb.mm_state_fsm, E_MM_IMPLICIT_DETACH, NULL);
+ osmo_fsm_inst_dispatch(ctx->gb.mm_state_fsm, E_MM_GPRS_DETACH, NULL);
break;
}
@@ -215,7 +217,7 @@ static int _tx_status(struct msgb *msg, uint8_t cause,
/* MMCTX might be NULL! */
- DEBUGP(DMM, "<- GPRS MM STATUS (cause: %s)\n",
+ DEBUGP(DMM, "<- GMM STATUS (cause: %s)\n",
get_value_string(gsm48_gmm_cause_names, cause));
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
@@ -241,7 +243,7 @@ static int _tx_detach_req(struct msgb *msg, uint8_t detach_type, uint8_t cause,
/* MMCTX might be NULL! */
- DEBUGP(DMM, "<- GPRS MM DETACH REQ (type: %s, cause: %s)\n",
+ DEBUGP(DMM, "<- GMM DETACH REQ (type: %s, cause: %s)\n",
get_value_string(gprs_det_t_mt_strs, detach_type),
get_value_string(gsm48_gmm_cause_names, cause));
@@ -281,15 +283,17 @@ int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm)
struct gsm48_hdr *gh;
struct gsm48_attach_ack *aa;
unsigned long t;
+#ifdef PTMSI_ALLOC
struct osmo_mobile_identity mi;
uint8_t *l;
int rc;
+#endif
#if 0
uint8_t *ptsig;
#endif
- LOGMMCTXP(LOGL_INFO, mm, "<- GPRS ATTACH ACCEPT (new P-TMSI=0x%08x)\n", mm->p_tmsi);
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_ACKED]);
+ LOGMMCTXP(LOGL_INFO, mm, "<- GMM ATTACH ACCEPT (new P-TMSI=0x%08x)\n", mm->p_tmsi);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_ACKED));
mmctx2msgid(msg, mm);
@@ -302,7 +306,7 @@ int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm)
aa->att_result = 1; /* GPRS only */
t = osmo_tdef_get(sgsn->cfg.T_defs, 3312, OSMO_TDEF_S, -1);
aa->ra_upd_timer = gprs_secs_to_tmr_floor(t);
- aa->radio_prio = 4; /* lowest */
+ aa->radio_prio = 0x44; /* lowest */
gsm48_encode_ra(&aa->ra_id, &mm->ra);
#if 0
@@ -340,6 +344,9 @@ int gsm48_tx_gmm_att_ack(struct sgsn_mm_ctx *mm)
/* Optional: MS-identity (combined attach) */
/* Optional: GMM cause (partial attach result for combined attach) */
+ /* Optional: Network feature support 10.5.5.23 */
+ /* msgb_v_put(msg, GSM48_IE_GMM_NET_FEAT_SUPPORT | 0x00);*/
+
return gsm48_gmm_sendmsg(msg, 0, mm, true);
}
@@ -349,9 +356,9 @@ static int _tx_gmm_att_rej(struct msgb *msg, uint8_t gmm_cause,
{
struct gsm48_hdr *gh;
- LOGMMCTXP(LOGL_NOTICE, mm, "<- GPRS ATTACH REJECT: %s\n",
+ LOGMMCTXP(LOGL_NOTICE, mm, "<- GMM ATTACH REJECT: %s\n",
get_value_string(gsm48_gmm_cause_names, gmm_cause));
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_REJECTED]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_REJECTED));
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
gh->proto_discr = GSM48_PDISC_MM_GPRS;
@@ -383,8 +390,8 @@ static int _tx_detach_ack(struct msgb *msg, uint8_t force_stby,
/* MMCTX might be NULL! */
- DEBUGP(DMM, "<- GPRS MM DETACH ACC (force-standby: %d)\n", force_stby);
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_DETACH_ACKED]);
+ DEBUGP(DMM, "<- GMM DETACH ACC (force-standby: %d)\n", force_stby);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_DETACH_ACKED));
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
gh->proto_discr = GSM48_PDISC_MM_GPRS;
@@ -416,7 +423,7 @@ int gsm48_tx_gmm_id_req(struct sgsn_mm_ctx *mm, uint8_t id_type)
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 ID REQ");
struct gsm48_hdr *gh;
- LOGMMCTXP(LOGL_DEBUG, mm, "<- GPRS IDENTITY REQUEST: mi_type=%s\n",
+ LOGMMCTXP(LOGL_DEBUG, mm, "<- GMM IDENTITY REQUEST: mi_type=%s\n",
gsm48_mi_type_name(id_type));
mmctx2msgid(msg, mm);
@@ -440,6 +447,17 @@ static bool mmctx_is_r99(const struct sgsn_mm_ctx *mm)
return false;
}
+static enum gprs_ciph_algo gprs_ms_net_select_best_gea(uint8_t net_mask, uint8_t ms_mask) {
+ uint8_t common_mask = net_mask & ms_mask;
+ uint8_t r = 0;
+
+ while (common_mask >>= 1) {
+ r++;
+ }
+
+ return r;
+}
+
/* 3GPP TS 24.008 § 9.4.9: Authentication and Ciphering Request */
int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm,
const struct osmo_auth_vector *vec,
@@ -451,7 +469,7 @@ int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm,
uint8_t *m_rand, *m_cksn, rbyte;
int rc;
- LOGMMCTXP(LOGL_INFO, mm, "<- GPRS AUTH AND CIPHERING REQ (rand = %s,"
+ LOGMMCTXP(LOGL_INFO, mm, "<- GMM AUTH AND CIPHERING REQ (rand = %s,"
" mmctx_is_r99=%d, vec->auth_types=0x%x",
osmo_hexdump(vec->rand, sizeof(vec->rand)),
mmctx_is_r99(mm), vec->auth_types);
@@ -514,7 +532,7 @@ static int gsm48_tx_gmm_auth_ciph_rej(struct sgsn_mm_ctx *mm)
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 AUTH CIPH REJ");
struct gsm48_hdr *gh;
- LOGMMCTXP(LOGL_NOTICE, mm, "<- GPRS AUTH AND CIPH REJECT\n");
+ LOGMMCTXP(LOGL_NOTICE, mm, "<- GMM AUTH AND CIPH REJECT\n");
mmctx2msgid(msg, mm);
@@ -594,7 +612,7 @@ static int gsm48_rx_gmm_auth_ciph_resp(struct sgsn_mm_ctx *ctx,
uint8_t res_len;
int rc;
- LOGMMCTXP(LOGL_INFO, ctx, "-> GPRS AUTH AND CIPH RESPONSE\n");
+ LOGMMCTXP(LOGL_INFO, ctx, "-> GMM AUTH AND CIPH RESPONSE\n");
if (ctx->auth_triplet.key_seq == GSM_KEY_SEQ_INVAL) {
LOGMMCTXP(LOGL_NOTICE, ctx,
@@ -645,7 +663,7 @@ static int gsm48_rx_gmm_auth_ciph_resp(struct sgsn_mm_ctx *ctx,
ctx->sec_ctx = check_auth_resp(ctx, false, &at->vec, res, res_len);
if (!sgsn_mm_ctx_is_authenticated(ctx)) {
rc = gsm48_tx_gmm_auth_ciph_rej(ctx);
- mm_ctx_cleanup_free(ctx, "GPRS AUTH AND CIPH REJECT");
+ mm_ctx_cleanup_free(ctx, "GMM AUTH AND CIPH REJECT");
return rc;
}
@@ -668,7 +686,7 @@ static int gsm48_rx_gmm_auth_ciph_fail(struct sgsn_mm_ctx *ctx,
const uint8_t *auts;
int rc;
- LOGMMCTXP(LOGL_INFO, ctx, "-> GPRS AUTH AND CIPH FAILURE (cause = %s)\n",
+ LOGMMCTXP(LOGL_INFO, ctx, "-> GMM AUTH AND CIPH FAILURE (cause = %s)\n",
get_value_string(gsm48_gmm_cause_names, gmm_cause));
tlv_parse(&tp, &gsm48_gmm_att_tlvdef, gh->data+1, msg->len - 1, 0, 0);
@@ -708,7 +726,7 @@ static int gsm48_rx_gmm_auth_ciph_fail(struct sgsn_mm_ctx *ctx,
LOGMMCTXP(LOGL_NOTICE, ctx, "Authentication failed\n");
rc = gsm48_tx_gmm_auth_ciph_rej(ctx);
- mm_ctx_cleanup_free(ctx, "GPRS AUTH FAILURE");
+ mm_ctx_cleanup_free(ctx, "GMM AUTH FAILURE");
return rc;
}
@@ -787,7 +805,7 @@ static int gsm48_tx_gmm_service_ack(struct sgsn_mm_ctx *mm)
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 SERVICE ACK");
struct gsm48_hdr *gh;
- LOGMMCTXP(LOGL_INFO, mm, "<- GPRS SERVICE ACCEPT (P-TMSI=0x%08x)\n", mm->p_tmsi);
+ LOGMMCTXP(LOGL_INFO, mm, "<- GMM SERVICE ACCEPT (P-TMSI=0x%08x)\n", mm->p_tmsi);
mmctx2msgid(msg, mm);
@@ -808,7 +826,7 @@ static int _tx_gmm_service_rej(struct msgb *msg, uint8_t gmm_cause,
{
struct gsm48_hdr *gh;
- LOGMMCTXP(LOGL_NOTICE, mm, "<- GPRS SERVICE REJECT: %s\n",
+ LOGMMCTXP(LOGL_NOTICE, mm, "<- GMM SERVICE REJECT: %s\n",
get_value_string(gsm48_gmm_cause_names, gmm_cause));
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
@@ -900,7 +918,13 @@ int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx)
/* The MS is authorized */
#ifdef BUILD_IU
if (ctx->ran_type == MM_CTX_T_UTRAN_Iu && !ctx->iu.ue_ctx->integrity_active) {
- rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key);
+ /* Is any encryption above UEA0 enabled? */
+ bool send_ck = sgsn->cfg.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0);
+ LOGMMCTXP(LOGL_DEBUG, ctx, "Iu Security Mode Command: %s encryption key (UEA encryption mask = 0x%x)\n",
+ send_ck ? "sending" : "not sending", sgsn->cfg.uea_encryption_mask);
+ /* FIXME: we should send the set of allowed UEA, as in ranap_new_msg_sec_mod_cmd2(). However, this
+ * is not possible in the iu_client API. See OS#5487. */
+ rc = ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, send_ck, ctx->iu.new_key);
ctx->iu.new_key = 0;
return rc;
}
@@ -922,16 +946,16 @@ int gsm48_gmm_authorize(struct sgsn_mm_ctx *ctx)
ctx->t3350_mode = GMM_T3350_MODE_ATT;
#else
memset(&sig_data, 0, sizeof(sig_data));
- sig_data.mm = mmctx;
+ sig_data.mm = ctx;
osmo_signal_dispatch(SS_SGSN, S_SGSN_ATTACH, &sig_data);
- osmo_fsm_inst_dispatch(mm->gmm_fsm, E_GMM_ATTACH_SUCCESS, NULL);
+ osmo_fsm_inst_dispatch(ctx->gmm_fsm, E_GMM_ATTACH_SUCCESS, NULL);
#endif
return gsm48_tx_gmm_att_ack(ctx);
#ifdef BUILD_IU
case GSM48_MT_GMM_SERVICE_REQ:
ctx->pending_req = 0;
- osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_PS_ATTACH, NULL);
+ osmo_fsm_inst_dispatch(ctx->iu.mm_state_fsm, E_PMM_PS_CONN_ESTABLISH, NULL);
rc = gsm48_tx_gmm_service_ack(ctx);
if (ctx->iu.service.type != GPRS_SERVICE_T_SIGNALLING)
@@ -1082,7 +1106,7 @@ static int gsm48_rx_gmm_id_resp(struct sgsn_mm_ctx *ctx, struct msgb *msg)
"p_tmsi_old=0x%08x\n",
ictx->p_tmsi);
- mm_ctx_cleanup_free(ictx, "GPRS IMSI re-use");
+ mm_ctx_cleanup_free(ictx, "GMM IMSI re-use");
}
}
OSMO_STRLCPY_ARRAY(ctx->imsi, mi.imsi);
@@ -1142,6 +1166,21 @@ static void mmctx_handle_rat_change(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
}
+static uint8_t gprs_ms_net_cap_gea_mask(const uint8_t *ms_net_cap, uint8_t cap_len)
+{
+ uint8_t mask = (1 << GPRS_ALGO_GEA0);
+ mask |= (0x80 & ms_net_cap[0]) ? (1 << GPRS_ALGO_GEA1) : 0;
+
+ if (cap_len < 2)
+ return mask;
+
+ /* extended GEA bits start from 2nd bit of the next byte */
+ mask |= (0x40 & ms_net_cap[1]) ? (1 << GPRS_ALGO_GEA2) : 0;
+ mask |= (0x20 & ms_net_cap[1]) ? (1 << GPRS_ALGO_GEA3) : 0;
+ mask |= (0x10 & ms_net_cap[1]) ? (1 << GPRS_ALGO_GEA4) : 0;
+ return mask;
+}
+
/* 3GPP TS 24.008 § 9.4.1 Attach request */
static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
struct gprs_llc_llme *llme)
@@ -1158,7 +1197,7 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
int rc;
LOGMMCTXP(LOGL_INFO, ctx, "-> GMM ATTACH REQUEST ");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_REQUEST));
/* As per TS 04.08 Chapter 4.7.1.4, the attach request arrives either
* with a foreign TLLI (P-TMSI that was allocated to the MS before),
@@ -1285,15 +1324,27 @@ static int gsm48_rx_gmm_att_req(struct sgsn_mm_ctx *ctx, struct msgb *msg,
ctx->ms_radio_access_capa.len);
ctx->ms_network_capa.len = msnc_len;
memcpy(ctx->ms_network_capa.buf, msnc, msnc_len);
- if (!gprs_ms_net_cap_gea_supported(ctx->ms_network_capa.buf, msnc_len,
- ctx->ciph_algo)) {
+
+ ctx->ue_cipher_mask = gprs_ms_net_cap_gea_mask(ctx->ms_network_capa.buf, msnc_len);
+
+ if (!(ctx->ue_cipher_mask & sgsn->cfg.gea_encryption_mask)) {
reject_cause = GMM_CAUSE_PROTO_ERR_UNSPEC;
LOGMMCTXP(LOGL_NOTICE, ctx, "Rejecting ATTACH REQUEST with MI "
- "%s because MS do not support required %s "
- "encryption\n", mi_log_string,
- get_value_string(gprs_cipher_names,ctx->ciph_algo));
+ "%s because MS do not support required encryption, mask UE:0x%02x NW:0x%02x \n",
+ mi_log_string, ctx->ue_cipher_mask, sgsn->cfg.gea_encryption_mask);
goto rejected;
}
+
+ /* just assume that everythig is fine if the phone offers a5/4:
+ * it requires a valid umts security context which we can only have after
+ * 1) IDENTITY REQUEST to know what to ask the HLR for
+ * 2) and AUTHENTICATION AND CIPHERING REQUEST
+ * ... but 2) already requires selecting a cipher mode.
+ * So let's just assume we will have the auth data required to make it work.
+ */
+
+ ctx->ciph_algo = gprs_ms_net_select_best_gea(ctx->ue_cipher_mask, sgsn->cfg.gea_encryption_mask);
+
#ifdef PTMSI_ALLOC
/* Allocate a new P-TMSI (+ P-TMSI signature) and update TLLI */
ptmsi_update(ctx);
@@ -1325,7 +1376,7 @@ rejected:
get_value_string(gsm48_gmm_cause_names, reject_cause), reject_cause);
rc = gsm48_tx_gmm_att_rej_oldmsg(msg, reject_cause);
if (ctx)
- mm_ctx_cleanup_free(ctx, "GPRS ATTACH REJ");
+ mm_ctx_cleanup_free(ctx, "GMM ATTACH REJ");
else if (llme)
gprs_llgmm_unassign(llme);
@@ -1338,7 +1389,7 @@ static int gsm48_rx_gmm_att_compl(struct sgsn_mm_ctx *mmctx)
{
struct sgsn_signal_data sig_data;
/* only in case SGSN offered new P-TMSI */
- LOGMMCTXP(LOGL_INFO, mmctx, "-> ATTACH COMPLETE\n");
+ LOGMMCTXP(LOGL_INFO, mmctx, "-> GMM ATTACH COMPLETE\n");
#ifdef BUILD_IU
if (mmctx->iu.ue_ctx) {
@@ -1405,7 +1456,7 @@ static int gsm48_rx_gmm_det_req(struct sgsn_mm_ctx *ctx, struct msgb *msg)
power_off = gh->data[0] & 0x8;
/* FIXME: In 24.008 there is an optional P-TMSI and P-TMSI signature IE */
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_DETACH_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_DETACH_REQUEST));
LOGMMCTXP(LOGL_INFO, ctx, "-> GMM DETACH REQUEST TLLI=0x%08x type=%s %s\n",
msgb_tlli(msg), get_value_string(gprs_det_t_mo_strs, detach_type),
power_off ? "Power-off" : "");
@@ -1425,7 +1476,7 @@ static int gsm48_rx_gmm_det_req(struct sgsn_mm_ctx *ctx, struct msgb *msg)
memset(&sig_data, 0, sizeof(sig_data));
sig_data.mm = ctx;
osmo_signal_dispatch(SS_SGSN, S_SGSN_DETACH, &sig_data);
- mm_ctx_cleanup_free(ctx, "GPRS DETACH REQUEST");
+ mm_ctx_cleanup_free(ctx, "GMM DETACH REQUEST");
}
return rc;
@@ -1438,12 +1489,14 @@ static int gsm48_tx_gmm_ra_upd_ack(struct sgsn_mm_ctx *mm)
struct gsm48_hdr *gh;
struct gsm48_ra_upd_ack *rua;
unsigned long t;
+#ifdef PTMSI_ALLOC
uint8_t *l;
int rc;
struct osmo_mobile_identity mi;
+#endif
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_ACKED]);
- LOGMMCTXP(LOGL_INFO, mm, "<- ROUTING AREA UPDATE ACCEPT\n");
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_ACKED));
+ LOGMMCTXP(LOGL_INFO, mm, "<- GMM ROUTING AREA UPDATE ACCEPT\n");
mmctx2msgid(msg, mm);
@@ -1498,7 +1551,7 @@ int gsm48_tx_gmm_ra_upd_rej(struct msgb *old_msg, uint8_t cause)
struct gsm48_hdr *gh;
LOGP(DMM, LOGL_NOTICE, "<- ROUTING AREA UPDATE REJECT\n");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_REJECT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_REJECT));
gmm_copy_id(msg, old_msg);
@@ -1524,21 +1577,19 @@ static void process_ms_ctx_status(struct sgsn_mm_ctx *mmctx,
* being in state PDP-INACTIVE. */
llist_for_each_entry_safe(pdp, pdp2, &mmctx->pdp_list, list) {
- if (pdp->nsapi < 8) {
- if (!(pdp_status[0] & (1 << pdp->nsapi))) {
- LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "
- "due to PDP CTX STATUS IE= 0x%02x%02x\n",
- pdp->nsapi, pdp_status[1], pdp_status[0]);
- sgsn_delete_pdp_ctx(pdp);
- }
- } else {
- if (!(pdp_status[1] & (1 << (pdp->nsapi - 8)))) {
- LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "
- "due to PDP CTX STATUS IE= 0x%02x%02x\n",
- pdp->nsapi, pdp_status[1], pdp_status[0]);
- sgsn_delete_pdp_ctx(pdp);
- }
- }
+ bool inactive = (pdp->nsapi < 8) ?
+ !(pdp_status[0] & (1 << pdp->nsapi)) :
+ !(pdp_status[1] & (1 << (pdp->nsapi - 8)));
+ if (!inactive)
+ continue;
+
+ LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u "
+ "due to PDP CTX STATUS IE=0x%02x%02x\n",
+ pdp->nsapi, pdp_status[1], pdp_status[0]);
+ if (pdp->ggsn)
+ sgsn_delete_pdp_ctx(pdp);
+ else /* GTP side already detached, freeing */
+ sgsn_pdp_ctx_free(pdp);
}
}
@@ -1580,7 +1631,7 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
/* Update Type 10.5.5.18 */
upd_type = *cur++ & 0x07;
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_REQUEST));
LOGMMCTXP(LOGL_INFO, mmctx, "-> GMM RA UPDATE REQUEST type=\"%s\"\n",
get_value_string(gprs_upd_t_strs, upd_type));
@@ -1663,16 +1714,26 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
} else if (!gprs_ra_id_equals(&mmctx->ra, &old_ra_id) ||
mmctx->gmm_fsm->state == ST_GMM_DEREGISTERED)
{
- /* We cannot use the mmctx */
- LOGMMCTXP(LOGL_INFO, mmctx,
- "The MM context cannot be used, RA: %s\n",
- osmo_rai_name(&mmctx->ra));
- /* mmctx is set to NULL and gprs_llgmm_unassign(llme) will be
- called below, let's make sure we don't keep dangling llme
- pointers in mmctx (OS#3957, OS#4245). */
- if (mmctx->ran_type == MM_CTX_T_GERAN_Gb)
- mmctx->gb.llme = NULL;
- mmctx = NULL;
+ /* We've received either a RAU for a MS which isn't registered
+ * or a RAU with an unknown RA ID. As long the SGSN doesn't support
+ * PS handover we treat this as invalid RAU */
+ struct gprs_ra_id new_ra_id;
+ char new_ra[32];
+
+ bssgp_parse_cell_id(&new_ra_id, msgb_bcid(msg));
+ osmo_rai_name_buf(new_ra, sizeof(new_ra), &new_ra_id);
+
+ if (mmctx->gmm_fsm->state == ST_GMM_DEREGISTERED)
+ LOGMMCTXP(LOGL_INFO, mmctx,
+ "Rejecting RAU - GMM state is deregistered. Old RA: %s New RA: %s\n",
+ osmo_rai_name(&old_ra_id), new_ra);
+ else
+ LOGMMCTXP(LOGL_INFO, mmctx,
+ "Rejecting RAU - Old RA doesn't match MM. Old RA: %s New RA: %s\n",
+ osmo_rai_name(&old_ra_id), new_ra);
+
+ reject_cause = GMM_CAUSE_IMPL_DETACHED;
+ goto rejected;
}
if (!mmctx) {
@@ -1698,7 +1759,7 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
/* Store new BVCI/NSEI in MM context (FIXME: delay until we ack?) */
msgid2mmctx(mmctx, msg);
/* Bump the statistics of received signalling msgs for this MM context */
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
/* Update the MM context with the new RA-ID */
if (mmctx->ran_type == MM_CTX_T_GERAN_Gb && msgb_bcid(msg)) {
@@ -1706,10 +1767,14 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
/* Update the MM context with the new (i.e. foreign) TLLI */
mmctx->gb.tlli = msgb_tlli(msg);
}
+ /* Update the MM context with the new DRX params */
+ if (TLVP_PRESENT(&tp, GSM48_IE_GMM_DRX_PARAM))
+ memcpy(&mmctx->drx_parms, TLVP_VAL(&tp, GSM48_IE_GMM_DRX_PARAM), sizeof(mmctx->drx_parms));
+
/* FIXME: Update the MM context with the MS radio acc capabilities */
/* FIXME: Update the MM context with the MS network capabilities */
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_RA_UPDATE]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_RA_UPDATE));
#ifdef PTMSI_ALLOC
ptmsi_update(mmctx);
@@ -1719,7 +1784,7 @@ static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
mmctx_timer_start(mmctx, 3350);
#else
/* Make sure we are NORMAL (i.e. not SUSPENDED anymore) */
- osmo_fsm_inst_dispatch(mm->gmm_fsm, E_GMM_ATTACH_SUCCESS, NULL);
+ osmo_fsm_inst_dispatch(mmctx->gmm_fsm, E_GMM_ATTACH_SUCCESS, NULL);
memset(&sig_data, 0, sizeof(sig_data));
sig_data.mm = mmctx;
@@ -1755,7 +1820,7 @@ rejected:
get_value_string(gsm48_gmm_cause_names, reject_cause), reject_cause);
rc = gsm48_tx_gmm_ra_upd_rej(msg, reject_cause);
if (mmctx)
- mm_ctx_cleanup_free(mmctx, "GPRS RA UPDATE REJ");
+ mm_ctx_cleanup_free(mmctx, "GMM RA UPDATE REJ");
else if (llme)
gprs_llgmm_unassign(llme);
#ifdef BUILD_IU
@@ -1937,7 +2002,7 @@ static int gsm48_rx_gmm_status(struct sgsn_mm_ctx *mmctx, struct msgb *msg)
{
struct gsm48_hdr *gh = msgb_l3(msg);
- LOGMMCTXP(LOGL_INFO, mmctx, "-> GPRS MM STATUS (cause: %s)\n",
+ LOGMMCTXP(LOGL_INFO, mmctx, "-> GMM STATUS (cause: %s)\n",
get_value_string(gsm48_gmm_cause_names, gh->data[0]));
return 0;
@@ -2056,7 +2121,7 @@ int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
if (!mmctx)
goto null_mmctx;
LOGMMCTXP(LOGL_INFO, mmctx, "-> DETACH ACK\n");
- mm_ctx_cleanup_free(mmctx, "GPRS DETACH ACK");
+ mm_ctx_cleanup_free(mmctx, "GMM DETACH ACK");
rc = 0;
break;
case GSM48_MT_GMM_ATTACH_COMPL:
@@ -2096,9 +2161,9 @@ int gsm0408_rcv_gmm(struct sgsn_mm_ctx *mmctx, struct msgb *msg,
null_mmctx:
LOGGBIUP(llme, msg, LOGL_ERROR,
- "Received GSM 04.08 message type 0x%02x,"
+ "Received GSM 04.08 message type %s,"
" but no MM context available\n",
- gh->msg_type);
+ get_value_string(gprs_msgt_gmm_names, gh->msg_type));
return -EINVAL;
}
@@ -2165,7 +2230,7 @@ static void mmctx_timer_cb(void *_mm)
if (mm->num_T_exp >= 5) {
LOGMMCTXP(LOGL_NOTICE, mm, "T3370 expired >= 5 times\n");
gsm48_tx_gmm_att_rej(mm, GMM_CAUSE_MS_ID_NOT_DERIVED);
- mm_ctx_cleanup_free(mm, "GPRS ATTACH REJECT (T3370)");
+ mm_ctx_cleanup_free(mm, "GMM ATTACH REJECT (T3370)");
break;
}
/* re-tranmit IDENTITY REQUEST and re-start timer */
@@ -2253,3 +2318,51 @@ int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli,
osmo_fsm_inst_dispatch(mmctx->gmm_fsm, E_GMM_RESUME, NULL);
return 0;
}
+
+/* Has to be called whenever any PDU (signaling, data, ...) has been received */
+void gprs_gb_recv_pdu(struct sgsn_mm_ctx *mmctx, const struct msgb *msg)
+{
+ msgid2mmctx(mmctx, msg);
+ if (mmctx->gb.llme)
+ osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_PDU_RECEPTION, NULL);
+}
+
+/* Main entry point for incoming 04.08 GPRS messages from Gb */
+int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme,
+ bool drop_cipherable)
+{
+ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg);
+ uint8_t pdisc = gsm48_hdr_pdisc(gh);
+ struct sgsn_mm_ctx *mmctx;
+ struct gprs_ra_id ra_id;
+ int rc = -EINVAL;
+
+ bssgp_parse_cell_id(&ra_id, msgb_bcid(msg));
+ mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &ra_id);
+ if (mmctx) {
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
+ mmctx->gb.llme = llme;
+ gprs_gb_recv_pdu(mmctx, msg);
+ }
+
+ /* MMCTX can be NULL */
+
+ switch (pdisc) {
+ case GSM48_PDISC_MM_GPRS:
+ rc = gsm0408_rcv_gmm(mmctx, msg, llme, drop_cipherable);
+ break;
+ case GSM48_PDISC_SM_GPRS:
+ rc = gsm0408_rcv_gsm(mmctx, msg, llme);
+ break;
+ default:
+ LOGMMCTXP(LOGL_NOTICE, mmctx,
+ "Unknown GSM 04.08 discriminator 0x%02x: %s\n",
+ pdisc, osmo_hexdump((uint8_t *)gh, msgb_l3len(msg)));
+ /* FIXME: return status message */
+ break;
+ }
+
+ /* MMCTX can be invalid */
+
+ return rc;
+}
diff --git a/src/sgsn/gprs_gmm_attach.c b/src/sgsn/gprs_gmm_attach.c
index c903a016b..708ea8f23 100644
--- a/src/sgsn/gprs_gmm_attach.c
+++ b/src/sgsn/gprs_gmm_attach.c
@@ -1,10 +1,12 @@
#include <osmocom/core/tdef.h>
+#include <osmocom/crypt/utran_cipher.h>
#include <osmocom/sgsn/gprs_gmm_attach.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/sgsn.h>
#define X(s) (1 << (s))
@@ -257,6 +259,7 @@ static void st_iu_security_cmd_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_
{
#ifdef BUILD_IU
struct sgsn_mm_ctx *ctx = fi->priv;
+ bool send_ck;
/* TODO: shouldn't this set always? not only when the integrity_active? */
if (ctx->iu.ue_ctx->integrity_active) {
@@ -264,7 +267,14 @@ static void st_iu_security_cmd_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_
return;
}
- ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, 0, ctx->iu.new_key);
+ /* Is any encryption above UEA0 enabled? */
+ send_ck = sgsn->cfg.uea_encryption_mask > (1 << OSMO_UTRAN_UEA0);
+ LOGMMCTXP(LOGL_DEBUG, ctx, "Iu Security Mode Command: %s encryption key (UEA encryption mask = 0x%x)\n",
+ send_ck ? "sending" : "not sending", sgsn->cfg.uea_encryption_mask);
+
+ /* FIXME: we should send the set of allowed UEA, as in ranap_new_msg_sec_mod_cmd2(). However, this
+ * is not possible in the iu_client API. See OS#5487. */
+ ranap_iu_tx_sec_mode_cmd(ctx->iu.ue_ctx, &ctx->auth_triplet.vec, send_ck, ctx->iu.new_key);
ctx->iu.new_key = 0;
#endif
}
@@ -272,6 +282,13 @@ static void st_iu_security_cmd_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_
static void st_iu_security_cmd(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch(event) {
+ case E_VLR_ANSWERED:
+ /* We may receive an event due to rx
+ * OSMO_GSUP_MSGT_INSERT_DATA_REQUEST here. Do nothing, update of
+ * subscriber is done by lower layers before event is signalled.
+ * In this state we simply wait for E_IU_SECURITY_CMD_COMPLETE
+ */
+ break;
case E_IU_SECURITY_CMD_COMPLETE:
gmm_attach_fsm_state_chg(fi, ST_ACCEPT);
break;
@@ -308,7 +325,7 @@ static struct osmo_fsm_state gmm_attach_req_fsm_states[] = {
.action = st_auth,
},
[ST_IU_SECURITY_CMD] = {
- .in_event_mask = X(E_IU_SECURITY_CMD_COMPLETE),
+ .in_event_mask = X(E_IU_SECURITY_CMD_COMPLETE) | X(E_VLR_ANSWERED),
.out_state_mask = X(ST_INIT) | X(ST_AUTH) | X(ST_ACCEPT) | X(ST_REJECT),
.name = "IuSecurityCommand",
.onenter = st_iu_security_cmd_on_enter,
diff --git a/src/sgsn/gprs_gmm_fsm.c b/src/sgsn/gprs_gmm_fsm.c
index 886726c68..57e1ec3bb 100644
--- a/src/sgsn/gprs_gmm_fsm.c
+++ b/src/sgsn/gprs_gmm_fsm.c
@@ -1,6 +1,6 @@
/* GMM mobility management states on the network side, 3GPP TS 24.008 § 4.1.3.3 */
/*
- * (C) 2019 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
+ * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
* All Rights Reserved
*
* SPDX-License-Identifier: AGPL-3.0+
@@ -57,6 +57,10 @@ static void st_gmm_deregistered(struct osmo_fsm_inst *fi, uint32_t event, void *
static void st_gmm_common_proc_init(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch(event) {
+ case E_GMM_COMMON_PROC_INIT_REQ:
+ /* MS may retransmit GPRS Attach Request if for some reason
+ * CommonProcedure didn't go forward correctly */
+ break;
/* TODO: events not used
case E_GMM_LOWER_LAYER_FAILED:
case E_GMM_COMMON_PROC_FAILED:
@@ -76,6 +80,11 @@ static void st_gmm_registered_normal(struct osmo_fsm_inst *fi, uint32_t event, v
case E_GMM_COMMON_PROC_INIT_REQ:
gmm_fsm_state_chg(fi, ST_GMM_COMMON_PROC_INIT);
break;
+ case E_GMM_COMMON_PROC_SUCCESS:
+ /* If we were moved from ST_GMM_COMMON_PROC_INIT here by
+ * E_GMM_ATTACH_SUCCESS instead of E_GMM_COMMON_PROC_SUCCESS then we'll receive the latter here:
+ * we should simply ignore it */
+ break;
/* case E_GMM_NET_INIT_DETACH_REQ:
gmm_fsm_state_chg(fi, ST_GMM_DEREGISTERED_INIT);
break; */
@@ -126,7 +135,8 @@ static struct osmo_fsm_state gmm_fsm_states[] = {
/* X(E_GMM_LOWER_LAYER_FAILED) | */
/* X(E_GMM_COMMON_PROC_FAILED) | */
X(E_GMM_COMMON_PROC_SUCCESS) |
- X(E_GMM_ATTACH_SUCCESS),
+ X(E_GMM_ATTACH_SUCCESS) |
+ X(E_GMM_COMMON_PROC_INIT_REQ),
.out_state_mask =
X(ST_GMM_DEREGISTERED) |
X(ST_GMM_REGISTERED_NORMAL),
@@ -136,6 +146,7 @@ static struct osmo_fsm_state gmm_fsm_states[] = {
[ST_GMM_REGISTERED_NORMAL] = {
.in_event_mask =
X(E_GMM_COMMON_PROC_INIT_REQ) |
+ X(E_GMM_COMMON_PROC_SUCCESS) |
/* X(E_GMM_NET_INIT_DETACH_REQ) | */
/* X(E_GMM_MS_INIT_DETACH_REQ) | */
X(E_GMM_SUSPEND),
@@ -194,9 +205,9 @@ void gmm_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *dat
gmm_fsm_state_chg(fi, ST_GMM_DEREGISTERED);
default:
if (mmctx->ran_type == MM_CTX_T_GERAN_Gb)
- osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_IMPLICIT_DETACH, NULL);
+ osmo_fsm_inst_dispatch(mmctx->gb.mm_state_fsm, E_MM_GPRS_DETACH, NULL);
else if (mmctx->ran_type == MM_CTX_T_UTRAN_Iu) {
- osmo_fsm_inst_dispatch(mmctx->iu.mm_state_fsm, E_PMM_IMPLICIT_DETACH, NULL);
+ osmo_fsm_inst_dispatch(mmctx->iu.mm_state_fsm, E_PMM_PS_DETACH, NULL);
mmctx->gb.llme = rat_chg->llme;
}
diff --git a/src/sgsn/gprs_llc.c b/src/sgsn/gprs_llc.c
index 6e22e65c0..6f563851f 100644
--- a/src/sgsn/gprs_llc.c
+++ b/src/sgsn/gprs_llc.c
@@ -33,7 +33,7 @@
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/crc24.h>
@@ -42,16 +42,29 @@
#include <osmocom/sgsn/gprs_sndcp_comp.h>
#include <osmocom/sgsn/gprs_sndcp.h>
+#include <osmocom/crypt/kdf.h>
+
const struct value_string gprs_llc_llme_state_names[] = {
{ GPRS_LLMS_UNASSIGNED, "UNASSIGNED" },
{ GPRS_LLMS_ASSIGNED, "ASSIGNED" },
{ 0, NULL }
};
+const struct value_string gprs_llc_lle_state_names[] = {
+ { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" },
+ { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" },
+ { GPRS_LLES_LOCAL_EST, "Local Establishment" },
+ { GPRS_LLES_REMOTE_EST, "Remote Establishment" },
+ { GPRS_LLES_ABM, "Asynchronous Balanced Mode" },
+ { GPRS_LLES_LOCAL_REL, "Local Release" },
+ { GPRS_LLES_TIMER_REC, "Timer Recovery" },
+ { 0, NULL }
+};
+
static struct gprs_llc_llme *llme_alloc(uint32_t tlli);
-static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg,
+static int gprs_llc_tx_xid(const struct gprs_llc_lle *lle, struct msgb *msg,
int command);
-static int gprs_llc_tx_dm(struct gprs_llc_lle *lle);
+static int gprs_llc_tx_dm(const struct gprs_llc_lle *lle);
static int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi,
int command, enum gprs_llc_u_cmd u_cmd, int pf_bit);
@@ -210,7 +223,7 @@ static int gprs_llc_process_xid_ind(uint8_t *bytes_request,
int bytes_request_len,
uint8_t *bytes_response,
int bytes_response_maxlen,
- struct gprs_llc_lle *lle)
+ const struct gprs_llc_lle *lle)
{
/* Note: This function computes the response that is sent back to the
* MS when a mobile originated XID is received. The function is
@@ -286,7 +299,7 @@ static int gprs_llc_process_xid_ind(uint8_t *bytes_request,
/* Dispatch XID indications and responses comming from the MS */
static void rx_llc_xid(struct gprs_llc_lle *lle,
- struct gprs_llc_hdr_parsed *gph)
+ const struct gprs_llc_hdr_parsed *gph)
{
uint8_t response[1024];
int response_len;
@@ -376,20 +389,24 @@ static int _bssgp_tx_dl_ud(struct msgb *msg, struct sgsn_mm_ctx *mmctx)
* not yet have a MMC context (e.g. XID negotiation of primarly
* LLC connection from GMM sapi). */
if (mmctx) {
+ /* In rare cases the LLME is NULL in those cases don't
+ * use the mm radio capabilities */
dup.imsi = mmctx->imsi;
- dup.drx_parms = mmctx->drx_parms;
- dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len;
- dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
-
- /* make sure we only send it to the right llme */
- if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli
- || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) {
- LOGP(DLLC, LOGL_ERROR,
- "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:"
- " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n",
- msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli);
- msgb_free(msg);
- return -EINVAL;
+ if (mmctx->gb.llme) {
+ dup.drx_parms = mmctx->drx_parms;
+ dup.ms_ra_cap.len = mmctx->ms_radio_access_capa.len;
+ dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf;
+
+ /* make sure we only send it to the right llme */
+ if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli
+ || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) {
+ LOGP(DLLC, LOGL_ERROR,
+ "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:"
+ " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n",
+ msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli);
+ msgb_free(msg);
+ return -EINVAL;
+ }
}
}
memcpy(&dup.qos_profile, qos_profile_default,
@@ -584,6 +601,7 @@ static struct gprs_llc_llme *llme_alloc(uint32_t tlli)
static void llme_free(struct gprs_llc_llme *llme)
{
+ gprs_sndcp_sm_deactivate_ind_by_llme(llme);
gprs_sndcp_comp_free(llme->comp.proto);
gprs_sndcp_comp_free(llme->comp.data);
llist_del(&llme->list);
@@ -666,15 +684,15 @@ int gprs_llc_tx_u(struct msgb *msg, uint8_t sapi, int command,
/* Identifiers passed down: (BVCI, NSEI) */
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
- rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], msg->len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_PACKETS));
+ rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_BYTES), msg->len);
/* Send BSSGP-DL-UNITDATA.req */
return _bssgp_tx_dl_ud(msg, NULL);
}
/* Send XID response to LLE */
-static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg,
+static int gprs_llc_tx_xid(const struct gprs_llc_lle *lle, struct msgb *msg,
int command)
{
/* copy identifiers from LLE to ensure lower layers can route */
@@ -685,7 +703,7 @@ static int gprs_llc_tx_xid(struct gprs_llc_lle *lle, struct msgb *msg,
return gprs_llc_tx_u(msg, lle->sapi, command, GPRS_LLC_U_XID, 1);
}
-static int gprs_llc_tx_dm(struct gprs_llc_lle *lle)
+static int gprs_llc_tx_dm(const struct gprs_llc_lle *lle)
{
struct msgb *msg = msgb_alloc_headroom(4096, 1024, "LLC_DM");
@@ -698,7 +716,7 @@ static int gprs_llc_tx_dm(struct gprs_llc_lle *lle)
}
/* encrypt information field + FCS, if needed! */
-static int apply_gea(struct gprs_llc_lle *lle, uint16_t crypt_len, uint16_t nu,
+static int apply_gea(const struct gprs_llc_lle *lle, uint16_t crypt_len, uint16_t nu,
uint32_t oc, uint8_t sapi, uint8_t *fcs, uint8_t *data)
{
uint8_t cipher_out[GSM0464_CIPH_MAX_BLOCK];
@@ -810,8 +828,8 @@ int gprs_llc_tx_ui(struct msgb *msg, uint8_t sapi, int command,
}
}
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
- rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], msg->len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_PACKETS));
+ rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_BYTES), msg->len);
/* Identifiers passed down: (BVCI, NSEI) */
@@ -958,9 +976,9 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
llhp.data);
if (rc < 0)
return rc;
- llhp.fcs = *(llhp.data + llhp.data_len);
- llhp.fcs |= *(llhp.data + llhp.data_len + 1) << 8;
- llhp.fcs |= *(llhp.data + llhp.data_len + 2) << 16;
+ llhp.fcs = *(llhp.data + llhp.data_len);
+ llhp.fcs |= *(llhp.data + llhp.data_len + 1) << 8;
+ llhp.fcs |= *(llhp.data + llhp.data_len + 2) << 16;
} else {
LOGP(DLLC, LOGL_NOTICE, "encrypted frame for LLC that "
"has no KC/Algo! Dropping.\n");
@@ -996,8 +1014,8 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
msgb_l3trim(msg, llhp.data_len);
}
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]);
- rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], msg->len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_UL_PACKETS));
+ rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_UL_BYTES), msg->len);
/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
@@ -1012,7 +1030,7 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
case GPRS_SAPI_SNDCP9:
case GPRS_SAPI_SNDCP11:
/* send LL_DATA_IND/LL_UNITDATA_IND to SNDCP */
- rc = sndcp_llunitdata_ind(msg, lle, llhp.data, llhp.data_len);
+ rc = sndcp_ll_unitdata_ind(msg, lle, llhp.data, llhp.data_len);
break;
case GPRS_SAPI_SMS:
/* FIXME */
@@ -1030,7 +1048,7 @@ int gprs_llc_rcvmsg(struct msgb *msg, struct tlv_parsed *tv)
}
/* Propagate crypto parameters MM -> LLME */
-void gprs_llme_copy_key(struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme)
+void gprs_llme_copy_key(const struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme)
{
if (!mm)
return;
@@ -1038,8 +1056,13 @@ void gprs_llme_copy_key(struct sgsn_mm_ctx *mm, struct gprs_llc_llme *llme)
llme->algo = mm->ciph_algo;
if (llme->cksn != mm->auth_triplet.key_seq &&
mm->auth_triplet.key_seq != GSM_KEY_SEQ_INVAL) {
- memcpy(llme->kc, mm->auth_triplet.vec.kc,
- gprs_cipher_key_length(mm->ciph_algo));
+
+ /* gea4 needs kc128 */
+ if (mm->ciph_algo == GPRS_ALGO_GEA4)
+ osmo_kdf_kc128(mm->auth_triplet.vec.ck, mm->auth_triplet.vec.ik, llme->kc);
+ else
+ memcpy(llme->kc, mm->auth_triplet.vec.kc, gprs_cipher_key_length(mm->ciph_algo));
+
llme->cksn = mm->auth_triplet.key_seq;
}
} else
diff --git a/src/sgsn/gprs_llc_vty.c b/src/sgsn/gprs_llc_vty.c
index 418be8348..4572f957c 100644
--- a/src/sgsn/gprs_llc_vty.c
+++ b/src/sgsn/gprs_llc_vty.c
@@ -39,22 +39,11 @@
#include <osmocom/vty/vty.h>
#include <osmocom/vty/command.h>
-struct value_string gprs_llc_state_strs[] = {
- { GPRS_LLES_UNASSIGNED, "TLLI Unassigned" },
- { GPRS_LLES_ASSIGNED_ADM, "TLLI Assigned" },
- { GPRS_LLES_LOCAL_EST, "Local Establishment" },
- { GPRS_LLES_REMOTE_EST, "Remote Establishment" },
- { GPRS_LLES_ABM, "Asynchronous Balanced Mode" },
- { GPRS_LLES_LOCAL_REL, "Local Release" },
- { GPRS_LLES_TIMER_REC, "Timer Recovery" },
- { 0, NULL }
-};
-
static void vty_dump_lle(struct vty *vty, struct gprs_llc_lle *lle)
{
struct gprs_llc_params *par = &lle->params;
- vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi,
- get_value_string(gprs_llc_state_strs, lle->state),
+ vty_out(vty, " SAPI %2u State %s VUsend=%u, VUrecv=%u", lle->sapi,
+ get_value_string(gprs_llc_lle_state_names, lle->state),
lle->vu_send, lle->vu_recv);
vty_out(vty, " Vsent=%u Vack=%u Vrecv=%u, RetransCtr=%u%s",
lle->v_sent, lle->v_ack, lle->v_recv,
@@ -79,7 +68,7 @@ static void vty_dump_llme(struct vty *vty, struct gprs_llc_llme *llme)
get_value_string(gprs_cipher_names, llme->algo), llme->iov_ui,
llme->cksn, llme->age_timestamp == GPRS_LLME_RESET_AGE ? 0 :
(int)(now_tp.tv_sec - (time_t)llme->age_timestamp),
- get_value_string(gprs_llc_state_strs, llme->state), VTY_NEWLINE);
+ get_value_string(gprs_llc_llme_state_names, llme->state), VTY_NEWLINE);
for (i = 0; i < ARRAY_SIZE(valid_sapis); i++) {
struct gprs_llc_lle *lle;
diff --git a/src/sgsn/gprs_mm_state_gb_fsm.c b/src/sgsn/gprs_mm_state_gb_fsm.c
index 811f0c2f4..dde7b770a 100644
--- a/src/sgsn/gprs_mm_state_gb_fsm.c
+++ b/src/sgsn/gprs_mm_state_gb_fsm.c
@@ -1,3 +1,25 @@
+/* TS 23.060 § 6.1.1 Mobility Management States (A/Gb mode) */
+/*
+ * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: AGPL-3.0+
+ *
+ * Author: Pau Espin Pedrol <pespin@sysmocom.de>
+ *
+ * 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.
+ *
+ * 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 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/>.
+ */
#include <osmocom/core/tdef.h>
#include <osmocom/sgsn/gprs_mm_state_gb_fsm.h>
@@ -5,6 +27,7 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#define X(s) (1 << (s))
@@ -49,7 +72,7 @@ static void st_mm_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data)
case E_MM_READY_TIMER_EXPIRY:
mm_state_gb_fsm_state_chg(fi, ST_MM_STANDBY);
break;
- case E_MM_IMPLICIT_DETACH:
+ case E_MM_GPRS_DETACH:
mm_state_gb_fsm_state_chg(fi, ST_MM_IDLE);
break;
case E_MM_PDU_RECEPTION:
@@ -68,6 +91,9 @@ static void st_mm_standby(struct osmo_fsm_inst *fi, uint32_t event, void *data)
case E_MM_PDU_RECEPTION:
mm_state_gb_fsm_state_chg(fi, ST_MM_READY);
break;
+ case E_MM_GPRS_DETACH:
+ mm_state_gb_fsm_state_chg(fi, ST_MM_IDLE);
+ break;
}
}
@@ -80,13 +106,13 @@ static struct osmo_fsm_state mm_state_gb_fsm_states[] = {
.action = st_mm_idle,
},
[ST_MM_READY] = {
- .in_event_mask = X(E_MM_READY_TIMER_EXPIRY) | X(E_MM_RA_UPDATE) | X(E_MM_IMPLICIT_DETACH) | X(E_MM_PDU_RECEPTION),
+ .in_event_mask = X(E_MM_READY_TIMER_EXPIRY) | X(E_MM_RA_UPDATE) | X(E_MM_GPRS_DETACH) | X(E_MM_PDU_RECEPTION),
.out_state_mask = X(ST_MM_IDLE) | X(ST_MM_STANDBY),
.name = "Ready",
.action = st_mm_ready,
},
[ST_MM_STANDBY] = {
- .in_event_mask = X(E_MM_PDU_RECEPTION),
+ .in_event_mask = X(E_MM_PDU_RECEPTION) | X(E_MM_GPRS_DETACH),
.out_state_mask = X(ST_MM_IDLE) | X(ST_MM_READY),
.name = "Standby",
.action = st_mm_standby,
@@ -96,7 +122,7 @@ static struct osmo_fsm_state mm_state_gb_fsm_states[] = {
const struct value_string mm_state_gb_fsm_event_names[] = {
OSMO_VALUE_STRING(E_MM_GPRS_ATTACH),
OSMO_VALUE_STRING(E_MM_PDU_RECEPTION),
- OSMO_VALUE_STRING(E_MM_IMPLICIT_DETACH),
+ OSMO_VALUE_STRING(E_MM_GPRS_DETACH),
OSMO_VALUE_STRING(E_MM_READY_TIMER_EXPIRY),
OSMO_VALUE_STRING(E_MM_RA_UPDATE),
{ 0, NULL }
diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c
index e571026c8..c2e9c4498 100644
--- a/src/sgsn/gprs_mm_state_iu_fsm.c
+++ b/src/sgsn/gprs_mm_state_iu_fsm.c
@@ -1,3 +1,25 @@
+/* TS 23.060 § 6.1.2 Mobility Management States (Iu mode) */
+/*
+ * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: AGPL-3.0+
+ *
+ * Author: Pau Espin Pedrol <pespin@sysmocom.de>
+ *
+ * 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.
+ *
+ * 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 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/>.
+ */
#include <arpa/inet.h>
#include <osmocom/core/tdef.h>
@@ -7,13 +29,15 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_ranap.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
+#include <osmocom/sgsn/mmctx.h>
#define X(s) (1 << (s))
static const struct osmo_tdef_state_timeout mm_state_iu_fsm_timeouts[32] = {
[ST_PMM_DETACHED] = { },
- /* non-spec -T3314 (User inactivity timer) */
- [ST_PMM_CONNECTED] = { .T=-3314 },
+ [ST_PMM_CONNECTED] = { },
[ST_PMM_IDLE] = { },
};
@@ -40,7 +64,7 @@ static void st_pmm_detached(struct osmo_fsm_inst *fi, uint32_t event, void *data
case E_PMM_PS_ATTACH:
mm_state_iu_fsm_state_chg(fi, ST_PMM_CONNECTED);
break;
- case E_PMM_IMPLICIT_DETACH:
+ case E_PMM_PS_DETACH:
break;
}
}
@@ -48,24 +72,16 @@ static void st_pmm_detached(struct osmo_fsm_inst *fi, uint32_t event, void *data
static void st_pmm_connected(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct sgsn_mm_ctx *ctx = fi->priv;
- const struct RANAP_Cause user_inactive_cause = {
- .present = RANAP_Cause_PR_radioNetwork,
- .choice.radioNetwork = RANAP_CauseRadioNetwork_user_inactivity,
- };
switch(event) {
case E_PMM_PS_CONN_RELEASE:
sgsn_ranap_iu_free(ctx);
mm_state_iu_fsm_state_chg(fi, ST_PMM_IDLE);
break;
- case E_PMM_IMPLICIT_DETACH:
+ case E_PMM_PS_DETACH:
sgsn_ranap_iu_release_free(ctx, NULL);
mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
break;
- case E_PMM_USER_INACTIVITY:
- sgsn_ranap_iu_release_free(ctx, &user_inactive_cause);
- mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
- break;
case E_PMM_RA_UPDATE:
break;
}
@@ -81,43 +97,37 @@ static void st_pmm_idle_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
static void st_pmm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch(event) {
+ case E_PMM_PS_ATTACH:
case E_PMM_PS_CONN_ESTABLISH:
mm_state_iu_fsm_state_chg(fi, ST_PMM_CONNECTED);
break;
- case E_PMM_IMPLICIT_DETACH:
+ case E_PMM_PS_DETACH:
mm_state_iu_fsm_state_chg(fi, ST_PMM_DETACHED);
break;
}
}
-static int pmm_state_fsm_timer_cb(struct osmo_fsm_inst *fi)
-{
- switch(fi->state) {
- case ST_PMM_CONNECTED:
- /* timer for pmm state. state=CONNECTED: -T3314 (User inactivity timer) */
- osmo_fsm_inst_dispatch(fi, E_PMM_USER_INACTIVITY, NULL);
- break;
- }
-
- return 0;
-}
-
static struct osmo_fsm_state mm_state_iu_fsm_states[] = {
[ST_PMM_DETACHED] = {
- .in_event_mask = X(E_PMM_PS_ATTACH) | X(E_PMM_IMPLICIT_DETACH),
+ .in_event_mask = X(E_PMM_PS_ATTACH) | X(E_PMM_PS_DETACH),
.out_state_mask = X(ST_PMM_CONNECTED),
.name = "Detached",
.action = st_pmm_detached,
},
[ST_PMM_CONNECTED] = {
- .in_event_mask = X(E_PMM_PS_CONN_RELEASE) | X(E_PMM_RA_UPDATE)
- | X(E_PMM_IMPLICIT_DETACH) | X(E_PMM_USER_INACTIVITY),
+ .in_event_mask =
+ X(E_PMM_PS_CONN_RELEASE) |
+ X(E_PMM_RA_UPDATE) |
+ X(E_PMM_PS_DETACH),
.out_state_mask = X(ST_PMM_DETACHED) | X(ST_PMM_IDLE),
.name = "Connected",
.action = st_pmm_connected,
},
[ST_PMM_IDLE] = {
- .in_event_mask = X(E_PMM_IMPLICIT_DETACH) | X(E_PMM_PS_CONN_ESTABLISH),
+ .in_event_mask =
+ X(E_PMM_PS_DETACH) |
+ X(E_PMM_PS_CONN_ESTABLISH) |
+ X(E_PMM_PS_ATTACH),
.out_state_mask = X(ST_PMM_DETACHED) | X(ST_PMM_CONNECTED),
.name = "Idle",
.onenter = st_pmm_idle_on_enter,
@@ -129,9 +139,8 @@ const struct value_string mm_state_iu_fsm_event_names[] = {
OSMO_VALUE_STRING(E_PMM_PS_ATTACH),
OSMO_VALUE_STRING(E_PMM_PS_CONN_RELEASE),
OSMO_VALUE_STRING(E_PMM_PS_CONN_ESTABLISH),
- OSMO_VALUE_STRING(E_PMM_IMPLICIT_DETACH),
+ OSMO_VALUE_STRING(E_PMM_PS_DETACH),
OSMO_VALUE_STRING(E_PMM_RA_UPDATE),
- OSMO_VALUE_STRING(E_PMM_USER_INACTIVITY),
{ 0, NULL }
};
@@ -140,7 +149,6 @@ struct osmo_fsm mm_state_iu_fsm = {
.states = mm_state_iu_fsm_states,
.num_states = ARRAY_SIZE(mm_state_iu_fsm_states),
.event_names = mm_state_iu_fsm_event_names,
- .timer_cb = pmm_state_fsm_timer_cb,
.log_subsys = DMM,
};
diff --git a/src/sgsn/gprs_ns.c b/src/sgsn/gprs_ns.c
new file mode 100644
index 000000000..eb447facd
--- /dev/null
+++ b/src/sgsn/gprs_ns.c
@@ -0,0 +1,103 @@
+/* Messages on the Gb interface (A/Gb mode) */
+
+/* (C) 2009-2015 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2010 by On-Waves
+ * (C) 2019 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+
+#include <osmocom/core/rate_ctr.h>
+
+#include <osmocom/gprs/gprs_msgb.h>
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_ns2.h>
+#include <osmocom/gprs/gprs_bssgp_bss.h>
+#include <osmocom/sgsn/gprs_llc.h>
+
+#include "config.h"
+
+#include <osmocom/sgsn/debug.h>
+
+void gprs_ns_prim_status_cb(struct osmo_gprs_ns2_prim *nsp)
+{
+ switch (nsp->u.status.cause) {
+ case GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED:
+ LOGP(DGPRS, LOGL_NOTICE, "NS-E %d SNS configured.\n", nsp->nsei);
+ break;
+ case GPRS_NS2_AFF_CAUSE_RECOVERY:
+ LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became available\n", nsp->nsei);
+ /* workaround for broken BSS which doesn't respond correct to BSSGP status message.
+ * Sent a BSSGP Reset when a persistent NSVC comes up for the first time. */
+ if (nsp->u.status.first && nsp->u.status.persistent) {
+ struct bssgp_bvc_ctx bctx = {
+ .nsei = nsp->nsei,
+ };
+ bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false);
+ }
+ break;
+ case GPRS_NS2_AFF_CAUSE_FAILURE:
+ LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became unavailable\n", nsp->nsei);
+ break;
+ default:
+ LOGP(DGPRS, LOGL_NOTICE, "NS: %s Unknown prim %d from NS\n",
+ get_value_string(osmo_prim_op_names, nsp->oph.operation), nsp->oph.primitive);
+ break;
+ }
+}
+
+/* call-back function for the NS protocol */
+int gprs_ns_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
+{
+ struct osmo_gprs_ns2_prim *nsp;
+ int rc = 0;
+
+ if (oph->sap != SAP_NS)
+ return 0;
+
+ nsp = container_of(oph, struct osmo_gprs_ns2_prim, oph);
+
+ if (oph->operation != PRIM_OP_INDICATION) {
+ LOGP(DGPRS, LOGL_NOTICE, "NS: %s Unknown prim %d from NS\n",
+ get_value_string(osmo_prim_op_names, oph->operation),
+ oph->operation);
+ return 0;
+ }
+
+ switch (oph->primitive) {
+ case GPRS_NS2_PRIM_UNIT_DATA:
+ /* hand the message into the BSSGP implementation */
+ /* add required msg fields for Gb layer */
+ msgb_bssgph(oph->msg) = oph->msg->l3h;
+ msgb_bvci(oph->msg) = nsp->bvci;
+ msgb_nsei(oph->msg) = nsp->nsei;
+ rc = bssgp_rcvmsg(oph->msg);
+ break;
+ case GPRS_NS2_PRIM_STATUS:
+ gprs_ns_prim_status_cb(nsp);
+ break;
+ default:
+ LOGP(DGPRS, LOGL_NOTICE, "NS: %s Unknown prim %d from NS\n",
+ get_value_string(osmo_prim_op_names, oph->operation), oph->primitive);
+ break;
+ }
+
+ if (oph->msg)
+ msgb_free(oph->msg);
+
+ return rc;
+}
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 7a3349192..5e0d8edc6 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -21,11 +21,12 @@
*
*/
-#include "bscconfig.h"
+#include "config.h"
#include <gtp.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/tdef.h>
+#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/ranap/ranap_common.h>
@@ -36,6 +37,10 @@
#include <osmocom/sgsn/gprs_ranap.h>
#include <osmocom/sgsn/gprs_gmm_attach.h>
#include <osmocom/sgsn/gprs_mm_state_iu_fsm.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
+#include <osmocom/sgsn/mmctx.h>
/* Send RAB activation requests for all PDP contexts */
void activate_pdp_rabs(struct sgsn_mm_ctx *ctx)
@@ -119,7 +124,8 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
if (!mm) {
- LOGIUP(ctx, LOGL_NOTICE, "Cannot find mm ctx for IU event %d\n", type);
+ LOGIUP(ctx, LOGL_NOTICE, "Cannot find mm ctx for IU event %s\n",
+ ranap_iu_event_type_str(type));
ranap_iu_free_ue(ctx);
return rc;
}
@@ -132,10 +138,9 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type
/* fall thru */
case RANAP_IU_EVENT_LINK_INVALIDATED:
/* Clean up ranap_ue_conn_ctx here */
- LOGMMCTXP(LOGL_INFO, mm, "IU release for imsi %s\n", mm->imsi);
- if (mm->iu.mm_state_fsm->state == ST_PMM_CONNECTED)
- osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
- else
+ LOGMMCTXP(LOGL_INFO, mm, "IU release (cause=%s)\n", ranap_iu_event_type_str(type));
+ rc = osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_PS_CONN_RELEASE, NULL);
+ if (rc < 0)
sgsn_ranap_iu_free(mm);
/* TODO: move this into FSM */
@@ -144,6 +149,11 @@ int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type
rc = 0;
break;
case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE:
+ /* FIXME: verify that a permitted UEA level was chosen. Compare how osmo-msc does it in
+ * msc_a_ran_dec_from_msc_i(), case RAN_MSG_CIPHER_MODE_COMPLETE.
+ * We should dissolve iu_client.c, it was a design mistake when first implementing Iu support. osmo-msc
+ * has moved away from it a long time ago.
+ */
/* Continue authentication here */
mm->iu.ue_ctx->integrity_active = 1;
ranap_iu_tx_common_id(mm->iu.ue_ctx, mm->imsi);
@@ -231,7 +241,7 @@ int gsm0408_gprs_rcvmsg_iu(struct msgb *msg, struct gprs_ra_id *ra_id,
mmctx = sgsn_mm_ctx_by_ue_ctx(MSG_IU_UE_CTX(msg));
if (mmctx) {
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
if (ra_id)
memcpy(&mmctx->ra, ra_id, sizeof(mmctx->ra));
}
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index f8019ab6a..88d1feb5a 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -26,7 +26,7 @@
#include <arpa/inet.h>
#include <netdb.h>
-#include "bscconfig.h"
+#include "config.h"
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/tdef.h>
@@ -36,13 +36,15 @@
#include <osmocom/sgsn/gprs_sm.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_utils.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_ranap.h>
-
-extern void *tall_sgsn_ctx;
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
+#include <osmocom/sgsn/mmctx.h>
/* 3GPP TS 04.08 sec 6.1.3.4.3(.a) "Abnormal cases" */
#define T339X_MAX_RETRANS 4
@@ -186,7 +188,7 @@ int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp)
uint8_t transaction_id = pdp->ti ^ 0x8; /* flip */
LOGPDPCTXP(LOGL_INFO, pdp, "<- ACTIVATE PDP CONTEXT ACK\n");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_ACCEPT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_ACCEPT));
mmctx2msgid(msg, pdp->mm);
@@ -232,7 +234,7 @@ int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid,
LOGMMCTXP(LOGL_NOTICE, mm, "<- ACTIVATE PDP CONTEXT REJ: %s\n",
get_value_string(gsm48_gsm_cause_names, cause));
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_REJECT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_REJECT));
mmctx2msgid(msg, mm);
@@ -257,7 +259,7 @@ static int _gsm48_tx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, uint8_t tid,
uint8_t tear_down_ind = (0x9 << 4) | (!!teardown);
LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT REQ\n");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_DL_DEACTIVATE_REQUEST));
mmctx2msgid(msg, mm);
@@ -285,7 +287,7 @@ static int _gsm48_tx_gsm_deact_pdp_acc(struct sgsn_mm_ctx *mm, uint8_t tid)
uint8_t transaction_id = tid ^ 0x8; /* flip */
LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT ACK\n");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_ACCEPT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_DL_DEACTIVATE_ACCEPT));
mmctx2msgid(msg, mm);
@@ -376,7 +378,7 @@ static void ggsn_lookup_cb(void *arg, int status, int timeouts, struct hostent *
goto reject_due_failure;
}
- ggsn = sgsn_ggsn_ctx_alloc(UINT32_MAX);
+ ggsn = sgsn_ggsn_ctx_alloc(sgsn, UINT32_MAX);
if (!ggsn) {
LOGMMCTXP(LOGL_ERROR, lookup->mmctx, "Failed to create ggsn.\n");
goto reject_due_failure;
@@ -448,7 +450,7 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del
DEBUGPC(DMM, "IPv4 ");
if (req_pdpa_len >= 6) {
struct in_addr ia;
- ia.s_addr = ntohl(*((uint32_t *) (req_pdpa+2)));
+ ia.s_addr = osmo_load32be(req_pdpa+2);
DEBUGPC(DMM, "%s ", inet_ntop(AF_INET, &ia, buf, sizeof(buf)));
}
break;
@@ -533,7 +535,7 @@ static int do_act_pdp_req(struct sgsn_mm_ctx *mmctx, struct msgb *msg, bool *del
/* Only increment counter for a real activation, after we checked
* for re-transmissions */
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PDP_CTX_ACT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PDP_CTX_ACT));
/* Determine GGSN based on APN and subscription options */
ggsn = sgsn_mm_ctx_find_ggsn_ctx(mmctx, &tp, &gsm_cause, apn_str);
@@ -591,7 +593,7 @@ static int gsm48_rx_gsm_act_pdp_req(struct sgsn_mm_ctx *mmctx,
struct msgb *msg;
int rc;
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_REQUEST));
/*
* This is painful. We might not have a static GGSN
@@ -629,7 +631,7 @@ static int gsm48_rx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, struct msgb *msg)
LOGMMCTXP(LOGL_INFO, mm, "-> DEACTIVATE PDP CONTEXT REQ (cause: %s)\n",
get_value_string(gsm48_gsm_cause_names, gh->data[0]));
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_UL_DEACTIVATE_REQUEST]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_UL_DEACTIVATE_REQUEST));
pdp = sgsn_pdp_ctx_by_tid(mm, transaction_id);
if (!pdp) {
@@ -639,7 +641,11 @@ static int gsm48_rx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, struct msgb *msg)
return _gsm48_tx_gsm_deact_pdp_acc(mm, transaction_id);
}
- return sgsn_delete_pdp_ctx(pdp);
+ if (pdp->ggsn)
+ return sgsn_delete_pdp_ctx(pdp);
+ /* GTP side already detached, freeing */
+ sgsn_pdp_ctx_free(pdp);
+ return 0;
}
/* 3GPP TS 24.008 § 9.5.9: Deactivate PDP Context Accept */
@@ -650,7 +656,7 @@ static int gsm48_rx_gsm_deact_pdp_ack(struct sgsn_mm_ctx *mm, struct msgb *msg)
struct sgsn_pdp_ctx *pdp;
LOGMMCTXP(LOGL_INFO, mm, "-> DEACTIVATE PDP CONTEXT ACK\n");
- rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_UL_DEACTIVATE_ACCEPT]);
+ rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_UL_DEACTIVATE_ACCEPT));
pdp = sgsn_pdp_ctx_by_tid(mm, transaction_id);
if (!pdp) {
diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c
index 7ce69600d..3eae127fc 100644
--- a/src/sgsn/gprs_sndcp.c
+++ b/src/sgsn/gprs_sndcp.c
@@ -28,10 +28,11 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/talloc.h>
+#include <osmocom/core/endian.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gprs_gb.h>
+#include <osmocom/sgsn/gprs_ns.h>
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_sndcp.h>
@@ -40,6 +41,9 @@
#include <osmocom/sgsn/gprs_sndcp_pcomp.h>
#include <osmocom/sgsn/gprs_sndcp_dcomp.h>
#include <osmocom/sgsn/gprs_sndcp_comp.h>
+#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/mmctx.h>
+#include <osmocom/sgsn/gtp.h>
#define DEBUG_IP_PACKETS 0 /* 0=Disabled, 1=Enabled */
@@ -65,7 +69,7 @@ static uint16_t calc_ip_csum(uint8_t *data, int len)
}
/* Calculate TCP/IP checksum */
-static uint16_t calc_tcpip_csum(const void *ctx, uint8_t *packet, int len)
+static uint16_t calc_tcpip_csum(const void *ctx, const uint8_t *packet, int len)
{
uint8_t *buf;
uint16_t csum;
@@ -83,7 +87,7 @@ static uint16_t calc_tcpip_csum(const void *ctx, uint8_t *packet, int len)
}
/* Show some ip packet details */
-static void debug_ip_packet(uint8_t *data, int len, int dir, char *info)
+static void debug_ip_packet(const uint8_t *data, int len, int dir, const char *info)
{
uint8_t tcp_flags;
char flags_debugmsg[256];
@@ -164,27 +168,43 @@ static void debug_ip_packet(uint8_t *data, int len, int dir, char *info)
/* Chapter 7.2: SN-PDU Formats */
struct sndcp_common_hdr {
+#if OSMO_IS_LITTLE_ENDIAN
/* octet 1 */
uint8_t nsapi:4;
uint8_t more:1;
uint8_t type:1;
uint8_t first:1;
uint8_t spare:1;
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
+ uint8_t spare:1, first:1, type:1, more:1, nsapi:4;
+#endif
} __attribute__((packed));
/* PCOMP / DCOMP only exist in first fragment */
struct sndcp_comp_hdr {
+#if OSMO_IS_LITTLE_ENDIAN
/* octet 2 */
uint8_t pcomp:4;
uint8_t dcomp:4;
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
+ uint8_t dcomp:4, pcomp:4;
+#endif
} __attribute__((packed));
struct sndcp_udata_hdr {
+#if OSMO_IS_LITTLE_ENDIAN
/* octet 3 */
uint8_t npdu_high:4;
uint8_t seg_nr:4;
/* octet 4 */
uint8_t npdu_low;
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
+ uint8_t seg_nr:4, npdu_high:4;
+ uint8_t npdu_low;
+#endif
} __attribute__((packed));
@@ -204,7 +224,8 @@ struct defrag_queue_entry {
LLIST_HEAD(gprs_sndcp_entities);
/* Check if any compression parameters are set in the sgsn configuration */
-static inline int any_pcomp_or_dcomp_active(struct sgsn_instance *sgsn) {
+static inline int any_pcomp_or_dcomp_active(const struct sgsn_instance *sgsn)
+{
if (sgsn->cfg.pcomp_rfc1144.active || sgsn->cfg.pcomp_rfc1144.passive ||
sgsn->cfg.dcomp_v42bis.active || sgsn->cfg.dcomp_v42bis.passive)
return true;
@@ -243,7 +264,7 @@ static int defrag_enqueue(struct gprs_sndcp_entity *sne, uint8_t seg_nr,
}
/* return if we have all segments of this N-PDU */
-static int defrag_have_all_segments(struct gprs_sndcp_entity *sne)
+static int defrag_have_all_segments(const struct gprs_sndcp_entity *sne)
{
uint32_t seg_needed = 0;
unsigned int i;
@@ -258,7 +279,7 @@ static int defrag_have_all_segments(struct gprs_sndcp_entity *sne)
return 0;
}
-static struct defrag_queue_entry *defrag_get_seg(struct gprs_sndcp_entity *sne,
+static struct defrag_queue_entry *defrag_get_seg(const struct gprs_sndcp_entity *sne,
uint32_t seg_nr)
{
struct defrag_queue_entry *dqe;
@@ -272,13 +293,62 @@ static struct defrag_queue_entry *defrag_get_seg(struct gprs_sndcp_entity *sne,
return NULL;
}
+/* Returns talloced buffer containing decompressed data, NULL on error. */
+static uint8_t *decompress_segment(struct gprs_sndcp_entity *sne, void *ctx,
+ const uint8_t *compressed_data, unsigned int compressed_data_len,
+ unsigned int *decompressed_data_len)
+{
+ int rc;
+ uint8_t *expnd = NULL;
+ *decompressed_data_len = 0;
+
+#if DEBUG_IP_PACKETS == 1
+ DEBUGP(DSNDCP, "\n");
+ DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
+ DEBUGP(DSNDCP, "===================================================\n");
+#endif
+
+ expnd = talloc_zero_size(ctx, compressed_data_len * MAX_DATADECOMPR_FAC +
+ MAX_HDRDECOMPR_INCR);
+ memcpy(expnd, compressed_data, compressed_data_len);
+
+ /* Apply data decompression */
+ rc = gprs_sndcp_dcomp_expand(expnd, compressed_data_len, sne->defrag.dcomp,
+ sne->defrag.data);
+ if (rc < 0) {
+ LOGP(DSNDCP, LOGL_ERROR,
+ "Data decompression failed!\n");
+ talloc_free(expnd);
+ return NULL;
+ }
+
+ /* Apply header decompression */
+ rc = gprs_sndcp_pcomp_expand(expnd, rc, sne->defrag.pcomp, sne->defrag.proto);
+ if (rc < 0) {
+ LOGP(DSNDCP, LOGL_ERROR,
+ "TCP/IP Header decompression failed!\n");
+ talloc_free(expnd);
+ return NULL;
+ }
+
+ *decompressed_data_len = rc;
+
+#if DEBUG_IP_PACKETS == 1
+ debug_ip_packet(expnd, *decompressed_data_len, 1, "defrag_segments()");
+ DEBUGP(DSNDCP, "===================================================\n");
+ DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
+ DEBUGP(DSNDCP, "\n");
+#endif
+ return expnd;
+}
+
/* Perform actual defragmentation and create an output packet */
static int defrag_segments(struct gprs_sndcp_entity *sne)
{
struct msgb *msg;
unsigned int seg_nr;
uint8_t *npdu;
- int npdu_len;
+ unsigned int npdu_len;
int rc;
uint8_t *expnd = NULL;
@@ -319,59 +389,26 @@ static int defrag_segments(struct gprs_sndcp_entity *sne)
* hands it off to the correct GTP tunnel + GGSN via gtp_data_req() */
/* Decompress packet */
-#if DEBUG_IP_PACKETS == 1
- DEBUGP(DSNDCP, " \n");
- DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
- DEBUGP(DSNDCP, "===================================================\n");
-#endif
if (any_pcomp_or_dcomp_active(sgsn)) {
-
- expnd = talloc_zero_size(msg, npdu_len * MAX_DATADECOMPR_FAC +
- MAX_HDRDECOMPR_INCR);
- memcpy(expnd, npdu, npdu_len);
-
- /* Apply data decompression */
- rc = gprs_sndcp_dcomp_expand(expnd, npdu_len, sne->defrag.dcomp,
- sne->defrag.data);
- if (rc < 0) {
- LOGP(DSNDCP, LOGL_ERROR,
- "Data decompression failed!\n");
- talloc_free(expnd);
- return -EIO;
- }
-
- /* Apply header decompression */
- rc = gprs_sndcp_pcomp_expand(expnd, rc, sne->defrag.pcomp,
- sne->defrag.proto);
- if (rc < 0) {
- LOGP(DSNDCP, LOGL_ERROR,
- "TCP/IP Header decompression failed!\n");
- talloc_free(expnd);
- return -EIO;
+ expnd = decompress_segment(sne, msg, npdu, npdu_len, &npdu_len);
+ if (!expnd) {
+ rc = -EIO;
+ goto ret_free;
}
-
- /* Modify npu length, expnd is handed directly handed
- * over to gsn_rx_sndcp_ud_ind(), see below */
- npdu_len = rc;
- } else
+ } else {
expnd = npdu;
-#if DEBUG_IP_PACKETS == 1
- debug_ip_packet(expnd, npdu_len, 1, "defrag_segments()");
- DEBUGP(DSNDCP, "===================================================\n");
- DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
- DEBUGP(DSNDCP, " \n");
-#endif
+ }
- /* Hand off packet to gtp */
- rc = sgsn_rx_sndcp_ud_ind(&sne->ra_id, sne->lle->llme->tlli,
- sne->nsapi, msg, npdu_len, expnd);
+ /* Hand off packet to SGSN (SNDCP SN-UNITDATA.ind), which will forward it to GGSN (GTP): */
+ rc = sndcp_sn_unitdata_ind(sne, msg, npdu_len, expnd);
+ret_free:
/* we must free the memory we allocated above; ownership is not transferred
* downwards in the call above */
msgb_free(msg);
- if (any_pcomp_or_dcomp_active(sgsn))
- talloc_free(expnd);
+ /* Note: We do not have to free expnd explicitly, because it is created
+ * within the talloc context of msg, which we just freed. */
return rc;
}
@@ -505,7 +542,7 @@ int sndcp_sm_activate_ind(struct gprs_llc_lle *lle, uint8_t nsapi)
}
/* Entry point for the SNSM-DEACTIVATE.indication */
-int sndcp_sm_deactivate_ind(struct gprs_llc_lle *lle, uint8_t nsapi)
+int sndcp_sm_deactivate_ind(const struct gprs_llc_lle *lle, uint8_t nsapi)
{
struct gprs_sndcp_entity *sne;
@@ -527,6 +564,20 @@ int sndcp_sm_deactivate_ind(struct gprs_llc_lle *lle, uint8_t nsapi)
return 0;
}
+/* Clean up all gprs_sndcp_entities related to llme (OS#4824) */
+void gprs_sndcp_sm_deactivate_ind_by_llme(const struct gprs_llc_llme *llme)
+{
+ struct gprs_sndcp_entity *sne, *sne2;
+
+ llist_for_each_entry_safe(sne, sne2, &gprs_sndcp_entities, list) {
+ if (sne->lle->llme == llme) {
+ LOGP(DSNDCP, LOGL_INFO, "SNSM-DEACTIVATE.ind for SNDCP attached to llme=%p\n", llme);
+ /* Free and remove from list */
+ sndcp_sm_deactivate_ind(sne->lle, sne->nsapi);
+ }
+ }
+}
+
/* Fragmenter state */
struct sndcp_frag_state {
uint8_t frag_nr;
@@ -634,7 +685,7 @@ static int sndcp_send_ud_frag(struct sndcp_frag_state *fs,
}
/* Request transmission of a SN-PDU over specified LLC Entity + SAPI */
-int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi,
+int sndcp_sn_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi,
void *mmcontext)
{
struct gprs_sndcp_entity *sne;
@@ -692,13 +743,14 @@ int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi
sne = gprs_sndcp_entity_by_lle(lle, nsapi);
if (!sne) {
- LOGP(DSNDCP, LOGL_ERROR, "Cannot find SNDCP Entity\n");
+ LOGP(DSNDCP, LOGL_ERROR, "Cannot find SNDCP Entity (lle=%p, TLLI=%08x, SAPI=%u, NSAPI=%u)\n",
+ lle, lle->llme->tlli, lle->sapi, nsapi);
msgb_free(msg);
return -EIO;
}
/* Check if we need to fragment this N-PDU into multiple SN-PDUs */
- if (msg->len > lle->params.n201_u -
+ if (msg->len > lle->params.n201_u -
(sizeof(*sch) + sizeof(*suh) + sizeof(*scomph))) {
/* initialize the fragmenter state */
fs.msg = msg;
@@ -743,7 +795,7 @@ int sndcp_unitdata_req(struct msgb *msg, struct gprs_llc_lle *lle, uint8_t nsapi
}
/* Section 5.1.2.17 LL-UNITDATA.ind */
-int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
+int sndcp_ll_unitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
uint8_t *hdr, uint16_t len)
{
struct gprs_sndcp_entity *sne;
@@ -791,7 +843,7 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
lle, lle->llme->tlli, lle->sapi, sch->nsapi);
return -EIO;
}
- gprs_gb_recv_pdu(mmctx);
+ gprs_gb_recv_pdu(mmctx, msg);
if (scomph) {
sne->defrag.pcomp = scomph->pcomp;
@@ -813,63 +865,40 @@ int sndcp_llunitdata_ind(struct msgb *msg, struct gprs_llc_lle *lle,
LOGP(DSNDCP, LOGL_ERROR, "Short SNDCP N-PDU: %d\n", npdu_len);
return -EIO;
}
- /* actually send the N-PDU to the SGSN core code, which then
- * hands it off to the correct GTP tunnel + GGSN via gtp_data_req() */
+ /* actually send the N-PDU to the SGSN core code (SNDCP SN-UNITDATA.ind) */
/* Decompress packet */
-#if DEBUG_IP_PACKETS == 1
- DEBUGP(DSNDCP, " \n");
- DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
- DEBUGP(DSNDCP, "===================================================\n");
-#endif
if (any_pcomp_or_dcomp_active(sgsn)) {
-
- expnd = talloc_zero_size(msg, npdu_len * MAX_DATADECOMPR_FAC +
- MAX_HDRDECOMPR_INCR);
- memcpy(expnd, npdu, npdu_len);
-
- /* Apply data decompression */
- rc = gprs_sndcp_dcomp_expand(expnd, npdu_len, sne->defrag.dcomp,
- sne->defrag.data);
- if (rc < 0) {
- LOGP(DSNDCP, LOGL_ERROR,
- "Data decompression failed!\n");
- talloc_free(expnd);
- return -EIO;
+ expnd = decompress_segment(sne, msg, npdu, npdu_len, (unsigned int *)&npdu_len);
+ if (!expnd) {
+ rc = -EIO;
+ goto ret_free;
}
-
- /* Apply header decompression */
- rc = gprs_sndcp_pcomp_expand(expnd, rc, sne->defrag.pcomp,
- sne->defrag.proto);
- if (rc < 0) {
- LOGP(DSNDCP, LOGL_ERROR,
- "TCP/IP Header decompression failed!\n");
- talloc_free(expnd);
- return -EIO;
- }
-
- /* Modify npu length, expnd is handed directly handed
- * over to gsn_rx_sndcp_ud_ind(), see below */
- npdu_len = rc;
- } else
+ } else {
expnd = npdu;
-#if DEBUG_IP_PACKETS == 1
- debug_ip_packet(expnd, npdu_len, 1, "sndcp_llunitdata_ind()");
- DEBUGP(DSNDCP, "===================================================\n");
- DEBUGP(DSNDCP, ":::::::::::::::::::::::::::::::::::::::::::::::::::\n");
- DEBUGP(DSNDCP, " \n");
-#endif
+ }
/* Hand off packet to gtp */
- rc = sgsn_rx_sndcp_ud_ind(&sne->ra_id, lle->llme->tlli,
- sne->nsapi, msg, npdu_len, expnd);
+ rc = sndcp_sn_unitdata_ind(sne, msg, npdu_len, expnd);
+ret_free:
if (any_pcomp_or_dcomp_active(sgsn))
talloc_free(expnd);
return rc;
}
+/* 5.1.1.4 SN-UNITDATA.indication
+ * Called by SNDCP when it has received/re-assembled a N-PDU
+ */
+int sndcp_sn_unitdata_ind(struct gprs_sndcp_entity *sne,
+ struct msgb *msg, uint32_t npdu_len, uint8_t *npdu)
+{
+ /* Hand it off N-PDU to the correct GTP tunnel + GGSN: */
+ return sgsn_gtp_data_req(&sne->ra_id, sne->lle->llme->tlli,
+ sne->nsapi, msg, npdu_len, npdu);
+}
+
#if 0
/* Section 5.1.2.1 LL-RESET.ind */
static int sndcp_ll_reset_ind(struct gprs_sndcp_entity *se)
@@ -1025,7 +1054,7 @@ int sndcp_sn_xid_req(struct gprs_llc_lle *lle, uint8_t nsapi)
/* Handle header compression entites */
static int handle_pcomp_entities(struct gprs_sndcp_comp_field *comp_field,
- struct gprs_llc_lle *lle)
+ const struct gprs_llc_lle *lle)
{
/* Note: This functions also transforms the comp_field into its
* echo form (strips comp values, resets propose bit etc...)
@@ -1075,7 +1104,7 @@ static int handle_pcomp_entities(struct gprs_sndcp_comp_field *comp_field,
/* Hanle data compression entites */
static int handle_dcomp_entities(struct gprs_sndcp_comp_field *comp_field,
- struct gprs_llc_lle *lle)
+ const struct gprs_llc_lle *lle)
{
/* See note in handle_pcomp_entities() */
@@ -1117,7 +1146,7 @@ static int handle_dcomp_entities(struct gprs_sndcp_comp_field *comp_field,
* (See also: TS 144 065, Section 6.8 XID parameter negotiation) */
int sndcp_sn_xid_ind(struct gprs_llc_xid_field *xid_field_indication,
struct gprs_llc_xid_field *xid_field_response,
- struct gprs_llc_lle *lle)
+ const struct gprs_llc_lle *lle)
{
/* Note: This function computes the SNDCP-XID response that is sent
* back to the ms when a ms originated XID is received. The
diff --git a/src/sgsn/gprs_subscriber.c b/src/sgsn/gprs_subscriber.c
index c23b332f3..a52abe8f1 100644
--- a/src/sgsn/gprs_subscriber.c
+++ b/src/sgsn/gprs_subscriber.c
@@ -30,7 +30,7 @@
#include <osmocom/gsupclient/gsup_client.h>
#include <osmocom/sgsn/sgsn.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_utils.h>
@@ -48,8 +48,6 @@
(gsup)->imsi, \
## args)
-extern void *tall_sgsn_ctx;
-
LLIST_HEAD(_gprs_subscribers);
struct llist_head * const gprs_subscribers = &_gprs_subscribers;
@@ -378,7 +376,8 @@ static void gprs_subscr_gsup_insert_data(struct gprs_subscr *subscr,
}
OSMO_ASSERT(pdp_data != NULL);
- pdp_data->pdp_type = pdp_info->pdp_type;
+ pdp_data->pdp_type_org = pdp_info->pdp_type_org;
+ pdp_data->pdp_type_nr = pdp_info->pdp_type_nr;
osmo_apn_to_str(pdp_data->apn_str,
pdp_info->apn_enc, pdp_info->apn_enc_len);
@@ -870,6 +869,8 @@ struct gprs_subscr *gprs_subscr_get_or_create_by_mmctx(struct sgsn_mm_ctx *mmctx
if (!subscr) {
subscr = gprs_subscr_get_or_create(mmctx->imsi);
+ if (!subscr)
+ return NULL;
subscr->flags |= GPRS_SUBSCRIBER_FIRST_CONTACT;
subscr->flags &= ~GPRS_SUBSCRIBER_ENABLE_PURGE;
}
@@ -893,6 +894,8 @@ int gprs_subscr_request_update_location(struct sgsn_mm_ctx *mmctx)
LOGMMCTXP(LOGL_DEBUG, mmctx, "Requesting subscriber data update\n");
subscr = gprs_subscr_get_or_create_by_mmctx(mmctx);
+ if (!subscr)
+ return -ENOMEM;
subscr->flags |= GPRS_SUBSCRIBER_UPDATE_LOCATION_PENDING;
@@ -918,6 +921,8 @@ int gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx,
LOGMMCTXP(LOGL_DEBUG, mmctx, "Requesting subscriber authentication info\n");
subscr = gprs_subscr_get_or_create_by_mmctx(mmctx);
+ if (!subscr)
+ return -ENOMEM;
subscr->flags |= GPRS_SUBSCRIBER_UPDATE_AUTH_INFO_PENDING;
diff --git a/src/sgsn/gtp_ggsn.c b/src/sgsn/gtp_ggsn.c
new file mode 100644
index 000000000..14cdfea00
--- /dev/null
+++ b/src/sgsn/gtp_ggsn.c
@@ -0,0 +1,178 @@
+/* GGSN context (peer) */
+
+/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2023 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/stats.h>
+
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/sgsn.h>
+#include <osmocom/sgsn/debug.h>
+#include <osmocom/sgsn/gprs_gmm_fsm.h>
+#include <osmocom/sgsn/gprs_sm.h>
+#include <osmocom/sgsn/pdpctx.h>
+
+void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc)
+{
+ bool pending = osmo_timer_pending(&ggc->echo_timer);
+
+ /* Only enable if allowed by policy and at least 1 pdp ctx exists against ggsn */
+ if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval) {
+ if (!pending)
+ osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0);
+ } else {
+ if (pending)
+ osmo_timer_del(&ggc->echo_timer);
+ }
+}
+
+/* GGSN contexts */
+static void echo_timer_cb(void *data)
+{
+ struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data;
+ sgsn_ggsn_echo_req(ggc);
+ osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0);
+}
+
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(struct sgsn_instance *sgsn, uint32_t id)
+{
+ struct sgsn_ggsn_ctx *ggc;
+
+ ggc = talloc_zero(sgsn, struct sgsn_ggsn_ctx);
+ if (!ggc)
+ return NULL;
+
+ ggc->id = id;
+ ggc->gtp_version = 1;
+ ggc->remote_restart_ctr = -1;
+ /* if we are called from config file parse, this gsn doesn't exist yet */
+ ggc->gsn = sgsn->gsn;
+ INIT_LLIST_HEAD(&ggc->pdp_list);
+ osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc);
+ llist_add(&ggc->list, &sgsn->ggsn_list);
+
+ return ggc;
+}
+
+void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc)
+{
+ OSMO_ASSERT(llist_empty(&ggc->pdp_list));
+ llist_del(&ggc->list);
+ talloc_free(ggc);
+}
+
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(struct sgsn_instance *sgsn, uint32_t id)
+{
+ struct sgsn_ggsn_ctx *ggc;
+
+ llist_for_each_entry(ggc, &sgsn->ggsn_list, list) {
+ if (id == ggc->id)
+ return ggc;
+ }
+ return NULL;
+}
+
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct sgsn_instance *sgsn, struct in_addr *addr)
+{
+ struct sgsn_ggsn_ctx *ggc;
+
+ llist_for_each_entry(ggc, &sgsn->ggsn_list, list) {
+ if (!memcmp(addr, &ggc->remote_addr, sizeof(*addr)))
+ return ggc;
+ }
+ return NULL;
+}
+
+
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(struct sgsn_instance *sgsn, uint32_t id)
+{
+ struct sgsn_ggsn_ctx *ggc;
+
+ ggc = sgsn_ggsn_ctx_by_id(sgsn, id);
+ if (!ggc)
+ ggc = sgsn_ggsn_ctx_alloc(sgsn, id);
+ return ggc;
+}
+
+void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)
+{
+ /* the MM context can be deleted while the GGSN is not reachable or
+ * if has been crashed. */
+ if (pctx->mm && pctx->mm->gmm_fsm->state == ST_GMM_REGISTERED_NORMAL) {
+ gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);
+ sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);
+ } else {
+ /* FIXME: GPRS paging in case MS is SUSPENDED */
+ LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN "
+ "recovery\n");
+ /* FIXME: how to tell this to libgtp? */
+ sgsn_pdp_ctx_free(pctx);
+ }
+}
+
+/* High-level function to be called in case a GGSN has disappeared or
+ * otherwise lost state (recovery procedure). It will detach all related pdp ctx
+ * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can
+ * be kept alive to allow handling later message which contained the Recovery IE. */
+int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except)
+{
+ int num = 0;
+
+ struct sgsn_pdp_ctx *pdp, *pdp2;
+ llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) {
+ if (pdp == except)
+ continue;
+ sgsn_ggsn_ctx_drop_pdp(pdp);
+ num++;
+ }
+
+ return num;
+}
+
+int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn)
+{
+ return sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, NULL);
+}
+
+void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp)
+{
+ llist_add(&pdp->ggsn_list, &ggc->pdp_list);
+ sgsn_ggsn_ctx_check_echo_timer(ggc);
+}
+
+void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp)
+{
+ llist_del(&pdp->ggsn_list);
+ sgsn_ggsn_ctx_check_echo_timer(ggc);
+ if (pdp->destroy_ggsn)
+ sgsn_ggsn_ctx_free(pdp->ggsn);
+ pdp->ggsn = NULL;
+ /* Drop references to libgtp since the conn is down */
+ if (pdp->lib)
+ pdp_freepdp(pdp->lib);
+ pdp->lib = NULL;
+}
diff --git a/src/sgsn/gtp_mme.c b/src/sgsn/gtp_mme.c
new file mode 100644
index 000000000..3d7ec76b6
--- /dev/null
+++ b/src/sgsn/gtp_mme.c
@@ -0,0 +1,143 @@
+/* TS 29.060 § 7.5.14 RAN Information Management Messages */
+/*
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: AGPL-3.0+
+ *
+ * Author: Pau Espin Pedrol <pespin@sysmocom.de>
+ *
+ * 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.
+ *
+ * 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 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/>.
+ */
+
+#include <talloc.h>
+
+#include <osmocom/sgsn/gtp_mme.h>
+#include <osmocom/sgsn/sgsn.h>
+
+static bool _eutran_tai_equal(const struct osmo_eutran_tai *t1, const struct osmo_eutran_tai *t2)
+{
+ return t1->mcc == t2->mcc &&
+ t1->mnc == t2->mnc &&
+ t1->mnc_3_digits == t2->mnc_3_digits &&
+ t1->tac == t2->tac;
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_alloc(struct sgsn_instance *sgsn, const char *name)
+{
+ struct sgsn_mme_ctx *mme;
+ mme = talloc_zero(sgsn, struct sgsn_mme_ctx);
+ if (!mme)
+ return NULL;
+
+ /* if we are called from config file parse, this gsn doesn't exist yet */
+ mme->sgsn = sgsn;
+
+ mme->name = talloc_strdup(mme, name);
+
+ INIT_LLIST_HEAD(&mme->routes);
+ llist_add_tail(&mme->list, &sgsn->mme_list);
+
+ return mme;
+}
+
+void sgsn_mme_ctx_free(struct sgsn_mme_ctx *mme)
+{
+ struct mme_rim_route *rt, *rt2;
+ llist_del(&mme->list);
+
+ llist_for_each_entry_safe(rt, rt2, &mme->routes, list) {
+ llist_del(&rt->list);
+ talloc_free(rt);
+ }
+
+ talloc_free(mme);
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_find_alloc(struct sgsn_instance *sgsn, const char *name)
+{
+ struct sgsn_mme_ctx *mme;
+
+ mme = sgsn_mme_ctx_by_name(sgsn, name);
+ if (!mme)
+ mme = sgsn_mme_ctx_alloc(sgsn, name);
+ return mme;
+}
+
+void sgsn_mme_ctx_route_add(struct sgsn_mme_ctx *mme, const struct osmo_eutran_tai *tai)
+{
+ struct mme_rim_route *rt = talloc_zero(mme, struct mme_rim_route);
+ rt->tai = *tai;
+ llist_add_tail(&rt->list, &mme->routes);
+}
+
+void sgsn_mme_ctx_route_del(struct sgsn_mme_ctx *mme, const struct osmo_eutran_tai *tai)
+{
+ struct mme_rim_route *rt;
+
+ llist_for_each_entry(rt, &mme->routes, list) {
+ if (_eutran_tai_equal(tai, &rt->tai)) {
+ llist_del(&rt->list);
+ talloc_free(rt);
+ return;
+ }
+ }
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_name(const struct sgsn_instance *sgsn, const char *name)
+{
+ struct sgsn_mme_ctx *mme;
+
+ llist_for_each_entry(mme, &sgsn->mme_list, list) {
+ if (!strcmp(name, mme->name))
+ return mme;
+ }
+ return NULL;
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_addr(const struct sgsn_instance *sgsn, const struct in_addr *addr)
+{
+ struct sgsn_mme_ctx *mme;
+
+ llist_for_each_entry(mme, &sgsn->mme_list, list) {
+ if (!memcmp(addr, &mme->remote_addr, sizeof(*addr)))
+ return mme;
+ }
+ return NULL;
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_route(const struct sgsn_instance *sgsn, const struct osmo_eutran_tai *tai)
+{
+ struct sgsn_mme_ctx *mme;
+ llist_for_each_entry(mme, &sgsn->mme_list, list) {
+ struct mme_rim_route *rt;
+ llist_for_each_entry(rt, &mme->routes, list) {
+ if (_eutran_tai_equal(tai, &rt->tai)) {
+ return mme;
+ }
+ }
+ }
+ return NULL;
+}
+
+struct sgsn_mme_ctx *sgsn_mme_ctx_by_default_route(const struct sgsn_instance *sgsn)
+{
+ struct sgsn_mme_ctx *mme;
+
+ llist_for_each_entry(mme, &sgsn->mme_list, list) {
+ if (mme->default_route)
+ return mme;
+ }
+ return NULL;
+}
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/mmctx.c
index cb2c0fc25..0e9309284 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/mmctx.c
@@ -1,4 +1,4 @@
-/* GPRS SGSN functionality */
+/* Mobility Management context */
/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
*
@@ -27,7 +27,9 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/stats.h>
#include <osmocom/core/backtrace.h>
-#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
+#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gsm/apn.h>
@@ -36,7 +38,7 @@
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_sm.h>
@@ -47,22 +49,16 @@
#include <osmocom/sgsn/gprs_mm_state_iu_fsm.h>
#include <osmocom/sgsn/gprs_gmm_fsm.h>
#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_sndcp.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
#include <pdp.h>
#include <time.h>
-#include "../../bscconfig.h"
-
-#define GPRS_LLME_CHECK_TICK 30
-
-extern struct sgsn_instance *sgsn;
-extern void *tall_sgsn_ctx;
-
-LLIST_HEAD(sgsn_mm_ctxts);
-LLIST_HEAD(sgsn_ggsn_ctxts);
-LLIST_HEAD(sgsn_apn_ctxts);
-LLIST_HEAD(sgsn_pdp_ctxts);
+#include "../../config.h"
const struct value_string sgsn_ran_type_names[] = {
{ MM_CTX_T_GERAN_Gb, "GPRS/EDGE via Gb" },
@@ -95,66 +91,12 @@ static const struct rate_ctr_group_desc mmctx_ctrg_desc = {
.class_id = OSMO_STATS_CLASS_SUBSCRIBER,
};
-static const struct rate_ctr_desc pdpctx_ctr_description[] = {
- { "udata:packets:in", "User Data Messages ( In)" },
- { "udata:packets:out", "User Data Messages (Out)" },
- { "udata:bytes:in", "User Data Bytes ( In)" },
- { "udata:bytes:out", "User Data Bytes (Out)" },
-};
-
-static const struct rate_ctr_group_desc pdpctx_ctrg_desc = {
- .group_name_prefix = "sgsn:pdpctx",
- .group_description = "SGSN PDP Context Statistics",
- .num_ctr = ARRAY_SIZE(pdpctx_ctr_description),
- .ctr_desc = pdpctx_ctr_description,
- .class_id = OSMO_STATS_CLASS_SUBSCRIBER,
-};
-
-static const struct rate_ctr_desc sgsn_ctr_description[] = {
- { "llc:dl_bytes", "Count sent LLC bytes before giving it to the bssgp layer" },
- { "llc:ul_bytes", "Count successful received LLC bytes (encrypt & fcs correct)" },
- { "llc:dl_packets", "Count successful sent LLC packets before giving it to the bssgp layer" },
- { "llc:ul_packets", "Count successful received LLC packets (encrypt & fcs correct)" },
- { "gprs:attach_requested", "Received attach requests" },
- { "gprs:attach_accepted", "Sent attach accepts" },
- { "gprs:attach_rejected", "Sent attach rejects" },
- { "gprs:detach_requested", "Received detach requests" },
- { "gprs:detach_acked", "Sent detach acks" },
- { "gprs:routing_area_requested", "Received routing area requests" },
- { "gprs:routing_area_requested", "Sent routing area acks" },
- { "gprs:routing_area_requested", "Sent routing area rejects" },
- { "pdp:activate_requested", "Received activate requests" },
- { "pdp:activate_rejected", "Sent activate rejects" },
- { "pdp:activate_accepted", "Sent activate accepts" },
- { "pdp:request_activated", "unused" },
- { "pdp:request_activate_rejected", "unused" },
- { "pdp:modify_requested", "unused" },
- { "pdp:modify_accepted", "unused" },
- { "pdp:dl_deactivate_requested", "Sent deactivate requests" },
- { "pdp:dl_deactivate_accepted", "Sent deactivate accepted" },
- { "pdp:ul_deactivate_requested", "Received deactivate requests" },
- { "pdp:ul_deactivate_accepted", "Received deactivate accepts" },
-};
-
-static const struct rate_ctr_group_desc sgsn_ctrg_desc = {
- "sgsn",
- "SGSN Overall Statistics",
- OSMO_STATS_CLASS_GLOBAL,
- ARRAY_SIZE(sgsn_ctr_description),
- sgsn_ctr_description,
-};
-
-void sgsn_rate_ctr_init() {
- sgsn->rate_ctrs = rate_ctr_group_alloc(tall_sgsn_ctx, &sgsn_ctrg_desc, 0);
- OSMO_ASSERT(sgsn->rate_ctrs);
-}
-
/* look-up an SGSN MM context based on Iu UE context (struct ue_conn_ctx)*/
struct sgsn_mm_ctx *sgsn_mm_ctx_by_ue_ctx(const void *uectx)
{
struct sgsn_mm_ctx *ctx;
- llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (ctx->ran_type == MM_CTX_T_UTRAN_Iu
&& uectx == ctx->iu.ue_ctx)
return ctx;
@@ -169,7 +111,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli,
{
struct sgsn_mm_ctx *ctx;
- llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if ((tlli == ctx->gb.tlli || tlli == ctx->gb.tlli_new) &&
gprs_ra_id_equals(raid, &ctx->ra))
return ctx;
@@ -193,7 +135,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli,
if (tlli_type != TLLI_FOREIGN && tlli_type != TLLI_LOCAL)
return NULL;
- llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if ((gprs_tmsi2tlli(ctx->p_tmsi, tlli_type) == tlli ||
gprs_tmsi2tlli(ctx->p_tmsi_old, tlli_type) == tlli) &&
gprs_ra_id_equals(raid, &ctx->ra))
@@ -207,7 +149,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t p_tmsi)
{
struct sgsn_mm_ctx *ctx;
- llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (p_tmsi == ctx->p_tmsi ||
(ctx->p_tmsi_old && ctx->p_tmsi_old == p_tmsi))
return ctx;
@@ -219,7 +161,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_imsi(const char *imsi)
{
struct sgsn_mm_ctx *ctx;
- llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (!strcmp(imsi, ctx->imsi))
return ctx;
}
@@ -261,7 +203,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc(uint32_t rate_ctr_id)
INIT_LLIST_HEAD(&ctx->pdp_list);
- llist_add(&ctx->list, &sgsn_mm_ctxts);
+ llist_add(&ctx->list, &sgsn->mm_list);
return ctx;
@@ -293,11 +235,8 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli,
memcpy(&ctx->ra, raid, sizeof(ctx->ra));
ctx->ran_type = MM_CTX_T_GERAN_Gb;
ctx->gb.tlli = tlli;
- ctx->ciph_algo = sgsn->cfg.cipher;
osmo_fsm_inst_update_id_f(ctx->gb.mm_state_fsm, "%" PRIu32, tlli);
- LOGMMCTXP(LOGL_DEBUG, ctx, "Allocated with %s cipher.\n",
- get_value_string(gprs_cipher_names, ctx->ciph_algo));
return ctx;
}
@@ -435,283 +374,6 @@ struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm,
return NULL;
}
-/* you don't want to use this directly, call sgsn_create_pdp_ctx() */
-struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
- struct sgsn_ggsn_ctx *ggsn,
- uint8_t nsapi)
-{
- struct sgsn_pdp_ctx *pdp;
-
- pdp = sgsn_pdp_ctx_by_nsapi(mm, nsapi);
- if (pdp)
- return NULL;
-
- pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx);
- if (!pdp)
- return NULL;
-
- pdp->mm = mm;
- pdp->ggsn = ggsn;
- pdp->nsapi = nsapi;
- pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi);
- if (!pdp->ctrg) {
- LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n");
- talloc_free(pdp);
- return NULL;
- }
- llist_add(&pdp->list, &mm->pdp_list);
- sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp);
- llist_add(&pdp->g_list, &sgsn_pdp_ctxts);
-
- return pdp;
-}
-
-/*
- * This function will not trigger any GSM DEACT PDP ACK messages, so you
- * probably want to call sgsn_delete_pdp_ctx() instead if the connection
- * isn't detached already.
- */
-void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp)
-{
- struct sgsn_signal_data sig_data;
-
- OSMO_ASSERT(pdp->mm != NULL);
-
- /* There might still be pending callbacks in libgtp. So the parts of
- * this object relevant to GTP need to remain intact in this case. */
-
- LOGPDPCTXP(LOGL_INFO, pdp, "Forcing release of PDP context\n");
-
- if (pdp->mm->ran_type == MM_CTX_T_GERAN_Gb) {
- /* Force the deactivation of the SNDCP layer */
- if (pdp->mm->gb.llme)
- sndcp_sm_deactivate_ind(&pdp->mm->gb.llme->lle[pdp->sapi], pdp->nsapi);
- }
-
- memset(&sig_data, 0, sizeof(sig_data));
- sig_data.pdp = pdp;
- osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data);
-
- /* Detach from MM context */
- pdp_ctx_detach_mm_ctx(pdp);
- if (pdp->ggsn)
- sgsn_delete_pdp_ctx(pdp);
-}
-
-/*
- * Don't call this function directly unless you know what you are doing.
- * In normal conditions use sgsn_delete_pdp_ctx and in unspecified or
- * implementation dependent abnormal ones sgsn_pdp_ctx_terminate.
- */
-void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp)
-{
- struct sgsn_signal_data sig_data;
-
- memset(&sig_data, 0, sizeof(sig_data));
- sig_data.pdp = pdp;
- osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_FREE, &sig_data);
-
- rate_ctr_group_free(pdp->ctrg);
- if (pdp->mm)
- llist_del(&pdp->list);
- if (pdp->ggsn)
- sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp);
- llist_del(&pdp->g_list);
-
- /* _if_ we still have a library handle, at least set it to NULL
- * to avoid any dereferences of the now-deleted PDP context from
- * sgsn_libgtp:cb_data_ind() */
- if (pdp->lib) {
- struct pdp_t *lib = pdp->lib;
- LOGPDPCTXP(LOGL_NOTICE, pdp, "freeing PDP context that still "
- "has a libgtp handle attached to it, this shouldn't "
- "happen!\n");
- osmo_generate_backtrace();
- lib->priv = NULL;
- }
-
- talloc_free(pdp);
-}
-
-void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc)
-{
- bool pending = osmo_timer_pending(&ggc->echo_timer);
-
- /* Only enable if allowed by policy and at least 1 pdp ctx exists against ggsn */
- if (!llist_empty(&ggc->pdp_list) && ggc->echo_interval) {
- if (!pending)
- osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0);
- } else {
- if (pending)
- osmo_timer_del(&ggc->echo_timer);
- }
-}
-
-/* GGSN contexts */
-static void echo_timer_cb(void *data)
-{
- struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data;
- sgsn_ggsn_echo_req(ggc);
- osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0);
-}
-
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id)
-{
- struct sgsn_ggsn_ctx *ggc;
-
- ggc = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_ctx);
- if (!ggc)
- return NULL;
-
- ggc->id = id;
- ggc->gtp_version = 1;
- ggc->remote_restart_ctr = -1;
- /* if we are called from config file parse, this gsn doesn't exist yet */
- ggc->gsn = sgsn->gsn;
- INIT_LLIST_HEAD(&ggc->pdp_list);
- osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc);
- llist_add(&ggc->list, &sgsn_ggsn_ctxts);
-
- return ggc;
-}
-
-void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc)
-{
- OSMO_ASSERT(llist_empty(&ggc->pdp_list));
- llist_del(&ggc->list);
- talloc_free(ggc);
-}
-
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id)
-{
- struct sgsn_ggsn_ctx *ggc;
-
- llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) {
- if (id == ggc->id)
- return ggc;
- }
- return NULL;
-}
-
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr)
-{
- struct sgsn_ggsn_ctx *ggc;
-
- llist_for_each_entry(ggc, &sgsn_ggsn_ctxts, list) {
- if (!memcmp(addr, &ggc->remote_addr, sizeof(*addr)))
- return ggc;
- }
- return NULL;
-}
-
-
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id)
-{
- struct sgsn_ggsn_ctx *ggc;
-
- ggc = sgsn_ggsn_ctx_by_id(id);
- if (!ggc)
- ggc = sgsn_ggsn_ctx_alloc(id);
- return ggc;
-}
-
-/* APN contexts */
-
-static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char *imsi_prefix)
-{
- struct apn_ctx *actx;
-
- actx = talloc_zero(tall_sgsn_ctx, struct apn_ctx);
- if (!actx)
- return NULL;
- actx->name = talloc_strdup(actx, ap_name);
- actx->imsi_prefix = talloc_strdup(actx, imsi_prefix);
-
- llist_add_tail(&actx->list, &sgsn_apn_ctxts);
-
- return actx;
-}
-
-void sgsn_apn_ctx_free(struct apn_ctx *actx)
-{
- llist_del(&actx->list);
- talloc_free(actx);
-}
-
-struct apn_ctx *sgsn_apn_ctx_match(const char *name, const char *imsi)
-{
- struct apn_ctx *actx;
- struct apn_ctx *found_actx = NULL;
- size_t imsi_prio = 0;
- size_t name_prio = 0;
- size_t name_req_len = strlen(name);
-
- llist_for_each_entry(actx, &sgsn_apn_ctxts, list) {
- size_t name_ref_len, imsi_ref_len;
- const char *name_ref_start, *name_match_start;
-
- imsi_ref_len = strlen(actx->imsi_prefix);
- if (strncmp(actx->imsi_prefix, imsi, imsi_ref_len) != 0)
- continue;
-
- if (imsi_ref_len < imsi_prio)
- continue;
-
- /* IMSI matches */
-
- name_ref_start = &actx->name[0];
- if (name_ref_start[0] == '*') {
- /* Suffix match */
- name_ref_start += 1;
- name_ref_len = strlen(name_ref_start);
- if (name_ref_len > name_req_len)
- continue;
- } else {
- name_ref_len = strlen(name_ref_start);
- if (name_ref_len != name_req_len)
- continue;
- }
-
- name_match_start = name + (name_req_len - name_ref_len);
- if (strcasecmp(name_match_start, name_ref_start) != 0)
- continue;
-
- /* IMSI and name match */
-
- if (imsi_ref_len == imsi_prio && name_ref_len < name_prio)
- /* Lower priority, skip */
- continue;
-
- imsi_prio = imsi_ref_len;
- name_prio = name_ref_len;
- found_actx = actx;
- }
- return found_actx;
-}
-
-struct apn_ctx *sgsn_apn_ctx_by_name(const char *name, const char *imsi_prefix)
-{
- struct apn_ctx *actx;
-
- llist_for_each_entry(actx, &sgsn_apn_ctxts, list) {
- if (strcasecmp(name, actx->name) == 0 &&
- strcasecmp(imsi_prefix, actx->imsi_prefix) == 0)
- return actx;
- }
- return NULL;
-}
-
-struct apn_ctx *sgsn_apn_ctx_find_alloc(const char *name, const char *imsi_prefix)
-{
- struct apn_ctx *actx;
-
- actx = sgsn_apn_ctx_by_name(name, imsi_prefix);
- if (!actx)
- actx = sgsn_apn_ctx_alloc(name, imsi_prefix);
-
- return actx;
-}
-
uint32_t sgsn_alloc_ptmsi(void)
{
struct sgsn_mm_ctx *mm;
@@ -747,7 +409,7 @@ restart:
goto restart;
}
- llist_for_each_entry(mm, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(mm, &sgsn->mm_list, list) {
if (mm->p_tmsi == ptmsi) {
if (!max_retries--)
goto failed;
@@ -762,64 +424,6 @@ failed:
return GSM_RESERVED_TMSI;
}
-void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx)
-{
- /* the MM context can be deleted while the GGSN is not reachable or
- * if has been crashed. */
- if (pctx->mm && pctx->mm->gmm_fsm->state == ST_GMM_REGISTERED_NORMAL) {
- gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true);
- sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx);
- } else {
- /* FIXME: GPRS paging in case MS is SUSPENDED */
- LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN "
- "recovery\n");
- /* FIXME: how to tell this to libgtp? */
- sgsn_pdp_ctx_free(pctx);
- }
-}
-
-/* High-level function to be called in case a GGSN has disappeared or
- * otherwise lost state (recovery procedure). It will detach all related pdp ctx
- * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can
- * be kept alive to allow handling later message which contained the Recovery IE. */
-int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except)
-{
- int num = 0;
-
- struct sgsn_pdp_ctx *pdp, *pdp2;
- llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) {
- if (pdp == except)
- continue;
- sgsn_ggsn_ctx_drop_pdp(pdp);
- num++;
- }
-
- return num;
-}
-
-int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn)
-{
- return sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, NULL);
-}
-
-void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp)
-{
- llist_add(&pdp->ggsn_list, &ggc->pdp_list);
- sgsn_ggsn_ctx_check_echo_timer(ggc);
-}
-void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp)
-{
- llist_del(&pdp->ggsn_list);
- sgsn_ggsn_ctx_check_echo_timer(ggc);
- if (pdp->destroy_ggsn)
- sgsn_ggsn_ctx_free(pdp->ggsn);
- pdp->ggsn = NULL;
- /* Drop references to libgtp since the conn is down */
- if (pdp->lib)
- pdp_freepdp(pdp->lib);
- pdp->lib = NULL;
-}
-
void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx)
{
OSMO_ASSERT(mmctx != NULL);
@@ -894,7 +498,7 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
insert_extra(tp, mmctx->subscr->sgsn_data, pdp);
continue;
}
- if (!llist_empty(&sgsn_apn_ctxts)) {
+ if (!llist_empty(&sgsn->apn_list)) {
apn_ctx = sgsn_apn_ctx_match(req_apn_str, mmctx->imsi);
/* Not configured */
if (apn_ctx == NULL)
@@ -947,13 +551,13 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
if (apn_ctx != NULL) {
ggsn = apn_ctx->ggsn;
- } else if (llist_empty(&sgsn_apn_ctxts)) {
+ } else if (llist_empty(&sgsn->apn_list)) {
/* No configuration -> use GGSN 0 */
- ggsn = sgsn_ggsn_ctx_by_id(0);
+ ggsn = sgsn_ggsn_ctx_by_id(sgsn, 0);
} else if (allow_any_apn &&
(selected_apn_str == NULL || strlen(selected_apn_str) == 0)) {
/* No APN given and no default configuration -> Use GGSN 0 */
- ggsn = sgsn_ggsn_ctx_by_id(0);
+ ggsn = sgsn_ggsn_ctx_by_id(sgsn, 0);
} else {
/* No matching configuration found */
LOGMMCTXP(LOGL_NOTICE, mmctx,
@@ -978,70 +582,3 @@ struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
return ggsn;
}
-
-static void sgsn_llme_cleanup_free(struct gprs_llc_llme *llme)
-{
- struct sgsn_mm_ctx *mmctx = NULL;
-
- llist_for_each_entry(mmctx, &sgsn_mm_ctxts, list) {
- if (llme == mmctx->gb.llme) {
- gsm0408_gprs_access_cancelled(mmctx, SGSN_ERROR_CAUSE_NONE);
- return;
- }
- }
-
- /* No MM context found */
- LOGP(DGPRS, LOGL_INFO, "Deleting orphaned LLME, TLLI 0x%08x\n",
- llme->tlli);
- gprs_llgmm_unassign(llme);
-}
-
-static void sgsn_llme_check_cb(void *data_)
-{
- struct gprs_llc_llme *llme, *llme_tmp;
- struct timespec now_tp;
- time_t now, age;
- time_t max_age = gprs_max_time_to_idle();
-
- int rc;
-
- rc = osmo_clock_gettime(CLOCK_MONOTONIC, &now_tp);
- OSMO_ASSERT(rc >= 0);
- now = now_tp.tv_sec;
-
- LOGP(DGPRS, LOGL_DEBUG,
- "Checking for inactive LLMEs, time = %u\n", (unsigned)now);
-
- llist_for_each_entry_safe(llme, llme_tmp, &gprs_llc_llmes, list) {
- if (llme->age_timestamp == GPRS_LLME_RESET_AGE)
- llme->age_timestamp = now;
-
- age = now - llme->age_timestamp;
-
- if (age > max_age || age < 0) {
- LOGP(DGPRS, LOGL_INFO,
- "Inactivity timeout for TLLI 0x%08x, age %d\n",
- llme->tlli, (int)age);
- sgsn_llme_cleanup_free(llme);
- }
- }
-
- osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0);
-}
-
-struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
-{
- struct sgsn_instance *inst;
- inst = talloc_zero(talloc_ctx, struct sgsn_instance);
- inst->cfg.gtp_statedir = talloc_strdup(inst, "./");
- inst->cfg.auth_policy = SGSN_AUTH_POLICY_CLOSED;
- inst->cfg.require_authentication = true; /* only applies if auth_policy is REMOTE */
- inst->cfg.gsup_server_port = OSMO_GSUP_PORT;
- return inst;
-}
-
-void sgsn_inst_init(struct sgsn_instance *sgsn)
-{
- osmo_timer_setup(&sgsn->llme_timer, sgsn_llme_check_cb, NULL);
- osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0);
-}
diff --git a/src/sgsn/pdpctx.c b/src/sgsn/pdpctx.c
new file mode 100644
index 000000000..e77942040
--- /dev/null
+++ b/src/sgsn/pdpctx.c
@@ -0,0 +1,158 @@
+/* PDP context functionality */
+
+/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/stats.h>
+
+#include <osmocom/sgsn/pdpctx.h>
+#include <osmocom/sgsn/mmctx.h>
+#include <osmocom/sgsn/sgsn.h>
+#include <osmocom/sgsn/debug.h>
+#include <osmocom/sgsn/signal.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gprs_llc_xid.h>
+#include <osmocom/sgsn/gprs_sndcp.h>
+#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_sm.h>
+#include <osmocom/sgsn/gtp.h>
+
+static const struct rate_ctr_desc pdpctx_ctr_description[] = {
+ { "udata:packets:in", "User Data Messages ( In)" },
+ { "udata:packets:out", "User Data Messages (Out)" },
+ { "udata:bytes:in", "User Data Bytes ( In)" },
+ { "udata:bytes:out", "User Data Bytes (Out)" },
+};
+
+static const struct rate_ctr_group_desc pdpctx_ctrg_desc = {
+ .group_name_prefix = "sgsn:pdpctx",
+ .group_description = "SGSN PDP Context Statistics",
+ .num_ctr = ARRAY_SIZE(pdpctx_ctr_description),
+ .ctr_desc = pdpctx_ctr_description,
+ .class_id = OSMO_STATS_CLASS_SUBSCRIBER,
+};
+
+/* you don't want to use this directly, call sgsn_create_pdp_ctx() */
+struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
+ struct sgsn_ggsn_ctx *ggsn,
+ uint8_t nsapi)
+{
+ struct sgsn_pdp_ctx *pdp;
+
+ pdp = sgsn_pdp_ctx_by_nsapi(mm, nsapi);
+ if (pdp)
+ return NULL;
+
+ pdp = talloc_zero(sgsn, struct sgsn_pdp_ctx);
+ if (!pdp)
+ return NULL;
+
+ pdp->mm = mm;
+ pdp->ggsn = ggsn;
+ pdp->nsapi = nsapi;
+ pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi);
+ if (!pdp->ctrg) {
+ LOGPDPCTXP(LOGL_ERROR, pdp, "Error allocation counter group\n");
+ talloc_free(pdp);
+ return NULL;
+ }
+ llist_add(&pdp->list, &mm->pdp_list);
+ sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp);
+ llist_add(&pdp->g_list, &sgsn->pdp_list);
+
+ return pdp;
+}
+
+/*
+ * This function will not trigger any GSM DEACT PDP ACK messages, so you
+ * probably want to call sgsn_delete_pdp_ctx() instead if the connection
+ * isn't detached already.
+ */
+void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp)
+{
+ struct sgsn_signal_data sig_data;
+
+ OSMO_ASSERT(pdp->mm != NULL);
+
+ /* There might still be pending callbacks in libgtp. So the parts of
+ * this object relevant to GTP need to remain intact in this case. */
+
+ LOGPDPCTXP(LOGL_INFO, pdp, "Forcing release of PDP context\n");
+
+ if (pdp->mm->ran_type == MM_CTX_T_GERAN_Gb) {
+ /* Force the deactivation of the SNDCP layer */
+ if (pdp->mm->gb.llme)
+ sndcp_sm_deactivate_ind(&pdp->mm->gb.llme->lle[pdp->sapi], pdp->nsapi);
+ }
+
+ memset(&sig_data, 0, sizeof(sig_data));
+ sig_data.pdp = pdp;
+ osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data);
+
+ /* Detach from MM context */
+ pdp_ctx_detach_mm_ctx(pdp);
+ if (pdp->ggsn)
+ sgsn_delete_pdp_ctx(pdp);
+}
+
+/*
+ * Don't call this function directly unless you know what you are doing.
+ * In normal conditions use sgsn_delete_pdp_ctx and in unspecified or
+ * implementation dependent abnormal ones sgsn_pdp_ctx_terminate.
+ */
+void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp)
+{
+ struct sgsn_signal_data sig_data;
+
+ memset(&sig_data, 0, sizeof(sig_data));
+ sig_data.pdp = pdp;
+ osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_FREE, &sig_data);
+
+ if (osmo_timer_pending(&pdp->timer)) {
+ LOGPDPCTXP(LOGL_ERROR, pdp, "Freeing PDP ctx with timer %u pending\n", pdp->T);
+ osmo_timer_del(&pdp->timer);
+ }
+
+ rate_ctr_group_free(pdp->ctrg);
+ if (pdp->mm)
+ llist_del(&pdp->list);
+ if (pdp->ggsn)
+ sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp);
+ llist_del(&pdp->g_list);
+
+ /* _if_ we still have a library handle, at least set it to NULL
+ * to avoid any dereferences of the now-deleted PDP context from
+ * sgsn_libgtp:cb_data_ind() */
+ if (pdp->lib) {
+ struct pdp_t *lib = pdp->lib;
+ LOGPDPCTXP(LOGL_NOTICE, pdp, "freeing PDP context that still "
+ "has a libgtp handle attached to it, this shouldn't "
+ "happen!\n");
+ osmo_generate_backtrace();
+ lib->priv = NULL;
+ }
+
+ talloc_free(pdp);
+}
diff --git a/src/sgsn/sgsn.c b/src/sgsn/sgsn.c
new file mode 100644
index 000000000..6619bf263
--- /dev/null
+++ b/src/sgsn/sgsn.c
@@ -0,0 +1,215 @@
+/* SGSN instance */
+
+/* (C) 2009 by Harald Welte <laforge@gnumonks.org>
+ *
+ * All Rights 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.
+ *
+ * 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 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/>.
+ *
+ */
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/stats.h>
+#include <osmocom/core/backtrace.h>
+#include <osmocom/ctrl/control_if.h>
+#include <osmocom/ctrl/ports.h>
+#include <osmocom/gprs/gprs_ns2.h>
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
+#include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/gsup.h>
+
+#include <osmocom/sgsn/gprs_subscriber.h>
+#include <osmocom/sgsn/debug.h>
+#include <osmocom/sgsn/sgsn.h>
+#include <osmocom/sgsn/gprs_gmm.h>
+#include <osmocom/sgsn/gprs_sm.h>
+#include <osmocom/sgsn/gprs_utils.h>
+#include <osmocom/sgsn/signal.h>
+#include <osmocom/sgsn/gprs_gmm_attach.h>
+#include <osmocom/sgsn/gprs_mm_state_gb_fsm.h>
+#include <osmocom/sgsn/gprs_mm_state_iu_fsm.h>
+#include <osmocom/sgsn/gprs_gmm_fsm.h>
+#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_sndcp.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/pdpctx.h>
+
+#include <pdp.h>
+
+#include <time.h>
+
+#define GPRS_LLME_CHECK_TICK 30
+
+extern struct osmo_tdef sgsn_T_defs[];
+
+static const struct rate_ctr_desc sgsn_ctr_description[] = {
+ { "llc:dl_bytes", "Count sent LLC bytes before giving it to the bssgp layer" },
+ { "llc:ul_bytes", "Count successful received LLC bytes (encrypt & fcs correct)" },
+ { "llc:dl_packets", "Count successful sent LLC packets before giving it to the bssgp layer" },
+ { "llc:ul_packets", "Count successful received LLC packets (encrypt & fcs correct)" },
+ { "gprs:attach_requested", "Received attach requests" },
+ { "gprs:attach_accepted", "Sent attach accepts" },
+ { "gprs:attach_rejected", "Sent attach rejects" },
+ { "gprs:detach_requested", "Received detach requests" },
+ { "gprs:detach_acked", "Sent detach acks" },
+ { "gprs:routing_area_requested", "Received routing area requests" },
+ { "gprs:routing_area_requested", "Sent routing area acks" },
+ { "gprs:routing_area_requested", "Sent routing area rejects" },
+ { "pdp:activate_requested", "Received activate requests" },
+ { "pdp:activate_rejected", "Sent activate rejects" },
+ { "pdp:activate_accepted", "Sent activate accepts" },
+ { "pdp:request_activated", "unused" },
+ { "pdp:request_activate_rejected", "unused" },
+ { "pdp:modify_requested", "unused" },
+ { "pdp:modify_accepted", "unused" },
+ { "pdp:dl_deactivate_requested", "Sent deactivate requests" },
+ { "pdp:dl_deactivate_accepted", "Sent deactivate accepted" },
+ { "pdp:ul_deactivate_requested", "Received deactivate requests" },
+ { "pdp:ul_deactivate_accepted", "Received deactivate accepts" },
+};
+
+static const struct rate_ctr_group_desc sgsn_ctrg_desc = {
+ "sgsn",
+ "SGSN Overall Statistics",
+ OSMO_STATS_CLASS_GLOBAL,
+ ARRAY_SIZE(sgsn_ctr_description),
+ sgsn_ctr_description,
+};
+
+static void sgsn_llme_cleanup_free(struct gprs_llc_llme *llme)
+{
+ struct sgsn_mm_ctx *mmctx = NULL;
+
+ llist_for_each_entry(mmctx, &sgsn->mm_list, list) {
+ if (llme == mmctx->gb.llme) {
+ gsm0408_gprs_access_cancelled(mmctx, SGSN_ERROR_CAUSE_NONE);
+ return;
+ }
+ }
+
+ /* No MM context found */
+ LOGP(DGPRS, LOGL_INFO, "Deleting orphaned LLME, TLLI 0x%08x\n",
+ llme->tlli);
+ gprs_llgmm_unassign(llme);
+}
+
+static void sgsn_llme_check_cb(void *data_)
+{
+ struct gprs_llc_llme *llme, *llme_tmp;
+ struct timespec now_tp;
+ time_t now, age;
+ time_t max_age = gprs_max_time_to_idle();
+
+ int rc;
+
+ rc = osmo_clock_gettime(CLOCK_MONOTONIC, &now_tp);
+ OSMO_ASSERT(rc >= 0);
+ now = now_tp.tv_sec;
+
+ LOGP(DGPRS, LOGL_DEBUG,
+ "Checking for inactive LLMEs, time = %u\n", (unsigned)now);
+
+ llist_for_each_entry_safe(llme, llme_tmp, &gprs_llc_llmes, list) {
+ if (llme->age_timestamp == GPRS_LLME_RESET_AGE)
+ llme->age_timestamp = now;
+
+ age = now - llme->age_timestamp;
+
+ if (age > max_age || age < 0) {
+ LOGP(DGPRS, LOGL_INFO,
+ "Inactivity timeout for TLLI 0x%08x, age %d\n",
+ llme->tlli, (int)age);
+ sgsn_llme_cleanup_free(llme);
+ }
+ }
+
+ osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0);
+}
+
+static int sgsn_instance_talloc_destructor(struct sgsn_instance *sgi)
+{
+ sgsn_cdr_release(sgi);
+ osmo_timer_del(&sgi->llme_timer);
+ rate_ctr_group_free(sgi->rate_ctrs);
+ return 0;
+}
+
+struct sgsn_instance *sgsn_instance_alloc(void *talloc_ctx)
+{
+ struct sgsn_instance *inst;
+ inst = talloc_zero(talloc_ctx, struct sgsn_instance);
+
+ talloc_set_destructor(inst, sgsn_instance_talloc_destructor);
+
+ inst->cfg.gtp_statedir = talloc_strdup(inst, "./");
+ inst->cfg.auth_policy = SGSN_AUTH_POLICY_CLOSED;
+ inst->cfg.require_authentication = true; /* only applies if auth_policy is REMOTE */
+ inst->cfg.gsup_server_port = OSMO_GSUP_PORT;
+
+ inst->cfg.T_defs = sgsn_T_defs;
+ osmo_tdefs_reset(inst->cfg.T_defs);
+ inst->cfg.T_defs_gtp = gtp_T_defs;
+ osmo_tdefs_reset(inst->cfg.T_defs_gtp);
+
+ inst->rate_ctrs = rate_ctr_group_alloc(inst, &sgsn_ctrg_desc, 0);
+ OSMO_ASSERT(inst->rate_ctrs);
+
+ INIT_LLIST_HEAD(&inst->apn_list);
+ INIT_LLIST_HEAD(&inst->ggsn_list);
+ INIT_LLIST_HEAD(&inst->mme_list);
+ INIT_LLIST_HEAD(&inst->mm_list);
+ INIT_LLIST_HEAD(&inst->pdp_list);
+
+ osmo_timer_setup(&inst->llme_timer, sgsn_llme_check_cb, NULL);
+ osmo_timer_schedule(&inst->llme_timer, GPRS_LLME_CHECK_TICK, 0);
+ /* These are mostly setting up stuff not related to VTY cfg, so they can be set up here: */
+ sgsn_auth_init(inst);
+ sgsn_cdr_init(inst);
+ return inst;
+}
+
+/* To be called after VTY config parsing: */
+int sgsn_inst_init(struct sgsn_instance *sgsn)
+{
+ int rc;
+
+ /* start control interface after reading config for
+ * ctrl_vty_get_bind_addr() */
+ sgsn->ctrlh = ctrl_interface_setup(NULL, OSMO_CTRL_PORT_SGSN, NULL);
+ if (!sgsn->ctrlh) {
+ LOGP(DGPRS, LOGL_ERROR, "Failed to create CTRL interface.\n");
+ return -EIO;
+ }
+
+ rc = sgsn_ctrl_cmds_install();
+ if (rc != 0) {
+ LOGP(DGPRS, LOGL_ERROR, "Failed to install CTRL commands.\n");
+ return -EFAULT;
+ }
+
+ rc = gprs_subscr_init(sgsn);
+ if (rc < 0) {
+ LOGP(DGPRS, LOGL_FATAL, "Cannot set up SGSN\n");
+ return rc;
+ }
+ return 0;
+}
diff --git a/src/sgsn/sgsn_auth.c b/src/sgsn/sgsn_auth.c
index b8d803590..cbff6f8ba 100644
--- a/src/sgsn/sgsn_auth.c
+++ b/src/sgsn/sgsn_auth.c
@@ -22,7 +22,7 @@
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/core/utils.h>
#include <osmocom/sgsn/sgsn.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/sgsn/debug.h>
diff --git a/src/sgsn/sgsn_cdr.c b/src/sgsn/sgsn_cdr.c
index a50b4dfdd..1536c135a 100644
--- a/src/sgsn/sgsn_cdr.c
+++ b/src/sgsn/sgsn_cdr.c
@@ -27,6 +27,9 @@
#include <osmocom/gsm/apn.h>
#include <osmocom/sgsn/vty.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/pdpctx.h>
+#include <osmocom/sgsn/mmctx.h>
#include <gtp.h>
#include <pdp.h>
@@ -38,10 +41,6 @@
#include <stdio.h>
#include <inttypes.h>
-/* TODO...avoid going through a global */
-extern struct sgsn_instance *sgsn;
-extern struct ctrl_handle *g_ctrlh;
-
/**
* The CDR module will generate an entry like:
*
@@ -64,7 +63,7 @@ extern struct ctrl_handle *g_ctrlh;
static void send_cdr_trap(char *value)
{
- if (ctrl_cmd_send_trap(g_ctrlh, "cdr-v1", value) < 0)
+ if (ctrl_cmd_send_trap(sgsn->ctrlh, "cdr-v1", value) < 0)
LOGP(DGPRS, LOGL_ERROR, "Failed to create and send TRAP cdr-v1\n");
}
@@ -299,3 +298,8 @@ int sgsn_cdr_init(struct sgsn_instance *sgsn)
return 0;
}
+
+void sgsn_cdr_release(struct sgsn_instance *sgsn)
+{
+ osmo_signal_unregister_handler(SS_SGSN, handle_sgsn_sig, sgsn);
+}
diff --git a/src/sgsn/sgsn_ctrl.c b/src/sgsn/sgsn_ctrl.c
index ad91d25a5..069304abd 100644
--- a/src/sgsn/sgsn_ctrl.c
+++ b/src/sgsn/sgsn_ctrl.c
@@ -21,20 +21,19 @@
#include <osmocom/ctrl/control_if.h>
#include <osmocom/ctrl/control_cmd.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
+#include <osmocom/sgsn/pdpctx.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/debug.h>
#include <pdp.h>
-extern vector ctrl_node_vec;
-
static int get_subscriber_list(struct ctrl_cmd *cmd, void *d)
{
struct sgsn_mm_ctx *mm;
cmd->reply = talloc_strdup(cmd, "");
- llist_for_each_entry(mm, &sgsn_mm_ctxts, list) {
+ llist_for_each_entry(mm, &sgsn->mm_list, list) {
char *addr = NULL;
struct sgsn_pdp_ctx *pdp;
@@ -43,7 +42,7 @@ static int get_subscriber_list(struct ctrl_cmd *cmd, void *d)
llist_for_each_entry(pdp, &mm->pdp_list, list)
addr = gprs_pdpaddr2str(pdp->lib->eua.v,
- pdp->lib->eua.l);
+ pdp->lib->eua.l, false);
cmd->reply = talloc_asprintf_append(
cmd->reply,
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 581e74d4b..9edd0c60e 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -34,7 +34,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
-#include "bscconfig.h"
+#include "config.h"
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
@@ -45,9 +45,9 @@
#include <osmocom/sgsn/signal.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
-#include <osmocom/sgsn/gprs_gb.h>
+#include <osmocom/sgsn/gprs_ns.h>
#include <osmocom/sgsn/gprs_llc.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/mmctx.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_sm.h>
#include <osmocom/sgsn/gprs_subscriber.h>
@@ -55,6 +55,11 @@
#include <osmocom/sgsn/gprs_ranap.h>
#include <osmocom/sgsn/gprs_gmm_fsm.h>
#include <osmocom/sgsn/gprs_mm_state_gb_fsm.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp_mme.h>
+#include <osmocom/sgsn/sgsn_rim.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
+#include <osmocom/sgsn/pdpctx.h>
#include <gtp.h>
#include <pdp.h>
@@ -167,6 +172,7 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
pdp->hisaddr0 = ggsn->remote_addr;
pdp->hisaddr1 = ggsn->remote_addr;
//pdp->cch_pdp = 512; /* Charging Flat Rate */
+ pdp->radio_pri = 0x4;
/* MS provided APN, subscription was verified by the caller */
pdp->selmode = 0xFC | 0x00;
@@ -225,18 +231,11 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
qos = TLVP_VAL(tp, OSMO_IE_GSM_REQ_QOS);
}
- if (qos_len <= 3) {
- pdp->qos_req.l = qos_len + 1;
- if (pdp->qos_req.l > sizeof(pdp->qos_req.v))
- pdp->qos_req.l = sizeof(pdp->qos_req.v);
- pdp->qos_req.v[0] = 0; /* Allocation/Retention policy */
- memcpy(&pdp->qos_req.v[1], qos, pdp->qos_req.l - 1);
- } else {
- pdp->qos_req.l = qos_len;
- if (pdp->qos_req.l > sizeof(pdp->qos_req.v))
- pdp->qos_req.l = sizeof(pdp->qos_req.v);
- memcpy(pdp->qos_req.v, qos, pdp->qos_req.l);
- }
+ pdp->qos_req.l = qos_len + 1;
+ if (pdp->qos_req.l > sizeof(pdp->qos_req.v))
+ pdp->qos_req.l = sizeof(pdp->qos_req.v);
+ pdp->qos_req.v[0] = 0; /* Allocation/Retention policy */
+ memcpy(&pdp->qos_req.v[1], qos, pdp->qos_req.l - 1);
/* charging characteristics if present */
if (TLVP_LEN(tp, OSMO_IE_GSM_CHARG_CHAR) >= sizeof(pdp->cch_pdp))
@@ -311,11 +310,16 @@ struct sgsn_pdp_ctx *sgsn_create_pdp_ctx(struct sgsn_ggsn_ctx *ggsn,
return pctx;
}
-/* SGSN wants to delete a PDP context */
+/* SGSN wants to delete a PDP context, send first DeleteCtxReq on the GTP side,
+ then upon DeleteCtx ACK it will send DeactPdpAcc to the MS if still
+ connected. */
int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx)
{
LOGPDPCTXP(LOGL_INFO, pctx, "Delete PDP Context\n");
+ OSMO_ASSERT(pctx->ggsn);
+ OSMO_ASSERT(pctx->lib);
+
/* FIXME: decide if we need teardown or not ! */
return gtp_delete_context_req2(pctx->ggsn->gsn, pctx->lib, pctx, 1);
}
@@ -413,7 +417,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
}
/* Check for cause value if it was really successful */
- if (cause != GTPCAUSE_ACC_REQ) {
+ if (!gtp_cause_successful(cause)) {
reject_cause = cause_map(gtp2sm_cause_map, cause,
GSM_CAUSE_ACT_REJ_GGSN);
goto reject;
@@ -473,6 +477,70 @@ void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc)
gtp_echo_req(ggc->gsn, ggc->gtp_version, ggc, &ggc->remote_addr);
}
+int sgsn_mme_ran_info_req(struct sgsn_mme_ctx *mme, const struct bssgp_ran_information_pdu *pdu)
+{
+ char ri_src_str[64], ri_dest_str[64];
+ int ri_len;
+ struct msgb *msg;
+ struct bssgp_normal_hdr *bgph;
+ int rc;
+ uint8_t ri_buf[64];
+ uint8_t *ri_ptr = &ri_buf[0];
+ struct sockaddr_in sk_in = {
+ .sin_family = AF_INET,
+ .sin_port = htons(GTP1C_PORT),
+ .sin_addr = mme->remote_addr,
+ };
+
+ msg = bssgp_encode_rim_pdu(pdu);
+ if (!msg) {
+ LOGMME(mme, DRIM, LOGL_ERROR, "Tx GTP RAN Information Relay: failed to encode pdu\n");
+ return -EINVAL;
+ }
+ bgph = (struct bssgp_normal_hdr *)msgb_bssgph(msg);
+ DEBUGP(DLBSSGP, "Tx GTP RAN Information Relay: RIM-PDU:%s, src=%s, dest=%s\n",
+ bssgp_pdu_str(bgph->pdu_type),
+ bssgp_rim_ri_name_buf(ri_src_str, sizeof(ri_src_str), &pdu->routing_info_src),
+ bssgp_rim_ri_name_buf(ri_dest_str, sizeof(ri_dest_str), &pdu->routing_info_dest));
+
+ if ((ri_len = bssgp_create_rim_ri(ri_ptr, &pdu->routing_info_dest)) < 0) {
+ ri_ptr = NULL;
+ ri_len = 0;
+ }
+
+ rc = gtp_ran_info_relay_req(mme->sgsn->gsn, &sk_in, msgb_data(msg), msgb_length(msg),
+ ri_ptr, ri_len, pdu->routing_info_dest.discr);
+ msgb_free(msg);
+ return rc;
+}
+
+/* Confirmation of a PDP Context Update */
+static int update_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
+{
+ struct sgsn_pdp_ctx *pctx = cbp;
+ int rc;
+
+ LOGPDPCTXP(LOGL_INFO, pctx, "Received Update PDP CTX CONF, cause=%d(%s)\n",
+ cause, get_value_string(gtp_cause_strs, cause));
+
+ /* 3GPP TS 29.060 "7.3.4":
+ * "If the SGSN receives an Update PDP Context Response with a Cause
+ * value other than "Request accepted", it shall abort the update of the
+ * PDP context.""
+ * "If the SGSN receives an Update PDP Context Response with
+ * a Cause value "Non-existent", it shall delete the PDP Context."
+ */
+ if (cause != GTPCAUSE_NON_EXIST)
+ return 0; /* Nothing to do */
+
+ LOGPDPCTXP(LOGL_INFO, pctx, "PDP CTX we tried to update doesn't exist in "
+ "the GGSN anymore, deleting it locally.\n");
+
+ rc = gtp_freepdp(pctx->ggsn->gsn, pctx->lib);
+ /* related mmctx is torn down in cb_delete_context called by gtp_freepdp() */
+ return rc;
+}
+
/* Confirmation of a PDP Context Delete */
static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
{
@@ -528,12 +596,12 @@ static int echo_conf(void *cbp, bool timeout)
}
/* Any message received by GGSN contains a recovery IE */
-static int cb_recovery2(struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery)
+static int cb_recovery3(struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery)
{
struct sgsn_ggsn_ctx *ggsn;
struct sgsn_pdp_ctx *pctx = NULL;
- ggsn = sgsn_ggsn_ctx_by_addr(&peer->sin_addr);
+ ggsn = sgsn_ggsn_ctx_by_addr(sgsn, &peer->sin_addr);
if (!ggsn) {
LOGP(DGPRS, LOGL_NOTICE, "Received Recovery IE for unknown GGSN\n");
return -EINVAL;
@@ -571,6 +639,8 @@ static int cb_conf(int type, int cause, struct pdp_t *pdp, void *cbp)
return echo_conf(cbp, cause == EOF);
case GTP_CREATE_PDP_REQ:
return create_pdp_conf(pdp, cbp, cause);
+ case GTP_UPDATE_PDP_REQ:
+ return update_pdp_conf(pdp, cbp, cause);
case GTP_DELETE_PDP_REQ:
return delete_pdp_conf(pdp, cbp, cause);
default:
@@ -613,6 +683,74 @@ static int cb_extheader_ind(struct sockaddr_in *peer)
return 0;
}
+static int cb_gtp_ran_info_relay_ind(struct sockaddr_in *peer, union gtpie_member **ie)
+{
+ char addrbuf[INET_ADDRSTRLEN];
+ struct sgsn_mme_ctx *mme = sgsn_mme_ctx_by_addr(sgsn, &peer->sin_addr);
+ if (!mme) {
+ LOGP(DGTP, LOGL_NOTICE, "Rx GTP RAN Information Relay from unknown MME %s\n",
+ inet_ntop(AF_INET, &peer->sin_addr, addrbuf, sizeof(addrbuf)));
+ return -ECONNREFUSED;
+ }
+
+ LOGMME(mme, DGTP, LOGL_INFO, "Rx GTP RAN Information Relay\n");
+
+ int rc;
+ unsigned int len = 0;
+ struct msgb *msg = bssgp_msgb_alloc();
+
+ uint8_t rim_ra_encoded[256];
+ unsigned int rim_ra_encoded_len = 0;
+ struct bssgp_rim_routing_info rim_ra;
+
+ unsigned int rim_ra_discr_encoded_len = 0;
+ uint8_t rim_ra_discr;
+
+ /* Read RIM Routing Address Discriminator (optional) */
+ rc = gtpie_gettlv(ie, GTPIE_RIM_RA_DISCR, 0, &rim_ra_discr_encoded_len, &rim_ra_discr,
+ sizeof(rim_ra_discr));
+ if (rc || rim_ra_discr_encoded_len <= 0) {
+ LOGMME(mme, DGTP, LOGL_NOTICE, "Rx GTP RAN Information Relay: No RIM Routing Address Discriminator IE found!\n");
+
+ /* It is not an error when the RIM ROUTING ADDRESS DISCRIMINATOR IE is missing. The RIM ROUTING ADDRESS
+ * DISCRIMINATOR IE is an optional IE. When it is missing, the RIM Routing Address shall be processed
+ * as an RNC address ("0001") See also: 3GPP TS 29.060 */
+ rim_ra_discr = BSSGP_RIM_ROUTING_INFO_UTRAN;
+ }
+
+ /* Read RIM Routing Address (optional) */
+ rc = gtpie_gettlv(ie, GTPIE_RIM_ROUT_ADDR, 0, &rim_ra_encoded_len, rim_ra_encoded, sizeof(rim_ra_encoded));
+ if (rc || rim_ra_encoded_len <= 0) {
+ LOGMME(mme, DGTP, LOGL_ERROR, "Rx GTP RAN Information Relay: No RIM Routing Address IE found!\n");
+
+ /* TODO: The (usually included) RIM ROUTING ADDRESS field is an optional field. However, we cannot
+ * proceed without a destination address. A possible way to fix this would be a default route that
+ * can be configured via the VTY. */
+ goto ret_error;
+ } else {
+ rc = bssgp_parse_rim_ra(&rim_ra, rim_ra_encoded, rim_ra_encoded_len, rim_ra_discr);
+ if (rc < 0) {
+ LOGMME(mme, DGTP, LOGL_ERROR,
+ "Rx GTP RAN Information Relay: Failed parsing RIM Routing Address/RIM Routing Address Discriminator IE!\n");
+ goto ret_error;
+ }
+ }
+
+ if (gtpie_gettlv(ie, GTPIE_RAN_T_CONTAIN, 0, &len, msgb_data(msg), 4096) || len <= 0) {
+ LOGMME(mme, DGTP, LOGL_ERROR, "Rx GTP RAN Information Relay: No Transparent Container IE found!\n");
+ goto ret_error;
+ }
+ msgb_put(msg, len);
+ msgb_bssgph(msg) = msg->data;
+ msgb_nsei(msg) = 0;
+
+ return sgsn_rim_rx_from_gtp(msg, &rim_ra);
+
+ret_error:
+ msgb_free(msg);
+ return -EINVAL;
+}
+
/* Called whenever we receive a DATA packet */
static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
{
@@ -665,15 +803,24 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
msgb_free(msg);
return -1;
case ST_GMM_REGISTERED_NORMAL:
- OSMO_ASSERT(mm->gb.mm_state_fsm->state != ST_MM_IDLE);
- if (mm->gb.mm_state_fsm->state == ST_MM_STANDBY) {
+ switch (mm->gb.mm_state_fsm->state) {
+ case ST_MM_IDLE:
+ LOGP(DGPRS, LOGL_ERROR, "Dropping DL packet for MS in MM state %s\n",
+ osmo_fsm_inst_state_name(mm->gb.mm_state_fsm));
+ msgb_free(msg);
+ return -1;
+ case ST_MM_READY:
+ /* Go ahead */
+ break;
+ case ST_MM_STANDBY:
LOGMMCTXP(LOGL_INFO, mm, "Paging MS in GMM state %s, MM state %s\n",
osmo_fsm_inst_state_name(mm->gmm_fsm),
osmo_fsm_inst_state_name(mm->gb.mm_state_fsm));
- gprs_gb_page_ps_ra(mm);
- }
+ sgsn_bssgp_page_ps_ra(mm);
- /* FIXME: queue the packet we received from GTP */
+ /* FIXME: queue the packet we received from GTP */
+ break;
+ }
break;
default:
LOGP(DGPRS, LOGL_ERROR, "GTP DATA IND for TLLI %08X in state "
@@ -682,20 +829,20 @@ static int cb_data_ind(struct pdp_t *lib, void *packet, unsigned int len)
return -1;
}
- rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_OUT]);
- rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_OUT], len);
- rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_UDATA_OUT]);
- rate_ctr_add(&mm->ctrg->ctr[GMM_CTR_BYTES_UDATA_OUT], len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_PKTS_UDATA_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_BYTES_UDATA_OUT), len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_PKTS_UDATA_OUT));
+ rate_ctr_add(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_BYTES_UDATA_OUT), len);
/* It is easier to have a global count */
pdp->cdr_bytes_out += len;
- return sndcp_unitdata_req(msg, &mm->gb.llme->lle[pdp->sapi],
+ return sndcp_sn_unitdata_req(msg, &mm->gb.llme->lle[pdp->sapi],
pdp->nsapi, mm);
}
/* Called by SNDCP when it has received/re-assembled a N-PDU */
-int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
+int sgsn_gtp_data_req(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
struct msgb *msg, uint32_t npdu_len, uint8_t *npdu)
{
struct sgsn_mm_ctx *mmctx;
@@ -720,10 +867,10 @@ int sgsn_rx_sndcp_ud_ind(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi,
return -EIO;
}
- rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_IN]);
- rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_IN], npdu_len);
- rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_UDATA_IN]);
- rate_ctr_add(&mmctx->ctrg->ctr[GMM_CTR_BYTES_UDATA_IN], npdu_len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_PKTS_UDATA_IN));
+ rate_ctr_add(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_BYTES_UDATA_IN), npdu_len);
+ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_UDATA_IN));
+ rate_ctr_add(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_BYTES_UDATA_IN), npdu_len);
/* It is easier to have a global count */
pdp->cdr_bytes_in += npdu_len;
@@ -775,31 +922,19 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
if (gsn->mode != GTP_MODE_SGSN)
return -EINVAL;
- sgi->gtp_fd0.fd = gsn->fd0;
- sgi->gtp_fd0.priv_nr = 0;
- sgi->gtp_fd0.data = sgi;
- sgi->gtp_fd0.when = OSMO_FD_READ;
- sgi->gtp_fd0.cb = sgsn_gtp_fd_cb;
+ osmo_fd_setup(&sgi->gtp_fd0, gsn->fd0, OSMO_FD_READ, sgsn_gtp_fd_cb, sgi, 0);
rc = osmo_fd_register(&sgi->gtp_fd0);
if (rc < 0)
return rc;
- sgi->gtp_fd1c.fd = gsn->fd1c;
- sgi->gtp_fd1c.priv_nr = 1;
- sgi->gtp_fd1c.data = sgi;
- sgi->gtp_fd1c.when = OSMO_FD_READ;
- sgi->gtp_fd1c.cb = sgsn_gtp_fd_cb;
+ osmo_fd_setup(&sgi->gtp_fd1c, gsn->fd1c, OSMO_FD_READ, sgsn_gtp_fd_cb, sgi, 1);
rc = osmo_fd_register(&sgi->gtp_fd1c);
if (rc < 0) {
osmo_fd_unregister(&sgi->gtp_fd0);
return rc;
}
- sgi->gtp_fd1u.fd = gsn->fd1u;
- sgi->gtp_fd1u.priv_nr = 2;
- sgi->gtp_fd1u.data = sgi;
- sgi->gtp_fd1u.when = OSMO_FD_READ;
- sgi->gtp_fd1u.cb = sgsn_gtp_fd_cb;
+ osmo_fd_setup(&sgi->gtp_fd1u, gsn->fd1u, OSMO_FD_READ, sgsn_gtp_fd_cb, sgi, 2);
rc = osmo_fd_register(&sgi->gtp_fd1u);
if (rc < 0) {
osmo_fd_unregister(&sgi->gtp_fd0);
@@ -810,10 +945,11 @@ int sgsn_gtp_init(struct sgsn_instance *sgi)
/* Register callbackcs with libgtp */
gtp_set_cb_delete_context(gsn, cb_delete_context);
gtp_set_cb_conf(gsn, cb_conf);
- gtp_set_cb_recovery2(gsn, cb_recovery2);
+ gtp_set_cb_recovery3(gsn, cb_recovery3);
gtp_set_cb_data_ind(gsn, cb_data_ind);
gtp_set_cb_unsup_ind(gsn, cb_unsup_ind);
gtp_set_cb_extheader_ind(gsn, cb_extheader_ind);
+ gtp_set_cb_ran_info_relay_ind(gsn, cb_gtp_ran_info_relay_ind);
return 0;
}
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index 5b538155a..d6afdef52 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -39,8 +39,9 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/stats.h>
+#include <osmocom/core/sockaddr_str.h>
-#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns2.h>
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gprs/gprs_bssgp_bss.h>
@@ -49,6 +50,7 @@
#include <osmocom/vty/stats.h>
#include <osmocom/vty/ports.h>
#include <osmocom/vty/misc.h>
+#include <osmocom/vty/cpu_sched_vty.h>
#include <osmocom/ctrl/control_vty.h>
@@ -57,15 +59,18 @@
#include <osmocom/sgsn/vty.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_llc.h>
+#include <osmocom/sgsn/gprs_sndcp.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/gprs_ranap.h>
-
-#include <osmocom/ctrl/control_if.h>
-#include <osmocom/ctrl/ports.h>
+#include <osmocom/sgsn/gprs_ns.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
+#include <osmocom/sgsn/gprs_subscriber.h>
+#include <osmocom/sgsn/gtp.h>
#include <gtp.h>
+#include <osmocom/sgsn/sgsn_rim.h>
-#include "../../bscconfig.h"
+#include "../../config.h"
#if BUILD_IU
#include <osmocom/sigtran/osmo_ss7.h>
@@ -77,9 +82,8 @@
#include <getopt.h>
void *tall_sgsn_ctx;
-struct ctrl_handle *g_ctrlh;
-struct gprs_ns_inst *sgsn_nsi;
+struct gprs_ns2_inst *sgsn_nsi;
static int daemonize = 0;
const char *openbsc_copyright =
"Copyright (C) 2010 Harald Welte and On-Waves\r\n"
@@ -93,60 +97,18 @@ const char *openbsc_copyright =
struct sgsn_instance *sgsn;
-/* call-back function for the NS protocol */
-static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
- struct msgb *msg, uint16_t bvci)
-{
- int rc = 0;
-
- switch (event) {
- case GPRS_NS_EVT_UNIT_DATA:
- /* hand the message into the BSSGP implementation */
- rc = bssgp_rcvmsg(msg);
- break;
- default:
- LOGP(DGPRS, LOGL_ERROR, "SGSN: Unknown event %u from NS\n", event);
- if (msg)
- msgb_free(msg);
- rc = -EIO;
- break;
- }
- return rc;
-}
-
-/* call-back function for the BSSGP protocol */
+/* call-back function for the BSSGP protocol.
+ * Must be left here so that we can add a new one in tests/sgsn_test */
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
{
- struct osmo_bssgp_prim *bp;
- bp = container_of(oph, struct osmo_bssgp_prim, oph);
-
- switch (oph->sap) {
- case SAP_BSSGP_LL:
- switch (oph->primitive) {
- case PRIM_BSSGP_UL_UD:
- return gprs_llc_rcvmsg(oph->msg, bp->tp);
- }
- break;
- case SAP_BSSGP_GMM:
- switch (oph->primitive) {
- case PRIM_BSSGP_GMM_SUSPEND:
- return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli);
- case PRIM_BSSGP_GMM_RESUME:
- return gprs_gmm_rx_resume(bp->ra_id, bp->tlli,
- bp->u.resume.suspend_ref);
- }
- break;
- case SAP_BSSGP_NM:
- break;
- }
- return 0;
+ return sgsn_bssgp_rx_prim(oph);
}
-static void signal_handler(int signal)
+static void signal_handler(int signum)
{
- fprintf(stdout, "signal %u received\n", signal);
+ fprintf(stdout, "signal %u received\n", signum);
- switch (signal) {
+ switch (signum) {
case SIGINT:
case SIGTERM:
osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL);
@@ -154,8 +116,17 @@ static void signal_handler(int signal)
exit(0);
break;
case SIGABRT:
- /* in case of abort, we want to obtain a talloc report
- * and then return to the caller, who will abort the process */
+ /* in case of abort, we want to obtain a talloc report and
+ * then run default SIGABRT handler, who will generate coredump
+ * and abort the process. abort() should do this for us after we
+ * return, but program wouldn't exit if an external SIGABRT is
+ * received.
+ */
+ talloc_report(tall_vty_ctx, stderr);
+ talloc_report_full(tall_sgsn_ctx, stderr);
+ signal(SIGABRT, SIG_DFL);
+ raise(SIGABRT);
+ break;
case SIGUSR1:
talloc_report(tall_vty_ctx, stderr);
talloc_report_full(tall_sgsn_ctx, stderr);
@@ -168,60 +139,36 @@ static void signal_handler(int signal)
}
}
-/* NSI that BSSGP uses when transmitting on NS */
-extern struct gprs_ns_inst *bssgp_nsi;
-
-int sgsn_vty_is_config_node(struct vty *vty, int node)
+static int sgsn_vty_go_parent(struct vty *vty)
{
- /* So far the SGSN has no nested nodes that need parent node
- * declaration, except for the ss7 vty nodes. */
- switch (node) {
+ switch (vty->node) {
case SGSN_NODE:
- return 1;
+ vty->node = CONFIG_NODE;
+ break;
+ case MME_NODE:
+ vty->node = SGSN_NODE;
+ vty->index = NULL;
+ break;
default:
#if BUILD_IU
- return osmo_ss7_is_config_node(vty, node);
+ osmo_ss7_vty_go_parent(vty);
#else
- return 0;
+ vty->node = CONFIG_NODE;
+ vty->index = NULL;
#endif
+ break;
}
-}
-int sgsn_vty_go_parent(struct vty *vty)
-{
- /* So far the SGSN has no nested nodes that need parent node
- * declaration, except for the ss7 vty nodes. */
-#if BUILD_IU
- return osmo_ss7_vty_go_parent(vty);
-#else
- vty->node = CONFIG_NODE;
- vty->index = NULL;
- return 0;
-#endif
+ return vty->node;
}
-static void bvc_reset_persistent_nsvcs(void)
-{
- /* Send BVC-RESET on all persistent NSVCs */
- struct gprs_nsvc *nsvc;
-
- llist_for_each_entry(nsvc, &sgsn_nsi->gprs_nsvcs, list) {
- struct bssgp_bvc_ctx bctx = {
- .nsei = nsvc->nsei,
- };
- if (!nsvc->persistent)
- continue;
- /* if it is not marked ALIVE, we cannot send any data over it. */
- nsvc->state |= NSE_S_ALIVE;
- bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false);
- }
-}
+/* NSI that BSSGP uses when transmitting on NS */
+extern struct gprs_ns_inst *bssgp_nsi;
static struct vty_app_info vty_info = {
.name = "OsmoSGSN",
.version = PACKAGE_VERSION,
.go_parent_cb = sgsn_vty_go_parent,
- .is_config_node = sgsn_vty_is_config_node,
};
static void print_help(void)
@@ -234,12 +181,43 @@ static void print_help(void)
printf(" -s --disable-color\n");
printf(" -c --config-file\tThe config file to use [%s]\n", CONFIG_FILE_DEFAULT);
printf(" -e --log-level number\tSet a global log level\n");
+
+ printf("\nVTY reference generation:\n");
+ printf(" --vty-ref-mode MODE VTY reference generation mode (e.g. 'expert').\n");
+ printf(" --vty-ref-xml Generate the VTY reference XML output and exit.\n");
}
+static void handle_long_options(const char *prog_name, const int long_option)
+{
+ static int vty_ref_mode = VTY_REF_GEN_MODE_DEFAULT;
+
+ switch (long_option) {
+ case 1:
+ vty_ref_mode = get_string_value(vty_ref_gen_mode_names, optarg);
+ if (vty_ref_mode < 0) {
+ fprintf(stderr, "%s: Unknown VTY reference generation "
+ "mode '%s'\n", prog_name, optarg);
+ exit(2);
+ }
+ break;
+ case 2:
+ fprintf(stderr, "Generating the VTY reference in mode '%s' (%s)\n",
+ get_value_string(vty_ref_gen_mode_names, vty_ref_mode),
+ get_value_string(vty_ref_gen_mode_desc, vty_ref_mode));
+ vty_dump_xml_ref_mode(stdout, (enum vty_ref_gen_mode) vty_ref_mode);
+ exit(0);
+ default:
+ fprintf(stderr, "%s: error parsing cmdline options\n", prog_name);
+ exit(2);
+ }
+}
+
+
static void handle_options(int argc, char **argv)
{
while (1) {
int option_index = 0, c;
+ static int long_option = 0;
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"debug", 1, 0, 'd'},
@@ -249,6 +227,8 @@ static void handle_options(int argc, char **argv)
{"timestamp", 0, 0, 'T'},
{ "version", 0, 0, 'V' },
{"log-level", 1, 0, 'e'},
+ {"vty-ref-mode", 1, &long_option, 1},
+ {"vty-ref-xml", 0, &long_option, 2},
{NULL, 0, 0, 0}
};
@@ -258,6 +238,9 @@ static void handle_options(int argc, char **argv)
break;
switch (c) {
+ case 0:
+ handle_long_options(argv[0], long_option);
+ break;
case 'h':
//print_usage();
print_help();
@@ -325,16 +308,6 @@ static struct log_info_cat gprs_categories[] = {
.description = "GPRS Packet Service",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
- [DNS] = {
- .name = "DNS",
- .description = "GPRS Network Service (NS)",
- .enabled = 1, .loglevel = LOGL_NOTICE,
- },
- [DBSSGP] = {
- .name = "DBSSGP",
- .description = "GPRS BSS Gateway Protocol (BSSGP)",
- .enabled = 1, .loglevel = LOGL_NOTICE,
- },
[DLLC] = {
.name = "DLLC",
.description = "GPRS Logical Link Control Protocol (LLC)",
@@ -370,6 +343,11 @@ static struct log_info_cat gprs_categories[] = {
.description = "GPRS Tunnelling Protocol (GTP)",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
+ [DRIM] = {
+ .name = "DRIM",
+ .description = "RAN Information Management (RIM)",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
};
static const struct log_info gprs_log_info = {
@@ -414,6 +392,7 @@ int main(int argc, char **argv)
osmo_stats_vty_add_cmds();
sgsn_vty_init(&sgsn->cfg);
ctrl_vty_init(tall_sgsn_ctx);
+ osmo_cpu_sched_vty_init(tall_sgsn_ctx);
#if BUILD_IU
OSMO_ASSERT(osmo_ss7_init() == 0);
@@ -421,6 +400,24 @@ int main(int argc, char **argv)
osmo_sccp_vty_init();
#endif
+ rate_ctr_init(tall_sgsn_ctx);
+
+ logging_vty_add_deprecated_subsys(tall_sgsn_ctx, "bssgp");
+ logging_vty_add_deprecated_subsys(tall_sgsn_ctx, "ns");
+
+ sgsn_nsi = gprs_ns2_instantiate(tall_sgsn_ctx, &gprs_ns_prim_cb, NULL);
+ if (!sgsn_nsi) {
+ LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
+ exit(1);
+ }
+ sgsn->cfg.nsi = sgsn_nsi;
+ bssgp_set_bssgp_callback(sgsn_bssgp_dispatch_ns_unitdata_req_cb, sgsn_nsi);
+
+ gprs_ns2_vty_init(sgsn_nsi);
+ bssgp_vty_init();
+ gprs_llc_vty_init();
+ gprs_sndcp_vty_init();
+
handle_options(argc, argv);
/* Backwards compatibility: for years, the default config file name was
@@ -438,30 +435,6 @@ int main(int argc, char **argv)
osmo_talloc_replace_string(sgsn, &sgsn->config_file, CONFIG_FILE_DEFAULT);
}
- rate_ctr_init(tall_sgsn_ctx);
-
- gprs_ns_set_log_ss(DNS);
- bssgp_set_log_ss(DBSSGP);
-
- sgsn_nsi = gprs_ns_instantiate(&sgsn_ns_cb, tall_sgsn_ctx);
- if (!sgsn_nsi) {
- LOGP(DGPRS, LOGL_ERROR, "Unable to instantiate NS\n");
- exit(1);
- }
- bssgp_nsi = sgsn->cfg.nsi = sgsn_nsi;
-
- gprs_llc_init("/usr/local/lib/osmocom/crypt/");
- sgsn_rate_ctr_init();
- sgsn_inst_init(sgsn);
-
- gprs_ns_vty_init(bssgp_nsi);
- bssgp_vty_init();
- gprs_llc_vty_init();
- gprs_sndcp_vty_init();
- sgsn_auth_init(sgsn);
- sgsn_cdr_init(sgsn);
- /* FIXME: register signal handler for SS_L_NS */
-
rc = sgsn_parse_config(sgsn->config_file);
if (rc < 0) {
LOGP(DGPRS, LOGL_FATAL, "Error in config file\n");
@@ -469,25 +442,11 @@ int main(int argc, char **argv)
}
/* start telnet after reading config for vty_get_bind_addr() */
- rc = telnet_init_dynif(tall_sgsn_ctx, NULL,
- vty_get_bind_addr(), OSMO_VTY_PORT_SGSN);
+ rc = telnet_init_default(tall_sgsn_ctx, NULL, OSMO_VTY_PORT_SGSN);
if (rc < 0)
exit(1);
- /* start control interface after reading config for
- * ctrl_vty_get_bind_addr() */
- g_ctrlh = ctrl_interface_setup_dynip(NULL, ctrl_vty_get_bind_addr(),
- OSMO_CTRL_PORT_SGSN, NULL);
- if (!g_ctrlh) {
- LOGP(DGPRS, LOGL_ERROR, "Failed to create CTRL interface.\n");
- exit(1);
- }
-
- if (sgsn_ctrl_cmds_install() != 0) {
- LOGP(DGPRS, LOGL_ERROR, "Failed to install CTRL commands.\n");
- exit(1);
- }
-
+ gprs_llc_init(sgsn->cfg.crypt_cipher_plugin_path);
rc = sgsn_gtp_init(sgsn);
if (rc) {
@@ -496,22 +455,9 @@ int main(int argc, char **argv)
} else
LOGP(DGPRS, LOGL_NOTICE, "libGTP v%s initialized\n", gtp_version());
- rc = gprs_subscr_init(sgsn);
- if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot set up subscriber management\n");
- exit(2);
- }
-
- rc = gprs_ns_nsip_listen(sgsn_nsi);
+ rc = sgsn_inst_init(sgsn);
if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on NSIP socket\n");
- exit(2);
- }
-
- rc = gprs_ns_frgre_listen(sgsn_nsi);
- if (rc < 0) {
- LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen GRE "
- "socket. Do you have CAP_NET_RAW?\n");
+ LOGP(DGPRS, LOGL_FATAL, "Cannot set up SGSN\n");
exit(2);
}
@@ -530,8 +476,8 @@ int main(int argc, char **argv)
"OsmoSGSN",
(23 << 3) + 4,
OSMO_SS7_ASP_PROT_M3UA,
- 0, NULL,
- 0, "127.0.0.1");
+ 0, "localhost",
+ 0, "localhost");
if (!sccp) {
printf("Setting up SCCP client failed.\n");
return 8;
@@ -540,8 +486,6 @@ int main(int argc, char **argv)
ranap_iu_init(tall_sgsn_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
#endif
- bvc_reset_persistent_nsvcs();
-
if (daemonize) {
rc = osmo_daemonize();
if (rc < 0) {
diff --git a/src/sgsn/sgsn_rim.c b/src/sgsn/sgsn_rim.c
new file mode 100644
index 000000000..40e1f9033
--- /dev/null
+++ b/src/sgsn/sgsn_rim.c
@@ -0,0 +1,127 @@
+
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdint.h>
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/tlv.h>
+#include <osmocom/vty/logging.h>
+#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_bssgp_rim.h>
+#include <osmocom/sgsn/sgsn_rim.h>
+#include <osmocom/sgsn/gtp_mme.h>
+#include <osmocom/sgsn/gtp.h>
+#include <osmocom/sgsn/debug.h>
+#include <osmocom/sgsn/sgsn.h>
+
+static int sgsn_bssgp_fwd_rim_to_geran(const struct bssgp_ran_information_pdu *pdu)
+{
+ struct bssgp_bvc_ctx *bvc_ctx;
+ OSMO_ASSERT(pdu->routing_info_dest.discr == BSSGP_RIM_ROUTING_INFO_GERAN);
+
+ /* Resolve RIM ROUTING ADDRESS to a BVC context */
+ bvc_ctx = btsctx_by_raid_cid(&pdu->routing_info_dest.geran.raid, pdu->routing_info_dest.geran.cid);
+ if (!bvc_ctx) {
+ LOGP(DRIM, LOGL_ERROR, "Unable to find NSEI for destination cell %s\n",
+ bssgp_rim_ri_name(&pdu->routing_info_dest));
+ return -EINVAL;
+ }
+
+ /* Forward PDU to the NSEI of the resolved BVC context */
+ return bssgp_tx_rim(pdu, bvc_ctx->nsei);
+}
+
+static int sgsn_bssgp_fwd_rim_to_geran_encoded(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address)
+{
+ struct bssgp_bvc_ctx *bvc_ctx;
+ OSMO_ASSERT(rim_routing_address->discr == BSSGP_RIM_ROUTING_INFO_GERAN);
+
+ /* Resolve RIM ROUTING ADDRESS to a BVC context */
+ bvc_ctx = btsctx_by_raid_cid(&rim_routing_address->geran.raid, rim_routing_address->geran.cid);
+ if (!bvc_ctx) {
+ LOGP(DRIM, LOGL_ERROR, "Unable to find NSEI for destination cell %s\n",
+ bssgp_rim_ri_name(rim_routing_address));
+ return -EINVAL;
+ }
+
+ /* Forward PDU to the NSEI of the resolved BVC context */
+ return bssgp_tx_rim_encoded(msg, bvc_ctx->nsei);
+}
+
+static int sgsn_bssgp_fwd_rim_to_eutran(const struct bssgp_ran_information_pdu *pdu)
+{
+ struct sgsn_mme_ctx *mme;
+ OSMO_ASSERT(pdu->routing_info_dest.discr == BSSGP_RIM_ROUTING_INFO_EUTRAN);
+
+ mme = sgsn_mme_ctx_by_route(sgsn, &pdu->routing_info_dest.eutran.tai);
+ if (!mme) { /* See if we have a default route configured */
+ mme = sgsn_mme_ctx_by_default_route(sgsn);
+ if (!mme) {
+ LOGP(DRIM, LOGL_ERROR, "Unable to find MME for destination cell %s\n",
+ bssgp_rim_ri_name(&pdu->routing_info_dest));
+ return -EINVAL;
+ }
+ }
+
+ return sgsn_mme_ran_info_req(mme, pdu);
+}
+
+/* Receive a RIM PDU from BSSGP (GERAN) */
+int sgsn_rim_rx_from_gb(struct osmo_bssgp_prim *bp, struct msgb *msg)
+{
+ uint16_t nsei = msgb_nsei(msg);
+ struct bssgp_ran_information_pdu *pdu = &bp->u.rim_pdu;
+
+ if (pdu->routing_info_src.discr != BSSGP_RIM_ROUTING_INFO_GERAN) {
+ LOGP(DRIM, LOGL_ERROR,
+ "Rx BSSGP RIM (NSEI=%u): Expected src %s, got %s\n", nsei,
+ bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN),
+ bssgp_rim_routing_info_discr_str(pdu->routing_info_src.discr));
+ goto err;
+ }
+
+ switch (pdu->routing_info_dest.discr) {
+ case BSSGP_RIM_ROUTING_INFO_GERAN:
+ return sgsn_bssgp_fwd_rim_to_geran(pdu);
+ case BSSGP_RIM_ROUTING_INFO_EUTRAN:
+ return sgsn_bssgp_fwd_rim_to_eutran(pdu);
+ default:
+ /* At the moment we can only handle GERAN/EUTRAN addresses, any
+ * other type of address will be considered as an invalid
+ * address. see also: 3GPP TS 48.018, section 8c.3.1.3
+ */
+ LOGP(DRIM, LOGL_ERROR,
+ "Rx BSSGP RIM (NSEI=%u): Unsupported dst %s\n", nsei,
+ bssgp_rim_routing_info_discr_str(pdu->routing_info_dest.discr));
+ }
+
+ LOGP(DRIM, LOGL_INFO, "Rx BSSGP RIM (NSEI=%u): for dest cell %s\n", nsei,
+ bssgp_rim_ri_name(&pdu->routing_info_dest));
+
+err:
+ /* In case of an invalid destination address we respond with
+ * a BSSGP STATUS PDU, see also: 3GPP TS 48.018, section 8c.3.1.3 */
+ bssgp_tx_status(BSSGP_CAUSE_UNKN_RIM_AI, NULL, msg);
+ return -1;
+}
+
+/* Receive a RIM PDU from GTPv1C (EUTRAN) */
+int sgsn_rim_rx_from_gtp(struct msgb *msg, struct bssgp_rim_routing_info *rim_routing_address)
+{
+ /* TODO: In this code path, we currently only support RIM message forwarding to GERAN (BSSGP). However, it
+ * technically also be possible to route a message back to GTP (BSSGP_RIM_ROUTING_INFO_EUTRAN) or to
+ * IuPS (BSSGP_RIM_ROUTING_INFO_UTRAN) */
+ if (rim_routing_address->discr != BSSGP_RIM_ROUTING_INFO_GERAN) {
+ LOGP(DRIM, LOGL_ERROR, "Rx GTP RAN Information Relay: Expected dst %s, got %s\n",
+ bssgp_rim_routing_info_discr_str(BSSGP_RIM_ROUTING_INFO_GERAN),
+ bssgp_rim_routing_info_discr_str(rim_routing_address->discr));
+ return -EINVAL;
+ }
+
+ LOGP(DRIM, LOGL_INFO, "Rx GTP RAN Information Relay for dest cell %s\n",
+ bssgp_rim_ri_name(rim_routing_address));
+
+ return sgsn_bssgp_fwd_rim_to_geran_encoded(msg, rim_routing_address);
+}
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 14248d1d8..29f9cd604 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -34,10 +34,15 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/sgsn.h>
-#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gprs/gprs_ns2.h>
+#include <osmocom/sgsn/gprs_ns.h>
#include <osmocom/sgsn/gprs_gmm.h>
-#include <osmocom/sgsn/gprs_sgsn.h>
+#include <osmocom/sgsn/gprs_bssgp.h>
+#include <osmocom/sgsn/mmctx.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
+#include <osmocom/sgsn/gtp_mme.h>
#include <osmocom/sgsn/vty.h>
+#include <osmocom/sgsn/pdpctx.h>
#include <osmocom/gsupclient/gsup_client.h>
#include <osmocom/vty/tdef_vty.h>
@@ -45,6 +50,7 @@
#include <osmocom/vty/vty.h>
#include <osmocom/vty/misc.h>
#include <osmocom/crypt/gprs_cipher.h>
+#include <osmocom/crypt/utran_cipher.h>
#include <osmocom/abis/ipa.h>
#include <osmocom/gprs/gprs_bssgp.h>
@@ -52,14 +58,12 @@
#include <pdp.h>
#include <gtp.h>
-#include "../../bscconfig.h"
+#include "../../config.h"
#ifdef BUILD_IU
#include <osmocom/ranap/iu_client.h>
#endif
-extern void *tall_sgsn_ctx;
-
static struct sgsn_config *g_cfg = NULL;
const struct value_string sgsn_auth_pol_strs[] = {
@@ -94,7 +98,7 @@ const struct value_string sgsn_auth_pol_strs[] = {
#define NONSPEC_X1001_SECS 5 /* wait for a RANAP Release Complete */
-static struct osmo_tdef sgsn_T_defs[] = {
+struct osmo_tdef sgsn_T_defs[] = {
{ .T=3312, .default_val=GSM0408_T3312_SECS, .desc="Periodic RA Update timer (s)" },
{ .T=3313, .default_val=GSM0408_T3313_SECS, .desc="Waiting for paging response timer (s)" },
{ .T=3314, .default_val=GSM0408_T3314_SECS, .desc="READY timer. Force to STANDBY on expiry timer (s)" },
@@ -110,7 +114,6 @@ static struct osmo_tdef sgsn_T_defs[] = {
/* non spec timers */
{ .T=-1001, .default_val=NONSPEC_X1001_SECS, .desc="RANAP Release timeout. Wait for RANAP Release Complete."
"On expiry release Iu connection (s)" },
- { .T=-3314, .default_val=GSM0408_T3314_SECS, .desc="Iu User inactivity timer. On expiry release Iu connection (s)" },
{}
};
@@ -134,7 +137,27 @@ DEFUN(cfg_sgsn_timer, cfg_sgsn_timer_cmd,
return osmo_tdef_vty_set_cmd(vty, g_cfg->T_defs, argv);
}
-char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len)
+DEFUN(show_timer_gtp, show_timer_gtp_cmd,
+ "show timer gtp " OSMO_TDEF_VTY_ARG_T_OPTIONAL,
+ SHOW_STR "Show timers\n" "GTP (libgtp) timers\n"
+ OSMO_TDEF_VTY_DOC_T)
+{
+ const char *T_arg = argc > 0 ? argv[0] : NULL;
+ return osmo_tdef_vty_show_cmd(vty, g_cfg->T_defs_gtp, T_arg, NULL);
+}
+
+DEFUN(cfg_sgsn_timer_gtp, cfg_sgsn_timer_gtp_cmd,
+ "timer gtp " OSMO_TDEF_VTY_ARG_SET_OPTIONAL,
+ "Configure or show timers\n" "GTP (libgtp) timers\n"
+ OSMO_TDEF_VTY_DOC_SET)
+{
+ /* If any arguments are missing, redirect to 'show' */
+ if (argc < 2)
+ return show_timer(self, vty, argc, argv);
+ return osmo_tdef_vty_set_cmd(vty, g_cfg->T_defs_gtp, argv);
+}
+
+char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6)
{
static char str[INET6_ADDRSTRLEN + 10];
@@ -147,15 +170,28 @@ char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len)
case PDP_TYPE_N_IETF_IPv4:
if (len < 2 + 4)
break;
- strcpy(str, "IPv4 ");
+ osmo_strlcpy(str, "IPv4 ", sizeof(str));
inet_ntop(AF_INET, pdpa+2, str+5, sizeof(str)-5);
return str;
case PDP_TYPE_N_IETF_IPv6:
if (len < 2 + 8)
break;
- strcpy(str, "IPv6 ");
+ osmo_strlcpy(str, "IPv6 ", sizeof(str));
inet_ntop(AF_INET6, pdpa+2, str+5, sizeof(str)-5);
return str;
+ case PDP_TYPE_N_IETF_IPv4v6:
+ if (len < 2 + 20)
+ break;
+ if (return_ipv6) {
+ /* The IPv6 token, (rightmost four fields) is a duplicate of
+ * the site prefix + subnetID (leftmost fields) in pdpa here */
+ osmo_strlcpy(str, "IPv6 ", sizeof(str));
+ inet_ntop(AF_INET6, pdpa+6, str+5, sizeof(str)-5);
+ return str;
+ }
+ osmo_strlcpy(str, "IPv4 ", sizeof(str));
+ inet_ntop(AF_INET, pdpa+2, str+5, sizeof(str)-5);
+ return str;
default:
break;
}
@@ -177,19 +213,45 @@ static struct cmd_node sgsn_node = {
1,
};
+static struct cmd_node mme_node = {
+ MME_NODE,
+ "%s(config-sgsn-mme)# ",
+ 1,
+};
+
+static void config_write_mme(struct vty *vty, const struct sgsn_mme_ctx *mme, const char *prefix)
+{
+ struct mme_rim_route *rt;
+
+ vty_out(vty, "%smme %s%s", prefix, mme->name, VTY_NEWLINE);
+
+ vty_out(vty, "%s gtp remote-ip %s%s", prefix, inet_ntoa(mme->remote_addr), VTY_NEWLINE);
+ if (mme->default_route)
+ vty_out(vty, "%s gtp ran-info-relay default%s", prefix, VTY_NEWLINE);
+ llist_for_each_entry(rt, &mme->routes, list) {
+ vty_out(vty, "%s gtp ran-info-relay %s %s %u%s", prefix,
+ osmo_mcc_name(rt->tai.mcc), osmo_mnc_name(rt->tai.mnc, rt->tai.mnc_3_digits),
+ rt->tai.tac, VTY_NEWLINE);
+ }
+}
+
static int config_write_sgsn(struct vty *vty)
{
struct sgsn_ggsn_ctx *gctx;
struct imsi_acl_entry *acl;
struct apn_ctx *actx;
struct ares_addr_node *server;
+ struct sgsn_mme_ctx *mme;
+ int i;
vty_out(vty, "sgsn%s", VTY_NEWLINE);
+ vty_out(vty, " gtp state-dir %s%s",
+ g_cfg->gtp_statedir, VTY_NEWLINE);
vty_out(vty, " gtp local-ip %s%s",
inet_ntoa(g_cfg->gtp_listenaddr.sin_addr), VTY_NEWLINE);
- llist_for_each_entry(gctx, &sgsn_ggsn_ctxts, list) {
+ llist_for_each_entry(gctx, &sgsn->ggsn_list, list) {
if (gctx->id == UINT32_MAX)
continue;
@@ -211,10 +273,26 @@ static int config_write_sgsn(struct vty *vty)
for (server = sgsn->ares_servers; server; server = server->next)
vty_out(vty, " grx-dns-add %s%s", inet_ntoa(server->addr.addr4), VTY_NEWLINE);
- if (g_cfg->cipher != GPRS_ALGO_GEA0)
- vty_out(vty, " encryption %s%s",
- get_value_string(gprs_cipher_names, g_cfg->cipher),
- VTY_NEWLINE);
+ if (g_cfg->gea_encryption_mask != 0) {
+ vty_out(vty, " encryption gea");
+
+ for (i = 0; i < _GPRS_ALGO_NUM; i++)
+ if (g_cfg->gea_encryption_mask >> i & 1)
+ vty_out(vty, " %u", i);
+
+ vty_out(vty, "%s", VTY_NEWLINE);
+ }
+ if (g_cfg->uea_encryption_mask != 0) {
+ vty_out(vty, " encryption uea");
+
+ for (i = 0; i < _OSMO_UTRAN_UEA_NUM; i++)
+ if (g_cfg->uea_encryption_mask >> i & 1)
+ vty_out(vty, " %u", i);
+
+ vty_out(vty, "%s", VTY_NEWLINE);
+ }
+ if (g_cfg->crypt_cipher_plugin_path)
+ vty_out(vty, " encryption cipher-plugin-path %s%s", g_cfg->crypt_cipher_plugin_path, VTY_NEWLINE);
if (g_cfg->sgsn_ipa_name)
vty_out(vty, " gsup ipa-name %s%s", g_cfg->sgsn_ipa_name, VTY_NEWLINE);
if (g_cfg->gsup_server_addr.sin_addr.s_addr)
@@ -243,9 +321,9 @@ static int config_write_sgsn(struct vty *vty)
llist_for_each_entry(acl, &g_cfg->imsi_acl, list)
vty_out(vty, " imsi-acl add %s%s", acl->imsi, VTY_NEWLINE);
- if (llist_empty(&sgsn_apn_ctxts))
+ if (llist_empty(&sgsn->apn_list))
vty_out(vty, " ! apn * ggsn 0%s", VTY_NEWLINE);
- llist_for_each_entry(actx, &sgsn_apn_ctxts, list) {
+ llist_for_each_entry(actx, &sgsn->apn_list, list) {
if (strlen(actx->imsi_prefix) > 0)
vty_out(vty, " apn %s imsi-prefix %s ggsn %u%s",
actx->name, actx->imsi_prefix, actx->ggsn->id,
@@ -266,6 +344,7 @@ static int config_write_sgsn(struct vty *vty)
vty_out(vty, " cdr interval %d%s", g_cfg->cdr.interval, VTY_NEWLINE);
osmo_tdef_vty_write(vty, g_cfg->T_defs, " timer ");
+ osmo_tdef_vty_write(vty, g_cfg->T_defs_gtp, " timer gtp ");
if (g_cfg->pcomp_rfc1144.active) {
vty_out(vty, " compression rfc1144 active slots %d%s",
@@ -295,6 +374,10 @@ static int config_write_sgsn(struct vty *vty)
} else
vty_out(vty, " no compression v42bis%s", VTY_NEWLINE);
+ llist_for_each_entry(mme, &sgsn->mme_list, list) {
+ config_write_mme(vty, mme, " ");
+ }
+
#ifdef BUILD_IU
vty_out(vty, " cs7-instance-iu %u%s", g_cfg->iu.cs7_instance,
VTY_NEWLINE);
@@ -315,6 +398,17 @@ DEFUN(cfg_sgsn, cfg_sgsn_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_sgsn_state_dir, cfg_sgsn_state_dir_cmd,
+ "gtp state-dir PATH",
+ "GTP Parameters\n"
+ "Set the directory for the GTP State file\n"
+ "Local Directory\n")
+{
+ osmo_talloc_replace_string(sgsn, &sgsn->cfg.gtp_statedir, argv[0]);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_sgsn_bind_addr, cfg_sgsn_bind_addr_cmd,
"gtp local-ip A.B.C.D",
"GTP Parameters\n"
@@ -338,7 +432,7 @@ DEFUN(cfg_ggsn_remote_ip, cfg_ggsn_remote_ip_cmd,
"IPv4 Address\n")
{
uint32_t id = atoi(argv[0]);
- struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);
+ struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(sgsn, id);
inet_aton(argv[1], &ggc->remote_addr);
@@ -363,7 +457,7 @@ DEFUN(cfg_ggsn_gtp_version, cfg_ggsn_gtp_version_cmd,
"Version 0\n" "Version 1\n")
{
uint32_t id = atoi(argv[0]);
- struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);
+ struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(sgsn, id);
if (atoi(argv[1]))
ggc->gtp_version = 1;
@@ -381,7 +475,7 @@ DEFUN(cfg_ggsn_echo_interval, cfg_ggsn_echo_interval_cmd,
"Interval between echo requests in seconds.\n")
{
uint32_t id = atoi(argv[0]);
- struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);
+ struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(sgsn, id);
ggc->echo_interval = atoi(argv[1]);
@@ -400,7 +494,7 @@ DEFUN(cfg_ggsn_no_echo_interval, cfg_ggsn_no_echo_interval_cmd,
NO_STR "Send an echo request to this static GGSN every interval.\n")
{
uint32_t id = atoi(argv[0]);
- struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id);
+ struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(sgsn, id);
ggc->echo_interval = 0;
sgsn_ggsn_ctx_check_echo_timer(ggc);
@@ -441,7 +535,7 @@ static int add_apn_ggsn_mapping(struct vty *vty, const char *apn_str,
struct apn_ctx *actx;
struct sgsn_ggsn_ctx *ggsn;
- ggsn = sgsn_ggsn_ctx_by_id(ggsn_id);
+ ggsn = sgsn_ggsn_ctx_by_id(sgsn, ggsn_id);
if (ggsn == NULL) {
vty_out(vty, "%% a GGSN with id %d has not been defined%s",
ggsn_id, VTY_NEWLINE);
@@ -505,8 +599,13 @@ static void vty_dump_pdp(struct vty *vty, const char *pfx,
osmo_apn_to_str(apnbuf, pdp->lib->apn_use.v, pdp->lib->apn_use.l),
VTY_NEWLINE);
vty_out(vty, "%s PDP Address: %s%s", pfx,
- gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l),
+ gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l, false),
VTY_NEWLINE);
+ if (pdp->lib->eua.v[1] == PDP_TYPE_N_IETF_IPv4v6) {
+ vty_out(vty, "%s PDP Address: %s%s", pfx,
+ gprs_pdpaddr2str(pdp->lib->eua.v, pdp->lib->eua.l, true),
+ VTY_NEWLINE);
+ }
vty_out(vty, "%s GTPv%d Local Control(%s / TEIC: 0x%08x) ", pfx, pdp->lib->version,
sgsn_gtp_ntoa(&pdp->lib->gsnlc), pdp->lib->teic_own);
vty_out(vty, "Data(%s / TEID: 0x%08x)%s",
@@ -614,7 +713,7 @@ DEFUN(swow_mmctx_imsi, show_mmctx_imsi_cmd,
argv[0], VTY_NEWLINE);
return CMD_WARNING;
}
- vty_dump_mmctx(vty, "", mm, argv[1] ? 1 : 0);
+ vty_dump_mmctx(vty, "", mm, (argc > 1) ? 1 : 0);
return CMD_SUCCESS;
}
@@ -623,9 +722,8 @@ DEFUN(swow_mmctx_all, show_mmctx_all_cmd,
SHOW_STR MMCTX_STR "All MM Contexts\n" INCLUDE_PDP_STR)
{
struct sgsn_mm_ctx *mm;
-
- llist_for_each_entry(mm, &sgsn_mm_ctxts, list)
- vty_dump_mmctx(vty, "", mm, argv[0] ? 1 : 0);
+ llist_for_each_entry(mm, &sgsn->mm_list, list)
+ vty_dump_mmctx(vty, "", mm, (argc > 0) ? 1 : 0);
return CMD_SUCCESS;
}
@@ -636,7 +734,7 @@ DEFUN(show_pdpctx_all, show_pdpctx_all_cmd,
{
struct sgsn_pdp_ctx *pdp;
- llist_for_each_entry(pdp, &sgsn_pdp_ctxts, g_list)
+ llist_for_each_entry(pdp, &sgsn->pdp_list, g_list)
vty_dump_pdp(vty, "", pdp);
return CMD_SUCCESS;
@@ -682,15 +780,19 @@ DEFUN(imsi_acl, cfg_imsi_acl_cmd,
return CMD_SUCCESS;
}
-DEFUN(cfg_encrypt, cfg_encrypt_cmd,
+DEFUN_DEPRECATED(cfg_encrypt, cfg_encrypt_cmd,
"encryption (GEA0|GEA1|GEA2|GEA3|GEA4)",
"Set encryption algorithm for SGSN\n"
"Use GEA0 (no encryption)\n"
"Use GEA1\nUse GEA2\nUse GEA3\nUse GEA4\n")
{
enum gprs_ciph_algo c = get_string_value(gprs_cipher_names, argv[0]);
+
+ if (strcmp(argv[0], "gea") == 0)
+ return CMD_SUCCESS;
+
if (c != GPRS_ALGO_GEA0) {
- if (!gprs_cipher_supported(c)) {
+ if (gprs_cipher_supported(c) <= 0) {
vty_out(vty, "%% cipher %s is unsupported in current version%s", argv[0], VTY_NEWLINE);
return CMD_WARNING;
}
@@ -702,11 +804,73 @@ DEFUN(cfg_encrypt, cfg_encrypt_cmd,
}
}
- g_cfg->cipher = c;
+ g_cfg->gea_encryption_mask |= (1 << c);
+
+ return CMD_SUCCESS;
+}
+
+#define ENCRYPTION_STR "Set encryption algorithms for SGSN\n"
+
+DEFUN(cfg_encrypt2, cfg_encrypt2_cmd,
+ "encryption gea <0-4> [<0-4>] [<0-4>] [<0-4>] [<0-4>]",
+ ENCRYPTION_STR
+ "GPRS Encryption Algorithm\n"
+ "GEAn Algorithm Number\n"
+ "GEAn Algorithm Number\n"
+ "GEAn Algorithm Number\n"
+ "GEAn Algorithm Number\n"
+ "GEAn Algorithm Number\n")
+{
+ int i = 0;
+
+ g_cfg->gea_encryption_mask = 0;
+ for (i = 0; i < argc; i++)
+ g_cfg->gea_encryption_mask |= (1 << atoi(argv[i]));
+
+ for (i = 0; i < _GPRS_ALGO_NUM; i++) {
+ if (g_cfg->gea_encryption_mask >> i & 1) {
+
+ if (i == GPRS_ALGO_GEA0)
+ continue;
+
+ if (gprs_cipher_supported(i) <= 0) {
+ vty_out(vty, "%% cipher %d is unsupported in current version%s", i, VTY_NEWLINE);
+ return CMD_ERR_INCOMPLETE;
+ }
+
+ if (!g_cfg->require_authentication) {
+ vty_out(vty, "%% unable to use encryption %s without authentication: please adjust auth-policy%s",
+ argv[i], VTY_NEWLINE);
+ return CMD_ERR_INCOMPLETE;
+ }
+
+ }
+ }
return CMD_SUCCESS;
}
+DEFUN(cfg_encrypt_cipher_plugin_path, cfg_encrypt_cipher_plugin_path_cmd,
+ "encryption cipher-plugin-path PATH",
+ ENCRYPTION_STR
+ "Path to gprs encryption cipher plugin directory\n"
+ "Plugin path\n")
+{
+ osmo_talloc_replace_string(sgsn, &sgsn->cfg.crypt_cipher_plugin_path, argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_no_encrypt_cipher_plugin_path, cfg_no_encrypt_cipher_plugin_path_cmd,
+ "no encryption cipher-plugin-path PATH",
+ NO_STR ENCRYPTION_STR
+ "Path to gprs encryption cipher plugin directory\n"
+ "Plugin path\n")
+{
+ TALLOC_FREE(sgsn->cfg.crypt_cipher_plugin_path);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_authentication, cfg_authentication_cmd,
"authentication (optional|required)",
"Whether to enforce MS authentication in GERAN (only with auth-policy remote)\n"
@@ -728,6 +892,23 @@ DEFUN(cfg_authentication, cfg_authentication_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_encryption_uea, cfg_encryption_uea_cmd,
+ "encryption uea <0-2> [<0-2>] [<0-2>]",
+ ENCRYPTION_STR
+ "UTRAN (3G) encryption algorithms to allow: 0 = UEA0 (no encryption), 1 = UEA1, 2 = UEA2.\n"
+ "UEAn Algorithm Number\n"
+ "UEAn Algorithm Number\n"
+ "UEAn Algorithm Number\n")
+{
+ unsigned int i;
+
+ g_cfg->uea_encryption_mask = 0;
+ for (i = 0; i < argc; i++)
+ g_cfg->uea_encryption_mask |= (1 << atoi(argv[i]));
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_auth_policy, cfg_auth_policy_cmd,
"auth-policy (accept-all|closed|acl-only|remote)",
"Configure the Authorization policy of the SGSN. This setting determines which subscribers are"
@@ -809,8 +990,17 @@ static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int
}
llist_for_each_entry(pdp, &gsub->sgsn_data->pdp_list, list) {
- vty_out(vty, " PDP info: Id: %d, Type: 0x%04x, APN: '%s'",
- pdp->context_id, pdp->pdp_type, pdp->apn_str);
+ char ip_str[INET6_ADDRSTRLEN] = { 0 };
+
+ vty_out(vty, " PDP info: Id: %d, Addr(Org: 0x%02x Type: 0x%02x",
+ pdp->context_id, pdp->pdp_type_org, pdp->pdp_type_nr);
+
+ if (pdp->pdp_address[0].u.sa.sa_family != AF_UNSPEC)
+ vty_out(vty, " Addr[0]: %s", osmo_sockaddr_ntop(&pdp->pdp_address[0].u.sa, ip_str));
+ if (pdp->pdp_address[0].u.sa.sa_family != AF_UNSPEC)
+ vty_out(vty, " Addr[1]: %s", osmo_sockaddr_ntop(&pdp->pdp_address[1].u.sa, ip_str));
+
+ vty_out(vty, ") APN: '%s'", pdp->apn_str);
if (pdp->qos_subscribed_len)
vty_out(vty, " QoS: %s", osmo_hexdump(pdp->qos_subscribed, pdp->qos_subscribed_len));
@@ -857,7 +1047,7 @@ DEFUN_HIDDEN(reset_sgsn_state,
struct gprs_subscr *subscr, *tmp_subscr;
struct sgsn_mm_ctx *mm, *tmp_mm;
- llist_for_each_entry_safe(mm, tmp_mm, &sgsn_mm_ctxts, list)
+ llist_for_each_entry_safe(mm, tmp_mm, &sgsn->mm_list, list)
{
gsm0408_gprs_access_cancelled(mm, SGSN_ERROR_CAUSE_NONE);
}
@@ -1007,6 +1197,10 @@ DEFUN(update_subscr_create, update_subscr_create_cmd,
}
subscr = gprs_subscr_get_or_create(imsi);
+ if (!subscr) {
+ vty_out(vty, "Can not create subscriber. Out of memory.%s", imsi);
+ return CMD_WARNING;
+ }
subscr->keep_in_ram = 1;
gprs_subscr_put(subscr);
@@ -1117,6 +1311,25 @@ DEFUN(update_subscr_update_auth_info, update_subscr_update_auth_info_cmd,
return CMD_SUCCESS;
}
+DEFUN(page_subscr, page_subscr_info_cmd,
+ "page imsi IMSI",
+ "Send a PS paging request to subscriber\n"
+ "Use the IMSI to select the subscriber\n"
+ "The IMSI\n")
+{
+ const char *imsi = argv[0];
+ struct sgsn_mm_ctx *mm;
+
+ mm = sgsn_mm_ctx_by_imsi(imsi);
+ if (!mm) {
+ vty_out(vty, "No MM context for IMSI %s%s", imsi, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ sgsn_bssgp_page_ps_ra(mm);
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_gsup_ipa_name,
cfg_gsup_ipa_name_cmd,
"gsup ipa-name NAME",
@@ -1407,13 +1620,165 @@ DEFUN(cfg_sgsn_cs7_instance_iu,
}
#endif
+DEFUN(cfg_sgsn_mme, cfg_sgsn_mme_cmd,
+ "mme NAME",
+ "Configure an MME peer\n"
+ "Name identifying the MME peer\n")
+{
+ struct sgsn_mme_ctx *mme;
+
+ mme = sgsn_mme_ctx_find_alloc(sgsn, argv[0]);
+ if (!mme)
+ return CMD_WARNING;
+
+ vty->node = MME_NODE;
+ vty->index = mme;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_sgsn_no_mme, cfg_sgsn_no_mme_cmd,
+ "no mme NAME",
+ NO_STR "Delete an MME peer configuration\n"
+ "Name identifying the MME peer\n")
+{
+ struct sgsn_mme_ctx *mme;
+
+ mme = sgsn_mme_ctx_by_name(sgsn, argv[0]);
+ if (!mme) {
+ vty_out(vty, "%% MME %s doesn't exist.%s",
+ argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ sgsn_mme_ctx_free(mme);
+
+ return CMD_SUCCESS;
+}
+
+#define GTP_STR "Configure GTP connection\n"
+
+DEFUN(cfg_mme_remote_ip, cfg_mme_remote_ip_cmd,
+ "gtp remote-ip A.B.C.D",
+ GTP_STR "Set Remote GTP IP address\n" IP_STR)
+{
+ struct sgsn_mme_ctx *mme = (struct sgsn_mme_ctx *) vty->index;
+
+ inet_aton(argv[0], &mme->remote_addr);
+
+ return CMD_SUCCESS;
+}
+
+#define RAN_INFO_STR "Configure RAN Information Relay routing\n"
+#define TAI_DOC "MCC\n" "MNC\n" "TAC\n"
+
+DEFUN(cfg_mme_ran_info_relay_tai, cfg_mme_ran_info_relay_tai_cmd,
+ "gtp ran-info-relay <0-999> <0-999> <0-65535>",
+ GTP_STR RAN_INFO_STR TAI_DOC)
+{
+ struct sgsn_mme_ctx *mme = (struct sgsn_mme_ctx *) vty->index;
+ struct sgsn_mme_ctx *mme_tmp;
+ struct osmo_eutran_tai tai;
+
+ const char *mcc = argv[0];
+ const char *mnc = argv[1];
+ const char *tac = argv[2];
+
+ if (osmo_mcc_from_str(mcc, &tai.mcc)) {
+ vty_out(vty, "%% Error decoding MCC: %s%s", mcc, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ if (osmo_mnc_from_str(mnc, &tai.mnc, &tai.mnc_3_digits)) {
+ vty_out(vty, "%% Error decoding MNC: %s%s", mnc, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ tai.tac = atoi(tac);
+
+ if ((mme_tmp = sgsn_mme_ctx_by_route(sgsn, &tai))) {
+ if (mme_tmp != mme) {
+ vty_out(vty, "%% Another MME %s already contains this route%s",
+ mme_tmp->name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ /* else: NO-OP, return */
+ return CMD_SUCCESS;
+ }
+
+ sgsn_mme_ctx_route_add(mme, &tai);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_mme_no_ran_info_relay_tai, cfg_mme_no_ran_info_relay_tai_cmd,
+ "no gtp ran-info-relay <0-999> <0-999> <0-65535>",
+ NO_STR GTP_STR RAN_INFO_STR TAI_DOC)
+{
+ struct sgsn_mme_ctx *mme = (struct sgsn_mme_ctx *) vty->index;
+ struct sgsn_mme_ctx *mme_tmp;
+ struct osmo_eutran_tai tai;
+
+ const char *mcc = argv[0];
+ const char *mnc = argv[1];
+ const char *tac = argv[2];
+
+ if (osmo_mcc_from_str(mcc, &tai.mcc)) {
+ vty_out(vty, "%% Error decoding MCC: %s%s", mcc, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ if (osmo_mnc_from_str(mnc, &tai.mnc, &tai.mnc_3_digits)) {
+ vty_out(vty, "%% Error decoding MNC: %s%s", mnc, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ tai.tac = atoi(tac);
+
+ if ((mme_tmp = sgsn_mme_ctx_by_route(sgsn, &tai))) {
+ if (mme_tmp != mme) {
+ vty_out(vty, "%% Another MME %s contains this route%s",
+ mme_tmp->name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ sgsn_mme_ctx_route_del(mme, &tai);
+ return CMD_SUCCESS;
+ } else {
+ vty_out(vty, "%% This route doesn't exist in current MME %s%s",
+ mme->name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+}
+
+DEFUN(cfg_mme_ran_info_relay_default, cfg_mme_ran_info_relay_default_cmd,
+ "gtp ran-info-relay default",
+ GTP_STR RAN_INFO_STR "Set as default route")
+{
+ struct sgsn_mme_ctx *mme = (struct sgsn_mme_ctx *) vty->index;
+ struct sgsn_mme_ctx *default_mme;
+
+ if (mme->default_route)
+ return CMD_SUCCESS; /* NO-OP */
+
+ if ((default_mme = sgsn_mme_ctx_by_default_route(sgsn))) {
+ vty_out(vty, "%% Another MME %s is already set as default route, "
+ "remove it before setting it here.%s",
+ default_mme->name, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ mme->default_route = true;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_mme_no_ran_info_relay_default, cfg_mme_no_ran_info_relay_default_cmd,
+ "no gtp ran-info-relay default",
+ NO_STR GTP_STR RAN_INFO_STR "Set as default route")
+{
+ struct sgsn_mme_ctx *mme = (struct sgsn_mme_ctx *) vty->index;
+ mme->default_route = false;
+ return CMD_SUCCESS;
+}
+
int sgsn_vty_init(struct sgsn_config *cfg)
{
g_cfg = cfg;
- g_cfg->T_defs = sgsn_T_defs;
- osmo_tdefs_reset(g_cfg->T_defs);
-
install_element_ve(&show_sgsn_cmd);
//install_element_ve(&show_mmctx_tlli_cmd);
install_element_ve(&show_mmctx_imsi_cmd);
@@ -1421,6 +1786,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element_ve(&show_pdpctx_all_cmd);
install_element_ve(&show_subscr_cache_cmd);
install_element_ve(&show_timer_cmd);
+ install_element_ve(&show_timer_gtp_cmd);
install_element(ENABLE_NODE, &update_subscr_insert_auth_triplet_cmd);
install_element(ENABLE_NODE, &update_subscr_create_cmd);
@@ -1428,10 +1794,12 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(ENABLE_NODE, &update_subscr_cancel_cmd);
install_element(ENABLE_NODE, &update_subscr_update_location_result_cmd);
install_element(ENABLE_NODE, &update_subscr_update_auth_info_cmd);
+ install_element(ENABLE_NODE, &page_subscr_info_cmd);
install_element(ENABLE_NODE, &reset_sgsn_state_cmd);
install_element(CONFIG_NODE, &cfg_sgsn_cmd);
install_node(&sgsn_node, config_write_sgsn);
+ install_element(SGSN_NODE, &cfg_sgsn_state_dir_cmd);
install_element(SGSN_NODE, &cfg_sgsn_bind_addr_cmd);
install_element(SGSN_NODE, &cfg_ggsn_remote_ip_cmd);
//install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd);
@@ -1441,7 +1809,14 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_imsi_acl_cmd);
install_element(SGSN_NODE, &cfg_auth_policy_cmd);
install_element(SGSN_NODE, &cfg_authentication_cmd);
+
+ /* order matters here: ensure we attempt to parse our new command first! */
+ install_element(SGSN_NODE, &cfg_encrypt2_cmd);
install_element(SGSN_NODE, &cfg_encrypt_cmd);
+ install_element(SGSN_NODE, &cfg_encryption_uea_cmd);
+ install_element(SGSN_NODE, &cfg_encrypt_cipher_plugin_path_cmd);
+ install_element(SGSN_NODE, &cfg_no_encrypt_cipher_plugin_path_cmd);
+
install_element(SGSN_NODE, &cfg_gsup_ipa_name_cmd);
install_element(SGSN_NODE, &cfg_gsup_remote_ip_cmd);
install_element(SGSN_NODE, &cfg_gsup_remote_port_cmd);
@@ -1461,6 +1836,7 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_grx_ggsn_cmd);
install_element(SGSN_NODE, &cfg_sgsn_timer_cmd);
+ install_element(SGSN_NODE, &cfg_sgsn_timer_gtp_cmd);
install_element(SGSN_NODE, &cfg_no_comp_rfc1144_cmd);
install_element(SGSN_NODE, &cfg_comp_rfc1144_cmd);
@@ -1469,6 +1845,15 @@ int sgsn_vty_init(struct sgsn_config *cfg)
install_element(SGSN_NODE, &cfg_comp_v42bis_cmd);
install_element(SGSN_NODE, &cfg_comp_v42bisp_cmd);
+ install_element(SGSN_NODE, &cfg_sgsn_mme_cmd);
+ install_element(SGSN_NODE, &cfg_sgsn_no_mme_cmd);
+ install_node(&mme_node, NULL);
+ install_element(MME_NODE, &cfg_mme_remote_ip_cmd);
+ install_element(MME_NODE, &cfg_mme_ran_info_relay_default_cmd);
+ install_element(MME_NODE, &cfg_mme_no_ran_info_relay_default_cmd);
+ install_element(MME_NODE, &cfg_mme_ran_info_relay_tai_cmd);
+ install_element(MME_NODE, &cfg_mme_no_ran_info_relay_tai_cmd);
+
#ifdef BUILD_IU
install_element(SGSN_NODE, &cfg_sgsn_cs7_instance_iu_cmd);
ranap_iu_vty_init(SGSN_NODE, &g_cfg->iu.rab_assign_addr_enc);
@@ -1483,6 +1868,9 @@ int sgsn_parse_config(const char *config_file)
/* make sure sgsn_vty_init() was called before this */
OSMO_ASSERT(g_cfg);
+ g_cfg->gea_encryption_mask = 0x1; /* support GEA0 by default unless specific encryption config exists */
+ g_cfg->uea_encryption_mask = (1 << OSMO_UTRAN_UEA0); /* support UEA0 by default unless specific encryption config exists */
+
rc = vty_read_config_file(config_file, NULL);
if (rc < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n", config_file);
diff --git a/src/sgsn/v42bis.c b/src/sgsn/v42bis.c
index 0759cdf1c..ddca5f8c9 100644
--- a/src/sgsn/v42bis.c
+++ b/src/sgsn/v42bis.c
@@ -17,10 +17,6 @@
* 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.
- *
- * You should have received a copy of the GNU Lesser 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.
*/
/* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a23d9317a..2c07ac96e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,5 @@
SUBDIRS = \
gprs \
- gbproxy \
gtphub \
sgsn \
xid \
@@ -33,7 +32,7 @@ EXTRA_DIST = \
$(TESTSUITE) \
vty_test_runner.py \
ctrl_test_runner.py \
- test_nodes.vty \
+ osmo-sgsn_test-nodes.vty \
$(NULL)
TESTSUITE = $(srcdir)/testsuite
@@ -43,38 +42,38 @@ DISTCLEANFILES = \
$(NULL)
if ENABLE_EXT_TESTS
-python-tests: $(BUILT_SOURCES)
+python-tests:
$(MAKE) vty-test
$(MAKE) ctrl-python-test
else
-python-tests: $(BUILT_SOURCES)
+python-tests:
echo "Not running python-based tests (determined at configure-time)"
endif
-vty-python-test: $(BUILT_SOURCES)
+vty-python-test: $(top_builddir)/src/sgsn/osmo-sgsn
osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
$(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v
- rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
+ rm -f $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
# To update the VTY script from current application behavior,
# pass -u to vty_script_runner.py by doing:
# make vty-transcript-test U=-u
-vty-transcript-test:
+vty-transcript-test: $(top_builddir)/src/sgsn/osmo-sgsn
osmo_verify_transcript_vty.py -v \
-n OsmoSGSN -p 4245 \
-r "$(top_builddir)/src/sgsn/osmo-sgsn -c $(top_srcdir)/doc/examples/osmo-sgsn/osmo-sgsn.cfg" \
- $(U) $${T:-$(srcdir)/*.vty}
- rm -f $(builddir)/sms.db $(builddir)/gsn_restart
+ $(U) $${T:-$(srcdir)/osmo-sgsn*.vty}
+ rm -f $(builddir)/gsn_restart
# don't run multiple tests concurrently so that the ports don't conflict
vty-test:
$(MAKE) vty-python-test
$(MAKE) vty-transcript-test
-ctrl-python-test: $(BUILT_SOURCES)
+ctrl-python-test: $(top_builddir)/src/sgsn/osmo-sgsn
$(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
- rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
+ rm -f $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count
check-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
diff --git a/tests/gbproxy/Makefile.am b/tests/gbproxy/Makefile.am
deleted file mode 100644
index b9585acc8..000000000
--- a/tests/gbproxy/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-AM_CPPFLAGS = \
- $(all_includes) \
- -I$(top_srcdir)/include \
- $(NULL)
-
-AM_CFLAGS = \
- -Wall \
- -ggdb3 \
- $(LIBOSMOCORE_CFLAGS) \
- $(LIBOSMOGSM_CFLAGS) \
- $(LIBOSMOABIS_CFLAGS) \
- $(NULL)
-
-AM_LDFLAGS = \
- $(COVERAGE_LDFLAGS) \
- $(NULL)
-
-EXTRA_DIST = \
- gbproxy_test.ok \
- $(NULL)
-
-noinst_PROGRAMS = \
- gbproxy_test \
- $(NULL)
-
-gbproxy_test_SOURCES = \
- gbproxy_test.c \
- $(NULL)
-
-gbproxy_test_LDFLAGS = \
- -Wl,--wrap=osmo_get_rand_id \
- $(NULL)
-
-gbproxy_test_LDADD = \
- $(top_builddir)/src/gbproxy/gb_proxy.o \
- $(top_builddir)/src/gbproxy/gb_proxy_patch.o \
- $(top_builddir)/src/gbproxy/gb_proxy_peer.o \
- $(top_builddir)/src/gbproxy/gb_proxy_tlli.o \
- $(top_builddir)/src/gprs/gprs_gb_parse.o \
- $(top_builddir)/src/gprs/gprs_llc_parse.o \
- $(top_builddir)/src/gprs/crc24.o \
- $(top_builddir)/src/gprs/gprs_utils.o \
- $(LIBOSMOCORE_LIBS) \
- $(LIBOSMOGB_LIBS) \
- $(LIBOSMOGSM_LIBS) \
- $(LIBOSMOVTY_LIBS) \
- $(LIBOSMOABIS_LIBS) \
- $(LIBRARY_DL) \
- $(LIBRARY_DLSYM) \
- -lrt \
- $(NULL)
diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c
deleted file mode 100644
index 6433eb606..000000000
--- a/tests/gbproxy/gbproxy_test.c
+++ /dev/null
@@ -1,5082 +0,0 @@
-/* test routines for gbproxy
- * send NS messages to the gbproxy and dumps what happens
- * (C) 2013 by sysmocom s.f.m.c. GmbH
- * Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
- */
-
-#undef _GNU_SOURCE
-#define _GNU_SOURCE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <string.h>
-#include <getopt.h>
-#include <dlfcn.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <osmocom/core/msgb.h>
-#include <osmocom/core/application.h>
-#include <osmocom/core/utils.h>
-#include <osmocom/core/logging.h>
-#include <osmocom/core/talloc.h>
-#include <osmocom/core/signal.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/gsm/tlv.h>
-#include <osmocom/gsm/gsm_utils.h>
-#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
-#include <osmocom/gprs/gprs_msgb.h>
-#include <osmocom/gprs/gprs_ns.h>
-#include <osmocom/gprs/gprs_bssgp.h>
-
-#include <osmocom/sgsn/gb_proxy.h>
-#include <osmocom/sgsn/gprs_utils.h>
-#include <osmocom/sgsn/gprs_llc.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
-#include <osmocom/sgsn/debug.h>
-
-#define REMOTE_BSS_ADDR 0x01020304
-#define REMOTE_SGSN_ADDR 0x05060708
-
-#define SGSN_NSEI 0x0100
-
-#define REMOTE_SGSN2_ADDR 0x15161718
-#define SGSN2_NSEI 0x0102
-
-#define MATCH_ANY (-1)
-
-void *tall_sgsn_ctx = NULL;
-
-struct gbproxy_config gbcfg = {0};
-
-struct llist_head *received_messages = NULL;
-
-/* override, requires '-Wl,--wrap=osmo_get_rand_id' */
-int __real_osmo_get_rand_id(uint8_t *data, size_t len);
-int mock_osmo_get_rand_id(uint8_t *data, size_t len);
-int (*osmo_get_rand_id_cb)(uint8_t *, size_t) =
- &mock_osmo_get_rand_id;
-
-int __wrap_osmo_get_rand_id(uint8_t *buf, size_t num)
-{
- return (*osmo_get_rand_id_cb)(buf, num);
-}
-
-static int rand_seq_num = 0;
-int mock_osmo_get_rand_id(uint8_t *buf, size_t num)
-{
- uint32_t val;
-
- OSMO_ASSERT(num == sizeof(val));
-
- val = 0x00dead00 + rand_seq_num;
-
- rand_seq_num++;
-
- memcpy(buf, &val, num);
-
- return 1;
-}
-
-static void cleanup_test()
-{
- rand_seq_num = 0;
-}
-
-static int dump_global(FILE *stream, int indent)
-{
- unsigned int i;
- const struct rate_ctr_group_desc *desc;
- int rc;
-
- rc = fprintf(stream, "%*sGbproxy global:\n", indent, "");
- if (rc < 0)
- return rc;
-
- desc = gbcfg.ctrg->desc;
-
- for (i = 0; i < desc->num_ctr; i++) {
- struct rate_ctr *ctr = &gbcfg.ctrg->ctr[i];
- if (ctr->current) {
- rc = fprintf(stream, "%*s %s: %llu\n",
- indent, "",
- desc->ctr_desc[i].description,
- (long long)ctr->current);
-
- if (rc < 0)
- return rc;
- }
- }
-
- return 0;
-}
-
-static int dump_peers(FILE *stream, int indent, time_t now,
- struct gbproxy_config *cfg)
-{
- struct gbproxy_peer *peer;
- struct gprs_ra_id raid;
- unsigned int i;
- const struct rate_ctr_group_desc *desc;
- int rc;
-
- rc = fprintf(stream, "%*sPeers:\n", indent, "");
- if (rc < 0)
- return rc;
-
- llist_for_each_entry(peer, &cfg->bts_peers, list) {
- struct gbproxy_link_info *link_info;
- struct gbproxy_patch_state *state = &peer->patch_state;
- gsm48_parse_ra(&raid, peer->ra);
-
- rc = fprintf(stream, "%*s NSEI %u, BVCI %u, %sblocked, RAI %s\n",
- indent, "",
- peer->nsei, peer->bvci,
- peer->blocked ? "" : "not ",
- osmo_rai_name(&raid));
-
- if (rc < 0)
- return rc;
-
- desc = peer->ctrg->desc;
-
- for (i = 0; i < desc->num_ctr; i++) {
- struct rate_ctr *ctr = &peer->ctrg->ctr[i];
- if (ctr->current) {
- rc = fprintf(stream, "%*s %s: %llu\n",
- indent, "",
- desc->ctr_desc[i].description,
- (long long)ctr->current);
-
- if (rc < 0)
- return rc;
- }
- }
-
- fprintf(stream, "%*s TLLI-Cache: %d\n",
- indent, "", state->logical_link_count);
- llist_for_each_entry(link_info, &state->logical_links, list) {
- struct osmo_mobile_identity mi;
- const char *imsi_str;
- time_t age = now ? now - link_info->timestamp : 0;
- int stored_msgs = 0;
- struct llist_head *iter;
- enum gbproxy_match_id match_id;
- llist_for_each(iter, &link_info->stored_msgs)
- stored_msgs++;
-
- if (link_info->imsi > 0) {
- if (osmo_mobile_identity_decode(&mi, link_info->imsi, link_info->imsi_len, false)
- || mi.type != GSM_MI_TYPE_IMSI)
- imsi_str = "(invalid)";
- else
- imsi_str = mi.imsi;
- } else {
- imsi_str = "(none)";
- }
- fprintf(stream, "%*s TLLI %08x",
- indent, "", link_info->tlli.current);
- if (link_info->tlli.assigned)
- fprintf(stream, "/%08x", link_info->tlli.assigned);
- if (link_info->sgsn_tlli.current) {
- fprintf(stream, " -> %08x",
- link_info->sgsn_tlli.current);
- if (link_info->sgsn_tlli.assigned)
- fprintf(stream, "/%08x",
- link_info->sgsn_tlli.assigned);
- }
- fprintf(stream, ", IMSI %s, AGE %d",
- imsi_str, (int)age);
-
- if (stored_msgs)
- fprintf(stream, ", STORED %d", stored_msgs);
-
- for (match_id = 0; match_id < ARRAY_SIZE(cfg->matches);
- ++match_id) {
- if (cfg->matches[match_id].enable &&
- link_info->is_matching[match_id]) {
- fprintf(stream, ", IMSI matches");
- break;
- }
- }
-
- if (link_info->imsi_acq_pending)
- fprintf(stream, ", IMSI acquisition in progress");
-
- if (cfg->route_to_sgsn2)
- fprintf(stream, ", SGSN NSEI %d",
- link_info->sgsn_nsei);
-
- if (link_info->is_deregistered)
- fprintf(stream, ", DE-REGISTERED");
-
- rc = fprintf(stream, "\n");
- if (rc < 0)
- return rc;
- }
- }
-
- return 0;
-}
-
-const uint8_t *convert_ra(struct gprs_ra_id *raid)
-{
- static struct gsm48_ra_id r;
- gsm48_encode_ra(&r, raid);
- return (const uint8_t *)&r;
-}
-
-/* DTAP - Attach Request */
-static const unsigned char dtap_attach_req[] = {
- 0x08, 0x01, 0x02, 0xf5, 0xe0, 0x21, 0x08, 0x02,
- 0x05, 0xf4, 0xfb, 0xc5, 0x46, 0x79, 0x11, 0x22,
- 0x33, 0x40, 0x50, 0x60, 0x19, 0x18, 0xb3, 0x43,
- 0x2b, 0x25, 0x96, 0x62, 0x00, 0x60, 0x80, 0x9a,
- 0xc2, 0xc6, 0x62, 0x00, 0x60, 0x80, 0xba, 0xc8,
- 0xc6, 0x62, 0x00, 0x60, 0x80, 0x00,
-};
-
-/* DTAP - Attach Request (invalid RAI) */
-static const unsigned char dtap_attach_req2[] = {
- 0x08, 0x01, 0x02, 0xf5, 0xe0, 0x21, 0x08, 0x02,
- 0x05, 0xf4, 0xfb, 0x00, 0xbe, 0xef, 0x99, 0x99,
- 0x99, 0x40, 0x50, 0x60, 0x19, 0x18, 0xb3, 0x43,
- 0x2b, 0x25, 0x96, 0x62, 0x00, 0x60, 0x80, 0x9a,
- 0xc2, 0xc6, 0x62, 0x00, 0x60, 0x80, 0xba, 0xc8,
- 0xc6, 0x62, 0x00, 0x60, 0x80, 0x00,
-};
-
-/* DTAP - Attach Request (P-TMSI 0x3f32b700) */
-static const unsigned char dtap_attach_req3[] = {
- 0x08, 0x01, 0x02, 0xf5, 0xe0, 0x21, 0x08, 0x02,
- 0x05, 0xf4, 0xef, 0xe2, 0xb7, 0x00, 0x11, 0x22,
- 0x33, 0x40, 0x50, 0x60, 0x19, 0x18, 0xb3, 0x43,
- 0x2b, 0x25, 0x96, 0x62, 0x00, 0x60, 0x80, 0x9a,
- 0xc2, 0xc6, 0x62, 0x00, 0x60, 0x80, 0xba, 0xc8,
- 0xc6, 0x62, 0x00, 0x60, 0x80, 0x00,
-};
-
-/* DTAP - Attach Request (IMSI 12131415161718) */
-static const unsigned char dtap_attach_req4[] = {
- 0x08, 0x01, 0x02, 0xf5, 0xe0, 0x21, 0x08, 0x02,
- 0x08, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0xf8, 0x11, 0x22, 0x33, 0x40, 0x50, 0x60, 0x19,
- 0x18, 0xb3, 0x43, 0x2b, 0x25, 0x96, 0x62, 0x00,
- 0x60, 0x80, 0x9a, 0xc2, 0xc6, 0x62, 0x00, 0x60,
- 0x80, 0xba, 0xc8, 0xc6, 0x62, 0x00, 0x60, 0x80,
- 0x00,
-};
-
-/* DTAP - Identity Request */
-static const unsigned char dtap_identity_req[] = {
- 0x08, 0x15, 0x01
-};
-
-/* DTAP - Identity Response */
-static const unsigned char dtap_identity_resp[] = {
- 0x08, 0x16, 0x08, 0x11, 0x12, 0x13, 0x14, 0x15,
- 0x16, 0x17, 0xf8
-};
-
-/* DTAP - Identity Response, IMSI 2 */
-static const unsigned char dtap_identity2_resp[] = {
- 0x08, 0x16, 0x08, 0x11, 0x12, 0x99, 0x99, 0x99,
- 0x16, 0x17, 0xf8
-};
-
-/* DTAP - Identity Response, IMSI 3 */
-static const unsigned char dtap_identity3_resp[] = {
- 0x08, 0x16, 0x08, 0x11, 0x12, 0x99, 0x99, 0x99,
- 0x26, 0x27, 0xf8
-};
-
-/* DTAP - Attach Accept */
-static const unsigned char dtap_attach_acc[] = {
- 0x08, 0x02, 0x01, 0x49, 0x04, 0x21, 0x63, 0x54,
- 0x40, 0x50, 0x60, 0x19, 0xcd, 0xd7, 0x08, 0x17,
- 0x16, 0x18, 0x05, 0xf4, 0xef, 0xe2, 0xb7, 0x00
-};
-
-/* DTAP - Attach Accept, P-TMSI 2 */
-static const unsigned char dtap_attach_acc2[] = {
- 0x08, 0x02, 0x01, 0x49, 0x04, 0x21, 0x63, 0x54,
- 0x40, 0x50, 0x60, 0x19, 0xcd, 0xd7, 0x08, 0x17,
- 0x16, 0x18, 0x05, 0xf4, 0xe0, 0x98, 0x76, 0x54
-};
-
-/* DTAP - Attach Complete */
-static const unsigned char dtap_attach_complete[] = {
- 0x08, 0x03
-};
-
-/* DTAP - Attach Reject (GPRS services not allowed) */
-static const unsigned char dtap_attach_rej7[] = {
- 0x08, 0x04, 0x07
-};
-
-/* DTAP - GMM Information */
-static const unsigned char dtap_gmm_information[] = {
- 0x08, 0x21
-};
-
-/* DTAP - Routing Area Update Request */
-static const unsigned char dtap_ra_upd_req[] = {
- 0x08, 0x08, 0x10, 0x11, 0x22, 0x33, 0x40, 0x50,
- 0x60, 0x1d, 0x19, 0x13, 0x42, 0x33, 0x57, 0x2b,
- 0xf7, 0xc8, 0x48, 0x02, 0x13, 0x48, 0x50, 0xc8,
- 0x48, 0x02, 0x14, 0x48, 0x50, 0xc8, 0x48, 0x02,
- 0x17, 0x49, 0x10, 0xc8, 0x48, 0x02, 0x00, 0x19,
- 0x8b, 0xb2, 0x92, 0x17, 0x16, 0x27, 0x07, 0x04,
- 0x31, 0x02, 0xe5, 0xe0, 0x32, 0x02, 0x20, 0x00
-};
-
-/* DTAP - Routing Area Update Accept */
-static const unsigned char dtap_ra_upd_acc[] = {
- 0x08, 0x09, 0x00, 0x49, 0x21, 0x63, 0x54,
- 0x40, 0x50, 0x60, 0x19, 0x54, 0xab, 0xb3, 0x18,
- 0x05, 0xf4, 0xef, 0xe2, 0xb7, 0x00, 0x17, 0x16,
-};
-
-/* DTAP - Routing Area Update Accept, P-TMSI 2 */
-static const unsigned char dtap_ra_upd_acc2[] = {
- 0x08, 0x09, 0x00, 0x49, 0x21, 0x63, 0x54,
- 0x40, 0x50, 0x60, 0x19, 0x54, 0xab, 0xb3, 0x18,
- 0x05, 0xf4, 0xe0, 0x98, 0x76, 0x54, 0x17, 0x16,
-};
-
-/* DTAP - Routing Area Update Accept, P-TMSI 3 */
-static const unsigned char dtap_ra_upd_acc3[] = {
- 0x08, 0x09, 0x00, 0x49, 0x21, 0x63, 0x54,
- 0x40, 0x50, 0x60, 0x19, 0x54, 0xab, 0xb3, 0x18,
- 0x05, 0xf4, 0xe0, 0x54, 0x32, 0x10, 0x17, 0x16,
-};
-
-/* DTAP - Routing Area Update Complete */
-static const unsigned char dtap_ra_upd_complete[] = {
- 0x08, 0x0a
-};
-
-/* DTAP - Routing Area Update Reject */
-/* cause = 10 ("Implicitly detached"), force_standby = 0 */
-static const unsigned char dtap_ra_upd_rej[] = {
- 0x08, 0x0b, 0x0a, 0x00,
-};
-
-/* DTAP - Activate PDP Context Request */
-static const unsigned char dtap_act_pdp_ctx_req[] = {
- 0x0a, 0x41, 0x05, 0x03, 0x0c, 0x00,
- 0x00, 0x1f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x02, 0x01, 0x21, 0x28, 0x03,
- 0x02, 0x61, 0x62, 0x27, 0x14, 0x80, 0x80, 0x21,
- 0x10, 0x01, 0x00, 0x00, 0x10, 0x81, 0x06, 0x00,
- 0x00, 0x00, 0x00, 0x83, 0x06, 0x00, 0x00, 0x00,
- 0x00
-};
-
-/* DTAP - Detach Request (MO) */
-/* normal detach, power_off = 1 */
-static const unsigned char dtap_detach_po_req[] = {
- 0x08, 0x05, 0x09, 0x18, 0x05, 0xf4, 0xef, 0xe2,
- 0xb7, 0x00, 0x19, 0x03, 0xb9, 0x97, 0xcb
-};
-
-/* DTAP - Detach Request (MO) */
-/* normal detach, power_off = 0 */
-static const unsigned char dtap_detach_req[] = {
- 0x08, 0x05, 0x01, 0x18, 0x05, 0xf4, 0xef, 0xe2,
- 0xb7, 0x00, 0x19, 0x03, 0xb9, 0x97, 0xcb
-};
-
-/* DTAP - Detach Accept (MO) */
-static const unsigned char dtap_detach_acc[] = {
- 0x08, 0x06, 0x00
-};
-
-/* DTAP - Detach Request (MT) */
-/* normal detach, reattach required, implicitly detached */
-static const unsigned char dtap_mt_detach_rea_req[] = {
- 0x08, 0x05, 0x01, 0x25, 0x0a
-};
-
-/* DTAP - Detach Request (MT) */
-/* normal detach, reattach not required, implicitly detached */
-static const unsigned char dtap_mt_detach_req[] = {
- 0x08, 0x05, 0x02, 0x25, 0x0a
-};
-
-/* DTAP - Detach Accept (MT) */
-static const unsigned char dtap_mt_detach_acc[] = {
- 0x08, 0x06
-};
-
-/* GPRS-LLC - SAPI: LLGMM, U, XID */
-static const unsigned char llc_u_xid_ul[] = {
- 0x41, 0xfb, 0x01, 0x00, 0x0e, 0x00, 0x64, 0x11,
- 0x05, 0x16, 0x01, 0x90, 0x66, 0xb3, 0x28
-};
-
-/* GPRS-LLC - SAPI: LLGMM, U, XID */
-static const unsigned char llc_u_xid_dl[] = {
- 0x41, 0xfb, 0x30, 0x84, 0x10, 0x61, 0xb6, 0x64,
- 0xe4, 0xa9, 0x1a, 0x9e
-};
-
-/* GPRS-LLC - SAPI: LL11, UI, NSAPI 5, DNS query */
-static const unsigned char llc_ui_ll11_dns_query_ul[] = {
- 0x0b, 0xc0, 0x01, 0x65, 0x00, 0x00, 0x00, 0x45,
- 0x00, 0x00, 0x38, 0x95, 0x72, 0x00, 0x00, 0x45,
- 0x11, 0x20, 0x85, 0x0a, 0xc0, 0x07, 0xe4, 0xac,
- 0x10, 0x01, 0x0a, 0xad, 0xab, 0x00, 0x35, 0x00,
- 0x24, 0x0e, 0x1c, 0x3b, 0xe0, 0x01, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x6d, 0x05, 0x68, 0x65, 0x69, 0x73, 0x65, 0x02,
- 0x64, 0x65, 0x00, 0x00, 0x01, 0x00, 0x01, 0x47,
- 0x8f, 0x07
-};
-
-/* GPRS-LLC - SAPI: LL11, UI, NSAPI 5, DNS query */
-static const unsigned char llc_ui_ll11_dns_resp_dl[] = {
- 0x4b, 0xc0, 0x01, 0x65, 0x00, 0x00, 0x00, 0x45,
- 0x00, 0x00, 0xc6, 0x00, 0x00, 0x40, 0x00, 0x3e,
- 0x11, 0x7c, 0x69, 0xac, 0x10, 0x01, 0x0a, 0x0a,
- 0xc0, 0x07, 0xe4, 0x00, 0x35, 0xad, 0xab, 0x00,
- 0xb2, 0x74, 0x4e, 0x3b, 0xe0, 0x81, 0x80, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x01,
- 0x6d, 0x05, 0x68, 0x65, 0x69, 0x73, 0x65, 0x02,
- 0x64, 0x65, 0x00, 0x00, 0x01, 0x00, 0x01, 0xc0,
- 0x0c, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x0e,
- 0x10, 0x00, 0x04, 0xc1, 0x63, 0x90, 0x58, 0xc0,
- 0x0e, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x0e,
- 0x10, 0x00, 0x16, 0x03, 0x6e, 0x73, 0x32, 0x0c,
- 0x70, 0x6f, 0x70, 0x2d, 0x68, 0x61, 0x6e, 0x6e,
- 0x6f, 0x76, 0x65, 0x72, 0x03, 0x6e, 0x65, 0x74,
- 0x00, 0xc0, 0x0e, 0x00, 0x02, 0x00, 0x01, 0x00,
- 0x00, 0x0e, 0x10, 0x00, 0x10, 0x02, 0x6e, 0x73,
- 0x01, 0x73, 0x08, 0x70, 0x6c, 0x75, 0x73, 0x6c,
- 0x69, 0x6e, 0x65, 0xc0, 0x14, 0xc0, 0x0e, 0x00,
- 0x02, 0x00, 0x01, 0x00, 0x00, 0x0e, 0x10, 0x00,
- 0x05, 0x02, 0x6e, 0x73, 0xc0, 0x0e, 0xc0, 0x0e,
- 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x0e, 0x10,
- 0x00, 0x05, 0x02, 0x6e, 0x73, 0xc0, 0x5f, 0xc0,
- 0x0e, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x0e,
- 0x10, 0x00, 0x12, 0x02, 0x6e, 0x73, 0x0c, 0x70,
- 0x6f, 0x70, 0x2d, 0x68, 0x61, 0x6e, 0x6e, 0x6f,
- 0x76, 0x65, 0x72, 0xc0, 0x14, 0xaa, 0xdf, 0x31
-};
-
-static int gprs_process_message(struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *peer, const unsigned char* data,
- size_t data_len);
-
-static void send_ns_reset(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr,
- enum ns_cause cause, uint16_t nsvci, uint16_t nsei)
-{
- /* GPRS Network Service, PDU type: NS_RESET,
- */
- unsigned char msg[12] = {
- 0x02, 0x00, 0x81, 0x01, 0x01, 0x82, 0x11, 0x22,
- 0x04, 0x82, 0x11, 0x22
- };
-
- msg[3] = cause;
- msg[6] = nsvci / 256;
- msg[7] = nsvci % 256;
- msg[10] = nsei / 256;
- msg[11] = nsei % 256;
-
- gprs_process_message(nsi, "RESET", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_reset_ack(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr,
- uint16_t nsvci, uint16_t nsei)
-{
- /* GPRS Network Service, PDU type: NS_RESET_ACK,
- */
- unsigned char msg[9] = {
- 0x03, 0x01, 0x82, 0x11, 0x22,
- 0x04, 0x82, 0x11, 0x22
- };
-
- msg[3] = nsvci / 256;
- msg[4] = nsvci % 256;
- msg[7] = nsei / 256;
- msg[8] = nsei % 256;
-
- gprs_process_message(nsi, "RESET_ACK", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_alive(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr)
-{
- /* GPRS Network Service, PDU type: NS_ALIVE */
- unsigned char msg[1] = {
- 0x0a
- };
-
- gprs_process_message(nsi, "ALIVE", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_alive_ack(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr)
-{
- /* GPRS Network Service, PDU type: NS_ALIVE_ACK */
- unsigned char msg[1] = {
- 0x0b
- };
-
- gprs_process_message(nsi, "ALIVE_ACK", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_unblock(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr)
-{
- /* GPRS Network Service, PDU type: NS_UNBLOCK */
- unsigned char msg[1] = {
- 0x06
- };
-
- gprs_process_message(nsi, "UNBLOCK", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_unblock_ack(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr)
-{
- /* GPRS Network Service, PDU type: NS_UNBLOCK_ACK */
- unsigned char msg[1] = {
- 0x07
- };
-
- gprs_process_message(nsi, "UNBLOCK_ACK", src_addr, msg, sizeof(msg));
-}
-
-static void send_ns_unitdata(struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *src_addr, uint16_t nsbvci,
- const unsigned char *bssgp_msg, size_t bssgp_msg_size)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA */
- unsigned char msg[4096] = {
- 0x00, 0x00, 0x00, 0x00
- };
-
- OSMO_ASSERT(bssgp_msg_size <= sizeof(msg) - 4);
-
- msg[2] = nsbvci / 256;
- msg[3] = nsbvci % 256;
- memcpy(msg + 4, bssgp_msg, bssgp_msg_size);
-
- gprs_process_message(nsi, text ? text : "UNITDATA", src_addr, msg, bssgp_msg_size + 4);
-}
-
-static void send_bssgp_ul_unitdata(
- struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *src_addr, uint16_t nsbvci, uint32_t tlli,
- struct gprs_ra_id *raid, uint16_t cell_id,
- const uint8_t *llc_msg, size_t llc_msg_size)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA */
- /* Base Station Subsystem GPRS Protocol: UL_UNITDATA */
- unsigned char msg[4096] = {
- 0x01, /* TLLI */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x08, 0x88, /* RAI */ 0x11, 0x22, 0x33, 0x40, 0x50, 0x60,
- /* CELL ID */ 0x00, 0x00, 0x00, 0x80, 0x0e, /* LLC LEN */ 0x00, 0x00,
- };
-
- size_t bssgp_msg_size = 23 + llc_msg_size;
-
- OSMO_ASSERT(bssgp_msg_size <= sizeof(msg));
-
- gsm48_encode_ra((struct gsm48_ra_id *)(msg + 10), raid);
- msg[1] = (uint8_t)(tlli >> 24);
- msg[2] = (uint8_t)(tlli >> 16);
- msg[3] = (uint8_t)(tlli >> 8);
- msg[4] = (uint8_t)(tlli >> 0);
- msg[16] = cell_id / 256;
- msg[17] = cell_id % 256;
- msg[21] = llc_msg_size / 256;
- msg[22] = llc_msg_size % 256;
- memcpy(msg + 23, llc_msg, llc_msg_size);
-
- send_ns_unitdata(nsi, text ? text : "BSSGP UL UNITDATA",
- src_addr, nsbvci, msg, bssgp_msg_size);
-}
-
-static void send_bssgp_dl_unitdata(
- struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *src_addr, uint16_t nsbvci, uint32_t tlli,
- int with_racap_drx, const uint8_t *imsi, size_t imsi_size,
- const uint8_t *llc_msg, size_t llc_msg_size)
-{
- /* Base Station Subsystem GPRS Protocol: DL_UNITDATA */
- unsigned char msg[4096] = {
- 0x00, /* TLLI */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x20,
- 0x16, 0x82, 0x02, 0x58,
- };
- unsigned char racap_drx[] = {
- 0x13, 0x99, 0x18, 0xb3, 0x43, 0x2b, 0x25, 0x96,
- 0x62, 0x00, 0x60, 0x80, 0x9a, 0xc2, 0xc6, 0x62,
- 0x00, 0x60, 0x80, 0xba, 0xc8, 0xc6, 0x62, 0x00,
- 0x60, 0x80, 0x00, 0x0a, 0x82, 0x08, 0x02
- };
-
- size_t bssgp_msg_size = 0;
-
- OSMO_ASSERT(51 + imsi_size + llc_msg_size <= sizeof(msg));
-
- msg[1] = (uint8_t)(tlli >> 24);
- msg[2] = (uint8_t)(tlli >> 16);
- msg[3] = (uint8_t)(tlli >> 8);
- msg[4] = (uint8_t)(tlli >> 0);
-
- bssgp_msg_size = 12;
-
- if (with_racap_drx) {
- memcpy(msg + bssgp_msg_size, racap_drx, sizeof(racap_drx));
- bssgp_msg_size += sizeof(racap_drx);
- }
-
- if (imsi) {
- OSMO_ASSERT(imsi_size <= 127);
- msg[bssgp_msg_size] = BSSGP_IE_IMSI;
- msg[bssgp_msg_size + 1] = 0x80 | imsi_size;
- memcpy(msg + bssgp_msg_size + 2, imsi, imsi_size);
- bssgp_msg_size += 2 + imsi_size;
- }
-
- if ((bssgp_msg_size % 4) != 0) {
- size_t abytes = (4 - (bssgp_msg_size + 2) % 4) % 4;
- msg[bssgp_msg_size] = BSSGP_IE_ALIGNMENT;
- msg[bssgp_msg_size + 1] = 0x80 | abytes;
- memset(msg + bssgp_msg_size + 2, 0, abytes);
- bssgp_msg_size += 2 + abytes;
- }
-
- msg[bssgp_msg_size] = BSSGP_IE_LLC_PDU;
- if (llc_msg_size < 128) {
- msg[bssgp_msg_size + 1] = 0x80 | llc_msg_size;
- bssgp_msg_size += 2;
- } else {
- msg[bssgp_msg_size + 1] = llc_msg_size / 256;
- msg[bssgp_msg_size + 2] = llc_msg_size % 256;
- bssgp_msg_size += 3;
- }
- memcpy(msg + bssgp_msg_size, llc_msg, llc_msg_size);
- bssgp_msg_size += llc_msg_size;
-
-
- send_ns_unitdata(nsi, text ? text : "BSSGP DL UNITDATA",
- src_addr, nsbvci, msg, bssgp_msg_size);
-}
-
-static void send_bssgp_reset(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr,
- uint16_t bvci)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA, BVCI 0
- * BSSGP RESET */
- unsigned char msg[18] = {
- 0x22, 0x04, 0x82, 0x4a,
- 0x2e, 0x07, 0x81, 0x08, 0x08, 0x88, 0x11, 0x22,
- 0x33, 0x40, 0x50, 0x60, 0x10, 0x00
- };
-
- msg[3] = bvci / 256;
- msg[4] = bvci % 256;
-
- send_ns_unitdata(nsi, "BVC_RESET", src_addr, 0, msg, sizeof(msg));
-}
-
-static void send_bssgp_reset_ack(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr, uint16_t bvci)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA, BVCI 0
- * BSSGP RESET_ACK */
- static unsigned char msg[5] = {
- 0x23, 0x04, 0x82, 0x00,
- 0x00
- };
-
- msg[3] = bvci / 256;
- msg[4] = bvci % 256;
-
- send_ns_unitdata(nsi, "BVC_RESET_ACK", src_addr, 0, msg, sizeof(msg));
-}
-
-static void send_bssgp_suspend(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- uint32_t tlli,
- struct gprs_ra_id *raid)
-{
- /* Base Station Subsystem GPRS Protocol, BSSGP SUSPEND */
- unsigned char msg[15] = {
- 0x0b, 0x1f, 0x84, /* TLLI */ 0xff, 0xff, 0xff, 0xff, 0x1b,
- 0x86, /* RAI */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
- };
-
- msg[3] = (uint8_t)(tlli >> 24);
- msg[4] = (uint8_t)(tlli >> 16);
- msg[5] = (uint8_t)(tlli >> 8);
- msg[6] = (uint8_t)(tlli >> 0);
-
- gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid);
-
- send_ns_unitdata(nsi, "BVC_SUSPEND", src_addr, 0, msg, sizeof(msg));
-}
-
-static void send_bssgp_suspend_ack(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- uint32_t tlli,
- struct gprs_ra_id *raid)
-{
- /* Base Station Subsystem GPRS Protocol, BSSGP SUSPEND ACK */
- unsigned char msg[18] = {
- 0x0c, 0x1f, 0x84, /* TLLI */ 0xff, 0xff, 0xff, 0xff, 0x1b,
- 0x86, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1d,
- 0x81, 0x01
- };
-
- msg[3] = (uint8_t)(tlli >> 24);
- msg[4] = (uint8_t)(tlli >> 16);
- msg[5] = (uint8_t)(tlli >> 8);
- msg[6] = (uint8_t)(tlli >> 0);
-
- gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid);
-
- send_ns_unitdata(nsi, "BVC_SUSPEND_ACK", src_addr, 0, msg, sizeof(msg));
-}
-
-static void send_bssgp_llc_discarded(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- uint16_t bvci, uint32_t tlli,
- unsigned n_frames, unsigned n_octets)
-{
- /* Base Station Subsystem GPRS Protocol: LLC-DISCARDED (0x2c) */
- unsigned char msg[] = {
- 0x2c, 0x1f, 0x84, /* TLLI */ 0xff, 0xff, 0xff, 0xff, 0x0f,
- 0x81, /* n frames */ 0xff, 0x04, 0x82, /* BVCI */ 0xff, 0xff, 0x25, 0x83,
- /* n octets */ 0xff, 0xff, 0xff
- };
-
- msg[3] = (uint8_t)(tlli >> 24);
- msg[4] = (uint8_t)(tlli >> 16);
- msg[5] = (uint8_t)(tlli >> 8);
- msg[6] = (uint8_t)(tlli >> 0);
- msg[9] = (uint8_t)(n_frames);
- msg[12] = (uint8_t)(bvci >> 8);
- msg[13] = (uint8_t)(bvci >> 0);
- msg[16] = (uint8_t)(n_octets >> 16);
- msg[17] = (uint8_t)(n_octets >> 8);
- msg[18] = (uint8_t)(n_octets >> 0);
-
- send_ns_unitdata(nsi, "LLC_DISCARDED", src_addr, 0, msg, sizeof(msg));
-}
-
-static void send_bssgp_paging(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- const uint8_t *imsi, size_t imsi_size,
- struct gprs_ra_id *raid, uint32_t ptmsi)
-{
- /* Base Station Subsystem GPRS Protocol, BSSGP SUSPEND */
- unsigned char msg[100] = {
- 0x06,
- };
-
- const unsigned char drx_ie[] = {0x0a, 0x82, 0x07, 0x04};
- const unsigned char qos_ie[] = {0x18, 0x83, 0x00, 0x00, 0x00};
-
- size_t bssgp_msg_size = 1;
-
- if (imsi) {
- OSMO_ASSERT(imsi_size <= 127);
- msg[bssgp_msg_size] = BSSGP_IE_IMSI;
- msg[bssgp_msg_size + 1] = 0x80 | imsi_size;
- memcpy(msg + bssgp_msg_size + 2, imsi, imsi_size);
- bssgp_msg_size += 2 + imsi_size;
- }
-
- memcpy(msg + bssgp_msg_size, drx_ie, sizeof(drx_ie));
- bssgp_msg_size += sizeof(drx_ie);
-
- if (raid) {
- msg[bssgp_msg_size] = BSSGP_IE_ROUTEING_AREA;
- msg[bssgp_msg_size+1] = 0x86;
- gsm48_encode_ra((struct gsm48_ra_id *)(msg + bssgp_msg_size + 2), raid);
- bssgp_msg_size += 8;
- }
-
- memcpy(msg + bssgp_msg_size, qos_ie, sizeof(qos_ie));
- bssgp_msg_size += sizeof(qos_ie);
-
- if (ptmsi != GSM_RESERVED_TMSI) {
- const uint32_t ptmsi_be = htonl(ptmsi);
- msg[bssgp_msg_size] = BSSGP_IE_TMSI;
- msg[bssgp_msg_size+1] = 0x84;
- memcpy(msg + bssgp_msg_size + 2, &ptmsi_be, 4);
- bssgp_msg_size += 6;
- }
-
- send_ns_unitdata(nsi, "PAGING_PS", src_addr, 0, msg, bssgp_msg_size);
-}
-
-static void send_bssgp_flow_control_bvc(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- uint16_t bvci, uint8_t tag)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA,
- * BSSGP FLOW_CONTROL_BVC */
- unsigned char msg[] = {
- 0x26, 0x1e, 0x81, /* Tag */ 0xff, 0x05, 0x82, 0x01, 0xdc,
- 0x03, 0x82, 0x02, 0x76, 0x01, 0x82, 0x00, 0x50,
- 0x1c, 0x82, 0x02, 0x58, 0x06, 0x82, 0x00, 0x03
- };
-
- msg[3] = tag;
-
- send_ns_unitdata(nsi, "FLOW_CONTROL_BVC", src_addr, bvci,
- msg, sizeof(msg));
-}
-
-static void send_bssgp_flow_control_bvc_ack(struct gprs_ns_inst *nsi,
- struct sockaddr_in *src_addr,
- uint16_t bvci, uint8_t tag)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA,
- * BSSGP FLOW_CONTROL_BVC_ACK */
- unsigned char msg[] = {
- 0x27, 0x1e, 0x81, /* Tag */ 0xce
- };
-
- msg[3] = tag;
-
- send_ns_unitdata(nsi, "FLOW_CONTROL_BVC_ACK", src_addr, bvci,
- msg, sizeof(msg));
-}
-
-static void send_llc_ul_ui(
- struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *src_addr, uint16_t nsbvci, uint32_t tlli,
- struct gprs_ra_id *raid, uint16_t cell_id,
- unsigned sapi, unsigned nu,
- const uint8_t *msg, size_t msg_size)
-{
- unsigned char llc_msg[4096] = {
- 0x00, 0xc0, 0x01
- };
-
- size_t llc_msg_size = 3 + msg_size + 3;
- uint8_t e_bit = 0;
- uint8_t pm_bit = 1;
- unsigned fcs;
-
- nu &= 0x01ff;
-
- OSMO_ASSERT(llc_msg_size <= sizeof(llc_msg));
-
- llc_msg[0] = (sapi & 0x0f);
- llc_msg[1] = 0xc0 | (nu >> 6); /* UI frame */
- llc_msg[2] = (nu << 2) | ((e_bit & 1) << 1) | (pm_bit & 1);
-
- memcpy(llc_msg + 3, msg, msg_size);
-
- fcs = gprs_llc_fcs(llc_msg, msg_size + 3);
- llc_msg[3 + msg_size + 0] = (uint8_t)(fcs >> 0);
- llc_msg[3 + msg_size + 1] = (uint8_t)(fcs >> 8);
- llc_msg[3 + msg_size + 2] = (uint8_t)(fcs >> 16);
-
- send_bssgp_ul_unitdata(nsi, text ? text : "LLC UI",
- src_addr, nsbvci, tlli, raid, cell_id,
- llc_msg, llc_msg_size);
-}
-
-static void send_llc_dl_ui(
- struct gprs_ns_inst *nsi, const char *text,
- struct sockaddr_in *src_addr, uint16_t nsbvci, uint32_t tlli,
- int with_racap_drx, const uint8_t *imsi, size_t imsi_size,
- unsigned sapi, unsigned nu,
- const uint8_t *msg, size_t msg_size)
-{
- /* GPRS Network Service, PDU type: NS_UNITDATA */
- /* Base Station Subsystem GPRS Protocol: UL_UNITDATA */
- unsigned char llc_msg[4096] = {
- 0x00, 0x00, 0x01
- };
-
- size_t llc_msg_size = 3 + msg_size + 3;
- uint8_t e_bit = 0;
- uint8_t pm_bit = 1;
- unsigned fcs;
-
- nu &= 0x01ff;
-
- OSMO_ASSERT(llc_msg_size <= sizeof(llc_msg));
-
- llc_msg[0] = 0x40 | (sapi & 0x0f);
- llc_msg[1] = 0xc0 | (nu >> 6); /* UI frame */
- llc_msg[2] = (nu << 2) | ((e_bit & 1) << 1) | (pm_bit & 1);
-
- memcpy(llc_msg + 3, msg, msg_size);
-
- fcs = gprs_llc_fcs(llc_msg, msg_size + 3);
- llc_msg[3 + msg_size + 0] = (uint8_t)(fcs >> 0);
- llc_msg[3 + msg_size + 1] = (uint8_t)(fcs >> 8);
- llc_msg[3 + msg_size + 2] = (uint8_t)(fcs >> 16);
-
- send_bssgp_dl_unitdata(nsi, text ? text : "LLC UI",
- src_addr, nsbvci, tlli,
- with_racap_drx, imsi, imsi_size,
- llc_msg, llc_msg_size);
-}
-
-
-static void setup_ns(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr,
- uint16_t nsvci, uint16_t nsei)
-{
- printf("Setup NS-VC: remote 0x%08x:%d, "
- "NSVCI 0x%04x(%d), NSEI 0x%04x(%d)\n\n",
- ntohl(src_addr->sin_addr.s_addr), ntohs(src_addr->sin_port),
- nsvci, nsvci, nsei, nsei);
-
- send_ns_reset(nsi, src_addr, NS_CAUSE_OM_INTERVENTION, nsvci, nsei);
- send_ns_alive(nsi, src_addr);
- send_ns_unblock(nsi, src_addr);
- send_ns_alive_ack(nsi, src_addr);
-}
-
-static void setup_bssgp(struct gprs_ns_inst *nsi, struct sockaddr_in *src_addr,
- uint16_t bvci)
-{
- printf("Setup BSSGP: remote 0x%08x:%d, "
- "BVCI 0x%04x(%d)\n\n",
- ntohl(src_addr->sin_addr.s_addr), ntohs(src_addr->sin_port),
- bvci, bvci);
-
- send_bssgp_reset(nsi, src_addr, bvci);
-}
-
-static void connect_sgsn(struct gprs_ns_inst *nsi, struct sockaddr_in *sgsn_peer,
- uint32_t sgsn_nsei)
-{
- gprs_ns_nsip_connect(nsi, sgsn_peer, sgsn_nsei, sgsn_nsei+1);
- send_ns_reset_ack(nsi, sgsn_peer, sgsn_nsei+1, sgsn_nsei);
- send_ns_alive_ack(nsi, sgsn_peer);
- send_ns_unblock_ack(nsi, sgsn_peer);
- send_ns_alive(nsi, sgsn_peer);
-}
-
-static void configure_sgsn_peer(struct sockaddr_in *sgsn_peer)
-{
- sgsn_peer->sin_family = AF_INET;
- sgsn_peer->sin_port = htons(32000);
- sgsn_peer->sin_addr.s_addr = htonl(REMOTE_SGSN_ADDR);
-}
-
-static void configure_sgsn2_peer(struct sockaddr_in *sgsn_peer)
-{
- sgsn_peer->sin_family = AF_INET;
- sgsn_peer->sin_port = htons(32001);
- sgsn_peer->sin_addr.s_addr = htonl(REMOTE_SGSN2_ADDR);
-}
-
-static void configure_bss_peers(struct sockaddr_in *bss_peers, size_t size)
-{
- size_t i;
-
- for (i = 0; i < size; ++i) {
- bss_peers[i].sin_family = AF_INET;
- bss_peers[i].sin_port = htons((i + 1) * 1111);
- bss_peers[i].sin_addr.s_addr = htonl(REMOTE_BSS_ADDR);
- }
-}
-
-int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
- struct sockaddr_in *saddr, enum gprs_ns_ll ll);
-
-/* override */
-int gprs_ns_callback(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
- struct msgb *msg, uint16_t bvci)
-{
- printf("CALLBACK, event %d, msg length %zu, bvci 0x%04x\n%s\n\n",
- event, msgb_bssgp_len(msg), bvci,
- osmo_hexdump(msgb_l2(msg), msgb_l2len(msg)));
-
- switch (event) {
- case GPRS_NS_EVT_UNIT_DATA:
- return gbprox_rcvmsg(&gbcfg, msg, nsvc->nsei, bvci, nsvc->nsvci);
- default:
- break;
- }
- return 0;
-}
-
-/* override */
-ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
- const struct sockaddr *dest_addr, socklen_t addrlen)
-{
- typedef ssize_t (*sendto_t)(int, const void *, size_t, int,
- const struct sockaddr *, socklen_t);
- static sendto_t real_sendto = NULL;
- uint32_t dest_host = htonl(((struct sockaddr_in *)dest_addr)->sin_addr.s_addr);
- int dest_port = htons(((struct sockaddr_in *)dest_addr)->sin_port);
-
- if (!real_sendto)
- real_sendto = dlsym(RTLD_NEXT, "sendto");
-
- if (dest_host == REMOTE_BSS_ADDR)
- printf("MESSAGE to BSS at 0x%08x:%d, msg length %zu\n%s\n\n",
- dest_host, dest_port,
- len, osmo_hexdump(buf, len));
- else if (dest_host == REMOTE_SGSN_ADDR)
- printf("MESSAGE to SGSN at 0x%08x:%d, msg length %zu\n%s\n\n",
- dest_host, dest_port,
- len, osmo_hexdump(buf, len));
- else if (dest_host == REMOTE_SGSN2_ADDR)
- printf("MESSAGE to SGSN 2 at 0x%08x:%d, msg length %zu\n%s\n\n",
- dest_host, dest_port,
- len, osmo_hexdump(buf, len));
- else
- return real_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
-
- return len;
-}
-
-/* override */
-int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg)
-{
- typedef int (*gprs_ns_sendmsg_t)(struct gprs_ns_inst *nsi, struct msgb *msg);
- static gprs_ns_sendmsg_t real_gprs_ns_sendmsg = NULL;
- uint16_t bvci = msgb_bvci(msg);
- uint16_t nsei = msgb_nsei(msg);
-
- size_t len = msgb_length(msg);
-
- if (!real_gprs_ns_sendmsg)
- real_gprs_ns_sendmsg = dlsym(RTLD_NEXT, "gprs_ns_sendmsg");
-
- if (nsei == SGSN_NSEI)
- printf("NS UNITDATA MESSAGE to SGSN, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
- bvci, len, __func__);
- else if (nsei == SGSN2_NSEI)
- printf("NS UNITDATA MESSAGE to SGSN 2, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
- bvci, len, __func__);
- else
- printf("NS UNITDATA MESSAGE to BSS, BVCI 0x%04x, "
- "msg length %zu (%s)\n",
- bvci, len, __func__);
-
- if (received_messages) {
- struct msgb *msg_copy;
- msg_copy = bssgp_msgb_copy(msg, "received_messages");
- llist_add_tail(&msg_copy->list, received_messages);
- }
-
- return real_gprs_ns_sendmsg(nsi, msg);
-}
-
-/* Get the next message from the receive FIFO
- *
- * \returns a pointer to the message which will be invalidated at the next call
- * to expect_msg. Returns NULL, if there is no message left.
- */
-static struct msgb *expect_msg(void)
-{
- static struct msgb *msg = NULL;
-
- msgb_free(msg);
- msg = NULL;
-
- if (!received_messages)
- return NULL;
-
- if (llist_empty(received_messages))
- return NULL;
-
- msg = llist_entry(received_messages->next, struct msgb, list);
- llist_del(&msg->list);
-
- return msg;
-}
-
-struct expect_result {
- struct msgb *msg;
- struct gprs_gb_parse_context parse_ctx;
-};
-
-static struct expect_result *expect_bssgp_msg(
- int match_nsei, int match_bvci, int match_pdu_type)
-{
- static struct expect_result result;
- static const struct expect_result empty_result = {0,};
- static struct msgb *msg;
- uint16_t nsei;
- int rc;
-
- memcpy(&result, &empty_result, sizeof(result));
-
- msg = expect_msg();
- if (!msg)
- return NULL;
-
- nsei = msgb_nsei(msg);
-
- if (match_nsei != MATCH_ANY && match_nsei != nsei) {
- fprintf(stderr, "%s: NSEI mismatch (expected %u, got %u)\n",
- __func__, match_nsei, nsei);
- return NULL;
- }
-
- if (match_bvci != MATCH_ANY && match_bvci != msgb_bvci(msg)) {
- fprintf(stderr, "%s: BVCI mismatch (expected %u, got %u)\n",
- __func__, match_bvci, msgb_bvci(msg));
- return NULL;
- }
-
- result.msg = msg;
-
- result.parse_ctx.to_bss = nsei != SGSN_NSEI && nsei != SGSN2_NSEI;
- result.parse_ctx.peer_nsei = nsei;
-
- if (!msgb_bssgph(msg)) {
- fprintf(stderr, "%s: Expected BSSGP\n", __func__);
- return NULL;
- }
-
- rc = gprs_gb_parse_bssgp(msgb_bssgph(msg), msgb_bssgp_len(msg),
- &result.parse_ctx);
-
- if (!rc) {
- fprintf(stderr, "%s: Failed to parse message\n", __func__);
- return NULL;
- }
-
- if (match_pdu_type != MATCH_ANY &&
- match_pdu_type != result.parse_ctx.pdu_type) {
- fprintf(stderr, "%s: PDU type mismatch (expected %u, got %u)\n",
- __func__, match_pdu_type, result.parse_ctx.pdu_type);
- return NULL;
- }
-
- return &result;
-}
-
-static struct expect_result *expect_llc_msg(
- int match_nsei, int match_bvci, int match_sapi, int match_type)
-{
- static struct expect_result *result;
-
- result = expect_bssgp_msg(match_nsei, match_bvci, MATCH_ANY);
- if (!result)
- return NULL;
-
- if (!result->parse_ctx.llc) {
- fprintf(stderr, "%s: Expected LLC message\n", __func__);
- return NULL;
- }
-
- if (match_sapi != MATCH_ANY &&
- match_sapi != result->parse_ctx.llc_hdr_parsed.sapi) {
- fprintf(stderr, "%s: LLC SAPI mismatch (expected %u, got %u)\n",
- __func__, match_sapi, result->parse_ctx.llc_hdr_parsed.sapi);
- return NULL;
- }
-
- if (match_type != MATCH_ANY &&
- match_type != result->parse_ctx.llc_hdr_parsed.cmd) {
- fprintf(stderr,
- "%s: LLC command/type mismatch (expected %u, got %u)\n",
- __func__, match_type, result->parse_ctx.llc_hdr_parsed.cmd);
- return NULL;
- }
-
- return result;
-}
-
-static struct expect_result *expect_gmm_msg(int match_nsei, int match_bvci,
- int match_type)
-{
- static struct expect_result *result;
-
- result = expect_llc_msg(match_nsei, match_bvci, GPRS_SAPI_GMM, GPRS_LLC_UI);
- if (!result)
- return NULL;
-
- if (!result->parse_ctx.g48_hdr) {
- fprintf(stderr, "%s: Expected GSM 04.08 message\n", __func__);
- return NULL;
- }
-
- if (match_type != MATCH_ANY &&
- match_type != result->parse_ctx.g48_hdr->msg_type) {
- fprintf(stderr,
- "%s: GSM 04.08 message type mismatch (expected %u, got %u)\n",
- __func__, match_type, result->parse_ctx.g48_hdr->msg_type);
- return NULL;
- }
-
- return result;
-}
-
-static void dump_rate_ctr_group(FILE *stream, const char *prefix,
- struct rate_ctr_group *ctrg)
-{
- unsigned int i;
-
- for (i = 0; i < ctrg->desc->num_ctr; i++) {
- struct rate_ctr *ctr = &ctrg->ctr[i];
- if (ctr->current && !strchr(ctrg->desc->ctr_desc[i].name, '.'))
- fprintf(stream, " %s%s: %llu%s",
- prefix, ctrg->desc->ctr_desc[i].description,
- (long long)ctr->current,
- "\n");
- };
-}
-
-/* Signal handler for signals from NS layer */
-static int test_signal(unsigned int subsys, unsigned int signal,
- void *handler_data, void *signal_data)
-{
- struct ns_signal_data *nssd = signal_data;
- int rc;
-
- if (subsys != SS_L_NS)
- return 0;
-
- switch (signal) {
- case S_NS_RESET:
- printf("==> got signal NS_RESET, NS-VC 0x%04x/%s\n",
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- break;
-
- case S_NS_ALIVE_EXP:
- printf("==> got signal NS_ALIVE_EXP, NS-VC 0x%04x/%s\n",
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- break;
-
- case S_NS_BLOCK:
- printf("==> got signal NS_BLOCK, NS-VC 0x%04x/%s\n",
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- break;
-
- case S_NS_UNBLOCK:
- printf("==> got signal NS_UNBLOCK, NS-VC 0x%04x/%s\n",
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- break;
-
- case S_NS_REPLACED:
- printf("==> got signal NS_REPLACED: 0x%04x/%s",
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- printf(" -> 0x%04x/%s\n",
- nssd->old_nsvc->nsvci,
- gprs_ns_ll_str(nssd->old_nsvc));
- break;
-
- default:
- printf("==> got signal %d, NS-VC 0x%04x/%s\n", signal,
- nssd->nsvc->nsvci,
- gprs_ns_ll_str(nssd->nsvc));
- break;
- }
- printf("\n");
- rc = gbprox_signal(subsys, signal, handler_data, signal_data);
- return rc;
-}
-
-static int gprs_process_message(struct gprs_ns_inst *nsi, const char *text, struct sockaddr_in *peer, const unsigned char* data, size_t data_len)
-{
- struct msgb *msg;
- int ret;
- if (data_len > NS_ALLOC_SIZE - NS_ALLOC_HEADROOM) {
- fprintf(stderr, "message too long: %zu\n", data_len);
- return -1;
- }
-
- msg = gprs_ns_msgb_alloc();
- OSMO_ASSERT(msg);
- memmove(msg->data, data, data_len);
- msg->l2h = msg->data;
- msgb_put(msg, data_len);
-
- printf("PROCESSING %s from 0x%08x:%d\n%s\n\n",
- text, ntohl(peer->sin_addr.s_addr), ntohs(peer->sin_port),
- osmo_hexdump(data, data_len));
-
- ret = gprs_ns_rcvmsg(nsi, msg, peer, GPRS_NS_LL_UDP);
-
- /* gprs_ns_rcvmsg() in old libosmocore returns "number of bytes
- * transmitted by any response PDU we sent as a result of the
- * received message", while modern libosmocore simply retunrs '0'
- * for any successfully received message. Let's make sure any
- * non-negative responses lead to a reproducible test output
- * with both old and new libosmocore. */
- printf("result (%s) = %d\n\n", text, ret < 0 ? ret : 0);
-
- msgb_free(msg);
-
- return ret;
-}
-
-static void gprs_dump_nsi(struct gprs_ns_inst *nsi)
-{
- struct gprs_nsvc *nsvc;
-
- printf("Current NS-VCIs:\n");
- llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) {
- struct sockaddr_in *peer = &(nsvc->ip.bts_addr);
- printf(" VCI 0x%04x, NSEI 0x%04x, peer 0x%08x:%d%s%s\n",
- nsvc->nsvci, nsvc->nsei,
- ntohl(peer->sin_addr.s_addr), ntohs(peer->sin_port),
- nsvc->state & NSE_S_BLOCKED ? ", blocked" : "",
- nsvc->state & NSE_S_ALIVE ? "" : ", dead"
- );
- dump_rate_ctr_group(stdout, " ", nsvc->ctrg);
- }
- printf("\n");
-}
-
-static void test_gbproxy()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[4] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
- gprs_dump_nsi(nsi);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- printf("--- Initialise BSS 2 ---\n\n");
-
- setup_ns(nsi, &bss_peer[1], 0x2001, 0x2000);
- setup_bssgp(nsi, &bss_peer[1], 0x2002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x2002);
-
- printf("--- Move BSS 1 to new port ---\n\n");
-
- setup_ns(nsi, &bss_peer[2], 0x1001, 0x1000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Move BSS 2 to former BSS 1 port ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x2001, 0x2000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Move BSS 1 to current BSS 2 port ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x2001, 0x2000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Move BSS 2 to new port ---\n\n");
-
- setup_ns(nsi, &bss_peer[3], 0x2001, 0x2000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Move BSS 2 to former BSS 1 port ---\n\n");
-
- setup_ns(nsi, &bss_peer[2], 0x2001, 0x2000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Move BSS 1 to original BSS 1 port ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Reset BSS 1 with a new BVCI ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], 0x1012);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1012);
-
- printf("--- Reset BSS 1 with the old BVCI ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- printf("--- Reset BSS 1 with the old BVCI again ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1012 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from SGSN to BSS 1, BVCI 0x1012 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &sgsn_peer, 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from SGSN to BSS 1, BVCI 0x1002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &sgsn_peer, 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 2 to SGSN, BVCI 0x2002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], 0x2002, (uint8_t *)"", 0);
-
- printf("--- Send message from SGSN to BSS 2, BVCI 0x2002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &sgsn_peer, 0x2002, (uint8_t *)"", 0);
-
- printf("--- Reset BSS 1 with the old BVCI on BSS2's link ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[2], 0x1002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from SGSN to BSS 1, BVCI 0x1002 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &sgsn_peer, 0x1012, (uint8_t *)"", 0);
-
- printf("--- Send message from SGSN to BSS 1, BVCI 0x10ff (invalid) ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &sgsn_peer, 0x10ff, (uint8_t *)"", 0);
-
- /* Find peer */
- OSMO_ASSERT(gbproxy_peer_by_bvci(&gbcfg, 0xeeee) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_bvci(&gbcfg, 0x1000) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_bvci(&gbcfg, 0x1012) != NULL);
- OSMO_ASSERT(gbproxy_peer_by_nsei(&gbcfg, 0xeeee) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_nsei(&gbcfg, 0x1012) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_nsei(&gbcfg, 0x1000) != NULL);
-
-
- /* Cleanup */
- OSMO_ASSERT(gbproxy_cleanup_peers(&gbcfg, 0, 0) == 0);
- OSMO_ASSERT(gbproxy_cleanup_peers(&gbcfg, 0x1000, 0xeeee) == 0);
- OSMO_ASSERT(gbproxy_cleanup_peers(&gbcfg, 0, 0x1002) == 0);
- OSMO_ASSERT(gbproxy_cleanup_peers(&gbcfg, 0x1000, 0x1012) == 1);
- OSMO_ASSERT(gbproxy_cleanup_peers(&gbcfg, 0x1000, 0x1012) == 0);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-}
-
-static void test_gbproxy_ident_changes()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- uint16_t nsei[2] = {0x1000, 0x2000};
- uint16_t nsvci[2] = {0x1001, 0x2001};
- uint16_t bvci[4] = {0x1002, 0x2002, 0x3002, 0x4002};
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
- gprs_dump_nsi(nsi);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], nsvci[0], nsei[0]);
- gprs_dump_nsi(nsi);
-
- printf("--- Setup BVCI 1 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[0]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[0]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Setup BVCI 2 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[1]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[1]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 1 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[0], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[0], (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 2 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[1], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[1], (uint8_t *)"", 0);
-
- printf("--- Change NSEI ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], nsvci[0], nsei[1]);
- gprs_dump_nsi(nsi);
-
- printf("--- Setup BVCI 1 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[0]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[0]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Setup BVCI 3 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[2]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[2]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 1 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[0], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[0], (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 2 "
- " (should fail) ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[1], (uint8_t *)"", 0);
- dump_peers(stdout, 0, 0, &gbcfg);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[1], (uint8_t *)"", 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 3 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[2], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[2], (uint8_t *)"", 0);
-
- printf("--- Change NSVCI ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], nsvci[1], nsei[1]);
- gprs_dump_nsi(nsi);
-
- printf("--- Setup BVCI 1 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[0]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[0]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Setup BVCI 4 ---\n\n");
-
- setup_bssgp(nsi, &bss_peer[0], bvci[3]);
- send_bssgp_reset_ack(nsi, &sgsn_peer, bvci[3]);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 1 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[0], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[0], (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 2 "
- " (should fail) ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[1], (uint8_t *)"", 0);
- dump_peers(stdout, 0, 0, &gbcfg);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[1], (uint8_t *)"", 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 3 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[2], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[2], (uint8_t *)"", 0);
-
- printf("--- Send message from BSS 1 to SGSN and back, BVCI 4 ---\n\n");
-
- send_ns_unitdata(nsi, NULL, &bss_peer[0], bvci[3], (uint8_t *)"", 0);
- send_ns_unitdata(nsi, NULL, &sgsn_peer, bvci[3], (uint8_t *)"", 0);
-
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-}
-
-static void test_gbproxy_ra_patching()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_sgsn =
- {.mcc = 123, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x7530;
- const char *err_msg = NULL;
- const uint32_t ptmsi = 0xefe2b700;
- const uint32_t local_tlli = 0xefe2b700;
- const uint32_t foreign_tlli = 0xbbc54679;
- const uint32_t foreign_tlli2 = 0xbb00beef;
- const uint8_t imsi[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- const char *patch_re = "^9898|^121314";
- struct gbproxy_link_info *link_info;
- struct gbproxy_peer *peer;
- LLIST_HEAD(rcv_list);
- struct expect_result *expect_res;
-
- OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 0;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- if (gbproxy_set_patch_filter(&gbcfg.matches[GBPROX_MATCH_PATCHING],
- patch_re, &err_msg) != 0) {
- fprintf(stderr, "Failed to compile RE '%s': %s\n",
- patch_re, err_msg);
- exit(1);
- }
-
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
- gprs_dump_nsi(nsi);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
-
- received_messages = &rcv_list;
-
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
- gprs_dump_nsi(nsi);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- OSMO_ASSERT(expect_bssgp_msg(SGSN_NSEI, 0, BSSGP_PDUT_BVC_RESET));
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- OSMO_ASSERT(expect_bssgp_msg(0x1000, 0, BSSGP_PDUT_BVC_RESET_ACK));
-
- send_bssgp_suspend(nsi, &bss_peer[0], 0xccd1758b, &rai_bss);
-
- OSMO_ASSERT(expect_bssgp_msg(SGSN_NSEI, 0, BSSGP_PDUT_SUSPEND));
-
- send_bssgp_suspend_ack(nsi, &sgsn_peer, 0xccd1758b, &rai_sgsn);
-
- OSMO_ASSERT(expect_bssgp_msg(0x1000, 0, BSSGP_PDUT_SUSPEND_ACK));
-
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(2 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- OSMO_ASSERT(1 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 0,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(4 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- foreign_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, 0,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ID_RESP));
-
- OSMO_ASSERT(5 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- OSMO_ASSERT(1 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, 1,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- OSMO_ASSERT(2 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- OSMO_ASSERT(gbproxy_peer_by_rai(&gbcfg, convert_ra(&rai_bss)) != NULL);
- OSMO_ASSERT(gbproxy_peer_by_rai(&gbcfg, convert_ra(&rai_sgsn)) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_rai(&gbcfg, convert_ra(&rai_unknown)) == NULL);
-
- OSMO_ASSERT(gbproxy_peer_by_lai(&gbcfg, convert_ra(&rai_bss)) != NULL);
- OSMO_ASSERT(gbproxy_peer_by_lai(&gbcfg, convert_ra(&rai_sgsn)) == NULL);
- OSMO_ASSERT(gbproxy_peer_by_lai(&gbcfg, convert_ra(&rai_unknown)) == NULL);
-
- OSMO_ASSERT(gbproxy_peer_by_lac(&gbcfg, convert_ra(&rai_bss)) != NULL);
- OSMO_ASSERT(gbproxy_peer_by_lac(&gbcfg, convert_ra(&rai_sgsn)) != NULL);
- OSMO_ASSERT(gbproxy_peer_by_lac(&gbcfg, convert_ra(&rai_unknown)) == NULL);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current != local_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current != local_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 4,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- OSMO_ASSERT(6 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current != local_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current != local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- /* Replace APN (1) */
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ (REPLACE APN)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GSM_ACT_PDP_REQ));
-
- OSMO_ASSERT(7 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current != local_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current != local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, 2,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_INFO));
-
- OSMO_ASSERT(2 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->tlli.current == local_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_tlli);
-
- /* Replace APN (2) */
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ (REPLACE APN)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- expect_res = expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GSM_ACT_PDP_REQ);
- OSMO_ASSERT(expect_res != NULL);
- OSMO_ASSERT(expect_res->parse_ctx.apn_ie_len == gbcfg.core_apn_size + 2);
-
- OSMO_ASSERT(8 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- gbcfg.core_apn[0] = 0;
- gbcfg.core_apn_size = 0;
-
- /* Remove APN */
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ (REMOVE APN)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- expect_res = expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GSM_ACT_PDP_REQ);
- OSMO_ASSERT(expect_res != NULL);
- OSMO_ASSERT(expect_res->parse_ctx.apn_ie_len == 0);
-
- OSMO_ASSERT(9 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 6,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- OSMO_ASSERT(10 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
- OSMO_ASSERT(2 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, 5,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- RA update ---\n\n");
-
- send_llc_ul_ui(nsi, "RA UPD REQ", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, 0x7080,
- GPRS_SAPI_GMM, 5,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_RA_UPD_REQ));
-
- OSMO_ASSERT(12 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- send_llc_dl_ui(nsi, "RA UPD ACC", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, 6,
- dtap_ra_upd_acc, sizeof(dtap_ra_upd_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_RA_UPD_ACK));
-
- OSMO_ASSERT(3 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_SGSN].current);
-
- /* Remove APN */
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ (REMOVE APN)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- expect_res = expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GSM_ACT_PDP_REQ);
- OSMO_ASSERT(expect_res != NULL);
- OSMO_ASSERT(expect_res->parse_ctx.apn_ie_len == 0);
-
- OSMO_ASSERT(13 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (power off -> no Detach Accept) */
- send_llc_ul_ui(nsi, "DETACH REQ (PWR OFF)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 6,
- dtap_detach_po_req, sizeof(dtap_detach_po_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- OSMO_ASSERT(14 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Bad cases ---\n\n");
-
- /* The RAI in the Attach Request message differs from the RAI in the
- * BSSGP message, only patch the latter */
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST (foreign RAI)", &bss_peer[0], 0x1002,
- foreign_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 0,
- dtap_attach_req2, sizeof(dtap_attach_req2));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- OSMO_ASSERT(15 == peer->ctrg->ctr[GBPROX_PEER_CTR_RAID_PATCHED_BSS].current);
-
- printf("TLLI is already detached, shouldn't patch\n");
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, 3,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GSM_ACT_PDP_REQ));
-
- printf("Invalid RAI, shouldn't patch\n");
- send_bssgp_suspend_ack(nsi, &sgsn_peer, 0xccd1758b, &rai_unknown);
-
- /* TODO: The following breaks with the current libosmocore, enable it
- * again (and remove the plain expect_msg), when the msgb_bssgph patch
- * is integrated */
- /* OSMO_ASSERT(expect_bssgp_msg(SGSN_NSEI, 0, BSSGP_PDUT_STATUS)); */
- OSMO_ASSERT(expect_msg());
-
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!expect_msg());
- received_messages = NULL;
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbproxy_clear_patch_filter(&gbcfg.matches[GBPROX_MATCH_PATCHING]);
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-}
-
-static void test_gbproxy_ptmsi_assignment()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t ptmsi = 0xefe2b700;
- const uint32_t local_tlli = 0xefe2b700;
-
- const uint32_t foreign_tlli1 = 0x8000dead;
- const uint32_t foreign_tlli2 = 0x8000beef;
-
- const uint8_t imsi1[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- const uint8_t imsi2[] = {0x11, 0x12, 0x99, 0x99, 0x99, 0x16, 0x17, 0xf8};
-
- struct gbproxy_link_info *link_info, *link_info2;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){};
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 0;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Establish first LLC connection ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli1, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- foreign_tlli1, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli1, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli1, 1, imsi1, sizeof(imsi1),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli1);
- link_info2 = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_tlli1);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_tlli1);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi1, sizeof(imsi1),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
- OSMO_ASSERT(!gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2)));
-
- link_info2 = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->tlli.current == local_tlli);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
- printf("--- Establish second LLC connection with the same P-TMSI ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli2, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- foreign_tlli2, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity2_resp, sizeof(dtap_identity2_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli2, 1, imsi2, sizeof(imsi2),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli2);
- link_info2 = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_tlli2);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_tlli2);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi2, sizeof(imsi2),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
- OSMO_ASSERT(!gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1)));
-
- link_info2 = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->tlli.current == local_tlli);
- OSMO_ASSERT(link_info->tlli.ptmsi == ptmsi);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-static void test_gbproxy_ptmsi_patching()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_sgsn =
- {.mcc = 123, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_wrong_mcc_sgsn =
- {.mcc = 999, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t sgsn_ptmsi = 0xefe2b700;
- const uint32_t sgsn_ptmsi2 = 0xe0987654;
- const uint32_t sgsn_ptmsi3 = 0xe0543210;
- const uint32_t local_sgsn_tlli = 0xefe2b700;
- const uint32_t local_sgsn_tlli2 = 0xe0987654;
- const uint32_t local_sgsn_tlli3 = 0xe0543210;
- const uint32_t random_sgsn_tlli = 0x78dead00;
- const uint32_t unknown_sgsn_tlli = 0xeebadbad;
-
- const uint32_t bss_ptmsi = 0xc0dead01;
- const uint32_t bss_ptmsi2 = 0xc0dead02;
- const uint32_t bss_ptmsi3 = 0xc0dead03;
- const uint32_t local_bss_tlli = 0xc0dead01;
- const uint32_t local_bss_tlli2 = 0xc0dead02;
- const uint32_t local_bss_tlli3 = 0xc0dead03;
- const uint32_t foreign_bss_tlli = 0x8000dead;
-
-
- const uint8_t imsi[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- struct gbproxy_link_info *link_info;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
- int old_ctr;
-
- OSMO_ASSERT(local_sgsn_tlli == gprs_tmsi2tlli(sgsn_ptmsi, TLLI_LOCAL));
- OSMO_ASSERT(local_sgsn_tlli2 == gprs_tmsi2tlli(sgsn_ptmsi2, TLLI_LOCAL));
- OSMO_ASSERT(local_sgsn_tlli3 == gprs_tmsi2tlli(sgsn_ptmsi3, TLLI_LOCAL));
- OSMO_ASSERT(local_bss_tlli == gprs_tmsi2tlli(bss_ptmsi, TLLI_LOCAL));
- OSMO_ASSERT(local_bss_tlli2 == gprs_tmsi2tlli(bss_ptmsi2, TLLI_LOCAL));
- OSMO_ASSERT(local_bss_tlli3 == gprs_tmsi2tlli(bss_ptmsi3, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 1;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- send_llc_ul_ui(nsi, "ACT PDP CTX REQ (REPLACE APN)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_act_pdp_ctx_req, sizeof(dtap_act_pdp_ctx_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Non-DTAP */
- send_bssgp_ul_unitdata(nsi, "XID (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_u_xid_ul, sizeof(llc_u_xid_ul));
-
- send_bssgp_dl_unitdata(nsi, "XID (DL)", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- llc_u_xid_dl, sizeof(llc_u_xid_dl));
-
- send_bssgp_ul_unitdata(nsi, "LL11 DNS QUERY (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_ui_ll11_dns_query_ul,
- sizeof(llc_ui_ll11_dns_query_ul));
-
- send_bssgp_dl_unitdata(nsi, "LL11 DNS RESP (DL)", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- llc_ui_ll11_dns_resp_dl,
- sizeof(llc_ui_ll11_dns_resp_dl));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Repeated RA Update Requests */
- send_llc_ul_ui(nsi, "RA UPD REQ (P-TMSI 2)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- send_llc_dl_ui(nsi, "RA UDP ACC (P-TMSI 2)", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_ra_upd_acc2, sizeof(dtap_ra_upd_acc2));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) != NULL);
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli2);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi2);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli2);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi2);
-
- send_llc_ul_ui(nsi, "RA UPD REQ (P-TMSI 3)", &bss_peer[0], 0x1002,
- local_bss_tlli2, &rai_bss, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- send_llc_dl_ui(nsi, "RA UDP ACC (P-TMSI 3)", &sgsn_peer, 0x1002,
- local_sgsn_tlli2, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_ra_upd_acc3, sizeof(dtap_ra_upd_acc3));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI) == NULL);
- OSMO_ASSERT(gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI) != NULL);
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi3);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli3);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi3);
-
- send_llc_ul_ui(nsi, "RA UPD COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli3, &rai_bss, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_complete, sizeof(dtap_ra_upd_complete));
-
- link_info = gbproxy_link_info_by_tlli(peer, local_bss_tlli3);
-
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_sgsn_tlli3, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli3, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli3);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- /* Other messages */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0x1002,
- local_bss_tlli3, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend(nsi, &bss_peer[0], local_bss_tlli3, &rai_bss);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli3, &rai_sgsn);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- old_ctr = peer->ctrg->ctr[GBPROX_PEER_CTR_PTMSI_PATCHED_SGSN].current;
-
- send_bssgp_paging(nsi, &sgsn_peer, imsi, sizeof(imsi), &rai_bss, sgsn_ptmsi3);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(old_ctr + 1 ==
- peer->ctrg->ctr[GBPROX_PEER_CTR_PTMSI_PATCHED_SGSN].current);
-
- /* Bad case: Invalid BVCI */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0xeee1,
- local_bss_tlli3, 1, 12);
- dump_global(stdout, 0);
-
- /* Bad case: Invalid RAI */
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli3, &rai_unknown);
-
- dump_global(stdout, 0);
-
- /* Bad case: Invalid MCC (LAC ok) */
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli3,
- &rai_wrong_mcc_sgsn);
-
- dump_global(stdout, 0);
-
- /* Bad case: Invalid TLLI from SGSN (IMSI unknown) */
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- unknown_sgsn_tlli, 1, NULL, 0,
- GPRS_SAPI_GMM, 2,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- /* Bad case: Invalid TLLI from SGSN (IMSI known) */
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- unknown_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, 3,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- /* Detach */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli3, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_sgsn_tlli3, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-static void test_gbproxy_ptmsi_patching_bad_cases()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t sgsn_ptmsi = 0xefe2b700;
- const uint32_t local_sgsn_tlli = 0xefe2b700;
- const uint32_t random_sgsn_tlli = 0x78dead00;
-
- const uint32_t bss_ptmsi = 0xc0dead01;
- const uint32_t local_bss_tlli = 0xc0dead01;
- const uint32_t foreign_bss_tlli = 0x8000dead;
-
-
- const uint8_t imsi[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- struct gbproxy_link_info *link_info;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- OSMO_ASSERT(local_sgsn_tlli == gprs_tmsi2tlli(sgsn_ptmsi, TLLI_LOCAL));
- OSMO_ASSERT(local_bss_tlli == gprs_tmsi2tlli(bss_ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 1;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT (duplicated)", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- /* Detach */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-
-static void test_gbproxy_imsi_acquisition()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_sgsn =
- {.mcc = 123, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_wrong_mcc_sgsn =
- {.mcc = 999, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t sgsn_ptmsi = 0xefe2b700;
- const uint32_t local_sgsn_tlli = 0xefe2b700;
- const uint32_t random_sgsn_tlli = 0x78dead00;
- const uint32_t random_sgsn_tlli2 = 0x78dead02;
-
- const uint32_t bss_ptmsi = 0xc0dead01;
- const uint32_t local_bss_tlli = 0xc0dead01;
- const uint32_t foreign_bss_tlli = 0x8000dead;
- const uint32_t other_bss_tlli = 0x8000beef;
-
- const uint8_t imsi[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- struct gbproxy_link_info *link_info;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- OSMO_ASSERT(local_sgsn_tlli == gprs_tmsi2tlli(sgsn_ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 1;
- gbcfg.acquire_imsi = 1;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- random_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- /* Non-DTAP */
- send_bssgp_ul_unitdata(nsi, "XID (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_u_xid_ul, sizeof(llc_u_xid_ul));
-
- send_bssgp_dl_unitdata(nsi, "XID (DL)", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- llc_u_xid_dl, sizeof(llc_u_xid_dl));
-
- send_bssgp_ul_unitdata(nsi, "LL11 DNS QUERY (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_ui_ll11_dns_query_ul,
- sizeof(llc_ui_ll11_dns_query_ul));
-
- send_bssgp_dl_unitdata(nsi, "LL11 DNS RESP (DL)", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- llc_ui_ll11_dns_resp_dl,
- sizeof(llc_ui_ll11_dns_resp_dl));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Other messages */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0x1002,
- local_bss_tlli, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_llc_discarded(nsi, &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend(nsi, &bss_peer[0], local_bss_tlli, &rai_bss);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli, &rai_sgsn);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Bad case: Invalid BVCI */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0xeee1,
- local_bss_tlli, 1, 12);
- dump_global(stdout, 0);
-
- /* Bad case: Invalid RAI */
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli, &rai_unknown);
-
- dump_global(stdout, 0);
-
- /* Bad case: Invalid MCC (LAC ok) */
- send_bssgp_suspend_ack(nsi, &sgsn_peer, local_sgsn_tlli,
- &rai_wrong_mcc_sgsn);
-
- dump_global(stdout, 0);
-
- /* Detach */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* RA Update request */
-
- send_llc_ul_ui(nsi, "RA UPD REQ", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "RA UDP ACC", &sgsn_peer, 0x1002,
- random_sgsn_tlli2, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_ra_upd_acc, sizeof(dtap_ra_upd_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach */
-
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_sgsn_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Special case: Repeated Attach Requests */
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Special case: Detach from an unknown TLLI */
-
- send_llc_ul_ui(nsi, "DETACH REQ (unknown TLLI)", &bss_peer[0], 0x1002,
- other_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Special case: Repeated RA Update Requests */
-
- send_llc_ul_ui(nsi, "RA UPD REQ", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- send_llc_ul_ui(nsi, "RA UPD REQ", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-static void test_gbproxy_secondary_sgsn()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer[2]= {{0},};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_sgsn =
- {.mcc = 123, .mnc = 456, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t sgsn_ptmsi = 0xefe2b700;
- const uint32_t local_sgsn_tlli = 0xefe2b700;
- const uint32_t random_sgsn_tlli = 0x78dead00;
-
- const uint32_t bss_ptmsi = 0xc0dead01;
- const uint32_t local_bss_tlli = 0xc0dead01;
- const uint32_t foreign_bss_tlli = 0x8000dead;
-
- const uint32_t sgsn_ptmsi2 = 0xe0987654;
- const uint32_t local_sgsn_tlli2 = 0xe0987654;
- const uint32_t random_sgsn_tlli2 = 0x78dead02;
- const uint32_t bss_ptmsi2 = 0xc0dead03;
- const uint32_t local_bss_tlli2 = 0xc0dead03;
- const uint32_t foreign_bss_tlli2 = 0x8000beef;
-
- const uint32_t random_sgsn_tlli3 = 0x78dead04;
- const uint32_t bss_ptmsi3 = 0xc0dead05;
- const uint32_t local_bss_tlli3 = 0xc0dead05;
- const uint32_t foreign_bss_tlli3 = 0x8000feed;
-
- const uint8_t imsi1[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- const uint8_t imsi2[] = {0x11, 0x12, 0x99, 0x99, 0x99, 0x16, 0x17, 0xf8};
- const uint8_t imsi3[] = {0x11, 0x12, 0x99, 0x99, 0x99, 0x26, 0x27, 0xf8};
- struct gbproxy_link_info *link_info;
- struct gbproxy_link_info *other_info;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- const char *err_msg = NULL;
- const char *filter_re = "999999";
-
- OSMO_ASSERT(local_sgsn_tlli == gprs_tmsi2tlli(sgsn_ptmsi, TLLI_LOCAL));
- OSMO_ASSERT(local_sgsn_tlli2 == gprs_tmsi2tlli(sgsn_ptmsi2, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){ .mcc = 123, .mnc = 456 };
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 1;
- gbcfg.acquire_imsi = 1;
-
- gbcfg.route_to_sgsn2 = 1;
- gbcfg.nsip_sgsn2_nsei = SGSN2_NSEI;
-
- if (gbproxy_set_patch_filter(&gbcfg.matches[GBPROX_MATCH_ROUTING],
- filter_re, &err_msg) != 0) {
- fprintf(stderr, "gbprox_set_patch_filter: got error: %s\n",
- err_msg);
- OSMO_ASSERT(err_msg == NULL);
- }
-
- configure_sgsn_peer(&sgsn_peer[0]);
- configure_sgsn2_peer(&sgsn_peer[1]);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN 1 ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer[0], SGSN_NSEI);
-
- printf("--- Initialise SGSN 2 ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer[1], SGSN2_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x0);
- send_bssgp_reset_ack(nsi, &sgsn_peer[0], 0x0);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
- send_bssgp_reset_ack(nsi, &sgsn_peer[0], 0x1002);
- send_bssgp_reset_ack(nsi, &sgsn_peer[1], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Flow control ---\n\n");
-
- send_bssgp_flow_control_bvc(nsi, &bss_peer[0], 0x1002, 1);
- send_bssgp_flow_control_bvc_ack(nsi, &sgsn_peer[0], 0x1002, 1);
- send_bssgp_flow_control_bvc_ack(nsi, &sgsn_peer[1], 0x1002, 1);
-
- printf("--- Establish GPRS connection (SGSN 1) ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer[0], 0x1002,
- random_sgsn_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer[0], 0x1002,
- random_sgsn_tlli, 1, imsi1, sizeof(imsi1),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer[0], 0x1002,
- local_sgsn_tlli, 1, imsi1, sizeof(imsi1),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- /* Non-DTAP */
- send_bssgp_ul_unitdata(nsi, "XID (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_u_xid_ul, sizeof(llc_u_xid_ul));
-
- send_bssgp_dl_unitdata(nsi, "XID (DL)", &sgsn_peer[0], 0x1002,
- local_sgsn_tlli, 1, imsi1, sizeof(imsi1),
- llc_u_xid_dl, sizeof(llc_u_xid_dl));
-
- send_bssgp_ul_unitdata(nsi, "LL11 DNS QUERY (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- llc_ui_ll11_dns_query_ul,
- sizeof(llc_ui_ll11_dns_query_ul));
-
- send_bssgp_dl_unitdata(nsi, "LL11 DNS RESP (DL)", &sgsn_peer[0], 0x1002,
- local_sgsn_tlli, 1, imsi1, sizeof(imsi1),
- llc_ui_ll11_dns_resp_dl,
- sizeof(llc_ui_ll11_dns_resp_dl));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Other messages */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0x1002,
- local_bss_tlli, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_llc_discarded(nsi, &sgsn_peer[0], 0x1002,
- local_sgsn_tlli, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend(nsi, &bss_peer[0], local_bss_tlli, &rai_bss);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend_ack(nsi, &sgsn_peer[0], local_sgsn_tlli, &rai_sgsn);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Establish GPRS connection (SGSN 2) ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli2, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity2_resp, sizeof(dtap_identity2_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer[1], 0x1002,
- random_sgsn_tlli2, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity2_resp, sizeof(dtap_identity2_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer[1], 0x1002,
- random_sgsn_tlli2, 1, imsi2, sizeof(imsi2),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc2, sizeof(dtap_attach_acc2));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli2, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli2);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli2);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi2);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli2);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli2);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi2);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli2);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli2);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli2);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli2);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli2, 1, imsi2, sizeof(imsi2),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli2, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli2);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli2);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- /* Non-DTAP */
- send_bssgp_ul_unitdata(nsi, "XID (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli2, &rai_bss, cell_id,
- llc_u_xid_ul, sizeof(llc_u_xid_ul));
-
- send_bssgp_dl_unitdata(nsi, "XID (DL)", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli2, 1, imsi2, sizeof(imsi2),
- llc_u_xid_dl, sizeof(llc_u_xid_dl));
-
- send_bssgp_ul_unitdata(nsi, "LL11 DNS QUERY (UL)", &bss_peer[0], 0x1002,
- local_bss_tlli2, &rai_bss, cell_id,
- llc_ui_ll11_dns_query_ul,
- sizeof(llc_ui_ll11_dns_query_ul));
-
- send_bssgp_dl_unitdata(nsi, "LL11 DNS RESP (DL)", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli2, 1, imsi2, sizeof(imsi2),
- llc_ui_ll11_dns_resp_dl,
- sizeof(llc_ui_ll11_dns_resp_dl));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Other messages */
- send_bssgp_llc_discarded(nsi, &bss_peer[0], 0x1002,
- local_bss_tlli2, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_llc_discarded(nsi, &sgsn_peer[1], 0x1002,
- local_sgsn_tlli2, 1, 12);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend(nsi, &bss_peer[0], local_bss_tlli2, &rai_bss);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_bssgp_suspend_ack(nsi, &sgsn_peer[1], local_sgsn_tlli2, &rai_sgsn);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Establish GPRS connection (SGSN 2, P-TMSI collision) ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_bss_tlli3, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli3, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity3_resp, sizeof(dtap_identity3_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer[1], 0x1002,
- random_sgsn_tlli3, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_bss_tlli3, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity3_resp, sizeof(dtap_identity3_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT (P-TMSI 1)", &sgsn_peer[1], 0x1002,
- random_sgsn_tlli3, 1, imsi3, sizeof(imsi3),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN_NSEI));
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, random_sgsn_tlli3, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli3);
- OSMO_ASSERT(!link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->tlli.ptmsi == bss_ptmsi3);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli3);
- OSMO_ASSERT(!link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.ptmsi == sgsn_ptmsi);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_bss_tlli3, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- other_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(other_info);
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info != other_info);
- OSMO_ASSERT(link_info->tlli.assigned == local_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.current == foreign_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.bss_validated);
- OSMO_ASSERT(!link_info->tlli.net_validated);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.current == random_sgsn_tlli3);
- OSMO_ASSERT(link_info->sgsn_tlli.bss_validated);
- OSMO_ASSERT(!link_info->sgsn_tlli.net_validated);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli, 1, imsi3, sizeof(imsi3),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- other_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN_NSEI);
- OSMO_ASSERT(other_info);
- link_info = gbproxy_link_info_by_sgsn_tlli(peer, local_sgsn_tlli, SGSN2_NSEI);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info != other_info);
- OSMO_ASSERT(link_info->tlli.current == local_bss_tlli3);
- OSMO_ASSERT(link_info->tlli.assigned == 0);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_sgsn_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
-
- printf("--- Shutdown GPRS connection (SGSN 1) ---\n\n");
-
- /* Detach */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer[0], 0x1002,
- local_sgsn_tlli, 1, imsi1, sizeof(imsi1),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Shutdown GPRS connection (SGSN 2) ---\n\n");
-
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli2, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli2, 1, imsi2, sizeof(imsi2),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Shutdown GPRS connection (SGSN 2, P-TMSI 1) ---\n\n");
-
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_bss_tlli3, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer[1], 0x1002,
- local_sgsn_tlli, 1, imsi3, sizeof(imsi3),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbproxy_clear_patch_filter(&gbcfg.matches[GBPROX_MATCH_ROUTING]);
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-static void test_gbproxy_keep_info()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t ptmsi = 0xefe2b700;
- const uint32_t local_tlli = 0xefe2b700;
- const uint32_t foreign_tlli = 0xafe2b700;
-
- const uint8_t imsi[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0xf8};
- struct gbproxy_link_info *link_info, *link_info2;
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- LLIST_HEAD(rcv_list);
-
- OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.patch_ptmsi = 0;
- gbcfg.acquire_imsi = 1;
- gbcfg.core_plmn = (struct osmo_plmn_id){};
- gbcfg.core_apn = NULL;
- gbcfg.core_apn_size = 0;
- gbcfg.route_to_sgsn2 = 0;
- gbcfg.nsip_sgsn2_nsei = 0xffff;
- gbcfg.keep_link_infos = GBPROX_KEEP_ALWAYS;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Send message from BSS 1 to SGSN, BVCI 0x1002 ---\n\n");
-
- received_messages = &rcv_list;
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len == 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(link_info->imsi_acq_pending);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len > 0);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(gprs_tlli_type(link_info->sgsn_tlli.current) == TLLI_FOREIGN);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- foreign_tlli, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ID_RESP));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len > 0);
- OSMO_ASSERT(gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi)));
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_INFO));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- /* Detach (MO) */
- send_llc_ul_ui(nsi, "DETACH REQ", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "DETACH ACC", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- OSMO_ASSERT(!expect_msg());
-
- /* Re-Attach */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(gprs_tlli_type(link_info->sgsn_tlli.current) == TLLI_FOREIGN);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ (re-attach)", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_rea_req, sizeof(dtap_mt_detach_rea_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Re-Attach */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Re-Attach with IMSI */
- send_llc_ul_ui(nsi, "ATTACH REQUEST (IMSI)", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req4, sizeof(dtap_attach_req4));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Re-Attach */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* RA update procedure (reject -> Detach) */
- send_llc_ul_ui(nsi, "RA UPD REQ", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, 0x7080,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_ra_upd_req, sizeof(dtap_ra_upd_req));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_RA_UPD_REQ));
-
- send_llc_dl_ui(nsi, "RA UDP REJ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_ra_upd_rej, sizeof(dtap_ra_upd_rej));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_RA_UPD_REJ));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Bad case: Re-Attach with wrong (initial) P-TMSI */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info != link_info2);
- OSMO_ASSERT(link_info->imsi_len == 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(link_info->imsi_acq_pending);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len > 0);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- OSMO_ASSERT(!expect_msg());
-
- /* Bad case: Re-Attach with local TLLI */
- send_llc_ul_ui(nsi, "ATTACH REQUEST (local TLLI)", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(link_info->sgsn_tlli.current == local_tlli);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ (re-attach)", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_rea_req, sizeof(dtap_mt_detach_rea_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Bad case: Unexpected Re-Attach with IMSI after completed attachment
- * procedure */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_INFO));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST (unexpected, IMSI)",
- &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req4, sizeof(dtap_attach_req4));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- /* Bad case: Unexpected Re-Attach with P-TMSI after completed attachment
- * procedure */
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "GMM INFO", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_gmm_information, sizeof(dtap_gmm_information));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_INFO));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST (unexpected)", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req3, sizeof(dtap_attach_req3));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
- OSMO_ASSERT(link_info->sgsn_tlli.current == foreign_tlli);
- OSMO_ASSERT(link_info->sgsn_tlli.assigned == 0);
-
- send_llc_dl_ui(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_acc, sizeof(dtap_attach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "ATTACH COMPLETE", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_complete, sizeof(dtap_attach_complete));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_COMPL));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- /* Detach (MT) */
- send_llc_dl_ui(nsi, "DETACH REQ", &sgsn_peer, 0x1002,
- local_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, local_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- local_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
- OSMO_ASSERT(!expect_msg());
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, local_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
-
- /* Attach rejected */
-
- gbproxy_delete_link_infos(peer);
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len == 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(link_info->imsi_acq_pending);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info2 = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info == link_info2);
- OSMO_ASSERT(link_info->imsi_len != 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(!link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "ATTACH REJECT", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_attach_rej7, sizeof(dtap_attach_rej7));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ATTACH_REJ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, foreign_tlli));
-
- OSMO_ASSERT(!expect_msg());
-
- /* Attach (incomplete) and Detach (MO) */
-
- gbproxy_delete_link_infos(peer);
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len == 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(link_info->imsi_acq_pending);
-
- send_llc_ul_ui(nsi, "DETACH REQ (MO)", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_req, sizeof(dtap_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!expect_msg());
-
- /* Attach (incomplete) and Detach (MT) */
-
- gbproxy_delete_link_infos(peer);
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_ID_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->imsi_len == 0);
- OSMO_ASSERT(!link_info->is_deregistered);
- OSMO_ASSERT(link_info->imsi_acq_pending);
-
- send_llc_dl_ui(nsi, "DETACH REQ (MT)", &sgsn_peer, 0x1002,
- foreign_tlli, 1, imsi, sizeof(imsi),
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_mt_detach_req, sizeof(dtap_mt_detach_req));
-
- OSMO_ASSERT(expect_gmm_msg(0x1000, 0x1002, GSM48_MT_GMM_DETACH_REQ));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- link_info = gbproxy_link_info_by_tlli(peer, foreign_tlli);
- OSMO_ASSERT(link_info);
-
- send_llc_ul_ui(nsi, "DETACH ACC", &bss_peer[0], 0x1002,
- foreign_tlli, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_mt_detach_acc, sizeof(dtap_mt_detach_acc));
-
- /* TODO: The stored messaged should be cleaned when receiving a Detach
- * Ack. Remove the first OSMO_ASSERT when this is fixed. */
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_ATTACH_REQ));
- OSMO_ASSERT(expect_gmm_msg(SGSN_NSEI, 0x1002, GSM48_MT_GMM_DETACH_ACK));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- OSMO_ASSERT(!gbproxy_link_info_by_tlli(peer, foreign_tlli));
- link_info = gbproxy_link_info_by_imsi(peer, imsi, sizeof(imsi));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->is_deregistered);
-
- OSMO_ASSERT(!expect_msg());
- received_messages = NULL;
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-struct gbproxy_link_info *register_tlli(
- struct gbproxy_peer *peer, uint32_t tlli,
- const uint8_t *imsi, size_t imsi_len, time_t now)
-{
- struct gbproxy_link_info *link_info;
- int imsi_matches = -1;
- int tlli_already_known = 0;
- struct gbproxy_config *cfg = peer->cfg;
-
- /* Check, whether the IMSI matches */
- if (gprs_is_mi_imsi(imsi, imsi_len)) {
- imsi_matches = gbproxy_check_imsi(
- &cfg->matches[GBPROX_MATCH_PATCHING], imsi, imsi_len);
- if (imsi_matches < 0)
- return NULL;
- }
-
- link_info = gbproxy_link_info_by_tlli(peer, tlli);
-
- if (!link_info) {
- link_info = gbproxy_link_info_by_imsi(peer, imsi, imsi_len);
-
- if (link_info) {
- /* TLLI has changed somehow, adjust it */
- LOGP(DGPRS, LOGL_INFO,
- "The TLLI has changed from %08x to %08x\n",
- link_info->tlli.current, tlli);
- link_info->tlli.current = tlli;
- }
- }
-
- if (!link_info) {
- link_info = gbproxy_link_info_alloc(peer);
- link_info->tlli.current = tlli;
- } else {
- gbproxy_detach_link_info(peer, link_info);
- tlli_already_known = 1;
- }
-
- OSMO_ASSERT(link_info != NULL);
-
- if (!tlli_already_known)
- LOGP(DGPRS, LOGL_INFO, "Adding TLLI %08x to list\n", tlli);
-
- gbproxy_attach_link_info(peer, now, link_info);
- gbproxy_update_link_info(link_info, imsi, imsi_len);
-
- if (imsi_matches >= 0)
- link_info->is_matching[GBPROX_MATCH_PATCHING] = imsi_matches;
-
- return link_info;
-}
-
-static void test_gbproxy_tlli_expire(void)
-{
- struct gbproxy_config cfg = {0};
- struct gbproxy_peer *peer;
- const char *err_msg = NULL;
- const uint8_t imsi1[] = { GSM_MI_TYPE_IMSI, 0x23, 0x24, 0x25, 0xf6 };
- const uint8_t imsi2[] = { GSM_MI_TYPE_IMSI, 0x26, 0x27, 0x28, 0xf9 };
- const uint8_t imsi3[] = { GSM_MI_TYPE_IMSI | 0x10, 0x32, 0x54, 0x76, 0xf8 };
- const uint32_t tlli1 = 1234 | 0xc0000000;
- const uint32_t tlli2 = 5678 | 0xc0000000;
- const uint32_t tlli3 = 3456 | 0xc0000000;
- const char *filter_re = ".*";
- time_t now = 1407479214;
-
- printf("Test TLLI info expiry\n\n");
-
- gbproxy_init_config(&cfg);
-
- if (gbproxy_set_patch_filter(&cfg.matches[GBPROX_MATCH_PATCHING],
- filter_re, &err_msg) != 0) {
- fprintf(stderr, "gbprox_set_patch_filter: got error: %s\n",
- err_msg);
- OSMO_ASSERT(err_msg == NULL);
- }
-
- {
- struct gbproxy_link_info *link_info;
-
- printf("Test TLLI replacement:\n");
-
- cfg.tlli_max_len = 0;
- cfg.tlli_max_age = 0;
- peer = gbproxy_peer_alloc(&cfg, 20);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 0);
-
- printf(" Add TLLI 1, IMSI 1\n");
- link_info = register_tlli(peer, tlli1,
- imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- /* replace the old entry */
- printf(" Add TLLI 2, IMSI 1 (should replace TLLI 1)\n");
- link_info = register_tlli(peer, tlli2,
- imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli2);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- dump_peers(stdout, 2, now, &cfg);
-
- /* verify that 5678 has survived */
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli2);
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(!link_info);
-
- printf("\n");
-
- gbproxy_peer_free(peer);
- }
-
- {
- struct gbproxy_link_info *link_info;
-
- printf("Test IMSI replacement:\n");
-
- cfg.tlli_max_len = 0;
- cfg.tlli_max_age = 0;
- peer = gbproxy_peer_alloc(&cfg, 20);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 0);
-
- printf(" Add TLLI 1, IMSI 1\n");
- link_info = register_tlli(peer, tlli1,
- imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- /* try to replace the old entry */
- printf(" Add TLLI 1, IMSI 2 (should replace IMSI 1)\n");
- link_info = register_tlli(peer, tlli1,
- imsi2, ARRAY_SIZE(imsi2), now);
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- dump_peers(stdout, 2, now, &cfg);
-
- /* verify that 5678 has survived */
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(!link_info);
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli1);
-
- printf("\n");
-
- gbproxy_peer_free(peer);
- }
-
- {
- struct gbproxy_link_info *link_info;
- int num_removed;
-
- printf("Test TLLI expiry, max_len == 1:\n");
-
- cfg.tlli_max_len = 1;
- cfg.tlli_max_age = 0;
- peer = gbproxy_peer_alloc(&cfg, 20);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 0);
-
- printf(" Add TLLI 1, IMSI 1\n");
- register_tlli(peer, tlli1, imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- /* replace the old entry */
- printf(" Add TLLI 2, IMSI 2 (should replace IMSI 1)\n");
- register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2), now);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 2);
-
- num_removed = gbproxy_remove_stale_link_infos(peer, now + 2);
- OSMO_ASSERT(num_removed == 1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- dump_peers(stdout, 2, now, &cfg);
-
- /* verify that 5678 has survived */
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(!link_info);
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli2);
-
- printf("\n");
-
- gbproxy_peer_free(peer);
- }
-
- {
- struct gbproxy_link_info *link_info;
- int num_removed;
-
- printf("Test TLLI expiry, max_age == 1:\n");
-
- cfg.tlli_max_len = 0;
- cfg.tlli_max_age = 1;
- peer = gbproxy_peer_alloc(&cfg, 20);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 0);
-
- printf(" Add TLLI 1, IMSI 1 (should expire after timeout)\n");
- register_tlli(peer, tlli1, imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- printf(" Add TLLI 2, IMSI 2 (should not expire after timeout)\n");
- register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2),
- now + 1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 2);
-
- num_removed = gbproxy_remove_stale_link_infos(peer, now + 2);
- OSMO_ASSERT(num_removed == 1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- dump_peers(stdout, 2, now + 2, &cfg);
-
- /* verify that 5678 has survived */
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(!link_info);
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli2);
-
- printf("\n");
-
- gbproxy_peer_free(peer);
- }
-
- {
- struct gbproxy_link_info *link_info;
- int num_removed;
-
- printf("Test TLLI expiry, max_len == 2, max_age == 1:\n");
-
- cfg.tlli_max_len = 0;
- cfg.tlli_max_age = 1;
- peer = gbproxy_peer_alloc(&cfg, 20);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 0);
-
- printf(" Add TLLI 1, IMSI 1 (should expire)\n");
- register_tlli(peer, tlli1, imsi1, ARRAY_SIZE(imsi1), now);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- printf(" Add TLLI 2, IMSI 2 (should expire after timeout)\n");
- register_tlli(peer, tlli2, imsi2, ARRAY_SIZE(imsi2),
- now + 1);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 2);
-
- printf(" Add TLLI 3, IMSI 3 (should not expire after timeout)\n");
- register_tlli(peer, tlli3, imsi3, ARRAY_SIZE(imsi3),
- now + 2);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 3);
-
- dump_peers(stdout, 2, now + 2, &cfg);
-
- printf(" Remove stale TLLIs\n");
- num_removed = gbproxy_remove_stale_link_infos(peer, now + 3);
- OSMO_ASSERT(num_removed == 2);
- OSMO_ASSERT(peer->patch_state.logical_link_count == 1);
-
- dump_peers(stdout, 2, now + 2, &cfg);
-
- /* verify that tlli3 has survived */
- link_info = gbproxy_link_info_by_imsi(peer, imsi1, ARRAY_SIZE(imsi1));
- OSMO_ASSERT(!link_info);
- link_info = gbproxy_link_info_by_imsi(peer, imsi2, ARRAY_SIZE(imsi2));
- OSMO_ASSERT(!link_info);
- link_info = gbproxy_link_info_by_imsi(peer, imsi3, ARRAY_SIZE(imsi3));
- OSMO_ASSERT(link_info);
- OSMO_ASSERT(link_info->tlli.current == tlli3);
-
- printf("\n");
-
- gbproxy_peer_free(peer);
- }
- gbproxy_clear_patch_filter(&cfg.matches[GBPROX_MATCH_PATCHING]);
- gbprox_reset(&cfg);
- /* gbprox_reset() frees the rate_ctr, but re-allocates it again. */
- rate_ctr_group_free(cfg.ctrg);
-
- cleanup_test();
-}
-
-static void test_gbproxy_imsi_matching(void)
-{
- const char *err_msg = NULL;
- const uint8_t imsi1[] = { GSM_MI_TYPE_IMSI | 0x10, 0x32, 0x54, 0xf6 };
- const uint8_t imsi2[] = { GSM_MI_TYPE_IMSI | GSM_MI_ODD | 0x10, 0x32, 0x54, 0x76 };
- const uint8_t imsi3_bad[] = { GSM_MI_TYPE_IMSI | 0x10, 0xee, 0x54, 0xff };
- const uint8_t tmsi1[] = { GSM_MI_TYPE_TMSI | 0xf0, 0x11, 0x22, 0x33, 0x44 };
- const uint8_t tmsi2_bad[] = { GSM_MI_TYPE_TMSI | 0xf0, 0x11, 0x22 };
- const uint8_t imei1[] = { GSM_MI_TYPE_IMEI | 0x10, 0x32, 0x54, 0xf6 };
- const uint8_t imei2[] = { GSM_MI_TYPE_IMEI | GSM_MI_ODD | 0x10, 0x32, 0x54, 0x76 };
- const char *filter_re1 = ".*";
- const char *filter_re2 = "^1234";
- const char *filter_re3 = "^4321";
- const char *filter_re4_bad = "^12[";
- struct gbproxy_match match = {0,};
-
- printf("=== Test IMSI/TMSI matching ===\n\n");
-
- OSMO_ASSERT(match.enable == 0);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re1, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re2, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- err_msg = NULL;
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re4_bad, &err_msg) == -1);
- OSMO_ASSERT(err_msg != NULL);
- OSMO_ASSERT(match.enable == 0);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re2, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, NULL, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 0);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re2, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- gbproxy_clear_patch_filter(&match);
- OSMO_ASSERT(match.enable == 0);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re2, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi1, ARRAY_SIZE(imsi1)) == 1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi2, ARRAY_SIZE(imsi2)) == 1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi3_bad, ARRAY_SIZE(imsi3_bad)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, tmsi1, ARRAY_SIZE(tmsi1)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, tmsi2_bad, ARRAY_SIZE(tmsi2_bad)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imei1, ARRAY_SIZE(imei1)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imei2, ARRAY_SIZE(imei2)) == -1);
-
- OSMO_ASSERT(gbproxy_set_patch_filter(&match, filter_re3, &err_msg) == 0);
- OSMO_ASSERT(match.enable == 1);
-
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi1, ARRAY_SIZE(imsi1)) == 0);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi2, ARRAY_SIZE(imsi2)) == 0);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imsi3_bad, ARRAY_SIZE(imsi3_bad)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, tmsi1, ARRAY_SIZE(tmsi1)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, tmsi2_bad, ARRAY_SIZE(tmsi2_bad)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imei1, ARRAY_SIZE(imei1)) == -1);
- OSMO_ASSERT(gbproxy_check_imsi(&match, imei2, ARRAY_SIZE(imei2)) == -1);
-
- /* TODO: Check correct length but wrong type with is_mi_tmsi */
-
- gbproxy_clear_patch_filter(&match);
- OSMO_ASSERT(match.enable == 0);
-
- cleanup_test();
-}
-
-static void test_gbproxy_stored_messages()
-{
- struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, tall_sgsn_ctx);
- struct sockaddr_in bss_peer[1] = {{0},};
- struct sockaddr_in sgsn_peer= {0};
- struct gprs_ra_id rai_bss =
- {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96};
- struct gprs_ra_id rai_unknown =
- {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96};
- uint16_t cell_id = 0x1234;
-
- const uint32_t ptmsi = 0xefe2b700;
- const uint32_t local_tlli = 0xefe2b700;
-
- const uint32_t foreign_tlli1 = 0x8000dead;
-
- struct gbproxy_peer *peer;
- unsigned bss_nu = 0;
- unsigned sgsn_nu = 0;
-
- OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL));
-
- bssgp_nsi = nsi;
- gbcfg.nsi = bssgp_nsi;
- gbcfg.nsip_sgsn_nsei = SGSN_NSEI;
- gbcfg.core_plmn = (struct osmo_plmn_id){};
- gbcfg.core_apn = talloc_zero_size(tall_sgsn_ctx, 100);
- gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar");
- gbcfg.patch_ptmsi = 0;
- gbcfg.acquire_imsi = 1;
- gbcfg.keep_link_infos = 0;
-
- configure_sgsn_peer(&sgsn_peer);
- configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer));
-
- printf("=== %s ===\n", __func__);
- printf("--- Initialise SGSN ---\n\n");
-
- connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI);
-
- printf("--- Initialise BSS 1 ---\n\n");
-
- setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000);
- setup_bssgp(nsi, &bss_peer[0], 0x1002);
-
- peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000);
- OSMO_ASSERT(peer != NULL);
-
- send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002);
-
- gprs_dump_nsi(nsi);
- dump_global(stdout, 0);
- dump_peers(stdout, 0, 0, &gbcfg);
-
- printf("--- Establish first LLC connection ---\n\n");
-
- send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002,
- foreign_tlli1, &rai_unknown, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_attach_req, sizeof(dtap_attach_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002,
- foreign_tlli1, 0, NULL, 0,
- GPRS_SAPI_GMM, sgsn_nu++,
- dtap_identity_req, sizeof(dtap_identity_req));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "DETACH ACCEPT", &bss_peer[0], 0x1002,
- foreign_tlli1, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_detach_acc, sizeof(dtap_detach_acc));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002,
- foreign_tlli1, &rai_bss, cell_id,
- GPRS_SAPI_GMM, bss_nu++,
- dtap_identity_resp, sizeof(dtap_identity_resp));
-
- dump_peers(stdout, 0, 0, &gbcfg);
-
- dump_global(stdout, 0);
-
- talloc_free(gbcfg.core_apn);
- gbcfg.core_apn = NULL;
-
- gbprox_reset(&gbcfg);
- gprs_ns_destroy(nsi);
- nsi = NULL;
-
- cleanup_test();
-}
-
-/* See OS#3178 "gbproxy: failed to parse invalid BSSGP-UNITDATA message" */
-static void test_gbproxy_parse_bssgp_unitdata()
-{
- const char *hex = "0000239401e155cfea000004088872f4801018009c4000800e000601c0416c4338";
- struct msgb *msg = msgb_alloc(1034, "bssgp_unitdata");
- struct gprs_gb_parse_context parse_ctx;
- int rc;
-
- memset(&parse_ctx, 0, sizeof(parse_ctx));
-
- OSMO_ASSERT(msg);
- msgb_bssgph(msg) = msg->head;
- msgb_put(msg, osmo_hexparse(hex, msg->head, msgb_tailroom(msg)));
-
- parse_ctx.to_bss = 0;
- parse_ctx.peer_nsei = msgb_nsei(msg);
-
- rc = gprs_gb_parse_bssgp(msg->data, msg->len, &parse_ctx);
- if (!rc)
- fprintf(stderr, "%s: Test passed; Failed to parse invalid message %s\n", __func__, msgb_hexdump(msg));
- else
- fprintf(stderr, "%s: Test failed; invalid message was accepted by parser: %s\n", __func__, msgb_hexdump(msg));
-
- OSMO_ASSERT(!rc);
-
- /* Manually decoded message according to:
- ETSI TS 148 018 V10.6.0 (2012 07) 96
- 3GPP TS 48.018 version 10.6.0 Release 10
- Table 10.2.2: UL-UNITDATA PDU content
-
- 00 - PDU type UL-UNITDATA (ok)
-
- 11.3.35 Temporary logical link Identity (TLLI)
- 00 - TLLI[0]
- 23 - TLLI[1]
- 94 - TLLI[2]
- 01 - TLLI[3]
- TLLI == "00239401"
-
- e1 - QOS[0] (bit rate MSB)
- 55 - QOS[1] (bit rate LSB)
- bit rate = "57685" (57685*100000 bit/s per PBRG)
- cf - QOS[2] PBRG = 11 (bit rate is expressed in 100000 bit/s increments),
- C/R 0 (contains LLC ACK/SACK),
- T 0 (contains signalling),
- A 1 (radio if uses MAC/UNITDATA,
- Precedence 111 (reserved value)
-
- ea - CELL_ID[0] (TLV IEI: wrong, should be 0x08)
- 00 - CELL_ID[1] (length 1)
- 00 - CELL_ID[2] (length 2)
- lenth == 0
- 04 -- CELL_ID[3]
- 08 -- CELL_ID[4]
- 88 -- CELL_ID[5]
- 72 -- CELL_ID[6]
- f4 -- CELL_ID[7]
- 80 -- CELL_ID[8]
- 10 -- CELL_DI[9]
-
- 18 -- QOSP[0] OoS Profile IEI
- not allowed in BSSGP Userdata
- 00 -- QOSP[1]
- 9c -- QOSP[2]
- 40 -- QOSP[3]
- 00 -- QOSP[4]
-
- 80 -- IEI for "E-UTRAN Inter RAT Handover Info"
- not allowed in BSSGP Userdata
- 0e -- length (14 bytes -- only 8 bytes remain)
- 00 06 01 c0 41 6c 43 38 */
-
- msgb_free(msg);
-
- cleanup_test();
-}
-
-static struct log_info_cat gprs_categories[] = {
- [DGPRS] = {
- .name = "DGPRS",
- .description = "GPRS Packet Service",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
- [DNS] = {
- .name = "DNS",
- .description = "GPRS Network Service (NS)",
- .enabled = 1, .loglevel = LOGL_INFO,
- },
- [DBSSGP] = {
- .name = "DBSSGP",
- .description = "GPRS BSS Gateway Protocol (BSSGP)",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
-};
-
-static struct log_info info = {
- .cat = gprs_categories,
- .num_cat = ARRAY_SIZE(gprs_categories),
-};
-
-int main(int argc, char **argv)
-{
- talloc_enable_leak_report();
- tall_sgsn_ctx = talloc_named_const(NULL, 0, "gbproxy_test");
- void *log_ctx = talloc_named_const(tall_sgsn_ctx, 0, "log");
-
- msgb_talloc_ctx_init(tall_sgsn_ctx, 0);
-
- osmo_init_logging2(log_ctx, &info);
- log_set_use_color(osmo_stderr_target, 0);
- log_set_print_filename(osmo_stderr_target, 0);
- osmo_signal_register_handler(SS_L_NS, &test_signal, &gbcfg);
-
- log_set_print_filename(osmo_stderr_target, 0);
- log_set_log_level(osmo_stderr_target, LOGL_DEBUG);
- log_set_all_filter(osmo_stderr_target, 1);
-
- rate_ctr_init(tall_sgsn_ctx);
-
- setlinebuf(stdout);
-
- printf("===== GbProxy test START\n");
- gbproxy_init_config(&gbcfg);
- test_gbproxy();
- test_gbproxy_ident_changes();
- test_gbproxy_imsi_matching();
- test_gbproxy_ptmsi_assignment();
- test_gbproxy_ra_patching();
- test_gbproxy_ptmsi_patching();
- test_gbproxy_ptmsi_patching_bad_cases();
- test_gbproxy_imsi_acquisition();
- test_gbproxy_secondary_sgsn();
- test_gbproxy_keep_info();
- test_gbproxy_tlli_expire();
- test_gbproxy_stored_messages();
- test_gbproxy_parse_bssgp_unitdata();
- gbprox_reset(&gbcfg);
- /* gbprox_reset() frees the rate_ctr, but re-allocates it again. */
- rate_ctr_group_free(gbcfg.ctrg);
- printf("===== GbProxy test END\n\n");
-
- talloc_free(log_ctx);
- /* expecting root and msgb ctx, empty */
- OSMO_ASSERT(talloc_total_blocks(tall_sgsn_ctx) == 2);
- talloc_free(tall_sgsn_ctx);
-
- return 0;
-}
diff --git a/tests/gbproxy/gbproxy_test.ok b/tests/gbproxy/gbproxy_test.ok
deleted file mode 100644
index 03de12e4a..000000000
--- a/tests/gbproxy/gbproxy_test.ok
+++ /dev/null
@@ -1,7492 +0,0 @@
-===== GbProxy test START
-=== test_gbproxy ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
-Current NS-VCIs:
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 15
- NS-VC Block count : 1
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 12
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
---- Initialise BSS 2 ---
-
-Setup NS-VC: remote 0x01020304:2222, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:2222
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:2222
-
-MESSAGE to BSS at 0x01020304:2222, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:2222, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:2222
-0a
-
-MESSAGE to BSS at 0x01020304:2222, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:2222
-06
-
-MESSAGE to BSS at 0x01020304:2222, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:2222
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:2222
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:2222, BVCI 0x2002(8194)
-
-PROCESSING BVC_RESET from 0x01020304:2222
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 12
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 20 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:2222, msg length 9
-00 00 00 00 23 04 82 20 02
-
-result (BVC_RESET_ACK) = 0
-
---- Move BSS 1 to new port ---
-
-Setup NS-VC: remote 0x01020304:3333, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:3333
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:3333
-
-MESSAGE to BSS at 0x01020304:3333, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:3333
-0a
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:3333
-06
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:3333
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:3333
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:2222
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333
- Packets at NS Level ( In): 9
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 52
- Bytes at NS Level (Out): 33
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Move BSS 2 to former BSS 1 port ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111
- Packets at NS Level ( In): 9
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 52
- Bytes at NS Level (Out): 33
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333
- Packets at NS Level ( In): 9
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 52
- Bytes at NS Level (Out): 33
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Move BSS 1 to current BSS 2 port ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111
- Packets at NS Level ( In): 13
- Packets at NS Level (Out): 13
- Bytes at NS Level ( In): 67
- Bytes at NS Level (Out): 45
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333
- Packets at NS Level ( In): 9
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 52
- Bytes at NS Level (Out): 33
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Move BSS 2 to new port ---
-
-Setup NS-VC: remote 0x01020304:4444, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:4444
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:4444
-
-MESSAGE to BSS at 0x01020304:4444, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:4444, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:4444
-0a
-
-MESSAGE to BSS at 0x01020304:4444, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:4444
-06
-
-MESSAGE to BSS at 0x01020304:4444, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:4444
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:4444
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:4444
- Packets at NS Level ( In): 17
- Packets at NS Level (Out): 17
- Bytes at NS Level ( In): 82
- Bytes at NS Level (Out): 57
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:3333
- Packets at NS Level ( In): 9
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 52
- Bytes at NS Level (Out): 33
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Move BSS 2 to former BSS 1 port ---
-
-Setup NS-VC: remote 0x01020304:3333, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:3333
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_REPLACED: 0x2001/1.2.3.4:4444 -> 0x1001/1.2.3.4:3333
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:3333
-
-MESSAGE to BSS at 0x01020304:3333, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:3333
-0a
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:3333
-06
-
-MESSAGE to BSS at 0x01020304:3333, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:3333
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:3333
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 21
- Bytes at NS Level ( In): 85
- Bytes at NS Level (Out): 69
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x00000000:0
- Packets at NS Level ( In): 10
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 64
- Bytes at NS Level (Out): 33
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Move BSS 1 to original BSS 1 port ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 21
- Bytes at NS Level ( In): 85
- Bytes at NS Level (Out): 69
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 14
- Packets at NS Level (Out): 13
- Bytes at NS Level ( In): 79
- Bytes at NS Level (Out): 45
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 59
- NS-VC Block count : 1
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Reset BSS 1 with a new BVCI ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1012(4114)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 12 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 12 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 12 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 21
- Bytes at NS Level ( In): 85
- Bytes at NS Level (Out): 69
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 15
- Packets at NS Level (Out): 13
- Bytes at NS Level ( In): 101
- Bytes at NS Level (Out): 45
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 7
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 81
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4114, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 12
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 12
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 12
-
-result (BVC_RESET_ACK) = 0
-
---- Reset BSS 1 with the old BVCI ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 21
- Bytes at NS Level ( In): 85
- Bytes at NS Level (Out): 69
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 16
- Packets at NS Level (Out): 14
- Bytes at NS Level ( In): 123
- Bytes at NS Level (Out): 54
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 7
- Packets at NS Level (Out): 8
- Bytes at NS Level ( In): 39
- Bytes at NS Level (Out): 103
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4114, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
---- Reset BSS 1 with the old BVCI again ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 21
- Bytes at NS Level ( In): 85
- Bytes at NS Level (Out): 69
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 17
- Packets at NS Level (Out): 15
- Bytes at NS Level ( In): 145
- Bytes at NS Level (Out): 63
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 8
- Packets at NS Level (Out): 9
- Bytes at NS Level ( In): 48
- Bytes at NS Level (Out): 125
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4114, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
---- Send message from BSS 1 to SGSN, BVCI 0x1012 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from SGSN to BSS 1, BVCI 0x1012 ---
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from SGSN to BSS 1, BVCI 0x1002 ---
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from BSS 2 to SGSN, BVCI 0x2002 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
---- Send message from SGSN to BSS 2, BVCI 0x2002 ---
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:3333, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
---- Reset BSS 1 with the old BVCI on BSS2's link ---
-
-Setup BSSGP: remote 0x01020304:3333, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:3333
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:3333
- Packets at NS Level ( In): 21
- Packets at NS Level (Out): 22
- Bytes at NS Level ( In): 107
- Bytes at NS Level (Out): 73
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 20
- Packets at NS Level (Out): 18
- Bytes at NS Level ( In): 157
- Bytes at NS Level (Out): 80
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 12
- Packets at NS Level (Out): 13
- Bytes at NS Level ( In): 69
- Bytes at NS Level (Out): 159
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4114, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
-Gbproxy global:
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:3333, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from SGSN to BSS 1, BVCI 0x1002 ---
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 12
-
-CALLBACK, event 0, msg length 0, bvci 0x1012
-00 00 10 12
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1012, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 12
-
-result (UNITDATA) = 0
-
---- Send message from SGSN to BSS 1, BVCI 0x10ff (invalid) ---
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 ff
-
-CALLBACK, event 0, msg length 0, bvci 0x10ff
-00 00 10 ff
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 10 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 14
-00 00 00 00 41 07 81 05 04 82 10 ff 15 80
-
-result (UNITDATA) = 0
-
-Peers:
- NSEI 8192, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
-Gbproxy global:
- Invalid BVC Identifier : 1
-=== test_gbproxy_ident_changes ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
-Current NS-VCIs:
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 15
- NS-VC Block count : 1
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 15
- Bytes at NS Level (Out): 12
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 15
- NS-VC Block count : 1
-
---- Setup BVCI 1 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Setup BVCI 2 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x2002(8194)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 20 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 20 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 20 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN and back, BVCI 1 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
---- Send message from BSS 1 to SGSN and back, BVCI 2 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
---- Change NSEI ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 20 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x2000, peer 0x01020304:1111
- Packets at NS Level ( In): 12
- Packets at NS Level (Out): 12
- Bytes at NS Level ( In): 82
- Bytes at NS Level (Out): 50
- NS-VC changed NSEI count : 1
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 8
- Packets at NS Level (Out): 8
- Bytes at NS Level ( In): 38
- Bytes at NS Level (Out): 67
- NS-VC Block count : 1
-
---- Setup BVCI 1 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Setup BVCI 3 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x3002(12290)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 30 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 30 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 30 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 30 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 30 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 30 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN and back, BVCI 1 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
---- Send message from BSS 1 to SGSN and back, BVCI 2 (should fail) ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
-Peers:
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-result (UNITDATA) = -22
-
-Peers:
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- NS Transmission error : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN and back, BVCI 3 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 30 02
-
-CALLBACK, event 0, msg length 0, bvci 0x3002
-00 00 30 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x3002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 30 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 30 02
-
-CALLBACK, event 0, msg length 0, bvci 0x3002
-00 00 30 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x3002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 30 02
-
-result (UNITDATA) = 0
-
---- Change NSVCI ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x2001(8193), NSEI 0x2000(8192)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 20 01 04 82 20 00
-
-==> got signal NS_REPLACED: 0x2001/0.0.0.0:0 -> 0x1001/1.2.3.4:1111
-
-==> got signal NS_RESET, NS-VC 0x2001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 20 01 04 82 20 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x2001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x2001, NSEI 0x2000, peer 0x01020304:1111
- Packets at NS Level ( In): 3
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 3
- Bytes at NS Level (Out): 12
- NS-VC replaced other count: 1
- VCI 0x1001, NSEI 0x2000, peer 0x00000000:0
- Packets at NS Level ( In): 18
- Packets at NS Level (Out): 16
- Bytes at NS Level ( In): 150
- Bytes at NS Level (Out): 76
- NS-VC changed NSEI count : 1
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 13
- Packets at NS Level (Out): 13
- Bytes at NS Level ( In): 68
- Bytes at NS Level (Out): 123
- NS-VC Block count : 1
-
---- Setup BVCI 1 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- NS Transmission error : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Setup BVCI 4 ---
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x4002(16386)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 40 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 40 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 40 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 40 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 40 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 40 02
-
-result (BVC_RESET_ACK) = 0
-
-Peers:
- NSEI 8192, BVCI 16386, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- NS Transmission error : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN and back, BVCI 1 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 10 02
-
-CALLBACK, event 0, msg length 0, bvci 0x1002
-00 00 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 10 02
-
-result (UNITDATA) = 0
-
---- Send message from BSS 1 to SGSN and back, BVCI 2 (should fail) ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 20 02
-
-result (UNITDATA) = 0
-
-Peers:
- NSEI 8192, BVCI 16386, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 2
- NS Transmission error : 1
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 20 02
-
-CALLBACK, event 0, msg length 0, bvci 0x2002
-00 00 20 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x2002, msg length 0 (gprs_ns_sendmsg)
-result (UNITDATA) = -22
-
-Peers:
- NSEI 8192, BVCI 16386, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 2
- NS Transmission error : 2
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN and back, BVCI 3 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 30 02
-
-CALLBACK, event 0, msg length 0, bvci 0x3002
-00 00 30 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x3002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 30 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 30 02
-
-CALLBACK, event 0, msg length 0, bvci 0x3002
-00 00 30 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x3002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 30 02
-
-result (UNITDATA) = 0
-
---- Send message from BSS 1 to SGSN and back, BVCI 4 ---
-
-PROCESSING UNITDATA from 0x01020304:1111
-00 00 40 02
-
-CALLBACK, event 0, msg length 0, bvci 0x4002
-00 00 40 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x4002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 4
-00 00 40 02
-
-result (UNITDATA) = 0
-
-PROCESSING UNITDATA from 0x05060708:32000
-00 00 40 02
-
-CALLBACK, event 0, msg length 0, bvci 0x4002
-00 00 40 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x4002, msg length 0 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 4
-00 00 40 02
-
-result (UNITDATA) = 0
-
-Gbproxy global:
-Peers:
- NSEI 8192, BVCI 16386, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 8192, BVCI 12290, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
- NSEI 4096, BVCI 8194, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 2
- NS Transmission error : 2
- TLLI-Cache: 0
- NSEI 8192, BVCI 4098, not blocked, RAI 112-332-16464-96
- NSEI mismatch : 1
- TLLI-Cache: 0
-=== Test IMSI/TMSI matching ===
-
-=== test_gbproxy_ptmsi_assignment ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Establish first LLC connection ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI (none), AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI (none), AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/efe2b700 -> 8000dead/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/efe2b700 -> 8000dead/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
---- Establish second LLC connection with the same P-TMSI ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 0d 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 46 42 6e
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 0d 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 46 42 6e
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 0d 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 46 42 6e
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 8000beef, IMSI (none), AGE 0
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 8000beef, IMSI (none), AGE 0
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 11 08 16 08 11 12 99 99 99 16 17 f8 15 36 87
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 11 08 16 08 11 12 99 99 99 16 17 f8 15 36 87
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 11 08 16 08 11 12 99 99 99 16 17 f8 15 36 87
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 8000beef, IMSI 12199999961718, AGE 0
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000beef/efe2b700 -> 8000beef/efe2b700, IMSI 12199999961718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 15 08 03 86 ac 47
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 15 08 03 86 ac 47
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 15 08 03 86 ac 47
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000beef/efe2b700 -> 8000beef/efe2b700, IMSI 12199999961718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12199999961718, AGE 0
-Gbproxy global:
-=== test_gbproxy_ra_patching ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
-Current NS-VCIs:
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 15
- NS-VC Block count : 1
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 4
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 12
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 4
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 12
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- TLLI-Cache: 0
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-PROCESSING BVC_SUSPEND from 0x01020304:1111
-00 00 00 00 0b 1f 84 cc d1 75 8b 1b 86 11 22 33 40 50 60
-
-CALLBACK, event 0, msg length 15, bvci 0x0000
-00 00 00 00 0b 1f 84 cc d1 75 8b 1b 86 11 22 33 40 50 60
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 15 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 19
-00 00 00 00 0b 1f 84 cc d1 75 8b 1b 86 21 63 54 40 50 60
-
-result (BVC_SUSPEND) = 0
-
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 cc d1 75 8b 1b 86 21 63 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 cc d1 75 8b 1b 86 21 63 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 cc d1 75 8b 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- RAID patched (SGSN): 1
- TLLI from SGSN unknown : 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 21 63 54 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 8e cd 32
-
-result (ATTACH REQUEST) = 0
-
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 11 01 c0 0d 08 16 08 11 12 13 14 15 16 17 f8 1d ff 1c
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 11 01 c0 0d 08 16 08 11 12 13 14 15 16 17 f8 1d ff 1c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 11 01 c0 0d 08 16 08 11 12 13 14 15 16 17 f8 1d ff 1c
-
-result (IDENT RESPONSE) = 0
-
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 be 38 c0
-
-result (ATTACH ACCEPT) = 0
-
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 08 01 c0 11 08 03 ea 67 11
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 08 01 c0 11 08 03 ea 67 11
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 08 01 c0 11 08 03 ea 67 11
-
-result (ATTACH COMPLETE) = 0
-
-PROCESSING ACT PDP CTX REQ (REPLACE APN) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 81 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 85
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 3a 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 08 03 66 6f 6f 03 62 61 72 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 24 9d 75
-
-result (ACT PDP CTX REQ (REPLACE APN)) = 0
-
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-PROCESSING ACT PDP CTX REQ (REPLACE APN) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 81 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 85
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 3a 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 08 03 66 6f 6f 03 62 61 72 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 24 9d 75
-
-result (ACT PDP CTX REQ (REPLACE APN)) = 0
-
-PROCESSING ACT PDP CTX REQ (REMOVE APN) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 71 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 75
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 30 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 85 fa 60
-
-result (ACT PDP CTX REQ (REMOVE APN)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 2
- APN patched : 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- PDP Activation Request count : 3
- TLLI from SGSN unknown : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0, IMSI matches
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 7e e1 41
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 7e e1 41
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 7e e1 41
-
-result (DETACH REQ) = 0
-
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 2
- APN patched : 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- PDP Activation Request count : 3
- TLLI from SGSN unknown : 1
- TLLI-Cache: 0
---- RA update ---
-
-PROCESSING RA UPD REQ from 0x01020304:1111
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 85 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 89
-00 00 10 02 01 bb c5 46 79 00 00 04 08 88 21 63 54 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 21 63 54 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 1d f0 41
-
-result (RA UPD REQ) = 0
-
-PROCESSING RA UPD ACC from 0x05060708:32000
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 19 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 ef e2 b7 00 17 16 d7 59 65
-
-CALLBACK, event 0, msg length 87, bvci 0x1002
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 19 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 ef e2 b7 00 17 16 d7 59 65
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 87 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 91
-00 00 10 02 00 bb c5 46 79 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 19 08 09 00 49 11 22 33 40 50 60 19 54 ab b3 18 05 f4 ef e2 b7 00 17 16 3a 03 54
-
-result (RA UPD ACC) = 0
-
-PROCESSING ACT PDP CTX REQ (REMOVE APN) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 71 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 75
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 30 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 85 fa 60
-
-result (ACT PDP CTX REQ (REMOVE APN)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 3
- APN patched : 4
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 1
- Detach Accept count : 1
- PDP Activation Request count : 4
- TLLI from SGSN unknown : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI bbc54679/efe2b700 -> bbc54679/efe2b700, IMSI 12131415161718, AGE 0, IMSI matches
-PROCESSING DETACH REQ (PWR OFF) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 09 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 84 0c eb
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 09 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 84 0c eb
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 15 01 c0 19 08 05 09 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 84 0c eb
-
-result (DETACH REQ (PWR OFF)) = 0
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 14
- RAID patched (SGSN): 3
- APN patched : 4
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 2
- Detach Accept count : 1
- PDP Activation Request count : 4
- TLLI from SGSN unknown : 1
- TLLI-Cache: 0
---- Bad cases ---
-
-PROCESSING ATTACH REQUEST (foreign RAI) from 0x01020304:1111
-00 00 10 02 01 bb 00 be ef 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb 00 be ef 99 99 99 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 2d c7 df
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 bb 00 be ef 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb 00 be ef 99 99 99 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 2d c7 df
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 bb 00 be ef 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb 00 be ef 99 99 99 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 2d c7 df
-
-result (ATTACH REQUEST (foreign RAI)) = 0
-
-TLLI is already detached, shouldn't patch
-PROCESSING ACT PDP CTX REQ from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 76 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 80
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 75 30 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-result (ACT PDP CTX REQ) = 0
-
-Invalid RAI, shouldn't patch
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 cc d1 75 8b 1b 86 00 f1 99 00 63 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 cc d1 75 8b 1b 86 00 f1 99 00 63 60 1d 81 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 28
-00 00 00 00 41 07 81 21 15 92 0c 1f 84 cc d1 75 8b 1b 86 00 f1 99 00 63 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- Patch error: no peer : 1
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 16
- RAID patched (SGSN): 3
- APN patched : 4
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 2
- Detach Accept count : 1
- PDP Activation Request count : 5
- TLLI from SGSN unknown : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI efe2b700 -> efe2b700, IMSI (none), AGE 0
- TLLI bb00beef -> bb00beef, IMSI (none), AGE 0
-=== test_gbproxy_ptmsi_patching ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 01 0c 0a 29
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ACT PDP CTX REQ (REPLACE APN) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-CALLBACK, event 0, msg length 76, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 35 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 03 02 61 62 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 5a ff 02
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 81 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 85
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 3a 01 c0 0d 0a 41 05 03 0c 00 00 1f 10 00 00 00 00 00 00 00 00 02 01 21 28 08 03 66 6f 6f 03 62 61 72 27 14 80 80 21 10 01 00 00 10 81 06 00 00 00 00 83 06 00 00 00 00 24 9d 75
-
-result (ACT PDP CTX REQ (REPLACE APN)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 5
- RAID patched (SGSN): 1
- APN patched : 1
- TLLI patched (BSS ): 4
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING XID (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-CALLBACK, event 0, msg length 38, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 38 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 42
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-result (XID (UL)) = 0
-
-PROCESSING XID (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-CALLBACK, event 0, msg length 70, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 70 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 74
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-result (XID (DL)) = 0
-
-PROCESSING LL11 DNS QUERY (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-CALLBACK, event 0, msg length 89, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 89 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 93
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-result (LL11 DNS QUERY (UL)) = 0
-
-PROCESSING LL11 DNS RESP (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-CALLBACK, event 0, msg length 267, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 267 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 271
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-result (LL11 DNS RESP (DL)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 1
- APN patched : 1
- TLLI patched (BSS ): 6
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING RA UPD REQ (P-TMSI 2) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 11 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 e2 6d 78
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 11 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 e2 6d 78
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 85 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 89
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 70 80 00 80 0e 00 3e 01 c0 11 08 08 10 21 63 54 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 69 a3 ae
-
-result (RA UPD REQ (P-TMSI 2)) = 0
-
-PROCESSING RA UDP ACC (P-TMSI 2) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 0d 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 e0 98 76 54 17 16 9f e8 ea
-
-CALLBACK, event 0, msg length 87, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 0d 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 e0 98 76 54 17 16 9f e8 ea
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 87 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 91
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 0d 08 09 00 49 11 22 33 40 50 60 19 54 ab b3 18 05 f4 c0 de ad 02 17 16 bb 4d a0
-
-result (RA UDP ACC (P-TMSI 2)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 2
- APN patched : 1
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 6
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01/c0dead02 -> efe2b700/e0987654, IMSI 12131415161718, AGE 0
-PROCESSING RA UPD REQ (P-TMSI 3) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 02 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 c0 de ad 02 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 85 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 89
-00 00 10 02 01 e0 98 76 54 00 00 04 08 88 21 63 54 40 50 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 21 63 54 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 1d f0 41
-
-result (RA UPD REQ (P-TMSI 3)) = 0
-
-PROCESSING RA UDP ACC (P-TMSI 3) from 0x05060708:32000
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 e0 54 32 10 17 16 1b a3 a8
-
-CALLBACK, event 0, msg length 87, bvci 0x1002
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 e0 54 32 10 17 16 1b a3 a8
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 87 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 91
-00 00 10 02 00 c0 de ad 02 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 11 22 33 40 50 60 19 54 ab b3 18 05 f4 c0 de ad 03 17 16 6e 58 26
-
-result (RA UDP ACC (P-TMSI 3)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 11
- RAID patched (SGSN): 3
- APN patched : 1
- TLLI patched (BSS ): 8
- TLLI patched (SGSN): 7
- P-TMSI patched (SGSN): 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01/c0dead03 -> efe2b700/e0543210, IMSI 12131415161718, AGE 0
-PROCESSING RA UPD COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 08 01 c0 19 08 0a d5 5f 5e
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 08 01 c0 19 08 0a d5 5f 5e
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 e0 54 32 10 00 00 04 08 88 21 63 54 40 50 60 70 80 00 80 0e 00 08 01 c0 19 08 0a d5 5f 5e
-
-result (RA UPD COMPLETE) = 0
-
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 e0 54 32 10 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 e0 54 32 10 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 12
- RAID patched (SGSN): 3
- APN patched : 1
- TLLI patched (BSS ): 9
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 23
-00 00 00 00 2c 1f 84 e0 54 32 10 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 12
- RAID patched (SGSN): 3
- APN patched : 1
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING BVC_SUSPEND from 0x01020304:1111
-00 00 00 00 0b 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60
-
-CALLBACK, event 0, msg length 15, bvci 0x0000
-00 00 00 00 0b 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 15 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 19
-00 00 00 00 0b 1f 84 e0 54 32 10 1b 86 21 63 54 40 50 60
-
-result (BVC_SUSPEND) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 3
- APN patched : 1
- TLLI patched (BSS ): 11
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 21 63 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 21 63 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 4
- APN patched : 1
- TLLI patched (BSS ): 11
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 3
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING PAGING_PS from 0x05060708:32000
-00 00 00 00 06 0d 88 11 12 13 14 15 16 17 f8 0a 82 07 04 1b 86 11 22 33 40 50 60 18 83 00 00 00 20 84 e0 54 32 10
-
-CALLBACK, event 0, msg length 34, bvci 0x0000
-00 00 00 00 06 0d 88 11 12 13 14 15 16 17 f8 0a 82 07 04 1b 86 11 22 33 40 50 60 18 83 00 00 00 20 84 e0 54 32 10
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 34 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 38
-00 00 00 00 06 0d 88 11 12 13 14 15 16 17 f8 0a 82 07 04 1b 86 11 22 33 40 50 60 18 83 00 00 00 20 84 c0 de ad 03
-
-result (PAGING_PS) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 5
- APN patched : 1
- TLLI patched (BSS ): 11
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 4
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- PDP Activation Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 23
-00 00 00 00 2c 1f 84 e0 54 32 10 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Gbproxy global:
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 00 f1 99 00 63 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 00 f1 99 00 63 60 1d 81 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 28
-00 00 00 00 41 07 81 21 15 92 0c 1f 84 e0 54 32 10 1b 86 00 f1 99 00 63 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- Patch error: no peer : 1
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 99 69 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 e0 54 32 10 1b 86 99 69 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- Patch error: no peer : 1
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 00 83 00 00 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 58, bvci 0x1002
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 00 83 00 00 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 58 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 62
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 00 83 00 00 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ee ba db ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-result (GMM INFO) = 0
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 1d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb aa cc a3
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 1d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb aa cc a3
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 e0 54 32 10 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 1d 08 05 01 18 05 f4 e0 54 32 10 19 03 b9 97 cb ea 6d af
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 14
- RAID patched (SGSN): 6
- APN patched : 1
- TLLI patched (BSS ): 13
- TLLI patched (SGSN): 10
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 4
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- Detach Request count : 1
- PDP Activation Request count : 1
- TLLI from SGSN unknown : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead03 -> e0543210, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 e0 54 32 10 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 19 08 06 00 04 ff 52
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 e0 54 32 10 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 19 08 06 00 04 ff 52
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 19 08 06 00 04 ff 52
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 14
- RAID patched (SGSN): 6
- APN patched : 1
- TLLI patched (BSS ): 13
- TLLI patched (SGSN): 11
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 4
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 2
- RoutingArea Update Accept count : 2
- RoutingArea Update Compltd count: 1
- Detach Request count : 1
- Detach Accept count : 1
- PDP Activation Request count : 1
- TLLI from SGSN unknown : 2
- TLLI-Cache: 0
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- Patch error: no peer : 1
-=== test_gbproxy_ptmsi_patching_bad_cases ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 01 0c 0a 29
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT (duplicated) from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 09 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 1d 9e 24
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 09 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 1d 9e 24
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 09 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 01 42 f6 fc
-
-result (ATTACH ACCEPT (duplicated)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 09 08 03 39 d7 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 2
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 0d 08 21 68 71 6b
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 4
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 2
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 0d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 37 67 c6
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 5
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 4
- TLLI patched (SGSN): 4
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 2
- Attach Completed count : 1
- Detach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 11 08 06 00 cf 8a 58
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 11 08 06 00 cf 8a 58
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 11 08 06 00 cf 8a 58
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 5
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 4
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 2
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI-Cache: 0
-Gbproxy global:
-=== test_gbproxy_imsi_acquisition ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 21 63 54 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 8e cd 32
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- TLLI patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- TLLI patched (BSS ): 1
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 01 0c 0a 29
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 5
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 5
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING XID (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-CALLBACK, event 0, msg length 38, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 38 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 42
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-result (XID (UL)) = 0
-
-PROCESSING XID (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-CALLBACK, event 0, msg length 70, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 70 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 74
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-result (XID (DL)) = 0
-
-PROCESSING LL11 DNS QUERY (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-CALLBACK, event 0, msg length 89, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 89 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 93
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-result (LL11 DNS QUERY (UL)) = 0
-
-PROCESSING LL11 DNS RESP (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-CALLBACK, event 0, msg length 267, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 267 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 271
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-result (LL11 DNS RESP (DL)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 5
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 23
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 6
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING LLC_DISCARDED from 0x05060708:32000
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 25 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 29
-00 00 00 00 41 07 81 27 15 93 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 6
- TLLI patched (SGSN): 6
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING BVC_SUSPEND from 0x01020304:1111
-00 00 00 00 0b 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60
-
-CALLBACK, event 0, msg length 15, bvci 0x0000
-00 00 00 00 0b 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 15 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 19
-00 00 00 00 0b 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60
-
-result (BVC_SUSPEND) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 8
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 6
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 8
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 7
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 23
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 ee e1 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Gbproxy global:
- BSSGP protocol error (SGSN): 1
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 00 f1 99 00 63 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 00 f1 99 00 63 60 1d 81 01
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 28
-00 00 00 00 41 07 81 21 15 92 0c 1f 84 ef e2 b7 00 1b 86 00 f1 99 00 63 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- BSSGP protocol error (SGSN): 1
- Patch error: no peer : 1
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 99 69 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 99 69 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- BSSGP protocol error (SGSN): 1
- Patch error: no peer : 1
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 9
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 9
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI-Cache: 0
-PROCESSING RA UPD REQ from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (RA UPD REQ) = 0
-
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 19 08 16 08 11 12 13 14 15 16 17 f8 9f c7 7a
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 19 08 16 08 11 12 13 14 15 16 17 f8 9f c7 7a
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 85 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 89
-00 00 10 02 01 78 de ad 02 00 00 04 08 88 21 63 54 00 63 60 70 80 00 80 0e 00 3e 01 c0 15 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 96 3e 97
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead02, IMSI 12131415161718, AGE 0
-PROCESSING RA UDP ACC from 0x05060708:32000
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 ef e2 b7 00 17 16 36 98 77
-
-CALLBACK, event 0, msg length 87, bvci 0x1002
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 21 63 54 40 50 60 19 54 ab b3 18 05 f4 ef e2 b7 00 17 16 36 98 77
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 87 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 91
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9d 41 c0 11 08 09 00 49 11 22 33 40 50 60 19 54 ab b3 18 05 f4 c0 de ad 03 17 16 6e 58 26
-
-result (RA UDP ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 10
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead03 -> 78dead02/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 1d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb aa cc a3
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 1d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb aa cc a3
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 06 00 11 f5 c0
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 10
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 2
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead03 -> 78dead02/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 15 08 06 00 f7 35 f0
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 11
- P-TMSI patched (SGSN): 2
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 2
- Detach Accept count : 2
- TLLI-Cache: 0
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 b6 bb
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 b6 bb
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 25 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 1d aa 57
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 25 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 1d aa 57
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 05 08 15 01 8f 47 9e
-
-result (ATTACH REQUEST) = 0
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 29 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb d9 1d ef
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 29 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb d9 1d ef
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 09 08 06 00 da 80 ca
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 11
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 3
- Detach Accept count : 2
- TLLI-Cache: 0
-PROCESSING DETACH REQ (unknown TLLI) from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 2d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 0d 30 0d
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 2d 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 0d 30 0d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 06 00 11 f5 c0
-
-result (DETACH REQ (unknown TLLI)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 11
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 1
- RoutingArea Update Accept count : 1
- Detach Request count : 4
- Detach Accept count : 2
- TLLI-Cache: 0
-PROCESSING RA UPD REQ from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 31 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 d8 cf d8
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 31 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 d8 cf d8
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (RA UPD REQ) = 0
-
-PROCESSING RA UPD REQ from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 35 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 ac 9c 37
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 70 80 00 80 0e 00 3e 01 c0 35 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 ac 9c 37
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 05 08 15 01 8f 47 9e
-
-result (RA UPD REQ) = 0
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 39 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 44 b6 8a
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 39 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 44 b6 8a
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 09 08 06 00 da 80 ca
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 11
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 1
- Attach Completed count : 1
- RoutingArea Update Request count: 3
- RoutingArea Update Accept count : 1
- Detach Request count : 5
- Detach Accept count : 2
- TLLI-Cache: 0
-Gbproxy global:
- Invalid Routing Area Identifier : 1
- BSSGP protocol error (SGSN): 1
- Patch error: no peer : 1
-=== test_gbproxy_secondary_sgsn ===
---- Initialise SGSN 1 ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise SGSN 2 ---
-
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 12
-02 00 81 01 01 82 01 03 04 82 01 02
-
-PROCESSING RESET_ACK from 0x15161718:32001
-03 01 82 01 03 04 82 01 02
-
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x15161718:32001
-0b
-
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x15161718:32001
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0103/21.22.23.24:32001
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x15161718:32001
-0a
-
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x0000(0)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 00 00 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 00 00 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 00 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 00 00
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 00 00
-
-result (BVC_RESET_ACK) = -2
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 21 63 54 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-PROCESSING BVC_RESET_ACK from 0x15161718:32001
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 6
- Bytes at NS Level ( In): 59
- Bytes at NS Level (Out): 30
- VCI 0x0103, NSEI 0x0102, peer 0x15161718:32001
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 6
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 30
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
- Invalid BVC Identifier : 1
- Patch error: no peer : 1
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- TLLI-Cache: 0
---- Flow control ---
-
-PROCESSING FLOW_CONTROL_BVC from 0x01020304:1111
-00 00 10 02 26 1e 81 01 05 82 01 dc 03 82 02 76 01 82 00 50 1c 82 02 58 06 82 00 03
-
-CALLBACK, event 0, msg length 24, bvci 0x1002
-00 00 10 02 26 1e 81 01 05 82 01 dc 03 82 02 76 01 82 00 50 1c 82 02 58 06 82 00 03
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 28
-00 00 10 02 26 1e 81 01 05 82 01 dc 03 82 02 76 01 82 00 50 1c 82 02 58 06 82 00 03
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 28
-00 00 10 02 26 1e 81 01 05 82 01 dc 03 82 02 76 01 82 00 50 1c 82 02 58 06 82 00 03
-
-result (FLOW_CONTROL_BVC) = 0
-
-PROCESSING FLOW_CONTROL_BVC_ACK from 0x05060708:32000
-00 00 10 02 27 1e 81 01
-
-CALLBACK, event 0, msg length 4, bvci 0x1002
-00 00 10 02 27 1e 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 4 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 8
-00 00 10 02 27 1e 81 01
-
-result (FLOW_CONTROL_BVC_ACK) = 0
-
-PROCESSING FLOW_CONTROL_BVC_ACK from 0x15161718:32001
-00 00 10 02 27 1e 81 01
-
-CALLBACK, event 0, msg length 4, bvci 0x1002
-00 00 10 02 27 1e 81 01
-
-result (FLOW_CONTROL_BVC_ACK) = 0
-
---- Establish GPRS connection (SGSN 1) ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress, SGSN NSEI 65535
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 2
- TLLI patched (BSS ): 1
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 78 de ad 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 1
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 78dead00, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 01 0c 0a 29
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 3
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 2
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 2
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead/c0dead01 -> 78dead00/efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 4
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 3
- TLLI patched (SGSN): 3
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING XID (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-CALLBACK, event 0, msg length 38, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 38 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 42
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-result (XID (UL)) = 0
-
-PROCESSING XID (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-CALLBACK, event 0, msg length 70, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 70 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 74
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-result (XID (DL)) = 0
-
-PROCESSING LL11 DNS QUERY (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-CALLBACK, event 0, msg length 89, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 89 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 93
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-result (LL11 DNS QUERY (UL)) = 0
-
-PROCESSING LL11 DNS RESP (DL) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-CALLBACK, event 0, msg length 267, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 267 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 271
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-result (LL11 DNS RESP (DL)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 6
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 5
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 01 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 23
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 6
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 6
- TLLI patched (SGSN): 5
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING LLC_DISCARDED from 0x05060708:32000
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 25 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 29
-00 00 00 00 41 07 81 27 15 93 2c 1f 84 ef e2 b7 00 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 6
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 6
- TLLI patched (SGSN): 6
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING BVC_SUSPEND from 0x01020304:1111
-00 00 00 00 0b 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60
-
-CALLBACK, event 0, msg length 15, bvci 0x0000
-00 00 00 00 0b 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 15 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 19
-00 00 00 00 0b 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60
-
-result (BVC_SUSPEND) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 1
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 6
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING BVC_SUSPEND_ACK from 0x05060708:32000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 ef e2 b7 00 1b 86 21 63 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 01 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 7
- P-TMSI patched (SGSN): 1
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
---- Establish GPRS connection (SGSN 2) ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 11 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 bf 00 5c
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 11 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 bf 00 5c
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 7
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 7
- TLLI patched (SGSN): 7
- P-TMSI patched (SGSN): 1
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 78dead02, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress, SGSN NSEI 65535
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 15 08 16 08 11 12 99 99 99 16 17 f8 18 39 de
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 15 08 16 08 11 12 99 99 99 16 17 f8 18 39 de
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 79
-00 00 10 02 01 78 de ad 02 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 11 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 bf 00 5c
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 8
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 8
- TLLI patched (SGSN): 7
- P-TMSI patched (SGSN): 1
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 78dead02, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT REQUEST from 0x15161718:32001
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 0e 89 41 c0 0d 08 15 01 0c a6 18
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 8
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 8
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 1
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 78dead02, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 19 08 16 08 11 12 99 99 99 16 17 f8 0f 28 35
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 be ef 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 19 08 16 08 11 12 99 99 99 16 17 f8 0f 28 35
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 44
-00 00 10 02 01 78 de ad 02 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 19 08 16 08 11 12 99 99 99 16 17 f8 0f 28 35
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 2
- TLLI patched (BSS ): 9
- TLLI patched (SGSN): 8
- P-TMSI patched (SGSN): 1
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef -> 78dead02, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH ACCEPT from 0x15161718:32001
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 e0 98 76 54 cb 1c 5b
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 02 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 e0 98 76 54 cb 1c 5b
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 be ef 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 03 32 40 fa
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 9
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 9
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef/c0dead03 -> 78dead02/e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 03 5e 3a ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 03 5e 3a ea
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 35
-00 00 10 02 01 e0 98 76 54 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 03 5e 3a ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 9
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI 8000beef/c0dead03 -> 78dead02/e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING GMM INFO from 0x15161718:32001
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 88 41 c0 15 08 21 bb c1 c6
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 10
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 10
- TLLI patched (SGSN): 10
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING XID (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-CALLBACK, event 0, msg length 38, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 38 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 42
-00 00 10 02 01 e0 98 76 54 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 0f 41 fb 01 00 0e 00 64 11 05 16 01 90 66 b3 28
-
-result (XID (UL)) = 0
-
-PROCESSING XID (DL) from 0x15161718:32001
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-CALLBACK, event 0, msg length 70, bvci 0x1002
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 70 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 74
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 8c 41 fb 30 84 10 61 b6 64 e4 a9 1a 9e
-
-result (XID (DL)) = 0
-
-PROCESSING LL11 DNS QUERY (UL) from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-CALLBACK, event 0, msg length 89, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 89 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 93
-00 00 10 02 01 e0 98 76 54 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 42 0b c0 01 65 00 00 00 45 00 00 38 95 72 00 00 45 11 20 85 0a c0 07 e4 ac 10 01 0a ad ab 00 35 00 24 0e 1c 3b e0 01 00 00 01 00 00 00 00 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 47 8f 07
-
-result (LL11 DNS QUERY (UL)) = 0
-
-PROCESSING LL11 DNS RESP (DL) from 0x15161718:32001
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-CALLBACK, event 0, msg length 267, bvci 0x1002
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 267 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 271
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 00 d0 4b c0 01 65 00 00 00 45 00 00 c6 00 00 40 00 3e 11 7c 69 ac 10 01 0a 0a c0 07 e4 00 35 ad ab 00 b2 74 4e 3b e0 81 80 00 01 00 01 00 05 00 00 01 6d 05 68 65 69 73 65 02 64 65 00 00 01 00 01 c0 0c 00 01 00 01 00 00 0e 10 00 04 c1 63 90 58 c0 0e 00 02 00 01 00 00 0e 10 00 16 03 6e 73 32 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 03 6e 65 74 00 c0 0e 00 02 00 01 00 00 0e 10 00 10 02 6e 73 01 73 08 70 6c 75 73 6c 69 6e 65 c0 14 c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 0e c0 0e 00 02 00 01 00 00 0e 10 00 05 02 6e 73 c0 5f c0 0e 00 02 00 01 00 00 0e 10 00 12 02 6e 73 0c 70 6f 70 2d 68 61 6e 6e 6f 76 65 72 c0 14 aa df 31
-
-result (LL11 DNS RESP (DL)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 12
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 12
- TLLI patched (SGSN): 12
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING LLC_DISCARDED from 0x01020304:1111
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 c0 de ad 03 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x0000, msg length 19 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 23
-00 00 00 00 2c 1f 84 e0 98 76 54 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 12
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 13
- TLLI patched (SGSN): 12
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING LLC_DISCARDED from 0x15161718:32001
-00 00 00 00 2c 1f 84 e0 98 76 54 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-CALLBACK, event 0, msg length 19, bvci 0x0000
-00 00 00 00 2c 1f 84 e0 98 76 54 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x0000, msg length 25 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 29
-00 00 00 00 41 07 81 27 15 93 2c 1f 84 e0 98 76 54 0f 81 01 04 82 10 02 25 83 00 00 0c
-
-result (LLC_DISCARDED) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 12
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 13
- TLLI patched (SGSN): 13
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING BVC_SUSPEND from 0x01020304:1111
-00 00 00 00 0b 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60
-
-CALLBACK, event 0, msg length 15, bvci 0x0000
-00 00 00 00 0b 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x0000, msg length 15 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 19
-00 00 00 00 0b 1f 84 e0 98 76 54 1b 86 21 63 54 40 50 60
-
-result (BVC_SUSPEND) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 3
- TLLI patched (BSS ): 14
- TLLI patched (SGSN): 13
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING BVC_SUSPEND_ACK from 0x15161718:32001
-00 00 00 00 0c 1f 84 e0 98 76 54 1b 86 21 63 54 40 50 60 1d 81 01
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 0c 1f 84 e0 98 76 54 1b 86 21 63 54 40 50 60 1d 81 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 22
-00 00 00 00 0c 1f 84 c0 de ad 03 1b 86 11 22 33 40 50 60 1d 81 01
-
-result (BVC_SUSPEND_ACK) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 14
- TLLI patched (SGSN): 14
- P-TMSI patched (SGSN): 2
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
---- Establish GPRS connection (SGSN 2, P-TMSI collision) ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 b6 bb
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 b6 bb
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 fe ed 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 13
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 14
- TLLI patched (SGSN): 14
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed -> 78dead04, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress, SGSN NSEI 65535
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 25 08 16 08 11 12 99 99 99 26 27 f8 94 16 f5
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 25 08 16 08 11 12 99 99 99 26 27 f8 94 16 f5
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 79
-00 00 10 02 01 78 de ad 04 00 00 04 08 88 21 63 54 00 63 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 b6 bb
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 14
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 15
- TLLI patched (SGSN): 14
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed -> 78dead04, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT REQUEST from 0x15161718:32001
-00 00 10 02 00 78 de ad 04 00 50 20 16 82 02 58 0e 89 41 c0 19 08 15 01 a2 f2 a4
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 78 de ad 04 00 50 20 16 82 02 58 0e 89 41 c0 19 08 15 01 a2 f2 a4
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 fe ed 00 50 20 16 82 02 58 0e 89 41 c0 19 08 15 01 a2 f2 a4
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 14
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 15
- TLLI patched (SGSN): 15
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed -> 78dead04, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 29 08 16 08 11 12 99 99 99 26 27 f8 83 07 1e
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 fe ed 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 29 08 16 08 11 12 99 99 99 26 27 f8 83 07 1e
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 44
-00 00 10 02 01 78 de ad 04 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 11 01 c0 29 08 16 08 11 12 99 99 99 26 27 f8 83 07 1e
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 15
- RAID patched (SGSN): 4
- TLLI patched (BSS ): 16
- TLLI patched (SGSN): 15
- P-TMSI patched (SGSN): 2
- Attach Request count : 3
- Attach Accept count : 2
- Attach Completed count : 2
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed -> 78dead04, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH ACCEPT (P-TMSI 1) from 0x15161718:32001
-00 00 10 02 00 78 de ad 04 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 9e 41 c0 1d 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 74 91 01
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 78 de ad 04 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 9e 41 c0 1d 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 74 91 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 80 00 fe ed 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 9e 41 c0 1d 08 02 01 49 04 11 22 33 40 50 60 19 cd d7 08 17 16 18 05 f4 c0 de ad 05 3e 78 6e
-
-result (ATTACH ACCEPT (P-TMSI 1)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 15
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 16
- TLLI patched (SGSN): 16
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 2
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed/c0dead05 -> 78dead04/efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 c0 de ad 05 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 2d 08 03 43 50 ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 c0 de ad 05 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 2d 08 03 43 50 ea
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 08 01 c0 2d 08 03 43 50 ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 16
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 17
- TLLI patched (SGSN): 16
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI 8000feed/c0dead05 -> 78dead04/efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
-PROCESSING GMM INFO from 0x15161718:32001
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 88 41 c0 21 08 21 ca 60 90
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 88 41 c0 21 08 21 ca 60 90
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 c0 de ad 05 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 88 41 c0 21 08 21 ca 60 90
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 16
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 17
- TLLI patched (SGSN): 17
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
---- Shutdown GPRS connection (SGSN 1) ---
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 31 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 57 e6 15
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 01 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 31 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 57 e6 15
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 31 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 57 e6 15
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 17
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 18
- TLLI patched (SGSN): 17
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI c0dead01 -> efe2b700, IMSI 12131415161718, AGE 0, SGSN NSEI 256
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 25 08 06 00 4d 09 cd
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 25 08 06 00 4d 09 cd
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 01 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 25 08 06 00 4d 09 cd
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 17
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 18
- TLLI patched (SGSN): 18
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
---- Shutdown GPRS connection (SGSN 2) ---
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 35 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 83 cb f7
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 03 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 35 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 83 cb f7
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 48
-00 00 10 02 01 e0 98 76 54 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 35 08 05 01 18 05 f4 e0 98 76 54 19 03 b9 97 cb b4 31 31
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 18
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 19
- TLLI patched (SGSN): 18
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 2
- Detach Accept count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI c0dead03 -> e0987654, IMSI 12199999961718, AGE 0, IMSI matches, SGSN NSEI 258
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
-PROCESSING DETACH ACC from 0x15161718:32001
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 89 41 c0 29 08 06 00 be c3 6f
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 e0 98 76 54 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 89 41 c0 29 08 06 00 be c3 6f
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 03 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 16 17 f8 00 81 00 0e 89 41 c0 29 08 06 00 be c3 6f
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 18
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 19
- TLLI patched (SGSN): 19
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 2
- Detach Accept count : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
---- Shutdown GPRS connection (SGSN 2, P-TMSI 1) ---
-
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 c0 de ad 05 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 39 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 44 b6 8a
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 c0 de ad 05 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 39 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 44 b6 8a
-
-NS UNITDATA MESSAGE to SGSN 2, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN 2 at 0x15161718:32001, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 21 63 54 40 50 60 12 34 00 80 0e 00 15 01 c0 39 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 44 b6 8a
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 19
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 20
- TLLI patched (SGSN): 19
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 3
- Detach Accept count : 2
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0dead05 -> efe2b700, IMSI 12199999962728, AGE 0, IMSI matches, SGSN NSEI 258
-PROCESSING DETACH ACC from 0x15161718:32001
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 89 41 c0 2d 08 06 00 86 7c c7
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 89 41 c0 2d 08 06 00 86 7c c7
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 c0 de ad 05 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 99 99 99 26 27 f8 00 81 00 0e 89 41 c0 2d 08 06 00 86 7c c7
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- RAID patched (BSS ): 19
- RAID patched (SGSN): 5
- TLLI patched (BSS ): 20
- TLLI patched (SGSN): 20
- P-TMSI patched (BSS ): 1
- P-TMSI patched (SGSN): 3
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 3
- Detach Accept count : 3
- TLLI-Cache: 0
-Gbproxy global:
- Invalid BVC Identifier : 1
- BSSGP protocol error (SGSN): 2
- Patch error: no peer : 1
-=== test_gbproxy_keep_info ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Send message from BSS 1 to SGSN, BVCI 0x1002 ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 05 08 16 08 11 12 13 14 15 16 17 f8 07 e1 ae
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 40 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 44
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 05 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 53 62 f1
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 0d 08 03 55 1c ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 09 08 21 04 ba 3d
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 44 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 48
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 11 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 6d b1 de
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 0d 08 06 00 aa ab ee
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 15 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e6 71 c7
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 15 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e6 71 c7
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 15 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e6 71 c7
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 1
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 11 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 3a 6d d4
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 19 08 03 32 f1 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 19 08 03 32 f1 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 19 08 03 32 f1 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ (re-attach) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 15 08 05 01 25 0a 67 0e 96
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 15 08 05 01 25 0a 67 0e 96
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 15 08 05 01 25 0a 67 0e 96
-
-result (DETACH REQ (re-attach)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 06 3d 1c 8b
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 06 3d 1c 8b
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 1d 08 06 3d 1c 8b
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 2
- Attach Accept count : 2
- Attach Completed count : 2
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 db cc
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 db cc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 21 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 44 db cc
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 3
- Attach Accept count : 2
- Attach Completed count : 2
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 19 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 27 3c 84
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 19 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 27 3c 84
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 19 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 27 3c 84
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 2
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 25 08 03 9b c6 47
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 25 08 03 9b c6 47
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 25 08 03 9b c6 47
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 1d 08 05 02 25 0a dd 56 6c
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 1d 08 05 02 25 0a dd 56 6c
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 1d 08 05 02 25 0a dd 56 6c
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 29 08 06 4c bd dd
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 29 08 06 4c bd dd
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 29 08 06 4c bd dd
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 3
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST (IMSI) from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 2d 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f0 f7 35
-
-CALLBACK, event 0, msg length 78, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 2d 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f0 f7 35
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 78 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 82
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 2d 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f0 f7 35
-
-result (ATTACH REQUEST (IMSI)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 4
- Attach Accept count : 3
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 21 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 cf 80 6e
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 21 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 cf 80 6e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 21 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 cf 80 6e
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 4
- Attach Accept count : 4
- Attach Completed count : 3
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 31 08 03 fc 2b 11
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 31 08 03 fc 2b 11
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 31 08 03 fc 2b 11
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 4
- Attach Accept count : 4
- Attach Completed count : 4
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 25 08 05 02 25 0a 8e ee 85
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 25 08 05 02 25 0a 8e ee 85
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 25 08 05 02 25 0a 8e ee 85
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 4
- Attach Accept count : 4
- Attach Completed count : 4
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 35 08 06 f3 c6 26
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 35 08 06 f3 c6 26
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 35 08 06 f3 c6 26
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 4
- Attach Accept count : 4
- Attach Completed count : 4
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 39 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e4 85 12
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 39 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e4 85 12
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 39 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 e4 85 12
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 5
- Attach Accept count : 4
- Attach Completed count : 4
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 29 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 d2 d1 3e
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 29 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 d2 d1 3e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 29 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 d2 d1 3e
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 5
- Attach Accept count : 5
- Attach Completed count : 4
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 3d 08 03 48 76 ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 3d 08 03 48 76 ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 3d 08 03 48 76 ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 5
- Attach Accept count : 5
- Attach Completed count : 5
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING RA UPD REQ from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 41 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 30 73 32
-
-CALLBACK, event 0, msg length 85, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 41 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 30 73 32
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 85 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 89
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 70 80 00 80 0e 00 3e 01 c0 41 08 08 10 11 22 33 40 50 60 1d 19 13 42 33 57 2b f7 c8 48 02 13 48 50 c8 48 02 14 48 50 c8 48 02 17 49 10 c8 48 02 00 19 8b b2 92 17 16 27 07 04 31 02 e5 e0 32 02 20 00 30 73 32
-
-result (RA UPD REQ) = 0
-
-PROCESSING RA UDP REJ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8a 41 c0 2d 08 0b 0a 00 41 30 a7
-
-CALLBACK, event 0, msg length 68, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8a 41 c0 2d 08 0b 0a 00 41 30 a7
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 68 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 72
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8a 41 c0 2d 08 0b 0a 00 41 30 a7
-
-result (RA UDP REJ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 5
- Attach Accept count : 5
- Attach Completed count : 5
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 45 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 50 cc c3
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 45 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 50 cc c3
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 5
- Attach Completed count : 5
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 2
- TLLI-Cache: 2
- TLLI afe2b700 -> afe2b700, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 49 08 16 08 11 12 13 14 15 16 17 f8 2c 2e b9
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 49 08 16 08 11 12 13 14 15 16 17 f8 2c 2e b9
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 45 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 50 cc c3
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 5
- Attach Completed count : 5
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 31 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 f5 22 ce
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 31 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 f5 22 ce
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 31 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 f5 22 ce
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 6
- Attach Completed count : 5
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 4d 08 03 79 84 ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 4d 08 03 79 84 ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 4d 08 03 79 84 ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 6
- Attach Completed count : 6
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 35 08 05 02 25 0a 9b fa 57
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 35 08 05 02 25 0a 9b fa 57
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 35 08 05 02 25 0a 9b fa 57
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 6
- Attach Completed count : 6
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 51 08 06 a5 d9 70
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 51 08 06 a5 d9 70
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 51 08 06 a5 d9 70
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 6
- Attach Accept count : 6
- Attach Completed count : 6
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST (local TLLI) from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 55 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f9 cc e9
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 55 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f9 cc e9
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 55 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 f9 cc e9
-
-result (ATTACH REQUEST (local TLLI)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 7
- Attach Accept count : 6
- Attach Completed count : 6
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 39 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 e8 73 9e
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 39 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 e8 73 9e
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 39 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 e8 73 9e
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 7
- Attach Accept count : 7
- Attach Completed count : 6
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 59 08 03 1e 69 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 59 08 03 1e 69 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 59 08 03 1e 69 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 7
- Attach Accept count : 7
- Attach Completed count : 7
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ (re-attach) from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 3d 08 05 01 25 0a 21 a2 ad
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 3d 08 05 01 25 0a 21 a2 ad
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 3d 08 05 01 25 0a 21 a2 ad
-
-result (DETACH REQ (re-attach)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 7
- Attach Accept count : 7
- Attach Completed count : 7
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 5d 08 06 11 84 8b
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 5d 08 06 11 84 8b
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 5d 08 06 11 84 8b
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 7
- Attach Accept count : 7
- Attach Completed count : 7
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 61 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 5b 66 e2
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 61 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 5b 66 e2
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 61 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 5b 66 e2
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 8
- Attach Accept count : 7
- Attach Completed count : 7
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 41 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 9e 50 40
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 41 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 9e 50 40
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 41 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 9e 50 40
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 8
- Attach Accept count : 8
- Attach Completed count : 7
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 65 08 03 b7 5e 47
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 65 08 03 b7 5e 47
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 65 08 03 b7 5e 47
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 8
- Attach Accept count : 8
- Attach Completed count : 8
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 45 08 21 9c 7f c6
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 45 08 21 9c 7f c6
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 45 08 21 9c 7f c6
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 8
- Attach Accept count : 8
- Attach Completed count : 8
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH REQUEST (unexpected, IMSI) from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 69 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 b4 63 cd
-
-CALLBACK, event 0, msg length 78, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 69 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 b4 63 cd
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 78 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 82
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 37 01 c0 69 08 01 02 f5 e0 21 08 02 08 11 12 13 14 15 16 17 f8 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 b4 63 cd
-
-result (ATTACH REQUEST (unexpected, IMSI)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 9
- Attach Accept count : 8
- Attach Completed count : 8
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 49 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 83 01 10
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 49 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 83 01 10
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 49 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 83 01 10
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 9
- Attach Accept count : 9
- Attach Completed count : 8
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 6d 08 03 6f c8 ea
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 6d 08 03 6f c8 ea
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 6d 08 03 6f c8 ea
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 9
- Attach Accept count : 9
- Attach Completed count : 9
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 4d 08 05 02 25 0a 51 0e 1b
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 4d 08 05 02 25 0a 51 0e 1b
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 4d 08 05 02 25 0a 51 0e 1b
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 9
- Attach Accept count : 9
- Attach Completed count : 9
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 71 08 06 b3 95 70
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 71 08 06 b3 95 70
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 71 08 06 b3 95 70
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 9
- Attach Accept count : 9
- Attach Completed count : 9
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 75 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 ab 17 53
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 75 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 ab 17 53
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 75 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 ab 17 53
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 10
- Attach Accept count : 9
- Attach Completed count : 9
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 51 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 a4 f2 e0
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 51 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 a4 f2 e0
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 51 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 a4 f2 e0
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 10
- Attach Accept count : 10
- Attach Completed count : 9
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 79 08 03 08 25 bc
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 79 08 03 08 25 bc
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 79 08 03 08 25 bc
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 10
- Attach Accept count : 10
- Attach Completed count : 10
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING GMM INFO from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 55 08 21 97 59 c6
-
-CALLBACK, event 0, msg length 66, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 55 08 21 97 59 c6
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 66 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 70
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 88 41 c0 55 08 21 97 59 c6
-
-result (GMM INFO) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 10
- Attach Accept count : 10
- Attach Completed count : 10
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH REQUEST (unexpected) from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 7d 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 a2 24 d0
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 7d 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 a2 24 d0
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 7d 08 01 02 f5 e0 21 08 02 05 f4 ef e2 b7 00 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 a2 24 d0
-
-result (ATTACH REQUEST (unexpected)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 11
- Attach Accept count : 10
- Attach Completed count : 10
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH ACCEPT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 59 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 b9 a3 b0
-
-CALLBACK, event 0, msg length 88, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 59 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 b9 a3 b0
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 88 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 92
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 9e 41 c0 59 08 02 01 49 04 21 63 54 40 50 60 19 cd d7 08 17 16 18 05 f4 ef e2 b7 00 b9 a3 b0
-
-result (ATTACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 11
- Attach Accept count : 11
- Attach Completed count : 10
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH COMPLETE from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 81 08 03 b9 71 10
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 81 08 03 b9 71 10
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 81 08 03 b9 71 10
-
-result (ATTACH COMPLETE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 11
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700/efe2b700 -> afe2b700/efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH REQ from 0x05060708:32000
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 5d 08 05 02 25 0a 44 1a c9
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 5d 08 05 02 25 0a 44 1a c9
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 ef e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 5d 08 05 02 25 0a 44 1a c9
-
-result (DETACH REQ) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 11
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI efe2b700 -> efe2b700, IMSI 12131415161718, AGE 0
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 85 08 06 b6 9c 27
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 85 08 06 b6 9c 27
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 ef e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 85 08 06 b6 9c 27
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 11
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 89 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 21 24 df
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 89 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 21 24 df
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 12
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 8d 08 16 08 11 12 13 14 15 16 17 f8 de 48 be
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 8d 08 16 08 11 12 13 14 15 16 17 f8 de 48 be
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 89 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 21 24 df
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 12
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0
-PROCESSING ATTACH REJECT from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 61 08 04 07 79 ba a5
-
-CALLBACK, event 0, msg length 67, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 61 08 04 07 79 ba a5
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 67 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 71
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 89 41 c0 61 08 04 07 79 ba a5
-
-result (ATTACH REJECT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 12
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 91 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 81 7a 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 91 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 81 7a 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 13
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 1
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING DETACH REQ (MO) from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 95 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 9c dc fc
-
-CALLBACK, event 0, msg length 44, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 15 01 c0 95 08 05 01 18 05 f4 ef e2 b7 00 19 03 b9 97 cb 9c dc fc
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 05 08 06 00 29 4a 68
-
-result (DETACH REQ (MO)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 13
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 2
- Detach Accept count : 1
- TLLI-Cache: 0
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 99 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 88 49 82
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 99 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 88 49 82
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 14
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 2
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING DETACH REQ (MT) from 0x05060708:32000
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 65 08 05 02 25 0a 17 a2 20
-
-CALLBACK, event 0, msg length 69, bvci 0x1002
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 65 08 05 02 25 0a 17 a2 20
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 69 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 73
-00 00 10 02 00 af e2 b7 00 00 50 20 16 82 02 58 13 99 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 0a 82 08 02 0d 88 11 12 13 14 15 16 17 f8 00 81 00 0e 8b 41 c0 65 08 05 02 25 0a 17 a2 20
-
-result (DETACH REQ (MT)) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 14
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 2
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI afe2b700 -> afe2b700, IMSI 12131415161718, AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING DETACH ACC from 0x01020304:1111
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 9d 08 06 65 2c 8a
-
-CALLBACK, event 0, msg length 31, bvci 0x1002
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 9d 08 06 65 2c 8a
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 34 01 c0 99 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 88 49 82
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 31 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 35
-00 00 10 02 01 af e2 b7 00 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 08 01 c0 9d 08 06 65 2c 8a
-
-result (DETACH ACC) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 14
- Attach Reject count : 1
- Attach Accept count : 11
- Attach Completed count : 11
- RoutingArea Update Request count: 1
- RoutingArea Update Reject count : 1
- Detach Request count : 2
- Detach Accept count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED
-Gbproxy global:
-Test TLLI info expiry
-
-Test TLLI replacement:
- Add TLLI 1, IMSI 1
- Add TLLI 2, IMSI 1 (should replace TLLI 1)
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c000162e, IMSI 03242526, AGE 0, IMSI matches
-
-Test IMSI replacement:
- Add TLLI 1, IMSI 1
- Add TLLI 1, IMSI 2 (should replace IMSI 1)
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c00004d2, IMSI 06272829, AGE 0, IMSI matches
-
-Test TLLI expiry, max_len == 1:
- Add TLLI 1, IMSI 1
- Add TLLI 2, IMSI 2 (should replace IMSI 1)
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c000162e, IMSI 06272829, AGE 0, IMSI matches
-
-Test TLLI expiry, max_age == 1:
- Add TLLI 1, IMSI 1 (should expire after timeout)
- Add TLLI 2, IMSI 2 (should not expire after timeout)
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c000162e, IMSI 06272829, AGE 1, IMSI matches
-
-Test TLLI expiry, max_len == 2, max_age == 1:
- Add TLLI 1, IMSI 1 (should expire)
- Add TLLI 2, IMSI 2 (should expire after timeout)
- Add TLLI 3, IMSI 3 (should not expire after timeout)
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 3
- TLLI-Cache: 3
- TLLI c0000d80, IMSI 12345678, AGE 0, IMSI matches
- TLLI c000162e, IMSI 06272829, AGE 1, IMSI matches
- TLLI c00004d2, IMSI 03242526, AGE 2, IMSI matches
- Remove stale TLLIs
- Peers:
- NSEI 0, BVCI 20, not blocked, RAI 000-000-0-0
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI c0000d80, IMSI 12345678, AGE 0, IMSI matches
-
-=== test_gbproxy_stored_messages ===
---- Initialise SGSN ---
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 12
-02 00 81 01 01 82 01 01 04 82 01 00
-
-PROCESSING RESET_ACK from 0x05060708:32000
-03 01 82 01 01 04 82 01 00
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0a
-
-result (RESET_ACK) = 0
-
-PROCESSING ALIVE_ACK from 0x05060708:32000
-0b
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-06
-
-result (ALIVE_ACK) = 0
-
-PROCESSING UNBLOCK_ACK from 0x05060708:32000
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000
-
-result (UNBLOCK_ACK) = 0
-
-PROCESSING ALIVE from 0x05060708:32000
-0a
-
-MESSAGE to SGSN at 0x05060708:32000, msg length 1
-0b
-
-result (ALIVE) = 0
-
---- Initialise BSS 1 ---
-
-Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096)
-
-PROCESSING RESET from 0x01020304:1111
-02 00 81 01 01 82 10 01 04 82 10 00
-
-==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111
-
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-03 01 82 10 01 04 82 10 00
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0a
-
-result (RESET) = 0
-
-PROCESSING ALIVE from 0x01020304:1111
-0a
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-0b
-
-result (ALIVE) = 0
-
-PROCESSING UNBLOCK from 0x01020304:1111
-06
-
-MESSAGE to BSS at 0x01020304:1111, msg length 1
-07
-
-==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111
-
-result (UNBLOCK) = 0
-
-PROCESSING ALIVE_ACK from 0x01020304:1111
-0b
-
-result (ALIVE_ACK) = 0
-
-Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098)
-
-PROCESSING BVC_RESET from 0x01020304:1111
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-CALLBACK, event 0, msg length 18, bvci 0x0000
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 22
-00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00
-
-result (BVC_RESET) = 0
-
-PROCESSING BVC_RESET_ACK from 0x05060708:32000
-00 00 00 00 23 04 82 10 02
-
-CALLBACK, event 0, msg length 5, bvci 0x0000
-00 00 00 00 23 04 82 10 02
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 9
-00 00 00 00 23 04 82 10 02
-
-result (BVC_RESET_ACK) = 0
-
-Current NS-VCIs:
- VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 37
- Bytes at NS Level (Out): 21
- VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000
- Packets at NS Level ( In): 5
- Packets at NS Level (Out): 5
- Bytes at NS Level ( In): 21
- Bytes at NS Level (Out): 37
- NS-VC Block count : 1
-
-Gbproxy global:
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- TLLI-Cache: 0
---- Establish first LLC connection ---
-
-PROCESSING ATTACH REQUEST from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-CALLBACK, event 0, msg length 75, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 28
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36
-
-result (ATTACH REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING IDENT REQUEST from 0x05060708:32000
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-CALLBACK, event 0, msg length 23, bvci 0x1002
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg)
-MESSAGE to BSS at 0x01020304:1111, msg length 27
-00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba
-
-result (IDENT REQUEST) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress
-PROCESSING DETACH ACCEPT from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41
-
-CALLBACK, event 0, msg length 32, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41
-
-result (DETACH ACCEPT) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI cache size : 1
- TLLI-Cache: 1
- TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 2, IMSI acquisition in progress
-PROCESSING IDENT RESPONSE from 0x01020304:1111
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-CALLBACK, event 0, msg length 40, bvci 0x1002
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 f8 10 f0 45
-
-NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg)
-MESSAGE to SGSN at 0x05060708:32000, msg length 79
-00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01
-
-result (IDENT RESPONSE) = 0
-
-Peers:
- NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96
- Attach Request count : 1
- TLLI-Cache: 0
-Gbproxy global:
-===== GbProxy test END
-
diff --git a/tests/gprs/Makefile.am b/tests/gprs/Makefile.am
index 902313f2a..ddfd2aec0 100644
--- a/tests/gprs/Makefile.am
+++ b/tests/gprs/Makefile.am
@@ -1,9 +1,10 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+AM_LDFLAGS = -no-install
EXTRA_DIST = gprs_test.ok
-noinst_PROGRAMS = gprs_test
+check_PROGRAMS = gprs_test
gprs_test_SOURCES = gprs_test.c $(top_srcdir)/src/gprs/gprs_utils.c
diff --git a/tests/gprs/gprs_test.c b/tests/gprs/gprs_test.c
index 99e3ea519..f239b7032 100644
--- a/tests/gprs/gprs_test.c
+++ b/tests/gprs/gprs_test.c
@@ -24,7 +24,7 @@ static int nu_is_retransmission(uint16_t nu, uint16_t vur)
return ret;
}
-static void test_8_4_2()
+static void test_8_4_2(void)
{
printf("Testing gprs_llc_is_retransmit.\n");
@@ -48,6 +48,22 @@ static void test_8_4_2()
ASSERT_FALSE(nu_is_retransmission(479, 511)); // wrapped
}
+/* GSM 04.08, 10.5.7.3 GPRS Timer */
+static int gprs_tmr_to_secs(uint8_t tmr)
+{
+ switch (tmr & GPRS_TMR_UNIT_MASK) {
+ case GPRS_TMR_2SECONDS:
+ return 2 * (tmr & GPRS_TMR_FACT_MASK);
+ default:
+ case GPRS_TMR_MINUTE:
+ return 60 * (tmr & GPRS_TMR_FACT_MASK);
+ case GPRS_TMR_6MINUTE:
+ return 360 * (tmr & GPRS_TMR_FACT_MASK);
+ case GPRS_TMR_DEACTIVATED:
+ return -1;
+ }
+}
+
static void test_gprs_timer_enc_dec(void)
{
int i, u, secs, tmr;
diff --git a/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am
index fea01e0d1..22b2a522c 100644
--- a/tests/gtphub/Makefile.am
+++ b/tests/gtphub/Makefile.am
@@ -12,11 +12,13 @@ AM_CFLAGS = \
$(LIBGTP_CFLAGS) \
$(NULL)
+AM_LDFLAGS = -no-install
+
EXTRA_DIST = \
gtphub_test.ok \
$(NULL)
-noinst_PROGRAMS = \
+check_PROGRAMS = \
gtphub_test \
$(NULL)
@@ -28,6 +30,7 @@ gtphub_test_LDFLAGS = \
-Wl,--wrap=gtphub_resolve_ggsn_addr \
-Wl,--wrap=gtphub_ares_init \
-Wl,--wrap=gtphub_write \
+ $(AM_LDFLAGS) \
$(NULL)
gtphub_test_LDADD = \
diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c
index d381b9b86..5fa730a05 100644
--- a/tests/gtphub/gtphub_test.c
+++ b/tests/gtphub/gtphub_test.c
@@ -27,10 +27,11 @@
#include <osmocom/core/utils.h>
#include <osmocom/core/application.h>
+#include <osmocom/gsm/protocol/gsm_23_003.h>
#include <osmocom/sgsn/debug.h>
-#include <osmocom/sgsn/gtphub.h>
+#include <osmocom/gtphub/gtphub.h>
#include <gtp.h>
#include <gtpie.h>
@@ -376,7 +377,7 @@ static void test_expiry(void)
}
char resolve_ggsn_got_imsi[GSM23003_IMSI_MAX_DIGITS+1];
-char resolve_ggsn_got_ni[GSM_APN_LENGTH];
+char resolve_ggsn_got_ni[APN_MAXLEN+1];
struct sgsn_sockaddr resolved_ggsn_addr;
static int resolve_to_ggsn(const char *addr, uint16_t port)
@@ -529,6 +530,8 @@ static int _reply_is(const char *hex, const char *file, int line)
const char *dump = osmo_hexdump_nospc(reply_buf, len);
int cmp = strcmp(dump, hex);
+ OSMO_ASSERT(dump && hex);
+
if (cmp != 0) {
printf("\n%s:%d: reply_is(): MISMATCH\n"
" expecting:\n'%s'\n"
@@ -575,7 +578,7 @@ time_t now;
static struct gtphub _hub;
static struct gtphub *hub = &_hub;
-static int setup_test_hub()
+static int setup_test_hub(void)
{
/* Not really needed, but to make 100% sure... */
ZERO_STRUCT(hub);
@@ -611,7 +614,7 @@ static int setup_test_hub()
return 1;
}
-static int clear_test_hub()
+static int clear_test_hub(void)
{
/* expire all */
gtphub_gc(hub, now + (60 * GTPH_EXPIRE_SLOWLY_MINUTES) + 1);
@@ -815,7 +818,7 @@ static void test_echo(void)
"87" /* 135: Quality of Service (QoS) Profile */ \
"0004" /* length */ \
"00" /* priority */ \
- "0b921f" /* QoS profile data */
+ "0b921f" /* QoS profile data */
#define MSG_PDP_CTX_RSP(len, tei_h, seq, restart, tei_u, tei_c, gsn_c, gsn_u) \
"32" \
@@ -896,7 +899,7 @@ static int msg_from_ggsn(int plane_idx,
return 1;
}
-static int create_pdp_ctx()
+static int create_pdp_ctx(void)
{
const char *gtp_req_from_sgsn =
MSG_PDP_CTX_REQ("0068",
diff --git a/tests/osmo-sgsn_test-nodes.vty b/tests/osmo-sgsn_test-nodes.vty
new file mode 100644
index 000000000..32ff8e71d
--- /dev/null
+++ b/tests/osmo-sgsn_test-nodes.vty
@@ -0,0 +1,133 @@
+OsmoSGSN> enable
+OsmoSGSN# show timer
+T3312 = 600 s Periodic RA Update timer (s) (default: 600 s)
+T3313 = 30 s Waiting for paging response timer (s) (default: 30 s)
+T3314 = 44 s READY timer. Force to STANDBY on expiry timer (s) (default: 44 s)
+T3316 = 44 s AA-Ready timer (s) (default: 44 s)
+T3322 = 6 s Detach request -> accept timer (s) (default: 6 s)
+T3350 = 6 s Waiting for ATT/RAU/TMSI_COMPL timer (s) (default: 6 s)
+T3360 = 6 s Waiting for AUTH/CIPH response timer (s) (default: 6 s)
+T3370 = 6 s Waiting for IDENTITY response timer (s) (default: 6 s)
+T3385 = 8 s Wait for ACT PDP CTX REQ timer (s) (default: 8 s)
+T3386 = 8 s Wait for MODIFY PDP CTX ACK timer (s) (default: 8 s)
+T3395 = 8 s Wait for DEACT PDP CTX ACK timer (s) (default: 8 s)
+T3397 = 8 s Wait for DEACT AA PDP CTX ACK timer (s) (default: 8 s)
+X1001 = 5 s RANAP Release timeout. Wait for RANAP Release Complete.On expiry release Iu connection (s) (default: 5 s)
+OsmoSGSN# configure terminal
+OsmoSGSN(config)# list
+...
+ sgsn
+ ctrl
+...
+ ns
+ bssgp
+...
+
+OsmoSGSN(config)# sgsn
+OsmoSGSN(config-sgsn)# list
+...
+ gtp state-dir PATH
+ gtp local-ip A.B.C.D
+ ggsn <0-255> remote-ip A.B.C.D
+ ggsn <0-255> gtp-version (0|1)
+ ggsn <0-255> echo-interval <1-36000>
+ ggsn <0-255> no echo-interval
+ imsi-acl (add|del) IMSI
+ auth-policy (accept-all|closed|acl-only|remote)
+ authentication (optional|required)
+ encryption gea <0-4> [<0-4>] [<0-4>] [<0-4>] [<0-4>]
+ encryption uea <0-2> [<0-2>] [<0-2>]
+ encryption cipher-plugin-path PATH
+ no encryption cipher-plugin-path PATH
+ gsup ipa-name NAME
+ gsup remote-ip A.B.C.D
+ gsup remote-port <0-65535>
+ gsup oap-id <0-65535>
+ gsup oap-k K
+ gsup oap-opc OPC
+ apn APNAME ggsn <0-255>
+ apn APNAME imsi-prefix IMSIPRE ggsn <0-255>
+ access-point-name NAME
+ no access-point-name NAME
+ cdr filename NAME
+ no cdr filename
+ cdr trap
+ no cdr trap
+ cdr interval <1-2147483647>
+ ggsn dynamic
+ grx-dns-add A.B.C.D
+ timer [TNNNN] [(<0-2147483647>|default)]
+ timer gtp [TNNNN] [(<0-2147483647>|default)]
+ no compression rfc1144
+ compression rfc1144 active slots <1-256>
+ compression rfc1144 passive
+ no compression v42bis
+ compression v42bis active direction (ms|sgsn|both) codewords <512-65535> strlen <6-250>
+ compression v42bis passive
+...
+
+OsmoSGSN(config-sgsn)# mme test0
+OsmoSGSN(config-sgsn-mme)# gtp remote-ip 1.2.3.4
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay 907 10 567
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay 202 12 51
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay 907 10 567
+OsmoSGSN(config-sgsn-mme)# exit
+OsmoSGSN(config-sgsn)# mme test1
+OsmoSGSN(config-sgsn-mme)# gtp remote-ip 5.6.7.8
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay default
+OsmoSGSN(config-sgsn-mme)# exit
+OsmoSGSN(config-sgsn)# show running-config
+...
+sgsn
+...
+ mme test0
+ gtp remote-ip 1.2.3.4
+ gtp ran-info-relay 907 10 567
+ gtp ran-info-relay 202 12 51
+ mme test1
+ gtp remote-ip 5.6.7.8
+ gtp ran-info-relay default
+...
+OsmoSGSN(config-sgsn)# mme test0
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay default
+% Another MME test1 is already set as default route, remove it before setting it here.
+OsmoSGSN(config-sgsn-mme)# exit
+OsmoSGSN(config-sgsn)# mme test1
+OsmoSGSN(config-sgsn-mme)# no gtp ran-info-relay default
+OsmoSGSN(config-sgsn-mme)# exit
+OsmoSGSN(config-sgsn)# mme test0
+OsmoSGSN(config-sgsn-mme)# gtp ran-info-relay default
+OsmoSGSN(config-sgsn-mme)# exit
+OsmoSGSN(config-sgsn)# show running-config
+...
+sgsn
+...
+ mme test0
+ gtp remote-ip 1.2.3.4
+ gtp ran-info-relay default
+ gtp ran-info-relay 907 10 567
+ gtp ran-info-relay 202 12 51
+ mme test1
+ gtp remote-ip 5.6.7.8
+...
+OsmoSGSN(config-sgsn)# no mme test0
+OsmoSGSN(config-sgsn)# show running-config
+...
+sgsn
+...
+ no compression v42bis
+ mme test1
+ gtp remote-ip 5.6.7.8
+...
+OsmoSGSN(config-sgsn)# no mme test1
+OsmoSGSN(config-sgsn)# encryption gea 0 3
+OsmoSGSN(config-sgsn)# encryption uea 1 2
+OsmoSGSN(config-sgsn)# encryption cipher-plugin-path /foo/bar
+OsmoSGSN(config-sgsn)# show running-config
+...
+sgsn
+...
+ encryption gea 0 3
+ encryption uea 1 2
+ encryption cipher-plugin-path /foo/bar
+...
diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index b72c44634..c6c1f4a68 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -7,6 +7,7 @@ AM_CFLAGS = \
-Wall \
-ggdb3 \
$(LIBOSMOCORE_CFLAGS) \
+ $(LIBOSMOCTRL_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOGSUPCLIENT_CFLAGS) \
@@ -21,16 +22,23 @@ AM_CFLAGS += \
$(NULL)
endif
+AM_LDFLAGS = -no-install
+
EXTRA_DIST = \
sgsn_test.ok \
$(NULL)
-noinst_PROGRAMS = \
+check_PROGRAMS = \
sgsn_test \
$(NULL)
+noinst_HEADERS = \
+ gprs_gb_parse.h \
+ $(NULL)
+
sgsn_test_SOURCES = \
sgsn_test.c \
+ gprs_gb_parse.c \
$(NULL)
sgsn_test_LDFLAGS = \
@@ -39,17 +47,26 @@ sgsn_test_LDFLAGS = \
-Wl,--wrap=gprs_subscr_request_update_location \
-Wl,--wrap=gprs_subscr_request_auth_info \
-Wl,--wrap=osmo_gsup_client_send \
+ $(AM_LDFLAGS) \
$(NULL)
sgsn_test_LDADD = \
+ $(top_builddir)/src/sgsn/apn.o \
+ $(top_builddir)/src/sgsn/gprs_bssgp.o \
$(top_builddir)/src/sgsn/gprs_llc.o \
- $(top_builddir)/src/sgsn/gprs_gb.o \
+ $(top_builddir)/src/sgsn/gprs_ns.o \
$(top_builddir)/src/sgsn/gprs_sndcp.o \
$(top_builddir)/src/sgsn/gprs_gmm_attach.o \
$(top_builddir)/src/sgsn/gprs_gmm.o \
$(top_builddir)/src/sgsn/gprs_gmm_fsm.o \
$(top_builddir)/src/sgsn/gprs_mm_state_gb_fsm.o \
- $(top_builddir)/src/sgsn/gprs_sgsn.o \
+ $(top_builddir)/src/sgsn/gtp_ggsn.o \
+ $(top_builddir)/src/sgsn/gtp_mme.o \
+ $(top_builddir)/src/sgsn/mmctx.o \
+ $(top_builddir)/src/sgsn/pdpctx.o \
+ $(top_builddir)/src/sgsn/sgsn.o \
+ $(top_builddir)/src/sgsn/sgsn_cdr.o \
+ $(top_builddir)/src/sgsn/sgsn_ctrl.o \
$(top_builddir)/src/sgsn/sgsn_vty.o \
$(top_builddir)/src/sgsn/sgsn_libgtp.o \
$(top_builddir)/src/sgsn/sgsn_auth.o \
@@ -62,13 +79,14 @@ sgsn_test_LDADD = \
$(top_builddir)/src/sgsn/gprs_sndcp_pcomp.o \
$(top_builddir)/src/sgsn/v42bis.o \
$(top_builddir)/src/sgsn/gprs_sndcp_dcomp.o \
+ $(top_builddir)/src/sgsn/sgsn_rim.o \
$(top_builddir)/src/gprs/gprs_utils.o \
$(top_builddir)/src/gprs/gprs_llc_parse.o \
- $(top_builddir)/src/gprs/gprs_gb_parse.o \
$(top_builddir)/src/gprs/crc24.o \
$(top_builddir)/src/gprs/sgsn_ares.o \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOCORE_LIBS) \
+ $(LIBOSMOCTRL_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOGB_LIBS) \
$(LIBOSMOGSUPCLIENT_LIBS) \
diff --git a/src/gprs/gprs_gb_parse.c b/tests/sgsn/gprs_gb_parse.c
index e5de4d4c7..670839f73 100644
--- a/src/gprs/gprs_gb_parse.c
+++ b/tests/sgsn/gprs_gb_parse.c
@@ -18,10 +18,12 @@
*
*/
+#include <arpa/inet.h>
+
#include <osmocom/gsm/gsm48.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
+#include "gprs_gb_parse.h"
#include <osmocom/sgsn/gprs_utils.h>
@@ -437,6 +439,47 @@ int gprs_gb_parse_llc(uint8_t *llc, size_t llc_len,
return gprs_gb_parse_dtap(ghp->data, ghp->data_len, parse_ctx);
}
+/*! Determine the TLLI from the given BSSGP message.
+ * \param[in] bssgp pointer to start of BSSGP header
+ * \param[in] bssgp_len length of BSSGP message in octets
+ * \param[out] tlli TLLI (if any) in host byte order
+ * \returns 1 if TLLI found; 0 if none found; negative on parse error */
+int gprs_gb_parse_tlli(const uint8_t *bssgp, size_t bssgp_len, uint32_t *tlli)
+{
+ const struct bssgp_normal_hdr *bgph;
+ uint8_t pdu_type;
+
+ if (bssgp_len < sizeof(struct bssgp_normal_hdr))
+ return -EINVAL;
+
+ bgph = (struct bssgp_normal_hdr *)bssgp;
+ pdu_type = bgph->pdu_type;
+
+ if (pdu_type == BSSGP_PDUT_UL_UNITDATA ||
+ pdu_type == BSSGP_PDUT_DL_UNITDATA) {
+ const struct bssgp_ud_hdr *budh = (struct bssgp_ud_hdr *)bssgp;
+ if (bssgp_len < sizeof(struct bssgp_ud_hdr))
+ return -EINVAL;
+ *tlli = osmo_load32be((const uint8_t *)&budh->tlli);
+ return 1;
+ } else {
+ const uint8_t *data = bgph->data;
+ size_t data_len = bssgp_len - sizeof(*bgph);
+ struct tlv_parsed tp;
+
+ if (bssgp_tlv_parse(&tp, data, data_len) < 0)
+ return -EINVAL;
+
+ if (TLVP_PRESENT(&tp, BSSGP_IE_TLLI)) {
+ *tlli = osmo_load32be(TLVP_VAL(&tp, BSSGP_IE_TLLI));
+ return 1;
+ }
+ }
+
+ /* No TLLI present in message */
+ return 0;
+}
+
int gprs_gb_parse_bssgp(uint8_t *bssgp, size_t bssgp_len,
struct gprs_gb_parse_context *parse_ctx)
{
diff --git a/include/osmocom/sgsn/gprs_gb_parse.h b/tests/sgsn/gprs_gb_parse.h
index 9f43faed6..58de17f81 100644
--- a/include/osmocom/sgsn/gprs_gb_parse.h
+++ b/tests/sgsn/gprs_gb_parse.h
@@ -51,6 +51,8 @@ int gprs_gb_parse_llc(uint8_t *llc, size_t llc_len,
int gprs_gb_parse_bssgp(uint8_t *bssgp, size_t bssgp_len,
struct gprs_gb_parse_context *parse_ctx);
+int gprs_gb_parse_tlli(const uint8_t *bssgp, size_t bssgp_len, uint32_t *tlli);
+
const char *gprs_gb_message_name(const struct gprs_gb_parse_context *parse_ctx,
const char *default_msg_name);
diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c
index 7399573fc..a149b8e2c 100644
--- a/tests/sgsn/sgsn_test.c
+++ b/tests/sgsn/sgsn_test.c
@@ -19,43 +19,38 @@
*
*/
+#include <osmocom/core/application.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/utils.h>
+#include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/gsup.h>
+#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/vty/vty.h>
+
+#include <osmocom/gsupclient/gsup_client.h>
+
#include <osmocom/sgsn/gprs_llc.h>
#include <osmocom/sgsn/sgsn.h>
#include <osmocom/sgsn/gprs_gmm.h>
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_subscriber.h>
-#include <osmocom/gsm/gsup.h>
-#include <osmocom/gsupclient/gsup_client.h>
#include <osmocom/sgsn/gprs_utils.h>
-#include <osmocom/sgsn/gprs_gb_parse.h>
#include <osmocom/sgsn/gprs_gmm_fsm.h>
-
-#include <osmocom/gprs/gprs_bssgp.h>
-
-#include <osmocom/gsm/gsm_utils.h>
-
-#include <osmocom/core/application.h>
-#include <osmocom/core/msgb.h>
-#include <osmocom/core/rate_ctr.h>
-#include <osmocom/core/utils.h>
-#include <osmocom/vty/vty.h>
+#include <osmocom/sgsn/gtp_ggsn.h>
#include <stdio.h>
+#include "gprs_gb_parse.h"
+
void *tall_sgsn_ctx;
-static struct sgsn_instance sgsn_inst = {
- .config_file = "osmo_sgsn.cfg",
- .cfg = {
- .gtp_statedir = "./",
- .auth_policy = SGSN_AUTH_POLICY_CLOSED,
- },
-};
-struct sgsn_instance *sgsn = &sgsn_inst;
+struct sgsn_instance *sgsn;
unsigned sgsn_tx_counter = 0;
struct msgb *last_msg = NULL;
struct gprs_gb_parse_context last_dl_parse_ctx;
-static void reset_last_msg()
+static void reset_last_msg(void)
{
if (last_msg)
msgb_free(last_msg);
@@ -64,9 +59,10 @@ static void reset_last_msg()
memset(&last_dl_parse_ctx, 0, sizeof(last_dl_parse_ctx));
}
-static void cleanup_test()
+static void cleanup_test(void)
{
reset_last_msg();
+ TALLOC_FREE(sgsn);
}
static uint32_t get_new_ptmsi(const struct gprs_gb_parse_context *parse_ctx)
@@ -281,7 +277,7 @@ static void show_subscrs(FILE *out)
}
}
-static void assert_no_subscrs()
+static void assert_no_subscrs(void)
{
show_subscrs(stdout);
fflush(stdout);
@@ -383,6 +379,7 @@ static void test_auth_triplets(void)
uint32_t local_tlli = 0xffeeddcc;
printf("Testing authentication triplet handling\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* Check for emptiness */
OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
@@ -571,6 +568,7 @@ static void test_subscriber_gsup(void)
printf("Testing subscriber GSUP handling\n");
update_subscriber_data_cb = my_dummy_sgsn_update_subscriber_data;
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* Check for emptiness */
OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
@@ -747,6 +745,7 @@ static void test_gmm_detach(void)
uint32_t local_tlli;
printf("Testing GMM detach\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* DTAP - Detach Request (MO) */
/* normal detach, power_off = 0 */
@@ -788,6 +787,7 @@ static void test_gmm_detach_power_off(void)
uint32_t local_tlli;
printf("Testing GMM detach (power off)\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* DTAP - Detach Request (MO) */
/* normal detach, power_off = 1 */
@@ -828,6 +828,7 @@ static void test_gmm_detach_no_mmctx(void)
uint32_t local_tlli;
printf("Testing GMM detach (no MMCTX)\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* DTAP - Detach Request (MO) */
/* normal detach, power_off = 0 */
@@ -864,6 +865,7 @@ static void test_gmm_detach_accept_unexpected(void)
uint32_t local_tlli;
printf("Testing GMM detach accept (unexpected)\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* DTAP - Detach Accept (MT) */
/* normal detach */
@@ -900,6 +902,7 @@ static void test_gmm_status_no_mmctx(void)
uint32_t local_tlli;
printf("Testing GMM Status (no MMCTX)\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* DTAP - GMM Status, protocol error */
static const unsigned char gmm_status[] = {
@@ -1194,6 +1197,7 @@ static void test_gmm_reject(void)
};
printf("Testing GMM reject\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* reset the PRNG used by sgsn_alloc_ptmsi */
srand(1);
@@ -1240,6 +1244,9 @@ static void test_gmm_cancel(void)
uint32_t foreign_tlli;
uint32_t local_tlli = 0;
struct gprs_llc_lle *lle;
+
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
+ sgsn->cfg.gea_encryption_mask = 0x1;
const enum sgsn_auth_policy saved_auth_policy = sgsn->cfg.auth_policy;
/* DTAP - Attach Request */
@@ -1270,8 +1277,7 @@ static void test_gmm_cancel(void)
};
printf("Testing cancellation\n");
-
- sgsn_inst.cfg.auth_policy = SGSN_AUTH_POLICY_OPEN;
+ sgsn->cfg.auth_policy = SGSN_AUTH_POLICY_OPEN;
foreign_tlli = gprs_tmsi2tlli(0xc0000023, TLLI_FOREIGN);
@@ -1343,6 +1349,7 @@ static void test_apn_matching(void)
struct apn_ctx *actx, *actxs[9];
printf("Testing APN matching\n");
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
actxs[0] = sgsn_apn_ctx_find_alloc("*.test", "");
actxs[1] = sgsn_apn_ctx_find_alloc("*.def.test", "");
@@ -1432,9 +1439,6 @@ static void test_apn_matching(void)
cleanup_test();
}
-struct sgsn_subscriber_pdp_data* sgsn_subscriber_pdp_data_alloc(
- struct sgsn_subscriber_data *sdata);
-
static void test_ggsn_selection(void)
{
struct apn_ctx *actxs[4];
@@ -1453,6 +1457,7 @@ static void test_ggsn_selection(void)
printf("Testing GGSN selection\n");
osmo_gsup_client_send_cb = my_gsup_client_send_dummy;
+ sgsn = sgsn_instance_alloc(tall_sgsn_ctx);
/* Check for emptiness */
OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
@@ -1471,9 +1476,9 @@ static void test_ggsn_selection(void)
/* TODO: Add PDP info entries to s1 */
- ggcs[0] = sgsn_ggsn_ctx_find_alloc(0);
- ggcs[1] = sgsn_ggsn_ctx_find_alloc(1);
- ggcs[2] = sgsn_ggsn_ctx_find_alloc(2);
+ ggcs[0] = sgsn_ggsn_ctx_find_alloc(sgsn, 0);
+ ggcs[1] = sgsn_ggsn_ctx_find_alloc(sgsn, 1);
+ ggcs[2] = sgsn_ggsn_ctx_find_alloc(sgsn, 2);
actxs[0] = sgsn_apn_ctx_find_alloc("test.apn", "123456");
actxs[0]->ggsn = ggcs[0];
@@ -1484,13 +1489,14 @@ static void test_ggsn_selection(void)
pdp_data = sgsn_subscriber_pdp_data_alloc(s1->sgsn_data);
pdp_data->context_id = 1;
- pdp_data->pdp_type = 0x0121;
+ pdp_data->pdp_type_org = PDP_TYPE_ORG_IETF;
+ pdp_data->pdp_type_nr = PDP_TYPE_N_IETF_IPv4;
osmo_strlcpy(pdp_data->apn_str, "*", sizeof(pdp_data->apn_str));
/* Resolve GGSNs */
tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Test.Apn");
+ osmo_apn_from_str(apn_enc, sizeof(apn_enc), "Test.Apn");
ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
OSMO_ASSERT(ggc != NULL);
@@ -1498,7 +1504,7 @@ static void test_ggsn_selection(void)
OSMO_ASSERT(strcmp(apn_str, "Test.Apn") == 0);
tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Other.Apn");
+ osmo_apn_from_str(apn_enc, sizeof(apn_enc), "Other.Apn");
ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
OSMO_ASSERT(ggc != NULL);
@@ -1524,7 +1530,7 @@ static void test_ggsn_selection(void)
tp.lv[GSM48_IE_GSM_APN].val = apn_enc;
tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Foo.Bar");
+ osmo_apn_from_str(apn_enc, sizeof(apn_enc), "Foo.Bar");
ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
OSMO_ASSERT(ggc == NULL);
@@ -1541,7 +1547,7 @@ static void test_ggsn_selection(void)
osmo_strlcpy(pdp_data->apn_str, "Test.Apn", sizeof(pdp_data->apn_str));
tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Test.Apn");
+ osmo_apn_from_str(apn_enc, sizeof(apn_enc), "Test.Apn");
ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
OSMO_ASSERT(ggc != NULL);
@@ -1549,7 +1555,7 @@ static void test_ggsn_selection(void)
OSMO_ASSERT(strcmp(apn_str, "Test.Apn") == 0);
tp.lv[GSM48_IE_GSM_APN].len =
- gprs_str_to_apn(apn_enc, sizeof(apn_enc), "Other.Apn");
+ osmo_apn_from_str(apn_enc, sizeof(apn_enc), "Other.Apn");
ggc = sgsn_mm_ctx_find_ggsn_ctx(ctx, &tp, &gsm_cause, apn_str);
OSMO_ASSERT(ggc == NULL);
@@ -1620,16 +1626,6 @@ static struct log_info_cat gprs_categories[] = {
.description = "GPRS Packet Service",
.enabled = 1, .loglevel = LOGL_DEBUG,
},
- [DNS] = {
- .name = "DNS",
- .description = "GPRS Network Service (NS)",
- .enabled = 1, .loglevel = LOGL_INFO,
- },
- [DBSSGP] = {
- .name = "DBSSGP",
- .description = "GPRS BSS Gateway Protocol (BSSGP)",
- .enabled = 1, .loglevel = LOGL_DEBUG,
- },
[DLLC] = {
.name = "DLLC",
.description = "GPRS Logical Link Control Protocol (LLC)",
@@ -1661,11 +1657,7 @@ int main(int argc, char **argv)
tall_sgsn_ctx = talloc_named_const(osmo_sgsn_ctx, 0, "sgsn");
msgb_ctx = msgb_talloc_ctx_init(osmo_sgsn_ctx, 0);
- sgsn_rate_ctr_init();
- sgsn_auth_init(sgsn);
- gprs_subscr_init(sgsn);
vty_init(&vty_info);
- sgsn_vty_init(&sgsn->cfg);
test_llme();
test_subscriber();
@@ -1685,7 +1677,7 @@ int main(int argc, char **argv)
talloc_report_full(osmo_sgsn_ctx, stderr);
OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1);
- OSMO_ASSERT(talloc_total_blocks(tall_sgsn_ctx) == 2);
+ OSMO_ASSERT(talloc_total_blocks(tall_sgsn_ctx) == 1);
return 0;
}
diff --git a/tests/slhc/Makefile.am b/tests/slhc/Makefile.am
index b6738c25d..33cb7faac 100644
--- a/tests/slhc/Makefile.am
+++ b/tests/slhc/Makefile.am
@@ -1,9 +1,10 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBCARES_CFLAGS)
+AM_LDFLAGS = -no-install
EXTRA_DIST = slhc_test.ok
-noinst_PROGRAMS = slhc_test
+check_PROGRAMS = slhc_test
slhc_test_SOURCES = slhc_test.c
diff --git a/tests/sndcp_xid/Makefile.am b/tests/sndcp_xid/Makefile.am
index 24626b32e..c4702b893 100644
--- a/tests/sndcp_xid/Makefile.am
+++ b/tests/sndcp_xid/Makefile.am
@@ -1,9 +1,10 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBCARES_CFLAGS)
+AM_LDFLAGS = -no-install
EXTRA_DIST = sndcp_xid_test.ok
-noinst_PROGRAMS = sndcp_xid_test
+check_PROGRAMS = sndcp_xid_test
sndcp_xid_test_SOURCES = sndcp_xid_test.c
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
deleted file mode 100644
index 18bccc8f2..000000000
--- a/tests/test_nodes.vty
+++ /dev/null
@@ -1,63 +0,0 @@
-OsmoSGSN> enable
-OsmoSGSN# show timer
-T3312 = 600 s Periodic RA Update timer (s) (default: 600 s)
-T3313 = 30 s Waiting for paging response timer (s) (default: 30 s)
-T3314 = 44 s READY timer. Force to STANDBY on expiry timer (s) (default: 44 s)
-T3316 = 44 s AA-Ready timer (s) (default: 44 s)
-T3322 = 6 s Detach request -> accept timer (s) (default: 6 s)
-T3350 = 6 s Waiting for ATT/RAU/TMSI_COMPL timer (s) (default: 6 s)
-T3360 = 6 s Waiting for AUTH/CIPH response timer (s) (default: 6 s)
-T3370 = 6 s Waiting for IDENTITY response timer (s) (default: 6 s)
-T3385 = 8 s Wait for ACT PDP CTX REQ timer (s) (default: 8 s)
-T3386 = 8 s Wait for MODIFY PDP CTX ACK timer (s) (default: 8 s)
-T3395 = 8 s Wait for DEACT PDP CTX ACK timer (s) (default: 8 s)
-T3397 = 8 s Wait for DEACT AA PDP CTX ACK timer (s) (default: 8 s)
-X1001 = 5 s RANAP Release timeout. Wait for RANAP Release Complete.On expiry release Iu connection (s) (default: 5 s)
-X3314 = 44 s Iu User inactivity timer. On expiry release Iu connection (s) (default: 44 s)
-OsmoSGSN# configure terminal
-OsmoSGSN(config)# list
-...
- sgsn
- ctrl
-...
- ns
- bssgp
-...
-
-OsmoSGSN(config)# sgsn
-OsmoSGSN(config-sgsn)# list
-...
- gtp local-ip A.B.C.D
- ggsn <0-255> remote-ip A.B.C.D
- ggsn <0-255> gtp-version (0|1)
- ggsn <0-255> echo-interval <1-36000>
- ggsn <0-255> no echo-interval
- imsi-acl (add|del) IMSI
- auth-policy (accept-all|closed|acl-only|remote)
- authentication (optional|required)
- encryption (GEA0|GEA1|GEA2|GEA3|GEA4)
- gsup ipa-name NAME
- gsup remote-ip A.B.C.D
- gsup remote-port <0-65535>
- gsup oap-id <0-65535>
- gsup oap-k K
- gsup oap-opc OPC
- apn APNAME ggsn <0-255>
- apn APNAME imsi-prefix IMSIPRE ggsn <0-255>
- access-point-name NAME
- no access-point-name NAME
- cdr filename NAME
- no cdr filename
- cdr trap
- no cdr trap
- cdr interval <1-2147483647>
- ggsn dynamic
- grx-dns-add A.B.C.D
- timer [TNNNN] [(<0-2147483647>|default)]
- no compression rfc1144
- compression rfc1144 active slots <1-256>
- compression rfc1144 passive
- no compression v42bis
- compression v42bis active direction (ms|sgsn|both) codewords <512-65535> strlen <6-250>
- compression v42bis passive
-...
diff --git a/tests/testsuite.at b/tests/testsuite.at
index d30115e01..637d853a7 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -7,12 +7,6 @@ cat $abs_srcdir/gprs/gprs_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/gprs/gprs_test], [], [expout], [ignore])
AT_CLEANUP
-AT_SETUP([gbproxy])
-AT_KEYWORDS([gbproxy])
-cat $abs_srcdir/gbproxy/gbproxy_test.ok > expout
-AT_CHECK([$abs_top_builddir/tests/gbproxy/gbproxy_test], [], [expout], [ignore])
-AT_CLEANUP
-
AT_SETUP([sgsn])
AT_KEYWORDS([sgsn])
AT_CHECK([test "$enable_sgsn_test" != no || exit 77])
diff --git a/tests/v42bis/Makefile.am b/tests/v42bis/Makefile.am
index 744239279..0e544a684 100644
--- a/tests/v42bis/Makefile.am
+++ b/tests/v42bis/Makefile.am
@@ -1,9 +1,10 @@
AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBCARES_CFLAGS)
+AM_LDFLAGS = -no-install
EXTRA_DIST = v42bis_test.ok
-noinst_PROGRAMS = v42bis_test
+check_PROGRAMS = v42bis_test
v42bis_test_SOURCES = v42bis_test.c
diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py
index ed52d5f9b..0b7df8c89 100755
--- a/tests/vty_test_runner.py
+++ b/tests/vty_test_runner.py
@@ -67,55 +67,6 @@ class TestVTYBase(unittest.TestCase):
self.vty = None
osmoutil.end_proc(self.proc)
-
-class TestVTYGbproxy(TestVTYBase):
-
- def vty_command(self):
- return ["./src/gbproxy/osmo-gbproxy", "-c",
- "doc/examples/osmo-gbproxy/osmo-gbproxy.cfg"]
-
- def vty_app(self):
- return (4246, "./src/gbproxy/osmo-gbproxy", "OsmoGbProxy", "gbproxy")
-
- def testVtyTree(self):
- self.vty.enable()
- self.assertTrue(self.vty.verify('configure terminal', ['']))
- self.assertEqual(self.vty.node(), 'config')
- self.checkForEndAndExit()
- self.assertTrue(self.vty.verify('ns', ['']))
- self.assertEqual(self.vty.node(), 'config-ns')
- self.checkForEndAndExit()
- self.assertTrue(self.vty.verify('exit', ['']))
- self.assertEqual(self.vty.node(), 'config')
- self.assertTrue(self.vty.verify('gbproxy', ['']))
- self.assertEqual(self.vty.node(), 'config-gbproxy')
- self.checkForEndAndExit()
- self.assertTrue(self.vty.verify('exit', ['']))
- self.assertEqual(self.vty.node(), 'config')
-
- def testVtyShow(self):
- res = self.vty.command("show ns")
- self.assertTrue(res.find('Encapsulation NS-UDP-IP') >= 0)
-
- res = self.vty.command("show gbproxy stats")
- self.assertTrue(res.find('GBProxy Global Statistics') >= 0)
-
- def testVtyDeletePeer(self):
- self.vty.enable()
- self.assertTrue(self.vty.verify('delete-gbproxy-peer 9999 bvci 7777', ['BVC not found']))
- res = self.vty.command("delete-gbproxy-peer 9999 all dry-run")
- self.assertTrue(res.find('Not Deleted 0 BVC') >= 0)
- self.assertTrue(res.find('Not Deleted 0 NS-VC') >= 0)
- res = self.vty.command("delete-gbproxy-peer 9999 only-bvc dry-run")
- self.assertTrue(res.find('Not Deleted 0 BVC') >= 0)
- self.assertTrue(res.find('Not Deleted 0 NS-VC') < 0)
- res = self.vty.command("delete-gbproxy-peer 9999 only-nsvc dry-run")
- self.assertTrue(res.find('Not Deleted 0 BVC') < 0)
- self.assertTrue(res.find('Not Deleted 0 NS-VC') >= 0)
- res = self.vty.command("delete-gbproxy-peer 9999 all")
- self.assertTrue(res.find('Deleted 0 BVC') >= 0)
- self.assertTrue(res.find('Deleted 0 NS-VC') >= 0)
-
class TestVTYSGSN(TestVTYBase):
def vty_command(self):
@@ -143,7 +94,7 @@ class TestVTYSGSN(TestVTYBase):
def testVtyShow(self):
res = self.vty.command("show ns")
- self.assertTrue(res.find('Encapsulation NS-UDP-IP') >= 0)
+ self.assertTrue(res.find('0 NS-VC:') >= 0)
self.assertTrue(self.vty.verify('show bssgp', ['']))
self.assertTrue(self.vty.verify('show bssgp stats', ['']))
self.assertTrue(self.vty.verify('show bssgp nsei 123', ['']))
@@ -276,13 +227,6 @@ class TestVTYSGSN(TestVTYBase):
for t in [3312, 3322, 3350, 3360, 3370, 3313, 3314, 3316, 3385, 3395, 3397]:
self.assertTrue(self.vty.verify('timer t%d 10' % t, ['']))
-def add_gbproxy_test(suite, workdir):
- if not os.path.isfile(os.path.join(workdir, "src/gbproxy/osmo-gbproxy")):
- print("Skipping the Gb-Proxy test")
- return
- test = unittest.TestLoader().loadTestsFromTestCase(TestVTYGbproxy)
- suite.addTest(test)
-
def add_sgsn_test(suite, workdir):
if not os.path.isfile(os.path.join(workdir, "src/sgsn/osmo-sgsn")):
print("Skipping the SGSN test")
@@ -320,7 +264,6 @@ if __name__ == '__main__':
os.chdir(workdir)
print("Running tests for specific VTY commands")
suite = unittest.TestSuite()
- add_gbproxy_test(suite, workdir)
add_sgsn_test(suite, workdir)
if args.test_name:
diff --git a/tests/xid/Makefile.am b/tests/xid/Makefile.am
index 6f058f5a6..d3a260bca 100644
--- a/tests/xid/Makefile.am
+++ b/tests/xid/Makefile.am
@@ -11,11 +11,13 @@ AM_CFLAGS = \
$(LIBCARES_CFLAGS) \
$(NULL)
+AM_LDFLAGS = -no-install
+
EXTRA_DIST = \
xid_test.ok \
$(NULL)
-noinst_PROGRAMS = \
+check_PROGRAMS = \
xid_test \
$(NULL)