Commit Graph

6734 Commits

Author SHA1 Message Date
Neels Hofmeyr 05c5680ba1 vty: mncc cfg: separate the 'mncc' from 'mncc-guard-timeout'
I want to add 'mncc internal' and 'mncc external' commands, and IMHO makes most
sense to have a common 'mncc' keyword to start MNCC config commands with. To
put it in terms of VTY online help:

  OsmoMSC(config-msc)# mncc ?
    internal       Use internal MNCC handler
    external       Use internal MNCC handler
    guard-timeout  Set global guard timeout

So far only the 'guard-timeout' exists, I want to add 'internal' and 'external'
in a subsequent commit.

Keep the old command 'mncc-guard-timeout' as deprecated alias. That means it
still works from old config files, but online documentation will omit it.

On 'write', write back the new format instead.

Rationale: see I2ec59d5eba407f83295528b51b93678d446b9cee

Change-Id: I52d69af48e1ddc87b3fb54bf66a01b1b8cbf5abe
2018-12-05 19:35:11 +00:00
Neels Hofmeyr fb153cbf8c msc_main: mncc: move mncc socket decision to after read_cfg
First step towards allowing to configure the MNCC socket path by config file.

Rationale: see I2ec59d5eba407f83295528b51b93678d446b9cee

Change-Id: Ifc87c1cacaa809d04fc23e8ccd761bee4509c805
2018-12-05 19:35:11 +00:00
Neels Hofmeyr a2ed9b50c6 cosmetic: msc_main.c: default args definition style
Explicitly name each arg with its default value, omit zero values, end last
item in comma.

Change-Id: I0e0f1e2c8722768b6c61fd6544911b20fe1af212
2018-12-05 19:35:11 +00:00
Neels Hofmeyr 18333fa5a5 add test_nodes.vty transcript test
It needs to work whether SMPP,Iu are enable or disabled, hence a bit more
wildcarding than one might expect.

Change-Id: I3a8c50d8d555b6b948d97d6412e17594ee439de0
2018-12-05 19:35:11 +00:00
Neels Hofmeyr 1231fdb7ad make: prepare for adding transcript tests
Separate 'make python-test' into separate make targets, to sensibly add VTY
transcript tests in an upcoming commit.

Feature: even though ./configure was called without --enable-external-tests,
each of the {ctrl,vty}x{python,transcript} tests can be invoked individually by
e.g. 'make vty-python-test'.

Both 'vty-transcript-test' and 'ctrl-transcript-test' are still empty, a
subsequent patch adds a vty-transcript-test.

All of this in preparation of tweaking the 'mncc' vty configuration, to be able
to track it in a vty transcript test.

Change-Id: I688657e56ae469c07b9f25ba37275d38dbd457e2
2018-12-05 19:35:11 +00:00
Neels Hofmeyr e3033b3f48 python tests: use py shebang instead of $(PYTHON)
I'm going to make the external tests manually launchable. For that I first had
an error message if $(PYTHON) was empty. But Pau says I should just use shebang
instead and ignore the autoconf python stuff, since that often fails anyway.

Change-Id: Ie35dd78c42577109a6a3143221a9769e47d361a5
2018-12-05 19:35:11 +00:00
Philipp Maier 425bb8ea83 gsm_subscriber: make function msc_paging_request() static
The function msc_paging_request() is only called from within
gsm_subscriber.c but never from outside. Lets make it static.

Change-Id: I2efc8eac01a4dd8733118067eecf566c13062106
2018-12-05 16:19:34 +00:00
Oliver Smith 42a6c3924c contrib/jenkins.sh: build and publish manuals
Add new environment variables WITH_MANUALS and PUBLISH to control if
the manuals should be built and uploaded. Describe all environment vars
on top of the file.

When WITH_MANUALS is set, install osmo-gsm-manuals like any other
dependency and add --enable-manuals to the configure flags (for "make"
and "make distcheck"). Add the bin subdir of the installed files to
PATH, so osmo-gsm-manuals-check-depends can be used by ./configure.

Related: OS#3385
Change-Id: I42d80dadf28fd54c45b275f2c278225a8e7ea031
2018-12-05 13:10:04 +01:00
Oliver Smith 9d4b5cad09 Fix DISTCHECK_CONFIGURE_FLAGS override
Set AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am instead of
DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from the
automake manual, as otherwise the flag can't be changed by the user
anymore.

Related: OS#3718
Change-Id: I6eb789b34523ed45a3626972f420d409fbab1597
2018-12-04 15:37:37 +01:00
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