diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-08-20 20:25:36 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-08-25 15:53:14 +0900 |
commit | 26c232f2c4c5e7e8707a00c418316a0218fcabff (patch) | |
tree | a3e70204e536550b89aa2212ed1ce075d0543c48 | |
parent | 3235c0618cfc320c0ad751d83d850ec714fa1c49 (diff) |
api: publish ToPathApi(*table.Path)
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | api/grpc_server.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index a850100c..3ddc43b2 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -180,7 +180,7 @@ func (s *Server) GetNeighbor(ctx context.Context, arg *GetNeighborRequest) (*Get return &GetNeighborResponse{Peers: p}, nil } -func toPathApi(path *table.Path) *Path { +func ToPathApi(path *table.Path) *Path { nlri := path.GetNlri() n, _ := nlri.Serialize() family := uint32(bgp.AfiSafiToRouteFamily(nlri.AFI(), nlri.SAFI())) @@ -257,7 +257,7 @@ func (s *Server) GetRib(ctx context.Context, arg *GetRibRequest) (*GetRibRespons Paths: func(paths []*table.Path) []*Path { l := make([]*Path, 0, len(paths)) for i, p := range paths { - pp := toPathApi(p) + pp := ToPathApi(p) switch arg.Table.Type { case Resource_LOCAL, Resource_GLOBAL: if i == 0 { @@ -306,11 +306,11 @@ func (s *Server) MonitorRib(arg *Table, stream GobgpApi_MonitorRibServer) error continue } if dst, y := dsts[path.GetNlri().String()]; y { - dst.Paths = append(dst.Paths, toPathApi(path)) + dst.Paths = append(dst.Paths, ToPathApi(path)) } else { dsts[path.GetNlri().String()] = &Destination{ Prefix: path.GetNlri().String(), - Paths: []*Path{toPathApi(path)}, + Paths: []*Path{ToPathApi(path)}, } } } |