added blackhole communities ranges to config
This commit is contained in:
parent
a04d065423
commit
27a6b9806d
@ -97,8 +97,9 @@ load_on_demand = true # Default: false
|
||||
|
||||
[blackhole_communities]
|
||||
65535:666
|
||||
6695:1105-1189:*
|
||||
6695:1111:10-90
|
||||
12345:1105-1189:*
|
||||
12345:1111:10-90
|
||||
rt:1234:4200000000-4200010000
|
||||
|
||||
[rpki]
|
||||
# shows rpki validation status in the client, based on the presence of a large
|
||||
|
@ -173,3 +173,19 @@ func (c BGPCommunityMap) Communities() Communities {
|
||||
}
|
||||
return communities
|
||||
}
|
||||
|
||||
// BGPCommunityRange describes a range within a bgp community:
|
||||
// It is a tuple with two values, the start and end.
|
||||
type BGPCommunityRange []int
|
||||
|
||||
// RangedBGPCommunity is a list of BGPCommunity ranges,
|
||||
// with 3 ranges in large communities.
|
||||
type RangedBGPCommunity []interface{}
|
||||
|
||||
// A BGPCommunitiesSet is a set of communities, large and extended.
|
||||
// The communities are described as ranges.
|
||||
type BGPCommunitiesSet struct {
|
||||
Communities []RangedBGPCommunity `json:"communities"`
|
||||
ExtCommunities []RangedBGPCommunity `json:"ext_communities"`
|
||||
LargeCommunities []RangedBGPCommunity `json:"large_communities"`
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ type ConfigResponse struct {
|
||||
Rpki Rpki `json:"rpki"`
|
||||
|
||||
BGPCommunities map[string]interface{} `json:"bgp_communities"`
|
||||
BGPBlackholeCommunities BGPCommunitiesSet `json:"bgp_blackhole_communities"`
|
||||
|
||||
NeighborsColumns map[string]string `json:"neighbors_columns"`
|
||||
NeighborsColumnsOrder []string `json:"neighbors_columns_order"`
|
||||
|
@ -147,6 +147,7 @@ type UIConfig struct {
|
||||
RoutesRejectCandidates RejectCandidatesConfig
|
||||
|
||||
BGPCommunities api.BGPCommunityMap
|
||||
BGPBlackholeCommunities api.BGPCommunitiesSet
|
||||
Rpki RpkiConfig
|
||||
|
||||
Theme ThemeConfig
|
||||
|
6
pkg/config/testdata/alice.conf
vendored
6
pkg/config/testdata/alice.conf
vendored
@ -128,6 +128,12 @@ invalid = 23042:1000:4-*
|
||||
# Uptime Displays the relative uptime of this neighbour
|
||||
# Description The neighbour's description with link to routes page
|
||||
#
|
||||
#
|
||||
[blackhole_communities]
|
||||
65535:666
|
||||
12345:1105-1189:*
|
||||
12345:1111:10-90
|
||||
rt:1234:4200000000-4200010000
|
||||
|
||||
[neighbours_columns]
|
||||
address = Neighbour
|
||||
|
@ -53,6 +53,7 @@ func (s *Server) apiConfigShow(
|
||||
result := api.ConfigResponse{
|
||||
Asn: s.cfg.Server.Asn,
|
||||
BGPCommunities: s.cfg.UI.BGPCommunities,
|
||||
BGPBlackholeCommunities: s.cfg.UI.BGPBlackholeCommunities,
|
||||
RejectReasons: s.cfg.UI.RoutesRejections.Reasons,
|
||||
Noexport: api.Noexport{
|
||||
LoadOnDemand: s.cfg.UI.RoutesNoexports.LoadOnDemand,
|
||||
|
Loading…
x
Reference in New Issue
Block a user