aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/ranap/ranap_common.h7
-rw-r--r--src/ranap_common.c25
2 files changed, 32 insertions, 0 deletions
diff --git a/include/osmocom/ranap/ranap_common.h b/include/osmocom/ranap/ranap_common.h
index b7682e5..459afe7 100644
--- a/include/osmocom/ranap/ranap_common.h
+++ b/include/osmocom/ranap/ranap_common.h
@@ -589,6 +589,8 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
+#include <osmocom/ranap/ranap_ies_defs.h>
+
#define RANAP_DEBUG(x, args ...) DEBUGP(_ranap_DRANAP, x, ## args)
extern int _ranap_DRANAP;
@@ -635,3 +637,8 @@ void ranap_set_log_area(int log_area);
int ranap_parse_lai(struct gprs_ra_id *ra_id, const RANAP_LAI_t *lai);
int ranap_ip_from_transp_layer_addr(const BIT_STRING_t *in, uint32_t *ip);
+
+/* The generated version does not work, this is a custom one */
+int ranap_decode_rab_setupormodifieditemies_fromlist(
+ RANAP_RAB_SetupOrModifiedItemIEs_t *raB_SetupOrModifiedItemIEs,
+ ANY_t *any_p);
diff --git a/src/ranap_common.c b/src/ranap_common.c
index f2fdf9d..7cbf1f9 100644
--- a/src/ranap_common.c
+++ b/src/ranap_common.c
@@ -540,3 +540,28 @@ int ranap_ip_from_transp_layer_addr(const BIT_STRING_t *in, uint32_t *ip)
return 0;
}
+
+int ranap_decode_rab_setupormodifieditemies_fromlist(
+ RANAP_RAB_SetupOrModifiedItemIEs_t *raB_SetupOrModifiedItemIEs,
+ ANY_t *any_p) {
+
+ RANAP_RAB_SetupOrModifiedItem_t *ranaP_RABSetupOrModifiedItem_p = NULL;
+ int decoded = 0;
+ assert(any_p != NULL);
+ assert(raB_SetupOrModifiedItemIEs != NULL);
+
+ memset(raB_SetupOrModifiedItemIEs, 0, sizeof(RANAP_RAB_SetupOrModifiedItemIEs_t));
+ RANAP_DEBUG("Decoding message RANAP_RAB_SetupOrModifiedItemIEs (%s:%d)\n", __FILE__, __LINE__);
+ decoded = ANY_to_type_aper(any_p, &asn_DEF_RANAP_RAB_SetupOrModifiedItem, (void**)&ranaP_RABSetupOrModifiedItem_p);
+ if (decoded < 0) {
+ RANAP_DEBUG("Decoding of IE raB_SetupOrModifiedItem failed\n");
+ return -1;
+ }
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_RAB_SetupOrModifiedItem, ranaP_RABSetupOrModifiedItem_p);
+ memcpy(&raB_SetupOrModifiedItemIEs->raB_SetupOrModifiedItem, ranaP_RABSetupOrModifiedItem_p, sizeof(RANAP_RAB_SetupOrModifiedItem_t));
+ FREEMEM(ranaP_RABSetupOrModifiedItem_p);
+
+ return decoded;
+}
+