RIC-867: Submgr adaptations to E2APv2.0

Change-Id: I334332d4564ecb7eb01e75d39d702f3ee2f3bf09
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
diff --git a/e2ap/libe2ap_wrapper/E2AP_if.c b/e2ap/libe2ap_wrapper/E2AP_if.c
index fe0d5d5..4a2a018 100644
--- a/e2ap/libe2ap_wrapper/E2AP_if.c
+++ b/e2ap/libe2ap_wrapper/E2AP_if.c
@@ -323,7 +323,7 @@
                         pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.ricActionID =
                           pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID;
 
-                        // RICCause
+                        // Cause
                         if (pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_ricRequest) {
                             pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_ricRequest;
                             pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricRequest =
@@ -334,6 +334,11 @@
                             pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricService =
                               pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
                         }
+                        else if (pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_e2Node) {
+                            pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_e2Node;
+                            pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.e2Node =
+                              pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
+                        }
                         else if (pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_transport) {
                             pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_transport;
                             pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.transport =
@@ -403,63 +408,46 @@
         else
             return e2err_RICSubscriptionFailureAllocRANfunctionIDFail;
 
-        // RICaction-NotAdmitted list
+        // Cause
         pRICsubscriptionFailure_IEs = calloc(1, sizeof(RICsubscriptionFailure_IEs_t));
         if (pRICsubscriptionFailure_IEs) {
-            pRICsubscriptionFailure_IEs->id = ProtocolIE_ID_id_RICactions_NotAdmitted;
+            pRICsubscriptionFailure_IEs->id = ProtocolIE_ID_id_Cause;
             pRICsubscriptionFailure_IEs->criticality = Criticality_reject;
-            pRICsubscriptionFailure_IEs->value.present = RICsubscriptionFailure_IEs__value_PR_RICaction_NotAdmitted_List;
-
-            uint64_t index = 0;
-            while (index < pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength && index < maxofRICactionID) {
-
-                RICaction_NotAdmitted_ItemIEs_t* pRICaction_NotAdmitted_ItemIEs = calloc(1, sizeof (RICaction_NotAdmitted_ItemIEs_t));
-                if (pRICaction_NotAdmitted_ItemIEs)
-                {
-                    pRICaction_NotAdmitted_ItemIEs->id = ProtocolIE_ID_id_RICaction_NotAdmitted_Item;
-                    pRICaction_NotAdmitted_ItemIEs->criticality = Criticality_reject;
-                    pRICaction_NotAdmitted_ItemIEs->value.present = RICaction_NotAdmitted_ItemIEs__value_PR_RICaction_NotAdmitted_Item;
-
-                    // RICActionID
-                    pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.ricActionID =
-                      pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID;
-
-                    // RICCause
-                    if (pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_ricRequest) {
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_ricRequest;
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricRequest =
-                          pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
-                    }
-                    else if (pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_ricService) {
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_ricService;
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricService =
-                          pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
-                    }
-                    else if (pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_transport) {
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_transport;
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.transport =
-                          pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
-                    }
-                    else if (pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_protocol) {
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_protocol;
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.protocol =
-                          pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
-                    }
-                    else if (pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content == Cause_PR_misc) {
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present = Cause_PR_misc;
-                        pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.misc =
-                          pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal;
-                    }
-                    ASN_SEQUENCE_ADD(&pRICsubscriptionFailure_IEs->value.choice.RICaction_NotAdmitted_List.list, pRICaction_NotAdmitted_ItemIEs);
-                }
-                else
-                    return e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail;
-                index++;
+            pRICsubscriptionFailure_IEs->value.present = RICsubscriptionFailure_IEs__value_PR_Cause;
+            if (pRICSubscriptionFailure->cause.content == Cause_PR_ricRequest) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_ricRequest;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.ricRequest =
+                  pRICSubscriptionFailure->cause.causeVal;
+            }
+            else if (pRICSubscriptionFailure->cause.content == Cause_PR_ricService) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_ricService;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.ricService =
+                  pRICSubscriptionFailure->cause.causeVal;
+            }
+            else if (pRICSubscriptionFailure->cause.content == Cause_PR_e2Node) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_e2Node;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.e2Node =
+                  pRICSubscriptionFailure->cause.causeVal;
+            }
+            else if (pRICSubscriptionFailure->cause.content == Cause_PR_transport) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_transport;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.transport =
+                  pRICSubscriptionFailure->cause.causeVal;
+            }
+            else if (pRICSubscriptionFailure->cause.content == Cause_PR_protocol) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_protocol;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.protocol =
+                  pRICSubscriptionFailure->cause.causeVal;
+            }
+            else if (pRICSubscriptionFailure->cause.content == Cause_PR_misc) {
+                pRICsubscriptionFailure_IEs->value.choice.Cause.present = Cause_PR_misc;
+                pRICsubscriptionFailure_IEs->value.choice.Cause.choice.misc =
+                  pRICSubscriptionFailure->cause.causeVal;
             }
             ASN_SEQUENCE_ADD(&pE2AP_PDU->choice.unsuccessfulOutcome.value.choice.RICsubscriptionFailure.protocolIEs.list, pRICsubscriptionFailure_IEs);
         }
         else
