blob: 5ae0933b71a44cbf8385c9e31a384c42ece40374 [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#if DEBUG
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25
26#include "E2AP_if.h"
27
28const size_t cDataBufferSize = 2048;
29
30typedef union {
31 uint32_t nodeID;
32 uint8_t octets[4];
33} IdOctects_t;
34
35//////////////////////////////////////////////////////////////////////
36bool TestRICSubscriptionRequest() {
37 RICSubscriptionRequest_t ricSubscriptionRequest;
38 ricSubscriptionRequest.ricRequestID.ricRequestorID = 1;
39 ricSubscriptionRequest.ricRequestID.ricRequestSequenceNumber = 22;
40 ricSubscriptionRequest.ranFunctionID = 33;
41
42 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.octetString.contentLength = 0;
43
44 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBIDPresent = true;
45 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalGNBIDPresent = false;
46 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.contentLength = 3;
47 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] = 1;
48 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] = 2;
49 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] = 3;
50
51// ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.eNBID.bits = cMacroENBIDP_20Bits;
52// ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.eNBID.bits = cHomeENBID_28Bits;
53// ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.eNBID.bits = cShortMacroENBID_18Bits;
54 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeID.bits = clongMacroENBIDP_21Bits;
55
56 IdOctects_t eNBOctects;
57 memset(eNBOctects.octets, 0, sizeof(eNBOctects));
58 eNBOctects.octets[0] = 11;
59 eNBOctects.octets[1] = 22;
60 eNBOctects.octets[2] = 31;
61 eNBOctects.octets[3] = 1;
62 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
63 printf("eNBOctects.nodeID = %u\n\n",eNBOctects.nodeID);
64
65 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceDirection = InterfaceDirection__incoming;
66 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceMessageType.procedureCode = 35; // id-rRCTransfer
67 ricSubscriptionRequest.ricSubscription.ricEventTriggerDefinition.interfaceMessageType.typeOfMessage = cE2InitiatingMessage;
68
69 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.contentLength = 1;
70 uint64_t index = 0;
71 while (index < ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.contentLength) {
72 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionID = 255; //index;
73 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionType = RICActionType_insert;
74
75 // ricActionDefinition, OPTIONAL. Not used in RIC
76 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent = false; //true;
77 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.styleID = 255;
78 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.sequenceOfActionParameters.parameterID = 222;
79
80 // ricSubsequentActionPresent, OPTIONAL
81 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent = true;
82 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType = RICSubsequentActionType_Continue;
83 ricSubscriptionRequest.ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricTimeToWait = RICTimeToWait_w100ms;
84 index++;
85 }
86
87 printRICSubscriptionRequest(&ricSubscriptionRequest);
88
89 uint64_t logBufferSize = 1024;
90 char logBuffer[logBufferSize];
91 uint64_t dataBufferSize = cDataBufferSize;
92 byte dataBuffer[dataBufferSize];
93 if (packRICSubscriptionRequest(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionRequest) == e2err_OK)
94 {
95 memset(&ricSubscriptionRequest,0, sizeof ricSubscriptionRequest);
96 uint64_t returnCode;
97 E2MessageInfo_t messageInfo;
98 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
99 if (pE2AP_PDU != 0) {
100 if (messageInfo.messageType == cE2InitiatingMessage) {
101 if (messageInfo.messageId == cRICSubscriptionRequest) {
102 if ((returnCode = getRICSubscriptionRequestData(pE2AP_PDU, &ricSubscriptionRequest)) == e2err_OK) {
103 printRICSubscriptionRequest(&ricSubscriptionRequest);
104 return true;
105 }
106 else
107 printf("Error in getRICSubscriptionRequestData. ReturnCode = %s",getE2ErrorString(returnCode));
108 }
109 else
110 printf("Not RICSubscriptionRequest\n");
111 }
112 else
113 printf("Not InitiatingMessage\n");
114 }
115 else
116 printf("%s",logBuffer);
117 }
118 else
119 printf("%s",logBuffer);
120 return false;
121}
122
123//////////////////////////////////////////////////////////////////////
124bool TestRICSubscriptionResponse() {
125 // Test RICSubscribeResponse
126 RICSubscriptionResponse_t ricSubscriptionResponse;
127 ricSubscriptionResponse.ricRequestID.ricRequestorID = 1;
128 ricSubscriptionResponse.ricRequestID.ricRequestSequenceNumber = 22;
129 ricSubscriptionResponse.ranFunctionID = 33;
130 ricSubscriptionResponse.ricActionAdmittedList.contentLength = 16;
131 uint64_t index = 0;
132 while (index < ricSubscriptionResponse.ricActionAdmittedList.contentLength) {
133 ricSubscriptionResponse.ricActionAdmittedList.ricActionID[index] = index;
134 index++;
135 }
136 ricSubscriptionResponse.ricActionNotAdmittedListPresent = true;
137 ricSubscriptionResponse.ricActionNotAdmittedList.contentLength = 16;
138 index = 0;
139 while (index < ricSubscriptionResponse.ricActionNotAdmittedList.contentLength) {
140 ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = index;
141 ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content = cRICCauseRadioNetwork;
142 ricSubscriptionResponse.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause = index;
143 index++;
144 }
145
146 printRICSubscriptionResponse(&ricSubscriptionResponse);
147
148 uint64_t logBufferSize = 1024;
149 char logBuffer[logBufferSize];
150 uint64_t dataBufferSize = cDataBufferSize;
151 byte dataBuffer[dataBufferSize];
152 if (packRICSubscriptionResponse(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionResponse) == e2err_OK)
153 {
154 memset(&ricSubscriptionResponse,0, sizeof ricSubscriptionResponse);
155 uint64_t returnCode;
156 E2MessageInfo_t messageInfo;
157 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
158 if (pE2AP_PDU != 0) {
159 if (messageInfo.messageType == cE2SuccessfulOutcome) {
160 if (messageInfo.messageId == cRICSubscriptionResponse) {
161 if ((returnCode = getRICSubscriptionResponseData(pE2AP_PDU, &ricSubscriptionResponse)) == e2err_OK) {
162 printRICSubscriptionResponse(&ricSubscriptionResponse);
163 return true;
164 }
165 else
166 printf("Error in getRICSubscriptionResponseData. ReturnCode = %s",getE2ErrorString(returnCode));
167 }
168 else
169 printf("Not RICSubscriptionResponse\n");
170 }
171 else
172 printf("Not SuccessfulOutcome\n");
173 }
174 else
175 printf("%s",logBuffer);
176 }
177 else
178 printf("%s",logBuffer);
179 return false;
180}
181
182//////////////////////////////////////////////////////////////////////
183bool TestRICSubscriptionFailure() {
184 // Test RICSubscribeFailure
185 RICSubscriptionFailure_t ricSubscriptionFailure;
186 ricSubscriptionFailure.ricRequestID.ricRequestorID = 1;
187 ricSubscriptionFailure.ricRequestID.ricRequestSequenceNumber = 22;
188 ricSubscriptionFailure.ranFunctionID = 33;
189 ricSubscriptionFailure.ricActionNotAdmittedList.contentLength = 16;
190 uint64_t index = 0;
191 while (index < ricSubscriptionFailure.ricActionNotAdmittedList.contentLength) {
192 ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = index;
193 ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content = cRICCauseRadioNetwork;
194 ricSubscriptionFailure.ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause = index;
195 index++;
196 }
197 // CriticalityDiagnostics, OPTIONAL. Not used in RIC
198 ricSubscriptionFailure.criticalityDiagnosticsPresent = false;
199 ricSubscriptionFailure.criticalityDiagnostics.procedureCodePresent = true;
200 ricSubscriptionFailure.criticalityDiagnostics.procedureCode = 1;
201 ricSubscriptionFailure.criticalityDiagnostics.triggeringMessagePresent = true;
202 ricSubscriptionFailure.criticalityDiagnostics.triggeringMessage = TriggeringMessage__initiating_message;
203 ricSubscriptionFailure.criticalityDiagnostics.procedureCriticalityPresent = true;
204 ricSubscriptionFailure.criticalityDiagnostics.procedureCriticality = Criticality__reject;
205
206 ricSubscriptionFailure.criticalityDiagnostics.iEsCriticalityDiagnosticsPresent = false;
207 ricSubscriptionFailure.criticalityDiagnostics.criticalityDiagnosticsIELength = 256;
208 uint16_t index2 = 0;
209 while (index2 < ricSubscriptionFailure.criticalityDiagnostics.criticalityDiagnosticsIELength) {
210 ricSubscriptionFailure.criticalityDiagnostics.criticalityDiagnosticsIEListItem[index2].iECriticality = Criticality__reject;
211 ricSubscriptionFailure.criticalityDiagnostics.criticalityDiagnosticsIEListItem[index2].iE_ID = index2;
212 ricSubscriptionFailure.criticalityDiagnostics.criticalityDiagnosticsIEListItem[index2].typeOfError = TypeOfError_missing;
213 index2++;
214 }
215
216 printRICSubscriptionFailure(&ricSubscriptionFailure);
217
218 uint64_t logBufferSize = 1024;
219 char logBuffer[logBufferSize];
220 uint64_t dataBufferSize = cDataBufferSize;
221 byte dataBuffer[dataBufferSize];
222 if (packRICSubscriptionFailure(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionFailure) == e2err_OK)
223 {
224 memset(&ricSubscriptionFailure,0, sizeof ricSubscriptionFailure);
225 uint64_t returnCode;
226 E2MessageInfo_t messageInfo;
227 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
228 if (pE2AP_PDU != 0) {
229 if (messageInfo.messageType == cE2UnsuccessfulOutcome) {
230 if (messageInfo.messageId == cRICSubscriptionFailure) {
231 if ((returnCode = getRICSubscriptionFailureData(pE2AP_PDU, &ricSubscriptionFailure)) == e2err_OK) {
232 printRICSubscriptionFailure(&ricSubscriptionFailure);
233 return true;
234 }
235 else
236 printf("Error in getRICSubscriptionFailureData. ReturnCode = %s",getE2ErrorString(returnCode));
237 }
238 else
239 printf("Not RICSubscriptionFailure\n");
240 }
241 else
242 printf("Not UnuccessfulOutcome\n");
243 }
244 else
245 printf("%s",logBuffer);
246 }
247 else
248 printf("%s",logBuffer);
249 return false;
250}
251
252//////////////////////////////////////////////////////////////////////
253bool TestRICIndication() {
254 // Test RICIndication
255 RICIndication_t ricIndication;
256
257 ricIndication.ricRequestID.ricRequestorID = 1;
258 ricIndication.ricRequestID.ricRequestSequenceNumber = 22;
259 ricIndication.ranFunctionID = 33;
260 ricIndication.ricActionID = 44;
261 ricIndication.ricIndicationSN = 55;
262 ricIndication.ricIndicationType = RICIndicationType_RICIndicationTypeReport;
263
264 ricIndication.ricIndicationHeader.interfaceID.globalGNBIDPresent = false;
265 ricIndication.ricIndicationHeader.interfaceID.globalENBIDPresent = true;
266 ricIndication.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.contentLength = 3;
267
268 ricIndication.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] = 1;
269 ricIndication.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] = 2;
270 ricIndication.ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] = 3;
271
272// ricIndication.ricIndicationHeader.interfaceID.globalENBID.nodeID.bits = cMacroENBIDP_20Bits;
273// ricIndication.ricIndicationHeader.interfaceID.globalENBID.nodeID.bits = cHomeENBID_28Bits;
274// ricIndication.ricIndicationHeader.interfaceID.globalENBID.nodeID.bits = cShortMacroENBID_18Bits;
275 ricIndication.ricIndicationHeader.interfaceID.globalENBID.nodeID.bits = clongMacroENBIDP_21Bits;
276
277 IdOctects_t eNBOctects;
278 memset(eNBOctects.octets, 0, sizeof(eNBOctects));
279 eNBOctects.octets[0] = 11;
280 eNBOctects.octets[1] = 22;
281 eNBOctects.octets[2] = 31;
282 eNBOctects.octets[3] = 1;
283 ricIndication.ricIndicationHeader.interfaceID.globalENBID.nodeID.nodeID = eNBOctects.nodeID;
284 printf("eNBOctects.nodeID = %u",eNBOctects.nodeID);
285
286 ricIndication.ricIndicationHeader.interfaceDirection = InterfaceDirection__incoming;
287
288 char data[] = "Hello world";
289 ricIndication.ricIndicationMessage.interfaceMessage.contentLength = sizeof(data);
290 memcpy(ricIndication.ricIndicationMessage.interfaceMessage.data,data,sizeof(data));
291
292 printRICIndication(&ricIndication);
293
294 uint64_t logBufferSize = 1024;
295 char logBuffer[logBufferSize];
296 uint64_t dataBufferSize = cDataBufferSize;
297 byte dataBuffer[dataBufferSize];
298 if (packRICIndication(&dataBufferSize, dataBuffer, logBuffer, &ricIndication) == e2err_OK)
299 {
300 memset(&ricIndication,0, sizeof ricIndication);
301 uint64_t returnCode;
302 E2MessageInfo_t messageInfo;
303 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
304 if (pE2AP_PDU != 0) {
305 if (messageInfo.messageType == cE2InitiatingMessage) {
306 if (messageInfo.messageId == cRICIndication) {
307 // RICindication
308 if ((returnCode = getRICIndicationData(pE2AP_PDU, &ricIndication)) == e2err_OK) {
309 printRICIndication(&ricIndication);
310 return true;
311 }
312 else
313 printf("Error in getRICIndicationData. ReturnCode = %s",getE2ErrorString(returnCode));
314 }
315 else
316 printf("Not RICIndication\n");
317 }
318 else
319 printf("Not InitiatingMessage\n");
320 }
321 else
322 printf("%s",logBuffer);
323 }
324 else
325 printf("%s",logBuffer);
326 return false;
327}
328
329//////////////////////////////////////////////////////////////////////
330bool TestRICSubscriptionDeleteRequest() {
331
332 RICSubscriptionDeleteRequest_t ricSubscriptionDeleteRequest;
333 ricSubscriptionDeleteRequest.ricRequestID.ricRequestorID = 1;
334 ricSubscriptionDeleteRequest.ricRequestID.ricRequestSequenceNumber = 22;
335 ricSubscriptionDeleteRequest.ranFunctionID = 33;
336
337 printRICSubscriptionDeleteRequest(&ricSubscriptionDeleteRequest);
338
339 uint64_t logBufferSize = 1024;
340 char logBuffer[logBufferSize];
341 uint64_t dataBufferSize = cDataBufferSize;
342 byte dataBuffer[cDataBufferSize];
343 if ((packRICSubscriptionDeleteRequest(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionDeleteRequest)) == e2err_OK)
344 {
345 memset(&ricSubscriptionDeleteRequest,0, sizeof ricSubscriptionDeleteRequest);
346 uint64_t returnCode;
347 E2MessageInfo_t messageInfo;
348 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
349 if (pE2AP_PDU != 0) {
350 if (messageInfo.messageType == cE2InitiatingMessage) {
351 if (messageInfo.messageId == cRICSubscriptionDeleteRequest) {
352 if ((returnCode = getRICSubscriptionDeleteRequestData(pE2AP_PDU, &ricSubscriptionDeleteRequest)) == e2err_OK) {
353 printRICSubscriptionDeleteRequest(&ricSubscriptionDeleteRequest);
354 return true;
355 }
356 else
357 printf("Error in getRICSubscriptionDeleteRequestData. ReturnCode = %s",getE2ErrorString(returnCode));
358 }
359 else
360 printf("Not RICSubscriptionDeleteRequest\n");
361 }
362 else
363 printf("Not InitiatingMessage\n");
364 }
365 else
366 printf("%s",logBuffer);
367 }
368 else
369 printf("%s",logBuffer);
370 return false;
371}
372
373//////////////////////////////////////////////////////////////////////
374bool TestRICSubscriptionDeleteResponse() {
375
376 RICSubscriptionDeleteResponse_t ricSubscriptionDeleteResponse;
377 ricSubscriptionDeleteResponse.ricRequestID.ricRequestorID = 1;
378 ricSubscriptionDeleteResponse.ricRequestID.ricRequestSequenceNumber = 22;
379 ricSubscriptionDeleteResponse.ranFunctionID = 33;
380
381 printRICSubscriptionDeleteResponse(&ricSubscriptionDeleteResponse);
382
383 uint64_t logBufferSize = 1024;
384 char logBuffer[logBufferSize];
385 uint64_t dataBufferSize = cDataBufferSize;
386 byte dataBuffer[dataBufferSize];
387 if ((packRICSubscriptionDeleteResponse(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionDeleteResponse)) == e2err_OK)
388 {
389 memset(&ricSubscriptionDeleteResponse,0, sizeof ricSubscriptionDeleteResponse);
390 uint64_t returnCode;
391 E2MessageInfo_t messageInfo;
392 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
393 if (pE2AP_PDU != 0) {
394 if (messageInfo.messageType == cE2SuccessfulOutcome) {
395 if (messageInfo.messageId == cRICsubscriptionDeleteResponse) {
396 if ((returnCode = getRICSubscriptionDeleteResponseData(pE2AP_PDU, &ricSubscriptionDeleteResponse)) == e2err_OK) {
397 printRICSubscriptionDeleteResponse(&ricSubscriptionDeleteResponse);
398 return true;
399 }
400 else
401 printf("Error in getRICSubscriptionDeleteResponseData. ReturnCode = %s",getE2ErrorString(returnCode));
402 }
403 else
404 printf("Not RICSubscriptionDeleteResponse\n");
405 }
406 else
407 printf("Not SuccessfulOutcome\n");
408 }
409 else
410 printf("%s",logBuffer);
411 }
412 else
413 printf("%s",logBuffer);
414 return false;
415}
416
417//////////////////////////////////////////////////////////////////////
418bool TestRICSubscriptionDeleteFailure() {
419
420 RICSubscriptionDeleteFailure_t ricSubscriptionDeleteFailure;
421 ricSubscriptionDeleteFailure.ricRequestID.ricRequestorID = 1;
422 ricSubscriptionDeleteFailure.ricRequestID.ricRequestSequenceNumber = 22;
423 ricSubscriptionDeleteFailure.ranFunctionID = 33;
424 ricSubscriptionDeleteFailure.ricCause.content = cRICCauseRadioNetwork;
425 ricSubscriptionDeleteFailure.ricCause.cause = 3;
426
427 printRICSubscriptionDeleteFailure(&ricSubscriptionDeleteFailure);
428
429 uint64_t logBufferSize = 1024;
430 char logBuffer[logBufferSize];
431 uint64_t dataBufferSize = cDataBufferSize;
432 byte dataBuffer[dataBufferSize];
433 if ((packRICSubscriptionDeleteFailure(&dataBufferSize, dataBuffer, logBuffer, &ricSubscriptionDeleteFailure)) == e2err_OK)
434 {
435 memset(&ricSubscriptionDeleteFailure,0, sizeof ricSubscriptionDeleteFailure);
436 uint64_t returnCode;
437 E2MessageInfo_t messageInfo;
438 e2ap_pdu_ptr_t* pE2AP_PDU = unpackE2AP_pdu(dataBufferSize, dataBuffer, logBuffer, &messageInfo);
439 if (pE2AP_PDU != 0) {
440 if (messageInfo.messageType == cE2UnsuccessfulOutcome) {
441 if (messageInfo.messageId == cRICsubscriptionDeleteFailure) {
442 if ((returnCode = getRICSubscriptionDeleteFailureData(pE2AP_PDU, &ricSubscriptionDeleteFailure)) == e2err_OK) {
443 printRICSubscriptionDeleteFailure(&ricSubscriptionDeleteFailure);
444 return true;
445 }
446 else
447 printf("Error in getRICSubscriptionDeleteFailureData. ReturnCode = %s",getE2ErrorString(returnCode));
448 }
449 else
450 printf("Not RICSubscriptionDeleteFailure\n");
451 }
452 else
453 printf("Not UnuccessfulOutcome\n");
454 }
455 else
456 printf("%s",logBuffer);
457 }
458 else
459 printf("%s",logBuffer);
460 return false;
461}
462
463//////////////////////////////////////////////////////////////////////
464void printDataBuffer(const size_t byteCount, const uint8_t* pData) {
465
466 uint64_t index = 0;
467 while (index < byteCount) {
468 if (index % 50 == 0) {
469 printf("\n");
470 }
471 printf("%u ",pData[index]);
472 index++;
473 }
474}
475
476//////////////////////////////////////////////////////////////////////
477void printRICSubscriptionRequest(const RICSubscriptionRequest_t* pRICSubscriptionRequest) {
478 printf("pRICSubscriptionRequest->ricRequestID.ricRequestorID = %u\n", pRICSubscriptionRequest->ricRequestID.ricRequestorID);
479 printf("pRICSubscriptionRequest->ricRequestID.ricRequestSequenceNumber = %u\n", pRICSubscriptionRequest->ricRequestID.ricRequestSequenceNumber);
480 printf("pRICSubscriptionRequest->ranFunctionID = %u\n",pRICSubscriptionRequest->ranFunctionID);
481
482 printf("pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeIDbits = %u\n",
483 (unsigned)pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeID.bits);
484 printf("pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID = %u\n",
485 (unsigned)pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceID.globalENBID.nodeID.nodeID);
486 printf("pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceDirection = %u\n",
487 (unsigned)pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceDirection);
488 printf("pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceMessageType.procedureCode = %u\n",
489 (unsigned)pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceMessageType.procedureCode);
490 printf("pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceMessageType.typeOfMessage = %u\n",
491 (unsigned)pRICSubscriptionRequest->ricSubscription.ricEventTriggerDefinition.interfaceMessageType.typeOfMessage);
492 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.contentLength = %u\n",
493 (unsigned)pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.contentLength);
494
495 uint64_t index = 0;
496 while (index < pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.contentLength) {
497 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionID = %li\n",
498 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionID);
499 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionType = %li\n",
500 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionType);
501 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent = %i\n",
502 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent);
503 if(pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinitionPresent)
504 {
505 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.styleID = %li\n",
506 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.styleID);
507 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.sequenceOfActionParameters.parameterID = %i\n",
508 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricActionDefinition.sequenceOfActionParameters.parameterID);
509 }
510 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent = %i\n",
511 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent);
512 if(pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentActionPresent)
513 {
514 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType = %li\n",
515 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricSubsequentActionType);
516 printf("pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricTimeToWait = %li\n",
517 pRICSubscriptionRequest->ricSubscription.ricActionToBeSetupItemIEs.ricActionToBeSetupItem[index].ricSubsequentAction.ricTimeToWait);
518 }
519 printf("\n\n");
520 index++;
521 }
522 printf("\n\n");
523}
524
525//////////////////////////////////////////////////////////////////////
526void printRICSubscriptionResponse(const RICSubscriptionResponse_t* pRICSubscriptionResponse) {
527
528 printf("pRICSubscriptionResponse->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionResponse->ricRequestID.ricRequestorID);
529 printf("pRICSubscriptionResponse->ricRequestID.ricRequestSequenceNumber = %u\n", pRICSubscriptionResponse->ricRequestID.ricRequestSequenceNumber);
530 printf("pRICSubscriptionResponse->ranFunctionID = %u\n",pRICSubscriptionResponse->ranFunctionID);
531 printf("pRICSubscriptionResponse->ricActionAdmittedList.contentLength = %u\n",(unsigned)pRICSubscriptionResponse->ricActionAdmittedList.contentLength);
532 uint64_t index = 0;
533 while (index < pRICSubscriptionResponse->ricActionAdmittedList.contentLength) {
534 printf("pRICSubscriptionResponse->ricActionAdmittedList.ricActionID[index] = %lu\n",pRICSubscriptionResponse->ricActionAdmittedList.ricActionID[index]);
535 index++;
536 }
537 printf("pRICSubscriptionResponse->ricActionNotAdmittedListPresent = %u\n",pRICSubscriptionResponse->ricActionNotAdmittedListPresent);
538 printf("pRICSubscriptionResponse->ricActionNotAdmittedList.contentLength = %u\n",(unsigned)pRICSubscriptionResponse->ricActionNotAdmittedList.contentLength);
539 index = 0;
540 while (index < pRICSubscriptionResponse->ricActionNotAdmittedList.contentLength) {
541 printf("pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = %lu\n",
542 pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID);
543 printf("pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content = %u\n",
544 (unsigned)pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content);
545 printf("pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause = %u\n",
546 (unsigned)pRICSubscriptionResponse->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause);
547 index++;
548 }
549 printf("\n");
550}
551
552//////////////////////////////////////////////////////////////////////
553void printRICSubscriptionFailure(const RICSubscriptionFailure_t* pRICSubscriptionFailure) {
554
555 printf("pRICSubscriptionFailure->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionFailure->ricRequestID.ricRequestorID);
556 printf("pRICSubscriptionFailure->ricRequestID.ricRequestSequenceNumber = %u\n",pRICSubscriptionFailure->ricRequestID.ricRequestSequenceNumber);
557 printf("pRICSubscriptionFailure->ranFunctionID = %i\n",pRICSubscriptionFailure->ranFunctionID);
558 printf("pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength = %u\n",(unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength);
559 uint64_t index = 0;
560 while (index < pRICSubscriptionFailure->ricActionNotAdmittedList.contentLength) {
561 printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID = %lu\n",
562 pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricActionID);
563 printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content = %u\n",
564 (unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.content);
565 printf("pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause = %u\n",
566 (unsigned)pRICSubscriptionFailure->ricActionNotAdmittedList.RICActionNotAdmittedItem[index].ricCause.cause);
567 index++;
568 }
569 if (pRICSubscriptionFailure->criticalityDiagnosticsPresent) {
570 printf("pRICSubscriptionFailure->criticalityDiagnosticsPresent = %u\n",pRICSubscriptionFailure->criticalityDiagnosticsPresent);
571 printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCodePresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.procedureCodePresent);
572 printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCode = %u\n",(unsigned)pRICSubscriptionFailure->criticalityDiagnostics.procedureCode);
573 printf("pRICSubscriptionFailure->criticalityDiagnostics.triggeringMessagePresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.triggeringMessagePresent);
574 printf("pRICSubscriptionFailure->criticalityDiagnostics.triggeringMessage = %u\n",(unsigned)pRICSubscriptionFailure->criticalityDiagnostics.triggeringMessage);
575 printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticalityPresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticalityPresent);
576 printf("pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticality = %u\n",(unsigned)pRICSubscriptionFailure->criticalityDiagnostics.procedureCriticality);
577 printf("pRICSubscriptionFailure->criticalityDiagnostics.iEsCriticalityDiagnosticsPresent = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.iEsCriticalityDiagnosticsPresent);
578 printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength = %u\n",pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength);
579 index = 0;
580 while (index < pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIELength) {
581 printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iECriticality = %u\n",
582 (unsigned)pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iECriticality);
583 printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iE_ID = %u\n",
584 pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].iE_ID);
585 printf("pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].typeOfError = %u\n",
586 (unsigned)pRICSubscriptionFailure->criticalityDiagnostics.criticalityDiagnosticsIEListItem[index].typeOfError);
587 index++;
588 }
589 }
590 printf("\n");
591}
592
593//////////////////////////////////////////////////////////////////////
594void printRICIndication(const RICIndication_t* pRICIndication) {
595
596 printf("pRICIndication->ricRequestID.ricRequestorID = %u\n",pRICIndication->ricRequestID.ricRequestorID);
597 printf("pRICIndication->ricRequestID.ricRequestSequenceNumber = %u\n",pRICIndication->ricRequestID.ricRequestSequenceNumber);
598 printf("pRICIndication->ranFunctionID = %u\n",pRICIndication->ranFunctionID);
599 printf("pRICIndication->ricActionID = %lu\n",pRICIndication->ricActionID);
600 printf("pRICIndication->ricIndicationSN = %u\n",pRICIndication->ricIndicationSN);
601 printf("pRICIndication->ricIndicationType = %u\n",(unsigned)pRICIndication->ricIndicationType);
602 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBIDPresent = %u\n",pRICIndication->ricIndicationHeader.interfaceID.globalENBIDPresent);
603 if (pRICIndication->ricIndicationHeader.interfaceID.globalENBIDPresent) {
604 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.contentLength = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.contentLength);
605 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[0]);
606 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[1]);
607 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.pLMNIdentity.pLMNIdentityVal[2]);
608 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.nodeID.bits = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.nodeID.bits);
609 printf("pRICIndication->ricIndicationHeader.interfaceID.globalENBID.nodeID.nodeID = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalENBID.nodeID.nodeID);
610 }
611 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBIDPresent = %u\n",pRICIndication->ricIndicationHeader.interfaceID.globalGNBIDPresent);
612 if(pRICIndication->ricIndicationHeader.interfaceID.globalGNBIDPresent){
613 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.contentLength = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.contentLength);
614 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[0]);
615 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[1]);
616 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2] = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.pLMNIdentity.pLMNIdentityVal[2]);
617 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.nodeID.bits = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.nodeID.bits);
618 printf("pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.nodeID.nodeID = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceID.globalGNBID.nodeID.nodeID);
619 }
620 printf("pRICIndication->ricIndicationHeader.interfaceDirection = %u\n",(unsigned)pRICIndication->ricIndicationHeader.interfaceDirection);
621 printf("pRICIndication->ricIndicationMessage.interfaceMessage.contentLength = %u\n",(unsigned)pRICIndication->ricIndicationMessage.interfaceMessage.contentLength);
622
623 printf("pRICIndication->ricIndicationMessage.interfaceMessage.data = ");
624 printDataBuffer(pRICIndication->ricIndicationMessage.interfaceMessage.contentLength,pRICIndication->ricIndicationMessage.interfaceMessage.data);
625 printf("\n");
626}
627
628void printRICSubscriptionDeleteRequest(const RICSubscriptionDeleteRequest_t* pRICSubscriptionDeleteRequest) {
629
630 printf("\npRICSubscriptionDeleteRequest->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionDeleteRequest->ricRequestID.ricRequestorID);
631 printf("pRICSubscriptionDeleteRequest->ricRequestID.ricRequestSequenceNumber = %u\n",pRICSubscriptionDeleteRequest->ricRequestID.ricRequestSequenceNumber);
632 printf("pRICSubscriptionDeleteRequest->ranFunctionID = %i\n",pRICSubscriptionDeleteRequest->ranFunctionID);
633 printf("\n");
634}
635
636void printRICSubscriptionDeleteResponse(const RICSubscriptionDeleteResponse_t* pRICSubscriptionDeleteResponse) {
637
638 printf("\npRICSubscriptionDeleteResponse->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionDeleteResponse->ricRequestID.ricRequestorID);
639 printf("pRICSubscriptionDeleteResponse->ricRequestID.ricRequestSequenceNumber = %u\n",pRICSubscriptionDeleteResponse->ricRequestID.ricRequestSequenceNumber);
640 printf("pRICSubscriptionDeleteResponse->ranFunctionID = %i\n",pRICSubscriptionDeleteResponse->ranFunctionID);
641 printf("\n");
642}
643
644void printRICSubscriptionDeleteFailure(const RICSubscriptionDeleteFailure_t* pRICSubscriptionDeleteFailure) {
645
646 printf("\npRICSubscriptionDeleteFailure->ricRequestID.ricRequestorID = %u\n",pRICSubscriptionDeleteFailure->ricRequestID.ricRequestorID);
647 printf("pRICSubscriptionDeleteFailure->ricRequestID.ricRequestSequenceNumber = %u\n",pRICSubscriptionDeleteFailure->ricRequestID.ricRequestSequenceNumber);
648 printf("pRICSubscriptionDeleteFailure->ranFunctionID = %i\n",pRICSubscriptionDeleteFailure->ranFunctionID);
649 printf("pRICSubscriptionDeleteFailure->ricCause.content = %i\n",pRICSubscriptionDeleteFailure->ricCause.content);
650 printf("pRICSubscriptionDeleteFailure->ricCause.cause = %i\n",pRICSubscriptionDeleteFailure->ricCause.cause);
651 printf("\n");
652}
653
654#endif