(family bgp.Family, nlri bgp.NLRI, isWithdraw bool, attrs []bgp.PathAttributeInterface, age time.Time)
| 187 | } |
| 188 | |
| 189 | func 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 | |
| 207 | func GetNativeNlri(p *api.Path) (bgp.NLRI, error) { |
| 208 | if p.Family == nil { |
searching dependent graphs…