aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranap_common.c
AgeCommit message (Collapse)AuthorFilesLines
2020-07-29Provide more context when logging "Error in ANY_fromType_aper"Harald Welte1-7/+7
Let's add the type name whose encoding failed to give us some kind of a clue what's happening in those situations. Change-Id: I802677ba7164a4d3382d4bc00f5e1c7ab7067d89
2017-12-20fix 3 compiler warnings in ranap_common.cNeels Hofmeyr1-2/+2
ranap_common.c:282 col 45: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘RANAP_CauseNon_Standard_t {aka const long int}’ [-Wformat=] ranap_common.c:527 col 15: warning: implicit declaration of function ‘asn1str_to_u16’; did you mean ‘asn_strtol’? [-Wimplicit-function-declaration] ranap_common.c:546 col 11: warning: unused variable ‘addr’ [-Wunused-variable] Change-Id: I0b399e78fa7b202a36e5e4be86f338c0ceb9823e
2017-07-06set RANAP msgb headroom to 512 (times two)Neels Hofmeyr1-1/+1
With a headroom of 256, the SGSN crashes with: msgb(0x6e3b90): Not enough headroom msgb_push (256 < 264) I'm not perfectly sure what amount of headroom is strictly necessary. The only reason to pick 512 is that it is twice the amount of 256. Change-Id: I9a193846902a0477af0873f78283c4f2bedaf5dd
2016-04-25ranap_parse_lai(): properly initialize out-arg, adjust test experrNeels Hofmeyr1-0/+4
The test stderr output changes merely because the source code line numbers of the error logging changed. Fixes: CID#93770
2016-04-06ranap_parse_lai(): Fix wrong BCD decoding for MNC. Add test.Neels Hofmeyr1-2/+2
Fix the ranap_parse_lai() part that decodes the MNC: place the *10 at the proper MNC digit. Add a comprehensive test for ranap_parse_lai() in test-helpers.c. Because ranap_parse_lai() logs things, add test_common.c to test-helpers compilation and an expected stderr output to test-helpers' testsuite.at def.
2016-04-06ranap_parse_lai(): add LAC size check, and log all parse errorsNeels Hofmeyr1-2/+14
2016-02-18ranap: Add custom ranap_decode_rab_setupormodifieditemies() functionDaniel Willmann1-0/+25
2016-02-18ranap_common: Add helper function to get IP from transport layer addrDaniel Willmann1-0/+17
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-03don't include hnbgw.h from ranap header filesHarald Welte1-1/+7
To use libosmo-ranap from outside of this repository, we need to eliminated all dependencies to local header files
2015-12-26ranap: Allocate msgb's with headroom for SCCP User primitive pushingHarald Welte1-1/+1
2015-12-26ranap_common.c: Add ranap_parse_lai()Harald Welte1-0/+26
2015-12-25ranap_common: Add value_string for procedure code and presenceHarald Welte1-0/+59
2015-12-25ranap_common: Add ranap_cause_str() to stringify RANAP CauseHarald Welte1-0/+201
2015-12-23Introduce DRANAP/DRUA log categories to separate loggingHarald Welte1-8/+8
2015-12-18ranap_common: Fix error cleanup path while generating IE PairHarald Welte1-2/+2
2015-12-18{hnbap,rua,ranap}_common: check for encoding errors in new_ie()Harald Welte1-5/+21
2015-12-18{hnbap,ranap,rua}_common: use FREEMEM(), not free() directlyHarald Welte1-3/+3
If we allocate with CALLOC/MALLOC macros, we need to release memory via the same API.
2015-12-18ranap: Use CALLOC() macro of libasn1cHarald Welte1-4/+2
we don't use malloc() directly, as that doesn't mix well with our libasn1c using talloc.
2015-12-18ranap: Ensure we free any intermediate dynamically allocated memoryHarald Welte1-4/+20
2015-12-16ranap_common: Add function to wrap IEs into a RANAP_ProtocolIE_FieldPair_tHarald Welte1-4/+32
The FieldPair is a strange construct of RANAP Radio Access Bearer assignment, where certain IEs appear in pairs.
2015-12-16Add ranap_generate_outcome() functionHarald Welte1-3/+27
Ranap has not only successsful and unsuccessful outcome, but also an unqualified general 'outcome'.
2015-12-16{hnbap,rua,ranap}_common.c: Reduce code duplicatioonHarald Welte1-43/+25
There used to be a lot of code duplication between the code to generate initiating, successfulOutcome and unsuccessfulOutcome messages. Try to reduce that by callign a generic function.
2015-12-16{rua,hnbap,ranap}_common: Add missing encoding functionsHarald Welte1-29/+37
We used to only have those generator functions that we needed for the existing hnbgw code; Implement the missing encoders
2015-10-06add copyright statement and AGPLv3 headers to source code filesHarald Welte1-0/+20
2015-09-10Back RUA/RANAP integration until RANAP Reset works for cs+psHarald Welte1-1/+1
The hNodeB is now actively transmitting and we are getting up to the HNBAP UE-REGISTER.req with the IMSI of the MS.
2015-09-10first dispatch of RUA into RANAPHarald Welte1-1/+4
This is becoming more and more of a hack, as asn1c + asn1tostruct.py don't really deal well with the RANAP syntax :(
2015-09-10ranap: Add more manual definitions to RANAP-PDUsHarald Welte1-0/+138
It seems that individual IEs contain nested containers, and asn1c is not generating code for that unless we help it by some hand-crafted additional definitions. *sigh*