context = new Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
- setThreadingPolicy(synchroniser); // otherwise we get errors on
- // the finalizer thread
+ // otherwise we get errors on the finalizer thread:
+ setThreadingPolicy(synchroniser);
}
};
defaultAction = new ReturnDefaultValueAction(ClassImposteriser.INSTANCE);
package org.opendaylight.lispflowmapping.lisp.authentication;
public enum LispKeyIDEnum {
- NONE(0, null), //
- SHA1(1, "HmacSHA1"), //
- SHA256(2, "HmacSHA256"), //
+ NONE(0, null),
+ SHA1(1, "HmacSHA1"),
+ SHA256(2, "HmacSHA256"),
UNKNOWN(-1, null);
private short keyID;
ByteBuffer replyBuffer = ByteBuffer.allocate(size);
- replyBuffer.put((byte) ((MessageType.MapReply.getIntValue() << 4) | //
- (BooleanUtils.isTrue(mapReply.isProbe()) ? Flags.PROBE : 0x00) | //
- (BooleanUtils.isTrue(mapReply.isEchoNonceEnabled()) ? Flags.ECHO_NONCE_ENABLED : 0x00)));
+ replyBuffer.put((byte) ((MessageType.MapReply.getIntValue() << 4)
+ | (BooleanUtils.isTrue(mapReply.isProbe()) ? Flags.PROBE : 0x00)
+ | (BooleanUtils.isTrue(mapReply.isEchoNonceEnabled()) ? Flags.ECHO_NONCE_ENABLED : 0x00)));
replyBuffer.position(replyBuffer.position() + Length.RES);
if (mapReply.getMappingRecordItem() != null) {
if (record.getAction() != null) {
act = record.getAction();
}
- replyBuffer.put((byte) ((act.getIntValue() << 5) | //
- ByteUtil.boolToBit(BooleanUtils.isTrue(record.isAuthoritative()), Flags.AUTHORITATIVE)));
+ replyBuffer.put((byte) ((act.getIntValue() << 5)
+ | ByteUtil.boolToBit(BooleanUtils.isTrue(record.isAuthoritative()), Flags.AUTHORITATIVE)));
replyBuffer.position(replyBuffer.position() + Length.RESERVED);
replyBuffer.putShort(NumberUtil.asShort(record.getMapVersion()));
if (record.getEid() != null && record.getEid().getAddress() != null) {
@Override
public int getAddressSize(LispAddress lispAddress) {
- return Length.IPV4; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV4;
}
@Override
public int getAddressSize(SimpleAddress simpleAddress) {
- return Length.IPV4; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV4;
}
@Override
@Override
public int getAddressSize(LispAddress lispAddress) {
- return Length.IPV4; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV4;
}
@Override
public int getAddressSize(SimpleAddress simpleAddress) {
- return Length.IPV4; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV4;
}
@Override
@Override
public int getAddressSize(LispAddress lispAddress) {
- return Length.IPV6; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV6;
}
@Override
public int getAddressSize(SimpleAddress simpleAddress) {
- return Length.IPV6; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV6;
}
@Override
@Override
public int getAddressSize(LispAddress lispAddress) {
- return Length.IPV6; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV6;
}
@Override
public int getAddressSize(SimpleAddress simpleAddress) {
- return Length.IPV6; // XXX does this need to worry about the mask too?
+ // XXX does this need to worry about the mask too?
+ return Length.IPV6;
}
@Override
private void serializeLCAFAddressHeader(ByteBuffer buffer, LispAddress lispAddress,
LispAddressSerializer serializer) {
- buffer.putShort((short) 0); // RES + Flags.
+ // RES + Flags
+ buffer.putShort((short) 0);
buffer.put(serializer.getLcafType());
buffer.put((byte) 0);
}
}
private Address deserializeData(ByteBuffer buffer, LispAddressSerializerContext ctx) {
- buffer.getShort(); // reserved bytes
+ // reserved bytes
+ buffer.getShort();
+
short srcMaskLength = (short) ByteUtil.getUnsignedByte(buffer);
short dstMaskLength = (short) ByteUtil.getUnsignedByte(buffer);
ctx.setMaskLen(srcMaskLength);
* The LCAF enum. http://tools.ietf.org/html/draft-ietf-lisp-lcaf-03
*/
public enum LispCanonicalAddressFormatEnum {
- LIST(1), //
- SEGMENT(2), //
- APPLICATION_DATA(4), //
- SOURCE_DEST(12), //
- TRAFFIC_ENGINEERING(10), //
- KEY_VALUE(15), //
+ LIST(1),
+ SEGMENT(2),
+ APPLICATION_DATA(4),
+ SOURCE_DEST(12),
+ TRAFFIC_ENGINEERING(10),
+ KEY_VALUE(15),
SERVICE_PATH(17),
UNKNOWN(-1);