-            return e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail;
+            return e2err_RICSubscriptionFailureAllocCauseFail;
 
         // CriticalityDiagnostics, OPTIONAL. Not used in RIC
 
@@ -597,7 +585,7 @@
         else
             return e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail;
 
-        // RICcause
+        // Cause
         pRICsubscriptionDeleteFailure_IEs = calloc(1, sizeof(RICsubscriptionDeleteFailure_IEs_t));
         if (pRICsubscriptionDeleteFailure_IEs) {
             pRICsubscriptionDeleteFailure_IEs->id = ProtocolIE_ID_id_Cause;
@@ -613,6 +601,11 @@
                 pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.choice.ricService =
                   pRICSubscriptionDeleteFailure->cause.causeVal;
             }
+            else if (pRICSubscriptionDeleteFailure->cause.content == Cause_PR_e2Node) {
+                pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.present = Cause_PR_e2Node;
+                pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.choice.e2Node =
+                  pRICSubscriptionDeleteFailure->cause.causeVal;
+            }
             else if (pRICSubscriptionDeleteFailure->cause.content == Cause_PR_transport) {
                 pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.present = Cause_PR_transport;
                 pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.choice.transport =
@@ -920,7 +913,7 @@
                 pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID =
                   pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.ricActionID;
 
-                //  RICcause
+                //  Cause
                 if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_ricRequest) {
                     pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_ricRequest;
                     pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
@@ -931,6 +924,11 @@
                     pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
                       pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricService;
                 }
+                else if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_e2Node) {
+                    pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_e2Node;
+                    pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
+                      pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.e2Node;
+                }
                 else if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_transport) {
                     pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_transport;
                     pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
@@ -990,56 +988,46 @@
         return e2err_RICsubscriptionFailureRANfunctionIDMissing;
     }
 
-    // RICaction-NotAdmitted-List
+    // Cause
     if (asnRicSubscriptionFailure->protocolIEs.list.count > 2 &&
-        asnRicSubscriptionFailure->protocolIEs.list.array[2]->id == ProtocolIE_ID_id_RICactions_NotAdmitted) {
+        asnRicSubscriptionFailure->protocolIEs.list.array[2]->id == ProtocolIE_ID_id_Cause) {
         pRICsubscriptionFailure_IEs = asnRicSubscriptionFailure->protocolIEs.list.array[2];
-        uint64_t index = 0;
-        while ((index < maxofRICactionID) && (index < pRICsubscriptionFailure_IEs->value.choice.RICaction_NotAdmitted_List.list.count)) {
-            RICaction_NotAdmitted_ItemIEs_t* pRICaction_NotAdmitted_ItemIEs =
-              (RICaction_NotAdmitted_ItemIEs_t*)pRICsubscriptionFailure_IEs->value.choice.RICaction_NotAdmitted_List.list.array[index];
-
-            // RICActionID
-            pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID =
-              pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.ricActionID;
-
-            //  RICcause
-            if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_ricRequest) {
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_ricRequest;
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
-                  pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricRequest;
-            }
-            else if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_ricService) {
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_ricService;
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
-                  pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.ricService;
-            }
-            else if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_transport) {
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_transport;
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
-                  pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.transport;
-            }
-            else if (pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_protocol) {
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_protocol;
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
-                  pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.protocol;
-            }
-            else if(pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.present == Cause_PR_misc) {
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_misc;
-                pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal =
-                  pRICaction_NotAdmitted_ItemIEs->value.choice.RICaction_NotAdmitted_Item.cause.choice.misc;
-            }
-            index++;
+        if (pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_ricRequest) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_ricRequest;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.ricRequest;
         }
-        pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength = index;
-
-        // CriticalityDiagnostics. OPTIONAL
-
+        else if (pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_ricService) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_ricService;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.ricService;
+        }
+        else if (pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_e2Node) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_e2Node;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.e2Node;
+        }
+        else if (pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_transport) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_transport;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.transport;
+        }
+        else if (pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_protocol) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_protocol;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.protocol;
+        }
+        else if(pRICsubscriptionFailure_IEs->value.choice.Cause.present == Cause_PR_misc) {
+            pRICSubscriptionFailure->cause.content = Cause_PR_misc;
+            pRICSubscriptionFailure->cause.causeVal =
+              pRICsubscriptionFailure_IEs->value.choice.Cause.choice.misc;
+        }
     }
     else {
         ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pE2AP_PDU);
