diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-15 19:19:42 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-15 19:37:21 +0900 |
commit | 3cfce356e43e5f9c4e2f2429ed2a3971b863f1a6 (patch) | |
tree | b5bb473789cdf0c19dae08817652182ce030c8cb /server/grpc_server.go | |
parent | b56ddd477bccd5ae0bd830b95de977ba516f066b (diff) |
cli: support extended community
Diffstat (limited to 'server/grpc_server.go')
-rw-r--r-- | server/grpc_server.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/grpc_server.go b/server/grpc_server.go index 1e81e3ce..a316ab19 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -75,6 +75,11 @@ const ( REQ_POLICY_COMMUNITY_ADD REQ_POLICY_COMMUNITY_DELETE REQ_POLICY_COMMUNITIES_DELETE + REQ_POLICY_EXTCOMMUNITY + REQ_POLICY_EXTCOMMUNITIES + REQ_POLICY_EXTCOMMUNITY_ADD + REQ_POLICY_EXTCOMMUNITY_DELETE + REQ_POLICY_EXTCOMMUNITIES_DELETE REQ_MONITOR_GLOBAL_BEST_CHANGED REQ_MONITOR_NEIGHBOR_PEER_STATE ) @@ -466,6 +471,17 @@ func (s *Server) modPolicy(arg *api.PolicyArguments, stream interface{}) error { default: return fmt.Errorf("unsupported operation: %s", arg.Operation) } + case api.Resource_POLICY_EXTCOMMUNITY: + switch arg.Operation { + case api.Operation_ADD: + reqType = REQ_POLICY_EXTCOMMUNITY_ADD + case api.Operation_DEL: + reqType = REQ_POLICY_EXTCOMMUNITY_DELETE + case api.Operation_DEL_ALL: + reqType = REQ_POLICY_EXTCOMMUNITIES_DELETE + default: + return fmt.Errorf("unsupported operation: %s", arg.Operation) + } case api.Resource_POLICY_ROUTEPOLICY: switch arg.Operation { case api.Operation_ADD: @@ -509,6 +525,8 @@ func (s *Server) GetPolicyRoutePolicies(arg *api.PolicyArguments, stream api.Grp reqType = REQ_POLICY_ASPATHS case api.Resource_POLICY_COMMUNITY: reqType = REQ_POLICY_COMMUNITIES + case api.Resource_POLICY_EXTCOMMUNITY: + reqType = REQ_POLICY_EXTCOMMUNITIES case api.Resource_POLICY_ROUTEPOLICY: reqType = REQ_POLICY_ROUTEPOLICIES default: @@ -540,6 +558,8 @@ func (s *Server) GetPolicyRoutePolicy(ctx context.Context, arg *api.PolicyArgume reqType = REQ_POLICY_ASPATH case api.Resource_POLICY_COMMUNITY: reqType = REQ_POLICY_COMMUNITY + case api.Resource_POLICY_EXTCOMMUNITY: + reqType = REQ_POLICY_EXTCOMMUNITY case api.Resource_POLICY_ROUTEPOLICY: reqType = REQ_POLICY_ROUTEPOLICY default: |