Commit Graph

417 Commits

Author SHA1 Message Date
Oliver Smith 6da2af924a src/lu_fsm.c: dealloc and cancel previous IMSI
FIXME: deallocation works, but the location cancel does not get sent
yet. (LU runs into a timeout and ME tries again, then the LU is
successful)

Related: OS#4476
Change-Id: I3993cbec8c5e96d704a58b396a55362e938c9cd2
2020-05-07 09:38:51 +02:00
Oliver Smith fca8a0a935 src/hlr.c: resolve/scramble pseudo IMSI in GSUP
Resolve the pseudonymous IMSI to the real IMSI as soon as possible, when
a GSUP message arrives. Use the real IMSI internally in OsmoHLR, so the
existing logic does not need to be changed. Scramble the IMSI back to the
pseudonymous IMSI in one common place (gsup_server_send_req_response)
right before responding to GSUP messages.

Related: OS#4476
Change-Id: I400810f96efca7746dd4ba1bed666acaea425e8a
2020-05-06 15:09:01 +02:00
Oliver Smith 7b4e5b1390 VTY: alloc/dealloc/show imsi pseudo
Create VTY commands and related database functions to get, allocate and
deallocate pseudonymous IMSIs. As this is a proof of concept, the code
to retrieve the next pseudonymous IMSI has no performance optimizations
and might not use a good entropy source (I did not verify).

Related: OS#4476
Change-Id: Ia93ee58d5e03c801eb774b9483a9a4417d031959
2020-05-06 13:42:26 +02:00
Oliver Smith 502f10fb0c VTY: add imsi-pseudo option
Related: OS#4476
Change-Id: I2a01364cdba61dfd2597aff9b4a812291aaa325d
2020-05-06 08:59:46 +02:00
Oliver Smith e2c192e8c8 sql: add table subscriber_imsi_pseudo
Related: OS#4476
Change-Id: I5d66ae11102dd616d1ce468034241493719f9db2
2020-05-06 08:57:19 +02:00
Neels Hofmeyr 9b8e7b4e39 hlr_subscr_nam(): fix condition to fix nam=false notifications
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
reversed.

hlr_subscr_nam() was rewritten in I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
ad868e29ba and this likely fixes a bug introduced
there.

Related: coverity CID#210169
Change-Id: I3a0e9ed4b865c88aa4a6341a3bf1a96c10d20ed9
2020-05-04 19:24:26 +02:00
Neels Hofmeyr 010ceb8206 osmo_mslookup_server_mdns_rx(): handle read() rc == 0
Coverity says "tainted buffer", I hope it means the case of read() returning
zero.

Related: coverity CID#210170
Change-Id: Ia2d57cb8bbacc6f54dc410047da69a983aedd24d
2020-05-04 19:15:29 +02:00
Neels Hofmeyr 1bd3ec49b1 gsup_server.c: properly handle negative rc from osmo_gsup_conn_ccm_get()
Related: coverity CID#210171
Change-Id: I5b56fe33cbc75679a3fffc034a53f06cd0e4043b
2020-05-04 17:53:52 +02:00
Neels Hofmeyr dfe6f41c81 osmo_gsup_req_new(): require from_peer != NULL
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
Change-Id: I3cb73ec0d31f84d4b613ecb026169c944d240e4c
2020-05-04 17:37:15 +02:00
Neels Hofmeyr 3e79a38440 make osmo_cni_peer_id_cmp() NULL safe
Related: coverity CID#210172
Change-Id: I400b23ac3f0eb68d5e4c757ea02d130fbe12f80b
2020-05-04 17:33:36 +02:00
Neels Hofmeyr a450a85956 auc3g: officially wrap IND around IND_bitlen space
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.

Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 26b4905e7f vty: show subscriber: show lu d,h,m,s ago, not just seconds
Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43
2020-04-30 19:22:24 +02:00
Neels Hofmeyr d9b3606234 vty: show subscriber: change format of 'last LU seen'
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().

