[Epic-ID: ODUHIGH-510][Task-ID: ODUHIGH-512] Implementation of E2 setup failure
[o-du/l2.git] / src / du_app / du_e2ap_mgr.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 /* This file contains all E2AP message handler related functionality */
20
21 #define MAX_NUM_TRANSACTION 256 /* As per, O-RAN WG3 E2AP v3.0, section 9.2.33 */
22 #define MAX_E2_SETUP_TMR 1
23 #define EVENT_E2_SETUP_TMR 1
24
25 typedef enum
26 {
27    RIC_INITIATED,
28    E2_NODE_INITIATED
29 }E2ProcedureDirection;
30
31 typedef enum
32 {
33    E2_RAN_FUNCTION_ID_INVALID,
34    E2_ACTION_NOT_SUPPORTED,
35    E2_EXECESSIVE_ACTIONS,
36    E2_DUPLICATE_ACTION,
37    E2_DUPLICATE_EVENT_TRIGGER,
38    E2_FUNCTION_RESOURCE_LIMIT,
39    E2_REQUEST_ID_UNKNOWN,
40    E2_INCONSISTENT_ACTION_SUBSEQUENT_ACTION_SEQUENCE,
41    E2_CONTROL_MESSAGE_INVALID,
42    E2_RIC_CALL_PROCESS_ID_INVALID,
43    E2_CONTROL_TIMER_EXPIRED,
44    E2_CONTROL_FAILED_TO_EXECUTE,
45    E2_SYSTEM_NOT_READY,
46    E2_RIC_REQUEST_CAUSE_UNSPECIFIED,
47    E2_RIC_SUBSCRIPTION_END_TIME_EXPIRED,
48    E2_RIC_SUBSCRIPTION_END_TIME_INVALID,
49    E2_DUPLICATE_RIC_REQUEST_ID,
50    E2_EVENT_TRIGGER_NOT_SUPPORTED,
51    E2_REQUEST_INFORMATION_UNAVAILABLE,
52    E2_INVALID_INFORMATION_REQUEST
53 }E2CauseRicRequest;
54
55 typedef enum
56 {
57    E2_RAN_FUNCTION_NOT_SUPPORTED,
58    E2_EXCESSIVE_FUNCTIONS,
59    E2_RIC_RESOURCE_LIMIT,
60 }E2CauseRicService;
61
62 typedef enum
63 {
64    E2_NODE_COMPONENT_UNKNOWN
65 }E2CauseE2Node;
66
67 typedef enum
68 {
69    E2_TRANSPORT_CAUSE_UNSPECIFIED,
70    E2_TRANSPORT_RESOURCE_UNAVAILABLE
71 }E2CauseTransport;
72
73 typedef enum
74 {
75    E2_TRANSFER_SYNTAX_ERROR,
76    E2_ABSTRACT_SYNTAX_ERROR_REJECT,
77    E2_ABSTRACT_SYNTAX_ERROR_IGNORE_AND_NOTIFY,
78    E2_MESSAGE_NOT_COMPATIBLE_WITH_RECEIVER_STATE,
79    E2_SEMANTIC_ERROR,
80    E2_ABSTRACT_SYNTAX_ERROR_FALSELY_CONSTRUCTED_MESSAGE,
81    E2_PROTOCOL_CAUSE_UNSPECIFIED
82 }E2CauseProtocol;
83
84 typedef enum
85 {
86    E2_CONTROL_PROCESSING_OVERLOAD,
87    E2_HARDWARE_FAILURE,
88    E2_OM_INTERVENTION,
89    E2_MISCELLANEOUS_CAUSE_UNSPECIFIED
90 }E2CauseMisc;
91
92 typedef enum 
93 {
94    E2_NOTHING,
95    E2_RIC_REQUEST,
96    E2_RIC_SERVICE,
97    E2_NODE,
98    E2_TRANSPORT,
99    E2_PROTOCOL,
100    E2_MISCELLANEOUS
101 }E2CauseType;
102
103 typedef uint8_t E2Cause;
104
105 typedef struct
106 {
107    uint8_t transactionId;
108    uint8_t procedureCode;
109 }E2TransInfo;
110
111 typedef struct e2Transcation
112 {
113    uint8_t     transIdCounter;
114    E2TransInfo onGoingTransaction[MAX_NUM_TRANSACTION];
115    /* Any new parameter for transaction handling can be added here in future */
116 }E2Transcation;
117
118 typedef struct e2Timer
119 {
120    CmTimer e2SetupTimer;
121    /* More timers can be added to this structure in future */
122 }E2Timer;
123
124 typedef struct e2apDb
125 {
126    uint16_t      ricId;
127    E2Transcation e2TransInfo;
128    uint8_t       *plmn;
129    uint32_t      ricReqId;
130    uint32_t      ricInstanceId;
131    uint32_t      ranFuncId;
132    uint8_t       *ricEventTrigger;
133    uint32_t      ricActionId;
134    uint32_t      ricActionType;
135    E2Timer       e2Timers;
136    uint8_t       e2SetupTimerInterval;
137 }E2apDb;
138
139 uint8_t assignTransactionId();
140 uint8_t ResetE2Request(E2ProcedureDirection dir, E2CauseType type, E2Cause cause);
141 uint8_t SendE2APMsg(Region region, Pool pool, char *encBuf, int encBufSize);
142 /**********************************************************************
143   End of file
144  **********************************************************************/