blob: d70d2b67bceb057508aca765058575891a1463d0 [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>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34typedef unsigned char byte;
35
36extern const int64_t cMaxNrOfErrors;
37
38extern const uint64_t cMaxSizeOfOctetString;
39
40typedef struct { // Octet string in ASN.1 does not have maximum length!
41 size_t contentLength;
42 uint8_t data[1024]; // table size is const cMaxSizeOfOctetString
43} OctetString_t;
44
45typedef struct {
46 uint8_t unusedbits; // trailing unused bits 0 - 7
47 size_t byteLength; // length in bytes
48 uint8_t data[1024];
49} Bitstring_t;
50
51typedef struct {
52 uint32_t ricRequestorID;
53 uint32_t ricRequestSequenceNumber;
54} RICRequestID_t;
55
56typedef uint16_t RANFunctionID_t;
57
58typedef uint64_t RICActionID_t;
59
60enum RICActionType_t {
61 RICActionType_report
62 ,RICActionType_insert
63 ,RICActionType_policy
64};
65
66typedef uint64_t StyleID_t;
67
68typedef uint32_t ParameterID_t;
69
70typedef struct {
71 uint32_t dummy; // This data type has no content. This dymmy is added here to solve problem with Golang. Golang do not like empty types.
72} ParameterValue_t;
73
74typedef struct {
75 ParameterID_t parameterID;
76 ParameterValue_t ParameterValue;
77} SequenceOfActionParameters_t;
78
79typedef struct {
80 StyleID_t styleID;
81 SequenceOfActionParameters_t sequenceOfActionParameters;
82} RICActionDefinition_t;
83
84enum RICSubsequentActionType_t {
85 RICSubsequentActionType_Continue,
86 RICSubsequentActionType_wait
87};
88
89enum RICTimeToWait_t {
90 RICTimeToWait_zero,
91 RICTimeToWait_w1ms,
92 RICTimeToWait_w2ms,
93 RICTimeToWait_w5ms,
94 RICTimeToWait_w10ms,
95 RICTimeToWait_w20ms,
96 RICTimeToWait_w30ms,
97 RICTimeToWait_w40ms,
98 RICTimeToWait_w50ms,
99 RICTimeToWait_w100ms,
100 RICTimeToWait_w200ms,
101 RICTimeToWait_w500ms,
102 RICTimeToWait_w1s,
103 RICTimeToWait_w2s,
104 RICTimeToWait_w5s,
105 RICTimeToWait_w10s,
106 RICTimeToWait_w20s,
107 RICTimeToWait_w60s
108};
109
110typedef struct {
111 uint64_t ricSubsequentActionType; // this is type of enum RICSubsequentActionType_t
112 uint64_t ricTimeToWait; // this is type of enum RICTimeToWait_t
113} RICSubsequentAction_t;
114
115typedef struct {
116 RICActionID_t ricActionID;
117 uint64_t ricActionType; // this is type of enum RICActionType_t
118 bool ricActionDefinitionPresent;
119 RICActionDefinition_t ricActionDefinition;
120 bool ricSubsequentActionPresent;
121 RICSubsequentAction_t ricSubsequentAction;
122} RICActionToBeSetupItem_t;
123
124static const uint64_t cMaxofRICactionID = 16;
125
126typedef struct {
127 uint8_t contentLength;
128 RICActionToBeSetupItem_t ricActionToBeSetupItem[16]; // table size is const cMaxofRICactionID
129} RICActionToBeSetupList_t;
130
131typedef struct {
132 uint8_t contentLength;
133 uint8_t pLMNIdentityVal[3];
134} PLMNIdentity_t;
135
136// size of eNB-id
137extern const size_t cMacroENBIDP_20Bits;
138extern const size_t cHomeENBID_28Bits;
139extern const size_t cShortMacroENBID_18Bits;
140extern const size_t clongMacroENBIDP_21Bits;
141
142typedef struct { // gNB-ID (SIZE 22..32 bits) or eNB-ID (SIZE 18, 20,21 or 28 bits)
143 uint8_t bits;
144 uint32_t nodeID;
145} NodeID_t;
146
147typedef struct {
148 PLMNIdentity_t pLMNIdentity;
149 NodeID_t nodeID;
150} GlobalNodeID_t;
151
152typedef struct { // CHOICE. Only either value can be present
153 bool globalENBIDPresent;
154 GlobalNodeID_t globalENBID;
155 bool globalGNBIDPresent;
156 GlobalNodeID_t globalGNBID;
157} InterfaceID_t;
158
159enum InterfaceDirection__t {
160 InterfaceDirection__incoming,
161 InterfaceDirection__outgoing
162};
163
164typedef uint8_t ProcedureCode__t;
165
166typedef struct {
167 ProcedureCode__t procedureCode;
168 uint8_t typeOfMessage; // This is X2AP-PDU, CHOICE of InitiatingMessage or SuccessfulOutcome or UnsuccessfulOutcome
169} RICInterfaceMessageType_t;
170
171typedef uint32_t InterfaceProtocolIEID_t;
172
173enum ProtocolIEtestCondition_t {
174 ProtocolIEtestCondition_equal,
175 ProtocolIEtestCondition_greaterthan,
176 ProtocolIEtestCondition_lessthan,
177 ProtocolIEtestCondition_contains,
178 ProtocolIEtestCondition_present
179};
180
181typedef struct { // CHOICE. Only one value can be present
182 bool valueIntPresent;
183 int64_t integer; //INTEGER;
184 bool valueEnumPresent;
185 int64_t valueEnum; // INTEGER
186 bool valueBoolPresent;
187 bool valueBool; // BOOLEAN
188 bool valueBitSPresent;
189 Bitstring_t octetstring; // OCTET STRING,
190 bool octetstringPresent;
191 OctetString_t octetString; // OCTET STRING,
192} InterfaceProtocolIEValue_t;
193
194typedef struct {
195 InterfaceProtocolIEID_t interfaceProtocolIEID;
196 //ProtocolIEtestCondition_t protocolIEtestCondition; Golang do not like this line. We do not need this right now.
197 InterfaceProtocolIEValue_t interfaceProtocolIEValue;
198} SequenceOfProtocolIE_t;
199
200static const uint64_t cMaxofProtocolIE = 16;
201
202typedef struct {
203 SequenceOfProtocolIE_t sequenceOfProtocolIE[16]; // table size is const cMaxofProtocolIE
204} SequenceOfProtocolIEList_t;
205
206typedef struct {
207 OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format
208 InterfaceID_t interfaceID;
209 uint8_t interfaceDirection; // this is type of enum InterfaceDirection_t
210 RICInterfaceMessageType_t interfaceMessageType ;
211 bool sequenceOfProtocolIEListPresent;
212 SequenceOfProtocolIEList_t SequenceOfProtocolIEList;
213} RICEventTriggerDefinition_t;
214
215typedef struct {
216 RICEventTriggerDefinition_t ricEventTriggerDefinition;
217 RICActionToBeSetupList_t ricActionToBeSetupItemIEs;
218} RICSubscription_t;
219
220typedef struct {
221 uint8_t contentLength;
222 RICActionID_t ricActionID[16]; // table size is const cMaxofRICactionID
223} RICActionAdmittedList_t;
224
225enum CauseRIC_t {
226 CauseRIC__function_id_Invalid,
227 CauseRIC__action_not_supported,
228 CauseRIC__excessive_actions,
229 CauseRIC__duplicate_action,
230 CauseRIC__duplicate_event,
231 CauseRIC__function_resource_limit,
232 CauseRIC__request_id_unknown,
233 CauseRIC__inconsistent_action_subsequent_action_sequence,
234 CauseRIC__control_message_invalid,
235 CauseRIC__call_process_id_invalid,
236 CauseRIC__function_not_required,
237 CauseRIC__excessive_functions,
238 CauseRIC__ric_resource_limit
239};
240
241extern const int cRICCauseRadioNetwork; // this is content of type RICCause_t
242extern const int cRICCauseTransport; // this is content of type RICCause_t
243extern const int cRICCauseProtocol; // this is content of type RICCause_t
244extern const int cRICCauseMisc; // this is content of type RICCause_t
245extern const int cRICCauseRic; // this is content of type RICCause_t
246
247typedef struct {
248 uint8_t content; // See above constants
249 uint8_t cause; // this is type of enum CauseRIC_t
250} RICCause_t;
251
252typedef struct {
253 RICActionID_t ricActionID;
254 RICCause_t ricCause;
255} RICActionNotAdmittedItem_t;
256
257typedef struct {
258 uint8_t contentLength;
259 RICActionNotAdmittedItem_t RICActionNotAdmittedItem[16]; // table size is const cMaxofRICactionID
260} RICActionNotAdmittedList_t;
261
262enum Criticality_t {
263 Criticality__reject,
264 Criticality__ignore,
265 Criticality__notify
266};
267
268typedef uint32_t ProtocolIE_ID__t;
269
270enum TriggeringMessage__t {
271 TriggeringMessage__initiating_message,
272 TriggeringMessage__successful_outcome,
273 TriggeringMessage__unsuccessful_outcome
274};
275
276enum TypeOfError_t {
277 TypeOfError_not_understood,
278 TypeOfError_missing
279};
280
281typedef struct {
282 uint8_t iECriticality; // this is type of enum Criticality_t
283 ProtocolIE_ID__t iE_ID;
284 uint8_t typeOfError; // this is type of enum TypeOfError_t
285 //iE-Extensions // This has no content in E2AP ASN.1 specification
286} CriticalityDiagnosticsIEListItem_t;
287
288typedef struct {
289 bool procedureCodePresent;
290 ProcedureCode__t procedureCode;
291 bool triggeringMessagePresent;
292 uint8_t triggeringMessage; // this is type of enum TriggeringMessage_t
293 bool procedureCriticalityPresent;
294 uint8_t procedureCriticality; // this is type of enum Criticality_t
295 bool iEsCriticalityDiagnosticsPresent;
296 uint16_t criticalityDiagnosticsIELength;
297 CriticalityDiagnosticsIEListItem_t criticalityDiagnosticsIEListItem[256]; // table size is const cMaxNrOfErrors
298 //iE-Extensions // This has no content in E2AP ASN.1 specification
299
300} CriticalityDiagnostics__t;
301
302typedef int32_t RICIndicationSN_t;
303
304enum RICIndicationType_t {
305 RICIndicationType_RICIndicationTypeReport,
306 RICIndicationType_RICIndicationTypeInsert
307};
308
309typedef struct {
310 OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format
311 InterfaceID_t interfaceID;
312 uint8_t interfaceDirection;
313} RICIndicationHeader_t;
314
315typedef struct {
316 OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format
317 OctetString_t interfaceMessage;
318} RICIndicationMessage_t;
319
320typedef struct {
321 OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format
322 uint64_t ricCallProcessIDVal;
323} RICCallProcessID_t;
324
325//////////////////////////////////////////////////////////////////////
326// E2 Error codes
327enum e2err {
328 e2err_OK,
329 e2err_RICSubscriptionRequestAllocRICrequestIDFail,
330 e2err_RICSubscriptionRequestAllocRANfunctionIDFail,
331 e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail,
332 e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail,
333 e2err_RICSubscriptionRequestAllocRICsubsequentActionFail,
334 e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail,
335 e2err_RICSubscriptionRequestEncodeFail,
336 e2err_RICSubscriptionRequestAllocE2AP_PDUFail,
337 e2err_RICEventTriggerDefinitionIEValueFail_1,
338 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail,
339 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail,
340 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail,
341 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail,
342 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail,
343 e2err_RICEventTriggerDefinitionIEValueFail_2,
344 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail,
345 e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail,
346 e2err_RICEventTriggerDefinitionIEValueFail_3,
347 e2err_RICEventTriggerDefinitionIEValueFail_4,
348 e2err_RICEventTriggerDefinitionPackFail_1,
349 e2err_RICEventTriggerDefinitionPackFail_2,
350 e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail,
351 e2err_RICSubscriptionResponseAllocRICrequestIDFail,
352 e2err_RICSubscriptionResponseAllocRANfunctionIDFail,
353 e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail,
354 e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail,
355 e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail,
356 e2err_RICSubscriptionResponseAllocRICActionNotAdmittedListFail,
357 e2err_RICSubscriptionResponseEncodeFail,
358 e2err_RICSubscriptionResponseAllocE2AP_PDUFail,
359 e2err_RICSubscriptionFailureAllocRICrequestIDFail,
360 e2err_RICSubscriptionFailureAllocRANfunctionIDFail,
361 e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail,
362 e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail,
363 e2err_RICSubscriptionFailureEncodeFail,
364 e2err_RICSubscriptionFailureAllocE2AP_PDUFail,
365 e2err_RICIndicationRICrequestIDFail,
366 e2err_RICIndicationAllocRANfunctionIDFail,
367 e2err_RICIndicationAllocRICactionIDFail,
368 e2err_RICIndicationAllocRICindicationSNFail,
369 e2err_RICIndicationAllocRICindicationTypeFail,
370 e2err_RICIndicationAllocRRICindicationHeaderBufFail,
371 e2err_RICIndicationAllocRICindicationHeaderFail,
372 e2err_RICIndicationAllocRICindicationMessageBufFail,
373 e2err_RICIndicationAllocRICindicationMessageFail,
374 e2err_RICIndicationEncodeFail,
375 e2err_RICIndicationAllocE2AP_PDUFail,
376 e2err_RICindicationHeaderIEValueFail_1,
377 e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDpLMN_IdentityBufFail,
378 e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail,
379 e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDhome_eNB_IDBufFail,
380 e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail,
381 e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail,
382 e2err_RICindicationHeaderIEValueFail_2,
383 e2err_RICIndicationAllocRICIndicationHeaderglobal_gNB_IDpLMN_IdentityBufFail,
384 e2err_RICIndicationAllocRICIndicationHeaderglobal_gNB_IDgNB_IDgNB_IDBufFail,
385 e2err_RICindicationHeaderIEValueFail_3,
386 e2err_RICindicationHeaderPackFail_1,
387 e2err_RICindicationHeaderPackFail_2,
388 e2err_RICIndicationHeaderAllocE2AP_PDUFail,
389 e2err_RICIndicationMessageAllocinterfaceMessageFail,
390 e2err_RICindicationMessagePackFail_1,
391 e2err_RICindicationMessagePackFail_2,
392 e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail,
393 e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail,
394 e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail,
395 e2err_RICSubscriptionDeleteRequestEncodeFail,
396 e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail,
397 e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail,
398 e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail,
399 e2err_RICSubscriptionDeleteResponseEncodeFail,
400 e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail,
401 e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail,
402 e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail,
403 e2err_RICSubscriptionDeleteFailureAllocRICcauseFail,
404 e2err_RICSubscriptionDeleteFailureEncodeFail,
405 e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail,
406 e2err_RICsubscriptionRequestRICrequestIDMissing,
407 e2err_RICsubscriptionRequestRANfunctionIDMissing,
408 e2err_RICsubscriptionRequestICsubscriptionMissing,
409 e2err_RICEventTriggerDefinitionIEValueFail_5,
410 e2err_RICEventTriggerDefinitionIEValueFail_6,
411 e2err_RICEventTriggerDefinitionIEValueFail_7,
412 e2err_RICEventTriggerDefinitionIEValueFail_8,
413 e2err_RICEventTriggerDefinitionDecodeWMOREFail,
414 e2err_RICEventTriggerDefinitionDecodeFAIL,
415 e2err_RICEventTriggerDefinitionDecodeDefaultFail,
416 e2err_RICsubscriptionResponseRICrequestIDMissing,
417 e2err_RICsubscriptionResponseRANfunctionIDMissing,
418 e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing,
419 e2err_RICsubscriptionResponseRICaction_NotAdmitted_ListMissing,
420 e2err_RICsubscriptionFailureRICrequestIDMissing,
421 e2err_RICsubscriptionFailureRANfunctionIDMissing,
422 e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing,
423 e2err_RICindicationRICrequestIDMissing,
424 e2err_RICindicationRANfunctionIDMissing,
425 e2err_RICindicationRICactionIDMissing,
426 e2err_RICindicationRICindicationSNMissing,
427 e2err_RICindicationRICindicationTypeMissing,
428 e2err_RICIndicationHeaderContentLengthFail,
429 e2err_RICindicationRICindicationHeaderMissing,
430 e2err_RICIndicationMessageContentLengthFail,
431 e2err_RICindicationRICindicationMessageMissing,
432 e2err_RICEventTriggerDefinitionIEValueFail_9,
433 e2err_RICEventTriggerDefinitionIEValueFail_10,
434 e2err_RICEventTriggerDefinitionIEValueFail_11,
435 e2err_RICIndicationHeaderDecodeWMOREFail,
436 e2err_RICIndicationHeaderDecodeFAIL,
437 e2err_RICIndicationHeaderDecodeDefaultFail,
438 e2err_RICIndicationMessageIEContentLengthFail,
439 e2err_RICIndicationMessageDecodeWMOREFail,
440 e2err_RICIndicationMessageDecodeFAIL,
441 e2err_RICIndicationMessageDecodeDefaultFail,
442 e2err_RICsubscriptionDeleteRequestRICrequestIDMissing,
443 e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing,
444 e2err_RICsubscriptionDeleteResponseRICrequestIDMissing,
445 e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing,
446 e2err_RICsubscriptionDeleteFailureRICrequestIDMissing,
447 e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing,
448 e2err_RICsubscriptionDeleteFailureRICcauseMissing
449};
450
451
452static const char* const E2ErrorStrings[] = {
453 "e2err_OK",
454 "e2err_RICSubscriptionRequestAllocRICrequestIDFail",
455 "e2err_RICSubscriptionRequestAllocRANfunctionIDFail",
456 "e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail",
457 "e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail",
458 "e2err_RICSubscriptionRequestAllocRICsubsequentActionFail",
459 "e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail",
460 "e2err_RICSubscriptionRequestEncodeFail",
461 "e2err_RICSubscriptionRequestAllocE2AP_PDUFail",
462 "e2err_RICEventTriggerDefinitionIEValueFail_1",
463 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail",
464 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail",
465 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail",
466 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail",
467 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail",
468 "e2err_RICEventTriggerDefinitionIEValueFail_2",
469 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail",
470 "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail",
471 "e2err_RICEventTriggerDefinitionIEValueFail_3",
472 "e2err_RICEventTriggerDefinitionIEValueFail_4",
473 "e2err_RICEventTriggerDefinitionPackFail_1",
474 "e2err_RICEventTriggerDefinitionPackFail_2",
475 "e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail",
476 "e2err_RICSubscriptionResponseAllocRICrequestIDFail",
477 "e2err_RICSubscriptionResponseAllocRANfunctionIDFail",
478 "e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail",
479 "e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail",
480 "e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail",
481 "e2err_RICSubscriptionResponseAllocRICActionNotAdmittedListFail",
482 "e2err_RICSubscriptionResponseEncodeFail",
483 "e2err_RICSubscriptionResponseAllocE2AP_PDUFail",
484 "e2err_RICSubscriptionFailureAllocRICrequestIDFail",
485 "e2err_RICSubscriptionFailureAllocRANfunctionIDFail",
486 "e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail",
487 "e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail",
488 "e2err_RICSubscriptionFailureEncodeFail",
489 "e2err_RICSubscriptionFailureAllocE2AP_PDUFail",
490 "e2err_RICIndicationRICrequestIDFail",
491 "e2err_RICIndicationAllocRANfunctionIDFail",
492 "e2err_RICIndicationAllocRICactionIDFail",
493 "e2err_RICIndicationAllocRICindicationSNFail",
494 "e2err_RICIndicationAllocRICindicationTypeFail",
495 "e2err_RICIndicationAllocRRICindicationHeaderBufFail",
496 "e2err_RICIndicationAllocRICindicationHeaderFail",
497 "e2err_RICIndicationAllocRICindicationMessageBufFail",
498 "e2err_RICIndicationAllocRICindicationMessageFail",
499 "e2err_RICIndicationEncodeFail",
500 "e2err_RICIndicationAllocE2AP_PDUFail",
501 "e2err_RICindicationHeaderIEValueFail_1",
502 "e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDpLMN_IdentityBufFail",
503 "e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail",
504 "e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDhome_eNB_IDBufFail",
505 "e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail",
506 "e2err_RICIndicationAllocRICIndicationHeaderglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail",
507 "e2err_RICindicationHeaderIEValueFail_2",
508 "e2err_RICIndicationAllocRICIndicationHeaderglobal_gNB_IDpLMN_IdentityBufFail",
509 "e2err_RICIndicationAllocRICIndicationHeaderglobal_gNB_IDgNB_IDgNB_IDBufFail",
510 "e2err_RICindicationHeaderIEValueFail_3",
511 "e2err_RICindicationHeaderPackFail_1",
512 "e2err_RICindicationHeaderPackFail_2",
513 "e2err_RICIndicationHeaderAllocE2AP_PDUFail",
514 "e2err_RICIndicationMessageAllocinterfaceMessageFail",
515 "e2err_RICindicationMessagePackFail_1",
516 "e2err_RICindicationMessagePackFail_2",
517 "e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail",
518 "e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail",
519 "e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail",
520 "e2err_RICSubscriptionDeleteRequestEncodeFail",
521 "e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail",
522 "e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail",
523 "e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail",
524 "e2err_RICSubscriptionDeleteResponseEncodeFail",
525 "e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail",
526 "e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail",
527 "e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail",
528 "e2err_RICSubscriptionDeleteFailureAllocRICcauseFail",
529 "e2err_RICSubscriptionDeleteFailureEncodeFail",
530 "e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail",
531 "e2err_RICsubscriptionRequestRICrequestIDMissing",
532 "e2err_RICsubscriptionRequestRANfunctionIDMissing",
533 "e2err_RICsubscriptionRequestICsubscriptionMissing",
534 "e2err_RICEventTriggerDefinitionIEValueFail_5",
535 "e2err_RICEventTriggerDefinitionIEValueFail_6",
536 "e2err_RICEventTriggerDefinitionIEValueFail_7",
537 "e2err_RICEventTriggerDefinitionIEValueFail_8",
538 "e2err_RICEventTriggerDefinitionDecodeWMOREFail",
539 "e2err_RICEventTriggerDefinitionDecodeFAIL",
540 "e2err_RICEventTriggerDefinitionDecodeDefaultFail",
541 "e2err_RICsubscriptionResponseRICrequestIDMissing",
542 "e2err_RICsubscriptionResponseRANfunctionIDMissing",
543 "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing",
544 "e2err_RICsubscriptionResponseRICaction_NotAdmitted_ListMissing",
545 "e2err_RICsubscriptionFailureRICrequestIDMissing",
546 "e2err_RICsubscriptionFailureRANfunctionIDMissing",
547 "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing",
548 "e2err_RICindicationRICrequestIDMissing",
549 "e2err_RICindicationRANfunctionIDMissing",
550 "e2err_RICindicationRICactionIDMissing",
551 "e2err_RICindicationRICindicationSNMissing",
552 "e2err_RICindicationRICindicationTypeMissing",
553 "e2err_RICIndicationHeaderContentLengthFail",
554 "e2err_RICindicationRICindicationHeaderMissing",
555 "e2err_RICIndicationMessageContentLengthFail",
556 "e2err_RICindicationRICindicationMessageMissing",
557 "e2err_RICEventTriggerDefinitionIEValueFail_9",
558 "e2err_RICEventTriggerDefinitionIEValueFail_10",
559 "e2err_RICEventTriggerDefinitionIEValueFail_11",
560 "e2err_RICIndicationHeaderDecodeWMOREFail",
561 "e2err_RICIndicationHeaderDecodeFAIL",
562 "e2err_RICIndicationHeaderDecodeDefaultFail",
563 "e2err_RICIndicationMessageIEContentLengthFail",
564 "e2err_RICIndicationMessageDecodeWMOREFail",
565 "e2err_RICIndicationMessageDecodeFAIL",
566 "e2err_RICIndicationMessageDecodeDefaultFail",
567 "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing",
568 "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing",
569 "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing",
570 "e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing",
571 "e2err_RICsubscriptionDeleteFailureRICrequestIDMissing",
572 "e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing",
573 "e2err_RICsubscriptionDeleteFailureRICcauseMissing"
574};
575
576typedef struct {
577 uint64_t messageType; // Initiating message or Successful outcome or Unsuccessful outcome
578 uint64_t messageId;
579} E2MessageInfo_t;
580
581//////////////////////////////////////////////////////////////////////
582// Message definitons
583
584// Below constant values are same as in E2AP, E2SM and X2AP specs
585extern const uint64_t cE2InitiatingMessage;
586extern const uint64_t cE2SuccessfulOutcome;
587extern const uint64_t cE2UnsuccessfulOutcome;
588
589// E2AP messages. Below message id constant values are the same as in ASN.1 specification
590
591// Initiating message
592extern const uint64_t cRICSubscriptionRequest;
593extern const uint64_t cRICSubscriptionDeleteRequest;
594extern const uint64_t cRICIndication;
595
596// Successful outcome
597extern const uint64_t cRICSubscriptionResponse;
598extern const uint64_t cRICsubscriptionDeleteResponse;
599
600// Unsuccessful outcome
601extern const uint64_t cRICSubscriptionFailure;
602extern const uint64_t cRICsubscriptionDeleteFailure;
603
604typedef struct {
605 RICRequestID_t ricRequestID;
606 RANFunctionID_t ranFunctionID;
607 RICSubscription_t ricSubscription;
608} RICSubscriptionRequest_t;
609
610typedef struct {
611 RICRequestID_t ricRequestID;
612 RANFunctionID_t ranFunctionID;
613 RICActionAdmittedList_t ricActionAdmittedList;
614 bool ricActionNotAdmittedListPresent;
615 RICActionNotAdmittedList_t ricActionNotAdmittedList;
616} RICSubscriptionResponse_t;
617
618
619typedef struct {
620 RICRequestID_t ricRequestID;
621 RANFunctionID_t ranFunctionID;
622 RICActionNotAdmittedList_t ricActionNotAdmittedList;
623 bool criticalityDiagnosticsPresent;
624 CriticalityDiagnostics__t criticalityDiagnostics;
625} RICSubscriptionFailure_t;
626
627typedef struct {
628 RICRequestID_t ricRequestID;
629 RANFunctionID_t ranFunctionID;
630 RICActionID_t ricActionID;
631 RICIndicationSN_t ricIndicationSN;
632 uint64_t ricIndicationType; // this is type of enum RICIndicationType_t
633 RICIndicationHeader_t ricIndicationHeader;
634 RICIndicationMessage_t ricIndicationMessage;
635 RICCallProcessID_t ricCallProcessID; // Not usein RIC currently
636} RICIndication_t;
637
638typedef struct {
639 RICRequestID_t ricRequestID;
640 RANFunctionID_t ranFunctionID;
641} RICSubscriptionDeleteRequest_t;
642
643typedef struct {
644 RICRequestID_t ricRequestID;
645 RANFunctionID_t ranFunctionID;
646} RICSubscriptionDeleteResponse_t;
647
648typedef struct {
649 RICRequestID_t ricRequestID;
650 RANFunctionID_t ranFunctionID;
651 RICCause_t ricCause;
652 bool criticalityDiagnosticsPresent;
653 CriticalityDiagnostics__t criticalityDiagnostics; // Not usein RIC currently
654} RICSubscriptionDeleteFailure_t;
655
656//////////////////////////////////////////////////////////////////////
657// Function declarations
658
659const char* getE2ErrorString(uint64_t);
660
661typedef void* e2ap_pdu_ptr_t;
662
663uint64_t packRICSubscriptionRequest(size_t*, byte*, char*,RICSubscriptionRequest_t*);
664uint64_t packRICEventTriggerDefinition(char*,RICEventTriggerDefinition_t*);
665uint64_t packRICSubscriptionResponse(size_t*, byte*, char*,RICSubscriptionResponse_t*);
666uint64_t packRICSubscriptionFailure(size_t*, byte*, char*,RICSubscriptionFailure_t*);
667uint64_t packRICIndication(size_t*, byte*, char*,RICIndication_t*);
668uint64_t packRICIndicationHeader(char*,RICIndicationHeader_t*);
669uint64_t packRICIndicationMessage(char*,RICIndicationMessage_t*);
670uint64_t packRICSubscriptionDeleteRequest(size_t*, byte*, char*,RICSubscriptionDeleteRequest_t*);
671uint64_t packRICSubscriptionDeleteResponse(size_t*, byte*, char*,RICSubscriptionDeleteResponse_t*);
672uint64_t packRICSubscriptionDeleteFailure(size_t*, byte*, char*,RICSubscriptionDeleteFailure_t*);
673
674e2ap_pdu_ptr_t* unpackE2AP_pdu(const size_t, const byte*, char*, E2MessageInfo_t*);
675uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*);
676uint64_t getRICEventTriggerDefinitionData(RICEventTriggerDefinition_t*);
677uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t*, RICSubscriptionResponse_t*);
678uint64_t getRICSubscriptionFailureData(e2ap_pdu_ptr_t*, RICSubscriptionFailure_t*);
679uint64_t getRICIndicationData(e2ap_pdu_ptr_t*, RICIndication_t*);
680uint64_t getRICIndicationHeaderData(RICIndicationHeader_t*);
681uint64_t getRICIndicationMessageData(RICIndicationMessage_t*);
682uint64_t getRICSubscriptionDeleteRequestData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteRequest_t*);
683uint64_t getRICSubscriptionDeleteResponseData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteResponse_t*);
684uint64_t getRICSubscriptionDeleteFailureData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteFailure_t*);
685
686
687#if DEBUG
688bool TestRICSubscriptionRequest();
689bool TestRICSubscriptionResponse();
690bool TestRICSubscriptionFailure();
691bool TestRICIndication();
692bool TestRICSubscriptionDeleteRequest();
693bool TestRICSubscriptionDeleteResponse();
694bool TestRICSubscriptionDeleteFailure();
695
696void printRICSubscriptionRequest(const RICSubscriptionRequest_t*);
697void printRICSubscriptionResponse(const RICSubscriptionResponse_t*);
698void printRICSubscriptionFailure(const RICSubscriptionFailure_t*);
699void printRICIndication(const RICIndication_t*);
700void printRICSubscriptionDeleteRequest(const RICSubscriptionDeleteRequest_t*);
701void printRICSubscriptionDeleteResponse(const RICSubscriptionDeleteResponse_t*);
702void printRICSubscriptionDeleteFailure(const RICSubscriptionDeleteFailure_t*);
703#endif
704
705#ifdef __cplusplus
706}
707#endif
708
709#endif