diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-16 21:45:27 -0500 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-17 23:22:55 -0500 |
commit | 93d1dca70aa0ae3b34050d24ad7462b8757213bf (patch) | |
tree | 29c369dfb6d2180e62bf51a5819eff8644bbc81a /api | |
parent | 24e397b0f65b1c5294ea711a953501fda944411d (diff) |
config: simplify route-disposition configuration
before:
```yaml
actions:
route-disposition:
accept-route: true
reject-route: false
```
after
```yaml
action:
router-disposition: accept-route
```
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'api')
-rw-r--r-- | api/grpc_server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index 78a53d0b..6445c003 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -1230,9 +1230,10 @@ func toStatementApi(s *config.Statement) *Statement { cs.RpkiResult = int32(s.Conditions.BgpConditions.RpkiValidationResult.ToInt()) as := &Actions{ RouteAction: func() RouteAction { - if s.Actions.RouteDisposition.AcceptRoute { + switch s.Actions.RouteDisposition { + case config.ROUTE_DISPOSITION_ACCEPT_ROUTE: return RouteAction_ACCEPT - } else if s.Actions.RouteDisposition.RejectRoute { + case config.ROUTE_DISPOSITION_REJECT_ROUTE: return RouteAction_REJECT } return RouteAction_NONE |