summaryrefslogtreecommitdiffhomepage
path: root/server/grpc_server.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-16 15:32:28 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-20 10:33:10 +0900
commit68635d8f0613fc9e13edc7065c63bed3e00851ca (patch)
treee2f82d205d8337ffe1a903951b7d3a69649c5eec /server/grpc_server.go
parent722975bfafdd723160dced623936c361475c9bff (diff)
api: support defined set modification via grpc
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r--server/grpc_server.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go
index c3f004df..e768c4c8 100644
--- a/server/grpc_server.go
+++ b/server/grpc_server.go
@@ -75,6 +75,7 @@ const (
REQ_MOD_PATH
REQ_GLOBAL_POLICY
REQ_DEFINED_SET
+ REQ_MOD_DEFINED_SET
)
const GRPC_PORT = 8080
@@ -519,6 +520,17 @@ func (s *Server) GetDefinedSets(arg *api.DefinedSet, stream api.GobgpApi_GetDefi
})
}
+func (s *Server) ModDefinedSet(ctx context.Context, arg *api.ModDefinedSetArguments) (*api.Error, error) {
+ none := &api.Error{}
+ req := NewGrpcRequest(REQ_MOD_DEFINED_SET, "", bgp.RouteFamily(0), arg)
+ s.bgpServerCh <- req
+ res := <-req.ResponseCh
+ if err := res.Err(); err != nil {
+ return none, err
+ }
+ return none, nil
+}
+
type GrpcRequest struct {
RequestType int
Name string