File: protocol.go

package info (click to toggle)
prometheus-bird-exporter 1.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: makefile: 12
file content (47 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package protocol

const (
	PROTO_UNKNOWN = Proto(0)
	BGP           = Proto(1)
	OSPF          = Proto(2)
	Kernel        = Proto(4)
	Static        = Proto(8)
	Direct        = Proto(16)
	Babel         = Proto(32)
	RPKI          = Proto(64)
	BFD           = Proto(128)
)

type Proto int

type Protocol struct {
	Name            string
	Description     string
	IPVersion       string
	ImportFilter    string
	ExportFilter    string
	Proto           Proto
	Up              int
	State           string
	Imported        int64
	Exported        int64
	Filtered        int64
	Preferred       int64
	Uptime          int
	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 Proto, ipVersion string, uptime int) *Protocol {
	return &Protocol{Name: name, Proto: proto, IPVersion: ipVersion, Uptime: uptime}
}