Commit Graph

6525 Commits

Author SHA1 Message Date
Neels Hofmeyr 1263bc8017 move gsm_cbfn to gsm_subscriber.h, the only user
(with two less line feeds)

Change-Id: I375e5b021e643f6b1986ea35ebaf3a6d60e189f5
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 9587759c71 drop cruft from gsm_subscriber.h
Change-Id: If6e2252486fe8d932f229a70ce5a4b6f22f6fc52
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 7b61ffe69b GSM_EXTENSION_LENGTH -> VLR_MSISDN_LENGTH
gsm_subscriber.h contains some legacy cruft, part of which is that the VLR's
max MSISDN length should rather be defined in vlr.h. Same for GSM_NAME_LENGTH
-> VLR_NAME_LENGTH.

Adjust some sms_queue stuff that anyway includes vlr.h already.

Drop gsm_subscriber.h from vlr.h.

Add other (more concise) includes that thus become necessary, since the include
chain vlr.h->gsm_subscriber.h->gsm_data.h is no longer in place.

Change-Id: Iab5c507ec04fc2884187cf946f6ae2240e4a31f8
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 8b6e536007 move gsm_auth_tuple to vlr.h as vlr_auth_tuple
Along goes GSM_KEYSEQ_INVAL as VLR_*.

It's where it logically belongs, and is almost the only reason why vlr.h
includes gsm_data.h. The remaining reason, GSM_EXTENSION_LENGTH, will be moved
by upcoming patch.

Change-Id: I122feae7ee3cbc59e941daef35a954bce29fec76
2018-11-30 22:46:15 +01:00
Neels Hofmeyr df6d2e3838 cosmetic: drop some unused opaque struct defs
Change-Id: I4d461dd39d0abdc4f2327445671459340ca1c946
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 7992122bac combine several small .h in msc_common.h
For hysterical raisins, there are some header files that contain few
declarations, and where the name doesn't reflect the content. Combine them to
new msc_common.h:

- common.h
- common_cs.h
- osmo_msc.h

Change-Id: I9e3a587342f8d398fb27354a2f2475f8797cdb28
2018-11-30 22:46:15 +01:00
Neels Hofmeyr a8945ce37c move ran_conn declarations to new ran_conn.h
With the dawn of inter-BSC,MSC handover, adopting the MSC-A,-I,-T roles from
3GPP TS 49.008, the RAN connection shall soon be a neatly separated corner of
osmo-msc, so gravitate ran_conn decarations to files of matching name.

Also, the current chaos of API defined in files with mismatching/meaningless
names drives me crazy.

Change-Id: Ice31e6c43e46678538c65261f150c67e1d0845e5
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 69d4395342 move subscr_conn.c to ran_conn.c
subscr_conn.c exclusively defines ran_conn related things. Rename the file.

Change-Id: I6aa6b335842116c717a554c981083a914724ee21
2018-11-30 22:46:15 +01:00
Neels Hofmeyr 3c20a5ee74 rename some RAN conn related stuff to ran_conn_*
Following previous rename of gsm_subscriber_connection:

Some functions and #defines are still called like "msc_conn" or just "msc_",
while they are clearly about a RAN conn.

To avoid confusion with the future separate concepts of MSC roles and a RAN
connection, rename all those to match the common "ran_conn" prefix.

Change-Id: Ia17a0a35f11911e00e19cafb5d7828d729a69640
2018-11-30 22:46:13 +01:00
Neels Hofmeyr c036b79918 rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.

* Name choice:

In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.

The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.

* Rationale:

A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.

Also:

- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*

Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-30 22:45:42 +01:00
Neels Hofmeyr d03e728915 drop msc_compl_l3() return value
msc_compl_l3() always returns MSC_CONN_ACCEPT, because the conn FSM handles (or
should handle) all reject cases. The accept/reject return value is a legacy
from libbsc internally passing a conn over to libmsc, in osmo-nitb.

Drop enum msc_compl_l3_rc.
Change msc_compl_l3_rc() to return void.
Change all callers to always act like for acceptance, as they always did anyway.
Drop some local variables now no longer needed.
Adjust the comment to msc_compl_l3().
Drop a bunch of #if-0'd code from msc_compl_l3().

Change-Id: I759d15f4e820d5fc16397ed7210ce92308e52a09
2018-11-30 22:44:23 +01:00
Neels Hofmeyr f41658d52e rename gsm_encr to geran_encr, it is only applicable on GERAN
On UTRAN, Security Mode is used instead of Ciphering Command, which does not
feature an A5 algorithm id.

Change-Id: Idc7ca9da1aa13ae16f5db2cb1024676cbc770820
2018-11-30 22:44:23 +01:00
Neels Hofmeyr b0779bbcab populate gsm_subscriber_connection->encr during Ciph
The gsm_subscriber_connection->encr is never used. Use it.

