aboutsummaryrefslogtreecommitdiffstats
path: root/src/hnbgw_hnbap.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-27fix error rc in various ASN.1 decoding functionsNeels Hofmeyr1-1/+1
Fixes: CID#57945, CID#57946, CID#57947, CID#57948, CID#57950, CID#57951 Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898
2016-09-27hnbap: accept UE Register Requests with TMSI and pTMSINeels Hofmeyr1-4/+114
Add the option to allow UE Register Requests with a TMSI identity. Add VTY command to enable this option, 'hnbap-allow-tmsi'. Add hnbgw_tx_ue_register_acc_tmsi(). HNBGW so far keeps track of UEs that have registered, with their IMSI. When a UE registers with only a TMSI, we obviously can't store an IMSI. However, since we're so far never *using* the list of UEs in osmo-hnbgw, we might as well just accept the TMSI registration and carry on as usual. All that is needed for proper operation is a valid UE context. This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. So far this caused failures and the need to make the UE clear its TMSI (wait several minutes or attempt to subscribe to a different network), so that UE registration switched back to IMSI. When simply accepting the TMSI in osmo-hngw, no problems are apparent in our current code state. For example, a Samsung Galaxy S4 seems to send a UE_Identity_PR_tMSILAI (CS identity), and a GT-I9100 seems to send a UE_Identity_PR_pTMSIRAI (PS identity) upon first registration to the network. Recording the IMSI in hnbgw: we could use the subscriber list during paging, to page a UE on only its last seen HNB. On the other hand, it doesn't hurt to anyway always page to all HNBs connected to osmo-hnbgw. The paging procedure does include a page-to-all-HNBs in case the first HNB paging fails. But we must be aware that UEs that register by TMSI will simply not have an IMSI recorded in the list of UE contexts, so a lookup based on IMSI may fail. Patch-by: Harald Welte <laforge@gnumonks.org>, me Change-Id: I87bc1aa3e85815ded7ac1dbdca48f1680b468589
2016-09-27hnbgw: UE context: add handling by tmsi identificationNeels Hofmeyr1-1/+1
To prepare for an upcoming commit that accepts TMSI identification upon UE Register Requests: Add tmsi arg to ue_context_alloc(). Add ue_context_by_tmsi(). This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. See the upcoming commit that enables accepting TMSI identities for further detail. Change-Id: I138458443319cc4cbea5ee7906cf5dd72d582130
2016-09-27hnbap: add UE Register Reject for pTMSIRAI identityNeels Hofmeyr1-32/+99
This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. Sending a proper registration reject speeds up the response seen on the UE and avoids needless waiting. See the upcoming commit that enables accepting TMSI identities for further detail. Change-Id: I03b69613e6ddd8a08d9358ffc2f74954c231fd2c
2016-09-09build: move headers to include/osmocom/*Neels Hofmeyr1-1/+1
This came up while fixing 'make distcheck'; this is certainly not the easiest way but it makes sense to have the headers in include/, like we do in openbsc. The easy alternative might be to add -I$(top_srcdir)/src to src/Makefile.am. Remove -I$(top_srcdir)/src from src/tests/Makefile.am, no longer needed. Change-Id: I5a82e029dcdc4df0a60a31271a4883393fe59234
2016-09-09build: fix ranap gen, use same for gen hnbap and rua genNeels Hofmeyr1-2/+2
fix extraneous rebuild for each make invocation: touch the ranap.stamp file in src/ as the make target suggests. fix for 'make distcheck': ranap gen: move generated sources to builddir, not srcdir. Thus we also -I the builddir include to pick up those headers. hnbap and rua have the same situation as ranap (they generate numerous files from a single make rule). Use the same makefile semantics for those two (commit for ranap gen omitted the same changes for hnbap and rua). The generated headers are thus moved to include/osmocom/*/, so adjust #include statements accordingly (*_common.h, *_ies_defs.h). Also move hnbap_common.h to include/osmocom/hnbap and rua_common.h to include/osmocom/rua, since the *_ies_defs.h want to include them; and since *_ies_defs.h are now in include/osmocom/*, we want a '<foo>' include now. Also adjust gitignore. Change-Id: I32213666fcdfc144008fa7d46497c0938d093e86
2016-09-09UE Register with TMSI: reply with a Register RejectNeels Hofmeyr1-1/+65
When receiving a UE Register Request with TMSI and no IMSI, compose a Register Reject with the same UE Identity and send. The accepting function expects a ue_context argument and composes the message from the IMSI found there. This new rejection message cannot rely on a ue_context struct and hence uses the asn1 uE_Identity directly. Change-Id: Ia47e398e50e316842cd260dc0d9a4e2d8a1c627c
2016-04-25UE Register: fix: free ies when no IMSI is foundNeels Hofmeyr1-0/+1
2016-04-25cosmetic: comments, log typo, explicit pointerNeels Hofmeyr1-2/+4
Fix log typo 'REGSITER' and add some comments on UE Register with TMSI. The container_pair struct starts with 'list', so passing the container_pair pointer is equivalent to passing the list; but instead, explicitly mention the list member to avoid confusion.
2016-01-12Revert "hnbgw_hnbap: Zero IEs_t before decode is called"Daniel Willmann1-5/+0
This reverts commit a8b6b1e3a1fb195d33f2e244494cb902eec5e405. Zeroing is now done inside of the decode function
2016-01-07hnbgw_hnbap: Zero IEs_t before decode is calleddaniel/wipDaniel Willmann1-0/+5
This ensures that presenceMask is zero and optional fields will be freed correctly. This needs to happen for ranap and rua as well.
2016-01-07asn1tostruct: Add memory free functions and use them in HNBAPDaniel Willmann1-1/+7
2016-01-07hnbgw_hnbap: Handle hnb deregister message as wellDaniel Willmann1-0/+18
2016-01-07hnbgw: Use libosmo-netif for SCCP connection handlingDaniel Willmann1-1/+3
2016-01-05move ranap_*.h,iu_helpers.h to include/osmocom/ranap/Neels Hofmeyr1-1/+1
A bit hacky: the ranap_ies_defs.h is generated together with the ranap_encoder.c and ranap_decoder.c. See comments in src/Makefile.am and include/osmocom/ranap/Makefile.am.
2016-01-03merge (+rename) iu_helpers.c into libosmo-ranapHarald Welte1-4/+4
2015-12-25Fix typo / spelling mistakesHarald Welte1-2/+2
2015-12-25hnbgw_hnbap: Print HNBAP Cause during UE De-RegisterHarald Welte1-2/+2
2015-12-24hnbgw: Bring all parts togetherHarald Welte1-2/+2
We now have the RUA and SUA parts interconnected by the context ID mapper, and should be able to pass messages back and forward between both sides. Unfortunately this touches a bit of everything, but the structures are all still very much in flux. Hopefully they will start to stabilize at some point soon...
2015-12-23use msgb_sctp_ppid() from libosmo-netif, remove local declarationHarald Welte1-1/+2
2015-12-22hnbgw_hnbap.c: Clean up after encoding a UE register acceptDaniel Willmann1-0/+4
Need to free the ASN.1 structs after using them to encode the UE register accept message.
2015-12-17hnbgw_hnbap: Initialize return value and always return somethingDaniel Willmann1-2/+4
2015-12-17hnbap: Free ASN.1 components after they are no longer neededDaniel Willmann1-0/+4
2015-12-17hnbgw: Change logging priorities and add HNBAP categoryDaniel Willmann1-9/+9
Log hnbap messages to the HNBAP category. Change MAIN category to only log INFO and above and change SCTP notification message to debug.
2015-12-17hnbgw_hnbap: Process UEDeRegister and try to free correct UEDaniel Willmann1-0/+24
2015-12-14asn1helpers: Fix 24 bit conversion function and use it in hnbgw_hnbapDaniel Willmann1-2/+2
The 32 bit int needs to be shifted left one byte so the correct bytes end up at the beginning of the bit string buffer.
2015-12-14asn1helpers: Add 28 bit conversion function and use it for Cell IDDaniel Willmann1-1/+1
The padding bits in the bit string are at the end and the byte-order is MSB-first. This means the number needs to be shifted left so the padding bits are the least significant.
2015-10-06add copyright statement and AGPLv3 headers to source code filesHarald Welte1-0/+20
2015-09-18the Context ID is a 24bit number, we cannot use len = 4 bytes!Harald Welte1-0/+1
2015-09-11various cleanups (compiler warnings, coding style)Harald Welte1-6/+9
2015-09-11move BCD string encoding/decoding functions to iu_helpers.[ch]Harald Welte1-46/+0
2015-09-11hnbap: Print error messages in error casesHarald Welte1-0/+23
2015-09-11respond to HNBAP UE REGISTER REQ withe correspnding ACCEPTHarald Welte1-7/+76
The Accept incudes the IMSI that the phone presented, but somehow we fail to encode the Context ID as bitstring, see ../pcap/20150911-hnbap-ue_register.pcap
2015-09-11introduce ue_context managementHarald Welte1-2/+6
We keep one 'ue_context' structure for every UE that we see a UE REGISTER REQUEST for.
2015-09-07hnbap: Don't enqueue a NULL msgb for transmitHarald Welte1-0/+3
2015-09-07Use implement HNBAP transmit using per-hnb write_queueHarald Welte1-1/+2
2015-09-07hnbgw: zero-initialize the output struct before aper_decode()Harald Welte1-0/+4
asn1c has this strange behavior that the _output_ struct must be zero-initialized.
2015-08-30migration of code from ffasn1c to asn1c + asn1tostruct.pyHarald Welte1-148/+101
2015-08-30hnbgw: Actually link in + call ffasn1c runtime libraryHarald Welte1-2/+81
2015-08-30move asn.1 helper functions to asn1helpers.[ch]Harald Welte1-25/+3
2015-08-30first compiling code (untested)Harald Welte1-27/+44
2015-08-29further tiny steps of progress on the hnb-gw infrastructureHarald Welte1-7/+40
2015-08-29very early intial code snippets for handling HNBAP in a HNB-GWHarald Welte1-0/+138