diff options
Diffstat (limited to 'table/path.go')
-rw-r--r-- | table/path.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/table/path.go b/table/path.go index 3742970f..a4fc4e43 100644 --- a/table/path.go +++ b/table/path.go @@ -826,6 +826,13 @@ func (path *Path) GetClusterList() []net.IP { return nil } +func (path *Path) GetOrigin() (uint8, error) { + if attr := path.getPathAttr(bgp.BGP_ATTR_TYPE_ORIGIN); attr != nil { + return attr.(*bgp.PathAttributeOrigin).Value[0], nil + } + return 0, fmt.Errorf("no origin path attr") +} + func (lhs *Path) Equal(rhs *Path) bool { return lhs == rhs } |