aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2018-12-11make gsup ipa name configurable in osmo-msc.cfgStefan Sperling3-7/+30
Add a 'ipa-name' VTY command which overrides the default IPA name used by the MSC. This is a prerequisite for inter-MSC handover. Related: OS#3355 Change-Id: I317d6c59f77e92fbb2b875a83dc0ec2fa5cb6006
2018-12-11LU: do not always invoke sub_pres_vlr_fsm_start()Neels Hofmeyr1-1/+6
sub_pres_vlr_fsm_start() starts the FSM, invokes the START event, and then this FSM invariably always directly terminates when vsub->ms_not_reachable_flag == false. So if it is false, there is not much use in instantiating a whole FSM instance that just terminates again, we might as well directly issue the parent-term-event and save some logging space. The same condition is already in place in the vlr_proc_acc_fsm.c in _proc_arq_vlr_node2_post_vlr() for CM Service Request and Paging Response. Now also skip this for LU. Change-Id: Id2303a795dfd381f76e94ff8ff2f495926ca8ba0
2018-12-11detach cancelled subscribers from VLRStefan Sperling1-0/+2
When a subscriber is cancelled, fake an IMSI detach to ensure that the subscriber gets removed from the VLR. I am not entirely sure if this change is correct but it does make TTCN3 test MSC_Tests.TC_gsup_cancel pass. Change-Id: I5918106e4a94ba2e6c61bcd7b90d3bf0565513cc Related: OS#2886
2018-12-10drop gsm48 RR ciph mode compl from permitted initial messagesNeels Hofmeyr1-1/+2
It is a message that is initially permitted, but it is in fact not handled in the L3 code but already before, upon receiving BSS_MAP_MSG_CIPHER_MODE_COMPLETE. Change-Id: I0079f07271ca76bd457d0e700f3a736eb9066b47
2018-12-10move ASS-COMPL MGCP handling out of a_iface_bssap.cNeels Hofmeyr3-86/+78
BSSMAP Assignment Complete: sort MGCP handling upon Assignment Complete to the proper locations. a_iface_bssap.c is not the right place to invoke the MGCP related procedures. - in a_iface_bssap.c only decode the IEs. - call ran_conn_assign_compl() and pass decoded values. - drop msc_assign_compl(), it was dead code; instead: - add ran_conn_assign_compl() - pass on all MGCP related info to msc_mgcp_ass_complete() - move all MGCP ctx related handling from a_iface_bssap.c to msc_mgcp.c. I'm dropping some comments to save some time, because if I adjust them IMHO they would still anyway restate the obvious. ran_conn_assign_compl() is now quite a thin shim, but it makes sense to have it: - This is the place that should tear down the ran_conn in case assignment failed, left for a future patch. - In the light of upcoming inter-MSC handover, ran_conn_assign_compl() will be the place where the Assignment Complete message might be relayed to a remote MSC. Change-Id: I8137215c443239bddf3e69b5715839a365b73b6c
2018-12-07ASS-COMPL: do not fire Sec Mode Compl eventNeels Hofmeyr1-4/+0
BSSMAP Assignment Complete: Do not invoke ran_conn_rx_sec_mode_compl(), that's just weird. Instead this should call msc_assign_compl(), which is currently dead code and does nothing ... and there are some more strings attached, being resolved in a subsequent patch. Change-Id: I448fdb783364628005437b3d866d1a076a9767d7
2018-12-05add VTY commands: mncc internal / external (== -M)Neels Hofmeyr3-2/+41
So far the only way to use external MNCC is to pass the -M cmdline arg: osmo-msc -M /path/to/socket However, the osmo-msc.service file for systemd is installed by 'make install', and hence it is quite impractical to depend on such a config item to be required in the service file: - It defies any scheme an operator may have in place to compose the osmo-msc.cfg file -- this option doesn't go in the .cfg file but needs separate action to add to the installed service file. - After a make install or package upgrades / re-installations, this option will be plain overwritten silently, or lead to the need for resolving file conflicts. The initial spark for this came from configuring the 35c3 GSM from cfg templates. Change-Id: I2ec59d5eba407f83295528b51b93678d446b9cee
2018-12-05vty: mncc cfg: separate the 'mncc' from 'mncc-guard-timeout'Neels Hofmeyr1-4/+14
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-05msc_main: mncc: move mncc socket decision to after read_cfgNeels Hofmeyr1-5/+4
First step towards allowing to configure the MNCC socket path by config file. Rationale: see I2ec59d5eba407f83295528b51b93678d446b9cee Change-Id: Ifc87c1cacaa809d04fc23e8ccd761bee4509c805
2018-12-05cosmetic: msc_main.c: default args definition styleNeels Hofmeyr1-5/+3
Explicitly name each arg with its default value, omit zero values, end last item in comma. Change-Id: I0e0f1e2c8722768b6c61fd6544911b20fe1af212
2018-12-05gsm_subscriber: make function msc_paging_request() staticPhilipp Maier1-1/+1
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-11-30GSM_EXTENSION_LENGTH -> VLR_MSISDN_LENGTHNeels Hofmeyr1-1/+1
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-30move gsm_auth_tuple to vlr.h as vlr_auth_tupleNeels Hofmeyr4-15/+15
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-30cosmetic: drop some unused opaque struct defsNeels Hofmeyr1-1/+0
Change-Id: I4d461dd39d0abdc4f2327445671459340ca1c946
2018-11-30combine several small .h in msc_common.hNeels Hofmeyr15-15/+1
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-30move ran_conn declarations to new ran_conn.hNeels Hofmeyr2-1/+2
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-30move subscr_conn.c to ran_conn.cNeels Hofmeyr2-1/+1
subscr_conn.c exclusively defines ran_conn related things. Rename the file. Change-Id: I6aa6b335842116c717a554c981083a914724ee21
2018-11-30rename some RAN conn related stuff to ran_conn_*Neels Hofmeyr12-77/+74
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-30rename gsm_subscriber_connection to ran_connNeels Hofmeyr23-452/+450
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-30drop msc_compl_l3() return valueNeels Hofmeyr3-44/+9
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-30rename gsm_encr to geran_encr, it is only applicable on GERANNeels Hofmeyr3-7/+7
On UTRAN, Security Mode is used instead of Ciphering Command, which does not feature an A5 algorithm id. Change-Id: Idc7ca9da1aa13ae16f5db2cb1024676cbc770820
2018-11-30populate gsm_subscriber_connection->encr during CiphNeels Hofmeyr2-0/+9
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-30adjust copyright in subscr_conn.cNeels Hofmeyr1-1/+1
Change-Id: Ia89e2d343a850234557e365457705a11d26fd925
2018-11-30cosmetic: subscr_conn_fsm_auth_ciph() should be staticNeels Hofmeyr1-1/+1
Only used in subscr_conn.c. Change-Id: Iaa2c63d2b06f59d34e0465c40a98741f56ec526a
2018-11-30drop unused SUBSCR_CONN_E_INVALIDNeels Hofmeyr1-1/+0
The idea to catch uninitialized vars was completely moot. We pass events by constants anyway. Change-Id: I6f3c964ee04fec9a96f385199fb3141ac8d672d4
2018-11-30libmsc/gsm_04_11.c: fix: always use SAPI 3 for MT SMSVadim Yanitskiy1-2/+3
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-30drop unused gsm_network->handover.activeNeels Hofmeyr1-17/+2
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-30drop unused gsm_subscr_conn->mncc_rtp_bridgeNeels Hofmeyr1-2/+0
Change-Id: I322dc18cfe2cc573744261df837e719b5cf224ba
2018-11-29libmsc/gsm_04_11.c: refactor MT SMS message handlingVadim Yanitskiy4-167/+204
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-29libmsc/transaction: introduce trans_find_by_sm_rp_mr()Ivan Kluchnikov1-0/+22
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-28libmsc/gsm_09_11.c: drop redundant assertion of stored msgbVadim Yanitskiy1-2/+0
It's already asserted at the beginning of handle_paging_event(). Change-Id: Ia558e11c6bde7bff130e4b76a4402ecc8068f1ed
2018-11-27libmsc/transaction.c: cosmetic: fix typoVadim Yanitskiy1-1/+1
Change-Id: I6d72b856e40ba81ee2f1e60693055705b5993b09
2018-11-25libmsc/gsm_04_11.c: refactor RP-DATA header validationVadim Yanitskiy1-20/+18
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-25libmsc/gsm_04_11.c: don't pass msgb to gsm411_rx_rp_{ack|error}Vadim Yanitskiy1-4/+4
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-23osmo_msc: remove unused parameter from msc_dtap()Philipp Maier3-3/+3
The parameter link_id in the function msc_dtap() is unused. Lets remove it. Change-Id: I7ba67b0cb514c91bc87a7b396ed3962b7a68e7da
2018-11-21msc/gsm_04_11.h: use forward-declaration for _gsm411_sms_trans_free()Vadim Yanitskiy1-0/+1
Change-Id: I87f96abd2b2d446751d8f95c9164c5eb6a58e66c
2018-11-21libmsc/db.c: cosmetic: mark missing breaks in switch as intendedVadim Yanitskiy1-0/+2
Change-Id: I3f4f34ecd0c5bb2d1a675ad5c4669fcffb87f292 Closes: Coverity CID#148209
2018-11-20Use libosmocore to function to parse cipher mode reject causeMax1-6/+7
This allow us to handle both regular and extended cause transparently. Change-Id: I7742ac41dd0642a5a40ce79d23250f8d9e6ae556 Related: OS#3187
2018-11-20Use BSSAP-specific TLV parser from libosmocoreMax1-1/+1
Change-Id: Iae1a3ffcebf1b0b95e61cd5dffe7ef734796fcfc
2018-11-19msc: vty: Fix integer printf formattingPau Espin Pedrol1-9/+9
| ../../../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-19Fix build with latest libosmocoreMax1-9/+0
Remove locally defined function which conflicts with the one in libosmocore. Change-Id: I464c16034b76e4599ac42857f60442c3fd000c75
2018-11-19libmsc: Don't send SMS STATUS REPORT locally if the ESME accepted it.Keith Whyte1-1/+1
When using smpp-first, after the ESME accepts our STATUS REPORT, we were sending it locally into gsm340_rx_sms_submit() anyway. In the case of the ESME mirroring the report back to us, this would result in two copies of the status report in the SMS database, which were also both then delivered to the MS. This causes no visible error to the user but is a waste of radio resources. With this patch, we check if it is the sms_report that has had receiver set in sms_route_mt_sms() and not the original SMS we are reporting on, which of course already has receiver set. Change-Id: I3529b89535800eaa1127721d613fa7bbcb8b23be
2018-11-16vlr: drop unused is_ps parameter in vlr_subscr_req_lu()Philipp Maier3-3/+3
the function vlr_subscr_req_lu() has a parameter is_ps, which is set to vsub->vlr->cfg.is_ps by the only caller in vlr_lu_fsm.c. Inside the function one can see that vsub->vlr->cfg.is_ps is used directly to decide between PS or CS LU, we could also use is_ps there. Presumably the parameter is_ps had been abandonned in an early development stage and was not removed, so lets drop the parameter. Change-Id: Id239721773b90099d122b232dae1ba457be9d255
2018-11-13vty: add command to show all known BSCMax1-0/+17
Change-Id: I247fdce00f43072b0a2a0122b80bd40cdd9e0128
2018-11-08cosmetic: remove forgotten debug printfPhilipp Maier1-1/+0
the control interface command subscriber-list-active-v1 contains a stray debug printf, lets remove it. Change-Id: I085cf7b4a45708ccb883f70f71f4fbcfda58d332
2018-11-02Add counters for BSSMAP cipher mode messagesMax1-0/+6
Count COMPLETE and REJECT messages. Besides general troubleshooting that's also useful for TTCN-3 tests to check that OsmoMSC processed those messages as expected. Change-Id: I5822b2b38b64f1a691b26c926a8e2bece21dc624 Related: OS#3187
2018-11-02Properly parse cause in cipher mode rejectMax1-5/+6
Use appropriate TLV routines to get and log the value of rejection cause. Change-Id: I26b3eb0deff6dbd217b23d284bbc6e6a9eebc8e6 Fixes: OS#3187
2018-10-30lu_fsm: result cb: use proper cause type (warning/coverity)Neels Hofmeyr1-2/+2
enum gsm48_gmm_cause is the wrong enum to pass to lu_fsm_failure(). Use enum gsm48_reject_value instead. Change-Id: If661f72056decb28c0ee82ad2449630a24d4f31c
2018-10-24gsm_04_08_cc: Add global guard timer for MNCCPhilipp Maier3-0/+62
The external MNCC handler may hang indefinitely in cases where the remote end of the MNCC ceases to work properly. Add a global guard timer to make sure the call reaches ACTIVE state. Change-Id: I7375d1e17cd746aac4eadfe1e587e82cf1630d3d Related: OS#3599
2018-10-21gsm0407_is_duplicate(): Handle error ret of gsm0407_pdisc_ctr_bin()Harald Welte1-1/+2
Change-Id: If9525694bcbc5c6c0e622e899dd634dc11ed61c4 Fixes: Coverity CID#182702