diff options
-rw-r--r-- | api/gobgp.pb.go | 1 | ||||
-rw-r--r-- | api/gobgp.proto | 1 | ||||
-rw-r--r-- | table/path.go | 7 |
3 files changed, 7 insertions, 2 deletions
diff --git a/api/gobgp.pb.go b/api/gobgp.pb.go index dbcc63d5..876d5218 100644 --- a/api/gobgp.pb.go +++ b/api/gobgp.pb.go @@ -328,6 +328,7 @@ type Path struct { IsWithdraw bool `protobuf:"varint,5,opt,name=is_withdraw" json:"is_withdraw,omitempty"` Validation int32 `protobuf:"varint,6,opt,name=validation" json:"validation,omitempty"` NoImplicitWithdraw bool `protobuf:"varint,7,opt,name=no_implicit_withdraw" json:"no_implicit_withdraw,omitempty"` + Rf uint32 `protobuf:"varint,8,opt,name=rf" json:"rf,omitempty"` } func (m *Path) Reset() { *m = Path{} } diff --git a/api/gobgp.proto b/api/gobgp.proto index 135fff8c..024f699a 100644 --- a/api/gobgp.proto +++ b/api/gobgp.proto @@ -143,6 +143,7 @@ message Path { bool is_withdraw = 5; int32 validation = 6; bool no_implicit_withdraw = 7; + uint32 rf = 8; } message Destination { diff --git a/table/path.go b/table/path.go index bc982cec..62f0e437 100644 --- a/table/path.go +++ b/table/path.go @@ -143,7 +143,9 @@ func (path *Path) IsIBGP() bool { } func (path *Path) ToApiStruct() *api.Path { - nlri, _ := path.GetNlri().Serialize() + nlri := path.GetNlri() + n, _ := nlri.Serialize() + rf := uint32(bgp.AfiSafiToRouteFamily(nlri.AFI(), nlri.SAFI())) pattrs := func(arg []bgp.PathAttributeInterface) [][]byte { ret := make([][]byte, 0, len(arg)) for _, a := range arg { @@ -153,11 +155,12 @@ func (path *Path) ToApiStruct() *api.Path { return ret }(path.GetPathAttrs()) return &api.Path{ - Nlri: nlri, + Nlri: n, Pattrs: pattrs, Age: int64(time.Now().Sub(path.timestamp).Seconds()), IsWithdraw: path.IsWithdraw, Validation: int32(path.Validation), + Rf: rf, } } |