summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2022-01-30 14:10:47 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-12 23:49:55 +0100
commitebec82011e1f83bd40f5bb94ea72c2552306e940 (patch)
treeb82b2fdd2d2300c067aaa0c76451baadc3cb6907 /src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java
parente3f9330af263fba206c5901a5a23a26b9da52142 (diff)
Implement toString in various path attributes
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java')
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java
index 759ae60..6909277 100644
--- a/src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java
+++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java
@@ -30,4 +30,12 @@ public class ExtendedCommuntiesAttribute implements PathAttribute {
return new byte[0];
}
+ public String toString() {
+ if (type == 0x03 && subType == 0x0b) {
+ // Color extended community
+ return String.format("color:%d", an);
+ }
+
+ return String.format("%d,%d,%d,%d", type, subType, as, an);
+ }
}