summaryrefslogtreecommitdiffhomepage
path: root/table/path.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-23 11:40:52 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-05-23 20:32:47 +0900
commit7c42e295e28c233fdb7a130681cd490308f116ca (patch)
treefa6e4117db2e9f2f31a914c0aa932772760386b8 /table/path.go
parenta7521827e1d8c964f1c9f342dc39d02f45660c49 (diff)
add collector feature
dump the update messages and the state change of peers into influxdb: [collector.config] url = "http://localhost:8086" db-name = "gobgp" Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/path.go')
-rw-r--r--table/path.go7
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
}