diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-27 16:54:03 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-30 15:05:09 +0900 |
commit | e3185194bb71697063a9304e03be3b9cdf850a96 (patch) | |
tree | 74f70b1eb273a39f62c61ddf2bb26237ffb1d54b /server/grpc_server.go | |
parent | b780fed28a735fa97cfbb220769f6f2082543674 (diff) |
server: enable to start without configuration file
add grpc api to configure global as/router-id
$ gobgp global as 65000 router-id 10.0.0.1
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r-- | server/grpc_server.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go index 348d11c7..c475f232 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -28,6 +28,8 @@ import ( const ( _ = iota + REQ_GLOBAL_CONFIG + REQ_MOD_GLOBAL_CONFIG REQ_NEIGHBOR REQ_NEIGHBORS REQ_ADJ_RIB_IN @@ -385,6 +387,18 @@ func (s *Server) ModPolicyAssignment(ctx context.Context, arg *api.ModPolicyAssi return s.mod(REQ_MOD_POLICY_ASSIGNMENT, arg) } +func (s *Server) GetGlobalConfig(ctx context.Context, arg *api.Arguments) (*api.Global, error) { + d, err := s.get(REQ_GLOBAL_CONFIG, arg) + if err != nil { + return nil, err + } + return d.(*api.Global), nil +} + +func (s *Server) ModGlobalConfig(ctx context.Context, arg *api.ModGlobalConfigArguments) (*api.Error, error) { + return s.mod(REQ_MOD_GLOBAL_CONFIG, arg) +} + type GrpcRequest struct { RequestType int Name string |