(a *bgp.PathAttributeAsPath)
| 318 | } |
| 319 | |
| 320 | func NewAsPathAttributeFromNative(a *bgp.PathAttributeAsPath) (*api.AsPathAttribute, error) { |
| 321 | segments := make([]*api.AsSegment, 0, len(a.Value)) |
| 322 | for _, param := range a.Value { |
| 323 | segments = append(segments, &api.AsSegment{ |
| 324 | Type: api.AsSegment_Type(param.GetType()), |
| 325 | Numbers: param.GetAS(), |
| 326 | }) |
| 327 | } |
| 328 | return &api.AsPathAttribute{ |
| 329 | Segments: segments, |
| 330 | }, nil |
| 331 | } |
| 332 | |
| 333 | func NewNextHopAttributeFromNative(a *bgp.PathAttributeNextHop) (*api.NextHopAttribute, error) { |
| 334 | return &api.NextHopAttribute{ |
searching dependent graphs…