From 5966466632bd73676ec80ca71c5082f88cb65bd6 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Tue, 26 Jul 2016 16:01:20 +0900 Subject: move gRPC-related code for REQ_GET_VRF to grpc_server.go Signed-off-by: FUJITA Tomonori --- server/grpc_server.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'server/grpc_server.go') diff --git a/server/grpc_server.go b/server/grpc_server.go index 34aa1f9d..ca852f83 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -772,11 +772,6 @@ func (s *Server) GetRoa(ctx context.Context, arg *api.GetRoaRequest) (*api.GetRo } func (s *Server) GetVrf(ctx context.Context, arg *api.GetVrfRequest) (*api.GetVrfResponse, error) { - d, err := s.get(REQ_GET_VRF, arg) - if err != nil { - return nil, err - } - l := make([]*api.Vrf, 0, len(d.([]*table.Vrf))) toApi := func(v *table.Vrf) *api.Vrf { f := func(rts []bgp.ExtendedCommunityInterface) [][]byte { ret := make([][]byte, 0, len(rts)) @@ -794,8 +789,9 @@ func (s *Server) GetVrf(ctx context.Context, arg *api.GetVrfRequest) (*api.GetVr ExportRt: f(v.ExportRt), } } - - for _, v := range d.([]*table.Vrf) { + vrfs := s.bgpServer.GetVrf() + l := make([]*api.Vrf, 0, len(vrfs)) + for _, v := range vrfs { l = append(l, toApi(v)) } return &api.GetVrfResponse{Vrfs: l}, nil -- cgit v1.2.3