23 Commits

Author SHA1 Message Date
Max
5ac8ab7cd9 ctrl: take both address and port from vty config
Change-Id: I5d73257c0233ce6772847809a6163b6ca4c88f83
2022-12-17 21:32:29 +03:00
Max
518550e404 Set working directory in systemd service file
By default systemd will execute service with root directory
(or home directory for user instance) which might result in
attempts to create files in unexpected place. Let's set it
to 'osmocom' subdir of state directory
(/var/lib for system instance) instead.

Related: OS#4821
Change-Id: Ie8b014e8eac23221a6a7087bb2b886014323680b
2022-09-12 07:12:35 +00:00
Max
f2a03654bb Add git-review config
Change-Id: Ia16bb7936e9382dcc51d9122bd7582d75eb7ae15
2022-09-09 22:40:27 +07:00
Vadim Yanitskiy
accb1d1b25 contrib/jenkins.sh: execute distcheck/maintainer-clean with $PARALLEL_MAKE
Change-Id: I14b0e0343dc70b72cc9e14641bccaa6da2059e46
2022-08-29 00:33:10 +07:00
Pau Espin Pedrol
f30a8a1133 Bump version: 0.2.1.5-cd82-dirty → 0.2.2
Change-Id: I17fe1460bb04da7d10ebaa1410cdb0dd670ece24
2022-06-29 12:21:07 +02:00
Harald Welte
cd82cb23be Fill README with content; convert to markdown
Change-Id: I54297aba4dbb4f521caaeb555de9e5404f9e6dcd
2022-06-18 14:01:07 +02:00
Harald Welte
bc54ff06f8 update git URLs (git -> https; gitea)
Change-Id: I8788fa6b0495b8ee72b1bb5485f6cd3a4835eb0b
2022-06-18 14:01:07 +02:00
Vadim Yanitskiy
b9b65d953f tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
When using 'check_PROGRAMS', autoconf/automake generates smarter
Makefiles, so that the test programs are not being compiled during
the normal 'make all', but only during 'make check'.

Change-Id: I9b60429c8c3922dd97809c72ed7960ffdc059d8b
2022-04-14 02:18:50 +03:00
Pau Espin Pedrol
454047c586 deb/rpm packaging: Drop dependency on autoconf-archive
it is not needed since ec37263a37.

