Allow to set the LU reject cause independently for both of the
following cases; either when an IMSI is unknown to the HLR or
when the mslookup client does not a receive a timely response
to a GSUP request for the remote home HLR.
Original patchset modified by <firstname.lastname@example.org>
This commit fixes the following errors:
Missing timeout param for mslookup.
Fails to start reading a written config if an msc node
is configured in the mslookup server.
Places the individual msc node services in the
top-level wildcard node due to incorrect indentation.
* Add missing timeout param.
* Add missing "ipa-name" part to mslookup-server-msc section.
* Add one extra space indentation for msc services.
This commit also adds a DEFINE for the default timeout value.
Use the apn functions from libosmocore to encode and decode qnames to
avoid code duplication and to avoid unnecessary dynamic allocation.
The unit tests for encoding and decoding rfc_question / rfc_record are
still passing and have the same output.
Create a new subscriber from CTRL, similar to VTY command
"imsi IDENT create".
On success SET_REPLY contains the ID of the newly created subscriber.
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.
Each VLR requesting auth tuples should use a distinct IND pool for 3G
auth. So far we tied the IND to the GSUP peer connection; MSC and SGSN
were always distinct GSUP peers, they ended up using distinct INDs.
However, we have implemented a GSUP proxy, so that, in a distributed
setup, a remotely roaming subscriber has only one direct GSUP peer
proxying for both remote MSC and SGSN. That means as soon as a
subscriber roams to a different site, we would use the GSUP proxy name
to determine the IND instead of the separate MSC and SGSN. The site's
MSC and SGSN appear as the same client, get the same IND bucket, waste
SQNs rapidly and cause auth tuple generation load.
So instead of using the local client as IND, persistently keep a list of
VLR names and assign a different IND to each. Use the
gsup_req->source_name as indicator, which reflects the actual remote
VLR's name (remote MSC or SGSN).
Persist the site <-> IND assignments in the database.
Add an IND test to db_test.c
There was an earlier patch version that separated the IND pools by
cn_domain, but it turned out to add complex semantics, while only
solving one aspect of the "adjacent VLR" problem. We need a solution not
only for CS vs PS, but also for 2,3G vs 4G, and for sites that are
physically adjacent to each other. This patch version does not offer any
automatic solution for that -- as soon as more than 2^IND_bitlen
(usually 32) VLRs show up, it is the responsibility of the admin to
ensure the 'ind' table in the hlr.db does not have unfortunate IND
assignments. So far no VTY commands exist for that, they may be added in
Caught by new gcc 11.1.0:
/git/osmo-hlr/src/db.c:257:16: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
257 | return rc;
In 89fda3024a I added a
vty command to show a summary of filtered subscribers by imsi
or msisdn. In practice there is a also need to be able to
filter on IMEI.
The idea here is not to replace every operation that could be
done directly on the sql database in the vty, but this one
Explicitly check filter_type is not NULL even though the current code
never passed a NULL filter_type unless filter was also NULL.
Remove unreachable code.
Related: coverity CID#216865
Related: coverity CID#216867
Adds the following commands:
show subscribers all - Display summary of all entries in HLR
show subscribers (imsi|msisdn|cs|ps) ... As above but filter on search field/string
show subscribers last seen - Display only subscribers with data in
Last LU update field, and sorts by Last LU.
Test USIMs as specified by 3GPP use the XOR algorithm not only for 2G
but also for 3G. libosmocore includes the XOR-3G support since v1.3.0,
but osmo-hlr somehow never made use of it.
An internal handler may want to continue session, e.g. to request
more information from the MS. Let's make the handlers responsible
for session state management, and check that state before calling
ss_session_free(), so a session can remain alive.
Before this patch ss->state was not set/used at all...
GSUP is message based on top of IPA, and hence TCP. We don't want to
have Nagle algorithm enabled, since we are interested in having messages
sent as quickly as possible and there's no need for lower layers to wait
for more data (because we send all the message data at once).
Firstly, vlr_number is an array and we need to check the first char for nul
instead of the pointer.
Also, osmo_ipa_name_set_str() returns zero on success, so the condition is
hlr_subscr_nam() was rewritten in I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
ad868e29ba and this likely fixes a bug introduced
Related: coverity CID#210169
In practice, from_peer is always non-NULL, yet some conditions checked against
NULL, looking like a possible NULL deref. Require non-NULL.
Related: coverity CID#210172
To determine distinct IND pools for each connected VLR, we need to pick ever
increasing values for any new peer showing up. Each subscriber's individual
IND_bitlen is then required to modulo the least significant N of bits that fit
in its IND_bitlen to effectively round-robin in the available IND pool space.
So far we did that but issued a warning message. This is actually exactly what
we want and it doesn't need to be treated like it weren't so.
So far, the time string format comes from ctime_r, and we manually add "UTC" to it.
The ctime_r format is wildly chaotic IMHO, mixing weekday, day-of-month and
hour and year in very unsorted ways.
Adding "UTC" to it is non-standard.
Instead use an ISO-8601 standardized time string via strftime().