public class Validation extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte |
FIRST_BIT |
static byte |
FOURTH_BIT |
static byte |
IPV4_SIZE |
static byte |
SECOND_BIT |
static byte |
THIRD_BIT |
| Modifier and Type | Method and Description |
|---|---|
static org.onlab.packet.IpPrefix |
bytesToPrefix(byte[] value,
int length)
Converts byte array of prefix value to IpPrefix object.
|
boolean |
getFirstBit()
Returns first bit in type flags.
|
boolean |
getFourthBit()
Returns fourth bit in type flags.
|
int |
getLength()
Returns attribute length.
|
boolean |
getSecondBit()
Returns second bit in type flags.
|
boolean |
getThirdBit()
Returns third bit in type flags.
|
boolean |
isShort()
Returns whether attribute length read in short or byte.
|
static Validation |
parseAttributeHeader(org.jboss.netty.buffer.ChannelBuffer cb)
Parses attribute Header.
|
static InetAddress |
toInetAddress(int length,
org.jboss.netty.buffer.ChannelBuffer cb)
Convert byte array to InetAddress.
|
static void |
validateLen(byte errorCode,
byte subErrCode,
int length)
Throws exception if length is not correct.
|
static void |
validateType(byte errorCode,
byte subErrCode,
int type)
Throws exception if type is not correct.
|
public static final byte FIRST_BIT
public static final byte SECOND_BIT
public static final byte THIRD_BIT
public static final byte FOURTH_BIT
public static final byte IPV4_SIZE
public static Validation parseAttributeHeader(org.jboss.netty.buffer.ChannelBuffer cb)
cb - ChannelBufferpublic static void validateLen(byte errorCode,
byte subErrCode,
int length)
throws BgpParseException
errorCode - Error codesubErrCode - Sub Error Codelength - erroneous lengthBgpParseException - for erroneous lengthpublic static void validateType(byte errorCode,
byte subErrCode,
int type)
throws BgpParseException
errorCode - Error codesubErrCode - Sub Error Codetype - erroneous typeBgpParseException - for erroneous typepublic static InetAddress toInetAddress(int length, org.jboss.netty.buffer.ChannelBuffer cb)
length - of IpAddresscb - channelBufferpublic boolean getFirstBit()
public boolean getSecondBit()
public boolean getThirdBit()
public boolean getFourthBit()
public int getLength()
public boolean isShort()
public static org.onlab.packet.IpPrefix bytesToPrefix(byte[] value,
int length)
value - byte array of prefix valuelength - prefix length in bitsCopyright © 2016. All rights reserved.