Commit Graph

29 Commits

Author SHA1 Message Date
Philipp Maier 6ce5684fba ranap_common: add decoder for RAB SetupOrModifyItemFirst
The RAB SetupOrModifyItemFirst is contained in the RAB Assignment
Request. We currently have no decoder for it, so lets add one.

Change-Id: Id7293c1035cf6de34b7a416fa9265a5a32ed3216
Related: OS#5152
2022-01-09 10:04:30 +00:00
Harald Welte 4f18ce1ecc Provide more context when logging "Error in ANY_fromType_aper"
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
2020-07-29 20:11:36 +02:00
Neels Hofmeyr f898d6bc10 fix 3 compiler warnings in ranap_common.c
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-12-20 15:55:14 +00:00
Neels Hofmeyr 3b42658836 set RANAP msgb headroom to 512 (times two)
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
2017-07-06 13:53:42 +00:00
Neels Hofmeyr f6e56058f4 ranap_parse_lai(): properly initialize out-arg, adjust test experr
The test stderr output changes merely because the source code line numbers
of the error logging changed.

Fixes: CID#93770
2016-04-25 13:26:07 +02:00
Neels Hofmeyr d8013d1f8c ranap_parse_lai(): Fix wrong BCD decoding for MNC. Add test.
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-06 18:55:14 +02:00
Neels Hofmeyr 8f4cd86904 ranap_parse_lai(): add LAC size check, and log all parse errors 2016-04-06 18:55:14 +02:00
Daniel Willmann 635fac0c3e ranap: Add custom ranap_decode_rab_setupormodifieditemies() function 2016-02-18 16:02:37 +01:00
Daniel Willmann 4870b995ec ranap_common: Add helper function to get IP from transport layer addr 2016-02-18 13:21:35 +01:00
Neels Hofmeyr 96979af054 move ranap_*.h,iu_helpers.h to include/osmocom/ranap/
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-05 15:37:23 +01:00
Harald Welte bdf3fd1dc4 don't include hnbgw.h from ranap header files
To use libosmo-ranap from outside of this repository, we need to
eliminated all dependencies to local header files
2016-01-03 17:25:51 +01:00
Harald Welte e311ae078a ranap: Allocate msgb's with headroom for SCCP User primitive pushing 2015-12-26 23:41:14 +01:00
Harald Welte 37704d907d ranap_common.c: Add ranap_parse_lai() 2015-12-26 08:42:31 +01:00
Harald Welte efef6fb4de ranap_common: Add value_string for procedure code and presence 2015-12-25 15:35:01 +01:00
Harald Welte 3d39f84233 ranap_common: Add ranap_cause_str() to stringify RANAP Cause 2015-12-25 09:40:07 +01:00
Harald Welte f42317ba9c Introduce DRANAP/DRUA log categories to separate logging 2015-12-23 15:37:17 +01:00
Harald Welte 16232780d8 ranap_common: Fix error cleanup path while generating IE Pair 2015-12-18 17:22:04 +01:00
Harald Welte 04329dcbdc {hnbap,rua,ranap}_common: check for encoding errors in new_ie() 2015-12-18 15:18:13 +01:00
Harald Welte 629391321f {hnbap,ranap,rua}_common: use FREEMEM(), not free() directly
If we allocate with CALLOC/MALLOC macros, we need to release memory via the
same API.
2015-12-18 14:58:34 +01:00
Harald Welte 9c397d4969 ranap: Use CALLOC() macro of libasn1c
we don't use malloc() directly, as that doesn't mix well with
our libasn1c using talloc.
2015-12-18 13:35:58 +01:00
Harald Welte 2676554c92 ranap: Ensure we free any intermediate dynamically allocated memory 2015-12-18 13:35:58 +01:00
Harald Welte ace1d24d34 ranap_common: Add function to wrap IEs into a RANAP_ProtocolIE_FieldPair_t
The FieldPair is a strange construct of RANAP Radio Access Bearer
assignment, where certain IEs appear in pairs.
2015-12-16 23:07:19 +01:00
Harald Welte c16117a22c Add ranap_generate_outcome() function
Ranap has not only successsful and unsuccessful outcome, but also
an unqualified general 'outcome'.
2015-12-16 20:30:11 +01:00
Harald Welte 8dacb07baf {hnbap,rua,ranap}_common.c: Reduce code duplicatioon
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 20:27:14 +01:00
Harald Welte cbaaeefe00 {rua,hnbap,ranap}_common: Add missing encoding functions
We used to only have those generator functions that we needed for
the existing hnbgw code; Implement the missing encoders
2015-12-16 20:17:26 +01:00
Harald Welte 77847ad020 add copyright statement and AGPLv3 headers to source code files 2015-10-06 22:07:04 +02:00
Harald Welte e2e5d4dd53 Back RUA/RANAP integration until RANAP Reset works for cs+ps
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-10 23:49:45 +02:00
Harald Welte 350814a5cb first dispatch of RUA into RANAP
This is becoming more and more of a hack, as asn1c + asn1tostruct.py
don't really deal well with the RANAP syntax :(
2015-09-10 22:32:15 +02:00
Harald Welte ac9c024432 ranap: Add more manual definitions to RANAP-PDUs
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*
2015-09-10 21:18:16 +02:00