Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
0b4d858e
Commit
0b4d858e
authored
6 years ago
by
Maximilian Wilhelm
Browse files
Options
Downloads
Patches
Plain Diff
Print OriginatorID and ClusterList in BGPPath, too.
Signed-off-by:
Maximilian Wilhelm
<
max@sdn.clinic
>
parent
60f8ce22
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
route/bgp_path.go
+19
-0
19 additions, 0 deletions
route/bgp_path.go
with
19 additions
and
0 deletions
route/bgp_path.go
+
19
−
0
View file @
0b4d858e
...
@@ -242,6 +242,14 @@ func (b *BGPPath) Print() string {
...
@@ -242,6 +242,14 @@ func (b *BGPPath) Print() string {
ret
+=
fmt
.
Sprintf
(
"
\t\t
Communities: %v
\n
"
,
b
.
Communities
)
ret
+=
fmt
.
Sprintf
(
"
\t\t
Communities: %v
\n
"
,
b
.
Communities
)
ret
+=
fmt
.
Sprintf
(
"
\t\t
LargeCommunities: %v
\n
"
,
b
.
LargeCommunities
)
ret
+=
fmt
.
Sprintf
(
"
\t\t
LargeCommunities: %v
\n
"
,
b
.
LargeCommunities
)
if
b
.
OriginatorID
!=
0
{
oid
:=
uint32To4Byte
(
b
.
OriginatorID
)
ret
+=
fmt
.
Sprintf
(
"
\t\t
OriginatorID: %d.%d.%d.%d
\n
"
,
oid
[
0
],
oid
[
1
],
oid
[
2
],
oid
[
3
])
}
if
b
.
ClusterList
!=
nil
{
ret
+=
fmt
.
Sprintf
(
"
\t\t
ClusterList %s
\n
"
,
b
.
ClusterListString
())
}
return
ret
return
ret
}
}
...
@@ -334,6 +342,17 @@ func (b *BGPPath) CommunitiesString() string {
...
@@ -334,6 +342,17 @@ func (b *BGPPath) CommunitiesString() string {
return
strings
.
TrimRight
(
str
,
" "
)
return
strings
.
TrimRight
(
str
,
" "
)
}
}
// ClusterListString returns the formated ClusterList
func
(
b
*
BGPPath
)
ClusterListString
()
string
{
str
:=
""
for
_
,
cid
:=
range
b
.
ClusterList
{
octes
:=
uint32To4Byte
(
cid
)
str
+=
fmt
.
Sprintf
(
"%d.%d.%d.%d "
,
octes
[
0
],
octes
[
1
],
octes
[
2
],
octes
[
3
])
}
return
strings
.
TrimRight
(
str
,
" "
)
}
// LargeCommunitiesString returns the formated communities
// LargeCommunitiesString returns the formated communities
func
(
b
*
BGPPath
)
LargeCommunitiesString
()
string
{
func
(
b
*
BGPPath
)
LargeCommunitiesString
()
string
{
str
:=
""
str
:=
""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment