diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-10-15 21:12:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-10-20 10:33:10 +0900 |
commit | 7937d8ddb6f8f82c593fb3b019d1fc618dc89f48 (patch) | |
tree | 853aa4860dd2a392cb7692c4b13741e2db1a0e26 /table/path.go | |
parent | 473f5b6ff32be2829dac2a19bd63df19a7efd4ec (diff) |
policy: clean up
remove redundant api structures and shorten valiable names
re-implement *ToApiStruct functions as a method of each structures
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/table/path.go b/table/path.go index b45b7f68..bcf5b4ce 100644 --- a/table/path.go +++ b/table/path.go @@ -556,16 +556,7 @@ func (path *Path) GetExtCommunities() []bgp.ExtendedCommunityInterface { return eCommunityList } -func (path *Path) SetExtCommunities(values []byte, doReplace bool) { - exts := []bgp.ExtendedCommunityInterface{} - for len(values) >= 8 { - e := &bgp.UnknownExtended{ - Type: bgp.BGPAttrType(values[0]), - Value: values[1:8], - } - exts = append(exts, e) - values = values[8:] - } +func (path *Path) SetExtCommunities(exts []bgp.ExtendedCommunityInterface, doReplace bool) { idx, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_EXTENDED_COMMUNITIES) if attr != nil { l := attr.(*bgp.PathAttributeExtendedCommunities).Value |