summaryrefslogtreecommitdiffhomepage
path: root/policy
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-06-30 18:13:55 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-01 21:27:31 +0900
commitc9d9a6825c9fe629b069205e2a73836047a7eb3c (patch)
tree4e8814ca0b07fe7d5a0b97658aa523f2e1232cd1 /policy
parentccfded2fee746664b576df0a068aec727cb5fae5 (diff)
cli: support med action
Diffstat (limited to 'policy')
-rw-r--r--policy/policy.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/policy/policy.go b/policy/policy.go
index 11996a4b..9ad7b349 100644
--- a/policy/policy.go
+++ b/policy/policy.go
@@ -1335,9 +1335,11 @@ func ActionsToApiStruct(conActions config.Actions) *api.Actions {
Communities: conActions.BgpActions.SetCommunity.Communities,
Options: conActions.BgpActions.SetCommunity.Options,
}
+ medAction := fmt.Sprintf("%s", conActions.BgpActions.SetMed)
resActions := &api.Actions{
RouteAction: action,
Community: communityAction,
+ Med: medAction,
}
return resActions
}
@@ -1348,6 +1350,10 @@ func ActionsToConfigStruct(reqActions *api.Actions) config.Actions {
actions.BgpActions.SetCommunity.Communities = reqActions.Community.Communities
actions.BgpActions.SetCommunity.Options = reqActions.Community.Options
}
+ if reqActions.Med != "" {
+ actions.BgpActions.SetMed = config.BgpSetMedType(reqActions.Med)
+ }
+
switch reqActions.RouteAction {
case ROUTE_ACCEPT:
actions.AcceptRoute = true