aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2016-11-12subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr3-5/+7
Change-Id: Ife8e10b240693a8d369139881774f1892044aa65
2016-11-12move subscr_request to gsm_subscriber.hNeels Hofmeyr2-14/+14
Change-Id: Idbbd39b0e068da17aafa97e315143509c69c50ea
2016-11-12add gsm_encr to subscr_connNeels Hofmeyr1-0/+1
Change-Id: Id5797cd1f1bfa2cca2d3fbabc1981aa75546421b
2016-11-12osmo-nitb becomes osmo-cscnNeels Hofmeyr8-100/+377
Change-Id: I3787050b524954d8a4dd13495c458f3ee293807b
2016-11-12remove unneccessary linking from some testsNeels Hofmeyr3-4/+0
The recent shifts and cuts have made some library linking for bsc, channel and db tests unnecessary.
2016-11-12msc_release_connection(): don't call gsm0808_clear()Neels Hofmeyr1-1/+0
gsm0808_clear() is all about clearing lchans. To be able to link libmsc without libbsc, don't call it directly. Change-Id: I149146fc3cb99ef4a21ee2a798231bb070f398cd
2016-11-12cut off libbsc paging, pending paging in libmscNeels Hofmeyr5-2/+24
Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. In osmo-nitb, paging is done on BSC level and MSC level "at the same time". When the new CSCN is fully operational, paging will be controlled separately on the MSC level, and the BSC (RNC) level will be instructed over an IuCS or A-interface to negotiate paging with the MS (UE). This MSC level paging does not yet exist and will be added in subsequent commits. Change-Id: I8b6920ddc54fc3f2876a59664e6722666d8a8a4a
2016-11-12libmsc: duplicate gsm0808 / gsm48 functions (towards BSC)Neels Hofmeyr4-13/+69
In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment relatd to msc_gsm0808_tx_cipher_mode() in two places. Change-Id: I5b276853d3af71f5e3f0a031fd17b4fff0580020
2016-11-12Use new msc_tx_dtap() instead of gsm0808_submit_dtap()Neels Hofmeyr4-8/+10
Aim: msc_tx_dtap() shall redirect to IuCS or A interfaces depending on subscr conn. Change-Id: I30d961f16eb7b9c0ab9cc3f43198098d3f1a909f
2016-11-12add libiudummy, to avoid linking Iu deps in testsNeels Hofmeyr6-0/+56
Change-Id: I4a66c4122011dbc87c6fcb336ab0461b86522c98
2016-11-12move to libxsc: gsm48_extract_mi(), gsm48_paging_extract_mi() -- TODO move ↵Neels Hofmeyr2-24/+24
to libfilter instead? Change-Id: I00ca0caf8224de029f53f4dedb1146e3cf7650ec
2016-11-12msc_compl_l3(): publish in .h, tweak return valueNeels Hofmeyr2-6/+17
Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c Change-Id: If24007445899e9c75553a0dbf843ada3566b3380
2016-11-12add cscn vty, remove nitb vtyNeels Hofmeyr5-104/+179
Change-Id: I8f8980d6cfbf26f1b0e0197939833e55dbe521fb
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