Commit Graph

5594 Commits

Author SHA1 Message Date
Max 93408ae727 SGSN: add vty config for choosing GPRS encryption
Change-Id: I07d65205be1c75d59744426629ed04cf3cd99f79
Related: OS#1582
2016-07-04 08:42:07 +00:00
Max 896c6f8e9e SGSN: force GSUP CN domain to PS
Always set CN domain in outgoing GSUP packets to PS to make it
compatible with osmo-auc.

Change-Id: Ia6ee2e55a41a8ea9e465d7df1b2b3559b553fca8
Related: OS#1582
2016-07-01 15:24:44 +02:00
Max 488902db2a Fix vty tests with subscriber deletion
Use correct vty command for subscriber deletion, adjust assertions
accordingly. The error was cause by inconsistent syntax of vty commands
for subscriber creation and deletion.

Change-Id: I9b9376b4ac0ec066000545167de312ca4460493b
2016-06-29 16:45:14 +00:00
Neels Hofmeyr dd49beebb1 err log: tweak dyn pdch ack error logging
Rather use gsm_lchan_name().

Change-Id: I0334484eaa6a2c0f25925042c9c3c1a4e3e78ca4
2016-06-24 09:31:54 +00:00
Neels Hofmeyr 3f2212235c dyn PDCH: cosmetic: clarify lchan rel with assertion and comment
Change-Id: If3cc40022e8283daa991fffe4b6baa734303d8a5
2016-06-24 09:31:17 +00:00
Neels Hofmeyr b0cc64274a debug log: log all lchan state transitions
Change-Id: Ic70aca65b3796c90ba1a88ea67ac7a2ad9190b69
2016-06-23 20:57:44 +00:00
Neels Hofmeyr efedf80526 vty: show lchan summary: also show lchan->state
Change-Id: If7ae92b8d501b51bbe8a165c223734e169a8bb97
2016-06-23 20:01:25 +00:00
Neels Hofmeyr 82c8f75f71 dyn PDCH: enable PDCH only after release due to error
In rsl_rx_rf_chan_rel_ack(), only activate PDCH when in NONE state.

For the case of REL_ERR state, do the PDCH activation in the error timeout
callback after T3111 is done.

