SSF.OS.OSPF
Class LinkInfo

java.lang.Object
  |
  +--SSF.OS.OSPF.LinkInfo

public class LinkInfo
extends java.lang.Object

A unit of information describing a link and used in the contents of a link state advertisement. The following table shows the information that goes into the different fields depending on the LSA packet type:


 
TYPE LINK ID LINK DATA
----------------------------------------------------------------------------
1 - Router link neighbor's router ID interface number
(Point-to-Point)
1 - Router link address prefix for length (in bits) of prefix
(Connect-to-Stub) subnetwork
3 - Summary link - length (in bits) of prefix
(IP network)
4 - Summary link - -
(AS boundary router)
5 - External link Forwarding address # of bits in destination's
(AS_Ext_Link) address prefix
----------------------------------------------------------------------------


Field Summary
 int area
          The Area to which the link interface belongs.
 int id
          Router ID of the neighbor, if this ID exists.
 int link_data
          This holds additional data about the link.
 int link_id
          This variable holds the ID of the link.
 int metric
          This is the cost of the link.
 int metric_type
          This holds the metric type used.
 java.lang.String nh
           
 int TypeOneType
          This field is used by Router links only to indicate if it is a point-to-point or summary link.
 
Constructor Summary
LinkInfo(int ar, java.lang.String nhipref, int tot, int ip, int data, int m_type, int met)
          Constructs a new unit of link information.
LinkInfo(java.lang.String nhipref, int ip, int data)
          Constructs a new unit of link information given router and link information.
LinkInfo(java.lang.String nhipref, int ip, int data, int tot)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Determines if a given object describes the same link as this object.
 void setID(int ident)
           
 java.lang.String toString()
          Converts the link information to a string.
 java.lang.String toString(boolean usenhi)
          Converts the link information to a string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

area

public int area
The Area to which the link interface belongs.


id

public int id
Router ID of the neighbor, if this ID exists.


nh

public java.lang.String nh

TypeOneType

public int TypeOneType
This field is used by Router links only to indicate if it is a point-to-point or summary link.


link_id

public int link_id
This variable holds the ID of the link.


link_data

public int link_data
This holds additional data about the link.


metric_type

public int metric_type
This holds the metric type used.


metric

public int metric
This is the cost of the link.

Constructor Detail

LinkInfo

public LinkInfo(java.lang.String nhipref,
                int ip,
                int data)
Constructs a new unit of link information given router and link information.


LinkInfo

public LinkInfo(java.lang.String nhipref,
                int ip,
                int data,
                int tot)

LinkInfo

public LinkInfo(int ar,
                java.lang.String nhipref,
                int tot,
                int ip,
                int data,
                int m_type,
                int met)
Constructs a new unit of link information.

Method Detail

toString

public java.lang.String toString(boolean usenhi)
Converts the link information to a string.

Parameters:
usenhi - Whether to use NHI addressing or IP addressing.
Returns:
the link information as a string

toString

public java.lang.String toString()
Converts the link information to a string.

Overrides:
toString in class java.lang.Object
Returns:
the link information as a string

setID

public void setID(int ident)

equals

public boolean equals(java.lang.Object o)
Determines if a given object describes the same link as this object.

Overrides:
equals in class java.lang.Object
Returns:
true only if the object is of type LinkInfo and describes the same link as this object