aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/rua
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-08-29 20:34:40 +0200
committerHarald Welte <laforge@gnumonks.org>2015-08-29 20:34:40 +0200
commite180c16ba103f309215d6c88100e6390fef15505 (patch)
tree1fce9748cd5d30e0c3ca6f8180fa534e8bbbcf38 /asn1/rua
parentc0e8e5c567eb094b50c254c9d9d1f89070cca229 (diff)
Add generated code for RUA using eurecom asn1tostruct.py
Diffstat (limited to 'asn1/rua')
-rw-r--r--asn1/rua/eurecom/rua_decoder.c390
-rw-r--r--asn1/rua/eurecom/rua_encoder.c216
-rw-r--r--asn1/rua/eurecom/rua_ies_defs.h175
3 files changed, 781 insertions, 0 deletions
diff --git a/asn1/rua/eurecom/rua_decoder.c b/asn1/rua/eurecom/rua_decoder.c
new file mode 100644
index 0000000..521ecab
--- /dev/null
+++ b/asn1/rua/eurecom/rua_decoder.c
@@ -0,0 +1,390 @@
+/*******************************************************************************
+
+ Eurecom OpenAirInterface
+ Copyright(c) 1999 - 2012 Eurecom
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+ The full GNU General Public License is included in this distribution in
+ the file called "COPYING".
+
+ Contact Information
+ Openair Admin: openair_admin@eurecom.fr
+ Openair Tech : openair_tech@eurecom.fr
+ Forums : http://forums.eurecom.fr/openairinterface
+ Address : EURECOM, Campus SophiaTech, 450 Route des Chappes
+ 06410 Biot FRANCE
+
+*******************************************************************************/
+
+/*******************************************************************************
+ * This file had been created by asn1tostruct.py script v0.5
+ * Please do not modify this file but regenerate it via script.
+ * Created on: 2015-08-29 14:31:31.109013 by laforge
+ * from ['../RUA-CommonDataTypes.asn', '../RUA-Constants.asn', '../RUA-Containers.asn', '../RUA-IEs.asn', '../RUA-PDU-Contents.asn', '../RUA-PDU-Descriptions.asn']
+ ******************************************************************************/
+#include "rua_common.h"
+#include "rua_ies_defs.h"
+
+int rua_decode_connecties(
+ ConnectIEs_t *connectIEs,
+ ANY_t *any_p) {
+
+ Connect_t connect;
+ Connect_t *connect_p = &connect;
+ int i, decoded = 0;
+ int tempDecoded = 0;
+ assert(any_p != NULL);
+ assert(connectIEs != NULL);
+
+ RUA_DEBUG("Decoding message ConnectIEs (%s:%d)\n", __FILE__, __LINE__);
+
+ ANY_to_type_aper(any_p, &asn_DEF_Connect, (void**)&connect_p);
+
+ for (i = 0; i < connect_p->connect_ies.list.count; i++) {
+ IE_t *ie_p;
+ ie_p = connect_p->connect_ies.list.array[i];
+ switch(ie_p->id) {
+ case ProtocolIE_ID_id_CN_DomainIndicator:
+ {
+ CN_DomainIndicator_t cnDomainIndicator;
+ CN_DomainIndicator_t *cnDomainIndicator_p = &cnDomainIndicator;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_CN_DomainIndicator, (void**)&cnDomainIndicator_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE cN_DomainIndicator failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_CN_DomainIndicator, cnDomainIndicator_p);
+ memcpy(&connectIEs->cN_DomainIndicator, cnDomainIndicator_p, sizeof(CN_DomainIndicator_t));
+ } break;
+ case ProtocolIE_ID_id_Context_ID:
+ {
+ Context_ID_t contextID;
+ Context_ID_t *contextID_p = &contextID;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Context_ID, (void**)&contextID_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE context_ID failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Context_ID, contextID_p);
+ memcpy(&connectIEs->context_ID, contextID_p, sizeof(Context_ID_t));
+ } break;
+ /* Optional field */
+ case ProtocolIE_ID_id_IntraDomainNasNodeSelector:
+ {
+ IntraDomainNasNodeSelector_t intraDomainNasNodeSelector;
+ IntraDomainNasNodeSelector_t *intraDomainNasNodeSelector_p = &intraDomainNasNodeSelector;
+ connectIEs->presenceMask |= CONNECTIES_INTRADOMAINNASNODESELECTOR_PRESENT;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_IntraDomainNasNodeSelector, (void**)&intraDomainNasNodeSelector_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE intraDomainNasNodeSelector failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_IntraDomainNasNodeSelector, intraDomainNasNodeSelector_p);
+ memcpy(&connectIEs->intraDomainNasNodeSelector, intraDomainNasNodeSelector_p, sizeof(IntraDomainNasNodeSelector_t));
+ } break;
+ case ProtocolIE_ID_id_Establishment_Cause:
+ {
+ Establishment_Cause_t establishmentCause;
+ Establishment_Cause_t *establishmentCause_p = &establishmentCause;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Establishment_Cause, (void**)&establishmentCause_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE establishment_Cause failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Establishment_Cause, establishmentCause_p);
+ memcpy(&connectIEs->establishment_Cause, establishmentCause_p, sizeof(Establishment_Cause_t));
+ } break;
+ case ProtocolIE_ID_id_RANAP_Message:
+ {
+ RANAP_Message_t ranapMessage;
+ RANAP_Message_t *ranapMessage_p = &ranapMessage;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_RANAP_Message, (void**)&ranapMessage_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE ranaP_Message failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_Message, ranapMessage_p);
+ memcpy(&connectIEs->ranaP_Message, ranapMessage_p, sizeof(RANAP_Message_t));
+ } break;
+ default:
+ RUA_DEBUG("Unknown protocol IE id (%d) for message connecties\n", (int)ie_p->id);
+ return -1;
+ }
+ }
+ return decoded;
+}
+
+int rua_decode_disconnecties(
+ DisconnectIEs_t *disconnectIEs,
+ ANY_t *any_p) {
+
+ Disconnect_t disconnect;
+ Disconnect_t *disconnect_p = &disconnect;
+ int i, decoded = 0;
+ int tempDecoded = 0;
+ assert(any_p != NULL);
+ assert(disconnectIEs != NULL);
+
+ RUA_DEBUG("Decoding message DisconnectIEs (%s:%d)\n", __FILE__, __LINE__);
+
+ ANY_to_type_aper(any_p, &asn_DEF_Disconnect, (void**)&disconnect_p);
+
+ for (i = 0; i < disconnect_p->disconnect_ies.list.count; i++) {
+ IE_t *ie_p;
+ ie_p = disconnect_p->disconnect_ies.list.array[i];
+ switch(ie_p->id) {
+ case ProtocolIE_ID_id_CN_DomainIndicator:
+ {
+ CN_DomainIndicator_t cnDomainIndicator;
+ CN_DomainIndicator_t *cnDomainIndicator_p = &cnDomainIndicator;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_CN_DomainIndicator, (void**)&cnDomainIndicator_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE cN_DomainIndicator failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_CN_DomainIndicator, cnDomainIndicator_p);
+ memcpy(&disconnectIEs->cN_DomainIndicator, cnDomainIndicator_p, sizeof(CN_DomainIndicator_t));
+ } break;
+ case ProtocolIE_ID_id_Context_ID:
+ {
+ Context_ID_t contextID;
+ Context_ID_t *contextID_p = &contextID;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Context_ID, (void**)&contextID_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE context_ID failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Context_ID, contextID_p);
+ memcpy(&disconnectIEs->context_ID, contextID_p, sizeof(Context_ID_t));
+ } break;
+ case ProtocolIE_ID_id_Cause:
+ {
+ Cause_t cause;
+ Cause_t *cause_p = &cause;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Cause, (void**)&cause_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE cause failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Cause, cause_p);
+ memcpy(&disconnectIEs->cause, cause_p, sizeof(Cause_t));
+ } break;
+ /* Conditional field */
+ case ProtocolIE_ID_id_RANAP_Message:
+ {
+ RANAP_Message_t ranapMessage;
+ RANAP_Message_t *ranapMessage_p = &ranapMessage;
+ disconnectIEs->presenceMask |= DISCONNECTIES_RANAP_MESSAGE_PRESENT;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_RANAP_Message, (void**)&ranapMessage_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE ranaP_Message failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_Message, ranapMessage_p);
+ memcpy(&disconnectIEs->ranaP_Message, ranapMessage_p, sizeof(RANAP_Message_t));
+ } break;
+ default:
+ RUA_DEBUG("Unknown protocol IE id (%d) for message disconnecties\n", (int)ie_p->id);
+ return -1;
+ }
+ }
+ return decoded;
+}
+
+int rua_decode_errorindicationies(
+ ErrorIndicationIEs_t *errorIndicationIEs,
+ ANY_t *any_p) {
+
+ ErrorIndication_t errorIndication;
+ ErrorIndication_t *errorIndication_p = &errorIndication;
+ int i, decoded = 0;
+ int tempDecoded = 0;
+ assert(any_p != NULL);
+ assert(errorIndicationIEs != NULL);
+
+ RUA_DEBUG("Decoding message ErrorIndicationIEs (%s:%d)\n", __FILE__, __LINE__);
+
+ ANY_to_type_aper(any_p, &asn_DEF_ErrorIndication, (void**)&errorIndication_p);
+
+ for (i = 0; i < errorIndication_p->errorIndication_ies.list.count; i++) {
+ IE_t *ie_p;
+ ie_p = errorIndication_p->errorIndication_ies.list.array[i];
+ switch(ie_p->id) {
+ case ProtocolIE_ID_id_Cause:
+ {
+ Cause_t cause;
+ Cause_t *cause_p = &cause;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Cause, (void**)&cause_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE cause failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Cause, cause_p);
+ memcpy(&errorIndicationIEs->cause, cause_p, sizeof(Cause_t));
+ } break;
+ /* Optional field */
+ case ProtocolIE_ID_id_CriticalityDiagnostics:
+ {
+ CriticalityDiagnostics_t criticalityDiagnostics;
+ CriticalityDiagnostics_t *criticalityDiagnostics_p = &criticalityDiagnostics;
+ errorIndicationIEs->presenceMask |= ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_CriticalityDiagnostics, (void**)&criticalityDiagnostics_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE criticalityDiagnostics failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_CriticalityDiagnostics, criticalityDiagnostics_p);
+ memcpy(&errorIndicationIEs->criticalityDiagnostics, criticalityDiagnostics_p, sizeof(CriticalityDiagnostics_t));
+ } break;
+ default:
+ RUA_DEBUG("Unknown protocol IE id (%d) for message errorindicationies\n", (int)ie_p->id);
+ return -1;
+ }
+ }
+ return decoded;
+}
+
+int rua_decode_connectionlesstransferies(
+ ConnectionlessTransferIEs_t *connectionlessTransferIEs,
+ ANY_t *any_p) {
+
+ ConnectionlessTransfer_t connectionlessTransfer;
+ ConnectionlessTransfer_t *connectionlessTransfer_p = &connectionlessTransfer;
+ int i, decoded = 0;
+ int tempDecoded = 0;
+ assert(any_p != NULL);
+ assert(connectionlessTransferIEs != NULL);
+
+ RUA_DEBUG("Decoding message ConnectionlessTransferIEs (%s:%d)\n", __FILE__, __LINE__);
+
+ ANY_to_type_aper(any_p, &asn_DEF_ConnectionlessTransfer, (void**)&connectionlessTransfer_p);
+
+ for (i = 0; i < connectionlessTransfer_p->connectionlessTransfer_ies.list.count; i++) {
+ IE_t *ie_p;
+ ie_p = connectionlessTransfer_p->connectionlessTransfer_ies.list.array[i];
+ switch(ie_p->id) {
+ case ProtocolIE_ID_id_RANAP_Message:
+ {
+ RANAP_Message_t ranapMessage;
+ RANAP_Message_t *ranapMessage_p = &ranapMessage;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_RANAP_Message, (void**)&ranapMessage_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE ranaP_Message failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_Message, ranapMessage_p);
+ memcpy(&connectionlessTransferIEs->ranaP_Message, ranapMessage_p, sizeof(RANAP_Message_t));
+ } break;
+ default:
+ RUA_DEBUG("Unknown protocol IE id (%d) for message connectionlesstransferies\n", (int)ie_p->id);
+ return -1;
+ }
+ }
+ return decoded;
+}
+
+int rua_decode_directtransferies(
+ DirectTransferIEs_t *directTransferIEs,
+ ANY_t *any_p) {
+
+ DirectTransfer_t directTransfer;
+ DirectTransfer_t *directTransfer_p = &directTransfer;
+ int i, decoded = 0;
+ int tempDecoded = 0;
+ assert(any_p != NULL);
+ assert(directTransferIEs != NULL);
+
+ RUA_DEBUG("Decoding message DirectTransferIEs (%s:%d)\n", __FILE__, __LINE__);
+
+ ANY_to_type_aper(any_p, &asn_DEF_DirectTransfer, (void**)&directTransfer_p);
+
+ for (i = 0; i < directTransfer_p->directTransfer_ies.list.count; i++) {
+ IE_t *ie_p;
+ ie_p = directTransfer_p->directTransfer_ies.list.array[i];
+ switch(ie_p->id) {
+ case ProtocolIE_ID_id_CN_DomainIndicator:
+ {
+ CN_DomainIndicator_t cnDomainIndicator;
+ CN_DomainIndicator_t *cnDomainIndicator_p = &cnDomainIndicator;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_CN_DomainIndicator, (void**)&cnDomainIndicator_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE cN_DomainIndicator failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_CN_DomainIndicator, cnDomainIndicator_p);
+ memcpy(&directTransferIEs->cN_DomainIndicator, cnDomainIndicator_p, sizeof(CN_DomainIndicator_t));
+ } break;
+ case ProtocolIE_ID_id_Context_ID:
+ {
+ Context_ID_t contextID;
+ Context_ID_t *contextID_p = &contextID;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_Context_ID, (void**)&contextID_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE context_ID failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_Context_ID, contextID_p);
+ memcpy(&directTransferIEs->context_ID, contextID_p, sizeof(Context_ID_t));
+ } break;
+ case ProtocolIE_ID_id_RANAP_Message:
+ {
+ RANAP_Message_t ranapMessage;
+ RANAP_Message_t *ranapMessage_p = &ranapMessage;
+ tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_RANAP_Message, (void**)&ranapMessage_p);
+ if (tempDecoded < 0) {
+ RUA_DEBUG("Decoding of IE ranaP_Message failed\n");
+ return -1;
+ }
+ decoded += tempDecoded;
+ if (asn1_xer_print)
+ xer_fprint(stdout, &asn_DEF_RANAP_Message, ranapMessage_p);
+ memcpy(&directTransferIEs->ranaP_Message, ranapMessage_p, sizeof(RANAP_Message_t));
+ } break;
+ default:
+ RUA_DEBUG("Unknown protocol IE id (%d) for message directtransferies\n", (int)ie_p->id);
+ return -1;
+ }
+ }
+ return decoded;
+}
+
diff --git a/asn1/rua/eurecom/rua_encoder.c b/asn1/rua/eurecom/rua_encoder.c
new file mode 100644
index 0000000..56d0f33
--- /dev/null
+++ b/asn1/rua/eurecom/rua_encoder.c
@@ -0,0 +1,216 @@
+/*******************************************************************************
+
+ Eurecom OpenAirInterface
+ Copyright(c) 1999 - 2012 Eurecom
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+ The full GNU General Public License is included in this distribution in
+ the file called "COPYING".
+
+ Contact Information
+ Openair Admin: openair_admin@eurecom.fr
+ Openair Tech : openair_tech@eurecom.fr
+ Forums : http://forums.eurecom.fr/openairinterface
+ Address : EURECOM, Campus SophiaTech, 450 Route des Chappes
+ 06410 Biot FRANCE
+
+*******************************************************************************/
+
+/*******************************************************************************
+ * This file had been created by asn1tostruct.py script v0.5
+ * Please do not modify this file but regenerate it via script.
+ * Created on: 2015-08-29 14:31:31.110934 by laforge
+ * from ['../RUA-CommonDataTypes.asn', '../RUA-Constants.asn', '../RUA-Containers.asn', '../RUA-IEs.asn', '../RUA-PDU-Contents.asn', '../RUA-PDU-Descriptions.asn']
+ ******************************************************************************/
+#include "rua_common.h"
+#include "rua_ies_defs.h"
+
+int rua_encode_connecties(
+ Connect_t *connect,
+ ConnectIEs_t *connectIEs) {
+
+ IE_t *ie;
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_CN_DomainIndicator,
+ Criticality_reject,
+ &asn_DEF_CN_DomainIndicator,
+ &connectIEs->cN_DomainIndicator)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connect->connect_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Context_ID,
+ Criticality_reject,
+ &asn_DEF_Context_ID,
+ &connectIEs->context_ID)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connect->connect_ies.list, ie);
+
+ /* Optional field */
+ if ((connectIEs->presenceMask & CONNECTIES_INTRADOMAINNASNODESELECTOR_PRESENT)
+ == CONNECTIES_INTRADOMAINNASNODESELECTOR_PRESENT) {
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_IntraDomainNasNodeSelector,
+ Criticality_ignore,
+ &asn_DEF_IntraDomainNasNodeSelector,
+ &connectIEs->intraDomainNasNodeSelector)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connect->connect_ies.list, ie);
+ }
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Establishment_Cause,
+ Criticality_reject,
+ &asn_DEF_Establishment_Cause,
+ &connectIEs->establishment_Cause)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connect->connect_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_RANAP_Message,
+ Criticality_reject,
+ &asn_DEF_RANAP_Message,
+ &connectIEs->ranaP_Message)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connect->connect_ies.list, ie);
+
+ return 0;
+}
+
+int rua_encode_disconnecties(
+ Disconnect_t *disconnect,
+ DisconnectIEs_t *disconnectIEs) {
+
+ IE_t *ie;
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_CN_DomainIndicator,
+ Criticality_reject,
+ &asn_DEF_CN_DomainIndicator,
+ &disconnectIEs->cN_DomainIndicator)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&disconnect->disconnect_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Context_ID,
+ Criticality_reject,
+ &asn_DEF_Context_ID,
+ &disconnectIEs->context_ID)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&disconnect->disconnect_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Cause,
+ Criticality_reject,
+ &asn_DEF_Cause,
+ &disconnectIEs->cause)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&disconnect->disconnect_ies.list, ie);
+
+ /* Conditional field */
+ if ((disconnectIEs->presenceMask & DISCONNECTIES_RANAP_MESSAGE_PRESENT)
+ == DISCONNECTIES_RANAP_MESSAGE_PRESENT) {
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_RANAP_Message,
+ Criticality_reject,
+ &asn_DEF_RANAP_Message,
+ &disconnectIEs->ranaP_Message)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&disconnect->disconnect_ies.list, ie);
+ }
+
+ return 0;
+}
+
+int rua_encode_errorindicationies(
+ ErrorIndication_t *errorIndication,
+ ErrorIndicationIEs_t *errorIndicationIEs) {
+
+ IE_t *ie;
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Cause,
+ Criticality_ignore,
+ &asn_DEF_Cause,
+ &errorIndicationIEs->cause)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&errorIndication->errorIndication_ies.list, ie);
+
+ /* Optional field */
+ if ((errorIndicationIEs->presenceMask & ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT)
+ == ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT) {
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_CriticalityDiagnostics,
+ Criticality_ignore,
+ &asn_DEF_CriticalityDiagnostics,
+ &errorIndicationIEs->criticalityDiagnostics)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&errorIndication->errorIndication_ies.list, ie);
+ }
+
+ return 0;
+}
+
+int rua_encode_connectionlesstransferies(
+ ConnectionlessTransfer_t *connectionlessTransfer,
+ ConnectionlessTransferIEs_t *connectionlessTransferIEs) {
+
+ IE_t *ie;
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_RANAP_Message,
+ Criticality_reject,
+ &asn_DEF_RANAP_Message,
+ &connectionlessTransferIEs->ranaP_Message)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&connectionlessTransfer->connectionlessTransfer_ies.list, ie);
+
+ return 0;
+}
+
+int rua_encode_directtransferies(
+ DirectTransfer_t *directTransfer,
+ DirectTransferIEs_t *directTransferIEs) {
+
+ IE_t *ie;
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_CN_DomainIndicator,
+ Criticality_reject,
+ &asn_DEF_CN_DomainIndicator,
+ &directTransferIEs->cN_DomainIndicator)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&directTransfer->directTransfer_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_Context_ID,
+ Criticality_reject,
+ &asn_DEF_Context_ID,
+ &directTransferIEs->context_ID)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&directTransfer->directTransfer_ies.list, ie);
+
+ if ((ie = rua_new_ie(ProtocolIE_ID_id_RANAP_Message,
+ Criticality_reject,
+ &asn_DEF_RANAP_Message,
+ &directTransferIEs->ranaP_Message)) == NULL) {
+ return -1;
+ }
+ ASN_SEQUENCE_ADD(&directTransfer->directTransfer_ies.list, ie);
+
+ return 0;
+}
+
diff --git a/asn1/rua/eurecom/rua_ies_defs.h b/asn1/rua/eurecom/rua_ies_defs.h
new file mode 100644
index 0000000..da5fc6f
--- /dev/null
+++ b/asn1/rua/eurecom/rua_ies_defs.h
@@ -0,0 +1,175 @@
+/*******************************************************************************
+
+ Eurecom OpenAirInterface
+ Copyright(c) 1999 - 2012 Eurecom
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms and conditions of the GNU General Public License,
+ version 2, as published by the Free Software Foundation.
+
+ This program is distributed in the hope it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+
+ The full GNU General Public License is included in this distribution in
+ the file called "COPYING".
+
+ Contact Information
+ Openair Admin: openair_admin@eurecom.fr
+ Openair Tech : openair_tech@eurecom.fr
+ Forums : http://forums.eurecom.fr/openairinterface
+ Address : EURECOM, Campus SophiaTech, 450 Route des Chappes
+ 06410 Biot FRANCE
+
+*******************************************************************************/
+
+/*******************************************************************************
+ * This file had been created by asn1tostruct.py script v0.5
+ * Please do not modify this file but regenerate it via script.
+ * Created on: 2015-08-29 14:31:31.107080 by laforge
+ * from ['../RUA-CommonDataTypes.asn', '../RUA-Constants.asn', '../RUA-Containers.asn', '../RUA-IEs.asn', '../RUA-PDU-Contents.asn', '../RUA-PDU-Descriptions.asn']
+ ******************************************************************************/
+#include "rua_common.h"
+
+#ifndef RUA_IES_DEFS_H_
+#define RUA_IES_DEFS_H_
+
+#define CONNECTIES_INTRADOMAINNASNODESELECTOR_PRESENT (1 << 0)
+
+typedef struct ConnectIEs_s {
+ uint16_t presenceMask;
+ CN_DomainIndicator_t cN_DomainIndicator;
+ Context_ID_t context_ID;
+ IntraDomainNasNodeSelector_t intraDomainNasNodeSelector; ///< Optional field
+ Establishment_Cause_t establishment_Cause;
+ RANAP_Message_t ranaP_Message;
+} ConnectIEs_t;
+
+#define DISCONNECTIES_RANAP_MESSAGE_PRESENT (1 << 0)
+
+typedef struct DisconnectIEs_s {
+ uint16_t presenceMask;
+ CN_DomainIndicator_t cN_DomainIndicator;
+ Context_ID_t context_ID;
+ Cause_t cause;
+ RANAP_Message_t ranaP_Message; ///< Conditional field
+} DisconnectIEs_t;
+
+#define ERRORINDICATIONIES_CRITICALITYDIAGNOSTICS_PRESENT (1 << 0)
+
+typedef struct ErrorIndicationIEs_s {
+ uint16_t presenceMask;
+ Cause_t cause;
+ CriticalityDiagnostics_t criticalityDiagnostics; ///< Optional field
+} ErrorIndicationIEs_t;
+
+typedef struct ConnectionlessTransferIEs_s {
+ RANAP_Message_t ranaP_Message;
+} ConnectionlessTransferIEs_t;
+
+typedef struct DirectTransferIEs_s {
+ CN_DomainIndicator_t cN_DomainIndicator;
+ Context_ID_t context_ID;
+ RANAP_Message_t ranaP_Message;
+} DirectTransferIEs_t;
+
+typedef struct rua_message_s {
+ uint8_t procedureCode;
+ uint8_t criticality;
+ uint8_t direction;
+ union {
+ ConnectIEs_t connectIEs;
+ ConnectionlessTransferIEs_t connectionlessTransferIEs;
+ DirectTransferIEs_t directTransferIEs;
+ DisconnectIEs_t disconnectIEs;
+ ErrorIndicationIEs_t errorIndicationIEs;
+ } msg;
+} rua_message;
+
+/** \brief Decode function for ConnectIEs ies.
+ * \param connectIEs Pointer to ASN1 structure in which data will be stored
+ * \param any_p Pointer to the ANY value to decode.
+ **/
+int rua_decode_connecties(
+ ConnectIEs_t *connectIEs,
+ ANY_t *any_p);
+
+/** \brief Encode function for ConnectIEs ies.
+ * \param connect Pointer to the ASN1 structure.
+ * \param connectIEs Pointer to the IES structure.
+ **/
+int rua_encode_connecties(
+ Connect_t *connect,
+ ConnectIEs_t *connectIEs);
+
+/** \brief Decode function for DisconnectIEs ies.
+ * \param disconnectIEs Pointer to ASN1 structure in which data will be stored
+ * \param any_p Pointer to the ANY value to decode.
+ **/
+int rua_decode_disconnecties(
+ DisconnectIEs_t *disconnectIEs,
+ ANY_t *any_p);
+
+/** \brief Encode function for DisconnectIEs ies.
+ * \param disconnect Pointer to the ASN1 structure.
+ * \param disconnectIEs Pointer to the IES structure.
+ **/
+int rua_encode_disconnecties(
+ Disconnect_t *disconnect,
+ DisconnectIEs_t *disconnectIEs);
+
+/** \brief Decode function for ErrorIndicationIEs ies.
+ * \param errorIndicationIEs Pointer to ASN1 structure in which data will be stored
+ * \param any_p Pointer to the ANY value to decode.
+ **/
+int rua_decode_errorindicationies(
+ ErrorIndicationIEs_t *errorIndicationIEs,
+ ANY_t *any_p);
+
+/** \brief Encode function for ErrorIndicationIEs ies.
+ * \param errorIndication Pointer to the ASN1 structure.
+ * \param errorIndicationIEs Pointer to the IES structure.
+ **/
+int rua_encode_errorindicationies(
+ ErrorIndication_t *errorIndication,
+ ErrorIndicationIEs_t *errorIndicationIEs);
+
+/** \brief Decode function for ConnectionlessTransferIEs ies.
+ * \param connectionlessTransferIEs Pointer to ASN1 structure in which data will be stored
+ * \param any_p Pointer to the ANY value to decode.
+ **/
+int rua_decode_connectionlesstransferies(
+ ConnectionlessTransferIEs_t *connectionlessTransferIEs,
+ ANY_t *any_p);
+
+/** \brief Encode function for ConnectionlessTransferIEs ies.
+ * \param connectionlessTransfer Pointer to the ASN1 structure.
+ * \param connectionlessTransferIEs Pointer to the IES structure.
+ **/
+int rua_encode_connectionlesstransferies(
+ ConnectionlessTransfer_t *connectionlessTransfer,
+ ConnectionlessTransferIEs_t *connectionlessTransferIEs);
+
+/** \brief Decode function for DirectTransferIEs ies.
+ * \param directTransferIEs Pointer to ASN1 structure in which data will be stored
+ * \param any_p Pointer to the ANY value to decode.
+ **/
+int rua_decode_directtransferies(
+ DirectTransferIEs_t *directTransferIEs,
+ ANY_t *any_p);
+
+/** \brief Encode function for DirectTransferIEs ies.
+ * \param directTransfer Pointer to the ASN1 structure.
+ * \param directTransferIEs Pointer to the IES structure.
+ **/
+int rua_encode_directtransferies(
+ DirectTransfer_t *directTransfer,
+ DirectTransferIEs_t *directTransferIEs);
+
+#endif /* RUA_IES_DEFS_H_ */
+