-        return e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing;
+        return e2err_RICsubscriptionFailureCauseMissing;
     }
+
     ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pE2AP_PDU);
     return e2err_OK;
 }
@@ -1143,7 +1131,7 @@
         return e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing;
     }
 
-    // RICcause
+    // Cause
     if (asnRicSubscriptionDeleteFailure->protocolIEs.list.count > 2 &&
         asnRicSubscriptionDeleteFailure->protocolIEs.list.array[2]->id == ProtocolIE_ID_id_Cause) {
         pRICsubscriptionDeleteFailure_IEs = asnRicSubscriptionDeleteFailure->protocolIEs.list.array[2];
@@ -1157,6 +1145,11 @@
             pRICSubscriptionDeleteFailure->cause.causeVal =
               pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.choice.ricService;
         }
+        else if (pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.present == Cause_PR_e2Node) {
+            pRICSubscriptionDeleteFailure->cause.content = Cause_PR_e2Node;
+            pRICSubscriptionDeleteFailure->cause.causeVal =
+              pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.choice.e2Node;
+        }
         else if (pRICsubscriptionDeleteFailure_IEs->value.choice.Cause.present == Cause_PR_transport) {
             pRICSubscriptionDeleteFailure->cause.content = Cause_PR_transport;
             pRICSubscriptionDeleteFailure->cause.causeVal =
@@ -1182,4 +1175,3 @@
     ASN_STRUCT_FREE(asn_DEF_E2AP_PDU, pE2AP_PDU);
     return e2err_OK;
 }
