summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2022-01-31 23:16:31 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-13 00:17:57 +0100
commit88f43944c915be3cb824a8ffa4f2995666b73486 (patch)
treef38d9c2b7fede5ec46e8df042afa36ce66819110 /src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java
parent9f35136d97673b825fb51c2e1c7067881a3d6820 (diff)
WIP current working dirHEADmaster
Implent outgoing BGPUpdate and some attributes
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