diff options
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go index 302847f8..75c67a83 100644 --- a/table/path.go +++ b/table/path.go @@ -438,6 +438,17 @@ func (path *Path) ClearCommunities() { } } +func (path *Path) GetExtCommunities() []interface{} { + eCommunityList := make([]interface{}, 0) + if _, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_EXTENDED_COMMUNITIES); attr != nil { + eCommunities := attr.(*bgp.PathAttributeExtendedCommunities).Value + for _, eCommunity := range eCommunities { + eCommunityList = append(eCommunityList, eCommunity) + } + } + return eCommunityList +} + func (path *Path) GetMed() (uint32, error) { _, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_MULTI_EXIT_DISC) if attr == nil { |