-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix BGP group label for old EX devices, add info label with filter po…
…llicy, add metrics for MED, pref and hold time
- Loading branch information
Showing
5 changed files
with
129 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ config.yml | |
artifacts | ||
config/tests/config_local.yml | ||
.vscode* | ||
notes.txt | ||
notes.txt | ||
.DS_Store/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
package bgp | ||
|
||
import "strings" | ||
|
||
func groupForPeer(p peer, groups groupMap) string { | ||
if len(p.Group) > 0 { | ||
return p.Group | ||
} | ||
|
||
return groups[p.GroupIndex].Name | ||
} | ||
|
||
func formatPolicy(s string) string { | ||
return strings.Trim(s, "\n ") | ||
} | ||
|
||
func bgpStateToNumber(bgpState string) float64 { | ||
switch bgpState { | ||
case "Active": | ||
return 1 | ||
case "Connect": | ||
return 2 | ||
case "Established": | ||
return 3 | ||
case "Idle": | ||
return 4 | ||
case "Openconfirm": | ||
return 5 | ||
case "OpenSent": | ||
return 6 | ||
case "route reflector client": | ||
return 7 | ||
default: | ||
return 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters