summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-18 18:03:04 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-20 10:33:10 +0900
commit95e68a8d8824874d0919435d7829fdfd2afdc6bc (patch)
treecc6d231744307f02ac73c97db52d7e8310870238 /table
parentf834e421284080a8d4b9150d19148be3b886779e (diff)
api/cli: refactor api to retrieve policy
make it similar to other policy api Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r--table/policy.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/table/policy.go b/table/policy.go
index 4b146a0f..06c58df5 100644
--- a/table/policy.go
+++ b/table/policy.go
@@ -2251,12 +2251,12 @@ func (p *Policy) Apply(path *Path) (RouteType, *Path) {
return ROUTE_TYPE_NONE, path
}
-func (p *Policy) ToApiStruct() *api.PolicyDefinition {
+func (p *Policy) ToApiStruct() *api.Policy {
ss := make([]*api.Statement, 0, len(p.Statements))
for _, s := range p.Statements {
ss = append(ss, s.ToApiStruct())
}
- return &api.PolicyDefinition{
+ return &api.Policy{
Name: p.name,
Statements: ss,
}
@@ -2412,7 +2412,7 @@ func CanImportToVrf(v *Vrf, path *Path) bool {
return c.Evaluate(path)
}
-func PoliciesToString(ps []*api.PolicyDefinition) []string {
+func PoliciesToString(ps []*api.Policy) []string {
names := make([]string, 0, len(ps))
for _, p := range ps {
names = append(names, p.Name)