aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-06-17dyn PDCH: add do_pdch_defrag() in new pdch_defrag.[hc]Andreas Eversberg4-2/+166
Will be used in the subsequent commit. Original patch by jolly (1c8a3d828612a6bea343a268072a7dddf4a22480), with extensive review and changes by nhofmeyr: * remove code dup: common find_lchan() replaces find_shared_forward() and find_shared_reverse() and simplifies invocation. * use LOGTSP() instead of debug_bts_trx_ts(), tweak debug logging (missing \n, in-code line breaking). * reword comment for do_pdch_defrag(). * remove code dup: calculate move direction by maths instead of 4 conditionals, and have only a single debug log for "does not lower fragmentation". * add two FIXME comments. Change-Id: Idcaf7ac40cbaf83593946cfe24a6a18a6a688fd5 Patch-by: Andreas Eversberg <jolly@eversberg.eu> Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-06-17dyn PDCH: Add new_lchan argument to bsc_handover_start()Andreas Eversberg4-10/+15
This is useful if the caller already allocated a new lchan, which will be used to dynamically re-assign lchans. The old behavior is maintained by passing NULL. Change-Id: I2b7151f32f0c04c22f294eb5dd3c7d7dfddf35e7
2016-06-17add DHODEC debug category, tweak DHO nameAndreas Eversberg2-1/+9
Change-Id: If19caca84327ac0267a7e1f0efc84a614b154486
2016-06-17configure: require libgsm for --enable-mgcp-transcodingNeels Hofmeyr1-1/+1
Fail in configure if libgsm is not found. Before this, the --enable-mgcp-transcoding would gladly accept that libgsm is missing and the build would fail later because of missing linking and undefined references. Change-Id: Ic23157cc5b75694f400a176c31f97d71e861ea02
2016-06-17bsc_version.c: update copyright date, add contributorNeels Hofmeyr1-3/+3
Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48
2016-06-16dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACTNeels Hofmeyr2-23/+12
Do the PDCH DE/ACT before we set the lchan->state to De-/Activation Requested. It makes more sense semantically to change PDCH mode while the lchan is still in NONE status. Thus slightly move some invocations: PDCH ACT: Free the lchan before PDCH activation. Hence remove the lchan_free() call from the rsl_rx_pdch_act_ack() code path; it used to do the PDCH activation first and call lchan_free() in the callback. PDCH DEACT: Set the (TCH) Activation Requested state only within rsl_chan_activate_lchan(), after the PDCH deact is complete. Channel allocator: don't pick channels that have a PDCH PENDING flag set, to avoid using channels that are still in PDCH switchover (despite their state being NONE). The lchan_may_change_pdch() sanity checks are becoming a lot simpler. Change-Id: I4206dd4808e21c3e59393ea7f5ab4f438afff066
2016-06-16dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACKNeels Hofmeyr1-0/+54
Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8
2016-06-16dyn PDCH: track pending PDCH de-/activationNeels Hofmeyr1-2/+18
Set and clear pending flags on the TS according to PDCH de-/activation. This will allow changing the time we set the channel state to after PDCH DEACT and before PDCH ACT, in a subsequent commit. Also add a sanity check on whether we're sending conflicting or superfluous PDCH de-/activations on the same TS. Change-Id: Ieae73271df749ded3d90585116aae01f3ad4ee74
2016-06-16dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect)Neels Hofmeyr1-0/+2
Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704
2016-06-16dyn PDCH: TS flags: rename one, add three, as enumNeels Hofmeyr3-5/+12
Rename TS_F_PDCH_MODE to TS_F_PDCH_ACTIVE, to more accurately reflect the truth value's meaning. Add TS_F_PDCH_ACT_PENDING and TS_F_PDCH_DEACT_PENDING for sysmoBTS (and possibly other BTS implementations) to remember what to do when the PCU replies with a channel de/activation. Also add TS_F_PDCH_PENDING_MASK to test for both. Change from #define to an enum. Note: These flags are also used in the upcoming osmo-bts-sysmo dyn PDCH commits, so osmo-bts submission depends on this commit. Change-Id: I391a103ab599648b0c5d4f3ad613a6d7c48834b3
2016-06-14Make random extension range configurableMax11-16/+78
Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658
2016-06-14Fix SIGABRT on wrong AMR payloadMax1-1/+3
Previously length check have not considered AMR format which requires extra byte for in-band length leading to SIGABRT on incorrect payload from BTS. Change-Id: I800f756fc803accace8c7e0b4a42b3744fe78bb6 Fixes: OS#1731
2016-06-14dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS EnableNeels Hofmeyr5-4/+50
Add dyn_pdch_init() in new file bsc_dyn_pdch.c (new file to avoid linking issues; bsc_init.c would create undefined references, and putting in a new file is the easiest solution). Call dyn_pdch_init() from nm_statechg_event() whenever a TS is enabled. Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will now be set after dyn_pdch_init() sent out the PDCH ACT and when subsequently the PDCH ACT ACK messages are received in rsl_rx_pdch_act_ack(). Change-Id: I0cad93dec59d546b3f3b19e332e0833496031575
2016-06-14dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channelAndreas Eversberg3-3/+45
Handle shared TCH/F+PDCH channels as regular TCH/F channels. Prior to activation, deactivate PDCH mode. After deactivation, restore PDCH mode. Change-Id: I59712b8769cc3959ef114a6e12e77801816fe8b6
2016-06-13add DSUA debug constantDaniel Willmann3-0/+11
Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4
2016-06-12dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slotsNeels Hofmeyr1-9/+29
Remove check for dyn PDCH in _lc_find_trx(), instead call _lc_find_trx() via _lc_find_bts() several times, so that pure TCH/F is preferred to TCH/F_PDCH. Add this logic next to the other channel match decisions in chan_alloc(). BTW, the removed check in _lc_find_trx() whether PDCH is active is not necessary, as described in the added comment for lchan_alloc(). Original patch idea by jolly, but split in two and implemented differently by nhofmeyr. Change-Id: I0c728b922656be03588b775638b610a93f8187d5
2016-06-12dyn PDCH: Fix free slot search for chan_alloc_reverse == trueAndreas Eversberg1-2/+14
For chan_alloc_reverse, _lc_find_trx() should return the last free slot instead of the first. Original patch by jolly, but split in two by nhofmeyr. Change-Id: Iff980242b9b5cb39345aaad0350ee368537677cd
2016-06-12Add talkspurt indicator for gsm_lchanMax1-1/+2
Add bit which can be set on BTS side to indicate that next RTP frame should be marked as a beginning of speech. Change-Id: I355a5ae275a2743b29071924c916c4f68c3b3e80 Related: OS#1562
2016-06-10DTX: add data necessary for schedulingMax1-0/+5
DTXd: to schedule SID repetition we have to know when previous SID was sent (fn) and if it was UPDATE or FIRST SID (is_update). DTXu: to properly set Marker bit in outgoing RTP we have to know the beginning of talkspurt. For codecs without explicit ONSET event we can do it by setting the flag (ul_sid) upon receiving SID and unsetting it on speech frames. Change-Id: I79cbec3b6c6fed5de385f8e202ceaf0b13234778 Related: OS#22, OS#1701
2016-06-10Add DTXd indicator to gsm_lchanMax1-0/+2
It is necessary for proper reporting of DTXd status during the measurement period. Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c Related: OS#1701
2016-06-10add DRANAP debug constantDaniel Willmann3-0/+11
Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2
2016-06-07lchan_alloc(): on alloc failure, report original typeNeels Hofmeyr1-4/+8
In lchan_alloc(), there are several decisions to fall back to another type of channel, followed by setting the channel type to the fall back type. So far, this was set regardless of allocation success or failure. If such fall back type is not available, do not modify the local type variable and thus report an S_CHALLOC_ALLOC_FAIL on the type originally requested (report is at the end of lchan_alloc()). Change-Id: Ie3d4cb74f91db0b8c4f5e595a963099de339ad1a
2016-06-06Add warning for unsupported DTX configurationsMax1-2/+6
libosmo-abis do not consider DTX bits while processing TRAU frames. As I do not have equipment to test it, I'm not sure if/how non-IP BTS will work in case of DTX - warn users about it. Change-Id: I94ee69cd309fc343a428ddc66942cd57f2a34c05 Related: OS#22
2016-06-05gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULLNeels Hofmeyr1-1/+4
Add missing mmctx NULL check in gsm0408_rcv_gmm(). gsm48_tx_gmm_status() would dereference mmctx without checking, so we can't call it if mmctx == NULL. Follows up on recent e98ba82d2b07c835: "gprs_gmm.c: Don't try to de-reference NULL mmctx". Change-Id: If59efbde86c76ffe91a0b33be87273783a2a4a02
2016-06-05configure.ac: add --enable-iu with deps asn1c, ranap, sigtranDaniel Willmann1-0/+12
For upcoming 3G support. Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02
2016-06-05debug log: cosmetic fixesNeels Hofmeyr1-2/+2
Drop erroneous C from a DEBUGPC, should be on a new line. Drop underscores from IPAC_PDCH_[DE]ACT: all other log messages for IPAC PDCH are without underscores -- git grep "P(.*IPAC.PDCH.*ACT" Change-Id: I8fb7a1c1beabb1f4388517383fd0bdc082d557ca
2016-06-05comment tweak for bsc_handover_start()Neels Hofmeyr2-6/+3
Have a comment only in the .c file to remove dup, tweak wording, use doxygen style. Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741
2016-06-05Add regexp authorization policy for IMSIMax6-10/+88
* extend "auth policy" vty command with new option "regexp" * add vty command "authorized-regexp" for setting arbitrary POSIX regular expression * add basic vty test * add optional "regexp" argument to subscriber-create-on-demand vty command With those in place we can now set the regexp against which MS's IMSI will be matched. If IMSI match the regexp than MS is allowed to access the network. If subscriber is already marked as authorized in HLR than it'll be allowed regardless of IMSI matching. The same way we can decide whether to create subscribers on-demand basesd on IMSI regexp match. Similar to authorization this restriction can be overridden by manually creating subscriber via vty, ctrl interface or directly in HLR. Change-Id: I525f4b80676de47d1d422686da2ca012301b0129 Fixes: OS#1647
2016-06-03Store last used FN for TCHMax1-0/+1
It's necessary to properly compute timestamp compensation for RTP packets in case of DTX (or heavy packet loss). Related: OS#22 Change-Id: Ib42c6a8614a4b73333a83181488dd4069cac14d7
2016-06-02gprs: more conditionals for Gb specific actionsDaniel Willmann3-8/+14
Change-Id: I213d21b9ddbf19e56269defcc6aa65aca4947140
2016-06-02sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu)Daniel Willmann1-3/+10
Assert that llme is unused for non-Gb (Iu) connections, and clean up otherwise. Make sure the cleanup is left below the sgsn_mm_ctx_free() call, as the comment states. Change-Id: I891ae21afc1f4f60580b822273b5435e0e17d46f
2016-06-02gprs_gmm.c: Perform LLME operations only if we have oneHarald Welte1-5/+7
In case the GMM message did not arrive over a Gb interface, there is no LLME (and thus the associated pointer is NULL). Don't try to perform operations on a NULL LLME. Change-Id: If7f24161cd2826f8ee238d4bc1090adf555cea4e
2016-06-02gprs_gmm.c: Make TLLI handling specific to Gb interfaceHarald Welte1-36/+60
Soem of the operations we perform in the GMM layer are specific to the GPRS/EDGE radio access network and its Gb interface. Let's make them conditional to that in preparation of supporting an Iu interface. Change-Id: I3efb7c5087afe8e2331ec17bd9fac5029f4bee6c
2016-06-02gprs_gmm.c: Don't try to de-reference NULL mmctxNeels Hofmeyr1-0/+32
There was a comment in the code that certain GMM messages require a valid mmctx pointer. However, nothing actually checked if that pointer was in fact non-NULL. We plainly crashed if a MS would send us the wrong message in the wrong state. Original patch by Harald Welte, but it broke message validity checking, resulting in sgsn_test failure. This re-implements the NULL check in a different way, as explained by in-code comment. Change-Id: I7908de65bec91599f7042549b832cbbd7ae5a9a8
2016-06-02rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb()Harald Welte4-5/+5
This is the entry point for GMM from Gb. We will create a new one for Iu, so let's be explicit rather than implicit. Change-Id: I93c074bf99db041117c0dc03dc8255879845a875
2016-06-01create_pdp_conf(): factor out PDP context accept dispatch as ↵Daniel Willmann1-9/+14
send_act_pdp_cont_acc() Change-Id: Ibf60e18707ff4aa2e60291e5595386ddda8d8190
2016-06-01prepare sgsn_mm_ctx for Gb and Iu mode (UMTS)Harald Welte8-86/+135
Explicitly mark those sgsn_mm_ctx members that apply for Gb mode and (upcoming) Iu mode, respectively. Add some comments in sgsn_mm_ctx. Change-Id: Ife9b02549f284e2547f16117cf43d7a36948fc4b Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-06-01rename enum gprs_mm_state to gprs_gmm_stateDaniel Willmann0-0/+0
Change-Id: Ibba054d15c55c7ac570e64ff66ea57964be095e3
2016-06-01Merge "rename enum gprs_mm_state to gprs_gmm_state"Harald Welte1-2/+2
2016-06-01Merge "add .gitreview"Harald Welte1-0/+3
2016-05-31gprs: use new uint8_t * for kv in gprs_cipher_run()Alexander Couzens1-2/+2
libosmocore changed in bf990bb8 Update internal GPRS cipher API from uint_64 to uint8_t*. Fix a warning. Change-Id: Ib5bfe1fb05c693347b11ff4faadd3fc2205ebd76
2016-05-31add .gitreviewAlexander Couzens1-0/+3
A .gitreview file is required to use git review. More information about git review https://www.mediawiki.org/wiki/Gerrit/git-review Change-Id: Ie7cdf16232181d4b8093e61f2d8a3faed9010d4f
2016-05-31rename enum gprs_mm_state to gprs_gmm_stateDaniel Willmann1-2/+2
Change-Id: Ibba054d15c55c7ac570e64ff66ea57964be095e3
2016-05-31Make si2q scheduling optionalMax3-19/+40
Previously si2quater SI messages were always scheduled. Check for neighbor configuration and only schedule si2q when necessary. Add corresponding unit test. Change-Id: Ibe997803ffb894133fd4d838410fe735791d414f Fixes: OS#1727 Reviewed-on: https://gerrit.osmocom.org/81 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-30bsc: Create minimal SI6 rest octetsHolger Hans Peter Freyther3-1/+43
In GSM R99 SI6 has mandatory SI6 rest octets and so far we did not include them. Add minimal support to generate the right band indicator. Target a slightly older version of the SI6 rest octets as we neither support MBMS nor Random bit stream but should include the band indicator. Change-Id: I417a40eb91f42a3416b4e07bb9fb4d7a01aaa36b Fixes: OS#1698 Related: OS#1725 Reviewed-on: https://gerrit.osmocom.org/71 Tested-by: Jenkins Builder Reviewed-by: Max <msuraev@sysmocom.de> Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-27tweak db debug log: log TMSI as hexNeels Hofmeyr1-1/+1
Change-Id: I4564c99c145a35fb592c228c1fa84c61ec425fd3 Reviewed-on: https://gerrit.osmocom.org/94 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-05-25filter/nat: Fix the context for the imsi assignmentHolger Hans Peter Freyther2-1/+4
In c09f8a3b7fb94ccef41e33c32bfe2bff1ffe0e44 as part of a cleanup I accidently changed the talloc context from "con" to "bsc". The issue occurred at an earlier commit when assigning req.ctx to the "wrong" context. The allocation needs to be scoped by the struct nat_sccp_connection and not the connection from BSC to NAT. Before we have a nat_sccp_connection we scope the copied imsi to the bsc_connection and then steal it, but for the identity resp we will always have a nat_sccp_connection and can already use the right context. Change-Id: I53789aad2809e19338ad3b2deb72c4757e7bd524 Related: OS#1733 Reviewed-on: https://gerrit.osmocom.org/102 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org> Reviewed-by: daniel <dwillmann@sysmocom.de> Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25debian: Make upgrading from debian SID easierHolger Hans Peter Freyther1-1/+7
Make sure the version number of this sourcepackage is higher than the one found in Debian SID. Change-Id: I838632e9e90378a03235c2aebd5bc9ed06627ec8 Reviewed-on: https://gerrit.osmocom.org/113 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-25rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frameHarald Welte1-1/+1
In AMR 12.2 (mode 7), the actual RTP payload is 33 bytes. Howeerver, as we store the length of the (dynamically-sized) AMR payload in the first byte, our buffer needs at least 33+1 byte in size. Change-Id: If1ad5d2d68c85733306c75ea62f67fe8fbc143b3 Reviewed-on: https://gerrit.osmocom.org/91 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-23gsm04_08_clear_request(): release loc with arg release=0Neels Hofmeyr1-1/+1
In gsm04_08_clear_request(), in_release == 1 anyway and msc_release_connection() would exit immediately without any effect. Don't confuse the reader by passing release=1 arg. Change-Id: I5bf9eb4889d32ad5e42ac7d096bf62fa3a493e20 Reviewed-on: https://gerrit.osmocom.org/93 Reviewed-by: Holger Freyther <holger@freyther.de> Tested-by: Jenkins Builder