Priyanka B
Committed by Gerrit Code Review

Adj-In RIB code fix

Change-Id: Ice870ab1aff068cc27a5337a3f4ff7090a53d84d
Showing 54 changed files with 560 additions and 106 deletions
......@@ -15,7 +15,7 @@
*/
package org.onosproject.bgpio.protocol;
import java.util.LinkedList;
import java.util.List;
import org.onosproject.bgpio.types.BgpValueType;
import org.onosproject.bgpio.protocol.linkstate.NodeDescriptors;
......@@ -36,5 +36,5 @@ public interface BgpPrefixLSNlri extends BgpLSNlri {
*
* @return list of Prefix descriptor
*/
LinkedList<BgpValueType> getPrefixdescriptor();
List<BgpValueType> getPrefixdescriptor();
}
......
......@@ -18,6 +18,7 @@ package org.onosproject.bgpio.protocol.linkstate;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
......@@ -28,6 +29,7 @@ import org.onosproject.bgpio.types.IPv4AddressTlv;
import org.onosproject.bgpio.types.IPv6AddressTlv;
import org.onosproject.bgpio.types.LinkLocalRemoteIdentifiersTlv;
import org.onosproject.bgpio.types.attr.BgpAttrNodeMultiTopologyId;
import org.onosproject.bgpio.util.Constants;
import org.onosproject.bgpio.util.UnSupportedAttribute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -38,13 +40,12 @@ import com.google.common.base.Preconditions;
/**
* Implementation of local node descriptors, remote node descriptors and link descriptors.
*/
public class BgpLinkLSIdentifier {
public class BgpLinkLSIdentifier implements Comparable<Object> {
private static final Logger log = LoggerFactory.getLogger(BgpLinkLSIdentifier.class);
public static final short IPV4_INTERFACE_ADDRESS_TYPE = 259;
public static final short IPV4_NEIGHBOR_ADDRESS_TYPE = 260;
public static final short IPV6_INTERFACE_ADDRESS_TYPE = 261;
public static final short IPV6_NEIGHBOR_ADDRESS_TYPE = 262;
public static final int TYPE_AND_LEN = 4;
private NodeDescriptors localNodeDescriptors;
private NodeDescriptors remoteNodeDescriptors;
......@@ -107,12 +108,13 @@ public class BgpLinkLSIdentifier {
*/
public static NodeDescriptors parseNodeDescriptors(ChannelBuffer cb, short desType, byte protocolId)
throws BgpParseException {
ChannelBuffer tempBuf = cb;
log.debug("parse Node descriptors");
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
tempBuf.readBytes(cb.readableBytes() + Constants.TYPE_AND_LEN_AS_SHORT));
}
NodeDescriptors nodeIdentifier = new NodeDescriptors();
ChannelBuffer tempCb = cb.readBytes(length);
......@@ -138,12 +140,12 @@ public class BgpLinkLSIdentifier {
int count = 0;
while (cb.readableBytes() > 0) {
ChannelBuffer tempBuf = cb;
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR,
tempBuf.readBytes(cb.readableBytes() + TYPE_AND_LEN));
tempBuf.readBytes(cb.readableBytes() + Constants.TYPE_AND_LEN_AS_SHORT));
}
ChannelBuffer tempCb = cb.readBytes(length);
switch (type) {
......@@ -170,7 +172,7 @@ public class BgpLinkLSIdentifier {
//length + 4 implies data contains type, length and value
throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR,
BgpErrorType.OPTIONAL_ATTRIBUTE_ERROR, tempBuf.readBytes(length
+ TYPE_AND_LEN));
+ Constants.TYPE_AND_LEN_AS_SHORT));
}
break;
default:
......@@ -231,8 +233,12 @@ public class BgpLinkLSIdentifier {
} else {
while (objListIterator.hasNext() && isCommonSubTlv) {
BgpValueType subTlv = objListIterator.next();
isCommonSubTlv = Objects.equals(linkDescriptor.contains(subTlv),
other.linkDescriptor.contains(subTlv));
if (linkDescriptor.contains(subTlv) && other.linkDescriptor.contains(subTlv)) {
isCommonSubTlv = Objects.equals(linkDescriptor.get(linkDescriptor.indexOf(subTlv)),
other.linkDescriptor.get(other.linkDescriptor.indexOf(subTlv)));
} else {
isCommonSubTlv = false;
}
}
return isCommonSubTlv && Objects.equals(this.localNodeDescriptors, other.localNodeDescriptors)
&& Objects.equals(this.remoteNodeDescriptors, other.remoteNodeDescriptors);
......@@ -249,4 +255,42 @@ public class BgpLinkLSIdentifier {
.add("linkDescriptor", linkDescriptor)
.toString();
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
int result = this.localNodeDescriptors.compareTo(((BgpLinkLSIdentifier) o).localNodeDescriptors);
if (result != 0) {
return result;
} else if (this.remoteNodeDescriptors.compareTo(((BgpLinkLSIdentifier) o).remoteNodeDescriptors) != 0) {
return this.remoteNodeDescriptors.compareTo(((BgpLinkLSIdentifier) o).remoteNodeDescriptors);
} else {
int countOtherSubTlv = ((BgpLinkLSIdentifier) o).linkDescriptor.size();
int countObjSubTlv = linkDescriptor.size();
if (countOtherSubTlv != countObjSubTlv) {
if (countOtherSubTlv > countObjSubTlv) {
return 1;
} else {
return -1;
}
}
ListIterator<BgpValueType> listIterator = linkDescriptor.listIterator();
ListIterator<BgpValueType> listIteratorOther = ((BgpLinkLSIdentifier) o).linkDescriptor.listIterator();
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (linkDescriptor.contains(tlv) && ((BgpLinkLSIdentifier) o).linkDescriptor.contains(tlv1)) {
int res = linkDescriptor.get(linkDescriptor.indexOf(tlv)).compareTo(
((BgpLinkLSIdentifier) o).linkDescriptor.get(((BgpLinkLSIdentifier) o).linkDescriptor
.indexOf(tlv1)));
if (res != 0) {
return res;
}
}
}
}
return 0;
}
}
......
......@@ -29,9 +29,9 @@ import com.google.common.base.MoreObjects;
/**
* Implementation of Node Identifier which includes local node descriptor/remote node descriptors.
*/
public class BgpNodeLSIdentifier {
public class BgpNodeLSIdentifier implements Comparable<Object> {
protected static final Logger log = LoggerFactory.getLogger(BgpNodeLSIdentifier.class);
private static final Logger log = LoggerFactory.getLogger(BgpNodeLSIdentifier.class);
private NodeDescriptors nodeDescriptors;
/**
......@@ -60,7 +60,8 @@ public class BgpNodeLSIdentifier {
*/
public static BgpNodeLSIdentifier parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId)
throws BgpParseException {
ChannelBuffer tempBuf = cb;
log.debug("parse Local node descriptor");
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
......@@ -110,4 +111,12 @@ public class BgpNodeLSIdentifier {
.add("NodeDescriptors", nodeDescriptors)
.toString();
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return this.nodeDescriptors.compareTo(((BgpNodeLSIdentifier) o).nodeDescriptors);
}
}
......
......@@ -15,7 +15,7 @@
*/
package org.onosproject.bgpio.protocol.linkstate;
import java.util.LinkedList;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
......@@ -188,7 +188,7 @@ public class BgpPrefixIPv4LSNlriVer4 implements BgpPrefixLSNlri {
}
@Override
public LinkedList<BgpValueType> getPrefixdescriptor() {
public List<BgpValueType> getPrefixdescriptor() {
return this.bgpPrefixLSIdentifier.getPrefixdescriptor();
}
......
......@@ -18,6 +18,8 @@ package org.onosproject.bgpio.protocol.linkstate;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
......@@ -36,12 +38,12 @@ import com.google.common.base.MoreObjects;
/**
* Provides Implementation of Local node descriptors and prefix descriptors.
*/
public class BgpPrefixLSIdentifier {
public class BgpPrefixLSIdentifier implements Comparable<Object> {
protected static final Logger log = LoggerFactory.getLogger(BgpPrefixLSIdentifier.class);
public static final int TYPE_AND_LEN = 4;
private NodeDescriptors localNodeDescriptors;
private LinkedList<BgpValueType> prefixDescriptor;
private List<BgpValueType> prefixDescriptor;
/**
* Resets parameters.
......@@ -57,7 +59,7 @@ public class BgpPrefixLSIdentifier {
* @param localNodeDescriptors Local node descriptors
* @param prefixDescriptor Prefix Descriptors
*/
public BgpPrefixLSIdentifier(NodeDescriptors localNodeDescriptors, LinkedList<BgpValueType> prefixDescriptor) {
public BgpPrefixLSIdentifier(NodeDescriptors localNodeDescriptors, List<BgpValueType> prefixDescriptor) {
this.localNodeDescriptors = localNodeDescriptors;
this.prefixDescriptor = prefixDescriptor;
}
......@@ -77,7 +79,7 @@ public class BgpPrefixLSIdentifier {
localNodeDescriptors = parseLocalNodeDescriptors(cb, protocolId);
//Parse Prefix descriptor
LinkedList<BgpValueType> prefixDescriptor = new LinkedList<>();
List<BgpValueType> prefixDescriptor = new LinkedList<>();
prefixDescriptor = parsePrefixDescriptors(cb);
return new BgpPrefixLSIdentifier(localNodeDescriptors, prefixDescriptor);
}
......@@ -92,7 +94,7 @@ public class BgpPrefixLSIdentifier {
*/
public static NodeDescriptors parseLocalNodeDescriptors(ChannelBuffer cb, byte protocolId)
throws BgpParseException {
ChannelBuffer tempBuf = cb;
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
......@@ -119,7 +121,7 @@ public class BgpPrefixLSIdentifier {
* @return list of prefix descriptors
* @throws BgpParseException while parsing list of prefix descriptors
*/
public static LinkedList<BgpValueType> parsePrefixDescriptors(ChannelBuffer cb) throws BgpParseException {
public static List<BgpValueType> parsePrefixDescriptors(ChannelBuffer cb) throws BgpParseException {
LinkedList<BgpValueType> prefixDescriptor = new LinkedList<>();
BgpValueType tlv = null;
boolean isIpReachInfo = false;
......@@ -127,7 +129,7 @@ public class BgpPrefixLSIdentifier {
int count = 0;
while (cb.readableBytes() > 0) {
ChannelBuffer tempBuf = cb;
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
......@@ -180,7 +182,7 @@ public class BgpPrefixLSIdentifier {
*
* @return Prefix descriptors
*/
public LinkedList<BgpValueType> getPrefixdescriptor() {
public List<BgpValueType> getPrefixdescriptor() {
return this.prefixDescriptor;
}
......@@ -209,8 +211,12 @@ public class BgpPrefixLSIdentifier {
} else {
while (objListIterator.hasNext() && isCommonSubTlv) {
BgpValueType subTlv = objListIterator.next();
isCommonSubTlv = Objects.equals(prefixDescriptor.contains(subTlv),
other.prefixDescriptor.contains(subTlv));
if (prefixDescriptor.contains(subTlv) && other.prefixDescriptor.contains(subTlv)) {
isCommonSubTlv = Objects.equals(prefixDescriptor.get(prefixDescriptor.indexOf(subTlv)),
other.prefixDescriptor.get(other.prefixDescriptor.indexOf(subTlv)));
} else {
isCommonSubTlv = false;
}
}
return isCommonSubTlv && Objects.equals(this.localNodeDescriptors, other.localNodeDescriptors);
}
......@@ -225,4 +231,41 @@ public class BgpPrefixLSIdentifier {
.add("prefixDescriptor", prefixDescriptor)
.toString();
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
int result = this.localNodeDescriptors.compareTo(((BgpPrefixLSIdentifier) o).localNodeDescriptors);
if (result != 0) {
return result;
} else {
int countOtherSubTlv = ((BgpPrefixLSIdentifier) o).prefixDescriptor.size();
int countObjSubTlv = prefixDescriptor.size();
if (countOtherSubTlv != countObjSubTlv) {
if (countOtherSubTlv > countObjSubTlv) {
return 1;
} else {
return -1;
}
}
ListIterator<BgpValueType> listIterator = prefixDescriptor.listIterator();
ListIterator<BgpValueType> listIteratorOther = ((BgpPrefixLSIdentifier) o).prefixDescriptor.listIterator();
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (prefixDescriptor.contains(tlv) && ((BgpPrefixLSIdentifier) o).prefixDescriptor.contains(tlv1)) {
int res = prefixDescriptor.get(prefixDescriptor.indexOf(tlv)).compareTo(
((BgpPrefixLSIdentifier) o).prefixDescriptor
.get(((BgpPrefixLSIdentifier) o).prefixDescriptor.indexOf(tlv1)));
if (res != 0) {
return res;
}
}
}
}
return 0;
}
}
......
......@@ -18,6 +18,8 @@ package org.onosproject.bgpio.protocol.linkstate;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
......@@ -57,7 +59,7 @@ public class NodeDescriptors {
Figure : Local or Remote Node Descriptors TLV format
*/
protected static final Logger log = LoggerFactory.getLogger(NodeDescriptors.class);
private static final Logger log = LoggerFactory.getLogger(NodeDescriptors.class);
public static final short LOCAL_NODE_DES_TYPE = 256;
public static final short REMOTE_NODE_DES_TYPE = 257;
......@@ -71,7 +73,7 @@ public class NodeDescriptors {
public static final int ISISPSEUDONODE_LEN = 7;
public static final int OSPFNONPSEUDONODE_LEN = 4;
public static final int OSPFPSEUDONODE_LEN = 8;
private LinkedList<BgpValueType> subTlvs;
private List<BgpValueType> subTlvs;
private short deslength;
private short desType;
......@@ -91,7 +93,7 @@ public class NodeDescriptors {
* @param deslength Descriptors length
* @param desType local node descriptor or remote node descriptor type
*/
public NodeDescriptors(LinkedList<BgpValueType> subTlvs, short deslength, short desType) {
public NodeDescriptors(List<BgpValueType> subTlvs, short deslength, short desType) {
this.subTlvs = subTlvs;
this.deslength = deslength;
this.desType = desType;
......@@ -102,7 +104,7 @@ public class NodeDescriptors {
*
* @return subTlvs list of subTlvs
*/
public LinkedList<BgpValueType> getSubTlvs() {
public List<BgpValueType> getSubTlvs() {
return subTlvs;
}
......@@ -130,7 +132,12 @@ public class NodeDescriptors {
} else {
while (objListIterator.hasNext() && isCommonSubTlv) {
BgpValueType subTlv = objListIterator.next();
isCommonSubTlv = Objects.equals(subTlvs.contains(subTlv), other.subTlvs.contains(subTlv));
if (subTlvs.contains(subTlv) && other.subTlvs.contains(subTlv)) {
isCommonSubTlv = Objects.equals(subTlvs.get(subTlvs.indexOf(subTlv)),
other.subTlvs.get(other.subTlvs.indexOf(subTlv)));
} else {
isCommonSubTlv = false;
}
}
return isCommonSubTlv;
}
......@@ -150,12 +157,12 @@ public class NodeDescriptors {
*/
public static NodeDescriptors read(ChannelBuffer cb, short desLength, short desType, byte protocolId)
throws BgpParseException {
LinkedList<BgpValueType> subTlvs;
subTlvs = new LinkedList<>();
log.debug("Read NodeDescriptor");
List<BgpValueType> subTlvs = new LinkedList<>();
BgpValueType tlv = null;
while (cb.readableBytes() > 0) {
ChannelBuffer tempBuf = cb;
ChannelBuffer tempBuf = cb.copy();
short type = cb.readShort();
short length = cb.readShort();
if (cb.readableBytes() < length) {
......@@ -222,4 +229,34 @@ public class NodeDescriptors {
.add("subTlvs", subTlvs)
.toString();
}
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
ListIterator<BgpValueType> listIterator = subTlvs.listIterator();
ListIterator<BgpValueType> listIteratorOther = ((NodeDescriptors) o).subTlvs.listIterator();
int countOtherSubTlv = ((NodeDescriptors) o).subTlvs.size();
int countObjSubTlv = subTlvs.size();
if (countOtherSubTlv != countObjSubTlv) {
if (countOtherSubTlv > countObjSubTlv) {
return 1;
} else {
return -1;
}
} else {
while (listIterator.hasNext()) {
BgpValueType tlv = listIterator.next();
BgpValueType tlv1 = listIteratorOther.next();
if (subTlvs.contains(tlv) && ((NodeDescriptors) o).subTlvs.contains(tlv1)) {
int result = subTlvs.get(subTlvs.indexOf(tlv)).compareTo(
((NodeDescriptors) o).subTlvs.get(((NodeDescriptors) o).subTlvs.indexOf(tlv1)));
if (result != 0) {
return result;
}
}
}
}
return 0;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.bgpio.types;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -38,8 +36,6 @@ public class AreaIDTlv implements BgpValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(AreaIDTlv.class);
public static final short TYPE = 514;
public static final short LENGTH = 4;
......@@ -116,6 +112,14 @@ public class AreaIDTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Integer) (this.areaID)).compareTo((Integer) (((AreaIDTlv) o).areaID));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -166,4 +166,10 @@ public class As4Path implements BgpValueType {
//Not required to Implement as of now
return 0;
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -205,4 +205,10 @@ public class AsPath implements BgpValueType {
//Not required to Implement as of now
return 0;
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -18,8 +18,6 @@ package org.onosproject.bgpio.types;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -38,8 +36,6 @@ public class AutonomousSystemTlv implements BgpValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(AutonomousSystemTlv.class);
public static final short TYPE = 512;
public static final short LENGTH = 4;
......@@ -116,6 +112,14 @@ public class AutonomousSystemTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Integer) (this.asNum)).compareTo((Integer) (((AutonomousSystemTlv) o).asNum));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -19,8 +19,6 @@ package org.onosproject.bgpio.types;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -39,30 +37,28 @@ public class BgpLSIdentifierTlv implements BgpValueType {
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
protected static final Logger log = LoggerFactory.getLogger(BgpLSIdentifierTlv.class);
public static final short TYPE = 513;
public static final short LENGTH = 4;
private final int bgpLSIdentifier;
private final int bgpLsIdentifier;
/**
* Constructor to initialize bgpLSIdentifier.
* Constructor to initialize bgpLsIdentifier.
*
* @param bgpLSIdentifier BGPLS-Identifier
* @param bgpLsIdentifier BGPLS-Identifier
*/
public BgpLSIdentifierTlv(int bgpLSIdentifier) {
this.bgpLSIdentifier = bgpLSIdentifier;
public BgpLSIdentifierTlv(int bgpLsIdentifier) {
this.bgpLsIdentifier = bgpLsIdentifier;
}
/**
* Returns object of this class with specified rbgpLSIdentifier.
* Returns object of this class with specified bgpLsIdentifier.
*
* @param bgpLSIdentifier BGPLS-Identifier
* @param bgpLsIdentifier BGPLS-Identifier
* @return BGPLS-Identifier
*/
public static BgpLSIdentifierTlv of(final int bgpLSIdentifier) {
return new BgpLSIdentifierTlv(bgpLSIdentifier);
public static BgpLSIdentifierTlv of(final int bgpLsIdentifier) {
return new BgpLSIdentifierTlv(bgpLsIdentifier);
}
/**
......@@ -70,13 +66,13 @@ public class BgpLSIdentifierTlv implements BgpValueType {
*
* @return opaque value of BGPLS-Identifier
*/
public int getBgpLSIdentifier() {
return bgpLSIdentifier;
public int getBgpLsIdentifier() {
return bgpLsIdentifier;
}
@Override
public int hashCode() {
return Objects.hash(bgpLSIdentifier);
return Objects.hash(bgpLsIdentifier);
}
@Override
......@@ -87,7 +83,7 @@ public class BgpLSIdentifierTlv implements BgpValueType {
if (obj instanceof BgpLSIdentifierTlv) {
BgpLSIdentifierTlv other = (BgpLSIdentifierTlv) obj;
return Objects.equals(bgpLSIdentifier, other.bgpLSIdentifier);
return Objects.equals(bgpLsIdentifier, other.bgpLsIdentifier);
}
return false;
}
......@@ -97,7 +93,7 @@ public class BgpLSIdentifierTlv implements BgpValueType {
int iLenStartIndex = c.writerIndex();
c.writeShort(TYPE);
c.writeShort(LENGTH);
c.writeInt(bgpLSIdentifier);
c.writeInt(bgpLsIdentifier);
return c.writerIndex() - iLenStartIndex;
}
......@@ -117,11 +113,19 @@ public class BgpLSIdentifierTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Integer) (this.bgpLsIdentifier)).compareTo((Integer) (((BgpLSIdentifierTlv) o).bgpLsIdentifier));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
.add("Length", LENGTH)
.add("Value", bgpLSIdentifier)
.add("Value", bgpLsIdentifier)
.toString();
}
}
\ No newline at end of file
......
......@@ -36,4 +36,12 @@ public interface BgpValueType {
* @return length written to channel buffer
*/
int write(ChannelBuffer cb);
/**
* Compares two objects.
*
* @param o object
* @return result after comparing two objects
*/
int compareTo(Object o);
}
\ No newline at end of file
......
......@@ -111,4 +111,10 @@ public class FourOctetAsNumCapabilityTlv implements BgpValueType {
.add("Length", LENGTH)
.add("Value", rawValue).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -15,14 +15,13 @@
*/
package org.onosproject.bgpio.types;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.IpPrefix;
import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -45,10 +44,9 @@ public class IPReachabilityInformationTlv implements BgpValueType {
Figure 14: IP Reachability Information TLV Format
*/
protected static final Logger log = LoggerFactory.getLogger(IPReachabilityInformationTlv.class);
public static final short TYPE = 265;
public static final int ONE_BYTE_LEN = 8;
private byte prefixLen;
private byte[] ipPrefix;
public short length;
......@@ -146,6 +144,16 @@ public class IPReachabilityInformationTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
ByteBuffer value1 = ByteBuffer.wrap(this.ipPrefix);
ByteBuffer value2 = ByteBuffer.wrap(((IPReachabilityInformationTlv) o).ipPrefix);
return value1.compareTo(value2);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -22,8 +22,6 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
......@@ -32,7 +30,6 @@ import com.google.common.base.Preconditions;
* Provides Implementation of IPv4AddressTlv.
*/
public class IPv4AddressTlv implements BgpValueType {
private static final Logger log = LoggerFactory.getLogger(IPv4AddressTlv.class);
private static final int LENGTH = 4;
private Ip4Address address;
......@@ -118,6 +115,14 @@ public class IPv4AddressTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Ip4Address) (this.address)).compareTo((Ip4Address) (((IPv4AddressTlv) o).address));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("type", type)
......
......@@ -22,8 +22,6 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.Ip6Address;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.onosproject.bgpio.util.Validation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
......@@ -32,7 +30,6 @@ import com.google.common.base.Preconditions;
* Provides Implementation of IPv6AddressTlv.
*/
public class IPv6AddressTlv implements BgpValueType {
private static final Logger log = LoggerFactory.getLogger(IPv6AddressTlv.class);
private static final int LENGTH = 16;
private final Ip6Address address;
......@@ -118,6 +115,14 @@ public class IPv6AddressTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Ip6Address) (this.address)).compareTo((Ip6Address) (((IPv6AddressTlv) o).address));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("type", type)
......
......@@ -15,12 +15,11 @@
*/
package org.onosproject.bgpio.types;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -28,8 +27,6 @@ import com.google.common.base.MoreObjects;
* Provides Implementation of IsIsNonPseudonode Tlv.
*/
public class IsIsNonPseudonode implements IGPRouterID, BgpValueType {
private static final Logger log = LoggerFactory.getLogger(IsIsNonPseudonode.class);
public static final short TYPE = 515;
public static final short LENGTH = 6;
......@@ -107,6 +104,16 @@ public class IsIsNonPseudonode implements IGPRouterID, BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
ByteBuffer value1 = ByteBuffer.wrap(this.isoNodeID);
ByteBuffer value2 = ByteBuffer.wrap(((IsIsNonPseudonode) o).isoNodeID);
return value1.compareTo(value2);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -15,13 +15,12 @@
*/
package org.onosproject.bgpio.types;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -29,8 +28,6 @@ import com.google.common.base.MoreObjects;
* Provides implementation of IsIsPseudonode Tlv.
*/
public class IsIsPseudonode implements IGPRouterID, BgpValueType {
private static final Logger log = LoggerFactory.getLogger(IsIsPseudonode.class);
public static final short TYPE = 515;
public static final short LENGTH = 7;
......@@ -125,6 +122,19 @@ public class IsIsPseudonode implements IGPRouterID, BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
ByteBuffer value1 = ByteBuffer.wrap(this.isoNodeID);
ByteBuffer value2 = ByteBuffer.wrap(((IsIsPseudonode) o).isoNodeID);
if (value1.compareTo(value2) != 0) {
return value1.compareTo(value2);
}
return ((Byte) (this.psnIdentifier)).compareTo((Byte) (((IsIsPseudonode) o).psnIdentifier));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -18,8 +18,6 @@ package org.onosproject.bgpio.types;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -27,7 +25,6 @@ import com.google.common.base.MoreObjects;
* Provides Implementation of Link Local/Remote IdentifiersTlv.
*/
public class LinkLocalRemoteIdentifiersTlv implements BgpValueType {
private static final Logger log = LoggerFactory.getLogger(LinkLocalRemoteIdentifiersTlv.class);
public static final short TYPE = 258;
private static final int LENGTH = 8;
......@@ -120,6 +117,20 @@ public class LinkLocalRemoteIdentifiersTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
int result = ((Integer) (this.linkLocalIdentifer))
.compareTo((Integer) (((LinkLocalRemoteIdentifiersTlv) o).linkLocalIdentifer));
if (result != 0) {
return result;
}
return ((Integer) (this.linkRemoteIdentifer))
.compareTo((Integer) (((LinkLocalRemoteIdentifiersTlv) o).linkRemoteIdentifer));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("TYPE", TYPE)
......
......@@ -305,4 +305,10 @@ public class LinkStateAttributes implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("linkStateAttribList", linkStateAttribList).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -112,4 +112,10 @@ public class LocalPref implements BgpValueType {
//Not to implement as of now
return 0;
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -112,4 +112,10 @@ public class Med implements BgpValueType {
//Not to implement as of now
return 0;
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -216,4 +216,10 @@ public class MpReachNlri implements BgpValueType {
.add("length", length)
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -193,6 +193,12 @@ public class MpUnReachNlri implements BgpValueType {
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("mpReachNlri", mpUnReachNlri)
......
......@@ -157,4 +157,10 @@ public class MultiProtocolExtnCapabilityTlv implements BgpValueType {
.add("Reserved", res)
.add("SAFI", safi).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -130,4 +130,10 @@ public class NextHop implements BgpValueType {
.add("nextHop", nextHop)
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -20,8 +20,6 @@ import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -29,9 +27,6 @@ import com.google.common.base.MoreObjects;
* Provides implementation of OSPFNonPseudonode Tlv.
*/
public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
protected static final Logger log = LoggerFactory.getLogger(OSPFNonPseudonode.class);
public static final short TYPE = 515;
public static final short LENGTH = 4;
......@@ -108,6 +103,14 @@ public class OSPFNonPseudonode implements IGPRouterID, BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Integer) (this.routerID)).compareTo((Integer) (((OSPFNonPseudonode) o).routerID));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -20,8 +20,6 @@ import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onlab.packet.Ip4Address;
import org.onosproject.bgpio.protocol.IGPRouterID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -29,9 +27,6 @@ import com.google.common.base.MoreObjects;
* Provides implementation of OSPFPseudonode Tlv.
*/
public class OSPFPseudonode implements IGPRouterID, BgpValueType {
protected static final Logger log = LoggerFactory.getLogger(OSPFPseudonode.class);
public static final short TYPE = 515;
public static final short LENGTH = 8;
......@@ -114,6 +109,18 @@ public class OSPFPseudonode implements IGPRouterID, BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
int result = ((Integer) (this.routerID)).compareTo((Integer) (((OSPFPseudonode) o).routerID));
if (result != 0) {
return this.drInterface.compareTo(((OSPFPseudonode) o).drInterface);
}
return result;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -19,8 +19,6 @@ import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.bgpio.exceptions.BgpParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
......@@ -41,8 +39,6 @@ public class OSPFRouteTypeTlv implements BgpValueType {
Figure : OSPF Route Type TLV Format
*/
protected static final Logger log = LoggerFactory.getLogger(OSPFRouteTypeTlv.class);
public static final short TYPE = 264;
public static final short LENGTH = 1;
public static final int INTRA_AREA_TYPE = 1;
......@@ -51,15 +47,16 @@ public class OSPFRouteTypeTlv implements BgpValueType {
public static final short EXTERNAL_TYPE_2 = 4;
public static final short NSSA_TYPE_1 = 5;
public static final short NSSA_TYPE_2 = 6;
private final byte routeType;
/**
* Enum for Route Type.
*/
public enum ROUTETYPE {
public enum RouteType {
Intra_Area(1), Inter_Area(2), External_1(3), External_2(4), NSSA_1(5), NSSA_2(6);
int value;
ROUTETYPE(int val) {
RouteType(int val) {
value = val;
}
public byte getType() {
......@@ -92,20 +89,20 @@ public class OSPFRouteTypeTlv implements BgpValueType {
* @return RouteType
* @throws BgpParseException if routeType is not matched
*/
public ROUTETYPE getValue() throws BgpParseException {
public RouteType getValue() throws BgpParseException {
switch (routeType) {
case INTRA_AREA_TYPE:
return ROUTETYPE.Intra_Area;
return RouteType.Intra_Area;
case INTER_AREA_TYPE:
return ROUTETYPE.Inter_Area;
return RouteType.Inter_Area;
case EXTERNAL_TYPE_1:
return ROUTETYPE.External_1;
return RouteType.External_1;
case EXTERNAL_TYPE_2:
return ROUTETYPE.External_2;
return RouteType.External_2;
case NSSA_TYPE_1:
return ROUTETYPE.NSSA_1;
return RouteType.NSSA_1;
case NSSA_TYPE_2:
return ROUTETYPE.NSSA_2;
return RouteType.NSSA_2;
default:
throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, (byte) 0, null);
}
......@@ -153,6 +150,14 @@ public class OSPFRouteTypeTlv implements BgpValueType {
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
return ((Byte) (this.routeType)).compareTo((Byte) (((OSPFRouteTypeTlv) o).routeType));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......
......@@ -159,4 +159,10 @@ public class Origin implements BgpValueType {
.add("origin", origin)
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
\ No newline at end of file
......
......@@ -18,10 +18,12 @@ package org.onosproject.bgpio.types;
import org.jboss.netty.buffer.ChannelBuffer;
import com.google.common.base.MoreObjects;
/**
* Implementation of RouteDistinguisher.
*/
public class RouteDistinguisher {
public class RouteDistinguisher implements Comparable<RouteDistinguisher> {
private long routeDistinguisher;
......@@ -59,4 +61,19 @@ public class RouteDistinguisher {
public long getRouteDistinguisher() {
return this.routeDistinguisher;
}
@Override
public int compareTo(RouteDistinguisher rd) {
if (this.equals(rd)) {
return 0;
}
return ((Long) (this.getRouteDistinguisher())).compareTo((Long) (rd.getRouteDistinguisher()));
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("routeDistinguisher", routeDistinguisher)
.toString();
}
}
\ No newline at end of file
......
......@@ -190,4 +190,10 @@ public final class BgpAttrNodeFlagBitTlv implements BgpValueType {
.add("bExternalBit", bExternalBit).add("bAbrBit", bAbrBit)
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -127,4 +127,10 @@ public class BgpAttrNodeIsIsAreaId implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("isisAreaId", isisAreaId).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -17,6 +17,7 @@ package org.onosproject.bgpio.types.attr;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
......@@ -134,4 +135,30 @@ public class BgpAttrNodeMultiTopologyId implements BgpValueType {
.add("multiTopologyId", multiTopologyId)
.toString();
}
@Override
public int compareTo(Object o) {
if (this.equals(o)) {
return 0;
}
int countOtherSubTlv = ((BgpAttrNodeMultiTopologyId) o).multiTopologyId.size();
int countObjSubTlv = multiTopologyId.size();
if (countOtherSubTlv != countObjSubTlv) {
if (countOtherSubTlv > countObjSubTlv) {
return 1;
} else {
return -1;
}
}
ListIterator<Short> listIterator = multiTopologyId.listIterator();
ListIterator<Short> listIteratorOther = ((BgpAttrNodeMultiTopologyId) o).multiTopologyId.listIterator();
while (listIterator.hasNext()) {
short id = listIterator.next();
short id1 = listIteratorOther.next();
if (((Short) id).compareTo((Short) id1) != 0) {
return ((Short) id).compareTo((Short) id1);
}
}
return 0;
}
}
\ No newline at end of file
......
......@@ -126,4 +126,10 @@ public class BgpAttrNodeName implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("nodeName", nodeName).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -130,4 +130,9 @@ public class BgpAttrOpaqueNode implements BgpValueType {
.add("opaqueNodeAttribute", opaqueNodeAttribute).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -131,4 +131,10 @@ public final class BgpAttrRouterIdV4 implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("ip4RouterId", ip4RouterId).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -134,4 +134,10 @@ public final class BgpAttrRouterIdV6 implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("ip6RouterId", ip6RouterId).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -169,4 +169,10 @@ public class BgpLinkAttrIgpMetric implements BgpValueType {
.add("igpMetric", igpMetric).add("igpMetricLen", igpMetricLen)
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -127,4 +127,10 @@ public final class BgpLinkAttrIsIsAdminstGrp implements BgpValueType {
return MoreObjects.toStringHelper(getClass())
.add("isisAdminGrp", isisAdminGrp).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -147,4 +147,10 @@ public final class BgpLinkAttrMaxLinkBandwidth implements BgpValueType {
return MoreObjects.toStringHelper(getClass())
.add("maxBandwidth", maxBandwidth).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -149,4 +149,10 @@ public class BgpLinkAttrMplsProtocolMask implements BgpValueType {
return MoreObjects.toStringHelper(getClass())
.add("bLdp", bLdp).add("bRsvpTe", bRsvpTe).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -125,4 +125,10 @@ public class BgpLinkAttrName implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("linkName", linkName).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -130,4 +130,10 @@ public final class BgpLinkAttrOpaqLnkAttrib implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("opaqueLinkAttribute", opaqueLinkAttribute).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -237,4 +237,10 @@ public final class BgpLinkAttrProtectionType implements BgpValueType {
.add("bDedOnePlusOne", bDedOnePlusOne)
.add("bEnhanced", bEnhanced).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -127,4 +127,10 @@ public class BgpLinkAttrSrlg implements BgpValueType {
public String toString() {
return MoreObjects.toStringHelper(getClass()).omitNullValues().add("sRlg", sRlg).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -129,4 +129,10 @@ public class BgpLinkAttrTeDefaultMetric implements BgpValueType {
return MoreObjects.toStringHelper(getClass())
.add("linkTEMetric", linkTeMetric).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -154,4 +154,10 @@ public class BgpLinkAttrUnRsrvdLinkBandwidth implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("maxUnResBandwidth", maxUnResBandwidth).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -136,4 +136,10 @@ public class BgpPrefixAttrExtRouteTag implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("pfxExtRouteTag", pfxExtRouteTag).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -195,4 +195,10 @@ public final class BgpPrefixAttrIgpFlags implements BgpValueType {
.add("bOspfLclAddrBit", bOspfLclAddrBit)
.add("bOspfNSSABit", bOspfNSSABit).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -128,4 +128,10 @@ public class BgpPrefixAttrMetric implements BgpValueType {
return MoreObjects.toStringHelper(getClass())
.add("linkPfxMetric", linkPfxMetric).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -131,4 +131,9 @@ public final class BgpPrefixAttrOpaqueData implements BgpValueType {
.toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -184,4 +184,10 @@ public class BgpPrefixAttrOspfFwdAddr implements BgpValueType {
.add("ip6RouterId", ip6RouterId).toString();
}
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......
......@@ -133,4 +133,10 @@ public class BgpPrefixAttrRouteTag implements BgpValueType {
return MoreObjects.toStringHelper(getClass()).omitNullValues()
.add("pfxRouteTag", pfxRouteTag).toString();
}
@Override
public int compareTo(Object o) {
// TODO Auto-generated method stub
return 0;
}
}
......