Change-Id: I6731968f05050399f4dd43b241290186e0c59e1a
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 0d82a87c0d drop error log for when a subscriber does not exist
Checking for existence of a subscriber and seeing that there is none is not
inherently an error. However, osmo-hlr currently logs on all occasions:

  DAUC ERROR Cannot read subscriber from db: MSISDN='1001': No such subscriber

This spams the ERROR log level. Particularly when a D-GSM setup does subscriber
existence checks for every incoming mslookup request, that potentially creates
constant ERROR logging.

The "No such subscriber" part comes from db_sel(), which might also return an
sqlite3_errmsg(). We still want those sqlite3_errmsg()es in the ERROR log.

Hence print an ERROR log only if db_sel() returns an rc != -ENOENT.

Change-Id: I5044e9b4519b948edc4e451cef0f7830d315619b
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 9489a9ce4b adoc: add D-GSM chapter to osmohlr-usermanual
Change-Id: I392b5523870c2ef3267179160028d26f3f761b77
2020-04-30 19:22:24 +02:00
Oliver Smith edc27ef390 hlr_vty_subscr: prettier output for last LU seen
Extend the "last LU seen on ..." line with the amount of seconds that
passed since now, or "(invalid timestamp)".

Patch split from Id7fc50567211a0870ac0524f6dee94d4513781ba, because it
depends on timestamp_age which was just added in
Ife4a61d71926d08f310a1aeed9d9f1974f64178b.

Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37
2020-04-30 19:22:24 +02:00
Neels Hofmeyr af748923bd gsup_server: send routing error back to the correct peer
If a peer attempts to add a route to an ipa-name that we already have in the
routing system, don't send the routing error to the peer that already has the
name, but to the peer that attempts to re-use it and would cause the collision.

This is fixing a situation where for example a locally attached MSC has name
'MSC-1', and a remote site is proxying GSUP here for a remote MSC that also has
the name 'MSC-1'. Send the routing error back to the proxy, not local 'MSC-1'.

Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 76328bdc91 D-GSM 3/n: implement roaming by mslookup in osmo-hlr
Add mslookup client to find remote home HLRs of unknown IMSIs, and
proxy/forward GSUP for those to the right remote HLR instances.

Add remote_hlr.c to manage one GSUP client per remote HLR GSUP address.

Add proxy.c to keep state about remotely handled IMSIs (remote GSUP address,
MSISDN, and probably more in future patches).  The mslookup_server that
determines whether a given MSISDN is attached locally now also needs to look in
the proxy record: it is always the osmo-hlr immediately peering for the MSC
that should respond to mslookup service address queries like SIP and SMPP.
(Only gsup.hlr service is always answered by the home HLR.)

Add dgsm.c to set up an mdns mslookup client, ask for IMSI homes, and to decide
which GSUP is handled locally and which needs to go to a remote HLR.

Add full VTY config and VTY tests.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: I2fe453553c90e6ee527ed13a13089900efd488aa
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 407925dcab D-GSM 2/n: implement mDNS method of mslookup server
Implement the mslookup server's mDNS responder, to actually service remote
mslookup requests:
- VTY mslookup/server config with service names,
- the mslookup_mdns_server listening for mslookup requests,

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: I5cae6459090588b4dd292be90a5e8903432669d2
2020-04-30 19:22:24 +02:00
Neels Hofmeyr ab7dc40f16 D-GSM 1/n: add mslookup server in osmo-hlr
Implement the mslookup server to service remote mslookup requests.

This patch merely adds the logic to answer incoming mslookup requests, an
actual method to receive requests (mDNS) follows in a subsequent patch.

- API to configure service names and addresses for the local site (per MSC).
- determine whether a subscriber is on a local MSC
  (checking the local proxy will be added in subsequent patch that adds proxy
  capability).
- VTY config follows in a subsequent patch.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: Ife4a61d71926d08f310a1aeed9d9f1974f64178b
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 86b507b6ea test_nodes.vty: remove cruft
This stuff is not testing osmo-hlr specific nodes, remove.