-
diff --git a/e2ap/libe2ap_wrapper/E2AP_if.h b/e2ap/libe2ap_wrapper/E2AP_if.h
index c52db2b..2678151 100644
--- a/e2ap/libe2ap_wrapper/E2AP_if.h
+++ b/e2ap/libe2ap_wrapper/E2AP_if.h
@@ -32,16 +32,8 @@
 extern "C" {
 #endif
 
-extern const int cCauseRICRequest;
-extern const int cCauseRICService;
-extern const int cCauseTransport;
-extern const int cCauseProtocol;
-extern const int cCauseMisc;
-
 typedef unsigned char byte;
 
-//extern const int64_t cMaxNrOfErrors;
-
 extern const uint64_t cMaxSizeOfOctetString;
 
 typedef struct { // Octet string in ASN.1 does not have maximum length!
@@ -75,7 +67,6 @@
      RICActionType_policy
 };
 
-
 enum RICSubsequentActionType_t {
 	RICSubsequentActionType_Continue,
 	RICSubsequentActionType_wait
@@ -162,9 +153,6 @@
 
 typedef uint8_t ProcedureCode__t;
 
-
-static const uint64_t cMaxofProtocolIE = 15;
-
 typedef struct {
     OctetString_t octetString;   // This element is E2AP spec format
 } RICEventTriggerDefinition_t;
@@ -179,12 +167,6 @@
 	RICActionID_t ricActionID[16]; // Table size is const cMaxofRICactionID
 } RICActionAdmittedList_t;
 
-extern const int cCauseRIC; // This is content of type CauseRIC_t
-extern const int cCauseRICService; // This is content of type CauseRICservice_t
-extern const int cRICCauseTransport; // This is content of type CauseTransport_t
-extern const int cRICCauseProtocol; // This is content of type CauseProtocol_t
-extern const int cRICCauseMisc; // This is content of type CauseMisc_t
-
 typedef struct {
     uint8_t content; // See above constants
     uint8_t causeVal; // This is type of enum CauseRIC_t
@@ -269,7 +251,7 @@
     e2err_RICSubscriptionFailureAllocRICrequestIDFail,
     e2err_RICSubscriptionFailureAllocRANfunctionIDFail,
     e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail,
-    e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail,
+    e2err_RICSubscriptionFailureAllocCauseFail,
     e2err_RICSubscriptionFailureEncodeFail,
     e2err_RICSubscriptionFailureAllocE2AP_PDUFail,
     e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail,
@@ -293,7 +275,7 @@
     e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing,
     e2err_RICsubscriptionFailureRICrequestIDMissing,
     e2err_RICsubscriptionFailureRANfunctionIDMissing,
-    e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing,
+    e2err_RICsubscriptionFailureCauseMissing,
     e2err_RICsubscriptionDeleteRequestRICrequestIDMissing,
     e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing,
     e2err_RICsubscriptionDeleteResponseRICrequestIDMissing,
@@ -325,7 +307,7 @@
     "e2err_RICSubscriptionFailureAllocRICrequestIDFail",
     "e2err_RICSubscriptionFailureAllocRANfunctionIDFail",
     "e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail",
-    "e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail",
+    "e2err_RICSubscriptionFailureAllocCauseFail",
     "e2err_RICSubscriptionFailureEncodeFail",
     "e2err_RICSubscriptionFailureAllocE2AP_PDUFail",
     "e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail",
@@ -349,7 +331,7 @@
     "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing",
     "e2err_RICsubscriptionFailureRICrequestIDMissing",
     "e2err_RICsubscriptionFailureRANfunctionIDMissing",
-    "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing",
+    "e2err_RICsubscriptionFailureCauseMissing",
     "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing",
     "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing",
     "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing",
@@ -403,7 +385,7 @@
 typedef struct {
     RICRequestID_t ricRequestID;
     RANFunctionID_t ranFunctionID;
-    RICActionNotAdmittedList_t ricActionNotAdmittedList;
+    RICCause_t cause;
     bool criticalityDiagnosticsPresent;
     CriticalityDiagnostics__t criticalityDiagnostics;
 } RICSubscriptionFailure_t;
diff --git a/e2ap/libe2ap_wrapper/E2AP_tests.c b/e2ap/libe2ap_wrapper/E2AP_tests.c
index 6316285..fbe4116 100644
--- a/e2ap/libe2ap_wrapper/E2AP_tests.c
+++ b/e2ap/libe2ap_wrapper/E2AP_tests.c
@@ -17,246 +17,61 @@
 ==================================================================================
 */
 
+
 #if DEBUG
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include "Cause.h"
 #include "E2AP_if.h"
 
 const size_t cDataBufferSize = 2048;
 
-typedef union {
-    uint32_t  nodeID;
-    uint8_t   octets[4];
-} IdOctects_t;
-
-
-
 //////////////////////////////////////////////////////////////////////
 bool TestRICSubscriptionRequest() {
 
     RICSubscriptionRequest_t ricSubscriptionRequest;
-    mem_track_hdr_t dynMemHead;
-    mem_track_init(&dynMemHead);
 
-    printf(" sizeof RICSubscriptionRequest_t = %li\n", sizeof (RICSubscriptionRequest_t));
-
+    // RICrequestID
     ricSubscriptionRequest.ricRequestID.ricRequestorID = 20206;
     ricSubscriptionRequest.ricRequestID.ricInstanceID = 0;
+
+    // RANfunctionID
     ricSubscriptionRequest.ranFunctionID = 3;
 
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength = 0;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent = true;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent = false;
+    // RICsubscriptionDetails
+    // RICeventTriggerDefinition
+    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength = 4;
+    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data[0] = 11;
+    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data[1] = 22;
+    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data[2] = 33;
+    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data[3] = 44;
 
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBIDPresent = true;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalGNBIDPresent = false;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength = 3;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] = 11;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] = 12;
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] = 13;
-
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cMacroENBIDP_20Bits;
-//    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cHomeENBID_28Bits;
-//    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = cShortMacroENBID_18Bits;
-//    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = clongMacroENBIDP_21Bits;
-
-    IdOctects_t eNBOctects;
-    memset(eNBOctects.octets, 0, sizeof(eNBOctects));
-    eNBOctects.octets[0] = 21;
-    eNBOctects.octets[1] = 22;
-    eNBOctects.octets[2] = 30;
-    eNBOctects.octets[3] = 0;
-/*
-    uint64_t i;
-    for (i = 0; i < 3; i++) {
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[i] = (unsigned char)(0x11 + i);
-        eNBOctects.octets[i] = (unsigned char)(0x21 + i);
-        //params.InterfaceId.plmnId[i] =
-        //params.InterfaceId.gnbId[i] = C.uchar(0x21 + i)
-    }
-*/
-    ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
-    printf("eNBOctects.nodeID = %u\n\n",eNBOctects.nodeID);
-
-    if (ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent) {
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceDirection = InterfaceDirection__incoming;
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode = 27;  // id-rRCTransfer
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage = cE2InitiatingMessage;
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceProtocolIEListPresent = false;
-    }
-    else if (ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent)
-        ricSubscriptionRequest.ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBNRTEventTriggerDefinition.eventDefinitionFormat1.triggerNature = NRTTriggerNature_t_now;
-
-    else {
-        printf("EventTrigger IE missing\n");
-        return false;
-    }
-
-
-    char data[3] = {'A','B','C'};
+    // RICactions-ToBeSetup-List
     ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength = 16;  //1..16
     uint64_t index = 0;
     while (index < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength) {
+
+        // RICactionID
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionID = index;
+
+        // RICactionType
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionType = RICActionType_report; //RICActionType_policy;
 
-        // ricActionDefinition, OPTIONAL.
+        // RICactionDefinition, OPTIONAL.
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent = true;  // E2AP
+        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.contentLength = 2;
+        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.data[0] = 1;
+        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.data[1] = 2;
 
-        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present = true; false;  // Choice
-        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present = false; //true;
-        ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present = false;
-
-        if (ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present) {
-            // X2 Format 1
-            if (allocActionDefinitionX2Format1(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1) != e2err_OK)
-                return false;
-            ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterCount = 2;
-
-            uint64_t index2 = 0;
-            while (index2 < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterCount) {
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->styleID = 255;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].parameterID = index2;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueIntPresent = true;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueInt = index2;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnumPresent = false;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnum = 111;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBoolPresent = false;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBool = true;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitSPresent = false;
-                if (!addBitString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS,sizeof(data),data,0)) {
-                    printf("addBitString failure\n");
-                    return false;
-                }
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctSPresent = false; //true;
-                if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS,sizeof(data),data)) {
-                    printf("addOctetString failure\n");
-                    return false;
-                }
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtSPresent = false; //true;
-                if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtS,sizeof(data),data)) {
-                    printf("addOctetString failure\n");
-                    return false;
-                }
-                index2++;
-            }
-        }
-        else if (ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present) {
-            // X2 Format 2
-            if (allocActionDefinitionX2Format2(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2))
-                return false;
-
-            ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupCount = 2;
-
-            uint64_t index2 = 0;
-            while (index2 < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupCount) {
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefCount = 2;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupID = index2;
-
-                uint64_t index3 = 0;
-                while (index3 < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefCount) {
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterID = index3;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterTest = RANParameterTest_equal;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueIntPresent = true;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueInt = index3;
-
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnumPresent = false;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnum = 1;
-
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBoolPresent = false;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBool = false;
-
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitSPresent = false;
-                    if (!addBitString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitS,sizeof(data),data,0)) {
-                        printf("addBitString failure\n");
-                        return false;
-                    }
-
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctSPresent = false; //true;
-                    if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctS,sizeof(data),data)) {
-                        printf("addOctetString failure\n");
-                        return false;
-                    }
-
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtSPresent = false; //true;
-                    if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtS,sizeof(data),data)) {
-                        printf("addOctetString failure\n");
-                        return false;
-                    }
-                    index3++;
-                }
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterCount = 2;
-
-                index3 = 0;
-                while (index3 < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterCount) {
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterID = index3;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent = true;
-                    ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueInt = index3;
-                    index3++;
-                }
-                index2++;
-            }
-
-        }
-        else if (ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present) {
-
-            // NRT Format 1
-            if (allocActionDefinitionNRTFormat1(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1) != e2err_OK)
-                return false;
-
-            ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterCount = 2;
-
-
-            uint64_t index2 = 0;
-            while (index2 < ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterCount) {
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterID = index2;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueIntPresent = false; //true;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueInt = index2;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnumPresent = false; //true;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnum = 100;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBoolPresent = false; //true;
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBool = true;
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitSPresent = true;
-                if (!addBitString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS,sizeof(data),data,0)) {
-                    printf("addBitString failure\n");
-                    return false;
-                }
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctSPresent = false; //true;
-                if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS,sizeof(data),data)) {
-                    printf("addOctetString failure\n");
-                    return false;
-                }
-
-                ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtSPresent = false; //true;
-                if (!addOctetString(&dynMemHead,&ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS,sizeof(data),data)) {
-                    printf("addOctetString failure\n");
-                    return false;
-                }
-                index2++;
-            }
-        }
-        // ricSubsequentActionPresent, OPTIONAL
+        // RICsubsequentAction, OPTIONAL
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent = true;  // E2AP
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType = RICSubsequentActionType_Continue;
         ricSubscriptionRequest.ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricTimeToWait = RICTimeToWait_zero;
         index++;
     }
 
