SSF.OS.BGP4.Path
Class Attribute

java.lang.Object
  |
  +--SSF.OS.BGP4.Path.Attribute
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
Aggregator, ASpath, AtomicAggregate, ClusterList, Communities, LocalPref, MED, NextHop, Origin, OriginatorID

public abstract class Attribute
extends java.lang.Object
implements java.io.Externalizable

A BGP path attribute. Path attributes are used to keep information about routes helps in making routing decisions.

See Also:
Serialized Form

Field Summary
static java.lang.String[] dmlnames
          The names of the path attributes as DML attributes.
static int MAX_TYPECODE
          The highest path attribute type code value used in the simulation.
static int MIN_TYPECODE
          The lowest path attribute type code value.
static java.lang.String[] names
          The names of the attributes as strings.
static java.lang.String[] nhidmlnames
          The names of NHI versions of path attributes as DML attributes.
static java.lang.String undefined
          For undefined string values.
 
Constructor Summary
Attribute()
          Empty constructor.
 
Method Summary
abstract  int bytecount()
          Calculates and returns the number of octets (bytes) needed to represent this path attribute in an update message.
abstract  Attribute copy()
          Constructs and returns a copy of the attribute.
abstract  boolean equals(Attribute attrib)
          Determines whether or not this path attribute is equivalent to another.
abstract  boolean opt()
          Returns whether the path attribute is optional (true) or well-known (false).
abstract  boolean partial()
          Returns whether or not the information contained in the optional transitive attribute is partial (true) or complete (false).
 void readExternal(java.io.DataInput in)
          Reads the contents of this object from a serialization stream.
 void readExternal(java.io.ObjectInput in)
           
abstract  boolean trans()
          Returns whether an optional attribute is transitive (true) or non-transitive (false).
 void writeExternal(java.io.DataOutput out)
          Writes the contents of this object to a serialization stream.
 void writeExternal(java.io.ObjectOutput out)
          Writes the contents of this object to a data stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

undefined

public static final java.lang.String undefined
For undefined string values.

See Also:
Constant Field Values

MIN_TYPECODE

public static final int MIN_TYPECODE
The lowest path attribute type code value.

See Also:
Constant Field Values

MAX_TYPECODE

public static final int MAX_TYPECODE
The highest path attribute type code value used in the simulation. The actual maximum typecode used in practice may be higher.

See Also:
Constant Field Values

names

public static final java.lang.String[] names
The names of the attributes as strings.


dmlnames

public static final java.lang.String[] dmlnames
The names of the path attributes as DML attributes.


nhidmlnames

public static final java.lang.String[] nhidmlnames
The names of NHI versions of path attributes as DML attributes. Only some path attributes have NHI versions.

Constructor Detail

Attribute

public Attribute()
Empty constructor. Used to deserialize this object.

Method Detail

copy

public abstract Attribute copy()
Constructs and returns a copy of the attribute.

Returns:
a copy of the attribute

opt

public abstract boolean opt()
Returns whether the path attribute is optional (true) or well-known (false).


trans

public abstract boolean trans()
Returns whether an optional attribute is transitive (true) or non-transitive (false). For well-known attributes it must be true.


partial

public abstract boolean partial()
Returns whether or not the information contained in the optional transitive attribute is partial (true) or complete (false). For well-known attributes and for optional non-transitive attributes, it must be false.


bytecount

public abstract int bytecount()
Calculates and returns the number of octets (bytes) needed to represent this path attribute in an update message. The number is the sum of the two octets needed for the attribute type (which contains attribute flags and the attribute type code), the one or two octets needed for the attribute length, and the variable number of octets needed for the attribute value.

Returns:
the number of octets (bytes) needed to represent this path attribute in an update message

equals

public abstract boolean equals(Attribute attrib)
Determines whether or not this path attribute is equivalent to another.

Parameters:
attrib - A path attribute to compare to this one.
Returns:
true only if the two attributes are equivalent

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the contents of this object to a data stream.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException - if there's an error writing the data

writeExternal

public void writeExternal(java.io.DataOutput out)
                   throws java.io.IOException
Writes the contents of this object to a serialization stream.

Throws:
java.io.IOException - if there's an error writing the data

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

readExternal

public void readExternal(java.io.DataInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the contents of this object from a serialization stream.

Throws:
java.io.IOException - if there's an error reading in the data
java.lang.ClassNotFoundException - if a class name is unrecognized