When sending the Ciphering Mode Command, populate the encryption key.
When receivint the Ciphering Mode Complete, populate the chosen alg_id.

Out of paranoia, store the enc key only if the size is large enough.

Hence the vty_dump_one_conn() now reports the actually chosen A5 algorithm ID
used.

For 3G connections, though, this will still remain 0 in the VTY, since there is
no explicit A5 algorithm negotiated on UTRAN. (Security Mode Command and
Security Mode Complete instead of the GERAN Ciphering.)

(Note, 'struct gsm_encr encr' will be renamed to 'struct geran_encr geran_encr'
in Idc7ca9da1aa13ae16f5db2cb1024676cbc770820)

Change-Id: Ice2c470c360612249f97301944c6fdf9443c7dce
2018-11-30 22:44:23 +01:00
Neels Hofmeyr dbaab50da3 adjust copyright in subscr_conn.c
Change-Id: Ia89e2d343a850234557e365457705a11d26fd925
2018-11-30 22:44:23 +01:00
Neels Hofmeyr 7486a94f56 cosmetic: subscr_conn_fsm_auth_ciph() should be static
Only used in subscr_conn.c.

Change-Id: Iaa2c63d2b06f59d34e0465c40a98741f56ec526a
2018-11-30 22:44:23 +01:00
Neels Hofmeyr c62c6d5d39 drop unused tests/db/*
Another one of those "what is this still doing here". Not mentioned in
configure.ac nor Makefile.am SUBDIR...

Change-Id: I05880507d9bf029f0ec451efda0ebe54ac09ef12
2018-11-30 22:44:23 +01:00
Neels Hofmeyr 81f6959ed5 drop unused gsm0408_allow_everyone() declaration
Change-Id: Id56ea492594edc38d1f9d31d94a1679c0cb61fa0
2018-11-30 22:44:23 +01:00
Neels Hofmeyr e777b5f575 drop unused SUBSCR_CONN_E_INVALID
The idea to catch uninitialized vars was completely moot. We pass events by
constants anyway.

Change-Id: I6f3c964ee04fec9a96f385199fb3141ac8d672d4
2018-11-30 22:44:23 +01:00
Neels Hofmeyr 29ab4a799a drop unused openbscdefines.h
Change-Id: If35cd49baa4d0a3b38f31736e1696f481babba9c
2018-11-30 22:44:23 +01:00
Vadim Yanitskiy 14e32a41d8 libmsc/gsm_04_11.c: fix: always use SAPI 3 for MT SMS
In I4a07ece80d8dd40b23da6bb1ffc9d3d745b54092 I've introduced a
regression. According to GSM TS 04.11, section 2.3, SAPI 3 shall
be used for both MO/MT SMS transmissions. Due to a mistake,
caused by misunderstanding of the meaning of trans->dlci, SAPI 3
was not assigned to SM transactions if there is already an active
RAN connection with subscriber. Let's fix this.

Let's also drop this misleading comment:

  /* FIXME: specify SACCH in case we already have active TCH */

because it's a task of the BSC/BTS to decide which lchan to use.

Change-Id: I08d0801a89d377441e95fb8e3dd27c8d587f89e9
Related: OS#3716
2018-11-30 19:43:28 +00:00
Neels Hofmeyr f9773b0b97 drop unused gsm_network->handover.active
gsm_network contains an int handover.active which is always zero. Drop it.

There is real handover code coming up soon, one part of this is to avoid
confusion.

The internal MNCC code queried it to decide whether to MNCC_BRIDGE or proxy RTP
(MNCC_FRAME_RECV). Since RTP is being handled by osmo-mgw since forever, drop
that entire condition from mncc_builtin.

Change-Id: Ie16e718266882588b38297121364ca0b7fdfe948
2018-11-30 04:56:59 +01:00
Neels Hofmeyr 344ee30bd4 drop unused gsm_subscr_conn->mncc_rtp_bridge
Change-Id: I322dc18cfe2cc573744261df837e719b5cf224ba
2018-11-30 04:49:12 +01:00
Vadim Yanitskiy 24e025e3e2 libmsc/gsm_04_11.c: refactor MT SMS message handling
According to GSM TS 04.11, the SMC (Short Message Control) state
machine is a part of CM-sublayer of L3, that is responsible for
connection management (establisment and releasing), and SM-RP
(Relay Protocol) message delivery.

For some reason, the connection establisment request from SMC
(GSM411_MMSMS_EST_REQ) was not handled properly - it was
always assumed that connection is already established.

This is why the code initiating a MT (Mobile Terminated) SMS
transfer had to establish a radio connection with subscriber
manually.

