diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-16 11:10:09 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-20 10:33:10 +0900 |
commit | 0ba93b0aa99fe72809bf081bae56bd756bba6937 (patch) | |
tree | 1c0ef3ecae1c9d927b0122b7d9af1471979636ff /table | |
parent | 7937d8ddb6f8f82c593fb3b019d1fc618dc89f48 (diff) |
api: use two ints instead of string to represent mask-length-range
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table')
-rw-r--r-- | table/policy.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/table/policy.go b/table/policy.go index 6d33a35f..696b28e0 100644 --- a/table/policy.go +++ b/table/policy.go @@ -171,8 +171,9 @@ func (p *Prefix) Match(path *Path) bool { func (p *Prefix) ToApiStruct() *api.Prefix { return &api.Prefix{ - IpPrefix: p.Prefix.String(), - MaskLengthRange: fmt.Sprintf("%d..%d", p.MasklengthRangeMin, p.MasklengthRangeMax), + IpPrefix: p.Prefix.String(), + MaskLengthMin: uint32(p.MasklengthRangeMin), + MaskLengthMax: uint32(p.MasklengthRangeMax), } } |