Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 1 | /* |
| 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 Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 29 | #include <ProcedureCode.h> |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 35 | extern const int cCauseRICRequest; |
| 36 | extern const int cCauseRICService; |
| 37 | extern const int cCauseTransport; |
| 38 | extern const int cCauseProtocol; |
| 39 | extern const int cCauseMisc; |
| 40 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 41 | typedef unsigned char byte; |
| 42 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 43 | //extern const int64_t cMaxNrOfErrors; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 44 | |
| 45 | extern const uint64_t cMaxSizeOfOctetString; |
| 46 | |
| 47 | typedef struct { // Octet string in ASN.1 does not have maximum length! |
| 48 | size_t contentLength; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 49 | uint8_t data[1024]; // Table size is const cMaxSizeOfOctetString |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 50 | } OctetString_t; |
| 51 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 52 | typedef struct { // Octet string in ASN.1 does not have maximum length! |
| 53 | size_t length; |
| 54 | uint8_t* data; |
| 55 | } DynOctetString_t; |
| 56 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 57 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 58 | uint8_t unusedBits; // Trailing unused bits 0 - 7 |
| 59 | size_t byteLength; // Length in bytes |
| 60 | uint8_t* data; |
| 61 | } DynBitString_t; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 62 | |
| 63 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 64 | uint32_t ricRequestorID; // 0..65535 |
| 65 | uint32_t ricInstanceID; // 0..65535 |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 66 | } RICRequestID_t; |
| 67 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 68 | typedef uint16_t RANFunctionID_t; // 0..4095 |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 69 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 70 | typedef uint64_t RICActionID_t; // 0..255 |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 71 | |
| 72 | enum RICActionType_t { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 73 | RICActionType_report, |
| 74 | RICActionType_insert, |
| 75 | RICActionType_policy |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 76 | }; |
| 77 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 78 | |
| 79 | enum RICSubsequentActionType_t { |
| 80 | RICSubsequentActionType_Continue, |
| 81 | RICSubsequentActionType_wait |
| 82 | }; |
| 83 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 84 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 85 | OctetString_t octetString; // This element is E2AP spec format |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 86 | } RICActionDefinitionChoice_t; |
| 87 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 88 | enum 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 | |
| 109 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 110 | uint64_t ricSubsequentActionType; // This is type of enum RICSubsequentActionType_t |
| 111 | uint64_t ricTimeToWait; // This is type of enum RICTimeToWait_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 112 | } RICSubsequentAction_t; |
| 113 | |
| 114 | typedef struct { |
| 115 | RICActionID_t ricActionID; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 116 | uint64_t ricActionType; // This is type of enum RICActionType_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 117 | bool ricActionDefinitionPresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 118 | RICActionDefinitionChoice_t ricActionDefinitionChoice; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 119 | bool ricSubsequentActionPresent; |
| 120 | RICSubsequentAction_t ricSubsequentAction; |
| 121 | } RICActionToBeSetupItem_t; |
| 122 | |
| 123 | static const uint64_t cMaxofRICactionID = 16; |
| 124 | |
| 125 | typedef struct { |
| 126 | uint8_t contentLength; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 127 | RICActionToBeSetupItem_t ricActionToBeSetupItem[16]; // 1..16 // Table size is const cMaxofRICactionID |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 128 | } RICActionToBeSetupList_t; |
| 129 | |
| 130 | typedef struct { |
| 131 | uint8_t contentLength; |
| 132 | uint8_t pLMNIdentityVal[3]; |
| 133 | } PLMNIdentity_t; |
| 134 | |
| 135 | // size of eNB-id |
| 136 | extern const size_t cMacroENBIDP_20Bits; |
| 137 | extern const size_t cHomeENBID_28Bits; |
| 138 | extern const size_t cShortMacroENBID_18Bits; |
| 139 | extern const size_t clongMacroENBIDP_21Bits; |
| 140 | |
| 141 | typedef 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 | |
| 146 | typedef struct { |
| 147 | PLMNIdentity_t pLMNIdentity; |
| 148 | NodeID_t nodeID; |
| 149 | } GlobalNodeID_t; |
| 150 | |
| 151 | typedef 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 | |
| 158 | enum InterfaceDirection__t { |
| 159 | InterfaceDirection__incoming, |
| 160 | InterfaceDirection__outgoing |
| 161 | }; |
| 162 | |
| 163 | typedef uint8_t ProcedureCode__t; |
| 164 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 165 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 166 | static const uint64_t cMaxofProtocolIE = 15; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 167 | |
| 168 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 169 | OctetString_t octetString; // This element is E2AP spec format |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 170 | } RICEventTriggerDefinition_t; |
| 171 | |
| 172 | typedef struct { |
| 173 | RICEventTriggerDefinition_t ricEventTriggerDefinition; |
| 174 | RICActionToBeSetupList_t ricActionToBeSetupItemIEs; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 175 | } RICSubscriptionDetails_t; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 176 | |
| 177 | typedef struct { |
| 178 | uint8_t contentLength; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 179 | RICActionID_t ricActionID[16]; // Table size is const cMaxofRICactionID |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 180 | } RICActionAdmittedList_t; |
| 181 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 182 | extern const int cCauseRIC; // This is content of type CauseRIC_t |
| 183 | extern const int cCauseRICService; // This is content of type CauseRICservice_t |
| 184 | extern const int cRICCauseTransport; // This is content of type CauseTransport_t |
| 185 | extern const int cRICCauseProtocol; // This is content of type CauseProtocol_t |
| 186 | extern const int cRICCauseMisc; // This is content of type CauseMisc_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 187 | |
| 188 | typedef struct { |
| 189 | uint8_t content; // See above constants |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 190 | uint8_t causeVal; // This is type of enum CauseRIC_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 191 | } RICCause_t; |
| 192 | |
| 193 | typedef struct { |
| 194 | RICActionID_t ricActionID; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 195 | RICCause_t cause; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 196 | } RICActionNotAdmittedItem_t; |
| 197 | |
| 198 | typedef struct { |
| 199 | uint8_t contentLength; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 200 | RICActionNotAdmittedItem_t RICActionNotAdmittedItem[16]; // Table size is const cMaxofRICactionID |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 201 | } RICActionNotAdmittedList_t; |
| 202 | |
| 203 | enum Criticality_t { |
| 204 | Criticality__reject, |
| 205 | Criticality__ignore, |
| 206 | Criticality__notify |
| 207 | }; |
| 208 | |
| 209 | typedef uint32_t ProtocolIE_ID__t; |
| 210 | |
| 211 | enum TriggeringMessage__t { |
| 212 | TriggeringMessage__initiating_message, |
| 213 | TriggeringMessage__successful_outcome, |
| 214 | TriggeringMessage__unsuccessful_outcome |
| 215 | }; |
| 216 | |
| 217 | enum TypeOfError_t { |
| 218 | TypeOfError_not_understood, |
| 219 | TypeOfError_missing |
| 220 | }; |
| 221 | |
| 222 | typedef struct { |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 223 | uint8_t iECriticality; // This is type of enum Criticality_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 224 | ProtocolIE_ID__t iE_ID; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 225 | uint8_t typeOfError; // This is type of enum TypeOfError_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 226 | //iE-Extensions // This has no content in E2AP ASN.1 specification |
| 227 | } CriticalityDiagnosticsIEListItem_t; |
| 228 | |
| 229 | typedef struct { |
| 230 | bool procedureCodePresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 231 | ProcedureCode__t procedureCode; // OPTIONAL |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 232 | bool triggeringMessagePresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 233 | uint8_t triggeringMessage; // OPTIONAL. This is type of enum TriggeringMessage_t |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 234 | bool procedureCriticalityPresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 235 | uint8_t procedureCriticality; // OPTIONAL. This is type of enum Criticality_t |
| 236 | bool ricRequestorIDPresent; |
| 237 | RICRequestID_t ricRequestorID; //OPTIONAL |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 238 | bool iEsCriticalityDiagnosticsPresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 239 | uint16_t criticalityDiagnosticsIELength; // 1..256 |
| 240 | CriticalityDiagnosticsIEListItem_t criticalityDiagnosticsIEListItem[256]; // OPTIONAL. Table size is const cMaxNrOfErrors |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 241 | } CriticalityDiagnostics__t; |
| 242 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 243 | typedef 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 |
| 250 | enum e2err { |
| 251 | e2err_OK, |
| 252 | e2err_RICSubscriptionRequestAllocRICrequestIDFail, |
| 253 | e2err_RICSubscriptionRequestAllocRANfunctionIDFail, |
| 254 | e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail, |
| 255 | e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail, |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 256 | e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail, |
| 257 | e2err_RICSubscriptionRequestAllocRICactionDefinitionFail, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 258 | e2err_RICSubscriptionRequestAllocRICsubsequentActionFail, |
| 259 | e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail, |
| 260 | e2err_RICSubscriptionRequestEncodeFail, |
| 261 | e2err_RICSubscriptionRequestAllocE2AP_PDUFail, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 262 | e2err_RICSubscriptionResponseAllocRICrequestIDFail, |
| 263 | e2err_RICSubscriptionResponseAllocRANfunctionIDFail, |
| 264 | e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail, |
| 265 | e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail, |
| 266 | e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 267 | 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 Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 275 | 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 Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 291 | e2err_RICsubscriptionResponseRICrequestIDMissing, |
| 292 | e2err_RICsubscriptionResponseRANfunctionIDMissing, |
| 293 | e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 294 | e2err_RICsubscriptionFailureRICrequestIDMissing, |
| 295 | e2err_RICsubscriptionFailureRANfunctionIDMissing, |
| 296 | e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 297 | e2err_RICsubscriptionDeleteRequestRICrequestIDMissing, |
| 298 | e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing, |
| 299 | e2err_RICsubscriptionDeleteResponseRICrequestIDMissing, |
| 300 | e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing, |
| 301 | e2err_RICsubscriptionDeleteFailureRICrequestIDMissing, |
| 302 | e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing, |
| 303 | e2err_RICsubscriptionDeleteFailureRICcauseMissing |
| 304 | }; |
| 305 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 306 | static const char* const E2ErrorStrings[] = { |
| 307 | "e2err_OK", |
| 308 | "e2err_RICSubscriptionRequestAllocRICrequestIDFail", |
| 309 | "e2err_RICSubscriptionRequestAllocRANfunctionIDFail", |
| 310 | "e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail", |
| 311 | "e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail", |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 312 | "e2err_RICSubscriptionRequestAllocRICactionDefinitionBufFail", |
| 313 | "e2err_RICSubscriptionRequestAllocRICactionDefinitionFail", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 314 | "e2err_RICSubscriptionRequestAllocRICsubsequentActionFail", |
| 315 | "e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail", |
| 316 | "e2err_RICSubscriptionRequestEncodeFail", |
| 317 | "e2err_RICSubscriptionRequestAllocE2AP_PDUFail", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 318 | "e2err_RICSubscriptionResponseAllocRICrequestIDFail", |
| 319 | "e2err_RICSubscriptionResponseAllocRANfunctionIDFail", |
| 320 | "e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail", |
| 321 | "e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail", |
| 322 | "e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 323 | "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 Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 331 | "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 Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 347 | "e2err_RICsubscriptionResponseRICrequestIDMissing", |
| 348 | "e2err_RICsubscriptionResponseRANfunctionIDMissing", |
| 349 | "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 350 | "e2err_RICsubscriptionFailureRICrequestIDMissing", |
| 351 | "e2err_RICsubscriptionFailureRANfunctionIDMissing", |
| 352 | "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 353 | "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing", |
| 354 | "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing", |
| 355 | "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing", |
| 356 | "e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing", |
| 357 | "e2err_RICsubscriptionDeleteFailureRICrequestIDMissing", |
| 358 | "e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing", |
| 359 | "e2err_RICsubscriptionDeleteFailureRICcauseMissing" |
| 360 | }; |
| 361 | |
| 362 | typedef 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 |
| 371 | extern const uint64_t cE2InitiatingMessage; |
| 372 | extern const uint64_t cE2SuccessfulOutcome; |
| 373 | extern 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 |
| 378 | extern const uint64_t cRICSubscriptionRequest; |
| 379 | extern const uint64_t cRICSubscriptionDeleteRequest; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 380 | |
| 381 | // Successful outcome |
| 382 | extern const uint64_t cRICSubscriptionResponse; |
| 383 | extern const uint64_t cRICsubscriptionDeleteResponse; |
| 384 | |
| 385 | // Unsuccessful outcome |
| 386 | extern const uint64_t cRICSubscriptionFailure; |
| 387 | extern const uint64_t cRICsubscriptionDeleteFailure; |
| 388 | |
| 389 | typedef struct { |
| 390 | RICRequestID_t ricRequestID; |
| 391 | RANFunctionID_t ranFunctionID; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 392 | RICSubscriptionDetails_t ricSubscriptionDetails; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 393 | } RICSubscriptionRequest_t; |
| 394 | |
| 395 | typedef 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 Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 403 | typedef struct { |
| 404 | RICRequestID_t ricRequestID; |
| 405 | RANFunctionID_t ranFunctionID; |
| 406 | RICActionNotAdmittedList_t ricActionNotAdmittedList; |
| 407 | bool criticalityDiagnosticsPresent; |
| 408 | CriticalityDiagnostics__t criticalityDiagnostics; |
| 409 | } RICSubscriptionFailure_t; |
| 410 | |
| 411 | typedef struct { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 412 | RICRequestID_t ricRequestID; |
| 413 | RANFunctionID_t ranFunctionID; |
| 414 | } RICSubscriptionDeleteRequest_t; |
| 415 | |
| 416 | typedef struct { |
| 417 | RICRequestID_t ricRequestID; |
| 418 | RANFunctionID_t ranFunctionID; |
| 419 | } RICSubscriptionDeleteResponse_t; |
| 420 | |
| 421 | typedef struct { |
| 422 | RICRequestID_t ricRequestID; |
| 423 | RANFunctionID_t ranFunctionID; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 424 | RICCause_t cause; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 425 | bool criticalityDiagnosticsPresent; |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 426 | CriticalityDiagnostics__t criticalityDiagnostics; // OPTIONAL. Not used in RIC currently |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 427 | } RICSubscriptionDeleteFailure_t; |
| 428 | |
| 429 | ////////////////////////////////////////////////////////////////////// |
| 430 | // Function declarations |
| 431 | |
| 432 | const char* getE2ErrorString(uint64_t); |
| 433 | |
| 434 | typedef void* e2ap_pdu_ptr_t; |
| 435 | |
| 436 | uint64_t packRICSubscriptionRequest(size_t*, byte*, char*,RICSubscriptionRequest_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 437 | uint64_t packRICSubscriptionResponse(size_t*, byte*, char*,RICSubscriptionResponse_t*); |
| 438 | uint64_t packRICSubscriptionFailure(size_t*, byte*, char*,RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 439 | uint64_t packRICSubscriptionDeleteRequest(size_t*, byte*, char*,RICSubscriptionDeleteRequest_t*); |
| 440 | uint64_t packRICSubscriptionDeleteResponse(size_t*, byte*, char*,RICSubscriptionDeleteResponse_t*); |
| 441 | uint64_t packRICSubscriptionDeleteFailure(size_t*, byte*, char*,RICSubscriptionDeleteFailure_t*); |
| 442 | |
| 443 | e2ap_pdu_ptr_t* unpackE2AP_pdu(const size_t, const byte*, char*, E2MessageInfo_t*); |
Juha Hyttinen | cdc35bf | 2020-07-11 13:32:57 +0300 | [diff] [blame] | 444 | uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 445 | uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t*, RICSubscriptionResponse_t*); |
| 446 | uint64_t getRICSubscriptionFailureData(e2ap_pdu_ptr_t*, RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 447 | uint64_t getRICSubscriptionDeleteRequestData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteRequest_t*); |
| 448 | uint64_t getRICSubscriptionDeleteResponseData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteResponse_t*); |
| 449 | uint64_t getRICSubscriptionDeleteFailureData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteFailure_t*); |
| 450 | |
Juha Hyttinen | aada645 | 2020-04-07 08:47:58 +0300 | [diff] [blame] | 451 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 452 | #if DEBUG |
| 453 | bool TestRICSubscriptionRequest(); |
| 454 | bool TestRICSubscriptionResponse(); |
| 455 | bool TestRICSubscriptionFailure(); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 456 | bool TestRICSubscriptionDeleteRequest(); |
| 457 | bool TestRICSubscriptionDeleteResponse(); |
| 458 | bool TestRICSubscriptionDeleteFailure(); |
| 459 | |
| 460 | void printRICSubscriptionRequest(const RICSubscriptionRequest_t*); |
| 461 | void printRICSubscriptionResponse(const RICSubscriptionResponse_t*); |
| 462 | void printRICSubscriptionFailure(const RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 463 | void printRICSubscriptionDeleteRequest(const RICSubscriptionDeleteRequest_t*); |
| 464 | void printRICSubscriptionDeleteResponse(const RICSubscriptionDeleteResponse_t*); |
| 465 | void printRICSubscriptionDeleteFailure(const RICSubscriptionDeleteFailure_t*); |
| 466 | #endif |
| 467 | |
| 468 | #ifdef __cplusplus |
| 469 | } |
| 470 | #endif |
| 471 | |
| 472 | #endif |