2 ==================================================================================
3 Copyright (c) 2019 AT&T Intellectual Property.
4 Copyright (c) 2019 Nokia
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
10 http://www.apache.org/licenses/LICENSE-2.0
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 ==================================================================================
23 "gerrit.o-ran-sc.org/r/ric-plt/e2ap/pkg/conv"
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 E2AP_InitiatingMessage uint64 = 1
32 E2AP_SuccessfulOutcome uint64 = 2
33 E2AP_UnsuccessfulOutcome uint64 = 3
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
42 E2AP_RICSubscriptionRequest uint64 = 1
43 E2AP_RICSubscriptionDeleteRequest uint64 = 2
45 // E2AP_RICServiceUpdate uint64 = 3
46 // E2AP_RICControlRequest uint64 = 4
48 // //E2AP_X2SetupRequest uint64 = 5;
49 // E2AP_ENDCX2SetupRequest uint64 = 6
50 // E2AP_ResourceStatusRequest uint64 = 7
51 // E2AP_ENBConfigurationUpdate uint64 = 8
52 // E2AP_ENDCConfigurationUpdate uint64 = 9
53 // E2AP_ResetRequest uint64 = 10
54 // E2AP_RICIndication uint64 = 11
56 // E2AP_RICServiceQuery uint64 = 12
57 // E2AP_LoadInformation uint64 = 13
58 // E2AP_GNBStatusIndication uint64 = 14
59 // E2AP_ResourceStatusUpdate uint64 = 15
60 // E2AP_ErrorIndication uint64 = 16
67 E2AP_RICSubscriptionResponse uint64 = 1
68 E2AP_RICSubscriptionDeleteResponse uint64 = 2
70 // E2AP_RICserviceUpdateAcknowledge uint64 = 3
71 // E2AP_RICcontrolAcknowledge uint64 = 4
73 // //E2AP_X2SetupResponse uint64 = 5;
74 // E2AP_ENDCX2SetupResponse uint64 = 6
75 // E2AP_ResourceStatusResponse uint64 = 7
76 // E2AP_ENBConfigurationUpdateAcknowledge uint64 = 8
77 // E2AP_ENDCConfigurationUpdateAcknowledge uint64 = 9
78 // E2AP_ResetResponse uint64 = 10
83 // Unsuccessful outcome
85 E2AP_RICSubscriptionFailure uint64 = 1
86 E2AP_RICSubscriptionDeleteFailure uint64 = 2
88 // E2AP_RICserviceUpdateFailure uint64 = 3
89 // E2AP_RICcontrolFailure uint64 = 4
91 // //E2AP_X2SetupFailure uint64 = 5;
92 // E2AP_ENDCX2SetupFailure uint64 = 6
93 // E2AP_ResourceStatusFailure uint64 = 7
94 // E2AP_ENBConfigurationUpdateFailure uint64 = 8
95 // E2AP_ENDCConfigurationUpdateFailure uint64 = 9
99 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
102 type PackedData struct {
106 //-----------------------------------------------------------------------------
108 //-----------------------------------------------------------------------------
109 type MessageInfo struct {
114 func (msgInfo *MessageInfo) String() string {
115 return "msginfo(" + strconv.FormatUint((uint64)(msgInfo.MsgType), 10) + string(":") + strconv.FormatUint((uint64)(msgInfo.MsgId), 10) + ")"
118 //-----------------------------------------------------------------------------
120 //-----------------------------------------------------------------------------
121 type RequestId struct {
122 Id uint32 //RequestorId
123 InstanceId uint32 //Same as SubId in many place in the code. Name changed in E2 spec SubId -> InstanceId
126 func (rid *RequestId) String() string {
127 return strconv.FormatUint((uint64)(rid.Id), 10) + string(":") + strconv.FormatUint((uint64)(rid.InstanceId), 10)
130 //-----------------------------------------------------------------------------
132 //-----------------------------------------------------------------------------
133 type FunctionId uint16
135 //-----------------------------------------------------------------------------
137 //-----------------------------------------------------------------------------
140 E2AP_ENBIDMacroPBits20 uint8 = 20
141 E2AP_ENBIDHomeBits28 uint8 = 28
142 E2AP_ENBIDShortMacroits18 uint8 = 18
143 E2AP_ENBIDlongMacroBits21 uint8 = 21
151 func (nid *NodeId) String() string {
152 return strconv.FormatUint((uint64)(nid.Id), 10)
155 //-----------------------------------------------------------------------------
157 //-----------------------------------------------------------------------------
158 type GlobalNodeId struct {
160 PlmnIdentity conv.PlmnIdentityTbcd
164 func (gnid *GlobalNodeId) String() string {
165 return gnid.PlmnIdentity.String() + string(":") + gnid.NodeId.String()
168 //-----------------------------------------------------------------------------
170 //-----------------------------------------------------------------------------
171 type InterfaceId struct {
172 GlobalEnbId GlobalNodeId
173 GlobalGnbId GlobalNodeId
176 //-----------------------------------------------------------------------------
178 //-----------------------------------------------------------------------------
181 E2AP_InterfaceDirectionIncoming uint32 = 0
182 E2AP_InterfaceDirectionOutgoing uint32 = 1
185 type EventTriggerDefinition struct {
190 //-----------------------------------------------------------------------------
192 //-----------------------------------------------------------------------------
193 type CallProcessId struct {
194 CallProcessIDVal uint32
198 type ActionDefinitionChoice struct {
202 //-----------------------------------------------------------------------------
204 //-----------------------------------------------------------------------------
205 type BitString struct {
211 //-----------------------------------------------------------------------------
213 //-----------------------------------------------------------------------------
214 type OctetString struct {
219 //-----------------------------------------------------------------------------
221 //-----------------------------------------------------------------------------
223 E2AP_SubSeqActionTypeContinue uint64 = 0
224 E2AP_SubSeqActionTypeWait uint64 = 1
227 var E2AP_SubSeqActionTypeStrMap = map[string]uint64{
228 "continue": E2AP_SubSeqActionTypeContinue,
229 "wait": E2AP_SubSeqActionTypeWait,
233 E2AP_TimeToWaitZero uint64 = 0
234 E2AP_TimeToWaitW1ms uint64 = 1
235 E2AP_TimeToWaitW2ms uint64 = 2
236 E2AP_TimeToWaitW5ms uint64 = 3
237 E2AP_TimeToWaitW10ms uint64 = 4
238 E2AP_TimeToWaitW20ms uint64 = 5
239 E2AP_TimeToWaitW30ms uint64 = 6
240 E2AP_TimeToWaitW40ms uint64 = 7
241 E2AP_TimeToWaitW50ms uint64 = 8
242 E2AP_TimeToWaitW100ms uint64 = 9
243 E2AP_TimeToWaitW200ms uint64 = 10
244 E2AP_TimeToWaitW500ms uint64 = 11
245 E2AP_TimeToWaitW1s uint64 = 12
246 E2AP_TimeToWaitW2s uint64 = 13
247 E2AP_TimeToWaitW5s uint64 = 14
248 E2AP_TimeToWaitW10s uint64 = 15
249 E2AP_TimeToWaitW20s uint64 = 16
250 E2AP_TimeToWaitW60 uint64 = 17
253 var E2AP_TimeToWaitStrMap = map[string]uint64{
254 "zero": E2AP_TimeToWaitZero,
255 "w1ms": E2AP_TimeToWaitW1ms,
256 "w2ms": E2AP_TimeToWaitW2ms,
257 "w5ms": E2AP_TimeToWaitW5ms,
258 "w10ms": E2AP_TimeToWaitW10ms,
259 "w20ms": E2AP_TimeToWaitW20ms,
260 "w30ms": E2AP_TimeToWaitW30ms,
261 "w40ms": E2AP_TimeToWaitW40ms,
262 "w50ms": E2AP_TimeToWaitW50ms,
263 "w100ms": E2AP_TimeToWaitW100ms,
264 "w200ms": E2AP_TimeToWaitW200ms,
265 "w500ms": E2AP_TimeToWaitW500ms,
266 "w1s": E2AP_TimeToWaitW1s,
267 "w2s": E2AP_TimeToWaitW2s,
268 "w5s": E2AP_TimeToWaitW5s,
269 "w10s": E2AP_TimeToWaitW10s,
270 "w20s": E2AP_TimeToWaitW20s,
271 "w60s": E2AP_TimeToWaitW60,
274 type SubsequentAction struct {
280 //-----------------------------------------------------------------------------
282 //-----------------------------------------------------------------------------
285 E2AP_ActionTypeReport uint64 = 0
286 E2AP_ActionTypeInsert uint64 = 1
287 E2AP_ActionTypePolicy uint64 = 2
288 E2AP_ActionTypeInvalid uint64 = 99 // For RIC internal usage only
291 var E2AP_ActionTypeStrMap = map[string]uint64{
292 "report": E2AP_ActionTypeReport,
293 "insert": E2AP_ActionTypeInsert,
294 "policy": E2AP_ActionTypePolicy,
297 type ActionToBeSetupItem struct {
300 RicActionDefinitionPresent bool
301 ActionDefinitionChoice
305 //-----------------------------------------------------------------------------
307 //-----------------------------------------------------------------------------
310 E2AP_CauseContent_RadioNetwork uint8 = 1
311 E2AP_CauseContent_Transport uint8 = 2
312 E2AP_CauseContent_Protocol uint8 = 3
313 E2AP_CauseContent_Misc uint8 = 4
314 E2AP_CauseContent_Ric uint8 = 5
318 // E2AP_CauseValue_RadioNetwork_ uint8 = 0
321 // E2AP_CauseValue_Transport_ uint8 = 0
324 // E2AP_CauseValue_Protocol_ uint8 = 0
327 // E2AP_CauseValue_Misc_ uint8 = 0
331 E2AP_CauseValue_Ric_function_id_Invalid uint8 = 0
332 E2AP_CauseValue_Ric_action_not_supported uint8 = 1
333 E2AP_CauseValue_Ric_excessive_actions uint8 = 2
334 E2AP_CauseValue_Ric_duplicate_action uint8 = 3
335 E2AP_CauseValue_Ric_duplicate_event uint8 = 4
336 E2AP_CauseValue_Ric_function_resource_limit uint8 = 5
337 E2AP_CauseValue_Ric_request_id_unknown uint8 = 6
338 E2AP_CauseValue_Ric_inconsistent_action_subsequent_action_sequence uint8 = 7
339 E2AP_CauseValue_Ric_control_message_invalid uint8 = 8
340 E2AP_CauseValue_Ric_call_process_id_invalid uint8 = 9
341 E2AP_CauseValue_Ric_function_not_required uint8 = 10
342 E2AP_CauseValue_Ric_excessive_functions uint8 = 11
343 E2AP_CauseValue_Ric_ric_resource_limi uint8 = 12
351 //-----------------------------------------------------------------------------
353 //-----------------------------------------------------------------------------
354 type ActionAdmittedItem struct {
358 //-----------------------------------------------------------------------------
360 //-----------------------------------------------------------------------------
361 type ActionAdmittedList struct {
362 Items []ActionAdmittedItem //16
365 //-----------------------------------------------------------------------------
367 //-----------------------------------------------------------------------------
368 type ActionNotAdmittedItem struct {
373 //-----------------------------------------------------------------------------
375 //-----------------------------------------------------------------------------
376 type ActionNotAdmittedList struct {
377 Items []ActionNotAdmittedItem //16
380 //-----------------------------------------------------------------------------
382 //-----------------------------------------------------------------------------
384 E2AP_CriticalityReject uint8 = 0
385 E2AP_CriticalityIgnore uint8 = 1
386 E2AP_CriticalityNotify uint8 = 2
389 type CriticalityDiagnosticsIEListItem struct {
390 IeCriticality uint8 //Crit
395 //-----------------------------------------------------------------------------
397 //-----------------------------------------------------------------------------
398 type CriticalityDiagnosticsIEList struct {
399 Items []CriticalityDiagnosticsIEListItem //256
402 //-----------------------------------------------------------------------------
404 //-----------------------------------------------------------------------------
405 type CriticalityDiagnostics struct {
412 ProcCrit uint8 //Crit
413 CriticalityDiagnosticsIEList