diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-01 05:49:27 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-01 05:49:27 -0800 |
commit | e63291850fd0795c5700e25e67e5dee89ba54c5f (patch) | |
tree | 9707289536ad95bb739c9856761ad43275e07d8c /framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java | |
parent | 671823e12bc13be9a8b87a5d7de33da1bb7a44e8 (diff) |
onos commit hash c2999f30c69e50df905a9d175ef80b3f23a98514
Change-Id: I2bb8562c4942b6d6a6d60b663db2e17540477b81
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java')
-rw-r--r-- | framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java index e3eb2c51..2a050c44 100644 --- a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java +++ b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Objects; import org.jboss.netty.buffer.ChannelBuffer; -import org.onosproject.bgpio.exceptions.BGPParseException; +import org.onosproject.bgpio.exceptions.BgpParseException; import org.onosproject.bgpio.util.Constants; import org.onosproject.bgpio.util.Validation; import org.slf4j.Logger; @@ -32,7 +32,7 @@ import com.google.common.base.MoreObjects; /** * Provides Implementation of AsPath mandatory BGP Path Attribute. */ -public class AsPath implements BGPValueType { +public class AsPath implements BgpValueType { /** * Enum to provide AS types. */ @@ -94,16 +94,16 @@ public class AsPath implements BGPValueType { * * @param cb ChannelBuffer * @return object of AsPath - * @throws BGPParseException while parsing AsPath + * @throws BgpParseException while parsing AsPath */ - public static AsPath read(ChannelBuffer cb) throws BGPParseException { + public static AsPath read(ChannelBuffer cb) throws BgpParseException { List<Short> aspathSet = new ArrayList<>(); List<Short> aspathSeq = new ArrayList<>(); ChannelBuffer tempCb = cb.copy(); Validation validation = Validation.parseAttributeHeader(cb); if (cb.readableBytes() < validation.getLength()) { - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_LENGTH_ERROR, + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR, validation.getLength()); } //if fourth bit is set, length is read as short otherwise as byte , len includes type, length and value @@ -111,7 +111,7 @@ public class AsPath implements BGPValueType { .getLength() + Constants.TYPE_AND_LEN_AS_BYTE; ChannelBuffer data = tempCb.readBytes(len); if (validation.getFirstBit() && !validation.getSecondBit() && validation.getThirdBit()) { - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, BGPErrorType.ATTRIBUTE_FLAGS_ERROR, data); + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_FLAGS_ERROR, data); } ChannelBuffer tempBuf = cb.readBytes(validation.getLength()); @@ -121,8 +121,8 @@ public class AsPath implements BGPValueType { byte pathSegLen = tempBuf.readByte(); int length = pathSegLen * ASNUM_SIZE; if (tempBuf.readableBytes() < length) { - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.ATTRIBUTE_LENGTH_ERROR, length); + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.ATTRIBUTE_LENGTH_ERROR, length); } ChannelBuffer aspathBuf = tempBuf.readBytes(length); while (aspathBuf.readableBytes() > 0) { @@ -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 |