-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbgp_protocol_model.go
More file actions
59 lines (53 loc) · 2.38 KB
/
bgp_protocol_model.go
File metadata and controls
59 lines (53 loc) · 2.38 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
package birdparse
type BgpProtocolBgpRoutes struct {
Imported string `json:"imported"`
Filtered string `json:"filtered"`
Exported string `json:"exported"`
Preferred string `json:"preferred"`
}
type BgpProtocolRouteChangeDetail struct {
Received string `json:"received"`
Rejected string `json:"rejected"`
Filtered string `json:"filtered"`
Ignored string `json:"ignored"`
Accepted string `json:"accepted"`
}
type BgpProtocolRouteChanges struct {
ImportUpdates *BgpProtocolRouteChangeDetail `json:"import_updates"`
ImportWithdraws *BgpProtocolRouteChangeDetail `json:"import_withdraws"`
ExportUpdates *BgpProtocolRouteChangeDetail `json:"export_updates"`
ExportWithdraws *BgpProtocolRouteChangeDetail `json:"export_withdraws"`
}
type BgpProtocol struct {
Protocol string `json:"protocol"`
Table string `json:"table"`
State string `json:"state"`
Connection string `json:"connection"`
Description string `json:"description"`
DescriptionShort string `json:"description_short"`
Preference int `json:"preference"`
InputFilter string `json:"input_filter"`
OutputFilter string `json:"output_filter"`
ImportLimit string `json:"import_limit"`
LimitAction string `json:"limit_action"`
Routes *BgpProtocolBgpRoutes `json:"routes"`
RouteChanges *BgpProtocolRouteChanges `json:"route_changes"`
BgpState string `json:"bgp_state"`
NeighborAddress string `json:"neighbor_address"`
NeighborAS int `json:"neighbor_as"`
NeighborID string `json:"neighbor_id"`
BgpSession []string `json:"bgp_session"`
SourceAddress string `json:"source_address"`
RouteLimitAt string `json:"route_limit_at"`
HoldTimer int `json:"hold_timer"`
HoldTimerNow int `json:"hold_timer_now"`
Keepalive int `json:"keepalive"`
KeepaliveNow int `json:"keepalive_now"`
}
func (p BgpProtocol) IsValid() bool {
if p.Protocol == "" &&
p.Table == "" {
return false
}
return true
}