summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-07-08 11:35:51 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-11 21:45:21 +0900
commit4719ec6b4a0dd403010a33376eee9b30b3a99a25 (patch)
treee9c0f111f3429377a8ce82b16d1225be730500f9 /table
parentd5028c1b6e29c312c1364c41555cb77c09c3f64b (diff)
policy: support extended community condition
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 {