diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2016-12-07 10:35:44 -0800 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2016-12-14 15:28:37 -0800 |
commit | ae496021e06452f92da8738671112597374775c1 (patch) | |
tree | 69841e23e1b679058a9265873594476c662a6246 /api/grpc_server.go | |
parent | 2c66865d5ee574d868284dd6a8e104ebe2aab283 (diff) |
policy: allow using invert condition in statement
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Diffstat (limited to 'api/grpc_server.go')
-rw-r--r-- | api/grpc_server.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/api/grpc_server.go b/api/grpc_server.go index 395f3bc2..9a3146f1 100644 --- a/api/grpc_server.go +++ b/api/grpc_server.go @@ -1209,14 +1209,16 @@ func NewAPIStatementFromTableStruct(t *table.Statement) *Statement { func toStatementApi(s *config.Statement) *Statement { cs := &Conditions{} if s.Conditions.MatchPrefixSet.PrefixSet != "" { + o, _ := table.NewMatchOption(s.Conditions.MatchPrefixSet.MatchSetOptions) cs.PrefixSet = &MatchSet{ - Type: MatchType(s.Conditions.MatchPrefixSet.MatchSetOptions.ToInt()), + Type: MatchType(o), Name: s.Conditions.MatchPrefixSet.PrefixSet, } } if s.Conditions.MatchNeighborSet.NeighborSet != "" { + o, _ := table.NewMatchOption(s.Conditions.MatchNeighborSet.MatchSetOptions) cs.NeighborSet = &MatchSet{ - Type: MatchType(s.Conditions.MatchNeighborSet.MatchSetOptions.ToInt()), + Type: MatchType(o), Name: s.Conditions.MatchNeighborSet.NeighborSet, } } |