laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved
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
---
M include/osmocom/ranap/ranap_common.h
M src/ranap_common.c
2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/include/osmocom/ranap/ranap_common.h b/include/osmocom/ranap/ranap_common.h
index 23359e1..f9c1f7f 100644
--- a/include/osmocom/ranap/ranap_common.h
+++ b/include/osmocom/ranap/ranap_common.h
@@ -643,3 +643,8 @@
int ranap_decode_rab_setupormodifieditemies_fromlist(
RANAP_RAB_SetupOrModifiedItemIEs_t *raB_SetupOrModifiedItemIEs,
ANY_t *any_p);
+
+/* There is no generated decoder available, this is a custom one */
+int ranap_decode_rab_setupormodifyitemfirst(
+ RANAP_RAB_SetupOrModifyItemFirst_t *raB_SetupOrModifyItemFirst,
+ ANY_t *any_p);
diff --git a/src/ranap_common.c b/src/ranap_common.c
index 4ada7ff..6c6d97c 100644
--- a/src/ranap_common.c
+++ b/src/ranap_common.c
@@ -562,7 +562,8 @@
ANY_t *any_p) {

RANAP_RAB_SetupOrModifiedItem_t *ranaP_RABSetupOrModifiedItem_p = NULL;
- int decoded = 0;
+ int decoded;
+
assert(any_p != NULL);
assert(raB_SetupOrModifiedItemIEs != NULL);

@@ -581,3 +582,28 @@
return decoded;
}

+int ranap_decode_rab_setupormodifyitemfirst(
+ RANAP_RAB_SetupOrModifyItemFirst_t *raB_SetupOrModifyItemFirst,
+ ANY_t *any_p)
+{
+ RANAP_RAB_SetupOrModifyItemFirst_t *ranaP_RABSetupOrModifyItemFirst_p = NULL;
+ int decoded;
+
+ assert(any_p != NULL);
+ assert(raB_SetupOrModifyItemFirst != NULL);
+
+ memset(raB_SetupOrModifyItemFirst, 0, sizeof(RANAP_RAB_SetupOrModifyItemFirst_t));
+ RANAP_DEBUG("Decoding message RANAP_RAB_SetupOrModifyItemFirst_t (%s:%d)\n", __FILE__, __LINE__);
+ decoded = ANY_to_type_aper(any_p, &asn_DEF_RANAP_RAB_SetupOrModifyItemFirst,
+ (void **)&ranaP_RABSetupOrModifyItemFirst_p);
+ if (decoded < 0) {
+ RANAP_DEBUG("Decoding of RANAP_RAB_SetupOrModifyItemFirst_t failed\n");
+ return -1;
+ }
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_RAB_SetupOrModifyItemFirst, ranaP_RABSetupOrModifyItemFirst_p);
+ memcpy(raB_SetupOrModifyItemFirst, ranaP_RABSetupOrModifyItemFirst_p, sizeof(RANAP_RAB_SetupOrModifyItemFirst_t));
+ FREEMEM(ranaP_RABSetupOrModifyItemFirst_p);
+
+ return decoded;
+}

To view, visit change 26723. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Id7293c1035cf6de34b7a416fa9265a5a32ed3216
Gerrit-Change-Number: 26723
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged