From 7937d8ddb6f8f82c593fb3b019d1fc618dc89f48 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Thu, 15 Oct 2015 21:12:40 +0900 Subject: 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 --- table/path.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'table/path.go') 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 -- cgit v1.2.3