summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute')
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/ASPathAttribute.java9
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java2
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/OriginAttribute.java3
3 files changed, 14 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
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java
index c579295..1bf72e4 100644
--- a/src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java
+++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/NextHopAttribute.java
@@ -3,11 +3,13 @@ package com.lumaserv.bgp.protocol.attribute;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import lombok.NoArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.nio.ByteBuffer;
+@NoArgsConstructor
@Getter
@Setter
public class NextHopAttribute implements PathAttribute {
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/OriginAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/OriginAttribute.java
index b8c996d..8cc3474 100644
--- a/src/main/java/com/lumaserv/bgp/protocol/attribute/OriginAttribute.java
+++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/OriginAttribute.java
@@ -2,11 +2,14 @@ package com.lumaserv.bgp.protocol.attribute;
import java.nio.ByteBuffer;
+import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.util.EnumSet;
+
+@AllArgsConstructor
@Getter
@Setter
public class OriginAttribute implements PathAttribute {