diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-22 10:02:05 -0800 |
commit | 77ce3be7567bd01c66d8ee88a93b485666723501 (patch) | |
tree | 283e7f39a501750bbd705fbb91645b20198900f1 /framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/AsPath.java | |
parent | 00e6500d0813dcbccaaa741ef38cc1eae6d11e07 (diff) |
Removed patch path since changes have been merged upstream to a different path. Updated README with directions.
Change-Id: Ie419abd2d3d3ef7315de9f607dcd757a78190995
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 | 9 |
1 files changed, 4 insertions, 5 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 100e14d7..e3eb2c51 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 @@ -22,6 +22,7 @@ import java.util.Objects; import org.jboss.netty.buffer.ChannelBuffer; import org.onosproject.bgpio.exceptions.BGPParseException; +import org.onosproject.bgpio.util.Constants; import org.onosproject.bgpio.util.Validation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +54,7 @@ public class AsPath implements BGPValueType { * * @return AS type */ - public byte getType() { + public byte type() { return (byte) value; } } @@ -63,8 +64,6 @@ public class AsPath implements BGPValueType { public static final byte ASPATH_SET_TYPE = 1; public static final byte ASPATH_SEQ_TYPE = 2; public static final byte ASNUM_SIZE = 2; - public static final int TYPE_AND_LEN_AS_SHORT = 4; - public static final int TYPE_AND_LEN_AS_BYTE = 3; private boolean isAsPath = false; private List<Short> aspathSet; @@ -108,8 +107,8 @@ public class AsPath implements BGPValueType { validation.getLength()); } //if fourth bit is set, length is read as short otherwise as byte , len includes type, length and value - int len = validation.isShort() ? validation.getLength() + TYPE_AND_LEN_AS_SHORT : validation - .getLength() + TYPE_AND_LEN_AS_BYTE; + int len = validation.isShort() ? validation.getLength() + Constants.TYPE_AND_LEN_AS_SHORT : validation + .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); |