Commit Graph

6607 Commits

Author SHA1 Message Date
Philipp Maier f913e5f575 a_reset: cleanup + remove dead code
a_reset.c/h was originally developed to be used in both, bsc and
msc without changes. Unfortunately no suitable library has been
found for a_reset.c/h so the file ended up as duplicated code in
both split brances. Eventually we decided to specialize the
generalized code again, which means some of the functions needed
only by osmo-bsc are removed.

- Remove dead code
- Fix timer identification number (T16)
- use fi->priv to hold context info
- Minor cosmetic fixes

Change-Id: I8e489eb494d358d130e51cb2167929edeaa12e92
Depends: libosmocore I36d221c973d3890721ef1d376fb9be82c4311378
Related: OS#3103
2018-05-17 20:14:01 +00:00
Philipp Maier 6f4752e00c vlr_access_req_fsm: use correct cause codes
The FSM that controls the VLR ACCESS uses cause code 9
(GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE) to signal that the
identity of the MS is currently not known in VLR (MSC-Reboot)
However, this cause code is from the GMM domain and is interpreted
as GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER by the MS, which cauese
the MS not to make a new LOCATION UPDATE on CM SERVICE REQUEST

- use GSM48_REJECT_IMSI_UNKNOWN_IN_VLR and
  GSM48_REJECT_IMSI_UNKNOWN_IN_VLR instead of
  GSM48_REJECT_IMSI_UNKNOWN_IN_VLR

Change-Id: Ic058c93387f9be9af4940f8961839c02b93ee370
Closes: OS#3266
2018-05-16 10:34:16 +02:00
Pau Espin cb8c75bba0 Bump version: 1.1.2.269-86f21-dirty → 1.2.0
Change-Id: I79d1f009617b247b6c3322a7926fd565913b1e6c
2018-05-03 18:52:03 +02:00
Pau Espin 86f212666a setup_trig_pag_evt: Fix heap-use-after-free
Catched by osmo-gsm-tester running test voice:octphy.

Fixes following AddressSanitizer report:
==18864==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a000016f18 at pc 0x55f1b29eee5c bp 0x7ffdaa2ac000 sp 0x7ffdaa2abff8
WRITE of size 8 at 0x61a000016f18 thread T0
    #0 0x55f1b29eee5b in setup_trig_pag_evt osmo-msc/src/libmsc/gsm_04_08.c:1490
    #1 0x55f1b2a086c1 in subscr_paging_dispatch osmo-msc/src/libmsc/gsm_subscriber.c:101
    #2 0x7fb88e07c1c9 in osmo_timers_update libosmocore/src/timer.c:257
    #3 0x7fb88e07f1b1 in osmo_select_main libosmocore/src/select.c:253
    #4 0x55f1b29b600b in main osmo-msc/msc_main.c:694
    #5 0x7fb88bebe2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #6 0x55f1b29b69f9 in _start (osmo-msc/bin/osmo-msc+0xf09f9)

Related: OS#3198

Change-Id: Ie7fdca4d48e247c77a53e81aec2b6bacd8fef678
2018-04-24 14:02:03 +02:00
Pau Espin 3f8cec8f66 setup_trig_pag_evt: Always log correct paging failure case
Change-Id: I5c7a49b42b6ced1a5e0afb3485eaf94ef55bbf23
2018-04-24 13:52:00 +02:00
Pau Espin 25adebea4c setup_trig_pag_evt: Remove uneeded default case in switch statement
Take the chance to  pass a var of type enum instead, so the compiler
warns us if a new enum value is added. For instance, if we remove
GSM_PAGING_EXPIRED from the switch statement:

