diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-08 14:49:27 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-09 05:17:57 -0800 |
commit | 3bed393b014210f6764778138798c31725839079 (patch) | |
tree | 469607542c5e8291b18de97cbd98737f6d2f66ab /table/policy.go | |
parent | a0b87f1ddf849cc44a39645fb296bfe2d3a5b287 (diff) |
config: add FromInt() method to config typedef
use for the translation between api structs
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/policy.go')
-rw-r--r-- | table/policy.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/table/policy.go b/table/policy.go index e556ec1d..263002c3 100644 --- a/table/policy.go +++ b/table/policy.go @@ -1709,7 +1709,8 @@ func NewCommunityActionFromApiStruct(a *api.CommunityAction) (*CommunityAction, } var list []uint32 var removeList []*regexp.Regexp - op := config.BgpSetCommunityOptionType(a.Type) + var op config.BgpSetCommunityOptionType + op = op.FromInt(int(a.Type)) if op == config.BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE { removeList = make([]*regexp.Regexp, 0, len(a.Communities)) } else { @@ -1828,7 +1829,8 @@ func NewExtCommunityActionFromApiStruct(a *api.CommunityAction) (*ExtCommunityAc var list []bgp.ExtendedCommunityInterface var removeList []*regexp.Regexp subtypeList := make([]bgp.ExtendedCommunityAttrSubType, 0, len(a.Communities)) - op := config.BgpSetCommunityOptionType(a.Type) + var op config.BgpSetCommunityOptionType + op = op.FromInt(int(a.Type)) if op == config.BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE { removeList = make([]*regexp.Regexp, 0, len(a.Communities)) } else { |