aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-11-12add iucs.[hc]Neels Hofmeyr4-0/+182
Change-Id: I88e981f4c31393a98ae8d61176c65c9251a6f28b
2016-11-12add DIUCS debug log constantNeels Hofmeyr2-0/+6
Change-Id: Id347a3024fa495a1ab680db7320648d933a4018b
2016-11-12gsm0408_loc_upd_rej(): remove bts use (used only for debug log)Neels Hofmeyr1-5/+3
Change-Id: I3ac38f4b701ad8308470573260fa91a4b04c2f18
2016-11-12gsm_04_08, gsm_subscriber: decouple lac from btsNeels Hofmeyr3-11/+10
The idea is to not have a direct pointer to a bts struct (into BSC land), but a LAC to resolve the BSC or RNC depending on the appropriate A or IuCS interface. subscr_update(): remove bts arg, add lac arg. Pass conn->lac to gsm48_generate_lai() instead of bts->location_area_code. Change-Id: I9f2b298a785bf4b2a1b3fcdd91b8256106b2d9de
2016-11-12subscr_update_expire_lu(): remove bts argNeels Hofmeyr3-5/+5
Change-Id: I26cafd9389aac65e53dc4280a1687c6b8bce3106
2016-11-12move t3212 to network level (periodic lu)Neels Hofmeyr5-11/+15
Set the T3212 default value in struct gsm_network and take that value when creating a BTS. Adjust VTY accordingly. Change-Id: Ifb730f9d0106fe195adc30459a39290a07313b50
2016-11-12libmsc: iucs dev: disable large parts of the codeNeels Hofmeyr5-1/+91
Change-Id: I3ef6ca26150b6102a0fa22a88a60d9a442d640b4
2016-11-12Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication.Neels Hofmeyr6-0/+149
Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add via_iface marker to gsm_subscriber_connection with enum values IFACE_A and IFACE_IU so far. Add Iu specific fields in a sub-struct: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). Change-Id: Idf8020a30562426e8f939706bf5c2188d5a09798
2016-11-12don't use lchan in libmscNeels Hofmeyr3-14/+12
Change-Id: Ic7ed7faa2bcc7aae799f41ed4abc2c001bfb61b7
2016-11-12gsm_04_08.c: Don't set msg->lchan nor msg->dstHarald Welte1-34/+0
the BSC-side of the API behind gsm0808_submit_dtap() is doing this resolving again anyway. So let's avoid doing it twice, and avoid having more dependency of the MSC down into the lchan details. Conflicts: openbsc/src/libmsc/gsm_04_08.c Change-Id: I14254be68ee1a48e9f1ce968233414d86c6ba9d5
2016-11-12gsm_subscriber_connection: mark BSC specific itemsNeels Hofmeyr1-6/+6
The struct shall be split in two later. Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7
2016-11-12osmo-nitb: exit when MNCC socket init failedNeels Hofmeyr1-3/+7
Change-Id: Icef97bb5da9840b810fe6f4b4da6abd4baa66915
2016-11-12split subscr_con_allocate()/_free() in bsc_ and msc_Neels Hofmeyr7-13/+42
Rename current subscr_con_allocate() and subscr_con_free to bsc_*, and add two separate msc_subscr_con_allocate() and _free(). The msc_subscr_con_free() ignores all lchan members. In libbsc use bsc_*, in libmsc use msc_*. Change-Id: I3cf7c7cafdf4672ec7b26058bba8a77159855257 Future: there will be distinct subscr conns for libbsc and libmsc.
2016-11-12move to libxsc: net timezone VTY configNeels Hofmeyr2-64/+64
Leave the timezone VTY output in libbsc's config_write_net(), until the BSC/MSC separation of struct gsm_network is completed. Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20
2016-11-12Move timezone settings up to network levelNeels Hofmeyr9-99/+98
Time zone used to be configurable per-BTS. In the upcoming MSC-split, no BTS structures will be available on the MSC level. To simplify, drop the ability to manage several time zones in a core network and place the time zone config on the network VTY level, i.e. in gsm_network. If we are going to re-add fine grained time zone settings, it should probably be tied to the LAC. Adjust time zone VTY config code (to be moved to libxsc in subsequent commit). Adjust time zone Ctrl Interface code. Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8
2016-11-12reinvent connection_for_subscr() and move to libmscNeels Hofmeyr3-35/+14
Implement connection_for_subscr() from a completely different angle: instead of looking up lchans in bts structs, look up the subscriber in the global list of gsm_subscriber_connection. static lchan_find() is thus obsoleted. All callers of connection_for_subscr() live in libmsc, so move to libmsc. The move and edit are done in a single commit since the old and new implementation have nothing in common. Future: osmo-cscn will use this, without bts being present. Remove implementation of connection_for_subscr() from channel_test.c -- it is possible that the abort() in there was intended for a regression test, but actually it seems the implementation was merely added for linking reasons, and the abort() added to guard against the NULL return value: no comment nor the commit log indicate that the abort() is test critical; the addition was the only change in channel_test.c for that commit; at the same time a connection_for_subscr() call was added in libmsc. Change-Id: I5e0ba0ecf1726ebd540800f4e98fdfc937c904ff
2016-11-12bsc vty: rename show_net_cmd to bsc_show_net_cmdNeels Hofmeyr1-2/+2
Future: there will be an MSC-land show-net-cmd, so rename to something with bsc in its name. Change-Id: Ifb86698cd57a09f03b935b6d3fcea87eff4cd397
2016-11-12move to libxsc: network VTY that isn't BSC-specificNeels Hofmeyr3-194/+211
Keep only BSC specific bits of the 'network' VTY node in bsc_vty.c, move more general VTY commands to xsc_vty.c. Add arg to xsc_vty_init() to pass a config_write_net() function. Pass a libbsc specific config_write_net() function. Future: upcoming omso-cscn will re-use the VTY bits moved to libxsc and pass a different config_write_net() function. Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71
2016-11-12move to libxsc: global vty gsm_network pointerNeels Hofmeyr3-17/+32
Move gsmnet_from_vty() and the bsc_gsmnet global to xsc_vty.c. Rename bsc_gsmnet to vty_global_gsm_network and make it static to xsc_vty.c, to clearly mark the global variable for VTY use only. Introduce xsc_vty_init() to set vty_global_gsm_network. Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6
2016-11-12global gsm_network: move allocation further upNeels Hofmeyr2-23/+25
Now that bsc_network_alloc() is separate, move it to before the VTY init (a subsequent patch will pass the gsm_network instance as a parameter to vty_init()). bsc_hack.c: drop the comment that says about the VTY init: "This needs to precede handle_options()" -- it is not accurate. Actually move the handle_options() above both vty_init() and the bsc_network_alloc() calls, to be able to decide which mncc callback to pass to bsc_network_alloc. It would make sense to set this later on, but that would require further refactoring of the bsc_network_init() and gsm_network_init() signatures, so not in this patch. Change-Id: Ie6a7037e703b5a2d08ceeb20d35f197aaddc9d1b
2016-11-12split bsc_bootstrap_network() in alloc and configNeels Hofmeyr4-13/+33
For patch clarity, keep some code dup to be removed in a subsequent patch. In the same sense don't change the fact that mncc_sock_init()'s return value is ignored. The global gsm_network instance 'bsc_gsmnet' is basically only used by the VTY, and a future patch will "hide" that global in a vty .c file. In a nutshell, I want to - first allocate a gsm_network, - then initialize the VTY passing the gsm_network pointer, - and then read the config file using the initialized VTY. So far, bsc_bootstrap_network() allocates the gsm_network and reads the config file right away, which only works by sharing the extern bsc_gsmnet pointer, which I would like to uncouple. Change-Id: I480a09a31a79766ad07b627dd5238b7e37f3be7a
2016-11-12tests: drop unused libmsc, unneeded duplicate libbsc linkingNeels Hofmeyr3-5/+0
Because of libxsc, tests/gsm0408,subscr,trau no longer need libmsc. Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18
2016-11-12sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counterNeels Hofmeyr6-43/+20
libbsc and libmsc will have separate subscriber connection structs. Hence don't rely on gsm_subscriber_connection, but work on a direct pointer to the counter for the next RP reference. The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop the entire file. Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072
2016-11-12factor out & introduce struct gsm_encr, in xsc.hNeels Hofmeyr2-6/+11
Factor out encryption info from struct gsm_lchan as struct gsm_encr, placed in xsc.h. Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Future: this will be used by libmsc's subscriber connection, for osmo-cscn.
2016-11-12move to libxsc: factor out gen of USSD notify and release completeNeels Hofmeyr11-39/+105
Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() functions, since there will be distinct subscriber connection structs. The current functions live in libmsc, so add the same in libbsc in new file gsm_04_80_utils.c. To avoid too much code dup, move the message generation part of gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() to new functions gsm0480_gen_ussdNotify() and gsm0480_gen_releaseComplete(), placed in libxsc. Change-Id: I33a84e3c28576ced91d2ea24103123431f551173
2016-11-12move to libxsc: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej()Neels Hofmeyr3-34/+34
Used by libbsc, libmsc as well as osmo-bsc and osmo-bsc_nat. Moving gsm48_create* to libxsc affects linking of osmo-bsc_nat, resulting in undefined references to gsm48_extract_mi() and gsm48_paging_extract_mi(); fix that by placing libfilter.a left of libbsc.a upon linker invocation. Change-Id: I212c2567b56191022b683674c1c4daf842839946
2016-11-12move to libxsc: net init 3: actual moveNeels Hofmeyr15-35/+84
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libxsc to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libxsc. The other items are kept out of libxsc because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-12move to libxsc: net init 2: move bsc_network_init decl to osmo_bsc.hNeels Hofmeyr6-7/+9
bsc_network_init() is more fit to live in a BSC specific header. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-12move to libxsc: net init 1: rename to bsc_network_initNeels Hofmeyr7-8/+10
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libxsc, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-12define mncc_recv_cb_t to avoid code dupNeels Hofmeyr5-7/+13
Put mncc_recv_cb_t in xsc.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include xsc.h (future knowledge). Since I will need to use mncc_recv_cb_t in xsc.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in xsc.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c
2016-11-12Add empty libxscNeels Hofmeyr7-0/+62
This will gradually soak up code shared by libbsc and libmsc. Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae
2016-11-11bs11_config: remove compiler waring about unused variableHarald Welte1-2/+2
bs11_config.c:78:22: warning: ‘too_fast’ defined but not used [-Wunused-const-variable=] static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; ^~~~~~~~ Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b
2016-11-11talloc_cxt: Fix compiler warning / missing #includeHarald Welte1-0/+1
talloc_ctx.c: In function ‘talloc_ctx_init’: talloc_ctx.c:40:2: warning: implicit declaration of function ‘msgb_talloc_ctx_init’ [-Wimplicit-function-declaration] msgb_talloc_ctx_init(ctx_root, 0); ^~~~~~~~~~~~~~~~~~~~ Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896
2016-11-10OM2000: disallow ip.access style TCH/F_PDCH pchan typeNeels Hofmeyr1-0/+9
For TCH/F_PDCH, return an invalid chan comb (0) and print an error message that hints at the proper pchan type to use instead: TCH/F_TCH/H_PDCH Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d
2016-11-10OM2000: for TS conf of dyn TS, always send TCH/F chan combNeels Hofmeyr1-5/+1
When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as pchan2comb(TCH/F). In the past, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This is a mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as pchan2comb(TCH/F) because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1
2016-11-10fix use after free in bsc_config_freeNeels Hofmeyr1-1/+1
talloc_free the cfg only after asserting num_bsc count sanity. This caused a failure in the 'bsc-nat' test with -fsanitize build. Should fix the Osmocom_Sanitizer build on jenkins.osmocom.org https://jenkins.osmocom.org/jenkins/job/Osmocom_Sanitizer/ Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6
2016-11-09OM2000: Throw error when MO can not be enabledPhilipp1-0/+10
Throw warning message in case the MO state does not change to enabled after sendeing an Enable-Request message. Change-Id: Idfde8d6f71526e8acfea51835732515a4bee858e
2016-11-09om2000: added support for ericssons sabm negotiationPhilipp1-0/+3
This patch adds support for ericssons sambm negotiation. This patch depends on libosmo-abis commit: 2788c7eacab91cd39d68e316fc8ee87763bbfeb4 Change-Id: I56b1c1cef07a61143fc0e8058480805cddfeff96
2016-11-09OM2000: Add fault report parsingPhilipp1-1/+129
This patch adds parsing for OM2000 MO fault report map parsing, the bits in the fault maps are counted out and displayed. Change-Id: I6e2928f39b09bc08e9ab78bc10bc81e07f7eb55d
2016-11-09RBS2000: re-establish any lost signalling linksHarald Welte1-0/+12
Contrary to standard A-bis, in the RBS2000 case the BSC connects the signalling data links (LAPD) to the BTS. In case one of them drop, we need to attempt to re-establish them. This requires libosmo-abis with Change-Id I07f0f79e0cda09766f357032ffb4e7ad643d448a Change-Id: I710b5af5d0acbdd3febd314849340f2adb7abd80
2016-11-09om2000: Add support for querying RBS capabilitiesroot3-0/+28
Change-Id: Id1fbaf41286f3651ce8f210eb8da05fb51179c96
2016-11-09lchan: Release channel in case of late activation ackHolger Hans Peter Freyther1-3/+28
In case of the sysmoBTS and receiving a channel activation ack on a channel that was marked as broken, release it again. Use a normal release without SACCH deactivation and release the rqd_ta data. Also add a local variable 'ts' to shorten some lines. The typical situation where this would occur is with high latency between BTS and BSC (or NITB). If a channel activation ack does not arrive in time, a channel is marked broken, and never recovers after that. This patch will release the channel again, which will remove the BROKEN_UNUSABLE state and makes lchan available again. Reported by Rhizomatica. However, in case of packet loss, i.e. when the channel activation ack never arrives at the BSC, this patch does not provide a resolution of the BROKEN_UNUSABLE state. On dynamic timeslots: clearing the dyn ts state could possibly happen in lchan_free() instead of in rsl_rx_chan_act_ack(). That's to be done in a separate patch, if at all. Tweaked-By: nhofmeyr Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed
2016-11-09SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTPHarald Welte1-1/+14
The GTP protocol specification requires us to include the MSISDN IE in all non-secondary PDP context activations. However, when no real HLR is used (e.g. via GSUP), we do not have the MSISDN information available and so far simply sent a zero-length MSISDN IE in GTP. The latter is a violation of the spec. So to resolve this, we now send a 15-digit all-zero dummy MSISDN IE, as described in TS 23.003. Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d
2016-11-09OM2000: Fix state machien for CF/TRXC on START ResultHarald Welte1-1/+1
When receiving the 'Start Result' message, for CF and TRXC MO we directly transition to performing the Operational Info. In that case, we need to return after sending the Operational Info and skip the usual processing for the default case below. Change-Id: I99860d198b337ffe461b240bda20dc10e1b5b2cb
2016-11-08WIP: OM2000: Full state machine implementation using osmo_fsmHarald Welte4-286/+1132
Our existing OM2000 code for initializing all Managed Objects of a BTS at startup was never complete. Rather than trying to fix the old-style code, introudce a hierarchy of osmo_fsm's reflecting the full protocol hand-shake and sequence of bringing up the individual MO's. If this works out well, it mihgt make sense to convert the TS 12.21 OML code for other BTS models, too. Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c
2016-11-03bsc_vty: include dyn TS info in vty show lchanNeels Hofmeyr1-3/+53
Extend both 'show lchan <bts> <trx> <lchan>' and 'show lchan summary' to include information on dynamic timeslots. Have one common function that prints " as foo" or " switching foo -> bar" to the vty, use it in lchan_dump_full_vty() and lchan_dump_short_vty(). In lchan_dump_short_vty(), split the vty_out call in two in order to interleave the dyn ts info right after the pchan. The summary hence looks e.g. like this for osmocom style dyn ts: BTS 0, TRX 0, Timeslot 5 TCH/F_TCH/H_PDCH as PDCH, Lchan 0, Type NONE, State ACTIVE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm or BTS 0, TRX 0, Timeslot 4 TCH/F_TCH/H_PDCH switching NONE -> PDCH, Lchan 0, Type NONE, State BROKEN UNUSABLE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda
2016-11-02log: count_codecs(): drop logging of non-TCH lchan typesNeels Hofmeyr1-3/+0
count_codecs() is called on every chan act ack, also for channels other than TCH/F and TCH/H. So this logging happens a lot during normal operation but adds no real information. Also, RSL would be the wrong logging category for this -- RSL is about the RSL communications, not whether our internal code tries to count lchan codecs for the wrong channel types. Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a
2016-11-02mncc_builtin: Properly reject DTMFlynxis/masterHarald Welte1-0/+2
As per TS 23.014, a GSM MSC must implement mobile-originated DTMF generation. We gate the DTMF signalling messages to MNCC, and expect the external MNCC handler to deal with it. However, the internal MNCC handler simply ignored such singalling messages, rather than rejecting DTMF altogether. It turns out failure to respond to START DTMF will cause some phones to behave in interesting ways, particularly with modem firmware v6.01.00, see https://osmocom.org/issues/1817). In this case the phone is not able to release the call as the pending response to the START DTMF is probably keping a reference or lock of some sort. Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac
2016-11-01Cosmetic: Add missing switch to usage helpPhilipp1-0/+1
Adds the -p --pcap option to the help text. Change-Id: I3e763c30ca13bc51c8b72af8a94558c92439f109
2016-11-01gsm0408: Adding log output for 3g specific RR messagesPhilipp2-7/+11
GSM 04.18, which is the successor of GSM 04.08, describes additional RR 3g specific message types. This commit adds log output for those messages. The behaviour is not changed all affected message types are still forwared to the MSC as they were before. See also 3GPP TS 04.18, section 10.4, table 10.4.1 The change requires to update libosmocore as well, see also commit f48fdb3a108da0dc23d7af4ac021e98e11f07152 in libosmocore.git for details. Change-Id: I41f2242fdf59c3eb4b3f8f7f003c17f7e0df01aa