[ONOS-4718] Initial implementation of LISP control message objects
Change-Id: I22cdb1a4b5d7bb7f0681c9fa9a45223b60bdb282
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
index 6021931..d187d88 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapNotify.java
@@ -17,6 +17,8 @@
import io.netty.buffer.ByteBuf;
+import java.util.List;
+
/**
* Default LISP map notify message class.
*/
@@ -36,4 +38,67 @@
public Builder createBuilder() {
return null;
}
+
+ @Override
+ public long getNonce() {
+ return 0;
+ }
+
+ @Override
+ public byte getRecordCount() {
+ return 0;
+ }
+
+ @Override
+ public short getKeyId() {
+ return 0;
+ }
+
+ @Override
+ public byte[] getAuthenticationData() {
+ return new byte[0];
+ }
+
+ @Override
+ public List<LispRecord> getLispRecords() {
+ return null;
+ }
+
+ public static final class DefaultNotifyBuilder implements NotifyBuilder {
+
+ @Override
+ public LispMessage build() {
+ return null;
+ }
+
+ @Override
+ public LispType getType() {
+ return null;
+ }
+
+ @Override
+ public NotifyBuilder withNonce(long nonce) {
+ return null;
+ }
+
+ @Override
+ public NotifyBuilder withRecordCount(byte recordCount) {
+ return null;
+ }
+
+ @Override
+ public NotifyBuilder withKeyId(short keyId) {
+ return null;
+ }
+
+ @Override
+ public NotifyBuilder withAuthenticationData(byte[] authenticationData) {
+ return null;
+ }
+
+ @Override
+ public NotifyBuilder addRecord(LispRecord record) {
+ return null;
+ }
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
index e14dd01..259f80a 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRegister.java
@@ -17,6 +17,8 @@
import io.netty.buffer.ByteBuf;
+import java.util.List;
+
/**
* Default LISP map register message class.
*/
@@ -35,4 +37,87 @@
public Builder createBuilder() {
return null;
}
+
+ @Override
+ public boolean isProxyMapReply() {
+ return false;
+ }
+
+ @Override
+ public boolean isWantMapNotify() {
+ return false;
+ }
+
+ @Override
+ public byte getRecordCount() {
+ return 0;
+ }
+
+ @Override
+ public long getNonce() {
+ return 0;
+ }
+
+ @Override
+ public short getKeyId() {
+ return 0;
+ }
+
+ @Override
+ public byte[] getAuthenticationData() {
+ return new byte[0];
+ }
+
+ @Override
+ public List<LispRecord> getLispRecords() {
+ return null;
+ }
+
+ public static final class DefaultRegisterBuilder implements RegisterBuilder {
+
+ @Override
+ public LispMessage build() {
+ return null;
+ }
+
+ @Override
+ public LispType getType() {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withIsProxyMapReply(boolean isProxyMapReply) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withRecordCount(byte recordCount) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withNonce(long nonce) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withKeyId(short keyId) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder withAuthenticationData(byte[] authenticationData) {
+ return null;
+ }
+
+ @Override
+ public RegisterBuilder addRecord(LispRecord record) {
+ return null;
+ }
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
index ef2a8a2..7f89dc0 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapReply.java
@@ -35,4 +35,67 @@
public Builder createBuilder() {
return null;
}
+
+ @Override
+ public boolean isProbe() {
+ return false;
+ }
+
+ @Override
+ public boolean isEtr() {
+ return false;
+ }
+
+ @Override
+ public boolean isSecurity() {
+ return false;
+ }
+
+ @Override
+ public byte getRecordCount() {
+ return 0;
+ }
+
+ @Override
+ public long getNonce() {
+ return 0;
+ }
+
+ public static final class DefaultReplyBuilder implements ReplyBuilder {
+
+ @Override
+ public LispMessage build() {
+ return null;
+ }
+
+ @Override
+ public LispType getType() {
+ return null;
+ }
+
+ @Override
+ public ReplyBuilder withIsProbe(boolean isProbe) {
+ return null;
+ }
+
+ @Override
+ public ReplyBuilder withIsEtr(boolean isEtr) {
+ return null;
+ }
+
+ @Override
+ public ReplyBuilder withIsSecurity(boolean isSecurity) {
+ return null;
+ }
+
+ @Override
+ public ReplyBuilder withRecordCount(byte recordCount) {
+ return null;
+ }
+
+ @Override
+ public ReplyBuilder withNonce(long nonce) {
+ return null;
+ }
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
index df9922b..9f8ac0f 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispMapRequest.java
@@ -16,6 +16,9 @@
package org.onosproject.lisp.msg.protocols;
import io.netty.buffer.ByteBuf;
+import org.onosproject.lisp.msg.types.LispAfiAddress;
+
+import java.util.List;
/**
* Default LISP map request message class.
@@ -35,4 +38,112 @@
public Builder createBuilder() {
return null;
}
+
+ @Override
+ public boolean isAuthoritative() {
+ return false;
+ }
+
+ @Override
+ public boolean isProbe() {
+ return false;
+ }
+
+ @Override
+ public boolean isSmr() {
+ return false;
+ }
+
+ @Override
+ public boolean isPitr() {
+ return false;
+ }
+
+ @Override
+ public boolean isSmrInvoked() {
+ return false;
+ }
+
+ @Override
+ public byte getRecordCount() {
+ return 0;
+ }
+
+ @Override
+ public long getNonce() {
+ return 0;
+ }
+
+ @Override
+ public LispAfiAddress getSourceEid() {
+ return null;
+ }
+
+ @Override
+ public List<LispAfiAddress> getItrRlocs() {
+ return null;
+ }
+
+ @Override
+ public List<EidRecord> getEids() {
+ return null;
+ }
+
+ public static final class DefaultRequestBuilder implements RequestBuilder {
+
+ @Override
+ public LispMessage build() {
+ return null;
+ }
+
+ @Override
+ public LispType getType() {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withIsAuthoritative(boolean isAuthoritative) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withIsProbe(boolean isProbe) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withIsSmr(boolean isSmr) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withIsPitr(boolean isPitr) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withIsSmrInvoked(boolean isSmrInvoked) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withRecordCount(byte recordCount) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withNonce(long nonce) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder withItrRloc(LispAfiAddress itrRloc) {
+ return null;
+ }
+
+ @Override
+ public RequestBuilder addEidRecord(EidRecord record) {
+ return null;
+ }
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/EidRecord.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/EidRecord.java
new file mode 100644
index 0000000..ffcd90e
--- /dev/null
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/EidRecord.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.lisp.msg.protocols;
+
+/**
+ * LISP EID record section which is part of LISP map request message.
+ */
+public class EidRecord {
+}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
index f3c64c5..e287aa1 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapNotify.java
@@ -15,8 +15,123 @@
*/
package org.onosproject.lisp.msg.protocols;
+import java.util.List;
+
/**
* LISP map notify message interface.
+ *
+ * LISP map notify message format is defined in RFC6830.
+ * https://tools.ietf.org/html/rfc6830#page-39
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |Type=4 | Reserved | Record Count |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Nonce . . . |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | . . . Nonce |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Key ID | Authentication Data Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * ~ Authentication Data ~
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | | Record TTL |
+ * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * R | Locator Count | EID mask-len | ACT |A| Reserved |
+ * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * c | Rsvd | Map-Version Number | EID-Prefix-AFI |
+ * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * r | EID-Prefix |
+ * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | /| Priority | Weight | M Priority | M Weight |
+ * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | o | Unused Flags |L|p|R| Loc-AFI |
+ * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | \| Locator |
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
*/
public interface LispMapNotify extends LispMessage {
+
+ /**
+ * Obtains nonce value.
+ *
+ * @return nonce value
+ */
+ long getNonce();
+
+ /**
+ * Obtains record count value.
+ *
+ * @return record count value
+ */
+ byte getRecordCount();
+
+ /**
+ * Obtains key identifier.
+ *
+ * @return key identifier
+ */
+ short getKeyId();
+
+ /**
+ * Obtains authentication data.
+ *
+ * @return authentication data
+ */
+ byte[] getAuthenticationData();
+
+ /**
+ * Obtains a collection of records.
+ *
+ * @return a collection of records
+ */
+ List<LispRecord> getLispRecords();
+
+ /**
+ * A builder of LISP map notify message.
+ */
+ interface NotifyBuilder extends Builder {
+
+ /**
+ * Sets nonce value.
+ *
+ * @param nonce nonce value
+ * @return NotifyBuilder object
+ */
+ NotifyBuilder withNonce(long nonce);
+
+ /**
+ * Sets record count.
+ *
+ * @param recordCount record count
+ * @return NotifyBuilder object
+ */
+ NotifyBuilder withRecordCount(byte recordCount);
+
+ /**
+ * Sets key identitifer.
+ *
+ * @param keyId key identifier
+ * @return NotifyBuilder object
+ */
+ NotifyBuilder withKeyId(short keyId);
+
+ /**
+ * Sets authentication data.
+ *
+ * @param authenticationData authentication data
+ * @return NotifyBuilder object
+ */
+ NotifyBuilder withAuthenticationData(byte[] authenticationData);
+
+ /**
+ * Adds a new record to record list.
+ *
+ * @param record record
+ * @return NotifyBuilder object
+ */
+ NotifyBuilder addRecord(LispRecord record);
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
index 4633d27..d9cdf9e 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRegister.java
@@ -15,8 +15,152 @@
*/
package org.onosproject.lisp.msg.protocols;
+import java.util.List;
+
/**
* LISP map register message interface.
+ *
+ * LISP map register message format is defined in RFC6830.
+ * https://tools.ietf.org/html/rfc6830#page-37
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |Type=3 |P| Reserved |M| Record Count |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Nonce . . . |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | . . . Nonce |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Key ID | Authentication Data Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * ~ Authentication Data ~
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | | Record TTL |
+ * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * R | Locator Count | EID mask-len | ACT |A| Reserved |
+ * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * c | Rsvd | Map-Version Number | EID-Prefix-AFI |
+ * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * r | EID-Prefix |
+ * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | /| Priority | Weight | M Priority | M Weight |
+ * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | o | Unused Flags |L|p|R| Loc-AFI |
+ * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | \| Locator |
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
public interface LispMapRegister extends LispMessage {
+
+ /**
+ * Obtains proxy map reply flag.
+ *
+ * @return proxy map reply flag
+ */
+ boolean isProxyMapReply();
+
+ /**
+ * Obtains want map notify flag.
+ *
+ * @return want map notify flag
+ */
+ boolean isWantMapNotify();
+
+ /**
+ * Obtains record count value.
+ *
+ * @return record count value
+ */
+ byte getRecordCount();
+
+ /**
+ * Obtains nonce value.
+ *
+ * @return nonce value
+ */
+ long getNonce();
+
+ /**
+ * Obtains key identifier.
+ *
+ * @return key identifier
+ */
+ short getKeyId();
+
+ /**
+ * Obtains authentication data.
+ *
+ * @return authentication data
+ */
+ byte[] getAuthenticationData();
+
+ /**
+ * Obtains a collection of records.
+ *
+ * @return a collection of records
+ */
+ List<LispRecord> getLispRecords();
+
+ /**
+ * A builder of LISP map register message.
+ */
+ interface RegisterBuilder extends Builder {
+
+ /**
+ * Sets isProxyMapReply flag.
+ *
+ * @param isProxyMapReply isProxyMapReply
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withIsProxyMapReply(boolean isProxyMapReply);
+
+ /**
+ * Sets isWantMapNotify flag.
+ *
+ * @param isWantMapNotify isWantMapNotify
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withIsWantMapNotify(boolean isWantMapNotify);
+
+ /**
+ * Sets record count.
+ *
+ * @param recordCount record count
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withRecordCount(byte recordCount);
+
+ /**
+ * Sets nonce value.
+ *
+ * @param nonce nonce value
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withNonce(long nonce);
+
+ /**
+ * Sets key identifier.
+ *
+ * @param keyId key identifier
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withKeyId(short keyId);
+
+ /**
+ * Sets authentication data.
+ *
+ * @param authenticationData authentication data
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder withAuthenticationData(byte[] authenticationData);
+
+ /**
+ * Adds a new record to record list.
+ *
+ * @param record record
+ * @return RegisterBuilder object
+ */
+ RegisterBuilder addRecord(LispRecord record);
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
index 6ed6c3ab..4a55f9d 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapReply.java
@@ -17,6 +17,114 @@
/**
* LISP map reply message interface.
+ *
+ * LISP map reply message format is defined in RFC6830.
+ * https://tools.ietf.org/html/rfc6830#page-31
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |Type=2 |P|E|S| Reserved | Record Count |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Nonce . . . |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | . . . Nonce |
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | | Record TTL |
+ * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * R | Locator Count | EID mask-len | ACT |A| Reserved |
+ * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * c | Rsvd | Map-Version Number | EID-Prefix-AFI |
+ * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * r | EID-Prefix |
+ * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | /| Priority | Weight | M Priority | M Weight |
+ * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | o | Unused Flags |L|p|R| Loc-AFI |
+ * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | \| Locator |
+ * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
public interface LispMapReply extends LispMessage {
+
+ /**
+ * Obtains probe flag.
+ *
+ * @return probe flag
+ */
+ boolean isProbe();
+
+ /**
+ * Obtains ETR flag.
+ *
+ * @return ETR flag
+ */
+ boolean isEtr();
+
+ /**
+ * Obtains security flag.
+ *
+ * @return security flag
+ */
+ boolean isSecurity();
+
+ /**
+ * Obtains record count value.
+ *
+ * @return record count value
+ */
+ byte getRecordCount();
+
+ /**
+ * Obtains nonce value.
+ *
+ * @return nonce value
+ */
+ long getNonce();
+
+ /**
+ * A builder of LISP map reply message.
+ */
+ interface ReplyBuilder extends Builder {
+
+ /**
+ * Sets isProbe flag.
+ *
+ * @param isProbe isProbe flag
+ * @return ReplyBuilder object
+ */
+ ReplyBuilder withIsProbe(boolean isProbe);
+
+ /**
+ * Sets isEtr flag.
+ *
+ * @param isEtr isEtr flag
+ * @return ReplyBuilder object
+ */
+ ReplyBuilder withIsEtr(boolean isEtr);
+
+ /**
+ * Sets isSecurity flag.
+ *
+ * @param isSecurity isSecurity flag
+ * @return ReplyBuilder object
+ */
+ ReplyBuilder withIsSecurity(boolean isSecurity);
+
+ /**
+ * Sets record count.
+ *
+ * @param recordCount record count
+ * @return ReplyBuilder object
+ */
+ ReplyBuilder withRecordCount(byte recordCount);
+
+ /**
+ * Sets nonce value.
+ *
+ * @param nonce nonce value
+ * @return ReplyBuilder object
+ */
+ ReplyBuilder withNonce(long nonce);
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
index 2618867..8566768 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMapRequest.java
@@ -15,8 +15,187 @@
*/
package org.onosproject.lisp.msg.protocols;
+import org.onosproject.lisp.msg.types.LispAfiAddress;
+
+import java.util.List;
+
/**
* LISP map request message interface.
+ *
+ * LISP map request message format is defined in RFC6830.
+ * https://tools.ietf.org/html/rfc6830#page-27
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |Type=1 |A|M|P|S|p|s| Reserved | IRC | Record Count |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Nonce . . . |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | . . . Nonce |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Source-EID-AFI | Source EID Address ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ITR-RLOC-AFI 1 | ITR-RLOC Address 1 ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ITR-RLOC-AFI n | ITR-RLOC Address n ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * / | Reserved | EID mask-len | EID-Prefix-AFI |
+ * Rec +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * \ | EID-Prefix ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Map-Reply Record ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
public interface LispMapRequest extends LispMessage {
+
+ /**
+ * Obtains authoritative flag.
+ *
+ * @return authoritative flag
+ */
+ boolean isAuthoritative();
+
+ /**
+ * Obtains probe flag.
+ *
+ * @return probe flag
+ */
+ boolean isProbe();
+
+ /**
+ * Obtains SMR flag.
+ *
+ * @return SMR flag
+ */
+ boolean isSmr();
+
+ /**
+ * Obtains PITR flag.
+ *
+ * @return PITR flag
+ */
+ boolean isPitr();
+
+ /**
+ * Obtains SMR Invoked flag.
+ *
+ * @return SMR invoked flag
+ */
+ boolean isSmrInvoked();
+
+ /**
+ * Obtains record count value.
+ *
+ * @return record count value
+ */
+ byte getRecordCount();
+
+ /**
+ * Obtains nonce value.
+ *
+ * @return nonce value
+ */
+ long getNonce();
+
+ /**
+ * Obtains source EID.
+ *
+ * @return source EID
+ */
+ LispAfiAddress getSourceEid();
+
+ /**
+ * Obtains a collection of ITR RLOCs.
+ *
+ * @return a collection of ITR RLOCs
+ */
+ List<LispAfiAddress> getItrRlocs();
+
+ /**
+ * Obtains a collection of EID records.
+ *
+ * @return a collection of EID records
+ */
+ List<EidRecord> getEids();
+
+ /**
+ * A builder of LISP map request message.
+ */
+ interface RequestBuilder extends Builder {
+
+ /**
+ * Sets isAuthoritative flag.
+ *
+ * @param isAuthoritative isAuthoritative flag
+ * @return RequestBuilder object
+ */
+ RequestBuilder withIsAuthoritative(boolean isAuthoritative);
+
+ /**
+ * Sets isProbe flag.
+ *
+ * @param isProbe isProbe flag
+ * @return RequestBuilder object
+ */
+ RequestBuilder withIsProbe(boolean isProbe);
+
+ /**
+ * Sets isSmr flag.
+ *
+ * @param isSmr isSmr flag
+ * @return RequestBuilder object
+ */
+ RequestBuilder withIsSmr(boolean isSmr);
+
+ /**
+ * Sets isPitr flag.
+ *
+ * @param isPitr isPitr flag
+ * @return RequestBuilder object
+ */
+ RequestBuilder withIsPitr(boolean isPitr);
+
+ /**
+ * Sets isSmrInvoked flag.
+ *
+ * @param isSmrInvoked isSmrInvoked flag
+ * @return RequestBuilder object
+ */
+ RequestBuilder withIsSmrInvoked(boolean isSmrInvoked);
+
+ /**
+ * Sets record count.
+ *
+ * @param recordCount record count
+ * @return RequestBuilder object
+ */
+ RequestBuilder withRecordCount(byte recordCount);
+
+ /**
+ * Sets nonce value.
+ *
+ * @param nonce nonce value
+ * @return RequestBuilder object
+ */
+ RequestBuilder withNonce(long nonce);
+
+ /**
+ * Adds ITR RLOC into RLOC collection.
+ *
+ * @param itrRloc ITR RLOC
+ * @return RequestBuilder object
+ */
+ RequestBuilder withItrRloc(LispAfiAddress itrRloc);
+
+ /**
+ * Adds EID record into record collection.
+ *
+ * @param record EID record
+ * @return RequestBuilder object
+ */
+ RequestBuilder addEidRecord(EidRecord record);
+ }
}
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
index cbd0c61..7a74bbb 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispMessage.java
@@ -46,7 +46,7 @@
/**
* LISP message builder interface.
*/
- interface Builder {
+ interface Builder {
/**
* Builds LISP message.
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispRecord.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispRecord.java
new file mode 100644
index 0000000..efbe17b
--- /dev/null
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispRecord.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.lisp.msg.protocols;
+
+/**
+ * LISP record section which is part of LISP map register message.
+ */
+public class LispRecord {
+
+}