+type RANfunctionsList struct {
+ Text string `xml:",chardata"`
+ ProtocolIESingleContainer []struct {
+ Text string `xml:",chardata"`
+ ID string `xml:"id"`
+ Criticality struct {
+ Text string `xml:",chardata"`
+ Reject string `xml:"reject"`
+ } `xml:"criticality"`
+ Value struct {
+ Text string `xml:",chardata"`
+ RANfunctionItem struct {
+ Text string `xml:",chardata"`
+ RanFunctionID string `xml:"ranFunctionID"`
+ RanFunctionDefinition string `xml:"ranFunctionDefinition"`
+ RanFunctionRevision string `xml:"ranFunctionRevision"`
+ } `xml:"RANfunction-Item"`
+ } `xml:"value"`
+ } `xml:"ProtocolIE-SingleContainer"`
+}
+
+func (m *E2SetupRequestMessage) GetExtractRanFunctionsList()([]*entities.RanFunction, error){
+ list :=m.E2APPDU.InitiatingMessage.Value.E2setupRequest.ProtocolIEs.E2setupRequestIEs[1].Value.RANfunctionsList.ProtocolIESingleContainer
+ funcs := make([]*entities.RanFunction, len(list))
+ for i:=0; i < len(funcs); i++{
+ funcs[i] = &entities.RanFunction{}
+ id, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionID, 10, 32)
+ if err != nil {
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.GetExtractRanFunctionsList - Failed parse uint RanFunctionID from %s", list[i].Value.RANfunctionItem.RanFunctionID))
+ }
+ funcs[i].RanFunctionId = uint32(id)
+ rev, err := strconv.ParseUint(list[i].Value.RANfunctionItem.RanFunctionRevision, 10, 32)
+ if err != nil {
+ return nil, errors.New(fmt.Sprintf("#e2_setup_request_message.GetExtractRanFunctionsList - Failed parse uint RanFunctionRevision from %s", list[i].Value.RANfunctionItem.RanFunctionRevision))
+ }
+ funcs[i].RanFunctionDefinition = list[i].Value.RANfunctionItem.RanFunctionDefinition
+ funcs[i].RanFunctionRevision = uint32(rev)
+ }
+ return funcs, nil
+}
+