[ONOS-4718] Initial implementation of LISP control msg deserializer
- Add LispLocatorRecord interface along with
DefaultLispLocatorRecord class and unit test class
- Add deserialization logic for four LISP control message classes
and two auxiliary classes
- Add ByteOperator utility to ease the bit access and manipulation
for byte data type
Change-Id: I68edf6877a0ebb52260296fc556e0690b795a845
diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispEidRecord.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispEidRecord.java
index 0984324..498ce13 100644
--- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispEidRecord.java
+++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/LispEidRecord.java
@@ -61,9 +61,20 @@
*/
private static class EidRecordReader implements LispMessageReader<LispEidRecord> {
+ private static final int RESERVED_SKIP_LENGTH = 1;
+
@Override
public LispEidRecord readFrom(ByteBuf byteBuf) throws LispParseError {
- return null;
+
+ // let's skip the reserved field
+ byteBuf.skipBytes(RESERVED_SKIP_LENGTH);
+
+ short maskLength = (short) byteBuf.readUnsignedShort();
+
+ // TODO: need to de-serialize AFI address
+ LispAfiAddress prefix = null;
+
+ return new LispEidRecord((byte) maskLength, prefix);
}
}
}