From e63291850fd0795c5700e25e67e5dee89ba54c5f Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Tue, 1 Dec 2015 05:49:27 -0800 Subject: onos commit hash c2999f30c69e50df905a9d175ef80b3f23a98514 Change-Id: I2bb8562c4942b6d6a6d60b663db2e17540477b81 Signed-off-by: Ashlee Young --- .../bgpio/protocol/ver4/BgpUpdateMsgVer4.java | 72 +++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpUpdateMsgVer4.java') diff --git a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpUpdateMsgVer4.java b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpUpdateMsgVer4.java index 9f4cf9b9..4d6af594 100644 --- a/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpUpdateMsgVer4.java +++ b/framework/src/onos/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpUpdateMsgVer4.java @@ -20,14 +20,14 @@ import java.util.List; import org.jboss.netty.buffer.ChannelBuffer; import org.onlab.packet.IpPrefix; -import org.onosproject.bgpio.exceptions.BGPParseException; -import org.onosproject.bgpio.protocol.BGPMessageReader; -import org.onosproject.bgpio.protocol.BGPType; +import org.onosproject.bgpio.exceptions.BgpParseException; +import org.onosproject.bgpio.protocol.BgpMessageReader; +import org.onosproject.bgpio.protocol.BgpType; import org.onosproject.bgpio.protocol.BgpUpdateMsg; -import org.onosproject.bgpio.types.BGPErrorType; -import org.onosproject.bgpio.types.BGPHeader; +import org.onosproject.bgpio.types.BgpErrorType; +import org.onosproject.bgpio.types.BgpHeader; import org.onosproject.bgpio.util.Validation; -import org.onosproject.bgpio.protocol.BGPVersion; +import org.onosproject.bgpio.protocol.BgpVersion; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,12 +75,12 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { public static final int BYTE_IN_BITS = 8; public static final int MIN_LEN_AFTER_WITHDRW_ROUTES = 2; public static final int MINIMUM_COMMON_HEADER_LENGTH = 19; - public static final BGPType MSG_TYPE = BGPType.UPDATE; + public static final BgpType MSG_TYPE = BgpType.UPDATE; public static final BgpUpdateMsgVer4.Reader READER = new Reader(); private List withdrawnRoutes; private BgpPathAttributes bgpPathAttributes; - private BGPHeader bgpHeader; + private BgpHeader bgpHeader; private List nlri; /** @@ -91,7 +91,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { * @param bgpPathAttributes BGP Path attributes * @param nlri Network Layer Reachability Information */ - public BgpUpdateMsgVer4(BGPHeader bgpHeader, List withdrawnRoutes, + public BgpUpdateMsgVer4(BgpHeader bgpHeader, List withdrawnRoutes, BgpPathAttributes bgpPathAttributes, List nlri) { this.bgpHeader = bgpHeader; this.withdrawnRoutes = withdrawnRoutes; @@ -102,15 +102,15 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { /** * Reader reads BGP Update Message from the channel buffer. */ - static class Reader implements BGPMessageReader { + static class Reader implements BgpMessageReader { @Override - public BgpUpdateMsg readFrom(ChannelBuffer cb, BGPHeader bgpHeader) - throws BGPParseException { + public BgpUpdateMsg readFrom(ChannelBuffer cb, BgpHeader bgpHeader) + throws BgpParseException { if (cb.readableBytes() != (bgpHeader.getLength() - MINIMUM_COMMON_HEADER_LENGTH)) { - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.BAD_MESSAGE_LENGTH, bgpHeader.getLength()); + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.BAD_MESSAGE_LENGTH, bgpHeader.getLength()); } LinkedList withDrwRoutes = new LinkedList<>(); @@ -120,8 +120,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { Short withDrwLen = cb.readShort(); if (cb.readableBytes() < withDrwLen) { - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, cb.readableBytes()); } ChannelBuffer tempCb = cb.readBytes(withDrwLen); @@ -131,23 +131,23 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { } if (cb.readableBytes() < MIN_LEN_AFTER_WITHDRW_ROUTES) { log.debug("Bgp Path Attribute len field not present"); - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null); } // Reading Total Path Attribute Length short totPathAttrLen = cb.readShort(); int len = withDrwLen + totPathAttrLen + PACKET_MINIMUM_LENGTH; if (len > bgpHeader.getLength()) { - throw new BGPParseException(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, null); + throw new BgpParseException(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, null); } if (totPathAttrLen != 0) { // Parsing BGPPathAttributes if (cb.readableBytes() < totPathAttrLen) { Validation - .validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, + .validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, cb.readableBytes()); } tempCb = cb.readBytes(totPathAttrLen); @@ -167,10 +167,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { * * @param cb channelBuffer * @return list of IP Prefix - * @throws BGPParseException while parsing NLRI + * @throws BgpParseException while parsing NLRI */ public static LinkedList parseNlri(ChannelBuffer cb) - throws BGPParseException { + throws BgpParseException { LinkedList nlri = new LinkedList<>(); while (cb.readableBytes() > 0) { int length = cb.readByte(); @@ -186,8 +186,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { len = len + 1; } if (cb.readableBytes() < len) { - Validation.validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, + Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, cb.readableBytes()); } byte[] prefix = new byte[len]; @@ -204,10 +204,10 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { * * @param cb channelBuffer * @return list of IP prefix - * @throws BGPParseException while parsing withdrawn routes + * @throws BgpParseException while parsing withdrawn routes */ public static LinkedList parseWithdrawnRoutes(ChannelBuffer cb) - throws BGPParseException { + throws BgpParseException { LinkedList withDrwRoutes = new LinkedList<>(); while (cb.readableBytes() > 0) { int length = cb.readByte(); @@ -224,8 +224,8 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { } if (cb.readableBytes() < len) { Validation - .validateLen(BGPErrorType.UPDATE_MESSAGE_ERROR, - BGPErrorType.MALFORMED_ATTRIBUTE_LIST, + .validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, + BgpErrorType.MALFORMED_ATTRIBUTE_LIST, cb.readableBytes()); } byte[] prefix = new byte[len]; @@ -238,17 +238,17 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { } @Override - public BGPVersion getVersion() { - return BGPVersion.BGP_4; + public BgpVersion getVersion() { + return BgpVersion.BGP_4; } @Override - public BGPType getType() { - return BGPType.UPDATE; + public BgpType getType() { + return BgpType.UPDATE; } @Override - public void writeTo(ChannelBuffer channelBuffer) throws BGPParseException { + public void writeTo(ChannelBuffer channelBuffer) throws BgpParseException { //Not to be implemented as of now } @@ -268,7 +268,7 @@ public class BgpUpdateMsgVer4 implements BgpUpdateMsg { } @Override - public BGPHeader getHeader() { + public BgpHeader getHeader() { return this.bgpHeader; } -- cgit 1.2.3-korg