diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-17 18:44:13 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-17 18:44:13 -0800 |
commit | 52ce66ef711d4f2cd356ec654e57ad6e2732981d (patch) | |
tree | 15079ebb80b686fb0210d291fdd5607fccc32385 /server/server.go | |
parent | 1b5d53c411f71209263b8f590ca317802f89621f (diff) |
rpki: support reset/softreset/enable operation
gobgp rpki server <ip address> reset|softreset|enable
reset: close a tcp conneciton and retry to connect and send ResetQuery
softreset: send ResetQuery
enable: send SerialQuery
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/server/server.go b/server/server.go index c5875299..a72c9d1d 100644 --- a/server/server.go +++ b/server/server.go @@ -2375,22 +2375,7 @@ func (server *BgpServer) handleModMrt(grpcReq *GrpcRequest) { func (server *BgpServer) handleModRpki(grpcReq *GrpcRequest) { arg := grpcReq.Data.(*api.ModRpkiArguments) - configured := false - if len(server.bgpConfig.RpkiServers.RpkiServerList) > 0 { - configured = true - } - if arg.Operation == api.Operation_ADD { - if configured { - grpcDone(grpcReq, fmt.Errorf("already enabled")) - return - } - } else { - if !configured { - grpcDone(grpcReq, fmt.Errorf("not enabled yet")) - return - } - } switch arg.Operation { case api.Operation_ADD: r := config.RpkiServer{} @@ -2400,6 +2385,9 @@ func (server *BgpServer) handleModRpki(grpcReq *GrpcRequest) { server.roaManager, _ = newROAManager(server.bgpConfig.Global.GlobalConfig.As, server.bgpConfig.RpkiServers) grpcDone(grpcReq, nil) return + case api.Operation_ENABLE, api.Operation_DISABLE, api.Operation_RESET, api.Operation_SOFTRESET: + grpcDone(grpcReq, server.roaManager.operate(arg.Operation, arg.Address)) + return } grpcDone(grpcReq, fmt.Errorf("not supported yet")) } |