-    printf(" sizeof RICSubscriptionRequest_t = %li\n", sizeof (RICSubscriptionRequest_t));
-
     printRICSubscriptionRequest(&ricSubscriptionRequest);
 
     uint64_t logBufferSize = 1024;
@@ -268,19 +83,12 @@
         memset(&ricSubscriptionRequest,0, sizeof (RICSubscriptionRequest_t));
         uint64_t returnCode;
         E2MessageInfo_t messageInfo;
-
-//    char testBuffer[] = {0x00,0xc9,0x00,0x21,0x00,0x00,0x03,0xea,0x7e,0x00,0x05,0x00,0x88,0x88,0x99,0x99,0xea,0x63,0x00,0x02,0x00,0x02,0xea,0x81,0x00,0x0b,0x00,0x01,0x00,0x00,0xea,0x6b,0x00,0x03,0x00,0x00,0x00};
-//    memcpy(&ricSubscriptionRequest,&testBuffer,sizeof testBuffer);
-//        e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(sizeof testBuffer, (byte*)testBuffer, logBuffer, &messageInfo);
-
-
         e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
         if (pE2AP_PDU != 0) {
             if (messageInfo.messageType == cE2InitiatingMessage) {
                 if (messageInfo.messageId == cRICSubscriptionRequest) {
-                    if ((returnCode = getRICSubscriptionRequestData(&dynMemHead, pE2AP_PDU, &ricSubscriptionRequest)) == e2err_OK) {
+                    if ((returnCode = getRICSubscriptionRequestData(pE2AP_PDU, &ricSubscriptionRequest)) == e2err_OK) {
                         printRICSubscriptionRequest(&ricSubscriptionRequest);
-                        mem_track_free(&dynMemHead);
                         return true;
                     }
                     else
@@ -298,29 +106,41 @@
     else
         printf("%s",logBuffer);
 
-    mem_track_free(&dynMemHead);
     return false;
 }
 
 //////////////////////////////////////////////////////////////////////
 bool TestRICSubscriptionResponse() {
-    // Test RICSubscribeResponse
+
     RICSubscriptionResponse_t ricSubscriptionResponse;
+
+    // RICrequestID
     ricSubscriptionResponse.ricRequestID.ricRequestorID = 1;
     ricSubscriptionResponse.ricRequestID.ricInstanceID = 22;
+
+    // RANfunctionID
     ricSubscriptionResponse.ranFunctionID = 33;
+
+    // RICaction-Admitted-List
     ricSubscriptionResponse.ricActionAdmittedList.contentLength = 16;
     uint64_t index = 0;
     while (index < ricSubscriptionResponse.ricActionAdmittedList.contentLength) {
+
+        // RICactionID
         ricSubscriptionResponse.ricActionAdmittedList.ricActionID[index] = index;
         index++;
     }
+    // RICaction-NotAdmitted-List, OPTIONAL
     ricSubscriptionResponse.ricActionNotAdmittedListPresent = true;
     ricSubscriptionResponse.ricActionNotAdmittedList.contentLength = 16;
     index = 0;
     while (index < ricSubscriptionResponse.ricActionNotAdmittedList.contentLength) {
+
+        // RICactionID
         ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = index;  //0..255
-        ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = cCauseRICService;
+
+        // Cause
+        ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = Cause_PR_ricService; //cCauseRICService;
         ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal = 2;
         index++;
     }
@@ -363,19 +183,20 @@
 
 //////////////////////////////////////////////////////////////////////
 bool TestRICSubscriptionFailure() {
-    // Test RICSubscribeFailure
+
     RICSubscriptionFailure_t ricSubscriptionFailure;
+
+    // RICrequestID
     ricSubscriptionFailure.ricRequestID.ricRequestorID = 1;
     ricSubscriptionFailure.ricRequestID.ricInstanceID = 22;
+
+    // RANfunctionID
     ricSubscriptionFailure.ranFunctionID = 33;
-    ricSubscriptionFailure.ricActionNotAdmittedList.contentLength = 16;
-    uint64_t index = 0;
-    while (index < ricSubscriptionFailure.ricActionNotAdmittedList.contentLength) {
-        ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = index;
-        ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = cCauseRICService;
-        ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal = 2;
-        index++;
-    }
+
+    // Cause
+    ricSubscriptionFailure.cause.content = Cause_PR_ricService;
+    ricSubscriptionFailure.cause.causeVal =
+
     // CriticalityDiagnostics, OPTIONAL. Not used in RIC
     ricSubscriptionFailure.criticalityDiagnosticsPresent = false;
     ricSubscriptionFailure.criticalityDiagnostics.procedureCodePresent = true;
@@ -435,9 +256,13 @@
 bool TestRICSubscriptionDeleteRequest() {
 
     RICSubscriptionDeleteRequest_t ricSubscriptionDeleteRequest;
+
+    // RICrequestID
     ricSubscriptionDeleteRequest.ricRequestID.ricRequestorID = 1;
     ricSubscriptionDeleteRequest.ricRequestID.ricInstanceID = 22;
-    ricSubscriptionDeleteRequest.ranFunctionID = 33;
+
+     // RANfunctionID
+   ricSubscriptionDeleteRequest.ranFunctionID = 33;
 
     printRICSubscriptionDeleteRequest(&ricSubscriptionDeleteRequest);
 
@@ -479,8 +304,12 @@
 bool TestRICSubscriptionDeleteResponse() {
 
     RICSubscriptionDeleteResponse_t ricSubscriptionDeleteResponse;
+
+    // RICrequestID
     ricSubscriptionDeleteResponse.ricRequestID.ricRequestorID = 1;
     ricSubscriptionDeleteResponse.ricRequestID.ricInstanceID = 22;
+
+    // RANfunctionID
     ricSubscriptionDeleteResponse.ranFunctionID = 33;
 
     printRICSubscriptionDeleteResponse(&ricSubscriptionDeleteResponse);
@@ -523,10 +352,16 @@
 bool TestRICSubscriptionDeleteFailure() {
 
     RICSubscriptionDeleteFailure_t ricSubscriptionDeleteFailure;
+
+    // RICrequestID
     ricSubscriptionDeleteFailure.ricRequestID.ricRequestorID = 1;
     ricSubscriptionDeleteFailure.ricRequestID.ricInstanceID = 22;
+
+    // RANfunctionID
     ricSubscriptionDeleteFailure.ranFunctionID = 33;
-    ricSubscriptionDeleteFailure.cause.content = cCauseRICService;
+
+    // Cause
+    ricSubscriptionDeleteFailure.cause.content = Cause_PR_ricService;//cCauseRICService;
     ricSubscriptionDeleteFailure.cause.causeVal = 2;
 
     printRICSubscriptionDeleteFailure(&ricSubscriptionDeleteFailure);
@@ -583,28 +418,13 @@
     printf("pRICSubscriptionRequest->ricRequestID.ricRequestorID = %u\n", pRICSubscriptionRequest->ricRequestID.ricRequestorID);
     printf("pRICSubscriptionRequest->ricRequestID.ricInstanceID = %u\n", pRICSubscriptionRequest->ricRequestID.ricInstanceID);
     printf("pRICSubscriptionRequest->ranFunctionID = %u\n",pRICSubscriptionRequest->ranFunctionID);
-    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent = %i\n",
-        pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent);
-    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent = %i\n",
-        pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent);
-    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBX2EventTriggerDefinitionPresent) {
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeIDbits = %u\n",
-             (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.bits);
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = %u\n",
-            (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID);
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceDirection = %u\n",
-             (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceDirection);
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode = %u\n",
-             (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.procedureCode);
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage = %u\n",
-             (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBX2eventTriggerDefinition.interfaceMessageType.typeOfMessage);
-    }
-    else if (pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.E2SMgNBNRTEventTriggerDefinitionPresent) {
-        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBNRTEventTriggerDefinition.eventDefinitionFormat1.triggerNature = %i\n",
-            pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.e2SMgNBNRTEventTriggerDefinition.eventDefinitionFormat1.triggerNature);
-    }
-    else
-        printf("Error. Empty pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition");
+
+    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength = %li\n",
+         pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength);
+    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data = ");
+    printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.contentLength,
+                    pRICSubscriptionRequest->ricSubscriptionDetails.ricEventTriggerDefinition.octetString.data);
+    printf("\n");
 
     printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength = %u\n",
          (unsigned)pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.contentLength);
@@ -620,272 +440,12 @@
              pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent);
         if(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent)
         {
-            if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present) {
-
-                // Format 1
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present = %i\n",
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1Present);
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->styleID = %li\n",
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->styleID);
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterCount = %i\n",
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterCount);
-
-                uint64_t index2 = 0;
-                while (index2 < pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterCount) {
-                printf("index2 = %lu\n", index2);
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].parameterID = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].parameterID);
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueIntPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueIntPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueIntPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueInt = %li\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueInt);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnumPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnumPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnumPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnum = %li\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueEnum);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBoolPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBoolPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBoolPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBool = %i\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBool);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitSPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS.byteLength = %li\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS.byteLength);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS.data = ");
-                        printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS.byteLength,
-                                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueBitS.data);
-                        printf("\n");
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctSPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.length = %li\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.length);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.data = ");
-                          printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.length,
-                                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.data);
-                        printf("\n");
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtSPresent = %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.length = %li\n",
-                          pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valueOctS.length);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtS.data = ");
-                        printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtS.length,
-                                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format1->actionParameterItem[index2].actionParameterValue.valuePrtS.data);
-                        printf("\n");
-                    }
-                    index2++;
-                }
-            }
-            else if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present) {
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present = %i\n",
-                  pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2Present);
-
-                // Format 2
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupCount = %i\n",
-                    pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupCount);
-
-                uint64_t index2 = 0;
-                while (index2 < pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupCount) {
-                printf("index2 = %lu\n", index2);
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupID = %li\n",
-                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupID);
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefCount = %i\n",
-                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefCount);
-
-                    uint64_t index3 = 0;
-                    while (index3 < pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefCount) {
-                        printf("index3 = %lu\n", index3);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterID = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterID);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterTest = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterTest);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueIntPresent = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueIntPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueIntPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueInt = %li\n",
-                                pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueInt);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnumPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnumPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnumPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnum = %li\n",
-                                pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueEnum);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBoolPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBoolPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBoolPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBool = %i\n",
-                                pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBool);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitSPresent = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitSPresent);
-                        if ( pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue,valueBitS.byteLength = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitS.byteLength);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitS.byteLength,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueBitS.data);
-                            printf("\n");
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctSPresent = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctSPresent);
-                        if(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue,valueOctS.length = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctS.length);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctS.length,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valueOctS.data);
-                            printf("\n");
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtSPresent = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtSPresent);
-                        if(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue,valuePrtS.length = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtS.length);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtS.length,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranUEgroupDefinition.ranUeGroupDefItem[index3].ranParameterValue.valuePrtS.data);
-                            printf("\n");
-                        }
-                        index3++;
-                    }
-
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterCount %i\n",
-                      pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterCount);
-
-                    index3 = 0;
-                    while (index3 < pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterCount) {
-                        printf("index3 = %lu\n", index3);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterID = %i\n",
-                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterID);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueIntPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueInt = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueInt);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnumPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnumPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnumPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueEnum);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBoolPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBoolPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBoolPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBool = %i\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBool);
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitSPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitSPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength, = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.byteLength,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueBitS.data);
-                            printf("\n");
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctSPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctSPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.length,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valueOctS.data);
-                            printf("\n");
-                        }
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtSPresent = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtSPresent);
-                        if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtSPresent) {
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length = %li\n",
-                                   pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length);
-                            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.data = ");
-                            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.length,
-                                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionX2Format2->ranUeGroupItem[index2].ranPolicy.ranParameterItem[index3].ranParameterValue.valuePrtS.data);
-                            printf("\n");
-                        }
-                        index3++;
-                    }
-                    index2++;
-                }
-            }
-            else if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present) {
-
-                // Format 1
-                printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present = %i\n",
-                  pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1Present);
-
-                uint64_t index2 = 0;
-                while (index2 < pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterCount) {
-                    printf("index2 = %lu\n", index2);
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterID = %i\n",
-                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterID);
-
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueIntPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueIntPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueIntPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueInt = %li\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueInt);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnumPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnumPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnumPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnum = %li\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueEnum);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBoolPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBoolPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBoolPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBool = %i\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBool);
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2]ranParameterValue.valueBitSPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS.byteLength, = %li\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS.byteLength);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS.data = ");
-                        printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS.byteLength,
-                                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueBitS.data);
-                        printf("\n");
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctSPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS.length = %li\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS.length);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS.data = ");
-                        printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS.length,
-                                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valueOctS.data);
-                        printf("\n");
-                    }
-                    printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2]ranParameterValue.valuePrtSPresent = %i\n",
-                           pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtSPresent);
-                    if (pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtSPresent) {
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS.length = %li\n",
-                               pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS.length);
-                        printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS.data = ");
-                        printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS.length,
-                                        pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.actionDefinitionNRTFormat1->ranParameterList[index2].ranParameterValue.valuePrtS.data);
-                        printf("\n");
-                    }
-                    index2++;
-                }
-            }
-            else
-                printf("Error. Missing pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice");
+            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.contentLength = %li\n",
+                 pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.contentLength);
+            printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.data = ");
+            printDataBuffer(pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.contentLength,
+                            pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionChoice.octetString.data);
+            printf("\n");
         }
 
         printf("pRICSubscriptionRequest->ricSubscriptionDetails.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent = %i\n",
@@ -936,17 +496,8 @@
     printf("pRICSubscriptionFailure->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionFailure->ricRequestID.ricRequestorID);
     printf("pRICSubscriptionFailure->ricRequestID.ricInstanceID = %u\n",pRICSubscriptionFailure->ricRequestID.ricInstanceID);
     printf("pRICSubscriptionFailure->ranFunctionID = %i\n",pRICSubscriptionFailure->ranFunctionID);
-    printf("pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength = %u\n",(unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength);
-    uint64_t index = 0;
-    while (index < pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength) {
-        printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = %lu\n",
-             pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID);
-        printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content = %u\n",
-            (unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.content);
-        printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.cause = %u\n",
-             (unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].cause.causeVal);
-        index++;
-    }
+    printf("pRICSubscriptionFailure->ricActionNotAdmittedList.content = %u\n",pRICSubscriptionFailure->cause.content);
+    printf("pRICSubscriptionFailure->ricActionNotAdmittedList.content = %u\n",pRICSubscriptionFailure->cause.causeVal);
     if (pRICSubscriptionFailure->criticalityDiagnosticsPresent) {
         printf("pRICSubscriptionFailure->criticalityDiagnosticsPresent = %u\n",pRICSubscriptionFailure->criticalityDiagnosticsPresent);
         printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCodePresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.procedureCodePresent);
@@ -957,7 +508,7 @@
         printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticality = %u\n",(unsigned)pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticality);
         printf("pRICSubscriptionFailure->criticalityDiagnostics.iEsCriticalityDiagnosticsPresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.iEsCriticalityDiagnosticsPresent);
         printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength);
-        index = 0;
+        unsigned int index = 0;
         while (index < pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength) {
             printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iECriticality = %u\n",
                  (unsigned)pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iECriticality);