Change-Id: I729b7dc0f2971b959810a46baa8a344e8b71e4a4
2022-01-11 18:26:44 +01:00
Oliver Smith
5b7f1fd5c8 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: Ieb4f9b4ad5073c9b5996cb960b248c450fd5f2dd
2021-12-14 12:22:00 +01:00
Pau Espin Pedrol
8ec775714c Bump version: 0.2.0.2-ec37-dirty → 0.2.1
Change-Id: I4a2e2ff8e5f8d08fb4f8bb1f75e92ede9bb5521f
2021-11-16 18:14:21 +01:00
Oliver Smith
ec37263a37 configure: don't turn some warnings into errors
Do not turn some compiler warnings into errors by default. This part was
copied from openbsc.git 34f012 ("Turn some compiler warnings into
errors"), where it was added before --enable-werror was available.

We build with --enable-werror during development and in CI. If the code
is built with a different compiler that throws additional warnings, it
should not stop the build.

Related: OS#5289
Change-Id: I22f6f4d3d4b81d4791a72a7bce130035bef58c31
2021-11-04 11:12:30 +01:00
Pau Espin Pedrol
44a2a85202 Use new stat item/ctr getter APIs
Generated with spatch:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""

Change-Id: I594c08b8fe0ed54a31353d8c6c911cc7293ae7c0
2021-06-04 18:07:05 +02:00
Pau Espin Pedrol
ed87bd5c74 Bump version: 0.1.0.8-14c9-dirty → 0.2.0
Change-Id: I67c0bde168c91f3d38cb228b4318321a70b68c3e
2021-02-24 14:30:57 +01:00
Pau Espin Pedrol
14c9c7bcd7 smlc_subscr_test: Replace use of deprecated log_set_print_filename() API
hex_category is also set explicitly to keep same results (old API used
to set it internally).

Change-Id: I49365dfcd24bed55101917d2ea034c4327ab51d6
2021-02-24 14:28:37 +01:00
Pau Espin Pedrol
b36a18f139 main: Support setting cmdline --vty-ref-mode
Change-Id: Iadb004319514cb134b0863ea16b3289e6f1a097a
2021-02-24 14:26:30 +01:00
Pau Espin Pedrol
427fbbd541 gitignore: Ignore autofoo files *~
Change-Id: I97997a44e26e8fe9b98606e63aa6d5986d0d85f6
2021-02-24 14:15:48 +01:00
Neels Hofmeyr
5dadf0ae6e manual: describe TA-based positioning and cell locations
Change-Id: I3d8ae0f6fef0c60499a5e133d3dd0ebd54e8c321
2020-10-28 03:19:44 +01:00
Harald Welte
8b6341b02f fix osmo-smlc.service: drop unknown '-s' command line argument
Change-Id: I3804fea29e06280f12b62e8c27d2a0ba4aafa7a0
2020-10-22 16:02:26 +02:00
Harald Welte
dbf98d5433 osmo-smlc.spec.in: Add dependency to autoconf-archive
I don't really understand why our other spec files only contain
a dependency to autoconf and get away with that (while still using
autoconf-archive from configure.ac), but let's try this.

Change-Id: Ica5f58297722b650a3862326d31b8eb8947ee1b6
2020-10-22 08:05:51 +02:00
Harald Welte
63ec8a9c59 debian: the osmo-smlc example is not in the osmo-msc directory
Change-Id: Ie6e2c591fc37fed716f0d30df9096b535f06a118
2020-10-22 08:04:58 +02:00
Harald Welte
fb2abb8f8c debian/spec: Add build depedency to autoconf-archive
Change-Id: I56ff1c97ef7f11ac35eb78558cc7a0049f39cd56
2020-10-21 20:58:02 +02:00
Harald Welte
033b15679c update vty reference XML
Change-Id: Ifae832b399fb905892cab36f6d4fa7704a2541f0
2020-10-21 20:21:40 +02:00
27 changed files with 1170 additions and 103 deletions

1
.gitignore vendored
View File

@@ -34,6 +34,7 @@ stamp-h1
libtool
ltmain.sh
m4/*.m4
*~
# git-version-gen magic
.tarball-version

4
.gitreview Normal file
View File

@@ -0,0 +1,4 @@
[gerrit]
host=gerrit.osmocom.org
project=osmo-smlc

4
README
View File

@@ -1,4 +0,0 @@
About OsmoSMLC
==============
FIXME

69
README.md Normal file
View File

@@ -0,0 +1,69 @@
osmo-smlc - Osmocom Serving Mobile Location Centre
==================================================
This repository contains a C-language implementation of a minimalistic
GSM Serving Mobile Location Centre (SMLC) for 2G (GSM). It is part of the
[Osmocom](https://osmocom.org/) Open Source Mobile Communications project.
OsmoSMLC exposes
* 3GPP Lb interface towards the BSC
* The Osmocom typical telnet VTY and CTRL interfaces.
* The Osmocom typical statsd exporter.
OsmoSMLC supports the following location methods:
* currently only the Timing Advance based method of determining a mobile station; operator must configure the
locations of the cells in the osmo-smlc configuration file
Homepage
--------
You can find the OsmoSMLC issue tracker and wiki online at
<https://osmocom.org/projects/osmo-smlc> and <https://osmocom.org/projects/osmo-smlc/wiki>
GIT Repository
--------------
You can clone from the official osmo-smlc.git repository using
git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc
There is a web interface at <https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc>
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/osmosmlc-usermanual.pdf)
as well as the [VTY Reference Manual](https://ftp.osmocom.org/docs/latest/osmosmlc-vty-reference.pdf)
Mailing List
------------
Discussions related to osmo-smlc are happening on the
openbsc@lists.osmocom.org mailing list, please see
<https://lists.osmocom.org/mailman/listinfo/openbsc> 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.
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-smlc can be seen at
<https://gerrit.osmocom.org/#/q/project:osmo-smlc+status:open>

View File

@@ -34,17 +34,12 @@ 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.])
])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.6.0)
PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 1.6.0)
dnl checks for header files
AC_HEADER_STDC
@@ -92,13 +87,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
CFLAGS="$saved_CFLAGS"
AC_SUBST(SYMBOL_VISIBILITY)
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"])
# Coverage build taken from WebKit's configure.in
AC_MSG_CHECKING([whether to enable code coverage support])
AC_ARG_ENABLE(coverage,
@@ -133,7 +121,7 @@ if test "x$enable_ext_tests" = "xyes" ; then
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])

View File

@@ -58,12 +58,12 @@ LD_LIBRARY_PATH="$inst/lib" $MAKE check \
|| cat-testlogs.sh
LD_LIBRARY_PATH="$inst/lib" \
DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \
$MAKE distcheck \
$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

View File

@@ -24,19 +24,20 @@ License: AGPL-3.0-or-later
Group: Hardware/Mobile
URL: https://osmocom.org/projects/osmo-smlc
Source: %{name}-%{version}.tar.xz
BuildRequires: autoconf
BuildRequires: automake >= 1.9
BuildRequires: libtool >= 2
BuildRequires: pkgconfig >= 0.20
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
%endif
BuildRequires: pkgconfig(libosmo-netif) >= 0.6.0
BuildRequires: pkgconfig(libosmo-sccp) >= 0.10.0
BuildRequires: pkgconfig(libosmo-sigtran) >= 0.10.0
BuildRequires: pkgconfig(libosmocore) >= 1.2.0
BuildRequires: pkgconfig(libosmoctrl) >= 1.2.0
BuildRequires: pkgconfig(libosmogsm) >= 1.2.0
BuildRequires: pkgconfig(libosmovty) >= 1.2.0
BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0
BuildRequires: pkgconfig(libosmo-sccp) >= 1.6.0
BuildRequires: pkgconfig(libosmo-sigtran) >= 1.6.0
BuildRequires: pkgconfig(libosmocore) >= 1.7.0
BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0
BuildRequires: pkgconfig(libosmogsm) >= 1.7.0
BuildRequires: pkgconfig(libosmovty) >= 1.7.0
BuildRequires: pkgconfig(talloc)
%{?systemd_requires}
@@ -76,7 +77,7 @@ make %{?_smp_mflags} check || (find . -name testsuite.log -exec cat {} +)
%files
%license COPYING
%doc AUTHORS README
%doc AUTHORS README.md
%{_bindir}/osmo-smlc
%dir %{_docdir}/%{name}/examples
%dir %{_docdir}/%{name}/examples/osmo-smlc

View File

@@ -4,7 +4,9 @@ Description=Osmocom Serving Mobile Location Center (SMLC)
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/osmo-smlc -c /etc/osmocom/osmo-smlc.cfg -s
StateDirectory=osmocom
WorkingDirectory=%S/osmocom
ExecStart=/usr/bin/osmo-smlc -c /etc/osmocom/osmo-smlc.cfg
RestartSec=2
[Install]

49
debian/changelog vendored
View File

@@ -1,3 +1,52 @@
osmo-smlc (0.2.2) unstable; urgency=medium
[ Oliver Smith ]
* treewide: remove FSF address
[ Pau Espin Pedrol ]
* deb/rpm packaging: Drop dependency on autoconf-archive
[ Vadim Yanitskiy ]
* tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
[ Harald Welte ]
* update git URLs (git -> https; gitea)
* Fill README with content; convert to markdown
-- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 29 Jun 2022 12:21:06 +0200
osmo-smlc (0.2.1) unstable; urgency=medium
[ Pau Espin Pedrol ]
* Use new stat item/ctr getter APIs
[ Oliver Smith ]
* configure: don't turn some warnings into errors
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 16 Nov 2021 18:14:21 +0100
osmo-smlc (0.2.0) unstable; urgency=medium
[ Harald Welte ]
* contrib/jenkins.sh: Build libosmo-abis, a dependency of libosmo-netif
* fix build of usermanual
* update vty reference XML
* debian/spec: Add build depedency to autoconf-archive
* debian: the osmo-smlc example is not in the osmo-msc directory
* osmo-smlc.spec.in: Add dependency to autoconf-archive
* fix osmo-smlc.service: drop unknown '-s' command line argument
[ Neels Hofmeyr ]
* initial working osmo-smlc implementation
* manual: describe TA-based positioning and cell locations
[ Pau Espin Pedrol ]
* gitignore: Ignore autofoo files *~
* main: Support setting cmdline --vty-ref-mode
* smlc_subscr_test: Replace use of deprecated log_set_print_filename() API
-- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 24 Feb 2021 14:30:56 +0100
osmo-smlc (0.0.1) unstable; urgency=medium
[ Harald Welte ]

12
debian/control vendored
View File

@@ -11,13 +11,13 @@ Build-Depends: debhelper (>=9),
pkg-config,
libsctp-dev,
libtalloc-dev,
libosmocore-dev (>= 1.3.0),
libosmo-sccp-dev (>= 1.1.0),
libosmo-sigtran-dev (>= 1.1.0),
osmo-gsm-manuals-dev (>= 0.2.0)
libosmocore-dev (>= 1.7.0),
libosmo-sccp-dev (>= 1.6.0),
libosmo-sigtran-dev (>= 1.6.0),
osmo-gsm-manuals-dev (>= 1.3.0)
Standards-Version: 3.9.8
Vcs-Git: git://git.osmocom.org/osmo-smlc.git
Vcs-Browser: https://git.osmocom.org/osmo-smlc/
Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc
Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc
Homepage: https://osmocom.org/projects/osmo-smlc
Package: osmo-smlc

2
debian/copyright vendored
View File

@@ -1,6 +1,6 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: osmo-smlc
Source: git://git.osmocom.org/osmo-smlc
Source: https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc
Files: *
Copyright: 2020 Harald Welte <laforge@osmocom.org>

View File

@@ -1,4 +1,4 @@
etc/osmocom/osmo-smlc.cfg
lib/systemd/system/osmo-smlc.service
usr/bin/osmo-smlc
usr/share/doc/osmo-msc/examples/osmo-smlc/osmo-smlc.cfg usr/share/doc/osmo-smlc/examples
usr/share/doc/osmo-smlc/examples/osmo-smlc/osmo-smlc.cfg usr/share/doc/osmo-smlc/examples

View File

@@ -4,7 +4,6 @@ SUBDIRS = \
$(NULL)
msc: \
$(builddir)/location_request_fsm.png \
$(NULL)
dot: \

View File

@@ -1,19 +0,0 @@
digraph G {
rankdir=TB
labelloc=t; label="Location Request FSM in OsmoSMLC"
BSC [label="BSC\nvia\nLb interface",shape=box3d]
subgraph cluster_LOC_REQ_FSM {
label="loc_req_fsm"
INIT -> WAIT_TA_RESPONSE
WAIT_TA_RESPONSE -> GOT_TA_RESPONSE
GOT_TA_RESPONSE -> terminate
terminate [shape=octagon]
}
BSC -> INIT [label="BSSMAP-LE Perform\nLocation Req",style=dashed]
WAIT_TA_RESPONSE -> BSC [label="TA Request",style=dashed]
BSC -> WAIT_TA_RESPONSE [label="TA Response",style=dashed]
GOT_TA_RESPONSE -> BSC [label="BSSMAP-LE Perform\nLocation Resp",style=dashed]
}

View File

@@ -0,0 +1,26 @@
== Configure Cell Locations
To determine geographic location estimates based on the serving cell, OsmoSMLC
needs preconfigured global positions by latitude and longitude, for each cell of
each BSC.
On the `cells` configuration node, cell locations can be indicated by LAC and
CI, or by Cell Global Identity. The following example configures the position
for a cell by LAC 23 and CI 42:
----
cells
lac-ci 23 42 lat 12.3456 lon 23.4567
----
The following example configures the position by a Cell Global Identity with
PLMN 001-01, LAC 2 and CI 3:
----
cells
cgi 001 01 2 3 lat 34.5678 lon 45.6789
----
If a cell's latitude and longitude is not configured, all location requests for
subscribers served by that cell are answered by a BSSMAP-LE Perform Location
Response without a Location Estimate and LCS Cause "Facility not supported".

View File

@@ -0,0 +1,11 @@
== Positioning Methods
So far, OsmoSMLC provides only TA-based positioning.
=== TA-Based Positioning
In TA-based positioning, the serving Cell Id and the Timing Advance (a.k.a.
Access Delay) are provided by the BSC. OsmoSMLC returns a GAD "ellipsoid point
with uncertainty circle" as location estimate. The ellipsoid point is the
latitude and longitude of the serving cell, and the uncertainty circle is the
maximum distance from that cell based on the Timing Advance information.

View File

@@ -63,10 +63,11 @@ has to configure a distinct point-code. See <<cs7_config>>.
===== Configure SCCP/M3UA (AoIP)
OsmoSMLC acts as client to contact an STP instance and establish an SCCP/M3UA
link.
link. OsmoSMLC always uses the SSN "SMLC (BSSMAP-LE)" (SSN code 252). The
configurable point-code defaults to 0.23.6 (190).
An example configuration of OsmoSMLC's Lb SCCP link, assuming the SMLC at
point-code 1.23.6 via an SG listening for M3UA at 127.0.0.1:2905:
point-code 1.23.6, listening for M3UA at 127.0.0.1:2905:
----
cs7 instance 0

View File

@@ -18,6 +18,10 @@ include::./common/chapters/logging.adoc[]
include::./common/chapters/cs7-config.adoc[]
include::{srcdir}/chapters/positioning.adoc[]
include::{srcdir}/chapters/cells.adoc[]
include::./common/chapters/counters-overview.adoc[]
// include::{srcdir}/chapters/counters.adoc[]

File diff suppressed because it is too large Load Diff

View File

@@ -17,10 +17,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#pragma once

View File

@@ -17,10 +17,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#pragma once

View File

@@ -17,10 +17,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <limits.h>

View File

@@ -186,14 +186,14 @@ static int sccp_lb_sap_down(struct sccp_lb_inst *sli, struct osmo_prim_hdr *oph)
{
int rc;
if (!sli->scu) {
rate_ctr_inc(&g_smlc->ctrs->ctr[SMLC_CTR_BSSMAP_LE_TX_ERR_CONN_NOT_READY]);
rate_ctr_inc(rate_ctr_group_get_ctr(g_smlc->ctrs, SMLC_CTR_BSSMAP_LE_TX_ERR_CONN_NOT_READY));
return -EIO;
}
rc = osmo_sccp_user_sap_down_nofree(sli->scu, oph);
if (rc >= 0)
rate_ctr_inc(&g_smlc->ctrs->ctr[SMLC_CTR_BSSMAP_LE_TX_SUCCESS]);
rate_ctr_inc(rate_ctr_group_get_ctr(g_smlc->ctrs, SMLC_CTR_BSSMAP_LE_TX_SUCCESS));
else
rate_ctr_inc(&g_smlc->ctrs->ctr[SMLC_CTR_BSSMAP_LE_TX_ERR_SEND]);
rate_ctr_inc(rate_ctr_group_get_ctr(g_smlc->ctrs, SMLC_CTR_BSSMAP_LE_TX_ERR_SEND));
return rc;
}

View File

@@ -17,10 +17,6 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <osmocom/smlc/smlc_data.h>
@@ -96,7 +92,7 @@ static int smlc_loc_req_start(struct lb_conn *lb_conn, const struct bssmap_le_pe
{
struct smlc_loc_req *smlc_loc_req;
rate_ctr_inc(&g_smlc->ctrs->ctr[SMLC_CTR_BSSMAP_LE_RX_DT1_PERFORM_LOCATION_REQUEST]);
rate_ctr_inc(rate_ctr_group_get_ctr(g_smlc->ctrs, SMLC_CTR_BSSMAP_LE_RX_DT1_PERFORM_LOCATION_REQUEST));
if (lb_conn->smlc_loc_req) {
/* Another request is already pending. If we send Perform Location Abort, the peer doesn't know which

View File

@@ -78,6 +78,31 @@ static void print_help()
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) {
@@ -90,7 +115,8 @@ static void handle_options(int argc, char **argv)
{"config-file", 1, 0, 'c'},
{"version", 0, 0, 'V' },
{"log-level", 1, 0, 'e'},
{"vty-ref-xml", 0, &long_option, 1},
{"vty-ref-mode", 1, &long_option, 1},
{"vty-ref-xml", 0, &long_option, 2},
{0, 0, 0, 0}
};
@@ -105,14 +131,8 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
case 0:
switch (long_option) {
case 1:
vty_dump_xml_ref(stdout);
exit(0);
default:
fprintf(stderr, "error parsing cmdline options\n");
exit(2);
}
handle_long_options(argv[0], long_option);
break;
case 'd':
log_parse_category_mask(osmo_stderr_target, optarg);
break;
@@ -248,8 +268,7 @@ int main(int argc, char **argv)
/* start control interface after reading config for
* ctrl_vty_get_bind_addr() */
g_smlc->ctrl = ctrl_interface_setup_dynip2(g_smlc, ctrl_vty_get_bind_addr(), OSMO_CTRL_PORT_SMLC,
smlc_ctrl_node_lookup, _LAST_CTRL_NODE_SMLC);
g_smlc->ctrl = ctrl_interface_setup2(g_smlc, OSMO_CTRL_PORT_SMLC, smlc_ctrl_node_lookup, _LAST_CTRL_NODE_SMLC);
if (!g_smlc->ctrl) {
fprintf(stderr, "Failed to init the control interface. Exiting.\n");
exit(1);

View File

@@ -20,7 +20,7 @@ EXTRA_DIST = \
smlc_subscr_test.err \
$(NULL)
noinst_PROGRAMS = \
check_PROGRAMS = \
smlc_subscr_test \
$(NULL)

View File

@@ -140,10 +140,11 @@ int main()
void *ctx = talloc_named_const(NULL, 0, "smlc_subscr_test");
osmo_init_logging2(ctx, &log_info);
log_set_print_filename(osmo_stderr_target, 0);
log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
log_set_print_timestamp(osmo_stderr_target, 0);
log_set_use_color(osmo_stderr_target, 0);
log_set_print_category(osmo_stderr_target, 1);
log_set_print_category_hex(osmo_stderr_target, 0);
g_smlc = smlc_state_alloc(ctx);
@@ -154,4 +155,3 @@ int main()
printf("Done\n");
return 0;
}