Change-Id: Ia11a209778b78ab02424e2abf3f9004fe97cf570
2020-04-30 19:22:24 +02:00
Neels Hofmeyr d017d7b215 enlarge the GSUP message headroom
Make room for (more) arbitrary IPA headers, like longer IPA names as configured
by the user.

Change-Id: I7d86f2dadcae29fe1550ea2c9773394ab31a837b
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 04c2375b38 db v5: prep for D-GSM: add vlr_via_proxy and sgsn_via_proxy
D-GSM will store in the HLR DB whether a locally connected MSC has attached the
subscriber (last_lu_seen[_ps]), or whether the attach happened via a GSUP proxy
from a different site.

Add columns for this separately in this patch.

Change-Id: I98c7b3870559ede84adf56e4bf111f53c7487745
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 939f508f00 gsup client: add up_down_cb(), add osmo_gsup_client_create3()
For the GSUP clients in upcoming D-GSM enabled osmo-hlr, it will be necessary
to trigger an event as soon as a GSUP client connection becomes ready for
communication. Add the osmo_gsup_client->up_down_cb.

Add osmo_gsup_client_create3() to pass the up_down_cb in the arguments. Also
add a cb data argument to populate the already existing osmo_gsup_client->data
item directly from osmo_gsup_client_create3().

We need the callbacks and data pointer in the osmo_gsup_client_create()
function right before startup, because this function immediately starts up the
connection. Who knows whether callbacks might trigger right away.

Because there are so many arguments, and to prevent the need for ever new
versions of this function, pass the arguments as an extendable struct.

Change-Id: I6f181e42b678465bc9945f192559dc57d2083c6d
2020-04-30 19:21:18 +02:00
Neels Hofmeyr c79bcdedc9 2/2: wrap ipa_name in osmo_cni_peer_id with type enum and union
To be prepared for the future in public API, wrap the new osmo_ipa_name struct
in an enum-type and union called osmo_cni_peer.

During code review it was requested to insert an ability to handle different
kinds of peer id, in order to be able to add a Global Title in the future.

Use the generic osmo_cni_peer only in the publicly visible API. For osmo-hlr
internal code, I intend to postpone implementing this into the future, when a
different peer identification actually gets introduced.

This way we don't need to implement it now in all osmo-hlr code paths (save
time now), but still make all external API users aware that this type may be
extended in the future.

Change-Id: Ide9dcdca283ab989240cfc6e53e9211862a199c5
2020-04-30 19:19:17 +02:00
Neels Hofmeyr ad868e29ba 1/2: refactor: add and use lu_fsm, osmo_gsup_req, osmo_ipa_name
These are seemingly orthogonal changes in one patch, because they are in fact
sufficiently intertwined that we are not willing to spend the time to separate
them. They are also refactoring changes, unlikely to make sense on their own.

** lu_fsm:

Attempting to make luop.c keep state about incoming GSUP requests made me find
shortcomings in several places:
- since it predates osmo_fsm, it is a state machine that does not strictly
  enforce the order of state transitions or the right sequence of incoming
  events.
- several places OSMO_ASSERT() on data received from the network.
- modifies the subscriber state before a LU is accepted.
- dead code about canceling a subscriber in a previous VLR. That would be a
  good thing to actually do, which should also be trivial now that we record
  vlr_name and sgsn_name, but I decided to remove the dead code for now.

To both step up the LU game *and* make it easier for me to integrate
osmo_gsup_req handling, I decided to create a lu_fsm, drawing from my, by now,
ample experience of writing osmo_fsms.

** osmo_gsup_req:

Prepare for D-GSM, where osmo-hlr will do proxy routing for remote HLRs /
communicate with remote MSCs via a proxy:

a) It is important that a response that osmo-hlr generates and that is sent
back to a requesting MSC contains all IEs that are needed to route it back to
the requester. Particularly source_name must become destination_name in the
response to be able to even reach the requesting MSC. Other fields are also
necessary to match, which were so far taken care of in individual numerous code
paths.

