From 7c42e295e28c233fdb7a130681cd490308f116ca Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 23 May 2016 11:40:52 +0900 Subject: 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 --- table/path.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'table/path.go') 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 } -- cgit v1.2.3