Compare commits

...

6 Commits

Author SHA1 Message Date
Neels Hofmeyr
472bb0733d put SQL only used in hlr-db-tool in hlr_db_tool.c
Change-Id: I3ac327dbcef37472fb13b8689d008e74b83b3bb1
2020-09-21 14:42:29 +02:00
Keith
d118efb789 osmo-hlr-db-tool: Make import from osmo-nitb less "lossy"
Include the IMEI and the last seen time in an import from
an osmo-nitb database.

Change-Id: Ic47e549be3551ae43ab6a84228d47ae03e9652a6
2020-08-31 16:42:27 +02:00
Pau Espin Pedrol
ed18fa908c Support setting rt-prio and cpu-affinity mask through VTY
Change-Id: I33101aae3e2851febc335f6fbf96228eab7cf6df
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
2020-08-18 13:25:34 +02:00
Pau Espin Pedrol
f464fff173 doc: Update VTY reference xml file
Change-Id: Ifdefba331ae2542b1cdc5860d0f9e53ef9f703c4
2020-08-18 12:50:21 +02:00
Pau Espin Pedrol
e893eeb1b3 configure.ac: Fix trailing whitespace
Change-Id: If0569167922695bb88c8f168f89fa300dd181c72
2020-08-18 12:49:05 +02:00
Vadim Yanitskiy
b77d568196 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: I6b38640b57480c6950be491eeb3c5167be1c6aab
2020-08-13 16:09:02 +07:00
9 changed files with 471 additions and 22 deletions

10
TODO-RELEASE Normal file
View File

@@ -0,0 +1,10 @@
# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install
# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
# In short:
# LIBVERSION=c:r:a
# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a.
# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0.
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
osmo-hlr update osmo-gsm-manuals dependency to > 0.3.0 for vty_cpu_sched.adoc include

View File

@@ -25,7 +25,7 @@ AC_PROG_MKDIR_P
AC_PROG_CC
AC_PROG_INSTALL
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'])])
@@ -39,10 +39,10 @@ PKG_PROG_PKG_CONFIG([0.20])
PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.4.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.4.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.4.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.4.0)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.6.0)
PKG_CHECK_MODULES(SQLITE3, sqlite3)

4
debian/control vendored
View File

@@ -1,14 +1,14 @@
Source: osmo-hlr
Section: net
Priority: optional
Maintainer: Max Suraev <msuraev@sysmocom.de>
Maintainer: Osmocom team <openbsc@lists.osmocom.org>
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
dh-systemd (>= 1.5),
autotools-dev,
python3-minimal,
libosmocore-dev,
libosmocore-dev (>= 1.4.0),
libosmo-abis-dev,
libosmo-netif-dev,
libsqlite3-dev,

View File

@@ -28,6 +28,8 @@ include::{srcdir}/chapters/dgsm.adoc[]
include::./common/chapters/gsup.adoc[]
include::./common/chapters/vty_cpu_sched.adoc[]
include::./common/chapters/port_numbers.adoc[]
include::./common/chapters/bibliography.adoc[]
@@ -35,4 +37,3 @@ include::./common/chapters/bibliography.adoc[]
include::./common/chapters/glossary.adoc[]
include::./common/chapters/gfdl.adoc[]

View File

