aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2017-03-16temporary dev: set debug log level almost everywheresysmocom/iuneels/iuNeels Hofmeyr1-17/+17
Change-Id: I0d5a36560e7edde27497de57e579f5b1d00eb525
2017-03-16log protocol discriminators and message types by nameNeels Hofmeyr11-907/+923
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df Change-Id: If1c49faf6e1757cb16b383dd2db87b48bc94eee6
2017-03-16mgcp: hack RAB success from nano3G: patch first RTP payloadNeels Hofmeyr2-0/+8
The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: I31a4475f42d59fd5704d52ee6e473e270db6d779
2017-03-16Implement IuCS (large refactoring and addition)Neels Hofmeyr93-2048/+4762
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw mgcp: hack RAB success from nano3G: patch first RTP payload The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Change-Id: Ie13ff348117e892d41b8355ab6c24915301eaeaf
2017-03-16mscsplit: various preparations to separate MSC from BSCHarald Welte28-266/+446
Disable large parts of the code that depend on BSC presence. 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. 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 MSC 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. 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() Change-Id: I9cf80f9c2c8a53a29e42f000029e680a9922cb41
2017-03-16IuPS adjustmentsHarald Welte5-23/+46
SGSN: Don't indicate GERAN in Iu mode PDP CTX ACT REQ to GGSN sgsn_ranap_iu_event: handle some events without valid MM context sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_config IuPS: cosmetic: explicitly check RAN type; move comment Change-Id: I8375ba42dd47d7ccd9ce9290767d6f8653a23b94
2017-03-16SI3: indicate R99+ MSC to GSM MS to enable UMTS AKANeels Hofmeyr1-0/+3
Change-Id: Iaf11218327f139e8cabfbc5f9916505c66eadbd8
2017-03-16Add msc_vlr test suite for MSC+VLR end-to-end testsNeels Hofmeyr34-2/+15304
Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
2017-03-16Use libvlr in libmsc (large refactoring)Harald Welte66-3827/+2142
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 development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. 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. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
2017-03-16Add libvlr implementationHarald Welte17-0/+5440
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 development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. Related: OS#1592 Change-Id: I3f75de5f0cc2ff77f276fd39832dd3621309c4b9
2017-03-16logging: auth request: use hexdump without spaces for RAND, AUTNNeels Hofmeyr1-2/+2
Change-Id: I656d8619a1adc93e2f627f4e1ba21512a7374279
2017-03-16gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr4-7/+21
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: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
2017-03-16GPRS/IuPS: remove all 3G authentication dev hacksNeels Hofmeyr2-44/+2
UMTS auth works now with the external OsmoHLR. Change-Id: I1204f388cf1311ec98b3eaf7505d7e18e73f03d0
2017-03-16LU counters: count completion and failure, not messages sentNeels Hofmeyr3-20/+38
From a human admin viewpoint it doesn't make sense to count the messages sent: When we use TMSIs, we first send a LU Accept with a new TMSI, and then expect the MS to respond with a TMSI Realloc Complete message. When that fails to come through, the LU actually ends in failure, even though a LU Accept was sent. If a conn breaks/vanishes during LU, we cancel the LU without sending any reply at all, so the failed LU would not be counted. Instead, count Location Updating results, i.e. completion and failures. (With the new VLR developments, LU counters need to be triggered in completely different places, and this patch prepares for that by providing sensible counters.) Change-Id: I03f14c6a2f7ec5e1d3ba401e32082476fc7b0cc6
2017-03-15oap tests: fix after SQN scheme changes from libosmocoreNeels Hofmeyr1-1/+1
In change-id Iadf43f21e0605e9e85f7e8026c40985f7ceff1a3, libosmocore changes from incrementing SQN after tuple generation to incrementing SQN before tuple generation. Thus we now need to pass desired_sqn - 1 to get the same tuples. Change-Id: Ifeda71e713bb60dcd31ac651f461b714cfa39b5c Related: OS#1968 OS#1969
2017-03-15OM2000: Change the order of MO initializationHarald Welte1-22/+24
So far: CF-IS-CON-TF Now: CF-TF-CON-IS Change-Id: I8efd9bafdcf9504d2e5fc85c44c708fa53f4dff8
2017-03-15gprs: fix T3186 encoding in Sysinfo 13Philipp Maier1-1/+7
The timer T3186, which is described in 3GPP TS 44.060, is using 3 bits of the si13 mac block. This requires special encoding. In the case of T3186, the value is encoded by the formula: bits = t/500-1. Our implementation uses the formula bits=t/500, which is incorrect. Change-Id: Ifd340c536cff2d1c4b1b3677a358ea95438801eb
2017-03-15examples: remove logging level * everythingMax2-7/+7
Option "logging level ... everything" is broken for quite some time and might be deprecated in future. Replace it with "logging level ... debug" in config examples. Change-Id: I828ef7671b4fb38717526a18ff8e9a5428cd511e Related: OS#71
2017-03-15cosmetic: Add commandline option to display versionPhilipp Maier1-1/+6
The -V option to display the Version and the copyright info is missing. Change-Id: I0c848fd42c13f473807caf3478d32c6ce5e43e31
2017-03-15libbsc: add chreq type for CHREQ_T_PDCH_ONE_PHASE & CHREQ_T_PDCH_TWO_PHASEAlexander Couzens3-3/+16
When using a BSC located PCU the BSC must understand PDCH requests. Change-Id: Ie7f4ed000cf1b40d269873cf0ddf5ff9f5bbc18a
2017-03-14cosmetic: add copyright header to bsc_control.pyPhilipp Maier1-0/+21
bsc_control.py lacks a copyright header. This commit adds the copyright header from ipa.py to bsc_control.py. Change-Id: Ie70bf686ee9bb157198e02bf8d946abf56adc82a
2017-03-14gprs_sgsn.c: initialize ptmsi with 0xdeadbeefAlexander Couzens1-1/+1
Fix uninitialized memory access warning. "Conditional jump or move depends on uninitialised value" Found by valgrind. Change-Id: Ibc2d585c5db899e6af20104211e32faf3822633a
2017-03-14python tests: vty and smpp: speed up >10 timesNeels Hofmeyr2-2/+0
osmo-python-tests now includes code that retries connecting the VTY socket and needs no external sleep()ing. This flies through most tests without any sleep() at all. See osmo-python-tests.git change-id Icc337f52a93d5fe31fc4ff235ccaf4e0fe75fa39 Change-Id: I42161d9716fe5bb0ef1c56e4bfb770bb99bbca7a
2017-03-13unixsocket: start sabm for UNIXSOCKETAlexander Couzens1-2/+4
openbsc only starts sabm messages for a subset of line drivers. Add unixsocket to those subset. Change-Id: If98c037119142cc33b46ab5c1bf02d4cda81c81e
2017-03-13OM2000: Add FIXME comments for missing resolving of RX/TX MO!Harald Welte1-0/+2
Change-Id: I45708df724c5fc3316eca6bd2ac2c0738b19a45b
2017-03-08add struct bsc_subscr, separating libbsc from gsm_subscriberNeels Hofmeyr30-115/+615
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC subscriber: struct bsc_subscr. Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no longer have a backpointer to gsm_network (used to be via subscr->group). Create a separate logging filter for the new BSC subscriber. The implementation of adjusting the filter context is added in libbsc to not introduce bsc_subscr_get/_put() dependencies to libcommon. During Paging Response, fetch a bsc_subscr from the mobile identity, like we do for the gsm_subscriber. It looks like a duplication now, but will make sense for the VLR as well as for future MSC split patches. Naming: it was requested to not name the new struct bsc_sub, because 'sub' is too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast to type, relatively short, unambiguous, and the naming is consistent. Add bsc_subscr unit test. Related: OS#1592, OS#1594 Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-03-07Add MS time. offset to gsm_lchanMax1-0/+6
Add MS TIMING OFFSET (3GPP TS 48.058 § 8.4.8) and P offset (3GPP TS 45.010 § 1.2) which can be used to compute MS TO from known TA. This will be used by osmo-bts (see I4dfe5c48834a083e757d5de3236a02e15a238b28) to provide MS TO as part of RSL MEASUREMENT RESULT. Change-Id: I8bda57c8d6c15bbb803eca708931556dae118a00 Related: OS#1574
2017-03-05vty tests: close msc socket after nat_msc_testNeels Hofmeyr1-23/+27
Change-Id: Ib64cf8690627803e1b4a8497ea63f1e766960478
2017-03-05sgsn: fix problem with leading-zero-IMSIsPhilipp Maier1-2/+11
When the IMSI ACL is maintained via the VTY, users may enter IMSIs without leading zeros. Especially in test environments, where MCC=001 and MNC=01 is common, it is likely that someone enters the corresponding IMSI (001010000000001) without the two zeros at the beginning. This patch fixes the problem by sanitizing the IMSI, eventually missing zeros in the beginning will be automatically added. Change-Id: I56ba0da61978bbdce71d0e320166c52b20b42517
2017-03-02vty tests: allow picking specific tests to run by nameNeels Hofmeyr1-0/+5
Depends: osmo-python-tests change-id I92f90c334169f31920c63dd5c5ac8dac215065e6 Change-Id: I849455e0423e1a63d6890aef7f9c6075ad53a920
2017-03-02Fix potential segfault in sgsn_libgtp.cMax1-3/+5
* print pdp->address instead of mm->imsi if mm is NULL * print mm->imsi in debug log (move it below NULL check) Change-Id: I4fbf5a54019a46612fbc528d61120182738f9205
2017-03-02subscriber conn: add indicator for originating RANNeels Hofmeyr3-1/+10
Add via_ran to gsm_subscriber_connection to indicate whether a conn is coming in via 2G/GERAN/A-Interface or 3G/UTRAN/Iu-Interface. Prepares for Iu, but also for libvlr to decide between GSM or UMTS Auth. Until actual Iu support is merged to master, this indicator will aid VLR unit testing. At some point we may also add RAN_GERAN_IU; it's not on the agenda yet, but to clearly distinguish the names if we want to add it, explicitly name the ones we have RAN_GERAN_A and RAN_UTRAN_IU. Change-Id: I93b870522f725170e4265a5543f6b680383d7465
2017-03-02fix: gprs_gmm, gprs_llc_vty: two unterminated value_string arraysNeels Hofmeyr2-0/+2
Change-Id: Icc4163ac4f962fe88bbebeb3310a557ba0834e84
2017-03-01meas_json: fix NEIGH: missing array bracesKeith1-1/+2
Make NEIGH an array of Javascript objects, otherwise the JSON is not parseable when neighbours exist Change-Id: I42029f40bf357adbb2f3c71cdcbafbc21090e348
2017-02-28libmsc/update_db_revision_3(): free memleaking db resultAlexander Couzens1-0/+2
Found by ASAN Change-Id: I2680c60e26b9876b428d4b75323f884f9ecd95b3
2017-02-28silent_call: remove unfinished fuzzer interfacePhilipp Maier3-0/+9
Remove the fuzzer interface that was partially implemented in gsm_04_08.c and silent_call.c is causing problems when an SMS is sent during an active silent call. The reason for this is that gsm0408_dispatch() in gsm_04_08.c would decide to rout all uplink traffic to silent_call_rx() in silent_call.c. silent_call_rx() is a stub function that discards the data. This patch removes the fuzzer interface code by placing ifdefs around it, so that it can be re-activated by experimentators. Change-Id: Id500197d58663b3f4b1756136343670388b0a4bc
2017-02-28ctrl_test_runner: speed up more than 10 fold by sleeping lessNeels Hofmeyr1-3/+13
Similar to a recent patch in osmo-python-tests for VTY based tests, but this is for the Ctrl tests. The TestCtrlBase tests gave a constant sleep(2) grace period for the process to startup. This causes tests to take minutes for no reason at all. Add code to TestCtrlBase to try and connect right away, retrying up to three seconds in .1 second intervals. This flies through most tests without any sleep() at all. Change-Id: I06569767153838bd9cd3edac001df5f6c567874c
2017-02-28vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problemsNeels Hofmeyr1-0/+1
When running the testBSCreload test in close succession, I get a "Connection refused" error because the socket is still in TIME_WAIT state. Passing the SO_REUSEADDR flag allows reusing the addr despite a TIME_WAIT socket. Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
2017-02-27XID: resend xid with pdp-ctx-ack messagesPhilipp Maier1-1/+15
If a pdp context is created a xid request is sent right after the pdp-context-ack message. The sending of the pdp-context-ack and the xid message is triggered from the GGSN via the GTP interface. When the pdp-context-ack message is not received by the MS, it will send the pdp-context-request again. A lost pdp-context-ack is resent by the SGSN directly so that the mechanism described above does not work for pdp-context-ack resents. This commit adds code to trigger the sending of xid messages also for resent pdp-context-ack messages. Change-Id: Ice66790803154310a61a70a54be76cec539c97a7
2017-02-27SGSN VTY: make missing GSUP server address+port fatalNeels Hofmeyr2-12/+10
On 'auth-policy remote', the SGSN requires GSUP server address and port. If it was missing, the SGSN would print a VTY warning and run anyway. Make this error more fatal: print an error (flattened a bit) to stderr and abort the program. Move validation of the GSUP server data presence out of the VTY command itself and into the config reading function. This way the GSUP server config can be given anywhere, including below the auth-policy config (was required above). Don't care about setting the auth-policy to remote with a telnet VTY, because in that case the GSUP client won't be started anyway. Change-Id: I4d8db910c32abd8579d3c9b9f0b2cb3a9a6dfe4c
2017-02-27SGSN: Integrate support for UMTS AKANeels Hofmeyr5-30/+205
The general infrastructure for UMTS AKA is already in place: * GSUP with capability to send us auth_vectors that contain either triplets or quintuples * mm_context that holds such auth_vectors Add: * capability to send UMTS AUTN in GMM AUTH REQ * parse extended UMTS RES * on auth response, validate expected AKA with vector and received res/sres * add Auth Failure message to receive resync AUTS token and * send to HLR * clear out-of-sync auth tuple * enter new state for when we're waiting for HLR to resync and send new tuples so that the next Auth Request will be handled Original first half of this patch by: Harald Welte <laforge@gnumonks.org> Full UMTS AKA procedure including AUTS resync tested to work against OsmoHLR with R99 USIM and Milenage algorithm. The sgsn_test.c needs adjustment because we're checking the vector's auth_types now. Depends: libosmocore change-ids I277fb3d407396dffa5c07a9c5454d87a415d393f If943731a78089f0aac3d55245de80596d01314a4 Related: OS#1956 Change-Id: Ie6a0cefba5e4e7f02cc2eaf6ec006ac07d5c1816
2017-02-25smpp_test_runner.py: fix socket leakNeels Hofmeyr1-0/+2
Each running test would open up another socket without ever closing unused ones. Close the sockets after each test is done. Change-Id: I0a42caab3bb8c9c9d04b033e4de9efe0ca8fd2af
2017-02-25python tests: remove process 'Launch' message, now at osmoutilNeels Hofmeyr3-3/+0
Change-Id: Id8eb70ddfdc1d0d9f90aa5343a4ea522042c34ee
2017-02-25vty_rest_runner.py: remove debug monitoring for TCP socketsNeels Hofmeyr1-22/+0
Change-Id: I7361bb0ce5302d00ccb18dc04eeb75ee1f6844a8
2017-02-25utils: 'meas_json' utility to convert measurement feed into a JSON feed.Alexander Chemeris2-0/+206
Change-Id: I56631969384da245eed8ffc14845c76a5d4de8d4
2017-02-25add struct gprs_subscr, separating gprs from gsm_subscriberNeels Hofmeyr13-151/+269
Prepare for replacing gsm_subscriber with vlr_subscriber. vlr_subscriber will not make sense to be used in gprs, so have a dedicated GPRS subscriber struct. (Could change if the gprs code were to use libvlr; is currently independent). Related: OS#1592 Change-Id: Ia8b391ee009c8545763cba04505be3947835120e
2017-02-24cosmetic: rename struct osmo_msc_data to bsc_msc_dataNeels Hofmeyr14-107/+107
With the OsmoMSC program coming up, the name osmo_msc_data becomes even more confusing than it already is. Clearly indicate it as libbsc's data of a remote MSC by prefixing with bsc_. Also, the Osmocom community has in the meantime agreed to have the osmo_ prefix only in libosmocore, to avoid naming conflicts in case things are moved there. So while renaming anyway, also drop the osmo_ prefix. Change-Id: I0dfbcb7d1a579211180f71319982820d8700afab
2017-02-24cosmetic: rename osmo_msc_data.h to bsc_msc_data.hNeels Hofmeyr19-18/+18
With the OsmoMSC program coming up, the name osmo_msc_data becomes even more confusing than it already is. Clearly indicate it as libbsc's data of a remote MSC by prefixing with bsc_. Also, the Osmocom community has in the meantime agreed to have the osmo_ prefix only in libosmocore, to avoid naming conflicts in case things are moved there. So while renaming anyway, also drop the osmo_ prefix. Change-Id: I13554563ce9289de126ba0d4cf329bafcda35607
2017-02-24cosmetic: clarify BSC's remote MSC data vs. OsmoMSCNeels Hofmeyr1-0/+6
Change-Id: I74dd2b3f935d39b8caa718e2c8a51cc81bddf1b9
2017-02-24cosmetic: gsm_data.h, README: rename CSCN to MSCNeels Hofmeyr2-2/+2
We're discarding the name OsmoCSCN for the benefit of OsmoMSC. But "CSCN" has already crept into the master branch in two places; apply the rename. See OS#1958 Change-Id: Ib4274eb3c172ada1fe7f05746740b456370bc93d