summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-15 21:12:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-20 10:33:10 +0900
commit7937d8ddb6f8f82c593fb3b019d1fc618dc89f48 (patch)
tree853aa4860dd2a392cb7692c4b13741e2db1a0e26 /table/path.go
parent473f5b6ff32be2829dac2a19bd63df19a7efd4ec (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.go11
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