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

Function NewPath

pkg/apiutil/util.go:189–205  ·  view source on GitHub ↗
(family bgp.Family, nlri bgp.NLRI, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time)

Source from the content-addressed store, hash-verified

187}
188
189func NewPath(family bgp.Family, nlri bgp.NLRI, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time) (*api.Path, error) {
190 n, err := MarshalNLRI(nlri)
191 if err != nil {
192 return nil, err
193 }
194 a, err := MarshalPathAttributes(attrs)
195 if err != nil {
196 return nil, err
197 }
198 return &api.Path{
199 Nlri: n,
200 Pattrs: a,
201 Age: tspb.New(age),
202 IsWithdraw: isWithdraw,
203 Family: ToApiFamily(family.Afi(), family.Safi()),
204 }, nil
205}
206
207func GetNativeNlri(p *api.Path) (bgp.NLRI, error) {
208 if p.Family == nil {

Calls 5

MarshalNLRIFunction · 0.85
MarshalPathAttributesFunction · 0.85
ToApiFamilyFunction · 0.85
AfiMethod · 0.80
SafiMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…