Commit Graph

24 Commits

Author SHA1 Message Date
Alexander Chemeris 84402c0c82 sgsn: Fix lengths of MS Network Capability and MS Radio Access Capability elements.
Original code was inconsistent about lengths and could lead to out
of bounds write. Lengths were also inconsistent with the TS 24.008.

Fixes: Coverity CID 1040714.
2013-07-04 18:34:49 +02:00
Holger Hans Peter Freyther 26d0fe3c89 gprs_sgsn.h: Include timer.h for the timer struct 2012-01-06 18:52:05 +01:00
Harald Welte 4b2ed35b8f GPRS: Fix buffer overflow in case of very long MS RA CAP IE
The MS Radio Access Capability IE can be _very_ long in some recent
high-end mobile phones, way beyond the old 14-byte limit.  We increase
our array to 52 bytes, and make sure not to overflow that buffer.
2011-07-27 23:35:38 +02:00
Pablo Neira Ayuso bf540cb7c3 src: use namespace prefix osmo_timer* for timer functions
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-06 12:11:06 +02:00
Pablo Neira Ayuso 136f453dd2 src: use new library libosmogsm and new path to headers in libosmocore
libosmogsm is a new library that is distributed in the libosmocore.
Now, openbsc depends on it. This patch gets openbsc with this
change.

This patch also rewrites all include path to the new
osmocom/[gsm|core]

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:17:56 +01:00
Harald Welte c728eeaf9b SGSN: Avoid duplicate MM contexts in case MS and SGSN disagree on P-TMSI 2010-12-26 19:20:07 +01:00
Harald Welte a9b473a3c2 SGSN: Implement network-initiated PDP CTX DEACT when GGSN restarts
If the GGSN restarts, its restart counter will increase.  We can
detect that and accordingly release/delete all PDP contexts for
that GGSN.
2010-12-26 19:20:03 +01:00
Harald Welte 496aee463f [SGSN] Call libosmocore helper to load cipher plugins 2010-07-02 22:54:55 +02:00
Harald Welte efbdee9a5c [GPSR] SGSN: Keep traffic counters for each PDP context 2010-06-10 15:12:38 +02:00
Harald Welte 96df60637a [GPRS] add comments to SGSN header file 2010-06-03 06:38:09 +02:00
Harald Welte 807a5d8264 [GPRS] Major LLC / TLLI handling fixes
* separate the LLME and LLE state in the LLC layer
* introduce gprs_llgmm_assign() function for LLGMM-ASSIGN.req primitive
* change QoS profile to match 'real' SGSN
* Update the new TLLI when assigning a P-TMSI

The result now is that the LLC layer is notified of TLLI changes, which in turn
means it doesn't allocate a new LLE structure every TLLI change, which again
in turn means that the UI frame sequence number does not reset to zero.

As a result, MS should no longer ignore frames based on wrong UI sequence number.
2010-06-01 11:57:13 +02:00
Harald Welte c2e8cc4a10 [GPRS] Implement TMSI reallocation and timers 3350 + 3370
Our state transitions and timers now reflect 04.08 for GMM much
better than before.  Also, we allocate a new P-TMSI on every ATTACH
and RA UPDATE, as some phones seem to get confused if they don't
get a P-TMSI.
2010-05-31 20:23:38 +02:00
Harald Welte cd4dd4d7ff [GPRS] fix numerous compiler warnings 2010-05-18 17:20:49 +02:00
Harald Welte 6463c0799c [GPRS] SGSN: TMSI allocation 2010-05-18 17:04:55 +02:00
Harald Welte 77289c202f [GPRS] SGSN: properly delete a PDP context after receiving PDP CTX DEACT REQ 2010-05-18 14:32:29 +02:00
Harald Welte 8acd88f369 [GPRS] SGSN: Include rate counters in MM Context 2010-05-18 10:57:45 +02:00
Harald Welte 6abf94e420 [GPRS] Properly connect GPRS SM with LIBGTP for PDP context activation
* store LLC SAPI as part of PDP ctx
* store NSEI + BVCI as part of MM ctx
* export gsm48_tx_gsm_act_pdp_acc() and call it from sgsn_libgtp.c
* create and use gsm48_tx_gsm_act_pdp_rej for error cases
* print SAPI as part of VTY show pdp
2010-05-18 10:35:06 +02:00
Harald Welte d193cb327a [GPRS] More work on a real SGSN 2010-05-17 22:58:03 +02:00
Harald Welte 8fc1a46f28 [SGSN] remove the mmctx->sgsn pointer
We never want to support multiple sgsn's within one process, so
there is no point in passing them around all the time.
2010-05-17 00:53:10 +02:00
Harald Welte 2720e7310d [GPRS] Initial untested support for libgtp
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1
protocol of the interface between SGSN and GGSN.

This commit includes code for the main libgtp integration (file
descriptor, select loop, timer) as well as code to encode/send
a CREATE PDP CONTEXT request.
2010-05-17 00:44:57 +02:00
Harald Welte ba850c529e [gprs] cosmetic updates in header file 2010-05-04 07:20:44 +02:00
Harald Welte eaa614cb9e [gprs] Use stdint.h types (uintXX_t instead of u_intXX_t)
libosmocore already uses them, it's time (at least for new code)
in openbsc to do the same.
2010-05-04 07:20:43 +02:00
Harald Welte f533e13c14 [gprs] add some Iu specific SGSN MM state fields 2010-05-04 07:20:42 +02:00
Harald Welte 9b455bf801 Create new 'gprs-sgsn' branch on top of 'gprs-conf'
This branch contains the partial SGSN/GGSN implementation that
was originally developed as part of the gprs branch.
2010-05-04 07:20:41 +02:00