public class WideCommunity extends Object implements BgpValueType
| Modifier and Type | Field and Description |
|---|---|
static byte |
FLAGS |
static short |
LENGTH |
static byte |
TYPE |
static byte |
TYPE_LENGTH_SIZE |
| Constructor and Description |
|---|
WideCommunity(WideCommunityAttrHeader wideCommunityHeader,
int community,
int localAsn,
int contextAsn,
WideCommunityTarget target,
WideCommunityExcludeTarget excludeTarget,
WideCommunityParameter parameter)
Creates an instance of wide community.
|
| Modifier and Type | Method and Description |
|---|---|
int |
community()
Returns wide community value.
|
int |
compareTo(Object o)
Compares two objects.
|
int |
contextAsn()
Returns wide community context autonomous number.
|
static List<BgpValueType> |
decodeWideCommunityTlv(org.jboss.netty.buffer.ChannelBuffer c)
Decode wide community target(s).
|
static void |
encodeWideCommunityTlv(org.jboss.netty.buffer.ChannelBuffer c,
List<BgpValueType> targetTlv)
Encode wide community target(s).
|
boolean |
equals(Object obj) |
WideCommunityExcludeTarget |
excludeTarget()
Returns wide community exclude target.
|
short |
getType()
Returns the Type of BGP Message.
|
int |
hashCode() |
int |
localAsn()
Returns wide community local autonomous number.
|
static WideCommunity |
of(WideCommunityAttrHeader wideCommunityHeader,
int community,
int localAsn,
int contextAsn,
WideCommunityTarget target,
WideCommunityExcludeTarget excludeTarget,
WideCommunityParameter parameter)
Returns object of this class with specified values.
|
WideCommunityParameter |
parameter()
Returns wide community parameter.
|
static WideCommunity |
read(org.jboss.netty.buffer.ChannelBuffer c)
Reads the wide community attribute.
|
void |
setCommunity(int community)
Sets wide community value.
|
void |
setContextAsn(int contextAsn)
Sets wide community context autonomous number.
|
void |
setExcludeTarget(WideCommunityExcludeTarget excludeTarget)
Sets wide community exclude target.
|
void |
setLocalAsn(int localAsn)
Sets wide community local autonomous number.
|
void |
setParameter(WideCommunityParameter parameter)
Sets wide community parameter.
|
void |
setTarget(WideCommunityTarget target)
Sets wide community target.
|
WideCommunityTarget |
target()
Returns wide community target.
|
String |
toString() |
int |
write(org.jboss.netty.buffer.ChannelBuffer c)
Writes the byte Stream of BGP Message to channel buffer.
|
public static final byte TYPE
public static final short LENGTH
public static final byte TYPE_LENGTH_SIZE
public static final byte FLAGS
public WideCommunity(WideCommunityAttrHeader wideCommunityHeader, int community, int localAsn, int contextAsn, WideCommunityTarget target, WideCommunityExcludeTarget excludeTarget, WideCommunityParameter parameter)
wideCommunityHeader - wide community headercommunity - wide communitylocalAsn - local ASN numbercontextAsn - context ASN numbertarget - wide community include targetexcludeTarget - wide community exclude targetparameter - wide community parameterpublic static WideCommunity of(WideCommunityAttrHeader wideCommunityHeader, int community, int localAsn, int contextAsn, WideCommunityTarget target, WideCommunityExcludeTarget excludeTarget, WideCommunityParameter parameter)
wideCommunityHeader - community headercommunity - wide communitylocalAsn - local ASN numbercontextAsn - context ASN numbertarget - wide community include targetexcludeTarget - wide community exclude targetparameter - wide community parameterpublic int community()
public void setCommunity(int community)
community - wide community valuepublic int localAsn()
public void setLocalAsn(int localAsn)
localAsn - local autonomous numberpublic int contextAsn()
public void setContextAsn(int contextAsn)
contextAsn - context autonomous numberpublic WideCommunityTarget target()
public void setTarget(WideCommunityTarget target)
target - wide community targetpublic WideCommunityExcludeTarget excludeTarget()
public void setExcludeTarget(WideCommunityExcludeTarget excludeTarget)
excludeTarget - wide community texclude argetpublic WideCommunityParameter parameter()
public void setParameter(WideCommunityParameter parameter)
parameter - wide community parameterpublic int write(org.jboss.netty.buffer.ChannelBuffer c)
BgpValueTypewrite in interface BgpValueTypec - channel bufferpublic static WideCommunity read(org.jboss.netty.buffer.ChannelBuffer c) throws BgpParseException
c - ChannelBufferBgpParseException - while parsing BgpPrefixAttrRouteTagpublic static void encodeWideCommunityTlv(org.jboss.netty.buffer.ChannelBuffer c,
List<BgpValueType> targetTlv)
c - channel buffertargetTlv - wide community include/exclude targetpublic static List<BgpValueType> decodeWideCommunityTlv(org.jboss.netty.buffer.ChannelBuffer c) throws BgpParseException
c - channel bufferBgpParseException - on decode errorpublic short getType()
BgpValueTypegetType in interface BgpValueTypepublic int compareTo(Object o)
BgpValueTypecompareTo in interface BgpValueTypeo - object