diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-07-08 11:35:51 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-11 21:45:21 +0900 |
commit | 4719ec6b4a0dd403010a33376eee9b30b3a99a25 (patch) | |
tree | e9c0f111f3429377a8ce82b16d1225be730500f9 /table | |
parent | d5028c1b6e29c312c1364c41555cb77c09c3f64b (diff) |
policy: support extended community condition
Diffstat (limited to 'table')
-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 { |