b) For some operations, the response to a GSUP request is generated
asynchronously (like Update Location Request -> Response, or taking the
response from an EUSE, or the upcoming proxying to a remote HLR). To be able to
feed a request message's information back into the response, we must thus keep
the request data around. Since struct osmo_gsup_message references a lot of
external data, usually with pointers directly into the received msgb, it is not
so trivial to pass GSUP message data around asynchronously, on its own.

osmo_gsup_req is the combined solution for both a and b: it keeps all data for
a GSUP message by taking ownership of the incoming msgb, and it provides an
explicit API "forcing" callers to respond with osmo_gsup_req_respond(), so that
all code paths trivially are definitely responding with the correct IEs set to
match the request's routing (by using osmo_gsup_make_response() recently added
to libosmocore).

Adjust all osmo-hlr code paths to use *only* osmo_gsup_req to respond to
incoming requests received on the GSUP server (above LU code being one of
them).

In fact, the same should be done on the client side. Hence osmo_gsup_req is
implemented in a server/client agnostic way, and is placed in
libosmo-gsupclient. As soon as we see routing errors in complex GSUP setups,
using osmo_gsup_req in the related GSUP client is likely to resolve those
problems without much thinking required beyond making all code paths use it.

libosmo-gsupclient is hence added to osmo-hlr binary's own library
dependencies. It would have been added by the D-GSM proxy routing anyway, we
are just doing it a little sooner.

** cni_peer_id.c / osmo_ipa_name:

We so far handle an IPA unit name as pointer + size, or as just pointer with
implicit talloc size. To ease working with GSUP peer identification data, I
require:

- a non-allocated storage of an IPA Name. It brings the drawback of being
  size limited, but our current implementation is anyway only able to handle
  MSC and SGSN names of 31 characters (see struct hlr_subscriber).
- a single-argument handle for IPA Name,
- easy to use utility functions like osmo_ipa_name_to_str(), osmo_ipa_name_cmp(), and copying
  by simple assignment, a = b.

Hence this patch adds a osmo_ipa_name in cni_peer_id.h and cni_peer_id.c. Heavily
used in LU and osmo_gsup_req.

Depends: libosmocore Id9692880079ea0f219f52d81b1923a76fc640566
Change-Id: I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
2020-04-30 19:16:09 +02:00
Oliver Smith 0c27a4c2d1 Cosmetic: mention OS#4491 in location cancel code
Change-Id: Idce0816172b92699d86ba3574a4fded0b73333cf
2020-04-16 09:16:27 +02:00
Eric Wild 08358b2752 configure.ac: fix libtool issue with clang and sanitizer
As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: Ib98b84ac156f52ecdbb7ae49eaaea35442527b22
2020-04-11 18:11:26 +00:00
Oliver Smith 5424dcb879 mslookup_client_mdns_test: no automatic skip
Exit with error code if multicast is disabled. The test is disabled by
default already, so when explicitly enabling it, we should not
automatically skip it.

Related: OS#4385
Change-Id: I82022c23fa9c40535f922b12d917efd7e229912b
2020-02-14 11:16:47 +00:00
Oliver Smith f0e90e6bd5 mslookup_client_mdns_test: disable by default
Only build and run the test, if --enable-mslookup-client-mdns-test is
passed to ./configure. Enable that option in jenkins.sh.

Related: OS#4385
Change-Id: Ie0cd4b0c55a1fbb00c215aeec7dcd0c15805add3
2020-02-14 11:16:47 +00:00
Vadim Yanitskiy 15ad7bef5f db: fix possible SQLite3 allocated memory leak in db_open()
From https://sqlite.org/c3ref/exec.html:

  To avoid memory leaks, the application should invoke sqlite3_free()
  on error message strings returned through the 5th parameter of
  sqlite3_exec() after the error message string is no longer needed.
  If the 5th parameter to sqlite3_exec() is not NULL and no errors
  occur, then sqlite3_exec() sets the pointer in its 5th parameter
  to NULL before returning.

