SSF.OS.OSPFv2
Class LSA

java.lang.Object
  |
  +--SSF.OS.ProtocolMessage
        |
        +--SSF.OS.OSPFv2.LSA

public class LSA
extends ProtocolMessage

An OSPF Link State Advertisement packet. It extends an OSPF packet. The following table shows the information that goes into the different fields depending on the LSA packet type:


 
 
TYPE LS Identification Sent by Received by
--------------------------------------------------------------------------------------
1 - Router link OSPF Router ID each router rtrs in the same area
2 - Network link IP itrf address of
network's dest. router
3 - Summary link (IP net) IP network number Area border rtr rtrs in the same area
4 - Summary link (ASBR) ASBR OSPF rtr ID ASB rtr rtrs in the AS
5 - External link IP network number AS boundary rtr rtrs in the AS
--------------------------------------------------------------------------------------

In RFC 2178, but NOT implemented:

1) LS checksum
2) length


Field Summary
 int advRouter
          The advertising router of this LSA.
 java.lang.String advrtrnh
           
static byte AS_EXTERNAL_LSA
          Indicates an AS External LSA.
static int HEADER_LENGTH
          The standard length of an LSA header.
 long lsAge
          The age of this Link State Advertisement.
 int lsID
          The Link State Identification of this LSA.
 int lsSeqnum
          The link state sequence number of this LSA header.
 byte lsType
          The type of this Link State Advertisement.
static byte NETWORK_LSA
          Indicates a network-LSA.
 boolean[] options
          The options field representing the capabilities of the router which originates this LSA.
static byte ROUTER_LSA
          Indicates a router-LSA.
static byte SUMMARY_ASBR_LSA
          Indicates a summary-LSA (ASBR).
static byte SUMMARY_NETWORK_LSA
          Indicates a summary-LSA (IP network).
 
Constructor Summary
LSA(boolean[] opt, byte t, int id, int ar, java.lang.String arnh, int seq)
          Constructs a Link State Advertisement.
 
Method Summary
 int bytecount()
          Return the total size (in bytes) of this LSA including the header.
 ProtocolMessage copy()
          Return an exact copy of the complete LSA.
 LSA copyHeader()
          Return an exact copy of this LSA header.
 java.lang.String getKey()
          creates a key from the values of lsTyp, lsID and advRouter which uniquely identifies this LSA.
 java.lang.String getStrFromType(byte type)
          Converts the byte value of lsType in a more readable format.
static int headerByteCount()
          Return the size (in bytes) of this Packet only, don't include the payload, if any.
 java.lang.String toString()
           
 
Methods inherited from class SSF.OS.ProtocolMessage
carryPayload, dropHeader, dropPayload, frombytes, fromVersion, header_bytecount, payload, previous, size, tobytes, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ROUTER_LSA

public static final byte ROUTER_LSA
Indicates a router-LSA.

See Also:
Constant Field Values

NETWORK_LSA

public static final byte NETWORK_LSA
Indicates a network-LSA.

See Also:
Constant Field Values

SUMMARY_NETWORK_LSA

public static final byte SUMMARY_NETWORK_LSA
Indicates a summary-LSA (IP network).

See Also:
Constant Field Values

SUMMARY_ASBR_LSA

public static final byte SUMMARY_ASBR_LSA
Indicates a summary-LSA (ASBR).

See Also:
Constant Field Values

AS_EXTERNAL_LSA

public static final byte AS_EXTERNAL_LSA
Indicates an AS External LSA.

See Also:
Constant Field Values

HEADER_LENGTH

public static final int HEADER_LENGTH
The standard length of an LSA header.

See Also:
Constant Field Values

lsAge

public long lsAge
The age of this Link State Advertisement.


options

public boolean[] options
The options field representing the capabilities of the router which originates this LSA.


lsType

public byte lsType
The type of this Link State Advertisement.


lsID

public int lsID
The Link State Identification of this LSA.


advRouter

public int advRouter
The advertising router of this LSA.


advrtrnh

public java.lang.String advrtrnh

lsSeqnum

public int lsSeqnum
The link state sequence number of this LSA header.

Constructor Detail

LSA

public LSA(boolean[] opt,
           byte t,
           int id,
           int ar,
           java.lang.String arnh,
           int seq)
Constructs a Link State Advertisement.

Parameters:
seq - LSA sequence number.
opt - Capabilities supported by the described portion of the routing domain.
t - LSA type.
ar - The ID of the advertising router.
arnh - The NHI prefix address of the advertising router.
Method Detail

getKey

public java.lang.String getKey()
creates a key from the values of lsTyp, lsID and advRouter which uniquely identifies this LSA.


copyHeader

public LSA copyHeader()
Return an exact copy of this LSA header.


copy

public ProtocolMessage copy()
Return an exact copy of the complete LSA.

Overrides:
copy in class ProtocolMessage

bytecount

public int bytecount()
Return the total size (in bytes) of this LSA including the header. All and only fields specified in RFC 2328 are included in calculation!!!

Overrides:
bytecount in class ProtocolMessage

headerByteCount

public static int headerByteCount()
Return the size (in bytes) of this Packet only, don't include the payload, if any.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getStrFromType

public java.lang.String getStrFromType(byte type)
Converts the byte value of lsType in a more readable format. This is only used for debuging purposes.