blob: 49e5e2e49318a15380938ccac5fd38b8f4312a14 [file] [log] [blame]
sandeepindiafbc7e3a2023-06-28 18:03:26 +05301#ifndef _WRAPPER_E2AP_H_
2#define _WRAPPER_E2AP_H_
3#include <stdio.h>
4#include <stdlib.h>
5#include "RICsubscriptionRequest.h"
6#include "RICsubscriptionResponse.h"
7#include "RICsubscriptionDeleteRequest.h"
8#include "RICsubscriptionDeleteResponse.h"
9#include "RICcontrolRequest.h"
10#include "RICindication.h"
11#include "E2AP-PDU.h"
12#include "InitiatingMessage.h"
13#include "SuccessfulOutcome.h"
14#include "UnsuccessfulOutcome.h"
15#include "ProtocolIE-Container.h"
16#include "ProtocolIE-Field.h"
17#include "RICactionDefinition.h"
18#include "RICsubsequentAction.h"
19#include "CauseRIC.h"
20
21typedef struct RICControlAcknowledgeMsg {
22 long requestorID;
23 long instanceID;
24 long ranfunctionID;
25 uint8_t *callProcessID;
26 size_t callProcessIDSize;
27 uint8_t *ricControlOutCome;
28 size_t ricControlOutComeSize;
29}RICControlAcknowledge;
30
31typedef struct RICControlFailureMsg {
32 long requestorID;
33 long instanceID;
34 long ranfunctionID;
35 uint8_t *callProcessID;
36 size_t callProcessIDSize;
37 uint8_t *ricControlOutCome;
38 size_t ricControlOutComeSize;
39 int causeType;
40 long causeValue;
41
42}RICControlFailure;
43
44typedef struct RICindicationMessage {
45 long requestorID;
46 long requestSequenceNumber;
47 long ranfunctionID;
48 long actionID;
49 long indicationSN;
50 long indicationType;
51 uint8_t *indicationHeader;
52 size_t indicationHeaderSize;
53 uint8_t *indicationMessage;
54 size_t indicationMessageSize;
55 uint8_t *callProcessID;
56 size_t callProcessIDSize;
57} RICindicationMsg;
58
59typedef struct RICcauseItem {
60 int ricCauseType;
61 long ricCauseID;
62} RICcauseItem;
63
64typedef struct RICactionAdmittedList {
65 long ricActionID[16];
66 int count;
67} RICactionAdmittedList;
68
69typedef struct RICactionNotAdmittedList {
70 long ricActionID[16];
71 RICcauseItem ricCause[16];
72 int count;
73} RICactionNotAdmittedList;
74
75typedef struct RICsubscriptionResponseMessage {
76 long requestorID;
77 long requestSequenceNumber;
78 long ranfunctionID;
79 RICactionAdmittedList ricActionAdmittedList;
80 RICactionNotAdmittedList ricActionNotAdmittedList;
81} RICsubscriptionResponseMsg;
82
83typedef struct RICactionDefinition {
84 uint8_t *actionDefinition;
85 int size;
86} RICactionDefinition;
87
88typedef struct RICSubsequentAction {
89 int isValid;
90 long subsequentActionType;
91 long timeToWait;
92} RICSubsequentAction;
93
94size_t encode_E2AP_PDU(E2AP_PDU_t* pdu, void* buffer, size_t buf_size);
95E2AP_PDU_t* decode_E2AP_PDU(const void* buffer, size_t buf_size);
96
97/* RICsubscriptionRequest */
98long e2ap_get_ric_subscription_request_sequence_number(void *buffer, size_t buf_size);
99ssize_t e2ap_set_ric_subscription_request_sequence_number(void *buffer, size_t buf_size, long sequence_number);
100ssize_t e2ap_encode_ric_subscription_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, long ranFunctionID, void *eventTriggerDefinition, size_t eventTriggerDefinitionSize, int actionCount, long *actionIds, long* actionTypes, RICactionDefinition *actionDefinitions, RICSubsequentAction *subsequentActionTypes);
101
102/* RICsubscriptionResponse */
103long e2ap_get_ric_subscription_response_sequence_number(void *buffer, size_t buf_size);
104ssize_t e2ap_set_ric_subscription_response_sequence_number(void *buffer, size_t buf_size, long sequence_number);
105RICsubscriptionResponseMsg* e2ap_decode_ric_subscription_response_message(void *buffer, size_t buf_size);
106
107/* RICsubscriptionFailure */
108long e2ap_get_ric_subscription_failure_sequence_number(void *buffer, size_t buf_size);
109
110/* RICsubscriptionDeleteRequest */
111long e2ap_get_ric_subscription_delete_request_sequence_number(void *buffer, size_t buf_size);
112ssize_t e2ap_set_ric_subscription_delete_request_sequence_number(void *buffer, size_t buf_size, long sequence_number);
113ssize_t e2ap_encode_ric_subscription_delete_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, long ranFunctionID);
114
115/* RICsubscriptionDeleteResponse */
116long e2ap_get_ric_subscription_delete_response_sequence_number(void *buffer, size_t buf_size);
117ssize_t e2ap_set_ric_subscription_delete_response_sequence_number(void *buffer, size_t buf_size, long sequence_number);
118
119/* RICsubscriptionDeleteFailure */
120long e2ap_get_ric_subscription_delete_failure_sequence_number(void *buffer, size_t buf_size);
121
122/* RICindication */
123RICindicationMsg* e2ap_decode_ric_indication_message(void *buffer, size_t buf_size);
124RICindicationMsg* e2ap_decode_ric_indication_m();
125void e2ap_free_decoded_ric_indication_message(RICindicationMsg* msg);
126
127/* RICcontrol */
128ssize_t e2ap_encode_ric_control_request_message(void *buffer, size_t buf_size, long ricRequestorID, long ricRequestSequenceNumber, long ranFunctionID, void *ricControlHdr, size_t ricControlHdrSize, void *ricControlMsg, size_t ricControlMsgSize);
129
130RICControlAcknowledge* e2ap_decode_ric_control_acknowledge_message(void *buffer, size_t buf_size);
131void e2ap_free_decoded_ric_control_ack(RICControlAcknowledge* msg);
132
133RICControlFailure* e2ap_decode_ric_control_failure_message(void *buffer, size_t buf_size);
134void e2ap_free_decoded_ric_control_failure(RICControlFailure* msg);
135
136#endif /* _WRAPPER_E2AP_H_ */