Change-Id: I4c55479b252a12039bb3d8c30a9cbf0199ca410e
2016-06-21 21:33:28 +02:00
Neels Hofmeyr 241bda03b4 typo in sgsn_test
(committing just to test gerrit, if it goes through it's still a valid change)

Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8
2016-06-20 18:26:15 +02:00
Neels Hofmeyr 29048b2a80 rm dup: use channel type names from libosmocore
In gsm_lchant_name(enum gsm_chan_t), use the gsm_chan_t_names value strings
from libosmocore instead of redefining the same strings. The list from
libosmocore is also more complete, including CCCH and PDTCH.

Add a todo comment to move to libosmocore.

In consequence, libosmogsm linkage needs to be added to osmo-bsc_mgcp,
mgcp_test, mgcp_transcoding_test and smpp_mirror, smpp_test.

Change-Id: If65ee7c0619cbc0acb0a15045bd5a969442c93cc
2016-06-18 11:34:21 +00:00
Neels Hofmeyr f8e02aa4e3 configure: require libgsm for --enable-mgcp-transcoding
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-17 15:33:22 +00:00
Neels Hofmeyr 349108801f bsc_version.c: update copyright date, add contributor
Change-Id: Ib3f6763448457915d7473ec5039ab406fd4bdb48
2016-06-17 04:52:30 +02:00
Neels Hofmeyr 832afa3f4b dyn PDCH: set lchan->state after PDCH DEACT / before PDCH ACT
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-16 04:29:40 +02:00
Neels Hofmeyr 285df2ec62 dyn PDCH: add lchan sanity checks in PDCH DE/ACT ACK
Change-Id: I0456cfb88860823c37c14688673e9cbc8d0085d8
2016-06-16 04:29:40 +02:00
Neels Hofmeyr 3201988f7b dyn PDCH: track pending PDCH de-/activation
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-16 04:29:40 +02:00
Neels Hofmeyr c1fbdedcd3 dyn PDCH: fix: clear PDCH flags on TS reconnect (e.g. BTS re-connect)
Change-Id: I89a0ef1794f343fdd06a62237f5732e73f4d2704
2016-06-16 04:29:40 +02:00
Neels Hofmeyr 2ebacce4fa dyn PDCH: TS flags: rename one, add three, as enum
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-16 04:26:33 +02:00
Max 0fcd2e2fec Make random extension range configurable
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-14 22:20:40 +00:00
Max e152ffe14d Fix SIGABRT on wrong AMR payload
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-14 10:20:05 +00:00
Neels Hofmeyr b8afb5fda2 dyn PDCH: send PDCH ACT for each TCH/F_PDCH on TS Enable
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-14 10:18:19 +00:00
Andreas Eversberg 9df268e217 dyn PDCH: Automatically deactivate/activate PDCH on TCH/F+PDCH channel
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-14 10:18:19 +00:00
Daniel Willmann 3adb23cfc5 add DSUA debug constant
Change-Id: I4a3a8189564345700ea4825983ab39a8411227f4
2016-06-13 09:18:51 +00:00
Neels Hofmeyr a66852525a dyn PDCH: allow allocating TCH/F on TCH/F_PDCH slots
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-12 15:48:38 +00:00
Andreas Eversberg 0434efa077 dyn PDCH: Fix free slot search for chan_alloc_reverse == true
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-12 15:48:38 +00:00
Max ec744655b4 Add talkspurt indicator for gsm_lchan
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-12 15:43:50 +00:00
Max f5fe31d513 DTX: add data necessary for scheduling
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-10 14:09:07 +02:00
Max ae3f0718f1 Add DTXd indicator to gsm_lchan
It is necessary for proper reporting of DTXd status during the
measurement period.

Change-Id: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c
Related: OS#1701
2016-06-10 11:34:41 +00:00
Daniel Willmann 35a65edd10 add DRANAP debug constant
Change-Id: I6132198ea86979e0ed84df32f2b7117feba497f2
2016-06-10 10:46:48 +00:00
Neels Hofmeyr f5713a5c63 lchan_alloc(): on alloc failure, report original type
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-07 11:10:40 +00:00
Max 6079528b48 Add warning for unsupported DTX configurations
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-06 11:36:48 +02:00
Neels Hofmeyr 9329e6fb49 gprs_gmm.c: don't transmit NOTEXIST when mmctx is NULL
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-05 23:36:28 +00:00
Daniel Willmann 3af9660e51 configure.ac: add --enable-iu with deps asn1c, ranap, sigtran
For upcoming 3G support.

Change-Id: I6209423d71f94d5cd0ca9daf065d0a9df521ef02
2016-06-05 23:13:01 +00:00
Neels Hofmeyr 9f5d231f00 debug log: cosmetic fixes
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-05 23:02:09 +00:00
Neels Hofmeyr 3e62d415ac comment tweak for bsc_handover_start()
Have a comment only in the .c file to remove dup, tweak wording, use doxygen
style.

Change-Id: If054dad877a1ca750cd72be9c9d90bcf087bf741
2016-06-05 23:01:25 +00:00
Max ddee01fa8f Add regexp authorization policy for IMSI
* 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-05 09:36:37 +00:00
Max d7df7ae392 Store last used FN for TCH
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-03 13:03:52 +02:00
Daniel Willmann f9f4387686 gprs: more conditionals for Gb specific actions
Change-Id: I213d21b9ddbf19e56269defcc6aa65aca4947140
2016-06-02 03:01:06 +02:00
Daniel Willmann 7ec8ca422c sgsn_mm_ctx_cleanup_free(): clean up LLME iff present (Gb, not Iu)
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-02 03:01:04 +02:00
Harald Welte 2b2429eb59 gprs_gmm.c: Perform LLME operations only if we have one
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-02 03:01:02 +02:00
Harald Welte dbc72b37ee gprs_gmm.c: Make TLLI handling specific to Gb interface
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-02 03:00:59 +02:00
Neels Hofmeyr e98ba82d2b gprs_gmm.c: Don't try to de-reference NULL mmctx
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-02 03:00:55 +02:00
Harald Welte 49393e128e rename gsm0408_gprs_rcvmsg() to gsm0408_gprs_rcvmsg_gb()
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-02 03:00:53 +02:00
Daniel Willmann 62ff38447c create_pdp_conf(): factor out PDP context accept dispatch as send_act_pdp_cont_acc()
Change-Id: Ibf60e18707ff4aa2e60291e5595386ddda8d8190
2016-06-01 12:09:51 +00:00
Harald Welte f97ee04563 prepare sgsn_mm_ctx for Gb and Iu mode (UMTS)
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-01 12:09:36 +00:00
Daniel Willmann 97165f386f rename enum gprs_mm_state to gprs_gmm_state
Change-Id: Ibba054d15c55c7ac570e64ff66ea57964be095e3
2016-06-01 11:07:21 +00:00
Harald Welte e1197481e5 Merge "rename enum gprs_mm_state to gprs_gmm_state" 2016-06-01 10:46:41 +00:00
Harald Welte a9ca72d907 Merge "add .gitreview" 2016-06-01 06:29:42 +00:00
Alexander Couzens 85f8fdabc3 gprs: use new uint8_t * for kv in gprs_cipher_run()
libosmocore changed in bf990bb8 Update internal GPRS cipher API
from uint_64 to uint8_t*.
Fix a warning.

Change-Id: Ib5bfe1fb05c693347b11ff4faadd3fc2205ebd76
2016-05-31 17:47:52 +02:00
Alexander Couzens 51fbc5f6e0 add .gitreview
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-31 17:43:46 +02:00
Daniel Willmann 0f46f9ca5a rename enum gprs_mm_state to gprs_gmm_state
Change-Id: Ibba054d15c55c7ac570e64ff66ea57964be095e3
2016-05-31 13:53:15 +02:00