aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_gmm.c
AgeCommit message (Collapse)AuthorFilesLines
2013-07-21sgsn: spelling fixes inside commentsHarald Welte1-2/+2
2013-07-21sgsn: Add "auth-policy" VTY command to enable/disable ACLHarald Welte1-1/+2
2013-07-21sgsn: add a minimalistic ACLHarald Welte1-1/+2
This adds a minimalistic ACL by which certain, individual roaming IMSIs can be authorized to use the SGSN. So you can selectively bypass the 'MCC+MNC == first 5 digits of IMSI' checking for a couple of IMSIs
2013-07-04sgsn: Fix lengths of MS Network Capability and MS Radio Access Capability ↵Alexander Chemeris1-4/+3
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.
2012-07-14add some comments regarding the free() / release of pdp contextxHarald Welte1-0/+3
It might be that we're deleting structures instead of properly cleaning up the attached libgtp handles...
2012-06-16split libgb into a separate library for outside useHarald Welte1-1/+2
This also removes the dependency to osmo_sock() inside libcommon and replaces it with osmo_sock_* from libosmocore
2011-10-16GPRS GMM: When we receive a RA UPD REQ, we are NORMAL even after SUSPENDHarald Welte1-0/+3
There is no explicit BSSGP RESUME in case the MS sends a RA UPD REQ after being in SUSPEND previously.
2011-10-16GPRS GMM: Send LLGMM-RESET.req when talking to unknown MSHarald Welte1-0/+5
In case a MS (of which we have no MM context) sends us anything but a GMM ATTACH REQUEST, we need to send it a LLC XID RESET (by means of issuing LLGMM-RESET.req). Otherwise the phone will expect us to send a specific unacknowledged sequence number that we don't know. Thanks to Holger for pointing this bug out to me. It seems to commonly occur when a MS is doing network re-selection and (erroneously) sends a RA UPD REQ instead of an ATTACH REQ. The RA UPD REJ that we sent was never seen by the GMM entity in the MS, as the LLC entity discarded it due to sequence number mis-match.
2011-10-14gprs_gmm: Fix various compiler warningsHolger Hans Peter Freyther1-4/+7
gprs_gmm.c:240:2: warning: passing argument 4 of ‘gprs_llc_tx_ui’ discards qualifiers from pointer target type ../../include/openbsc/gprs_llc.h:151:5: note: expected ‘void *’ but argument is of type ‘const struct sgsn_mm_ctx *’ gprs_gmm.c:349:11: warning: unused variable ‘ptsig’ gprs_gmm.c:601:5: warning: too many arguments for format gprs_gmm.c:987:25: warning: initialization discards qualifiers from pointer target type gprs_gmm.c:1010:6: warning: ‘rc’ may be used uninitialized in this function
2011-08-05GPRS: Fix the parsing/interpretation of the PDP CTX status IEHarald Welte1-8/+16
The byte ordering is a bit odd: The least significant byte is ahead of the most significant byte, different from everything else in GSM that seems to be big-endian. Thanks to Seungju Kim <admin@manateeshome.com> for repoerting the bug.
2011-07-27GPRS: Fix buffer overflow in case of very long MS RA CAP IEHarald Welte1-3/+9
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-16gprs_gmm: ctx cannot be null, so remove checkHarald Welte1-1/+1
Detected by Smatch: /home/laforge/projects/git/openbsc/openbsc/src/gprs/gprs_gmm.c +757 gsm48_rx_gmm_att_req(133) warn: variable dereferenced before check 'ctx'
2011-05-07src: use namespace prefix osmo_* for misc utilsPablo Neira Ayuso1-1/+1
Summary of changes: s/bcd2char/osmo_bcd2char/g s/char2bcd/osmo_char2bcd/g s/hexparse/osmo_hexparse/g s/hexdump/osmo_hexdump/g s/hexdump_nospc/osmo_hexdump_nospc/g s/ubit_dump/osmo_ubit_dump/g s/static_assert/osmo_static_assert/g
2011-05-06src: use namespace prefix osmo_timer* for timer functionsPablo Neira Ayuso1-9/+9
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-03-23Fix build of bsc-nat and GPRS code after include path changeHarald Welte1-2/+2
The last patch changed the osmocore include paths, this fixes some build problems caused by it
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-6/+6
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-01-01[SGSN] Fix processing of RA Update Request regarding TLLIHarald Welte1-1/+6
In case we get a RA UPD REQ on a new cell (both served by the same SGSN), the LLC stack should not allocate a ne LLE/LLME, as the latter would reset the V(u)sent / V(u)recv to zero and make the MS discard our responses. Instead, whenever the LLC stack sees a foreign TLLI, it should always convert it to the local TLLI before doing any lookup for a LLE/LLME.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-6/+5
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-12-26SGSN: Avoid duplicate MM contexts in case MS and SGSN disagree on P-TMSIHarald Welte1-0/+15
2010-12-26SGSN: Implement network-initiated PDP CTX DEACT when GGSN restartsHarald Welte1-0/+99
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-24SGSN / GMM: Only allow non-roaming IMSIsHarald Welte1-1/+10
As we do not yet use the HLR from the SGSN, we allow all MS to attach to our GPRS network. However, if this is running in a public environment, it could cause service interruption to users of commercial GPRS networks. Thus, we now check if the first 5 digits of the IMSI match the MCC/MNC of the cell that they want to register to. Thus, any subscribers with SIM cards from real operators will no longer be accepted.
2010-12-23GPRS/GMM: Correctly look up MM Context in RA UpdateHarald Welte1-0/+1
If a MS changes RA, the RA will arrive in the new cell using the old TLLI (masked as foreign TLLI). So we need to look-up the TLLI in a special way, using the old RA as indicated in the 04.08 GMM message. There is still another bug remaining: As we somehow create a new LLC, the sequence numbers of our responses start from 0 again, which is not what the MS expects. This needs to be fixed in a follow-up patch.
2010-07-03[SGSN] Some IEs in ATTACH REQUEST can be longer in 24.008Harald Welte1-1/+3
The original length checks were based on 04.08, but 24.008 allows longer IEs.
2010-07-03[SGSN] Initial work on GMM authentication and cipheringHarald Welte1-9/+103
2010-07-02[SGSN] use GPRS_ALGO_GEA0 instead of '0'Harald Welte1-6/+11
2010-07-02[SGSN] SM: Properly parse APN and PCO Optional IE in PDP CTX ACT REQHarald Welte1-2/+8
2010-07-02[SGSN] Send poper SM and GMM STATUS in case we have no MM CTXHarald Welte1-1/+2
2010-07-02[SGSN] Remove old dead codeHarald Welte1-17/+14
2010-07-02[SGSN] Only increment PDP CTX ACT count after check for retransmissionHarald Welte1-2/+4
2010-07-02[SGSN] Account for re-transmitted PDP CTX ACT REQHarald Welte1-2/+11
In case our PDP CTX ACT ACK gets lost on the Gb or Um link, the MS re-transmits the PDP CTX ACT REQ. We have to ACK it again instead of REJecting it..
2010-07-01[SGSN] GMM: Complete value_string for GMM cause valuesHarald Welte1-4/+21
2010-07-01[SGSN] Fix TLLI (re)assignmentsHarald Welte1-3/+3
Once The TLLI (or P-TMSI of which it is derived) change has been confirmed by the MS, we need to unassign the old TLLI but keep the new TLLI _without_ re-setting the LLC entity structure such as VUsend /VUrecv counters.
2010-06-28[SGSN] MM: Properly communicate TLLI changes / unassignment to LLCHarald Welte1-3/+9
2010-06-28[SGSN] Deactivate all PDP contexts on GPRS DETACHHarald Welte1-0/+10
2010-06-09[GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX stateHarald Welte1-0/+48
2010-06-09[GPRS] GMM/SM: Improve error handling by sending STATUS messagesHarald Welte1-9/+60
2010-06-09[GPRS] Drop all PDP contexts not present in PDP CTX STATUS IE at RA UPDHarald Welte1-0/+66
2010-06-09[GPRS] SM: Acknowledge PDP CTX DEACT for non-existing PDP CTXHarald Welte1-5/+9
Some phones (notably a Ericsson Mobile Platform based E-TEN M800) insist on sending PDP CTX DEACT messages for contexts that have already been deactivated. The spec doesn't really say what we should do in this case. But since there is no "reject", we simply acknowledge it.
2010-06-01[GPRS] Major LLC / TLLI handling fixesHarald Welte1-19/+51
* 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-05-31[GPRS] GMM: Set LLC 'C/R' bit when sending IDENTITY REQUESTHarald Welte1-2/+2
Commands initiatied by the SGSN have to set C/R = 1
2010-05-31[GPRS] Include IMSI and DRX params in BSSGP DL-UDHarald Welte1-9/+18
When we send a downlink unit-data request via BSSGP, there is a lot of information that needs to be copied from the mm context, such as the IMSI, DRX parametes, MS radio access parameters, ... This is a quite strange layering violation, since we now need to pass a pointer to the MM ctx from GMM through LLC into BSSGP :(
2010-05-31[GPRS] Implement TMSI reallocation and timers 3350 + 3370Harald Welte1-34/+159
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-30[GPRS] GMM: Add some FIXME's to the codeHarald Welte1-0/+3
2010-05-18[GPRS] SGSN: use GGSN IP address from config file, disable TMSI allocationHarald Welte1-10/+21
2010-05-18[GPRS] fix numerous compiler warningsHarald Welte1-8/+3
2010-05-18[GPRS] SGSN: TMSI allocationHarald Welte1-31/+60
2010-05-18[GPRS] SGSN: Correctly set upper 4 bits of PDP address to 0Harald Welte1-0/+9
It's really strange. In GTP those 4 bits are 1, in 04.08 they are zero. Otherwise the IE is exactly the same :/
2010-05-18[GPRS] SGSN: Make sure the PCO from GGSN are passed to the MSHarald Welte1-1/+1
2010-05-18[GPRS] SGSN: properly delete a PDP context after receiving PDP CTX DEACT REQHarald Welte1-18/+28
2010-05-18[GPRS] SGSN: Don't use GGSN-provided QoS as the MS doesn't like itHarald Welte1-4/+3