From ebec82011e1f83bd40f5bb94ea72c2552306e940 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 30 Jan 2022 14:10:47 +0100 Subject: Implement toString in various path attributes --- .../bgp/protocol/attribute/ExtendedCommuntiesAttribute.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute/ExtendedCommuntiesAttribute.java') 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); + } } -- cgit v1.2.3