summaryrefslogtreecommitdiff
path: root/src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java')
-rw-r--r--src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java b/src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java
new file mode 100644
index 0000000..43dc8d5
--- /dev/null
+++ b/src/main/java/com/lumaserv/bgp/protocol/attribute/MPUnreachableNLRIAttribute.java
@@ -0,0 +1,36 @@
+package com.lumaserv.bgp.protocol.attribute;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import com.lumaserv.bgp.protocol.AFI;
+import com.lumaserv.bgp.protocol.SAFI;
+
+import java.nio.ByteBuffer;
+
+@Getter
+@Setter
+public class MPUnreachableNLRIAttribute implements PathAttribute {
+
+ AFI afi;
+ SAFI safi;
+ int nlriLen;
+
+ public MPUnreachableNLRIAttribute(byte typeCode, byte[] data) {
+ afi = AFI.fromInteger((data[0] << 8) | data[1]);
+ safi = SAFI.fromInteger(data[2]);
+ nlriLen = data.length - 3;
+ }
+
+ public byte getTypeCode() {
+ return 15;
+ }
+
+ public void build(ByteBuffer b) {
+ // FIXME
+ }
+
+ public String toString() {
+ return "AFI:" + afi + " SAFI:" + safi + " NLRIs:" + nlriLen;
+ }
+}