Let's benefit from having the SMC state machine, and offload
connection establishment to it. This change makes the local
implementation closer to GSM TS 04.11, and facilitates the
further integration of GSUP transport.

NOTE: the expected unit test output is changed, because now we
always allocate a transaction first, and then establish a
connection, not vice versa.

Change-Id: I4a07ece80d8dd40b23da6bb1ffc9d3d745b54092
2018-11-29 02:54:54 +07:00
Ivan Kluchnikov 9bd4fd601a libmsc/transaction: introduce trans_find_by_sm_rp_mr()
According to GSM TS 04.11, section 8.2.3, the RP Message Reference
is a mandatory field for all messages on the SM-RL (SM Relay Layer),
that is used to link an RP-ACK or RP-ERROR message to the associated
(preceding) RP-DATA or RP-SMMA message transfer attempt.

This change extends the transaction state structure with SM-RP-MR,
and introduces a new function for matching transactions within a
given connection by this reference.

Change-Id: Ice47c37ecef4416e65ecee8931d946c915316791
2018-11-29 02:54:54 +07:00
Vadim Yanitskiy 87c7ea3c5a libmsc/gsm_09_11.c: drop redundant assertion of stored msgb
It's already asserted at the beginning of handle_paging_event().

Change-Id: Ia558e11c6bde7bff130e4b76a4402ecc8068f1ed
2018-11-28 17:01:29 +00:00
Oliver Smith 39093768ca build manuals moved here from osmo-gsm-manuals.git
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.

Related: OS#3385
Change-Id: Ic3c5add3c87f0aadb1ffab668ce16be6d0805d33
2018-11-27 17:50:54 +01:00
Neels Hofmeyr d9fb15603e Merge history from osmo-gsm-manuals.git
Change-Id: I30ec6b3bc18fa36e7bad74ca445bc9949dcefe80
2018-11-27 17:44:56 +01:00
Neels Hofmeyr ab3ade70c4 msc: update vty reference
Change-Id: I31f1d388b5323af8ece8a71a82c1b91f80d404e1
2018-11-27 17:43:39 +01:00
Daniel Willmann 020a485287 OsmoBSC/HLR/MSC: Fix default config file name
Mention that the default is not openbsc.cfg, but osmo-*.cfg

Change-Id: I139e6004e28d6f918f31792e634214a6153edd0e
2018-11-27 17:43:39 +01:00
Harald Welte 732443c3b8 add SGs / CSFB related dot + msc files
Those graphs + message sequence charts are not yet used by any
of our manuals, but they should become used by the OsmoMSC user
manual once SGs interface support is added.

Related: OS#2583
Change-Id: Idfd3a66c18131b5458d183b8e66f62eaaab65991
2018-11-27 17:43:39 +01:00
Harald Welte d89f1d18cb vty-ref: Update URI of docbook 5.0 schema
... to match the /etc/xml/catalog file on debian (no "www" in hostname)

Change-Id: Id9f3579c7f2bc3af13fe30b5268f249b6f59ed0d
2018-11-27 17:43:39 +01:00
Neels Hofmeyr df7d7ffc52 OsmoMSC: update VTY reference
This is the first update since the libosmocore changes to the 'show
online-help' generated output. Hence the produced document now benefits from
the structural improvements:
- not repeating common commands for every node;
- using section names that match the VTY prompt.

Update msc_vty_additions.xml to match the new node ID scheme.

Change-Id: I6f1698dbc205334cf69234f88b124abfce54cc9a
2018-11-27 17:43:39 +01:00
Harald Welte 593bbb5e5e share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR
Since the NITB split, GSUP is used in all three network elements, so
make the protocol a shared chapter

Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f
2018-11-27 17:43:39 +01:00
Alexander Couzens 7fd0e0fd64 OsmoMSC: add rate counter documentation
Change-Id: Idc105fd16511c6ea4f5069a57b217ea3319bdbec
2018-11-27 17:43:39 +01:00
Neels Hofmeyr adfbd3b8d6 refactor Makefile build rules, don't use the FORCE
The initial goal was to make sure we don't have overall FORCE rules causing
unnecessary rebuilds -- annoying while writing documentation. As I looked
through possible dependencies, I finally understood what's going on here.

Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In
each, describe in a top comment how to use it, and also unify how they are
used:

- Rename Makefile.inc to Makefile.docbook.inc and refactor
- Add Makefile.vty-reference.inc
- Add Makefile.common.inc

Make sure that we accurately pick up all dependencies.

Drop use of the macro called 'command', that silenced the actual command lines
invoked and replaced them with short strings: it obscures what is actually
going on and makes the Makefiles hard to read and understand.

