[Epic-ID: ODUHIGH-516][Task-ID: 526] Implementation of ric service update
[o-du/l2.git] / src / du_app / du_e2ap_mgr.h
index 5004628..e59e646 100644 (file)
  *******************************************************************************/
 
 /* This file contains all E2AP message handler related functionality */
-
-#define MAX_NUM_TRANSACTION 256 /* As per, O-RAN WG3 E2AP v3.0, section 9.2.33 */
 #define MAX_E2_SETUP_TMR 1
+#define MAX_RIC_SERVICE_UPDATE_TMR 1
+
 #define EVENT_E2_SETUP_TMR 1
+#define EVENT_RIC_SERVICE_UPDATE_TMR 2
+
+#define MAX_NUM_TRANSACTION 256 /* As per, O-RAN WG3 E2AP v3.0, section 9.2.33 */
 #define MAX_RAN_FUNCTION 256        /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.2.2 : maxofRANfunctionID */
 #define MAX_E2_NODE_COMPONENT 1024     /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.2.2 : maxofE2nodeComponents */
 #define MAX_TNL_ASSOCIATION 32         /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.2.11 : maxofTNLA */
@@ -44,7 +47,6 @@
 #define REPORT_STYLE_NAME "E2 Node Measurement"
 #define REPORT_STYLE_TYPE 1
 #define REPORT_ACTION_FORMAT_TYPE 1
-#define NUM_OF_MEASUREMENT_INFO_SUPPORTED 2
 #define MEASUREMENT_TYPE_NAME (char*[]) {"RRU.PrbTotDl", "RRU.PrbTotUl"}
 #define RIC_INDICATION_HEADER_FORMAT 1
 #define RIC_INDICATION_MESSAGE_FORMAT 1
@@ -171,14 +173,44 @@ typedef struct
 
 typedef struct e2Transcation
 {
-   uint8_t     transIdCounter;
-   E2TransInfo onGoingTransaction[MAX_NUM_TRANSACTION];
-   /* Any new parameter for transaction handling can be added here in future */
+   uint8_t     transIdCounter; /* counting the total number of DU initiated transaction */
+   E2TransInfo e2InitTransaction[MAX_NUM_TRANSACTION]; /* Storing DU-initiated transactions information */
+   E2TransInfo ricInitTransaction[MAX_NUM_TRANSACTION]; /* Storing RIC-initiated transactions information */
 }E2Transaction;
 
+typedef struct
+{
+   uint16_t   id;
+   uint16_t   revisionCounter;
+}RanFuncInfo;
+
+typedef struct
+{
+   uint8_t     numOfRanFunToBeAdded;
+   RanFuncInfo ranFunToBeAdded[MAX_RAN_FUNCTION];
+   uint8_t     numOfRanFunToBeModified;
+   RanFuncInfo ranFunToBeModified[MAX_RAN_FUNCTION];
+   uint8_t     numOfRanFunToBeDeleted;
+   RanFuncInfo ranFunToBeDeleted[MAX_RAN_FUNCTION];
+}E2TmpRanFunList;
+
+typedef struct ricServiceUpdate
+{
+   E2ProcedureDirection dir;
+   uint8_t              transId;
+   E2TmpRanFunList      recvRanFuncList;
+}RicServiceUpdate;
+
+typedef struct 
+{
+   RicServiceUpdate ricService;
+   CmTimer          timer;
+}RicServiceUpdateTimer;
+
 typedef struct e2Timer
 {
    CmTimer e2SetupTimer;
+   RicServiceUpdateTimer ricServiceUpdateTimer;
    /* More timers can be added to this structure in future */
 }E2Timer;
 
@@ -246,7 +278,8 @@ typedef struct
 /* O-RAN.WG3.E2SM-KPM-R003-v03.00 : Section 8.3.11 */
 typedef struct
 {
-   /* TODO : To be added when list of KPIs are finalised */
+   /* TODO : To be added in future when subcounters for any
+    * measurment type is required */
 }LabelInfo;
 
 /* O-RAN.WG3.E2SM-KPM-R003-v03.00 : Section 8.2.1.2.1 */
@@ -257,16 +290,19 @@ typedef struct
       char     measurementTypeName[STRING_SIZE_150_BYTES];
       uint16_t measurementTypeId;
    }choice;
-   uint32_t    numOfLabels;
-   LabelInfo   LabelInfoList[MAX_LABEL_INFO];
+
+   /* As of now Labels are not used, hence it is not implemented completely */
+   //uint32_t    numOfLabels;
+   //LabelInfo   LabelInfoList[MAX_LABEL_INFO];
+   
+   CmLListCp   measuredValue;  /* To be filled when numOfLabels is 0, else values are calculated per Label */
 }MeasurementInfo;
 
 /* O-RAN.WG3.E2SM-KPM-R003-v03.00 : Section 8.2.1.2.1 */
 typedef struct
 {
-   uint16_t                numOfMeasuermentInfo;
-   MeasurementInfo         **measurementInfoList;
-   uint32_t                granularityPeriod;                     /* In millisecond */
+   CmLListCp               measurementInfoList;    /* Each node corresponds to MeasurementInfo */
+   uint32_t                granularityPeriod;      /* In millisecond */
 }ActionDefFormat1;
 
 /* O-RAN.WG3.E2SM-KPM-R003-v03.00 : Section 8.2.1.2.2 */
@@ -313,6 +349,7 @@ typedef struct
    uint8_t           id;
    ActionType        type;
    ActionDefinition  definition;
+   ConfigType        action;
 }ActionInfo;
 
 /* O-RAN.WG3.E2AP-R003-v03.00 : Section 9.1.1.1 : maxofRICActionID */
@@ -388,6 +425,7 @@ typedef struct
    E2TimersInfo     e2TimersInfo;
 }E2apDb;
 
+
 uint8_t assignTransactionId();
 uint8_t ResetE2Request(E2ProcedureDirection dir, E2CauseType type, E2Cause cause);
 uint8_t SendE2APMsg(Region region, Pool pool, char *encBuf, int encBufSize);