Squash-merging e2ap-v2.0 branch
[ric-plt/e2mgr.git] / E2Manager / models / e2_node_configuration_update.go
1 //
2 // Copyright 2022 Samsung Electronics Co.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15
16 //  This source code is part of the near-RT RIC (RAN Intelligent Controller)
17 //  platform project (RICP).
18
19 package models
20
21 import (
22         "encoding/xml"
23         "strconv"
24
25         "gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities"
26 )
27
28 type E2nodeConfigurationUpdateMessage struct {
29         XMLName xml.Name `xml:"E2nodeConfigurationUpdateMessage"`
30         Text    string   `xml:",chardata"`
31         E2APPDU struct {
32                 Text              string `xml:",chardata"`
33                 InitiatingMessage struct {
34                         Text          string `xml:",chardata"`
35                         ProcedureCode string `xml:"procedureCode"`
36                         Criticality   struct {
37                                 Text   string `xml:",chardata"`
38                                 Reject string `xml:"reject"`
39                         } `xml:"criticality"`
40                         Value struct {
41                                 Text                      string                    `xml:",chardata"`
42                                 E2nodeConfigurationUpdate E2nodeConfigurationUpdate `xml:"E2nodeConfigurationUpdate"`
43                         } `xml:"value"`
44                 } `xml:"initiatingMessage"`
45         } `xml:"E2AP-PDU"`
46 }
47
48 type E2nodeConfigurationUpdate struct {
49         Text        string `xml:",chardata"`
50         ProtocolIEs struct {
51                 Text                         string                        `xml:",chardata"`
52                 E2nodeConfigurationUpdateIEs []E2nodeConfigurationUpdateIE `xml:"E2nodeConfigurationUpdate-IEs"`
53         } `xml:"protocolIEs"`
54 }
55
56 type E2nodeConfigurationUpdateIE struct {
57         Text        string `xml:",chardata"`
58         ID          string `xml:"id"`
59         Criticality struct {
60                 Text   string `xml:",chardata"`
61                 Reject string `xml:"reject"`
62         } `xml:"criticality"`
63         Value struct {
64                 Text                              string                            `xml:",chardata"`
65                 TransactionID                     string                            `xml:"TransactionID"`
66                 E2nodeComponentConfigAdditionList E2nodeComponentConfigAdditionList `xml:"E2nodeComponentConfigAddition-List"`
67                 E2nodeComponentConfigUpdateList   E2nodeComponentConfigUpdateList   `xml:"E2nodeComponentConfigUpdate-List"`
68                 E2nodeComponentConfigRemovalList  E2nodeComponentConfigRemovalList  `xml:"E2nodeComponentConfigRemoval-List"`
69         } `xml:"value"`
70 }
71
72 type E2nodeComponentConfigAdditionList struct {
73         Text                      string `xml:",chardata"`
74         ProtocolIESingleContainer []struct {
75                 Text        string `xml:",chardata"`
76                 ID          string `xml:"id"`
77                 Criticality struct {
78                         Text   string `xml:",chardata"`
79                         Reject string `xml:"reject"`
80                 } `xml:"criticality"`
81                 Value struct {
82                         Text                              string `xml:",chardata"`
83                         E2nodeComponentConfigAdditionItem struct {
84                                 Text                         string                       `xml:",chardata"`
85                                 E2nodeComponentInterfaceType E2nodeComponentInterfaceType `xml:"e2nodeComponentInterfaceType"`
86                                 E2nodeComponentID            E2nodeComponentID            `xml:"e2nodeComponentID"`
87                                 E2nodeComponentConfiguration E2nodeComponentConfiguration `xml:"e2nodeComponentConfiguration"`
88                         } `xml:"E2nodeComponentConfigAddition-Item"`
89                 } `xml:"value"`
90         } `xml:"ProtocolIE-SingleContainer"`
91 }
92
93 type E2nodeComponentConfigUpdateList struct {
94         Text                      string `xml:",chardata"`
95         ProtocolIESingleContainer []struct {
96                 Text        string `xml:",chardata"`
97                 ID          string `xml:"id"`
98                 Criticality struct {
99                         Text   string `xml:",chardata"`
100                         Reject string `xml:"reject"`
101                 } `xml:"criticality"`
102                 Value struct {
103                         Text                            string `xml:",chardata"`
104                         E2nodeComponentConfigUpdateItem struct {
105                                 Text                         string                       `xml:",chardata"`
106                                 E2nodeComponentInterfaceType E2nodeComponentInterfaceType `xml:"e2nodeComponentInterfaceType"`
107                                 E2nodeComponentID            E2nodeComponentID            `xml:"e2nodeComponentID"`
108                                 E2nodeComponentConfiguration E2nodeComponentConfiguration `xml:"e2nodeComponentConfiguration"`
109                         } `xml:"E2nodeComponentConfigUpdate-Item"`
110                 } `xml:"value"`
111         } `xml:"ProtocolIE-SingleContainer"`
112 }
113
114 type E2nodeComponentConfigRemovalList struct {
115         Text                      string `xml:",chardata"`
116         ProtocolIESingleContainer []struct {
117                 Text        string `xml:",chardata"`
118                 ID          string `xml:"id"`
119                 Criticality struct {
120                         Text   string `xml:",chardata"`
121                         Reject string `xml:"reject"`
122                 } `xml:"criticality"`
123                 Value struct {
124                         Text                             string `xml:",chardata"`
125                         E2nodeComponentConfigRemovalItem struct {
126                                 Text                         string                       `xml:",chardata"`
127                                 E2nodeComponentInterfaceType E2nodeComponentInterfaceType `xml:"e2nodeComponentInterfaceType"`
128                                 E2nodeComponentID            E2nodeComponentID            `xml:"e2nodeComponentID"`
129                         } `xml:"E2nodeComponentConfigRemoval-Item"`
130                 } `xml:"value"`
131         } `xml:"ProtocolIE-SingleContainer"`
132 }
133
134 type E2nodeComponentInterfaceType struct {
135         Text string    `xml:",chardata"`
136         Ng   *struct{} `xml:"ng"`
137         Xn   *struct{} `xml:"xn"`
138         E1   *struct{} `xml:"e1"`
139         F1   *struct{} `xml:"f1"`
140         W1   *struct{} `xml:"w1"`
141         S1   *struct{} `xml:"s1"`
142         X2   *struct{} `xml:"x2"`
143 }
144
145 type E2nodeComponentID struct {
146         Text                           string `xml:",chardata"`
147         E2nodeComponentInterfaceTypeNG struct {
148                 Text    string `xml:",chardata"`
149                 AmfName string `xml:"amf-name"`
150         } `xml:"e2nodeComponentInterfaceTypeNG"`
151         E2nodeComponentInterfaceTypeXn struct {
152                 Text              string `xml:",chardata"`
153                 GlobalNGRANNodeID string `xml:"global-NG-RAN-Node-ID"`
154         } `xml:"e2nodeComponentInterfaceTypeXn"`
155         E2nodeComponentInterfaceTypeE1 struct {
156                 Text      string `xml:",chardata"`
157                 GNBCUCPID string `xml:"gNB-CU-CP-ID"`
158         } `xml:"e2nodeComponentInterfaceTypeE1"`
159         E2nodeComponentInterfaceTypeF1 struct {
160                 Text    string `xml:",chardata"`
161                 GNBDUID string `xml:"gNB-DU-ID"`
162         } `xml:"e2nodeComponentInterfaceTypeF1"`
163         E2nodeComponentInterfaceTypeW1 struct {
164                 Text      string `xml:",chardata"`
165                 NgENBDUID string `xml:"ng-eNB-DU-ID"`
166         } `xml:"e2nodeComponentInterfaceTypeW1"`
167         E2nodeComponentInterfaceTypeS1 struct {
168                 Text    string `xml:",chardata"`
169                 MmeName string `xml:"mme-name"`
170         } `xml:"e2nodeComponentInterfaceTypeS1"`
171         E2nodeComponentInterfaceTypeX2 struct {
172                 Text          string `xml:",chardata"`
173                 GlobalENBID   string `xml:"global-eNB-ID"`
174                 GlobalEnGNBID string `xml:"global-en-gNB-ID"`
175         } `xml:"e2nodeComponentInterfaceTypeX2"`
176 }
177
178 type E2nodeComponentConfiguration struct {
179         Text                        string `xml:",chardata"`
180         E2nodeComponentRequestPart  string `xml:"e2nodeComponentRequestPart"`
181         E2nodeComponentResponsePart string `xml:"e2nodeComponentResponsePart"`
182 }
183
184 func (m *E2nodeConfigurationUpdateMessage) ExtractConfigAdditionList() []entities.E2NodeComponentConfig {
185         var result []entities.E2NodeComponentConfig
186         e2nodeConfigUpdateIEs := m.E2APPDU.InitiatingMessage.Value.E2nodeConfigurationUpdate.ProtocolIEs.E2nodeConfigurationUpdateIEs
187
188         var additionList *E2nodeComponentConfigAdditionList
189         for _, v := range e2nodeConfigUpdateIEs {
190                 if v.ID == ProtocolIE_ID_id_E2nodeComponentConfigAddition {
191                         additionList = &(v.Value.E2nodeComponentConfigAdditionList)
192                         break
193                 }
194         }
195
196         // need not to check for empty addtionList
197         // as list defined as SIZE(1..maxofE2nodeComponents)
198         if additionList != nil {
199                 for _, val := range additionList.ProtocolIESingleContainer {
200                         componentItem := val.Value.E2nodeComponentConfigAdditionItem
201                         if componentItem.E2nodeComponentInterfaceType.Ng != nil { // NG Interface
202                                 result = append(result, entities.E2NodeComponentConfig{
203                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_ng,
204                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
205                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
206                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeNG{
207                                                 E2NodeComponentInterfaceTypeNG: &entities.E2NodeComponentInterfaceNG{
208                                                         AmfName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeNG.AmfName,
209                                                 },
210                                         },
211                                 })
212                         }
213
214                         // TODO - Not Supported Yet
215                         if componentItem.E2nodeComponentInterfaceType.Xn != nil { // xn inetrface
216                                 // result = append(result, entities.E2NodeComponentConfig{
217                                 //      E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_xn,
218                                 //      E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
219                                 //      E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
220                                 //      E2NodeComponentID:            &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeXn{},
221                                 // })
222                         }
223
224                         if componentItem.E2nodeComponentInterfaceType.E1 != nil { // e1 interface
225                                 gnbCuCpId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeE1.GNBCUCPID, 10, 64)
226                                 if err != nil {
227                                         continue
228                                 }
229
230                                 result = append(result, entities.E2NodeComponentConfig{
231                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_e1,
232                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
233                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
234                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeE1{
235                                                 E2NodeComponentInterfaceTypeE1: &entities.E2NodeComponentInterfaceE1{
236                                                         GNBCuCpId: gnbCuCpId,
237                                                 },
238                                         },
239                                 })
240                         }
241
242                         if componentItem.E2nodeComponentInterfaceType.F1 != nil { // f1 interface
243                                 gnbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeF1.GNBDUID, 10, 64)
244                                 if err != nil {
245                                         continue
246                                 }
247                                 result = append(result, entities.E2NodeComponentConfig{
248                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_f1,
249                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
250                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
251                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeF1{
252                                                 E2NodeComponentInterfaceTypeF1: &entities.E2NodeComponentInterfaceF1{
253                                                         GNBDuId: gnbDuId,
254                                                 },
255                                         },
256                                 })
257                         }
258
259                         if componentItem.E2nodeComponentInterfaceType.W1 != nil { // w1 interface
260                                 ngenbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeW1.NgENBDUID, 10, 64)
261                                 if err != nil {
262                                         continue
263                                 }
264
265                                 result = append(result, entities.E2NodeComponentConfig{
266                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_w1,
267                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
268                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
269                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeW1{
270                                                 E2NodeComponentInterfaceTypeW1: &entities.E2NodeComponentInterfaceW1{
271                                                         NgenbDuId: ngenbDuId,
272                                                 },
273                                         },
274                                 })
275                         }
276
277                         if componentItem.E2nodeComponentInterfaceType.S1 != nil { // s1 interface
278                                 result = append(result, entities.E2NodeComponentConfig{
279                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_s1,
280                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
281                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
282                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeS1{
283                                                 E2NodeComponentInterfaceTypeS1: &entities.E2NodeComponentInterfaceS1{
284                                                         MmeName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeS1.MmeName,
285                                                 },
286                                         },
287                                 })
288                         }
289
290                         // TODO - Not Supported Yet
291                         if componentItem.E2nodeComponentInterfaceType.X2 != nil { // x2 interface
292                                 // result = append(result, entities.E2NodeComponentConfig{
293                                 //      E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_x2,
294                                 //      E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
295                                 //      E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
296                                 //      E2NodeComponentID:            &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeX2{},
297                                 // })
298
299                         }
300                 }
301         }
302         return result
303 }
304
305 func (m *E2nodeConfigurationUpdateMessage) ExtractConfigUpdateList() []entities.E2NodeComponentConfig {
306         var result []entities.E2NodeComponentConfig
307         e2nodeConfigUpdateIEs := m.E2APPDU.InitiatingMessage.Value.E2nodeConfigurationUpdate.ProtocolIEs.E2nodeConfigurationUpdateIEs
308
309         var updateList *E2nodeComponentConfigUpdateList
310         for _, v := range e2nodeConfigUpdateIEs {
311                 if v.ID == "33" {
312                         updateList = &(v.Value.E2nodeComponentConfigUpdateList)
313                         break
314                 }
315         }
316
317         // need not to check for empty addtionList
318         // as list defined as SIZE(1..maxofE2nodeComponents)
319         if updateList != nil {
320                 for _, val := range updateList.ProtocolIESingleContainer {
321                         componentItem := val.Value.E2nodeComponentConfigUpdateItem
322                         if componentItem.E2nodeComponentInterfaceType.Ng != nil { // NG Interface
323                                 result = append(result, entities.E2NodeComponentConfig{
324                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_ng,
325                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
326                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
327                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeNG{
328                                                 E2NodeComponentInterfaceTypeNG: &entities.E2NodeComponentInterfaceNG{
329                                                         AmfName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeNG.AmfName,
330                                                 },
331                                         },
332                                 })
333                                 continue
334                         }
335
336                         if componentItem.E2nodeComponentInterfaceType.Xn != nil { // xn inetrface
337                                 // TODO - Not Supported Yet
338                                 continue
339                         }
340
341                         if componentItem.E2nodeComponentInterfaceType.E1 != nil { // e1 interface
342                                 gnbCuCpId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeE1.GNBCUCPID, 10, 64)
343                                 if err == nil {
344                                         result = append(result, entities.E2NodeComponentConfig{
345                                                 E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_e1,
346                                                 E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
347                                                 E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
348                                                 E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeE1{
349                                                         E2NodeComponentInterfaceTypeE1: &entities.E2NodeComponentInterfaceE1{
350                                                                 GNBCuCpId: gnbCuCpId,
351                                                         },
352                                                 },
353                                         })
354                                 }
355                                 continue
356                         }
357
358                         if componentItem.E2nodeComponentInterfaceType.F1 != nil { // f1 interface
359                                 gnbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeF1.GNBDUID, 10, 64)
360                                 if err == nil {
361                                         result = append(result, entities.E2NodeComponentConfig{
362                                                 E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_f1,
363                                                 E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
364                                                 E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
365                                                 E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeF1{
366                                                         E2NodeComponentInterfaceTypeF1: &entities.E2NodeComponentInterfaceF1{
367                                                                 GNBDuId: gnbDuId,
368                                                         },
369                                                 },
370                                         })
371                                 }
372                                 continue
373                         }
374
375                         if componentItem.E2nodeComponentInterfaceType.W1 != nil { // w1 interface
376                                 ngenbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeW1.NgENBDUID, 10, 64)
377                                 if err == nil {
378                                         result = append(result, entities.E2NodeComponentConfig{
379                                                 E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_w1,
380                                                 E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
381                                                 E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
382                                                 E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeW1{
383                                                         E2NodeComponentInterfaceTypeW1: &entities.E2NodeComponentInterfaceW1{
384                                                                 NgenbDuId: ngenbDuId,
385                                                         },
386                                                 },
387                                         })
388                                 }
389                                 continue
390                         }
391
392                         if componentItem.E2nodeComponentInterfaceType.S1 != nil { // s1 interface
393                                 result = append(result, entities.E2NodeComponentConfig{
394                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_s1,
395                                         E2NodeComponentRequestPart:   []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentRequestPart),
396                                         E2NodeComponentResponsePart:  []byte(componentItem.E2nodeComponentConfiguration.E2nodeComponentResponsePart),
397                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeS1{
398                                                 E2NodeComponentInterfaceTypeS1: &entities.E2NodeComponentInterfaceS1{
399                                                         MmeName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeS1.MmeName,
400                                                 },
401                                         },
402                                 })
403                                 continue
404                         }
405
406                         if componentItem.E2nodeComponentInterfaceType.X2 != nil { // x2 interface
407                                 // TODO - Not Supported Yet
408                                 continue
409                         }
410                 }
411         }
412         return result
413 }
414
415 func (m *E2nodeConfigurationUpdateMessage) ExtractConfigDeletionList() []entities.E2NodeComponentConfig {
416         var result []entities.E2NodeComponentConfig
417         e2nodeConfigUpdateIEs := m.E2APPDU.InitiatingMessage.Value.E2nodeConfigurationUpdate.ProtocolIEs.E2nodeConfigurationUpdateIEs
418
419         var deletionList *E2nodeComponentConfigRemovalList
420         for _, v := range e2nodeConfigUpdateIEs {
421                 if v.ID == ProtocolIE_ID_id_E2nodeComponentConfigRemoval {
422                         deletionList = &(v.Value.E2nodeComponentConfigRemovalList)
423                         break
424                 }
425         }
426
427         // need not to check for empty addtionList
428         // as list defined as SIZE(1..maxofE2nodeComponents)
429         if deletionList != nil {
430                 for _, val := range deletionList.ProtocolIESingleContainer {
431                         componentItem := val.Value.E2nodeComponentConfigRemovalItem
432
433                         if componentItem.E2nodeComponentInterfaceType.Ng != nil { // NG Interface
434                                 result = append(result, entities.E2NodeComponentConfig{
435                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_ng,
436                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeNG{
437                                                 E2NodeComponentInterfaceTypeNG: &entities.E2NodeComponentInterfaceNG{
438                                                         AmfName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeNG.AmfName,
439                                                 },
440                                         },
441                                 })
442                         }
443
444                         if componentItem.E2nodeComponentInterfaceType.Xn != nil { // xn inetrface
445                                 // TODO - Not Supported Yet
446                         }
447
448                         if componentItem.E2nodeComponentInterfaceType.E1 != nil { // e1 interface
449                                 gnbCuCpId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeE1.GNBCUCPID, 10, 64)
450                                 if err != nil {
451                                         continue
452                                 }
453
454                                 result = append(result, entities.E2NodeComponentConfig{
455                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_e1,
456                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeE1{
457                                                 E2NodeComponentInterfaceTypeE1: &entities.E2NodeComponentInterfaceE1{
458                                                         GNBCuCpId: gnbCuCpId,
459                                                 },
460                                         },
461                                 })
462                         }
463
464                         if componentItem.E2nodeComponentInterfaceType.F1 != nil { // f1 interface
465                                 gnbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeF1.GNBDUID, 10, 64)
466                                 if err != nil {
467                                         continue
468                                 }
469                                 result = append(result, entities.E2NodeComponentConfig{
470                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_f1,
471                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeF1{
472                                                 E2NodeComponentInterfaceTypeF1: &entities.E2NodeComponentInterfaceF1{
473                                                         GNBDuId: gnbDuId,
474                                                 },
475                                         },
476                                 })
477                         }
478
479                         if componentItem.E2nodeComponentInterfaceType.W1 != nil { // w1 interface
480                                 ngenbDuId, err := strconv.ParseInt(componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeW1.NgENBDUID, 10, 64)
481                                 if err != nil {
482                                         continue
483                                 }
484
485                                 result = append(result, entities.E2NodeComponentConfig{
486                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_w1,
487                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeW1{
488                                                 E2NodeComponentInterfaceTypeW1: &entities.E2NodeComponentInterfaceW1{
489                                                         NgenbDuId: ngenbDuId,
490                                                 },
491                                         },
492                                 })
493                         }
494
495                         if componentItem.E2nodeComponentInterfaceType.S1 != nil { // s1 interface
496                                 result = append(result, entities.E2NodeComponentConfig{
497                                         E2NodeComponentInterfaceType: entities.E2NodeComponentInterfaceType_s1,
498                                         E2NodeComponentID: &entities.E2NodeComponentConfig_E2NodeComponentInterfaceTypeS1{
499                                                 E2NodeComponentInterfaceTypeS1: &entities.E2NodeComponentInterfaceS1{
500                                                         MmeName: componentItem.E2nodeComponentID.E2nodeComponentInterfaceTypeS1.MmeName,
501                                                 },
502                                         },
503                                 })
504                         }
505
506                         if componentItem.E2nodeComponentInterfaceType.X2 != nil { // x2 interface
507                                 // TODO - Not Supported Yet
508                         }
509                 }
510         }
511         return result
512 }