aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
AgeCommit message (Collapse)AuthorFilesLines
2017-05-20Add missing _CFLAGS and _LIBSAlexander Huemer1-1/+1
These missing pieces go unnoticed if dependencies are not installed in distinct directories. Change-Id: If8d57b72f63d79cc0d8efba7466c6ec177207cbb
2017-05-10src: use osmo_timer_setup()Pablo Neira Ayuso6-19/+8
Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
2017-05-05Gb: use textual representation for parse logMax1-3/+2
Use textual representation for message type and protocol descriminator in case of Gb parsing errors. Change-Id: Ida925258be119619d8705361730c554a130b75bc Related: SYS#3610
2017-05-04ctrl: remove boilerplate codeMax1-12/+1
Define subscriber-list-active-v1 ctrl command as RO and remove unnecessary functions. Change-Id: I88fe905c22cf7563415d470b88cb43fca0d52a7f
2017-05-02Fix vty warnings for GEA0Max1-10/+11
Previously vty always used additional checks even for GEA0 (no encryption) which resulted in misleading warnings. Fix this by adding explicit check for GEA0. Related: SYS#3610 Change-Id: I1ee468ab3298076d4cb5c7b1f6293c07e272417b
2017-03-20bsc_/gprs_subscriber: fix: use osmo_strlcpy() to safely copy IMSINeels Hofmeyr1-1/+1
Fixes: coverity scan CID 163918 Change-Id: I4b2760b006a0707928530b4390c6997b79b02981
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-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-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-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-02fix: gprs_gmm, gprs_llc_vty: two unterminated value_string arraysNeels Hofmeyr2-0/+2
Change-Id: Icc4163ac4f962fe88bbebeb3310a557ba0834e84
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 Hofmeyr3-29/+198
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-25add struct gprs_subscr, separating gprs from gsm_subscriberNeels Hofmeyr6-101/+164
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-21Handle DSD from HLRMax1-9/+25
Handle Delete Subscriber Data GSUP message from HLR to disable Packet Services for a given IMSI. Change-Id: I6b9b494fa58bcb95bd550c49f8204f00f8fdf628 Related: OS#1645
2017-02-08vty: remove ignored logging parametersMax3-3/+3
Since ce9fec3e896571835ac5bfd2980d6836f2b29f0d libosmocore ignores parameters to log_vty_command_* functions. Hence parameter of logging_vty_add_cmds() is ignored too. As we depend on much later libosmocore version anyway, we can simplify code somewhat by removing parameters which will be ignored anyway. Change-Id: I62f752fd88f1d8fefa563648f9864c7c31f87991
2017-02-07gprs/sgsn_vty: fix typo in commentAlexander Couzens1-1/+1
Change-Id: I63225b7ba6d666eddf00b1deb893e79dc9ec842b
2017-02-07gprs/sgsn_mm_ctx_alloc(): initialize MM state to IDLEAlexander Couzens1-0/+1
Previous the state was only set in Iu mode. Change-Id: I99a6aec1090cad9b9d38d134cc9b34ef292062df
2017-02-07gprs/gprs_mm: add value_strings for PMM & MM statesAlexander Couzens1-2/+15
Change-Id: I4e34dcd5e48c4dd73d63c6f865298ee7d9c864be
2017-02-07gprs/sgsn: rename sgsn_mm_ctx_alloc() -> sgsn_mm_ctx_alloc_gb()Alexander Couzens2-4/+4
Postfix the ran type to clarify the purpose. Because of the new support of the Iu ran type, there are 2 functions to allocate a mm ctx. For Iu it's sgsn_mm_ctx_alloc_iu(). For gb it should be named in the same way. Change-Id: Ic49009e8c20c12308855e1409c09004698c79b95
2017-02-07gprs/sgsn: rename gprs->mm_state -> gmm_stateAlexander Couzens4-39/+54
GMM is the right term. MM state is already occupied. Change-Id: I9cfdcf921e4ebd14a5e7ce7489ec4ce5d1f5515f
2017-02-06VTY: Print 3G auth tuples, not just 2G auth tuplesHarald Welte1-9/+24
Change-Id: I277e4347ee1486a39e6dc4e2363a593f328f9e3b Related: OS#1592
2017-02-01sgsn: Fix deeply flawed copying logic for PDP context activationHolger Hans Peter Freyther1-3/+9
It is one of these changes that should have never worked but did for a long time. Only recently a corrupted GTP message was seen. The code in ccd2312d10e14747e8a4d26d8f72b052ffcfc282 tried to solve the right problem but was deeply flawed. * Make the code operate on the copied message and not the original one that is deleted by the underlaying layers on return * Add an out variable to determine if the msgb should be deleted and assume that by default it will be deleted. Change-Id: I564526e7cde2b8a2f0ce900492cd38fc23c176a7
2017-01-27gprs: Fix compiler warning about uninitalized cause codePhilipp Maier1-1/+1
in gprs_gmm.c:gsm48_rx_gmm_ra_upd_req the variable reject_cause is not initalized, which is ok, since it gets initalized before the jump into the "rejected" path. However, the compiler still throws a warning. This commit fixes the problem by preinitalizing the reject_cause to GMM_CAUSE_PROTO_ERR_UNSPEC Change-Id: I84cffb631e4cad3d4748512b47e3876208f53727
2017-01-26sgsn: Add GTP information to "show pdp-context"Harald Welte1-2/+21
When displaying the PDP context, it is quite useful to also show IP address and TEI information about the GTP side of that PDP context. Change-Id: I56ea530240c15b26729e7a42e539020cb1e233e5
2017-01-26various comment / whitespace tweaks (libmsc, gprs, libcommon-cs)Neels Hofmeyr2-1/+2
cosmetic ws in common_cs_vty.c, osmo_msc.c comment: tiny typo fix in gsm_04_08.c In comments, drop some unbalanced braces, because simplistic C file harvesters will break at a single opening brace even if it is in a comment. This is aimed at the fsm-to-dot.py script in libosmocore/contrib. Change-Id: I3c1fa53195a1e57d6fe0a6791c346d30ceff1251
2017-01-25compression: Fix nullpointer derefPhilipp Maier1-3/+4
When the creation of a new compression entity fails, an error message is created, this error message contains printf with a dereferentiation of the compression entity, that is clearly NULL at that point. This commit corrects that. Change-Id: I87371ade0ccd6a93b446f2013c1747f486739518
2017-01-23cosmetic: use osmo_strlcpy() everywhereNeels Hofmeyr5-23/+23
Shorten some code and make obvious to the reader that the string copy is done in a safe way. Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
2017-01-15gprs subscr: fix: intended strcmp(), but is strcpy()Neels Hofmeyr1-5/+3
The code checked 'if (strcpy(..) != 0)' which is always true and thus always copied twice -- luckily we want to copy anyway and so this is not an actual functional failure. We could correct to strcmp, but instead of iterating to compare, we might as well copy right away. Change-Id: I0ea035bd478f7022ed65e9e84d8aaf5e423309b7
2017-01-13Log expected SRES on GPRS AUTH REJECTMax1-1/+3
Change-Id: I19b0001650979bf7f1832f04f9fd5a26beb577d0
2016-12-23cosmetic: Rename phone to msPhilipp1-7/+7
The term "phone" is incorrect. Rename phone to "MS" (mobile station) in the comments and log output of gprs_llc.c Change-Id: I322d3d99452502da7555cc2af6bc8a192ca3c9c5
2016-12-23sndcp: Allow empty SNDCP-XID indicationsPhilipp2-32/+47
In some rare cases the modem might send a xid indication that does not contain anything except the version number field. The sgsn ignors such SNDCP-XID indications by stripping the entire field from the response. We found a modem in the wild that started to act problematic when the empty SNDCP-XID was missing in the response. This patch changes the XID negotiation behaviour in a way that if a modem should send empty SNDCP-XID indications, the reply will also contain an empty SNDCP-XID indication. Apart from that the SNDCP-XID version number is now parsed and echoed in the response. This ensures that we always reply with the version number that the modem expects. (The version was 0 in all cases we observed so far) Change-Id: I097a770cb4907418f53e620a051ebb8cd110c5f2 Related: OS#1794
2016-12-21Improve GPRS loggingMax6-19/+60
* log xid type as string instead of int * log packet encryption status, algorithm and IOV-UI in debug mode * print encryption parameters when dumping llme via vty * log key propagation from MM to LLC Related: OS#1794 Change-Id: I30c38fdeb0b88bb39bdb9928851300bc79e6aec6
2016-12-18gtphub: fix possible NULL deref: don't print NULL tunnelNeels Hofmeyr1-0/+3
Fixes: coverity CID#158302 Change-Id: Ic500a3eb0c49393c7962a20e61eb57fd467208d3
2016-12-13move grps_gsup_client.c to libcommon/gsup_client.cNeels Hofmeyr3-655/+0
This is in preparation for libvlr. Related: OS#1592 Change-Id: I9ad7dc7f17f3b033c779de9ae8bc120655502fce
2016-12-13move gprs/oap.c to libcommon/oap_client.cNeels Hofmeyr2-263/+1
This is in preparation for libvlr. Related: OS#1592 Change-Id: Ib526df6d9de55a1e59a379d5e2c8541ed0ef67e3
2016-12-13rename oap.h to oap_client.hNeels Hofmeyr1-1/+1
Related: OS#1592 Change-Id: I05bd65ff81b0f70f68217b2e0a9466e160bdbdec
2016-12-13oap: rename public API from oap_ to oap_client_Neels Hofmeyr2-13/+15
Mainly to differentiate the OAP messaging API (osmo_oap_ in libosmocore) from the OAP client. This is in preparation for moving the oap client to libcommon, which is in turn preparation for libvlr. Add the osmo_ prefix, as all public Osmocom API should have. We also have OAP messages code in libosmocore, so clarify by naming this osmo_oap_client, and by also renaming the oap_test to oap_client_test. This reshuffling will allow an easy move of OAP to libosmocore if we should want to do that. A number of patches will follow up on this. Related: OS#1592 Change-Id: Id447d2bebc026a375567654adafa5f82439ea7e1
2016-12-13move OAP messages implementations to libosmocoreHarald Welte3-180/+1
This corresponds to change-id If5099e60681a215e798b6675f21813f26769c253 in libosmocore, which is now required to build openbsc. Related: OS#1592 Change-Id: I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf
2016-12-13gsup client, gsup_test_client: move logging to DLGSUP categoryNeels Hofmeyr2-24/+19
Use the DLGSUP logging category for GSUP. Bump the required version of libosmocore to 0.9.5 to benefit from the DLGSUP logging category fix in core/logging.[hc]. (Id974c7be158e4d60421a98110f5c807aefd31119) Todo: we're using a "Library" logging category, which is not really what the library category was intended for. Instead, the GSUP client should probably be given a logging category like DVLR or DGPRS in its initialization API. Related: OS#1592 Change-Id: Id3938267fa062e1a997d3704cd678874306f86ee
2016-12-13rename gprs_gsup_client.h to gsup_client.hNeels Hofmeyr4-4/+4
This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. Related: OS#1592 Change-Id: I9c95d00f1a9420887a44c938b1d0ee3e20586f4c
2016-12-13gprs_gsup_client*: remove the gprs_ prefixNeels Hofmeyr3-40/+42
Make sure everything is named gsup_client_ / GSUP_CLIENT_. Rename static gsup_client_send() to client_send() to avoid clash with public gprs_gsup_client_send() being renamed to gsup_client_send(). This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. libvlr and osmo-sgsn will use the same GSUP client code. A number of patches will follow up on this, also for the the OAP client. Related: OS#1592 Change-Id: I57433973b1c4f6cc1e12e7b1c96b5f719f418b51
2016-12-13comments: gsup client: rename to Generic, adjust copyright and authorsNeels Hofmeyr1-2/+3
Related: OS#1592 Change-Id: I2c5d145e05aa4afd43ef1341d22563448f1c3577
2016-12-13add gsup_test_client programHarald Welte3-0/+319
Related: OS#1592 Change-Id: Iafd844393dd90b899f84ed61c875c1eb533436d7
2016-12-13Revert "Support Deactivate PDP Context Request from network"Neels Hofmeyr1-38/+0
This reverts commit 1611df5226199da2bf2fba3d22d93cc1a6c6c777. This is due to a segfault introduced to the asan build only. See: http://lists.osmocom.org/pipermail/openbsc/2016-December/009966.html Subject: new sanitizer breakage: SIGSEGV in sgsn_create_pdp_ctx() Date: Tue Dec 13 12:08:32 UTC 2016 Change-Id: Ic926c0e6778947b516994822e3a21d4fde25bb02
2016-12-12Support Deactivate PDP Context Request from networkPravin Kumarvel1-0/+38
Enable Deactivate PDP context based on the IMSI of the subscriber. When there are PDP contexts present for a MM context, PDP context will be deactivated along with GMM Detach(MM context deletion). If there are no PDP present, MM context will be deleted to avoid further PDP context request from the MS. Test cases is added to check this functionality. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
2016-12-05LLC: Fixup element order in LLC-XIDPhilipp1-2/+2
When the LLC-XID request is constructed the order of the elements in the TLV structure is reversed. This is in theory not a problem, but differs from what we know from our practical experience. This commit fixes the problem. Change-Id: I1d71c947350d3c5a85ff36b71c1b8f036071d162
2016-11-28IuPS: properly update ra_id on GMM Attach RequestNeels Hofmeyr1-4/+2
For new MM contexts, the ra_id was correctly obtained from the ue_ctx, but in case an MM ctx is re-used and the ra_id changed, the new ra_id was not copied to the MM context; instead, the ra_id was overwritten with uninitialized data. Always initialize the local ra_id variable from the ue_ctx->ra_id for Iu connections; it is used further below to update the ctx->ra_id. For the case of a brand new Iu MM ctx, the ctx->ra_id then gets initialized a second time. We could technically drop the init in sgsn_mm_ctx_alloc_iu(), but it doesn't hurt either way. Fixes: CID#57936 Change-Id: Ia06458758362e76925690b1757d8ced95e9609e4
2016-11-27sndcp: fixup for coverity scan defect CID 149097Philipp2-0/+2
Coverity scan detects a Null pointer deref (FORWARD_NULL) in gprs_sndcp_comp.c: 67 in gprs_sndcp_comp_create(). The reason for this is that gprs_sndcp_dcomp_init() and also gprs_sndcp_pcomp_init() rely on the comp_entity->algo algo flag. If the program logic is correct a null pointer deref should never occur. This commit adds OSMO_ASSERT() statements to ensure a null pointer deref is catched if if the ...comp_init() functions are used with incorrect parameters. Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1