src/libmsc/gsm_04_08.c:1463:2: warning: enumeration value ‘GSM_PAGING_EXPIRED’ not handled in switch [-Wswitch]
  switch (paging_event) {
  ^~~~~~

Change-Id: I65d871704b9636c594dc982200fbe7f7ce6784f5
2018-04-24 11:47:00 +02:00
Pau Espin 4cf452fbd8 Remove unused GSM_PAGING_OOM
Change-Id: Ie5883953f48d11ec498f47c30ab4201bb956368c
2018-04-24 11:35:37 +02:00
Pau Espin 7e300d8741 smpp_smsc_conf: Fix heap-use-after-free
Fixes following error catched by enabling address sanitizer:
==20792==ERROR: AddressSanitizer: heap-use-after-free on address 0x60b000122610 at pc 0x7f9c9c3fe063 bp 0x7ffd2e68f600 sp 0x7ffd2e68edb0
READ of size 11 at 0x60b000122610 thread T0
    #0 0x7f9c9c3fe062  (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x3c062)
    #1 0x7f9c9beb8ee4 in talloc_strdup (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x6ee4)
    #2 0x56096a7cf75b in smpp_smsc_conf src/libmsc/smpp_smsc.c:983
    #3 0x56096a7cf9df in smpp_smsc_start src/libmsc/smpp_smsc.c:1015
    #4 0x56096a7d4935 in smpp_openbsc_start src/libmsc/smpp_openbsc.c:785
    #5 0x56096a755ad0 in main src/osmo-msc/msc_main.c:598
    #6 0x7f9c9927b2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #7 0x56096a756979 in _start (/home/jenkins/workspace/osmo-gsm-tester_run-prod/trial-805/inst/osmo-msc/bin/osmo-msc+0xf0979)

Related: OS#3181

Change-Id: Iaf0d251c8d2912266a087ada4d20905146e08592
2018-04-17 16:10:35 +02:00
Vadim Yanitskiy 7d7ee427b3 tests/msc_vlr: fix expected SS message names
Since the I697639d8469e5dda617b27995c4a92e1f0c0bead, call
independent SS messages are also supported by
gsm48_pdisc_msgtype_name().

So, instead of 'NCSS:0x3b' it will return 'GSM0480_MTYPE_REGISTER'.
Let's correct the expected message names.

Change-Id: If9e854ee84882d104cf2ffaceb3862fda6862f19
2018-04-17 19:28:55 +07:00
Neels Hofmeyr 21adb2bcd1 cosmetic: use enum ranap_nsap_addr_enc instead of int
The only reason to use int instead of the enum was the lack of header
iu_client.h when not building with Iu support. Rather use the configure result
properly, include the header when Iu support is built and use the proper enum.

Omit the entire iu sub-struct when building without Iu.

Add LIBOSMORANAP_CFLAGS to libvlr, in order to find the iu_client.h header (now
also included from gsm_data.h).

Rationale: Instead of using a questionable typecast from int* to enum*, we can
now use the enum member directly without needing to silence compiler warnings.

Change-Id: Ic9f8bf53f4b605c166e84cd7edd90c10fe7d7a1f
2018-04-16 01:50:46 +02:00
Harald Welte 37a3ae8585 sms_queue: fix use-after-free on 'pending'
This bug is super obvious: We cannot first call
sms_pending_free(pending) and then in the next line still dereference
the pending->sms_id member.

This bug was introduced in January with Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78
and apparently nobody has tested any MT-SMS with asan enabled since?

Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Closes: OS#3152
2018-04-14 20:57:42 +02:00
Harald Welte ce96928e12 smpp: Unset esme->acl on socket close
We set acl->esme during _process_bind(), but we don't clear it
in case the TCP connection for the ESME is dead.  This leads to
a stale acl->esme pointer, which we will attempt to dereference
the next time a SMS is delivered to a route pointing to this acl,
where it will be a heap use-after-free.

This was discovered using AddressSanitizer and MSC_Tests.ttcn

Closes: OS#3168
Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
2018-04-14 15:07:36 +02:00
Neels Hofmeyr 99a8d235f3 msc conn ref counts: log human readable list of conn owners
Change-Id: I2a09efafbdbdde0399238f7d79feea8612605201
2018-04-12 19:40:01 +00:00
Neels Hofmeyr 158095960b refactor VLR FSM result handling
Instead of keeping separate enums for FSM results and translating between those
and the actual 04.08 reject causes that will ultimately reach the MS, just pass
enum gsm48_reject_value cause codes around everywhere.

Collapse some VLR *_timeout() and *_cancel() api to just *_cancel() with a
gsm48 cause arg.

(Hopefully) improve a few reject causes, but otherwise just aim for more
transparent decisions on which cause value is used, for future fixes of
returned causes.

Depends: I6661f139e68a498fb1bef10c266c2f064b72774a (libosmocore)
Change-Id: I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1
2018-04-12 19:40:00 +00:00
Vadim Yanitskiy 048eb30684 libmsc/ussd: don't overwrite rc if decoding failed
Change-Id: I344e4b3a9aad617686a7ddbdeae5780fd8b07e58
2018-04-12 09:27:44 +00:00
Neels Hofmeyr fe4ba7c057 cosmetic: embed compl_l3_type in FSM id
In the subscr_conn_fsm instance's ID, include the Complete Layer 3 type, so
that we can see on the first glance whether a state transition belongs to MO or
MT.

The huge patch is due to the cosmetic change affecting nearly every single log
line in the msc_vlr_tests, by nature of changing the FSM's ID.

Related: OS#3122
Change-Id: I2a7e27e0f16df1872dcda64cb928c3b8528ea3f7
2018-04-11 21:39:44 +00:00
Neels Hofmeyr 2a5cd93d8f fix BSC Clear Request
On receiving a Clear Request, don't send a Clear Command "out of band", let the
FSM do the release handling by invoking msc_subscr_conn_mo_close().

Fixes: ttcn3 MSC_Tests.TC_lu_clear_request
Change-Id: I168b889ac7989641cc679b781dcffb87ff13a710
2018-04-11 21:39:44 +00:00
Neels Hofmeyr 4068ab278b properly receive BSSMAP Clear Complete and Iu Release Complete
When sending a BSSMAP Clear or Iu Release, do not immediately discard the conn,
but wait until a BSSMAP Clear Complete / Iu Release Complete has been received.

Hence we will no longer show in the log that an incoming Release/Clear Complete
belongs to an unknown subscriber, but will still be around to properly log the
release.

Related: OS#3122
Change-Id: Ie4c6aaba3866d6e5b98004e8870a215e8cf8ffc1
2018-04-11 21:39:44 +00:00
Neels Hofmeyr e3d3dc6ea2 refactor subscr_conn and subscr_conn_fsm de-/alloc
Refactor:

1. Glue the gsm_subscriber_connection alloc to the subscr_conn_fsm.
2. Add separate AUTH_CIPH state to the FSM.
3. Use conn->use_count to trigger conn release.
4. Add separate RELEASING state to the FSM.
5. Add rate counters for each of the three Complete Layer 3 types.

Details:

1. Glue the gsm_subscriber_connection alloc to the subscr_conn_fsm.

Historically, a gsm_subscriber_connection was allocated in libbsc land, and
only upon Complete Layer 3 did libmsc add the fsm instance. After splitting
openbsc.git into a separate osmo-msc, this is no longer necessary, hence:

Closely tie gsm_subscriber_connection allocation to the subscr_conn_fsm
instance: talloc the conn as a child of the FSM instance, and discard the conn
as soon as the FSM terminates.

2. Add separate AUTH_CIPH state to the FSM.

Decoding the Complete Layer 3 message is distinctly separate from waiting for
the VLR FSMs to conclude. Use the NEW state as "we don't know if this is a
valid message yet", and the AUTH_CIPH state as "evaluating, don't release".

A profound effect of this: should we for any odd reason fail to leave the FSM's
NEW state, the conn will be released right at the end of msc_compl_l3(),
without needing to trigger release in each code path.

3. Use conn->use_count to trigger conn release.

Before, the FSM itself would hold a use count on the conn, and hence we would
need to ask it whether it is ready to release the conn yet by dispatching
events, to achieve a use_count decrement.

Instead, unite the FSM instance and conn, and do not hold a use count by the
FSM. Hence, trigger an FSM "UNUSED" event only when the use_count reaches zero.
As long as use counts are done correctly, the FSM will terminate correctly.

These exceptions:

- The new AUTH_CIPH state explicitly ignores UNUSED events, since we expect the
  use count to reach zero while evaluating Authentication and Ciphering. (I
  experimented with holding a use count by AUTH_CIPH onenter() and releasing by
  onleave(), but the use count and thus the conn are released before the next
  state can initiate transactions that would increment the use count again.
  Same thing for the VLR FSMs holding a use count, they should be done before
  we advance to the next state. The easiest is to simply expect zero use count
  during the AUTH_CIPH state.)

- A CM Service Request means that even though the MSC would be through with all
  it wants to do, we shall still wait for a request to follow from the MS.
  Hence the FSM holds a use count on itself while a CM Service is pending.

- While waiting for a Release/Clear Complete, the FSM holds a use count on
  itself.

4. Add separate RELEASING state to the FSM.

If we decide to release for other reasons than a use count reaching zero, we
still need to be able to wait for the msc_dtap() use count on the conn to
release.

(An upcoming patch will further use the RELEASING state to properly wait for
Clear Complete / Release Complete messages.)

5. Add rate counters for each of the three Complete Layer 3 types.

Besides LU, also count CM Service Request and Paging Response
acceptance/rejections. Without these counters, only very few of the auth+ciph
outcomes actually show in the counters.

Related: OS#3122
Change-Id: I55feb379e176a96a831e105b86202b17a0ffe889
2018-04-11 21:39:44 +00:00
Neels Hofmeyr dc2514b220 CC: intentionally release T308 on BSSMAP Clear Request from BSC
So far we hit a running T308 during CC release when caused by a BSSMAP Clear
Request, and we loudly log that as error.

However, now I understand that T308 is a direct cause of the dispatch of a REL
IND towards MNCC, which is used to indicate teardown to MNCC. So during
_gsm48_cc_trans_free(), we first clear all timers, then invoke
mncc_release_ind() which starts another timer (useful for graceful CC Release,
but in this code path the intention is immediate release). Simply immediately
cancel the timer again and release the conn.

A separate question is whether a BSSMAP Clear Request should be less aggressive
in releasing the connections; i.e. instead of calling trans_free() all around,
to rather ask each transaction to "please stop soon", somehow.

Related: OS#3062
Change-Id: I231fdb574a086a206321148474cbdc7ca9cf39f0
2018-04-11 21:39:44 +00:00
Philipp Maier 79beccd93a msc_mgcp: do not send wildcarded DLCX messages
If an error on the MGW side occurs, the MSC may send out
a DLCX command that contains a wildcarded endpoint name.
Wildcarded DLCX commands are legal in principle but not
in the context of an error on a single endpoint. Apart
from that osmo-mgw is (not yet) capable to handle
wildcarded DLCX command.

The problem is caused by a wrong error handling. When the
first (RAN) CRCX fails the error handling logic tries to
perform a DLCX, but since we did not receive a specific
endpoint name yet, the buffer containing the endpoint name
is still initalized with the wildcarded enpoint name, but
the error handler and the code that generates the DLCX is
not aware of that.

- Perform a check in the error handler function that
  checks if a DLCX can be made (a specific endpoint
  name is set

- Correct the flags in the code that handles the first
  CRCX so that no DLCX is requested in the case of error

Related OS#2882

Change-Id: I64c2a82016d854ad446fd49a5d76a28324e8bd4b
2018-04-11 17:36:45 +02:00
Philipp Maier d997fa176d msc_mgcp.c: log endpoint name instead of pointer
The logtext currently logs the pointer (address) of the string
variable that holds the endpoint name, rather then the endpoint
name itself.

- Use %s instead of %p in format string

Change-Id: I01b3d07aeedd72be60361249a5bf80fbb68b7bb8
2018-04-11 15:25:35 +02:00
Neels Hofmeyr cbcf89c2ac msc_vlr_test_call: reproduce OS#3062
A related ttcn3 test is added in Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51

Related: OS#3062
Change-Id: Ice7197b48d4e163a3c4d97b559fdcd7e88c4107e
2018-04-10 00:18:16 +00:00
Neels Hofmeyr f840e6fe98 trans_free: drop bad assertion
I assumed that trans_free() would always be called before freeing the FSM. But
the actual conn free dance that tries to make sure a release is triggered from
all directions actually may run into a situation where conn->fi is NULL.

The situation is described in OS#3125.

For now simply drop the assert.

The subscr conn and FSM dealloc will soon be glued firmly together; but I want
to add a test against OS#3062 before that, and that would also hit above assertion.

Related: OS#3125 OS#3062
Change-Id: I5c30e0f9545fb76615776ff6cc16b56aeb5b043a
2018-04-10 02:15:02 +02:00
Vadim Yanitskiy f95d5be0ae libmsc/ussd.c: cosmetic: correct log level and message
Change-Id: If6c270fae54ce79c2708c99d7762ce6ff71f43d9
2018-04-09 18:57:33 +00:00
Vadim Yanitskiy 12d221f8cc libmsc/gsm_04_80.c: drop unused 'in_msg' argument
It isn't used, so no need to pass it.

Change-Id: I4248ebf8626d3f7f0bf273fd20cc4f64e979938b
2018-04-09 18:57:33 +00:00
Vadim Yanitskiy 01c0549af3 ussd.h: cosmetic: use '#pragma once' include guard
Change-Id: I0e78aa946b8e6bc7c31534751b2ee5c867bfd490
2018-04-09 18:57:33 +00:00
Vadim Yanitskiy b7d4065648 ussd.h: cosmetic: remove useless comment
We usually put comments for functions in *.c files, while header
files are usually plain listings of the API without comments.

Change-Id: I6b0d1d9e1a1b1ffb71cb9905e74f6fad2333bb65
2018-04-09 18:57:33 +00:00
Harald Welte 39b5548808 Permit any Sender MSISDN when sending SMS from VTY
In the old days, OsmoNITB couldn't process any SMS that wasn't between
two subscribers on the same NITB.

We've long re-worked the internals in order to process SMS with
arbitrary sender MSISDN (e.g. from SMPP). However, the VTY command
"subscriber ... sms" was never updated, it seems.

Change-Id: I62b17e0a67989484415f0df2c8cb4ff1f94dbf2b
Closes: OS#3151
2018-04-09 19:19:33 +02:00
Harald Welte 0e2fa5dcb5 DTAP: Ensure proper DLCI is used in MSC-originated DTAP
The DLCI field of the DTAP header indicates the SAPI as well as the
data link (main DCCH or SACCH).  We must make sure to use the correct
DLCI when sending DTAP to the BSC.

We achieve this by
* storing the DLCI in the msgb->cb while parsing the DTAP header
* storing the received DLCI (from msgb->cb) in the transaction for
  mobile-originated transactions
* using the trans->dlci to sent msgb->cb when transmitting L3
* filling the DTAP DLCI value from msgb->cb when transmitting DTAP

For MSC-originated transactions, we choose a DLCI value corresponding
to the service (SAPI=0 for CC, SAPI=3 for SMS) and store that in
trans->dlci.

Closes: OS#3150
Change-Id: If511b20f52575054cab1346d99a8cb68d827fdbf
2018-04-09 16:41:10 +02:00
Neels Hofmeyr 93c7463fce unify allocation of gsm_subscriber_connection
The current msc_subscr_con_allocate() was in fact only used by msc_vlr_tests,
while both a_iface_bssap.c and iucs.c did their own duplicate code of
allocating the gsm_subscriber_connection struct. Unify.

Drop the old msc_subscr_con_allocate(), instead add msc_subscr_conn_alloc().
The new function also takes via_ran and lac arguments directly.

The conn allocation will soon be closely tied to the subscr_conn_fsm instance
allocation, so place the new function definition alongside the other
subscr_conn_fsm API, and match its naming ("conn").

Related: OS#3122
Change-Id: Ia57b42a149a43f9c370b1310e2e1f512183993ea
2018-04-05 01:10:32 +02:00
Neels Hofmeyr 16c42b5fba subscr_conn: store complete_layer3_type in conn, not FSM event arg
Instead of jumping through hoops to pass the Complete Layer 3 operation that
created this conn via FSM event dispatch parameters, put it right in the
gsm_subscriber_connection struct, where it always belonged.

Move definition of the enum complete_layer3_type to gsm_data.h, where
gsm_subscriber_connection is defined.

Introduce msc_subscr_conn_update_id() to set the complete_layer3_type of the
conn as soon as a Complete Layer 3 message is received.

In msc_subscr_conn_update_id(), already include an mi_string argument to
prepare for an upcoming patch where the FSM will be allocated much earlier when
the Mobile Identity is not known yet, and we'll also update the fi->id here.

The odd logging change in the msc_vlr_tests output uncovers a wrong use of the
osmo_fsm_inst_dispatch() data argument for SUBSCR_CONN_E_CN_CLOSE events: if a
child FSM signals unsuccessful result, instead of the failure cause, it passed
the complete_layer3_type, as requested upon FSM allocation, which was then
misinterpreted as a failure cause. Now a child FSM failure will pass NULL
instead, while other SUBSCR_CONN_E_CN_CLOSE events may still pass a valid cause
value.

Related: OS#3122
Change-Id: Iae30dd57a8861c4eaaf56999f872d4e635ba97fb
2018-04-03 02:13:16 +02:00
Neels Hofmeyr 1ba0df26dc cosmetic: rename subscr_conn_from to complete_layer3_type
'subscr_conn_from' could mean anything: from what, RAN type? BSS identifier? MM
action? Clearly name it as the Complete Layer 3 kind it represents.

Related: OS#3122
Change-Id: I6263a80e6db01c2ca48df6c58b05e2fd19347057
2018-04-03 02:13:09 +02:00
Neels Hofmeyr 4d3a66b3f8 cosmetic: rename gsm_subscriber_connection->conn_fsm to ->fi
Match osmo-bsc's naming of the subscriber connection's FSM instance; 'conn->fi'
makes more sense anyway than 'conn->conn_fsm'.

BTW, an upcoming commit will do away with the legacy from libbsc/libmsc duality
and firmly glue the conn allocation to the fi.

Related: OS#3122
Change-Id: If442f2ba78d9722b1065ec30c9a13f372b6a8caa
2018-04-03 02:13:04 +02:00
Neels Hofmeyr ae73d2b16f cosmetic: rx_bssmap: read message type once into local var
Instead of referencing msg->l3h[0] all the time, use local variable msg_type.

Related: OS#3122
Change-Id: If70c9fa00edd462d3470bded6eb2c6521e4d9234
2018-04-03 02:12:09 +02:00
Neels Hofmeyr 9fe52e4af3 test_reject_concurrency: missing assert
I broke this test during dev and saw the failure being noticed only in the next
test when DTAP is expected again. Verify success right there, instead.

Change-Id: Ifdde3a6fa5835203c34c40db77761f2e90c0d5ff
2018-04-03 02:09:39 +02:00
Neels Hofmeyr 80d1101153 drop some dead definitions (gsm_data.h, gsup_client.c)
Change-Id: Icad01d0ad8fa68293160bc56543b9c3dcafc50bb
2018-04-02 23:59:50 +02:00
Neels Hofmeyr 08b3828995 use osmo_init_logging2() with proper talloc ctx
Since the logging allocations now also show up in the root context report, some
tests need adjusted talloc checks.

In msc_vlr_tests, also output the number of talloc blocks before tests are
started to show that the number didn't change after the tests.

Change-Id: Iae07ae60230c7bab28e52b5df97fa3844778158e
2018-03-30 23:20:03 +02:00
Neels Hofmeyr 053e27528c gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'
Change-Id: Idb3ca50009e25c8e10bcbd15e430caf6de18a040
2018-03-26 19:09:07 +02:00
Pau Espin 7fdfad2f5d contrib: osmo-msc.service: Depend on osmo-mgw.service
Change-Id: Ia50eb02843bf6d145040fbe5032071a3be7b0794
2018-03-23 15:58:06 +01:00
Neels Hofmeyr a6ac98b6aa remove empty libcommon-cs
Change-Id: If6afda250986b12781ae579323985615621ed75c
2018-03-22 17:11:30 +01:00
Neels Hofmeyr 79e580b6ff dissolve libcommon-cs: move gsm48_* code to libmsc, drop sms_next_rp_msg_ref()
Move gsm48_* functions from common_cs.c to libmsc/gsm_04_08.c.

Drop sms_next_rp_msg_ref(), it is just a bunch of bloat around "next_rp_ref++".
Apply the "++" instead, in gsm_04_11.c.

libcommon-cs is now empty, to be removed in subsequent commit.

Change-Id: Ibc410803ce8e273b626124ab9fc934f04df3ae50
2018-03-22 17:10:49 +01:00
Neels Hofmeyr 55014d0509 dissolve libcommon-cs: move gsm_network_init() to libmsc
Move to libmsc/osmo_msc.c (for lack of a better place and reluctance to create
an own file just for gsm_network_init()).

Change-Id: I2279eee4db6f6687726bfd55841b3748d4930f15
2018-03-22 17:07:59 +01:00
Neels Hofmeyr 67fa909494 dissolve libcommon-cs: mv a_reset.c to libmsc
Change-Id: I2936dadf1ec91b39796b6012d5e6c5db39e0bd34
2018-03-22 17:07:36 +01:00
Neels Hofmeyr 8ea65b3270 rename libcommon to libgsupclient
All that is left in libcommon now are the GSUP and OAP client implementations.
These are duplicated in osmo-sgsn.git and make sense to remain somewhat
separate from libmsc. So now they get their own little lib.

Change-Id: Ic71aa119c233b6a0ae169a5b2a53819903d2be82
2018-03-22 17:07:13 +01:00
Neels Hofmeyr 9d74425e27 dissolve libcommon: drop gsm_data.c, move code to libmsc
classmark_is_r99() is only used in gsm_04_08.c, move there as static.
rrlp_mode_* is only used in msc_vty.c, move there as static.
Move ran_type_names[] to msc_ifaces.c.

Change-Id: I5381c72af6841829fbc65940fd7d6f4d5cf583df
2018-03-22 17:06:51 +01:00
Neels Hofmeyr 7a2f58ea63 dissolve libcommon: drop gsm_subscriber_base.c, move vlr_subscr_* to vlr.c
Change-Id: Ia69890da68b8afa8a2a4e8ab58ec5c4a4ba9d06a
2018-03-22 17:06:28 +01:00
Neels Hofmeyr c01e90933f dissolve libcommon: move talloc ctx into msc_main.c, drop talloc_ctx.c
Drop tall_bsc_ctx; in mncc_sock_init(), talloc the mncc_sock_state from
gsm_network.

In tests or utils, move from using an extern tall_bsc_ctx to a local root
context pointer.

Change-Id: I92c252be1d1e7634f1653de47d37c99d77d9501c
2018-03-22 17:06:05 +01:00
Neels Hofmeyr 6a8b9c70fc dissolve libcommon: drop debug.c
Apply more concise logging categories in each main scope. The bulk goes to
msc_main.c, obviously, while tests and utils get a slimmed down bunch of
logging categories.

Change-Id: I969a0662ba273f3721b6820d02151b7a5b8014b8
2018-03-22 17:05:42 +01:00
Neels Hofmeyr 34fd0c69a3 dissolve libcommon: drop unused bsc_version.c
Change-Id: I23f31b1dc265d153598ee9006cae3adaf3cebd2f
2018-03-22 17:04:59 +01:00