summaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/table
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2018-12-23 23:12:49 +0900
committerFUJITA Tomonori <fujita.tomonori@gmail.com>2018-12-23 23:40:37 +0900
commit8d0a8b0ffa696a3838740fec7accc54ccfb452ab (patch)
treecc9dd2da324045dba80bb6dc1d1149ed0114c639 /internal/pkg/table
parentababf3068c48d665e2d9d7816cbb521c74fc47c5 (diff)
make the usage of type name in protobuf consistent
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Diffstat (limited to 'internal/pkg/table')
-rw-r--r--internal/pkg/table/policy.go38
1 files changed, 19 insertions, 19 deletions
diff --git a/internal/pkg/table/policy.go b/internal/pkg/table/policy.go
index 6c4ca0b0..af07b784 100644
--- a/internal/pkg/table/policy.go
+++ b/internal/pkg/table/policy.go
@@ -3907,45 +3907,45 @@ func toStatementApi(s *config.Statement) *api.Statement {
o, _ := NewMatchOption(s.Conditions.MatchPrefixSet.MatchSetOptions)
if s.Conditions.MatchPrefixSet.PrefixSet != "" {
cs.PrefixSet = &api.MatchSet{
- Type: api.MatchType(o),
- Name: s.Conditions.MatchPrefixSet.PrefixSet,
+ MatchType: api.MatchType(o),
+ Name: s.Conditions.MatchPrefixSet.PrefixSet,
}
}
if s.Conditions.MatchNeighborSet.NeighborSet != "" {
o, _ := NewMatchOption(s.Conditions.MatchNeighborSet.MatchSetOptions)
cs.NeighborSet = &api.MatchSet{
- Type: api.MatchType(o),
- Name: s.Conditions.MatchNeighborSet.NeighborSet,
+ MatchType: api.MatchType(o),
+ Name: s.Conditions.MatchNeighborSet.NeighborSet,
}
}
if s.Conditions.BgpConditions.AsPathLength.Operator != "" {
cs.AsPathLength = &api.AsPathLength{
- Length: s.Conditions.BgpConditions.AsPathLength.Value,
- Type: api.AsPathLengthType(s.Conditions.BgpConditions.AsPathLength.Operator.ToInt()),
+ Length: s.Conditions.BgpConditions.AsPathLength.Value,
+ LengthType: api.AsPathLengthType(s.Conditions.BgpConditions.AsPathLength.Operator.ToInt()),
}
}
if s.Conditions.BgpConditions.MatchAsPathSet.AsPathSet != "" {
cs.AsPathSet = &api.MatchSet{
- Type: api.MatchType(s.Conditions.BgpConditions.MatchAsPathSet.MatchSetOptions.ToInt()),
- Name: s.Conditions.BgpConditions.MatchAsPathSet.AsPathSet,
+ MatchType: api.MatchType(s.Conditions.BgpConditions.MatchAsPathSet.MatchSetOptions.ToInt()),
+ Name: s.Conditions.BgpConditions.MatchAsPathSet.AsPathSet,
}
}
if s.Conditions.BgpConditions.MatchCommunitySet.CommunitySet != "" {
cs.CommunitySet = &api.MatchSet{
- Type: api.MatchType(s.Conditions.BgpConditions.MatchCommunitySet.MatchSetOptions.ToInt()),
- Name: s.Conditions.BgpConditions.MatchCommunitySet.CommunitySet,
+ MatchType: api.MatchType(s.Conditions.BgpConditions.MatchCommunitySet.MatchSetOptions.ToInt()),
+ Name: s.Conditions.BgpConditions.MatchCommunitySet.CommunitySet,
}
}
if s.Conditions.BgpConditions.MatchExtCommunitySet.ExtCommunitySet != "" {
cs.ExtCommunitySet = &api.MatchSet{
- Type: api.MatchType(s.Conditions.BgpConditions.MatchExtCommunitySet.MatchSetOptions.ToInt()),
- Name: s.Conditions.BgpConditions.MatchExtCommunitySet.ExtCommunitySet,
+ MatchType: api.MatchType(s.Conditions.BgpConditions.MatchExtCommunitySet.MatchSetOptions.ToInt()),
+ Name: s.Conditions.BgpConditions.MatchExtCommunitySet.ExtCommunitySet,
}
}
if s.Conditions.BgpConditions.MatchLargeCommunitySet.LargeCommunitySet != "" {
cs.LargeCommunitySet = &api.MatchSet{
- Type: api.MatchType(s.Conditions.BgpConditions.MatchLargeCommunitySet.MatchSetOptions.ToInt()),
- Name: s.Conditions.BgpConditions.MatchLargeCommunitySet.LargeCommunitySet,
+ MatchType: api.MatchType(s.Conditions.BgpConditions.MatchLargeCommunitySet.MatchSetOptions.ToInt()),
+ Name: s.Conditions.BgpConditions.MatchLargeCommunitySet.LargeCommunitySet,
}
}
if s.Conditions.BgpConditions.RouteType != "" {
@@ -3980,7 +3980,7 @@ func toStatementApi(s *config.Statement) *api.Statement {
return nil
}
return &api.CommunityAction{
- Type: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetCommunity.Options)]),
+ ActionType: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetCommunity.Options)]),
Communities: s.Actions.BgpActions.SetCommunity.SetCommunityMethod.CommunitiesList}
}(),
Med: func() *api.MedAction {
@@ -4002,8 +4002,8 @@ func toStatementApi(s *config.Statement) *api.Statement {
return nil
}
return &api.MedAction{
- Value: value,
- Type: action,
+ Value: value,
+ ActionType: action,
}
}(),
AsPrepend: func() *api.AsPrependAction {
@@ -4028,7 +4028,7 @@ func toStatementApi(s *config.Statement) *api.Statement {
return nil
}
return &api.CommunityAction{
- Type: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetExtCommunity.Options)]),
+ ActionType: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetExtCommunity.Options)]),
Communities: s.Actions.BgpActions.SetExtCommunity.SetExtCommunityMethod.CommunitiesList,
}
}(),
@@ -4037,7 +4037,7 @@ func toStatementApi(s *config.Statement) *api.Statement {
return nil
}
return &api.CommunityAction{
- Type: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetLargeCommunity.Options)]),
+ ActionType: api.CommunityActionType(config.BgpSetCommunityOptionTypeToIntMap[config.BgpSetCommunityOptionType(s.Actions.BgpActions.SetLargeCommunity.Options)]),
Communities: s.Actions.BgpActions.SetLargeCommunity.SetLargeCommunityMethod.CommunitiesList,
}
}(),