diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-07-29 00:07:26 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-07-29 00:07:26 +0900 |
commit | 0147728f77aa1871714b5dd23260732caeceb7ed (patch) | |
tree | 3e7570a99d1e7c78f32cb6aba94ccd73b528fd2e /server/grpc_server.go | |
parent | c3560d1224f7759455b6916843341b20355dbfe5 (diff) |
move gRPC-related code for SoftReset to grpc_server.go
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r-- | server/grpc_server.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go index 00e8e263..b16990c1 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -447,18 +447,21 @@ func (s *Server) ResetNeighbor(ctx context.Context, arg *api.ResetNeighborReques } func (s *Server) SoftResetNeighbor(ctx context.Context, arg *api.SoftResetNeighborRequest) (*api.SoftResetNeighborResponse, error) { - op := REQ_NEIGHBOR_SOFT_RESET + var err error + addr := arg.Address + if addr == "all" { + addr = "" + } + family := bgp.RouteFamily(0) switch arg.Direction { case api.SoftResetNeighborRequest_IN: - op = REQ_NEIGHBOR_SOFT_RESET_IN + err = s.bgpServer.SoftResetIn(addr, family) case api.SoftResetNeighborRequest_OUT: - op = REQ_NEIGHBOR_SOFT_RESET_OUT - } - d, err := s.neighbor(op, arg.Address, arg) - if err != nil { - return nil, err + err = s.bgpServer.SoftResetOut(addr, family) + default: + err = s.bgpServer.SoftReset(addr, family) } - return d.(*api.SoftResetNeighborResponse), err + return &api.SoftResetNeighborResponse{}, err } func (s *Server) ShutdownNeighbor(ctx context.Context, arg *api.ShutdownNeighborRequest) (*api.ShutdownNeighborResponse, error) { |