summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
Diffstat (limited to 'table')
-rw-r--r--table/path.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go
index 3cebdb96..5e914975 100644
--- a/table/path.go
+++ b/table/path.go
@@ -327,6 +327,14 @@ func (path *Path) getPrefix() string {
return path.nlri.String()
}
+func (path *Path) GetAsPath() *bgp.PathAttributeAsPath {
+ _, attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_AS_PATH)
+ if attr != nil {
+ return attr.(*bgp.PathAttributeAsPath)
+ }
+ return nil
+}
+
// GetAsPathLen returns the number of AS_PATH
func (path *Path) GetAsPathLen() int {