bird_exporter/protocol/protocol.go
Tim Small d494720cc3 Add basic support for the Babel protocol.
This doesn't add a protocol specific parser, but does allow basic
information about babel imported and exported routes etc. to be exposed.
2021-09-23 13:20:19 +01:00

44 lines
956 B
Go

package protocol
const (
PROTO_UNKNOWN = 0
BGP = 1
OSPF = 2
Kernel = 4
Static = 8
Direct = 16
Babel = 32
)
type Protocol struct {
Name string
Description string
IPVersion string
ImportFilter string
ExportFilter string
Proto int
Up int
Imported int64
Exported int64
Filtered int64
Preferred int64
Uptime int
Attributes map[string]float64
ImportUpdates RouteChangeCount
ImportWithdraws RouteChangeCount
ExportUpdates RouteChangeCount
ExportWithdraws RouteChangeCount
}
type RouteChangeCount struct {
Received int64
Rejected int64
Filtered int64
Ignored int64
Accepted int64
}
func NewProtocol(name string, proto int, ipVersion string, uptime int) *Protocol {
return &Protocol{Name: name, Proto: proto, IPVersion: ipVersion, Uptime: uptime, Attributes: make(map[string]float64)}
}