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> |
| 29 | |
| 30 | #ifdef __cplusplus |
| 31 | extern "C" { |
| 32 | #endif |
| 33 | |
| 34 | typedef unsigned char byte; |
| 35 | |
| 36 | extern const int64_t cMaxNrOfErrors; |
| 37 | |
| 38 | extern const uint64_t cMaxSizeOfOctetString; |
| 39 | |
| 40 | typedef 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 | |
| 45 | typedef 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 | |
| 51 | typedef struct { |
| 52 | uint32_t ricRequestorID; |
| 53 | uint32_t ricRequestSequenceNumber; |
| 54 | } RICRequestID_t; |
| 55 | |
| 56 | typedef uint16_t RANFunctionID_t; |
| 57 | |
| 58 | typedef uint64_t RICActionID_t; |
| 59 | |
| 60 | enum RICActionType_t { |
| 61 | RICActionType_report |
| 62 | ,RICActionType_insert |
| 63 | ,RICActionType_policy |
| 64 | }; |
| 65 | |
| 66 | typedef uint64_t StyleID_t; |
| 67 | |
| 68 | typedef uint32_t ParameterID_t; |
| 69 | |
| 70 | typedef struct { |
Anssi Mannila | 114fa2c | 2020-01-16 12:47:47 +0200 | [diff] [blame] | 71 | uint32_t dummy; // This data type has no content. This dummy is added here to solve problem with Golang. Golang do not like empty types. |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 72 | } ParameterValue_t; |
| 73 | |
| 74 | typedef struct { |
| 75 | ParameterID_t parameterID; |
| 76 | ParameterValue_t ParameterValue; |
| 77 | } SequenceOfActionParameters_t; |
| 78 | |
| 79 | typedef struct { |
| 80 | StyleID_t styleID; |
| 81 | SequenceOfActionParameters_t sequenceOfActionParameters; |
| 82 | } RICActionDefinition_t; |
| 83 | |
| 84 | enum RICSubsequentActionType_t { |
| 85 | RICSubsequentActionType_Continue, |
| 86 | RICSubsequentActionType_wait |
| 87 | }; |
| 88 | |
| 89 | enum 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 | |
| 110 | typedef 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 | |
| 115 | typedef 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 | |
| 124 | static const uint64_t cMaxofRICactionID = 16; |
| 125 | |
| 126 | typedef struct { |
| 127 | uint8_t contentLength; |
| 128 | RICActionToBeSetupItem_t ricActionToBeSetupItem[16]; // table size is const cMaxofRICactionID |
| 129 | } RICActionToBeSetupList_t; |
| 130 | |
| 131 | typedef struct { |
| 132 | uint8_t contentLength; |
| 133 | uint8_t pLMNIdentityVal[3]; |
| 134 | } PLMNIdentity_t; |
| 135 | |
| 136 | // size of eNB-id |
| 137 | extern const size_t cMacroENBIDP_20Bits; |
| 138 | extern const size_t cHomeENBID_28Bits; |
| 139 | extern const size_t cShortMacroENBID_18Bits; |
| 140 | extern const size_t clongMacroENBIDP_21Bits; |
| 141 | |
| 142 | typedef 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 | |
| 147 | typedef struct { |
| 148 | PLMNIdentity_t pLMNIdentity; |
| 149 | NodeID_t nodeID; |
| 150 | } GlobalNodeID_t; |
| 151 | |
| 152 | typedef 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 | |
| 159 | enum InterfaceDirection__t { |
| 160 | InterfaceDirection__incoming, |
| 161 | InterfaceDirection__outgoing |
| 162 | }; |
| 163 | |
| 164 | typedef uint8_t ProcedureCode__t; |
| 165 | |
| 166 | typedef struct { |
| 167 | ProcedureCode__t procedureCode; |
| 168 | uint8_t typeOfMessage; // This is X2AP-PDU, CHOICE of InitiatingMessage or SuccessfulOutcome or UnsuccessfulOutcome |
| 169 | } RICInterfaceMessageType_t; |
| 170 | |
| 171 | typedef uint32_t InterfaceProtocolIEID_t; |
| 172 | |
| 173 | enum ProtocolIEtestCondition_t { |
| 174 | ProtocolIEtestCondition_equal, |
| 175 | ProtocolIEtestCondition_greaterthan, |
| 176 | ProtocolIEtestCondition_lessthan, |
| 177 | ProtocolIEtestCondition_contains, |
| 178 | ProtocolIEtestCondition_present |
| 179 | }; |
| 180 | |
| 181 | typedef struct { // CHOICE. Only one value can be present |
| 182 | bool valueIntPresent; |
Anssi Mannila | 114fa2c | 2020-01-16 12:47:47 +0200 | [diff] [blame] | 183 | int64_t integer; // INTEGER; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 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 | |
| 194 | typedef 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 | |
| 200 | static const uint64_t cMaxofProtocolIE = 16; |
| 201 | |
| 202 | typedef struct { |
| 203 | SequenceOfProtocolIE_t sequenceOfProtocolIE[16]; // table size is const cMaxofProtocolIE |
| 204 | } SequenceOfProtocolIEList_t; |
| 205 | |
| 206 | typedef 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 | |
| 215 | typedef struct { |
| 216 | RICEventTriggerDefinition_t ricEventTriggerDefinition; |
| 217 | RICActionToBeSetupList_t ricActionToBeSetupItemIEs; |
| 218 | } RICSubscription_t; |
| 219 | |
| 220 | typedef struct { |
| 221 | uint8_t contentLength; |
| 222 | RICActionID_t ricActionID[16]; // table size is const cMaxofRICactionID |
| 223 | } RICActionAdmittedList_t; |
| 224 | |
| 225 | enum 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 | |
| 241 | extern const int cRICCauseRadioNetwork; // this is content of type RICCause_t |
| 242 | extern const int cRICCauseTransport; // this is content of type RICCause_t |
| 243 | extern const int cRICCauseProtocol; // this is content of type RICCause_t |
| 244 | extern const int cRICCauseMisc; // this is content of type RICCause_t |
| 245 | extern const int cRICCauseRic; // this is content of type RICCause_t |
| 246 | |
| 247 | typedef struct { |
| 248 | uint8_t content; // See above constants |
| 249 | uint8_t cause; // this is type of enum CauseRIC_t |
| 250 | } RICCause_t; |
| 251 | |
| 252 | typedef struct { |
| 253 | RICActionID_t ricActionID; |
| 254 | RICCause_t ricCause; |
| 255 | } RICActionNotAdmittedItem_t; |
| 256 | |
| 257 | typedef struct { |
| 258 | uint8_t contentLength; |
| 259 | RICActionNotAdmittedItem_t RICActionNotAdmittedItem[16]; // table size is const cMaxofRICactionID |
| 260 | } RICActionNotAdmittedList_t; |
| 261 | |
| 262 | enum Criticality_t { |
| 263 | Criticality__reject, |
| 264 | Criticality__ignore, |
| 265 | Criticality__notify |
| 266 | }; |
| 267 | |
| 268 | typedef uint32_t ProtocolIE_ID__t; |
| 269 | |
| 270 | enum TriggeringMessage__t { |
| 271 | TriggeringMessage__initiating_message, |
| 272 | TriggeringMessage__successful_outcome, |
| 273 | TriggeringMessage__unsuccessful_outcome |
| 274 | }; |
| 275 | |
| 276 | enum TypeOfError_t { |
| 277 | TypeOfError_not_understood, |
| 278 | TypeOfError_missing |
| 279 | }; |
| 280 | |
| 281 | typedef 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 | |
| 288 | typedef 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 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 302 | typedef struct { |
| 303 | OctetString_t octetString; // E2AP spec format, the other elements for E2SM-X2 format |
| 304 | uint64_t ricCallProcessIDVal; |
| 305 | } RICCallProcessID_t; |
| 306 | |
| 307 | ////////////////////////////////////////////////////////////////////// |
| 308 | // E2 Error codes |
| 309 | enum e2err { |
| 310 | e2err_OK, |
| 311 | e2err_RICSubscriptionRequestAllocRICrequestIDFail, |
| 312 | e2err_RICSubscriptionRequestAllocRANfunctionIDFail, |
| 313 | e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail, |
| 314 | e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail, |
| 315 | e2err_RICSubscriptionRequestAllocRICsubsequentActionFail, |
| 316 | e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail, |
| 317 | e2err_RICSubscriptionRequestEncodeFail, |
| 318 | e2err_RICSubscriptionRequestAllocE2AP_PDUFail, |
| 319 | e2err_RICEventTriggerDefinitionIEValueFail_1, |
| 320 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail, |
| 321 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail, |
| 322 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail, |
| 323 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail, |
| 324 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail, |
| 325 | e2err_RICEventTriggerDefinitionIEValueFail_2, |
| 326 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail, |
| 327 | e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail, |
| 328 | e2err_RICEventTriggerDefinitionIEValueFail_3, |
| 329 | e2err_RICEventTriggerDefinitionIEValueFail_4, |
| 330 | e2err_RICEventTriggerDefinitionPackFail_1, |
| 331 | e2err_RICEventTriggerDefinitionPackFail_2, |
| 332 | e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail, |
| 333 | e2err_RICSubscriptionResponseAllocRICrequestIDFail, |
| 334 | e2err_RICSubscriptionResponseAllocRANfunctionIDFail, |
| 335 | e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail, |
| 336 | e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail, |
| 337 | e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 338 | e2err_RICSubscriptionResponseEncodeFail, |
| 339 | e2err_RICSubscriptionResponseAllocE2AP_PDUFail, |
| 340 | e2err_RICSubscriptionFailureAllocRICrequestIDFail, |
| 341 | e2err_RICSubscriptionFailureAllocRANfunctionIDFail, |
| 342 | e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail, |
| 343 | e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail, |
| 344 | e2err_RICSubscriptionFailureEncodeFail, |
| 345 | e2err_RICSubscriptionFailureAllocE2AP_PDUFail, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 346 | e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail, |
| 347 | e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail, |
| 348 | e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail, |
| 349 | e2err_RICSubscriptionDeleteRequestEncodeFail, |
| 350 | e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail, |
| 351 | e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail, |
| 352 | e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail, |
| 353 | e2err_RICSubscriptionDeleteResponseEncodeFail, |
| 354 | e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail, |
| 355 | e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail, |
| 356 | e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail, |
| 357 | e2err_RICSubscriptionDeleteFailureAllocRICcauseFail, |
| 358 | e2err_RICSubscriptionDeleteFailureEncodeFail, |
| 359 | e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail, |
| 360 | e2err_RICsubscriptionRequestRICrequestIDMissing, |
| 361 | e2err_RICsubscriptionRequestRANfunctionIDMissing, |
| 362 | e2err_RICsubscriptionRequestICsubscriptionMissing, |
| 363 | e2err_RICEventTriggerDefinitionIEValueFail_5, |
| 364 | e2err_RICEventTriggerDefinitionIEValueFail_6, |
| 365 | e2err_RICEventTriggerDefinitionIEValueFail_7, |
| 366 | e2err_RICEventTriggerDefinitionIEValueFail_8, |
| 367 | e2err_RICEventTriggerDefinitionDecodeWMOREFail, |
| 368 | e2err_RICEventTriggerDefinitionDecodeFAIL, |
| 369 | e2err_RICEventTriggerDefinitionDecodeDefaultFail, |
| 370 | e2err_RICsubscriptionResponseRICrequestIDMissing, |
| 371 | e2err_RICsubscriptionResponseRANfunctionIDMissing, |
| 372 | e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 373 | e2err_RICsubscriptionFailureRICrequestIDMissing, |
| 374 | e2err_RICsubscriptionFailureRANfunctionIDMissing, |
| 375 | e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 376 | e2err_RICEventTriggerDefinitionIEValueFail_9, |
| 377 | e2err_RICEventTriggerDefinitionIEValueFail_10, |
| 378 | e2err_RICEventTriggerDefinitionIEValueFail_11, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 379 | e2err_RICsubscriptionDeleteRequestRICrequestIDMissing, |
| 380 | e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing, |
| 381 | e2err_RICsubscriptionDeleteResponseRICrequestIDMissing, |
| 382 | e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing, |
| 383 | e2err_RICsubscriptionDeleteFailureRICrequestIDMissing, |
| 384 | e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing, |
| 385 | e2err_RICsubscriptionDeleteFailureRICcauseMissing |
| 386 | }; |
| 387 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 388 | static const char* const E2ErrorStrings[] = { |
| 389 | "e2err_OK", |
| 390 | "e2err_RICSubscriptionRequestAllocRICrequestIDFail", |
| 391 | "e2err_RICSubscriptionRequestAllocRANfunctionIDFail", |
| 392 | "e2err_RICSubscriptionRequestAllocRICeventTriggerDefinitionBufFail", |
| 393 | "e2err_RICSubscriptionRequestAllocRICaction_ToBeSetup_ItemIEsFail", |
| 394 | "e2err_RICSubscriptionRequestAllocRICsubsequentActionFail", |
| 395 | "e2err_RICSubscriptionRequestAllocRICsubscriptionRequest_IEsFail", |
| 396 | "e2err_RICSubscriptionRequestEncodeFail", |
| 397 | "e2err_RICSubscriptionRequestAllocE2AP_PDUFail", |
| 398 | "e2err_RICEventTriggerDefinitionIEValueFail_1", |
| 399 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDpLMN_IdentityBufFail", |
| 400 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDmacro_eNB_IDBufFail", |
| 401 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDhome_eNB_IDBufFail", |
| 402 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDshort_Macro_eNB_IDBufFail", |
| 403 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_eNB_IDeNB_IDlong_Macro_eNB_IDBufFail", |
| 404 | "e2err_RICEventTriggerDefinitionIEValueFail_2", |
| 405 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDpLMN_IdentityBufFail", |
| 406 | "e2err_RICIndicationAllocRICEventTriggerDefinitionglobal_gNB_IDgNB_IDBufFail", |
| 407 | "e2err_RICEventTriggerDefinitionIEValueFail_3", |
| 408 | "e2err_RICEventTriggerDefinitionIEValueFail_4", |
| 409 | "e2err_RICEventTriggerDefinitionPackFail_1", |
| 410 | "e2err_RICEventTriggerDefinitionPackFail_2", |
| 411 | "e2err_RICEventTriggerDefinitionAllocE2SM_gNB_X2_eventTriggerDefinitionFail", |
| 412 | "e2err_RICSubscriptionResponseAllocRICrequestIDFail", |
| 413 | "e2err_RICSubscriptionResponseAllocRANfunctionIDFail", |
| 414 | "e2err_RICSubscriptionResponseAllocRICaction_Admitted_ItemIEsFail", |
| 415 | "e2err_RICSubscriptionResponseAllocRICActionAdmittedListFail", |
| 416 | "e2err_RICSubscriptionResponseAllocRICaction_NotAdmitted_ItemIEsFail", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 417 | "e2err_RICSubscriptionResponseEncodeFail", |
| 418 | "e2err_RICSubscriptionResponseAllocE2AP_PDUFail", |
| 419 | "e2err_RICSubscriptionFailureAllocRICrequestIDFail", |
| 420 | "e2err_RICSubscriptionFailureAllocRANfunctionIDFail", |
| 421 | "e2err_RICSubscriptionFailureAllocRICaction_NotAdmitted_ItemIEsFail", |
| 422 | "e2err_RICSubscriptionFailureAllocRICActionAdmittedListFail", |
| 423 | "e2err_RICSubscriptionFailureEncodeFail", |
| 424 | "e2err_RICSubscriptionFailureAllocE2AP_PDUFail", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 425 | "e2err_E2SM_gNB_X2_indicationMessageAllocE2AP_PDUFail", |
| 426 | "e2err_RICSubscriptionDeleteRequestAllocRICrequestIDFail", |
| 427 | "e2err_RICSubscriptionDeleteRequestAllocRANfunctionIDFail", |
| 428 | "e2err_RICSubscriptionDeleteRequestEncodeFail", |
| 429 | "e2err_RICSubscriptionDeleteRequestAllocE2AP_PDUFail", |
| 430 | "e2err_RICSubscriptionDeleteResponseAllocRICrequestIDFail", |
| 431 | "e2err_RICSubscriptionDeleteResponseAllocRANfunctionIDFail", |
| 432 | "e2err_RICSubscriptionDeleteResponseEncodeFail", |
| 433 | "e2err_RICSubscriptionDeleteResponseAllocE2AP_PDUFail", |
| 434 | "e2err_RICSubscriptionDeleteFailureAllocRICrequestIDFail", |
| 435 | "e2err_RICSubscriptionDeleteFailureAllocRANfunctionIDFail", |
| 436 | "e2err_RICSubscriptionDeleteFailureAllocRICcauseFail", |
| 437 | "e2err_RICSubscriptionDeleteFailureEncodeFail", |
| 438 | "e2err_RICSubscriptionDeleteFailureAllocE2AP_PDUFail", |
| 439 | "e2err_RICsubscriptionRequestRICrequestIDMissing", |
| 440 | "e2err_RICsubscriptionRequestRANfunctionIDMissing", |
| 441 | "e2err_RICsubscriptionRequestICsubscriptionMissing", |
| 442 | "e2err_RICEventTriggerDefinitionIEValueFail_5", |
| 443 | "e2err_RICEventTriggerDefinitionIEValueFail_6", |
| 444 | "e2err_RICEventTriggerDefinitionIEValueFail_7", |
| 445 | "e2err_RICEventTriggerDefinitionIEValueFail_8", |
| 446 | "e2err_RICEventTriggerDefinitionDecodeWMOREFail", |
| 447 | "e2err_RICEventTriggerDefinitionDecodeFAIL", |
| 448 | "e2err_RICEventTriggerDefinitionDecodeDefaultFail", |
| 449 | "e2err_RICsubscriptionResponseRICrequestIDMissing", |
| 450 | "e2err_RICsubscriptionResponseRANfunctionIDMissing", |
| 451 | "e2err_RICsubscriptionResponseRICaction_Admitted_ListMissing", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 452 | "e2err_RICsubscriptionFailureRICrequestIDMissing", |
| 453 | "e2err_RICsubscriptionFailureRANfunctionIDMissing", |
| 454 | "e2err_RICsubscriptionFailureRICaction_NotAdmitted_ListMissing", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 455 | "e2err_RICEventTriggerDefinitionIEValueFail_9", |
| 456 | "e2err_RICEventTriggerDefinitionIEValueFail_10", |
| 457 | "e2err_RICEventTriggerDefinitionIEValueFail_11", |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 458 | "e2err_RICsubscriptionDeleteRequestRICrequestIDMissing", |
| 459 | "e2err_RICsubscriptionDeleteRequestRANfunctionIDMissing", |
| 460 | "e2err_RICsubscriptionDeleteResponseRICrequestIDMissing", |
| 461 | "e2err_RICsubscriptionDeleteResponseRANfunctionIDMissing", |
| 462 | "e2err_RICsubscriptionDeleteFailureRICrequestIDMissing", |
| 463 | "e2err_RICsubscriptionDeleteFailureRANfunctionIDMissing", |
| 464 | "e2err_RICsubscriptionDeleteFailureRICcauseMissing" |
| 465 | }; |
| 466 | |
| 467 | typedef struct { |
| 468 | uint64_t messageType; // Initiating message or Successful outcome or Unsuccessful outcome |
| 469 | uint64_t messageId; |
| 470 | } E2MessageInfo_t; |
| 471 | |
| 472 | ////////////////////////////////////////////////////////////////////// |
| 473 | // Message definitons |
| 474 | |
| 475 | // Below constant values are same as in E2AP, E2SM and X2AP specs |
| 476 | extern const uint64_t cE2InitiatingMessage; |
| 477 | extern const uint64_t cE2SuccessfulOutcome; |
| 478 | extern const uint64_t cE2UnsuccessfulOutcome; |
| 479 | |
| 480 | // E2AP messages. Below message id constant values are the same as in ASN.1 specification |
| 481 | |
| 482 | // Initiating message |
| 483 | extern const uint64_t cRICSubscriptionRequest; |
| 484 | extern const uint64_t cRICSubscriptionDeleteRequest; |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 485 | |
| 486 | // Successful outcome |
| 487 | extern const uint64_t cRICSubscriptionResponse; |
| 488 | extern const uint64_t cRICsubscriptionDeleteResponse; |
| 489 | |
| 490 | // Unsuccessful outcome |
| 491 | extern const uint64_t cRICSubscriptionFailure; |
| 492 | extern const uint64_t cRICsubscriptionDeleteFailure; |
| 493 | |
| 494 | typedef struct { |
| 495 | RICRequestID_t ricRequestID; |
| 496 | RANFunctionID_t ranFunctionID; |
| 497 | RICSubscription_t ricSubscription; |
| 498 | } RICSubscriptionRequest_t; |
| 499 | |
| 500 | typedef struct { |
| 501 | RICRequestID_t ricRequestID; |
| 502 | RANFunctionID_t ranFunctionID; |
| 503 | RICActionAdmittedList_t ricActionAdmittedList; |
| 504 | bool ricActionNotAdmittedListPresent; |
| 505 | RICActionNotAdmittedList_t ricActionNotAdmittedList; |
| 506 | } RICSubscriptionResponse_t; |
| 507 | |
| 508 | |
| 509 | typedef struct { |
| 510 | RICRequestID_t ricRequestID; |
| 511 | RANFunctionID_t ranFunctionID; |
| 512 | RICActionNotAdmittedList_t ricActionNotAdmittedList; |
| 513 | bool criticalityDiagnosticsPresent; |
| 514 | CriticalityDiagnostics__t criticalityDiagnostics; |
| 515 | } RICSubscriptionFailure_t; |
| 516 | |
| 517 | typedef struct { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 518 | RICRequestID_t ricRequestID; |
| 519 | RANFunctionID_t ranFunctionID; |
| 520 | } RICSubscriptionDeleteRequest_t; |
| 521 | |
| 522 | typedef struct { |
| 523 | RICRequestID_t ricRequestID; |
| 524 | RANFunctionID_t ranFunctionID; |
| 525 | } RICSubscriptionDeleteResponse_t; |
| 526 | |
| 527 | typedef struct { |
| 528 | RICRequestID_t ricRequestID; |
| 529 | RANFunctionID_t ranFunctionID; |
| 530 | RICCause_t ricCause; |
| 531 | bool criticalityDiagnosticsPresent; |
Anssi Mannila | 114fa2c | 2020-01-16 12:47:47 +0200 | [diff] [blame] | 532 | CriticalityDiagnostics__t criticalityDiagnostics; // Not used in RIC currently |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 533 | } RICSubscriptionDeleteFailure_t; |
| 534 | |
| 535 | ////////////////////////////////////////////////////////////////////// |
| 536 | // Function declarations |
| 537 | |
| 538 | const char* getE2ErrorString(uint64_t); |
| 539 | |
| 540 | typedef void* e2ap_pdu_ptr_t; |
| 541 | |
| 542 | uint64_t packRICSubscriptionRequest(size_t*, byte*, char*,RICSubscriptionRequest_t*); |
| 543 | uint64_t packRICEventTriggerDefinition(char*,RICEventTriggerDefinition_t*); |
| 544 | uint64_t packRICSubscriptionResponse(size_t*, byte*, char*,RICSubscriptionResponse_t*); |
| 545 | uint64_t packRICSubscriptionFailure(size_t*, byte*, char*,RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 546 | uint64_t packRICSubscriptionDeleteRequest(size_t*, byte*, char*,RICSubscriptionDeleteRequest_t*); |
| 547 | uint64_t packRICSubscriptionDeleteResponse(size_t*, byte*, char*,RICSubscriptionDeleteResponse_t*); |
| 548 | uint64_t packRICSubscriptionDeleteFailure(size_t*, byte*, char*,RICSubscriptionDeleteFailure_t*); |
| 549 | |
| 550 | e2ap_pdu_ptr_t* unpackE2AP_pdu(const size_t, const byte*, char*, E2MessageInfo_t*); |
| 551 | uint64_t getRICSubscriptionRequestData(e2ap_pdu_ptr_t*, RICSubscriptionRequest_t*); |
| 552 | uint64_t getRICEventTriggerDefinitionData(RICEventTriggerDefinition_t*); |
| 553 | uint64_t getRICSubscriptionResponseData(e2ap_pdu_ptr_t*, RICSubscriptionResponse_t*); |
| 554 | uint64_t getRICSubscriptionFailureData(e2ap_pdu_ptr_t*, RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 555 | uint64_t getRICSubscriptionDeleteRequestData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteRequest_t*); |
| 556 | uint64_t getRICSubscriptionDeleteResponseData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteResponse_t*); |
| 557 | uint64_t getRICSubscriptionDeleteFailureData(e2ap_pdu_ptr_t*, RICSubscriptionDeleteFailure_t*); |
| 558 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 559 | #if DEBUG |
| 560 | bool TestRICSubscriptionRequest(); |
| 561 | bool TestRICSubscriptionResponse(); |
| 562 | bool TestRICSubscriptionFailure(); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 563 | bool TestRICSubscriptionDeleteRequest(); |
| 564 | bool TestRICSubscriptionDeleteResponse(); |
| 565 | bool TestRICSubscriptionDeleteFailure(); |
| 566 | |
| 567 | void printRICSubscriptionRequest(const RICSubscriptionRequest_t*); |
| 568 | void printRICSubscriptionResponse(const RICSubscriptionResponse_t*); |
| 569 | void printRICSubscriptionFailure(const RICSubscriptionFailure_t*); |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 570 | void printRICSubscriptionDeleteRequest(const RICSubscriptionDeleteRequest_t*); |
| 571 | void printRICSubscriptionDeleteResponse(const RICSubscriptionDeleteResponse_t*); |
| 572 | void printRICSubscriptionDeleteFailure(const RICSubscriptionDeleteFailure_t*); |
| 573 | #endif |
| 574 | |
| 575 | #ifdef __cplusplus |
| 576 | } |
| 577 | #endif |
| 578 | |
| 579 | #endif |