summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
Diffstat (limited to 'table')
-rw-r--r--table/path.go11
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 {