@@ -18,10 +18,11 @@
<param name='terminal' doc='Write to terminal' />
</params>
</command>
<command id='write file'>
<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'>
@@ -187,7 +188,7 @@
<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 (main|db|auc|ss|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
<command id='logging level (main|db|auc|ss|mslookup|lu|dgsm|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' />
@@ -195,6 +196,9 @@
<param name='db' doc='Database Layer' />
<param name='auc' doc='Authentication Center' />
<param name='ss' doc='Supplementary Services' />
<param name='mslookup' doc='Mobile Subscriber Lookup' />
<param name='lu' doc='Location Updating' />
<param name='dgsm' doc='Distributed GSM: MS lookup and proxy' />
<param name='lglobal' doc='Library-internal global log family' />
<param name='llapd' doc='LAPD in libosmogsm' />
<param name='linp' doc='A-bis Intput Subsystem' />
@@ -253,6 +257,43 @@
<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 (main|db|auc|ss|mslookup|lu|dgsm|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='main' doc='Main Program' />
<param name='db' doc='Database Layer' />
<param name='auc' doc='Authentication Center' />
<param name='ss' doc='Supplementary Services' />
<param name='mslookup' doc='Mobile Subscriber Lookup' />
<param name='lu' doc='Location Updating' />
<param name='dgsm' doc='Distributed GSM: MS lookup and proxy' />
<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' />
@@ -360,6 +401,20 @@
<param name='IDENT' doc='IMSI/MSISDN/ID/IMEI of the subscriber' />
</params>
</command>
<command id='show mslookup services'>
<params>
<param name='show' doc='Show running system information' />
<param name='mslookup' doc='Distributed GSM / mslookup related information' />
<param name='services' doc='List configured service addresses as sent to remote mslookup requests' />
</params>
</command>
<command id='show cpu-sched threads'>
<params>
<param name='show' doc='Show running system information' />
<param name='cpu-sched' doc='Show Sched section information' />
<param name='threads' doc='Show information about running threads)' />
</params>
</command>
</node>
<node id='enable'>
<name>enable</name>
@@ -528,7 +583,7 @@
<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 (main|db|auc|ss|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
<command id='logging level (main|db|auc|ss|mslookup|lu|dgsm|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' />
@@ -536,6 +591,9 @@
<param name='db' doc='Database Layer' />
<param name='auc' doc='Authentication Center' />
<param name='ss' doc='Supplementary Services' />
<param name='mslookup' doc='Mobile Subscriber Lookup' />
<param name='lu' doc='Location Updating' />
<param name='dgsm' doc='Distributed GSM: MS lookup and proxy' />
<param name='lglobal' doc='Library-internal global log family' />
<param name='llapd' doc='LAPD in libosmogsm' />
<param name='linp' doc='A-bis Intput Subsystem' />
@@ -564,7 +622,8 @@
</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='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' />
@@ -593,6 +652,43 @@
<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 (main|db|auc|ss|mslookup|lu|dgsm|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='main' doc='Main Program' />
<param name='db' doc='Database Layer' />
<param name='auc' doc='Authentication Center' />
<param name='ss' doc='Supplementary Services' />
<param name='mslookup' doc='Mobile Subscriber Lookup' />
<param name='lu' doc='Location Updating' />
<param name='dgsm' doc='Distributed GSM: MS lookup and proxy' />
<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' />
@@ -672,6 +768,18 @@
<param name='rate-counters' doc='Show all rate counters' />
</params>
</command>
<command id='stats report'>
<params>
<param name='stats' doc='Stats related commands' />
<param name='report' doc='Manurally trigger reporting of stats' />
</params>
</command>
<command id='stats reset'>
<params>
<param name='stats' doc='Stats related commands' />
<param name='reset' doc='Reset all stats' />
</params>
</command>
<command id='show gsup-connections'>
<params>
<param name='show' doc='Show running system information' />
@@ -827,6 +935,20 @@
<param name='cs+ps' doc='Allow access to both circuit and packet switched services' />
</params>
</command>
<command id='show mslookup services'>
<params>
<param name='show' doc='Show running system information' />
<param name='mslookup' doc='Distributed GSM / mslookup related information' />
<param name='services' doc='List configured service addresses as sent to remote mslookup requests' />
</params>
</command>
<command id='show cpu-sched threads'>
<params>
<param name='show' doc='Show running system information' />
<param name='cpu-sched' doc='Show Sched section information' />
<param name='threads' doc='Show information about running threads)' />
</params>
</command>
</node>
<node id='config'>
<name>config</name>
@@ -1056,11 +1178,11 @@
<param name='log' doc='Report to the logger' />
</params>
</command>
<command id='stats interval &lt;1-65535&gt;'>
<command id='stats interval &lt;0-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' />
<param name='&lt;0-65535&gt;' doc='Interval in seconds (0 disables the reporting interval)' />
</params>
</command>
<command id='hlr'>
@@ -1068,6 +1190,16 @@
<param name='hlr' doc='Configure the HLR' />
</params>
</command>
<command id='mslookup'>
<params>
<param name='mslookup' doc='Configure Distributed GSM mslookup' />
</params>
</command>
<command id='cpu-sched'>
<params>
<param name='cpu-sched' doc='Configure CPU Scheduler related settings' />
</params>
</command>
</node>
<node id='config-log'>
<name>config-log</name>
@@ -1143,7 +1275,7 @@
<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 (main|db|auc|ss|lglobal|llapd|linp|lmux|lmi|lmib|lsms|lctrl|lgtp|lstats|lgsup|loap|lss7|lsccp|lsua|lm3ua|lmgcp|ljibuf|lrspro) (debug|info|notice|error|fatal)'>
<command id='logging level (main|db|auc|ss|mslookup|lu|dgsm|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' />
@@ -1151,6 +1283,9 @@
<param name='db' doc='Database Layer' />
<param name='auc' doc='Authentication Center' />
<param name='ss' doc='Supplementary Services' />
<param name='mslookup' doc='Mobile Subscriber Lookup' />
<param name='lu' doc='Location Updating' />
<param name='dgsm' doc='Distributed GSM: MS lookup and proxy' />
<param name='lglobal' doc='Library-internal global log family' />
<param name='llapd' doc='LAPD in libosmogsm' />
<param name='linp' doc='A-bis Intput Subsystem' />
@@ -1278,6 +1413,12 @@
<param name='disable' doc='Disable the reporter' />
</params>
</command>
<command id='flush-period &lt;0-65535&gt;'>
<params>
<param name='flush-period' doc='Configure stats sub-system' />
<param name='&lt;0-65535&gt;' doc='Send all stats even if they have not changed (i.e. force the flush)every N-th reporting interval. Set to 0 to disable regular flush (default).' />
</params>
</command>
</node>
<node id='config-line'>
<name>config-line</name>
@@ -1309,6 +1450,27 @@
</params>
</command>
</node>
<node id='config-cpu-sched'>
<name>config-cpu-sched</name>
<command id='policy rr &lt;1-32&gt;'>
<params>
<param name='policy' doc='Set the scheduling policy to use for the process' />
<param name='rr' doc='Use the SCHED_RR real-time scheduling algorithm' />
<param name='&lt;1-32&gt;' doc='Set the SCHED_RR real-time priority' />
</params>
</command>
<command id='cpu-affinity (self|all|&lt;0-4294967295&gt;|THREADNAME) CPUHEXMASK [delay]'>
<params>
<param name='cpu-affinity' doc='Set CPU affinity mask on a (group of) thread(s)' />
<param name='self' doc='Set CPU affinity mask on thread running the VTY' />
<param name='all' doc='Set CPU affinity mask on all process&apos; threads' />
<param name='&lt;0-4294967295&gt;' doc='Set CPU affinity mask on a thread with specified PID' />
<param name='THREADNAME' doc='Set CPU affinity mask on a thread with specified thread name' />
<param name='CPUHEXMASK' doc='CPU affinity mask' />
<param name='[delay]' doc='If set, delay applying the affinity mask now and let the app handle it at a later point' />
</params>
</command>
</node>
<node id='config-hlr'>
<name>config-hlr</name>
<command id='gsup'>
@@ -1424,8 +1586,192 @@
<param name='A.B.C.D' doc='IPv4 Address to bind the GSUP interface to' />
</params>
</command>
<command id='ipa-name NAME'>
<params>
<param name='ipa-name' doc='Set the IPA name of this HLR, for proxying to remote HLRs' />
<param name='NAME' doc='A globally unique name for this HLR. For example: PLMN + redundancy server number: HLR-901-70-0. This name is used for GSUP routing and must be set if multiple HLRs interconnect (e.g. mslookup for Distributed GSM).' />
</params>
</command>
</node>
<node id='config-hlr-euse'>
<name>config-hlr-euse</name>
</node>
<node id='config-mslookup'>
<name>config-mslookup</name>
<command id='mdns bind [IP] [&lt;1-65535&gt;]'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='bind' doc='Convenience shortcut: enable and configure both server and client for mDNS mslookup' />
<param name='[IP]' doc='multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42' />
<param name='[&lt;1-65535&gt;]' doc='mDNS UDP Port number' />
</params>
</command>
<command id='mdns domain-suffix DOMAIN_SUFFIX'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='domain-suffix' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
<param name='DOMAIN_SUFFIX' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
</params>
</command>
<command id='no mdns bind'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='mdns' doc='Disable both server and client for mDNS mslookup' />
<param name='bind' doc='(null)' />
</params>
</command>
<command id='server'>
<params>
<param name='server' doc='Enable and configure Distributed GSM mslookup server' />
</params>
</command>
<command id='no server'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='server' doc='Disable Distributed GSM mslookup server' />
</params>
</command>
<command id='client'>
<params>
<param name='client' doc='Enable and configure Distributed GSM mslookup client' />
</params>
</command>
<command id='no client'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='client' doc='Disable Distributed GSM mslookup client' />
</params>
</command>
</node>
<node id='config-mslookup-server'>
<name>config-mslookup-server</name>
<command id='mdns bind [IP] [&lt;1-65535&gt;]'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='bind' doc='Configure where the mDNS server listens for mslookup requests' />
<param name='[IP]' doc='multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42' />
<param name='[&lt;1-65535&gt;]' doc='mDNS UDP Port number' />
</params>
</command>
<command id='mdns domain-suffix DOMAIN_SUFFIX'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='domain-suffix' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
<param name='DOMAIN_SUFFIX' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
</params>
</command>
<command id='no mdns bind'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='mdns' doc='Disable server for mDNS mslookup (do not answer remote requests)' />
<param name='bind' doc='(null)' />
</params>
</command>
<command id='service NAME at IP &lt;1-65535&gt;'>
<params>
<param name='service' doc='Configure addresses of local services, as sent in replies to remote mslookup requests.' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
<param name='at' doc='at' />
<param name='IP' doc='IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1' />
<param name='&lt;1-65535&gt;' doc='Service-specific port number' />
</params>
</command>
<command id='no service NAME'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='service' doc='Remove one or more service address entries' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
</params>
</command>
<command id='no service NAME at IP &lt;1-65535&gt;'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='service' doc='Remove one or more service address entries' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
<param name='at' doc='at' />
<param name='IP' doc='IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1' />
<param name='&lt;1-65535&gt;' doc='Service-specific port number' />
</params>
</command>
<command id='msc ipa-name .IPA_NAME'>
<params>
<param name='msc' doc='Configure services for individual local MSCs' />
<param name='ipa-name' doc='Identify locally connected MSC by IPA Unit Name' />
<param name='.IPA_NAME' doc='IPA Unit Name of the local MSC to configure' />
</params>
</command>
</node>
<node id='config-mslookup-server-msc'>
<name>config-mslookup-server-msc</name>
<command id='service NAME at IP &lt;1-65535&gt;'>
<params>
<param name='service' doc='Configure addresses of local services, as sent in replies to remote mslookup requests.' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
<param name='at' doc='at' />
<param name='IP' doc='IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1' />
<param name='&lt;1-65535&gt;' doc='Service-specific port number' />
</params>
</command>
<command id='no service NAME'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='service' doc='Remove one or more service address entries' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
</params>
</command>
<command id='no service NAME at IP &lt;1-65535&gt;'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='service' doc='Remove one or more service address entries' />
<param name='NAME' doc='mslookup service name, e.g. sip.voice or smpp.sms' />
<param name='at' doc='at' />
<param name='IP' doc='IPv4 address like 1.2.3.4 or IPv6 address like a:b:c:d::1' />
<param name='&lt;1-65535&gt;' doc='Service-specific port number' />
</params>
</command>
</node>
<node id='config-mslookup-client'>
<name>config-mslookup-client</name>
<command id='timeout &lt;1-100000&gt;'>
<params>
<param name='timeout' doc='How long should the mslookup client wait for remote responses before evaluating received results' />
<param name='&lt;1-100000&gt;' doc='timeout in milliseconds' />
</params>
</command>
<command id='mdns bind [IP] [&lt;1-65535&gt;]'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='bind' doc='Enable mDNS client, and configure multicast address to send mDNS mslookup requests to' />
<param name='[IP]' doc='multicast IPv4 address like 239.192.23.42 or IPv6 address like ff08::23:42' />
<param name='[&lt;1-65535&gt;]' doc='mDNS UDP Port number' />
</params>
</command>
<command id='mdns domain-suffix DOMAIN_SUFFIX'>
<params>
<param name='mdns' doc='Multicast DNS related configuration' />
<param name='domain-suffix' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
<param name='DOMAIN_SUFFIX' doc='mDNS domain suffix (default: mdns.osmocom.org). This is appended and stripped from mDNS packets during encoding/decoding, so we don&apos;t collide with top-level domains administrated by IANA' />
</params>
</command>
<command id='no mdns bind'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='mdns' doc='Disable mDNS client, do not query remote services by mDNS' />
<param name='bind' doc='(null)' />
</params>
</command>
<command id='gateway-proxy IP [&lt;1-65535&gt;]'>
<params>
<param name='gateway-proxy' doc='Configure a fixed IP address to send all GSUP requests for unknown IMSIs to, without invoking a lookup for IMSI' />
<param name='IP' doc='IP address of the remote HLR' />
<param name='[&lt;1-65535&gt;]' doc='GSUP port number (omit for default 4222)' />
</params>
</command>
<command id='no gateway-proxy'>
<params>
<param name='no' doc='Negate a command or set its defaults' />
<param name='gateway-proxy' doc='Disable gateway proxy for GSUP with unknown IMSIs' />
</params>
</command>
</node>
</vtydoc>

View File

@@ -31,6 +31,7 @@
#include <osmocom/vty/command.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/ports.h>
#include <osmocom/vty/cpu_sched_vty.h>
#include <osmocom/ctrl/control_vty.h>
#include <osmocom/gsm/apn.h>
#include <osmocom/gsm/gsm48_ie.h>
@@ -732,6 +733,7 @@ int main(int argc, char **argv)
handle_options(argc, argv);
hlr_vty_init();
dgsm_vty_init();
osmo_cpu_sched_vty_init(hlr_ctx);
rc = vty_read_config_file(cmdline_opts.config_file, NULL);
if (rc < 0) {

View File

@@ -25,6 +25,7 @@
#include <getopt.h>
#include <inttypes.h>
#include <string.h>
#include <errno.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/application.h>
@@ -70,8 +71,9 @@ static void print_help()
printf(" (All commands imply this if none exists yet.)\n");
printf("\n");
printf(" import-nitb-db <nitb.db> Add OsmoNITB db's subscribers to OsmoHLR db.\n");
printf(" Be aware that the import is lossy, only the\n");
printf(" IMSI, MSISDN, nam_cs/ps and 2G auth data are set.\n");
printf(" Be aware that the import is somewhat lossy, only the IMSI,\n");
printf(" MSISDN, IMEI, nam_cs/ps, 2G auth data and last seen LU are set.\n");
printf(" The most recently associated IMEI from the Equipment table is used.\n");
}
static void print_version(int print_copyright)
@@ -212,9 +214,15 @@ enum nitb_stmt {
static const char *nitb_stmt_sql[] = {
[NITB_SELECT_SUBSCR] =
"SELECT imsi, id, extension, authorized"
" FROM Subscriber"
" ORDER BY id",
"SELECT s.imsi, s.id, s.extension, s.authorized,"
" SUBSTR(e.imei,0,15), STRFTIME('%s', s.expire_lu)"
" FROM Subscriber s INNER JOIN"
" (SELECT imei, subscriber_id, MAX(Equipment.updated) AS updated"
" FROM Equipment,EquipmentWatch"
" WHERE Equipment.id = EquipmentWatch.equipment_id"
" GROUP BY EquipmentWatch.subscriber_id) e"
" ON e.subscriber_id = s.id"
" ORDER by s.id",
[NITB_SELECT_AUTH_KEYS] =
"SELECT algorithm_id, a3a8_ki from authkeys"
" WHERE subscriber_id = $subscr_id",
@@ -222,8 +230,65 @@ static const char *nitb_stmt_sql[] = {
sqlite3_stmt *nitb_stmt[ARRAY_SIZE(nitb_stmt_sql)] = {};
enum hlr_db_stmt {
HLR_DB_STMT_SET_IMPLICIT_LU_BY_IMSI,
};
static const char *hlr_db_stmt_sql[] = {
[HLR_DB_STMT_SET_IMPLICIT_LU_BY_IMSI] =
"UPDATE subscriber SET last_lu_seen = datetime($last_lu, 'unixepoch') WHERE imsi = $imsi",
};
sqlite3_stmt *hlr_db_stmt[ARRAY_SIZE(hlr_db_stmt_sql)] = {};
size_t _dbd_decode_binary(const unsigned char *in, unsigned char *out);
/*! Set a subscriber's LU timestamp in the HLR database.
* In normal operations there is never any need to explicitly
* update the value of last_lu_seen, so this function can live here.
*
* \param[in,out] dbc database context.
* \param[in] imsi ASCII string of IMSI digits
* \param[in] imei ASCII string of identifier digits, or NULL to remove the IMEI.
* \returns 0 on success, -ENOENT when the given subscriber does not exist,
* -EIO on database errors.
*/
int db_subscr_update_lu_by_imsi(struct db_context *dbc, const char* imsi, const int last_lu)
{
int rc, ret = 0;
sqlite3_stmt *stmt = hlr_db_stmt[HLR_DB_STMT_SET_IMPLICIT_LU_BY_IMSI];
if (!db_bind_text(stmt, "$imsi", imsi))
return -EIO;
if (last_lu && !db_bind_int(stmt, "$last_lu", last_lu))
return -EIO;
/* execute the statement */
rc = sqlite3_step(stmt);
if (rc != SQLITE_DONE) {
LOGP(DAUC, LOGL_ERROR, "Update last_lu_seen for subscriber IMSI='%s': SQL Error: %s\n", imsi,
sqlite3_errmsg(dbc->db));
ret = -EIO;
goto out;
}
/* verify execution result */
rc = sqlite3_changes(dbc->db);
if (!rc) {
LOGP(DAUC, LOGL_ERROR, "Cannot update last_lu_seen for subscriber IMSI='%s': no such subscriber\n", imsi);
ret = -ENOENT;
} else if (rc != 1) {
LOGP(DAUC, LOGL_ERROR, "Update last_lu_seen for subscriber IMSI='%s': SQL modified %d rows (expected 1)\n",
imsi, rc);
ret = -EIO;
}
out:
db_remove_reset(stmt);
return ret;
}
void import_nitb_subscr_aud(sqlite3 *nitb_db, const char *imsi, int64_t nitb_id, int64_t hlr_id)
{
int rc;
@@ -297,6 +362,7 @@ void import_nitb_subscr(sqlite3 *nitb_db, sqlite3_stmt *stmt)
int64_t imsi;
char imsi_str[32];
bool authorized;
int last_lu_int;
imsi = sqlite3_column_int64(stmt, 0);
@@ -315,8 +381,16 @@ void import_nitb_subscr(sqlite3 *nitb_db, sqlite3_stmt *stmt)
nitb_id = sqlite3_column_int64(stmt, 1);
copy_sqlite3_text_to_buf(subscr.msisdn, stmt, 2);
authorized = sqlite3_column_int(stmt, 3) ? true : false;
copy_sqlite3_text_to_buf(subscr.imei, stmt, 4);
/* Default periodic LU was 30 mins and the expire_lu
* was twice that + 1 min
*/
last_lu_int = sqlite3_column_int(stmt, 5) - 3660;
db_subscr_update_msisdn_by_imsi(dbc, imsi_str, subscr.msisdn);
db_subscr_update_imei_by_imsi(dbc, imsi_str, subscr.imei);
db_subscr_update_lu_by_imsi(dbc, imsi_str, last_lu_int);
db_subscr_nam(dbc, imsi_str, authorized, true);
db_subscr_nam(dbc, imsi_str, authorized, false);
@@ -361,6 +435,17 @@ int import_nitb_db(void)
}
}
for (i = 0; i < ARRAY_SIZE(hlr_db_stmt_sql); i++) {
sql = hlr_db_stmt_sql[i];
rc = sqlite3_prepare_v2(g_hlr_db_tool_ctx->dbc->db, hlr_db_stmt_sql[i], -1,
&hlr_db_stmt[i], NULL);
if (rc != SQLITE_OK) {
LOGP(DDB, LOGL_ERROR, "OsmoHLR DB: Unable to prepare SQL statement '%s'\n", sql);
ret = -1;
goto out_free;
}
}
stmt = nitb_stmt[NITB_SELECT_SUBSCR];
while ((rc = sqlite3_step(stmt)) == SQLITE_ROW) {

View File

@@ -16,6 +16,7 @@ OsmoHLR> list
subscriber (imsi|msisdn|id|imei) IDENT show
show subscriber (imsi|msisdn|id|imei) IDENT
show mslookup services
...
OsmoHLR> enable
OsmoHLR# ?
@@ -25,12 +26,15 @@ OsmoHLR# ?
OsmoHLR# configure terminal
OsmoHLR(config)# ?
...
hlr Configure the HLR
mslookup Configure Distributed GSM mslookup
hlr Configure the HLR
mslookup Configure Distributed GSM mslookup
...
OsmoHLR(config)# list
...
hlr
mslookup
...
OsmoHLR(config)# hlr
OsmoHLR(config-hlr)# ?

View File

@@ -14,6 +14,7 @@ OsmoHLR# list
subscriber (imsi|msisdn|id|imei) IDENT update imei (none|IMEI)
subscriber (imsi|msisdn|id|imei) IDENT update network-access-mode (none|cs|ps|cs+ps)
show mslookup services
...
OsmoHLR# subscriber?
subscriber Subscriber management commands