MCPcopy
hub / github.com/osrg/gobgp / GetNativePathAttributes

Function GetNativePathAttributes

pkg/apiutil/util.go:217–235  ·  view source on GitHub ↗
(p *api.Path)

Source from the content-addressed store, hash-verified

215}
216
217func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error) {
218 pattrsLen := len(p.PattrsBinary)
219 if pattrsLen > 0 {
220 pattrs := make([]bgp.PathAttributeInterface, 0, pattrsLen)
221 for _, attr := range p.PattrsBinary {
222 a, err := bgp.GetPathAttribute(attr)
223 if err != nil {
224 return nil, err
225 }
226 err = a.DecodeFromBytes(attr)
227 if err != nil {
228 return nil, err
229 }
230 pattrs = append(pattrs, a)
231 }
232 return pattrs, nil
233 }
234 return UnmarshalPathAttributes(p.Pattrs)
235}
236
237func ToFamily(f *api.Family) bgp.Family {
238 return bgp.NewFamily(uint16(f.Afi), uint8(f.Safi))

Callers 11

TestMetricsFunction · 0.92
api2PathFunction · 0.92
api2apiutilPathFunction · 0.92
Test_ParsePathFunction · 0.92
Test_ParseEvpnPathFunction · 0.92
Test_ParseFlowSpecPathFunction · 0.92
makeMonitorRouteArgsFunction · 0.92
makeShowRouteArgsFunction · 0.92
showValidationInfoFunction · 0.92
NewDestinationFunction · 0.85

Calls 3

GetPathAttributeFunction · 0.92
UnmarshalPathAttributesFunction · 0.85
DecodeFromBytesMethod · 0.65

Tested by 5

TestMetricsFunction · 0.74
Test_ParsePathFunction · 0.74
Test_ParseEvpnPathFunction · 0.74
Test_ParseFlowSpecPathFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…