Change-Id: Ic9ed9bad3165bc4a637fe963f51e923f012e19ac
Fixes: CID#208182
2020-02-09 05:32:48 +07:00
Oliver Smith 74e7072f63 mdns_rfc.c: fix possible access of uninit. mem
Fixes: CID#207548
Change-Id: Ifa269d8a88d84c01349668cdd8d1f1d24c12c6d8
2020-01-31 15:27:50 +00:00
Neels Hofmeyr 4fa9653733 gsup_client.c: fix deprecation for client create func
Change-Id: Iab9f416519b5df3bd4683592b2976f16675d9be7
2020-01-29 12:48:26 +01:00
Oliver Smith 5e5ce4aef2 mdns_sock.c: fix resource leak of sock
Fixes: CID#207542
Change-Id: I0216b17c3ff67910a39520e2f2a5a16e23575a86
2020-01-14 08:43:52 +01:00
Oliver Smith 9e533f666d osmo-mslookup-client: fix dereferencing null
Fixes: CID#207543
Change-Id: Ia9ff5b2c767853dd00f577a7bc3583f408e061b5
2020-01-14 08:40:34 +01:00
Oliver Smith 544b15d3fa osmo-mslookup-client.c: fix dereferencing null
Fixes: CID#207544
Change-Id: I51b974420975e670708f0d2318f63615d281922c
2020-01-14 08:40:19 +01:00
Oliver Smith 89afb7f78b mslookup_client_mdns.c: fix dereferencing null
Fixes: CID#207545
Change-Id: I0f7fbbdb663304bd5214cba4a6e4abe1dd165cfa
2020-01-13 15:00:37 +01:00
Oliver Smith b1775162ea mdns_msg.c: always call va_end
Fixes: CID#207546
Change-Id: I39829e78619a6412618e1140ff9b1185bad975bd
2020-01-13 14:57:18 +01:00
Oliver Smith f55f605931 mslookup_client.c: fix dereferencing null pointer
Fixes: CID#207547
Change-Id: If19e1e68fad76a3d65788ac208da7dde1f8745c1
2020-01-13 14:52:51 +01:00
Neels Hofmeyr fbe4929543 fix missing braces in LOGP_GSUP_FWD
Change-Id: I8634ea8822c8ccba4081014c5540f2b6a229fc7e
2020-01-13 14:12:00 +01:00
Oliver Smith e53a34a7e1 contrib/dgsm/ add example esme and dialplan
Add example scripts for the distributed GSM network:

esme_dgsm.py: connect to the SMPP port of OsmoMSC A and forward SMS to the SMPP
port of OsmoMSC B. The IP and port of OsmoMSC B is retrieved by the receiver's
MSISDN using osmo-mslookup-client.