Each manual's makefile is greatly reduced to few definitions and a Makefile
include, e.g. one for asciidoc, one for VTY reference.

Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link
from OsmoNITB. It applies only to OsmoBSC and OsmoNITB.

Add a script that combines a VTY reference file with *all* additions files
found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc.

Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0
2018-11-27 17:43:39 +01:00
Neels Hofmeyr fee9dd7902 add OsmoHLR manual, OsmoHLR VTY reference
Change-Id: Ieb6a362a26a7e65199f68f5cd32d9b6b0e5d0fbf
2018-11-27 17:43:39 +01:00
Neels Hofmeyr 8c8ebb13b6 add OsmoMSC manual
Add OsmoMSC and OsmoHLR to bibliography (even though the OsmoHLR manual does
not yet exist, a reference to it has been added in OsmoMSC's manual).

Change-Id: I9ecff2837fbf5fdc19675a726f6d70c21eb178ee
2018-11-27 17:43:39 +01:00
Neels Hofmeyr 845031955e Importing history from osmo-gsm-manuals
Change-Id: I1b7d606d489f3881ca5b21111a3615c469403d02
2018-11-27 17:43:22 +01:00
Vadim Yanitskiy 380b2195cf libmsc/transaction.c: cosmetic: fix typo
Change-Id: I6d72b856e40ba81ee2f1e60693055705b5993b09
2018-11-27 15:14:31 +07:00
Vadim Yanitskiy 535f110d09 libmsc/gsm_04_11.c: refactor RP-DATA header validation
It's much better to have both RP-DATA header parsing and validation
code in a single function. There is no need to pass all the header
fields (DA, OA, UI) to gsm411_rx_rp_ud() because they are not
used there.

Change-Id: Iaf295949148e2a613c5403d1f7a926fcd6849c15
2018-11-25 21:48:29 +07:00
Vadim Yanitskiy 0c8998f066 libmsc/gsm_04_11.c: don't pass msgb to gsm411_rx_rp_{ack|error}
Passing a message buffer containing the whole encoded message, and
a pointer to the RP header (struct gsm411_rp_hdr) is redundant.

Change-Id: I0eb5c7c485ab7d109966431bd875fa74e00936d7
2018-11-25 21:48:29 +07:00
Philipp Maier 54729d6e5e osmo_msc: remove unused parameter from msc_dtap()
The parameter link_id in the function msc_dtap() is unused. Lets remove
it.

Change-Id: I7ba67b0cb514c91bc87a7b396ed3962b7a68e7da
2018-11-23 10:04:29 +00:00
Vadim Yanitskiy b7e5201b62 msc_vlr_tests.c: drop duplicating DMM category definition
Change-Id: I2bf8150580c318ccaa9c30657582c15020f6b711
2018-11-22 20:24:27 +07:00
Vadim Yanitskiy c350c093c4 msc/gsm_04_11.h: use forward-declaration for _gsm411_sms_trans_free()
Change-Id: I87f96abd2b2d446751d8f95c9164c5eb6a58e66c
2018-11-21 20:52:36 +07:00
Vadim Yanitskiy fb05bb4a60 msc/gsm_04_11.h: drop unused sms_next_rp_msg_ref()
Change-Id: I53b27629177b3342c4f5b34c80d52cbb6dc8476b
2018-11-21 20:52:36 +07:00
Vadim Yanitskiy 0cd761c604 libmsc/db.c: cosmetic: mark missing breaks in switch as intended
Change-Id: I3f4f34ecd0c5bb2d1a675ad5c4669fcffb87f292
Closes: Coverity CID#148209
2018-11-21 19:48:16 +07:00
Max 58099f699f Use libosmocore to function to parse cipher mode reject cause
This allow us to handle both regular and extended cause transparently.

Change-Id: I7742ac41dd0642a5a40ce79d23250f8d9e6ae556
Related: OS#3187
2018-11-20 17:27:40 +00:00
Max f1329c533d Use BSSAP-specific TLV parser from libosmocore
Change-Id: Iae1a3ffcebf1b0b95e61cd5dffe7ef734796fcfc
2018-11-20 15:24:54 +00:00
Pau Espin 3710623e36 msc: vty: Fix integer printf formatting
| ../../../git/src/libmsc/msc_vty.c:1202:44: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'uint64_t {aka long long unsigned int}' [-Wformat=]
|   vty_out(vty, "Location Update         : %lu attach, %lu normal, %lu periodic%s",
|                                             ^

Change-Id: Iae1c0b20a519ce71a21f72cea3c63694ef10adb4
2018-11-19 11:11:17 +01:00
Max 48a595e8ba Fix build with latest libosmocore
Remove locally defined function which conflicts with the one in
libosmocore.

Change-Id: I464c16034b76e4599ac42857f60442c3fd000c75
2018-11-19 09:48:22 +00:00