summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java')
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
index b39e473..170acf8 100644
--- a/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
+++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
@@ -1,5 +1,6 @@
package com.lumaserv.bgp.protocol.attribute;
+import lombok.NoArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@@ -7,6 +8,7 @@ import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
+@NoArgsConstructor
@Getter
@Setter
public class ASPathAttribute implements PathAttribute {
@@ -30,6 +32,13 @@ public class ASPathAttribute implements PathAttribute {
}
public void build(ByteBuffer b) {
+ for (Segment segment: segments) {
+ b.put(segment.getType());
+ b.put((byte)segment.getAsns().size());
+ for (Integer asn: segment.getAsns()) {
+ b.putShort(asn.shortValue());
+ }
+ }
}
@Getter