aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr21-983/+335
Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: 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 Iu specific fields in gsm_subscriber_connection: 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]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). 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 related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. 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. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. 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 add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-08-27vlr: LU FSM: enable Retrieve_IMEISV_If_RequiredNeels Hofmeyr2-41/+51
Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a
2017-08-27vlr: place comments on if (0) casesNeels Hofmeyr2-1/+8
Change-Id: I56c1e61dedeac01a4e24452feee6616782783d8f
2017-08-27SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSNHarald Welte1-10/+20
Change-Id: Ifd9ff4342de342475609bad0257a23c50290e23b
2017-08-27IuPS: explicitly check RAN type; move commentNeels Hofmeyr1-1/+3
Change-Id: I054d72590dfb2012f6f8506d3a5f8fd2953194e1
2017-08-27IuPS: don't require an MM context for Iu ReleaseNeels Hofmeyr1-5/+13
Change-Id: I8b4d08b3ee8add1f1d54efb13985eabe0c9d31f3
2017-08-27SI3: indicate R99+ MSC to GSM MS to enable UMTS AKANeels Hofmeyr1-0/+3
Change-Id: I796e1f4281628061f4522c43c549de9e751bc045
2017-08-27osmo-nitb: change default db name to sms.dbNeels Hofmeyr1-1/+1
libvlr now delegates subscriber management to osmo-hlr, so the database no longer represents a HLR. It basically only stores SMS, so reflect that fact in the default database name. Change-Id: I3289d68d3eb63aff940b48a25b584d5e83cd0197
2017-08-27Use libvlr in libmsc (large refactoring)Harald Welte35-3198/+1633
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
2017-08-27Add libvlr implementationHarald Welte14-1/+4318
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-08-27logging: auth request: use hexdump without spaces for RAND, AUTNNeels Hofmeyr1-2/+2
Change-Id: Ie16bb2c01e770914f411bfb34b523c56ea9fab81
2017-08-27gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr3-5/+16
Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Unrelated cosmetic change while editing the arguments: gsup_client_create()'s definition's oap client config arg name mismatched the one used in the declaration. Use oapc_config in both. Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2
2017-08-27GPRS/IuPS: remove all 3G authentication dev hacksNeels Hofmeyr2-44/+2
UMTS auth works now with the external OsmoHLR. Change-Id: Ie42945bb687b077fd0ee430c2711d19782151610
2017-08-27move openbsc/* to repos rootNeels Hofmeyr182-0/+96560
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
2009-06-10move openbsc into its own subdirectoryHarald Welte37-20105/+0
2009-06-09* add support for storing classmark1/2/3 per subscriberHarald Welte2-7/+149
* add support for parsing measurement results (both BTS and MS side)
2009-06-09don't prefix every line with timestamp, this saves some screen real estateHarald Welte2-7/+22
2009-06-09fix typo CHANNL->CHANNELHarald Welte1-1/+1
2009-06-09some more commentsHarald Welte1-2/+3
2009-06-09db.c: tmsi may be empty so put it into '' to make that obvoius (Andreas ↵Holger Freyther1-3/+3
Eversberg) during attachment, the "tmsi" field of the subscriber may be an empty string, so the string must be quoted in the sql request, or the sql request fails due to incorrect syntax. also i added "extension" field to debug output.
2009-06-09gsm_04_08.c: Kill duplication pointed out by Andreas EversbergHolger Freyther1-22/+18
Introduce the internal gsm0408_authorize that will determine if we allow the user into our network. If allowed a new tmsi will be allocated, the subscr_update will be called, the loc_operation released, and the accept sent. Otherwise just return 0. The code was copied from mm_rx_id_resp.
2009-06-09gsm_04_08.c: Call subscr_update everytime we let someone in (Andreas Eversberg)Holger Freyther1-0/+1
If location update is requested, but subscriber is not yet authorised within mm_rx_loc_upd_req() function, the subscr_update() is not called, because subscriber information is not complete. During mm_rx_id_resp() the subscriber informations is may be complete, so authorize subscriber succeeds and database must be updated.
2009-06-09bsc_hack.c: Fix the -l db option (Andreas Eversberg)Holger Freyther1-1/+1
Add ':' to indicate an argument will follow -l.
2009-06-08Add the isdnsync program which enable layer1 and layer2 on a cardHolger Freyther2-1/+195
this small tool is used to enable layer 1 and 2 on a given isdn card. the card can be used to retrieve clock signal from a network. layer 2 (PTP) is required to keep layer 1 without interruption. this tool works on e1 and s0 cards. to use the clock signal with other cards, interconnection with a clock-slave-card is required. (Andreas Eversberg)
2009-06-06gsm_04_08.c: Some spoofing protection against two location updating requestsHolger Freyther1-0/+11
Do not allow two location updating requests on the same lchan. Such an event is certainly spoofed and can confuse the internal logic of the application. Prevent that.
2009-06-06lchan: Handle the abnormal case of channel getting closedHolger Freyther2-1/+28
The abnormal case is that lchan_free ist getting called due a RSL_MT_CHAN_REL_ACK in the RSL but the refcount of this channel is not zero. This means that some "logical operation" is still going on that needs to be cancelled. Instead of always queuing up all operations in the struct gsm_lchan use the signal framework to inform higher layers about this abnormal case. In gsm_04_08.c a signal handler is installed and in the abnormal case the location updating request operation is freed.
2009-06-06Revert "[db] Keep track of the current gsm_network"Holger Freyther2-4/+2
This was a stupid decision. We will have to assign the network at some other place. The problem will be a problem when we have two gsm_networks in one process and the same subscriber is traveling in both networks.
2009-06-05fix CONN FAIL and IPAC_DISCONNECT_IND log printingHarald Welte1-3/+2
2009-06-05print reject cause of MM STATUS messageHarald Welte1-1/+10
2009-06-05missing newline in log message about measurement resultHarald Welte1-0/+2
2009-06-05fix printing of measurement resultsHarald Welte1-1/+0
2009-06-05BS11: add nm_state for EnveBTES, PA and BBSIG physical objectsHarald Welte1-0/+21
2009-06-04[subscr] Remove the struct gsm_bts pointer from subscriberHolger Freyther1-6/+2
The pointer was initially added to support to open a lchan by using the gsm_subscriber structure. We would have restored the struct gsm_bts from the db when loading the subscriber. Instead we will dynamically resolve the gsm_bts and might end up paging multiple bts in the same (stored/old) location area until it answers.
2009-06-04[debug] Move subscr_get_by_tmsi below the debug statement (Andreas Eversberg)Holger Freyther1-1/+2
subscr_get_by_tmsi might log as well and then the order of debugging it not as clear as it could be.
2009-06-02[misc] Search for the crypt symbol to conditionally enable crypt in VTYHolger Freyther1-2/+2
It will define -DVTY_CRYPT_PW= if crypt is found. If -lcrypt is needed, $(LIB_CRYPT) will be -lcrypt. Compiles on OS X and Linux and reenables crypt. Patch by: Lars Immisch
2009-06-02[l2] Do not always release the layer2 when closing the socket (Andreas ↵Holger Freyther1-3/+2
Eversberg) Tells mISDN not to release layer 2 on closing socket, when not requested. If mISDN was told to release layer 2 once, it will continue to release layer 2 on every shutdown of OpenBSC.
2009-06-02[e1] Correctly initialize the e1link (Andreas Eversberg)Holger Freyther1-8/+24
During bootstrap of BS11, the e1links are initialized. This must also be done when BS11 is already bootstrapped (when restarting OpenBSC). It is required to correctly multiplex the audio traffic between channels. Without it, all time slots refer to card 0, slot 0, subslot 0, which causes crashes when handling TRAU frames..
2009-06-02[debug] Change DEBUGPC statements to contain \n (Andreas Eversberg)Holger Freyther2-12/+14
Some debug outputs now correctly use end-of-line characters.
2009-06-02[rsl] Change logging of handling reason 0x18 in rsl_rx_conn_fail (Andreas ↵Holger Freyther1-3/+5
Eversberg) Release the channel when it is not used, otherwise claim it is still in use...
2009-06-02[subcriber] Fix the subscriber use counting in gsm_04_08.c (Andreas Eversberg)Holger Freyther1-2/+8
This patch will fix subscriber usage countinig. It may happen, that the subscriber count will not be 0 after releasing of a call. (This problem is solved with the application patch (27), which will replace static call transaction by a dynamic transaction list, and use subscriber for each transaction created.)
2009-06-02[subscriber] Log changes in the usage of a subscriber (Andreas Eversberg)Holger Freyther1-1/+7
Log changes of the use count of a gsm_subscriber.
2009-06-02[subscriber] Update the lac entry in subscr_update (by Andreas Eversberg)Holger Freyther1-1/+7
This is coming from patch 16 and is one of the two changes. When invoking subscr_update update the lac entry as well.
2009-06-02debug: Fix the definition on DMM (Andreas Eversberg)Holger Freyther1-1/+1
Now MM can be specified on the command line with the debug option.
2009-05-28* give Siemens ObjClass reasonable names rather than A3/A5/A6Harald Welte3-17/+70
* add nm_state objects for RACK and CCLK * add obj_class human-readable printing for all vendor obj_classes * add human-readable printing of administrative state * add enum for cell_alloc numbers
2009-05-23some more comments on the abis attributesHarald Welte1-3/+5
2009-05-23make sure even our predefined structures use HARDCODED_BSIC as initial valueHarald Welte1-2/+2
2009-05-23show and edit subscribers from the vty interfaceHarald Welte2-0/+122
2009-05-23mark two functions as static, fix typo in vty messageHarald Welte1-3/+3
2009-05-23Add user-configurable BSIC settingHarald Welte3-2/+26
2009-05-23* replace some more hex bytes in init msgs by #definesHarald Welte1-10/+14
* when using patch_tables(), use the ARFCN of the BTS, not the cmdline argument