blob: aab8aaa31bf7a69bdb07cfb5877dea4e6b298cad [file] [log] [blame]
Juha Hyttinenff8dccd2019-12-10 14:34:07 +02001/*
2==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17==================================================================================
18*/
19
20#ifndef E2AP_IF_H
21#define E2AP_IF_H
22
23#ifndef ASN_DISABLE_OER_SUPPORT
24#define ASN_DISABLE_OER_SUPPORT
25#endif
26
27#include <stdbool.h>
28#include <stdint.h>
Juha Hyttinenaada6452020-04-07 08:47:58 +030029#include <ProcedureCode.h>
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020030
31#ifdef __cplusplus
32extern "C" {
33#endif
34
Juha Hyttinenaada6452020-04-07 08:47:58 +030035extern const int cCauseRICRequest;
36extern const int cCauseRICService;
37extern const int cCauseTransport;
38extern const int cCauseProtocol;
39extern const int cCauseMisc;
40
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020041typedef unsigned char byte;
42
Juha Hyttinenaada6452020-04-07 08:47:58 +030043//extern const int64_t cMaxNrOfErrors;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020044
45extern const uint64_t cMaxSizeOfOctetString;
46
47typedef struct { // Octet string in ASN.1 does not have maximum length!
48 size_t contentLength;
Juha Hyttinenaada6452020-04-07 08:47:58 +030049 uint8_t data[1024]; // Table size is const cMaxSizeOfOctetString
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020050} OctetString_t;
51
Juha Hyttinenaada6452020-04-07 08:47:58 +030052typedef struct { // Octet string in ASN.1 does not have maximum length!
53 size_t length;
54 uint8_t* data;
55} DynOctetString_t;
56
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020057typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +030058 uint8_t unusedBits; // Trailing unused bits 0 - 7
59 size_t byteLength; // Length in bytes
60 uint8_t* data;
61} DynBitString_t;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020062
63typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +030064 uint32_t ricRequestorID; // 0..65535
65 uint32_t ricInstanceID; // 0..65535
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020066} RICRequestID_t;
67
Juha Hyttinenaada6452020-04-07 08:47:58 +030068typedef uint16_t RANFunctionID_t; // 0..4095
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020069
Juha Hyttinenaada6452020-04-07 08:47:58 +030070typedef uint64_t RICActionID_t; // 0..255
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020071
72enum RICActionType_t {
Juha Hyttinenaada6452020-04-07 08:47:58 +030073 RICActionType_report,
74 RICActionType_insert,
75 RICActionType_policy
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020076};
77
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020078
79enum RICSubsequentActionType_t {
80 RICSubsequentActionType_Continue,
81 RICSubsequentActionType_wait
82};
83
Juha Hyttinenaada6452020-04-07 08:47:58 +030084typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +030085 OctetString_t octetString; // This element is E2AP spec format
Juha Hyttinenaada6452020-04-07 08:47:58 +030086} RICActionDefinitionChoice_t;
87
Juha Hyttinenff8dccd2019-12-10 14:34:07 +020088enum RICTimeToWait_t {
89 RICTimeToWait_zero,
90 RICTimeToWait_w1ms,
91 RICTimeToWait_w2ms,
92 RICTimeToWait_w5ms,
93 RICTimeToWait_w10ms,
94 RICTimeToWait_w20ms,
95 RICTimeToWait_w30ms,
96 RICTimeToWait_w40ms,
97 RICTimeToWait_w50ms,
98 RICTimeToWait_w100ms,
99 RICTimeToWait_w200ms,
100 RICTimeToWait_w500ms,
101 RICTimeToWait_w1s,
102 RICTimeToWait_w2s,
103 RICTimeToWait_w5s,
104 RICTimeToWait_w10s,
105 RICTimeToWait_w20s,
106 RICTimeToWait_w60s
107};
108
109typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +0300110 uint64_t ricSubsequentActionType; // This is type of enum RICSubsequentActionType_t
111 uint64_t ricTimeToWait; // This is type of enum RICTimeToWait_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200112} RICSubsequentAction_t;
113
114typedef struct {
115 RICActionID_t ricActionID;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300116 uint64_t ricActionType; // This is type of enum RICActionType_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200117 bool ricActionDefinitionPresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300118 RICActionDefinitionChoice_t ricActionDefinitionChoice;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200119 bool ricSubsequentActionPresent;
120 RICSubsequentAction_t ricSubsequentAction;
121} RICActionToBeSetupItem_t;
122
123static const uint64_t cMaxofRICactionID = 16;
124
125typedef struct {
126 uint8_t contentLength;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300127 RICActionToBeSetupItem_t ricActionToBeSetupItem[16]; // 1..16 // Table size is const cMaxofRICactionID
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200128} RICActionToBeSetupList_t;
129
130typedef struct {
131 uint8_t contentLength;
132 uint8_t pLMNIdentityVal[3];
133} PLMNIdentity_t;
134
135// size of eNB-id
136extern const size_t cMacroENBIDP_20Bits;
137extern const size_t cHomeENBID_28Bits;
138extern const size_t cShortMacroENBID_18Bits;
139extern const size_t clongMacroENBIDP_21Bits;
140
141typedef struct { // gNB-ID (SIZE 22..32 bits) or eNB-ID (SIZE 18, 20,21 or 28 bits)
142 uint8_t bits;
143 uint32_t nodeID;
144} NodeID_t;
145
146typedef struct {
147 PLMNIdentity_t pLMNIdentity;
148 NodeID_t nodeID;
149} GlobalNodeID_t;
150
151typedef struct { // CHOICE. Only either value can be present
152 bool globalENBIDPresent;
153 GlobalNodeID_t globalENBID;
154 bool globalGNBIDPresent;
155 GlobalNodeID_t globalGNBID;
156} InterfaceID_t;
157
158enum InterfaceDirection__t {
159 InterfaceDirection__incoming,
160 InterfaceDirection__outgoing
161};
162
163typedef uint8_t ProcedureCode__t;
164
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200165
Juha Hyttinenaada6452020-04-07 08:47:58 +0300166static const uint64_t cMaxofProtocolIE = 15;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200167
168typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +0300169 OctetString_t octetString; // This element is E2AP spec format
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200170} RICEventTriggerDefinition_t;
171
172typedef struct {
173 RICEventTriggerDefinition_t ricEventTriggerDefinition;
174 RICActionToBeSetupList_t ricActionToBeSetupItemIEs;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300175} RICSubscriptionDetails_t;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200176
177typedef struct {
178 uint8_t contentLength;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300179 RICActionID_t ricActionID[16]; // Table size is const cMaxofRICactionID
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200180} RICActionAdmittedList_t;
181
Juha Hyttinenaada6452020-04-07 08:47:58 +0300182extern const int cCauseRIC; // This is content of type CauseRIC_t
183extern const int cCauseRICService; // This is content of type CauseRICservice_t
184extern const int cRICCauseTransport; // This is content of type CauseTransport_t
185extern const int cRICCauseProtocol; // This is content of type CauseProtocol_t
186extern const int cRICCauseMisc; // This is content of type CauseMisc_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200187
188typedef struct {
189 uint8_t content; // See above constants
Juha Hyttinenaada6452020-04-07 08:47:58 +0300190 uint8_t causeVal; // This is type of enum CauseRIC_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200191} RICCause_t;
192
193typedef struct {
194 RICActionID_t ricActionID;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300195 RICCause_t cause;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200196} RICActionNotAdmittedItem_t;
197
198typedef struct {
199 uint8_t contentLength;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300200 RICActionNotAdmittedItem_t RICActionNotAdmittedItem[16]; // Table size is const cMaxofRICactionID
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200201} RICActionNotAdmittedList_t;
202
203enum Criticality_t {
204 Criticality__reject,
205 Criticality__ignore,
206 Criticality__notify
207};
208
209typedef uint32_t ProtocolIE_ID__t;
210
211enum TriggeringMessage__t {
212 TriggeringMessage__initiating_message,
213 TriggeringMessage__successful_outcome,
214 TriggeringMessage__unsuccessful_outcome
215};
216
217enum TypeOfError_t {
218 TypeOfError_not_understood,
219 TypeOfError_missing
220};
221
222typedef struct {
Juha Hyttinenaada6452020-04-07 08:47:58 +0300223 uint8_t iECriticality; // This is type of enum Criticality_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200224 ProtocolIE_ID__t iE_ID;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300225 uint8_t typeOfError; // This is type of enum TypeOfError_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200226 //iE-Extensions // This has no content in E2AP ASN.1 specification
227} CriticalityDiagnosticsIEListItem_t;
228
229typedef struct {
230 bool procedureCodePresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300231 ProcedureCode__t procedureCode; // OPTIONAL
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200232 bool triggeringMessagePresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300233 uint8_t triggeringMessage; // OPTIONAL. This is type of enum TriggeringMessage_t
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200234 bool procedureCriticalityPresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300235 uint8_t procedureCriticality; // OPTIONAL. This is type of enum Criticality_t
236 bool ricRequestorIDPresent;
237 RICRequestID_t ricRequestorID; //OPTIONAL
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200238 bool iEsCriticalityDiagnosticsPresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300239 uint16_t criticalityDiagnosticsIELength; // 1..256
240 CriticalityDiagnosticsIEListItem_t criticalityDiagnosticsIEListItem[256]; // OPTIONAL. Table size is const cMaxNrOfErrors
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200241} CriticalityDiagnostics__t;
242
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200243typedef struct {
244 OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format
245 uint64_t ricCallProcessIDVal;
246} RICCallProcessID_t;
247
248//////////////////////////////////////////////////////////////////////
249// E2 Error codes
250enum e2err {
251 e2err_OK,
252 e2err_RICSubscriptionRequestAllocRICrequestIDFail,
253 e2err_RICSubscriptionRequestAllocRANfunctionIDFail,
254 e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail,
255 e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail,
Juha Hyttinenaada6452020-04-07 08:47:58 +0300256 e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail,
257 e2err_RICSubscriptionRequestAllocRICactionDefinitionFail,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200258 e2err_RICSubscriptionRequestAllocRICsubsequentActionFail,
259 e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail,
260 e2err_RICSubscriptionRequestEncodeFail,
261 e2err_RICSubscriptionRequestAllocE2AP_PDUFail,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200262 e2err_RICSubscriptionResponseAllocRICrequestIDFail,
263 e2err_RICSubscriptionResponseAllocRANfunctionIDFail,
264 e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail,
265 e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail,
266 e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200267 e2err_RICSubscriptionResponseEncodeFail,
268 e2err_RICSubscriptionResponseAllocE2AP_PDUFail,
269 e2err_RICSubscriptionFailureAllocRICrequestIDFail,
270 e2err_RICSubscriptionFailureAllocRANfunctionIDFail,
271 e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail,
272 e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail,
273 e2err_RICSubscriptionFailureEncodeFail,
274 e2err_RICSubscriptionFailureAllocE2AP_PDUFail,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200275 e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail,
276 e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail,
277 e2err_RICSubscriptionDeleteRequestEncodeFail,
278 e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail,
279 e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail,
280 e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail,
281 e2err_RICSubscriptionDeleteResponseEncodeFail,
282 e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail,
283 e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail,
284 e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail,
285 e2err_RICSubscriptionDeleteFailureAllocRICcauseFail,
286 e2err_RICSubscriptionDeleteFailureEncodeFail,
287 e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail,
288 e2err_RICsubscriptionRequestRICrequestIDMissing,
289 e2err_RICsubscriptionRequestRANfunctionIDMissing,
290 e2err_RICsubscriptionRequestICsubscriptionMissing,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200291 e2err_RICsubscriptionResponseRICrequestIDMissing,
292 e2err_RICsubscriptionResponseRANfunctionIDMissing,
293 e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200294 e2err_RICsubscriptionFailureRICrequestIDMissing,
295 e2err_RICsubscriptionFailureRANfunctionIDMissing,
296 e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing,
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200297 e2err_RICsubscriptionDeleteRequestRICrequestIDMissing,
298 e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing,
299 e2err_RICsubscriptionDeleteResponseRICrequestIDMissing,
300 e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing,
301 e2err_RICsubscriptionDeleteFailureRICrequestIDMissing,
302 e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing,
303 e2err_RICsubscriptionDeleteFailureRICcauseMissing
304};
305
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200306static const char* const E2ErrorStrings[] = {
307 "e2err_OK",
308 "e2err_RICSubscriptionRequestAllocRICrequestIDFail",
309 "e2err_RICSubscriptionRequestAllocRANfunctionIDFail",
310 "e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail",
311 "e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail",
Juha Hyttinenaada6452020-04-07 08:47:58 +0300312 "e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail",
313 "e2err_RICSubscriptionRequestAllocRICactionDefinitionFail",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200314 "e2err_RICSubscriptionRequestAllocRICsubsequentActionFail",
315 "e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail",
316 "e2err_RICSubscriptionRequestEncodeFail",
317 "e2err_RICSubscriptionRequestAllocE2AP_PDUFail",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200318 "e2err_RICSubscriptionResponseAllocRICrequestIDFail",
319 "e2err_RICSubscriptionResponseAllocRANfunctionIDFail",
320 "e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail",
321 "e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail",
322 "e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200323 "e2err_RICSubscriptionResponseEncodeFail",
324 "e2err_RICSubscriptionResponseAllocE2AP_PDUFail",
325 "e2err_RICSubscriptionFailureAllocRICrequestIDFail",
326 "e2err_RICSubscriptionFailureAllocRANfunctionIDFail",
327 "e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail",
328 "e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail",
329 "e2err_RICSubscriptionFailureEncodeFail",
330 "e2err_RICSubscriptionFailureAllocE2AP_PDUFail",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200331 "e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail",
332 "e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail",
333 "e2err_RICSubscriptionDeleteRequestEncodeFail",
334 "e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail",
335 "e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail",
336 "e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail",
337 "e2err_RICSubscriptionDeleteResponseEncodeFail",
338 "e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail",
339 "e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail",
340 "e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail",
341 "e2err_RICSubscriptionDeleteFailureAllocRICcauseFail",
342 "e2err_RICSubscriptionDeleteFailureEncodeFail",
343 "e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail",
344 "e2err_RICsubscriptionRequestRICrequestIDMissing",
345 "e2err_RICsubscriptionRequestRANfunctionIDMissing",
346 "e2err_RICsubscriptionRequestICsubscriptionMissing",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200347 "e2err_RICsubscriptionResponseRICrequestIDMissing",
348 "e2err_RICsubscriptionResponseRANfunctionIDMissing",
349 "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200350 "e2err_RICsubscriptionFailureRICrequestIDMissing",
351 "e2err_RICsubscriptionFailureRANfunctionIDMissing",
352 "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing",
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200353 "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing",
354 "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing",
355 "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing",
356 "e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing",
357 "e2err_RICsubscriptionDeleteFailureRICrequestIDMissing",
358 "e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing",
359 "e2err_RICsubscriptionDeleteFailureRICcauseMissing"
360};
361
362typedef struct {
363 uint64_t messageType; // Initiating message or Successful outcome or Unsuccessful outcome
364 uint64_t messageId;
365} E2MessageInfo_t;
366
367//////////////////////////////////////////////////////////////////////
368// Message definitons
369
370// Below constant values are same as in E2AP, E2SM and X2AP specs
371extern const uint64_t cE2InitiatingMessage;
372extern const uint64_t cE2SuccessfulOutcome;
373extern const uint64_t cE2UnsuccessfulOutcome;
374
375// E2AP messages. Below message id constant values are the same as in ASN.1 specification
376
377// Initiating message
378extern const uint64_t cRICSubscriptionRequest;
379extern const uint64_t cRICSubscriptionDeleteRequest;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200380
381// Successful outcome
382extern const uint64_t cRICSubscriptionResponse;
383extern const uint64_t cRICsubscriptionDeleteResponse;
384
385// Unsuccessful outcome
386extern const uint64_t cRICSubscriptionFailure;
387extern const uint64_t cRICsubscriptionDeleteFailure;
388
389typedef struct {
390 RICRequestID_t ricRequestID;
391 RANFunctionID_t ranFunctionID;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300392 RICSubscriptionDetails_t ricSubscriptionDetails;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200393} RICSubscriptionRequest_t;
394
395typedef struct {
396 RICRequestID_t ricRequestID;
397 RANFunctionID_t ranFunctionID;
398 RICActionAdmittedList_t ricActionAdmittedList;
399 bool ricActionNotAdmittedListPresent;
400 RICActionNotAdmittedList_t ricActionNotAdmittedList;
401} RICSubscriptionResponse_t;
402
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200403typedef struct {
404 RICRequestID_t ricRequestID;
405 RANFunctionID_t ranFunctionID;
406 RICActionNotAdmittedList_t ricActionNotAdmittedList;
407 bool criticalityDiagnosticsPresent;
408 CriticalityDiagnostics__t criticalityDiagnostics;
409} RICSubscriptionFailure_t;
410
411typedef struct {
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200412 RICRequestID_t ricRequestID;
413 RANFunctionID_t ranFunctionID;
414} RICSubscriptionDeleteRequest_t;
415
416typedef struct {
417 RICRequestID_t ricRequestID;
418 RANFunctionID_t ranFunctionID;
419} RICSubscriptionDeleteResponse_t;
420
421typedef struct {
422 RICRequestID_t ricRequestID;
423 RANFunctionID_t ranFunctionID;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300424 RICCause_t cause;
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200425 bool criticalityDiagnosticsPresent;
Juha Hyttinenaada6452020-04-07 08:47:58 +0300426 CriticalityDiagnostics__t criticalityDiagnostics; // OPTIONAL. Not used in RIC currently
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200427} RICSubscriptionDeleteFailure_t;
428
429//////////////////////////////////////////////////////////////////////
430// Function declarations
431
432const char* getE2ErrorString(uint64_t);
433
434typedef void* e2ap_pdu_ptr_t;
435
436uint64_t packRICSubscriptionRequest(size_t*, byte*, char*,RICSubscriptionRequest_t*);
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200437uint64_t packRICSubscriptionResponse(size_t*, byte*, char*,RICSubscriptionResponse_t*);
438uint64_t packRICSubscriptionFailure(size_t*, byte*, char*,RICSubscriptionFailure_t*);
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200439uint64_t packRICSubscriptionDeleteRequest(size_t*, byte*, char*,RICSubscriptionDeleteRequest_t*);
440uint64_t packRICSubscriptionDeleteResponse(size_t*, byte*, char*,RICSubscriptionDeleteResponse_t*);
441uint64_t packRICSubscriptionDeleteFailure(size_t*, byte*, char*,RICSubscriptionDeleteFailure_t*);
442
443e2ap_pdu_ptr_t* unpackE2AP_pdu(const size_t, const byte*, char*, E2MessageInfo_t*);
Juha Hyttinencdc35bf2020-07-11 13:32:57 +0300444uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*);
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200445uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t*, RICSubscriptionResponse_t*);
446uint64_t getRICSubscriptionFailureData(e2ap_pdu_ptr_t*, RICSubscriptionFailure_t*);
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200447uint64_t getRICSubscriptionDeleteRequestData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteRequest_t*);
448uint64_t getRICSubscriptionDeleteResponseData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteResponse_t*);
449uint64_t getRICSubscriptionDeleteFailureData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteFailure_t*);
450
Juha Hyttinenaada6452020-04-07 08:47:58 +0300451
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200452#if DEBUG
453bool TestRICSubscriptionRequest();
454bool TestRICSubscriptionResponse();
455bool TestRICSubscriptionFailure();
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200456bool TestRICSubscriptionDeleteRequest();
457bool TestRICSubscriptionDeleteResponse();
458bool TestRICSubscriptionDeleteFailure();
459
460void printRICSubscriptionRequest(const RICSubscriptionRequest_t*);
461void printRICSubscriptionResponse(const RICSubscriptionResponse_t*);
462void printRICSubscriptionFailure(const RICSubscriptionFailure_t*);
Juha Hyttinenff8dccd2019-12-10 14:34:07 +0200463void printRICSubscriptionDeleteRequest(const RICSubscriptionDeleteRequest_t*);
464void printRICSubscriptionDeleteResponse(const RICSubscriptionDeleteResponse_t*);
465void printRICSubscriptionDeleteFailure(const RICSubscriptionDeleteFailure_t*);
466#endif
467
468#ifdef __cplusplus
469}
470#endif
471
472#endif