contrib/dgsm/freeswitch_dialplan_dgsm.py: resolve the destination SIP servers
of calls with osmo-mslookup-client and bridge the calls accordingly.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Related: OS#4254
Related: OS#4255
Change-Id: I26e8dd8d9a08187fccb3e74ee91366bc24f6c608
2020-01-13 14:12:00 +01:00
Neels Hofmeyr 52ef60fe96 add osmo-mslookup-client program (#2)
Standalone program using libosmo-mslookup to easily integrate with programs
that want to connect services (SIP, SMS,...) to the current location of a
subscriber. Also useful for manual testing.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Resubmit of 637bbfcd92 after revert in
41fe362591.

Change-Id: Ie39d30e20461ab10ae3584863d8bfc6b76a12f37
2020-01-13 14:11:48 +01:00
Oliver Smith 3a9f267983 add mDNS lookup method to libosmo-mslookup (#2)
Add the first actually useful lookup method to the mslookup library: multicast
DNS.

The server side is added in a subsequent commit, when the mslookup server is
implemented for the osmo-hlr program.

Use custom DNS encoding instead of libc-ares (which we use in OsmoSGSN
already), because libc-ares is only a DNS client implementation and we will
need both client and server.

Resubmit of f10463c5fc after being
reverted in 110a49f69f. This new version
skips the mslookup_client_mdns test if multicast is not supported in the
build environment. I have verified that it doesn't break the build
anymore in my own OBS namespace.

Related: OS#4237, OS#4361
Patch-by: osmith, nhofmeyr
Change-Id: I3c340627181b632dd6a0d577aa2ea2a7cd035c0c
2020-01-13 14:10:50 +01:00
Oliver Smith 5436c77a96 Makefile.am: fix pkgconfig_DATA
Fix building debian packages:
	dh_install: Cannot find (any matches for) "usr/lib/*/pkgconfig/libosmo-mslookup.pc" (tried in "." and "debian/tmp")
	dh_install: libosmo-mslookup-dev missing files: usr/lib/*/pkgconfig/libosmo-mslookup.pc
	dh_install: missing files, aborting

Fixes: bf7deda0fc ("add libosmo-mslookup abstract client")
Change-Id: Ib0bce2d09b41834f7331969eaf7c57a9787f7efb
2020-01-13 14:08:27 +01:00
Harald Welte 110a49f69f Revert "add mDNS lookup method to libosmo-mslookup"
This reverts commit f10463c5fc, as it
causes all OBS osmo-hlr builds to fail in the mslookup_client_mdns test.

Change-Id: I5aec5b59f304c7f732c4a31131beedf29c966d9d
2020-01-12 16:27:42 +01:00
Harald Welte 41fe362591 Revert "add osmo-mslookup-client program"
This reverts commit 637bbfcd92, as it
is a follow-up commit to Change-Id I03a0ffa1d4dc1b24ac78a5ad0975bca90a49c728
which causes all OBS osmo-hlr builds to fail in the mslookup_client_mdns test.

Change-Id: I43084ac3b24684f17df43fefc82019e44baaa236
2020-01-12 16:26:52 +01:00
Alexander Couzens 0bb8fce2f1 hlr: remove unused internal USSD list
struct hlr.iuse_list is not used at all.

Change-Id: I7b51c195bbc107beb0a0bde72b266757fc4fd5e2
2020-01-11 23:48:38 +01:00
Neels Hofmeyr 637bbfcd92 add osmo-mslookup-client program
Standalone program using libosmo-mslookup to easily integrate with programs
that want to connect services (SIP, SMS,...) to the current location of a
subscriber. Also useful for manual testing.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: Ie68a5c1db04fb4dff00dc3c774a1162f5b9fabf7
2020-01-10 16:07:40 +00:00
Oliver Smith f10463c5fc add mDNS lookup method to libosmo-mslookup
Add the first actually useful lookup method to the mslookup library: multicast
DNS.

The server side is added in a subsequent commit, when the mslookup server is
implemented for the osmo-hlr program.

Use custom DNS encoding instead of libc-ares (which we use in OsmoSGSN
already), because libc-ares is only a DNS client implementation and we will
need both client and server.

Related: OS#4237
Patch-by: osmith, nhofmeyr
Change-Id: I03a0ffa1d4dc1b24ac78a5ad0975bca90a49c728
2020-01-10 16:07:40 +00:00
Oliver Smith bf7deda0fc add libosmo-mslookup abstract client
mslookup is a key concept in Distributed GSM, which allows querying the current
location of a subscriber in a number of cooperating but independent core
network sites, by arbitrary service names and by MSISDN/IMSI.

Add the abstract mslookup client library. An actual lookup method (besides
mslookup_client_fake.c) is added in a subsequent patch.

For a detailed overview of this and upcoming patches, please see the elaborate
comment at the top of mslookup.c.

Add as separate library, libosmo-mslookup, to allow adding D-GSM capability to
arbitrary client programs.

osmo-hlr will be the only mslookup server implementation, added in a subsequent
patch.

osmo-hlr itself will also use this library and act as an mslookup client, when
requesting the home HLR for locally unknown IMSIs.

Related: OS#4237
Patch-by: osmith, nhofmeyr
Change-Id: I83487ab8aad1611eb02e997dafbcb8344da13df1
2020-01-10 16:07:40 +00:00