urv.olsr.data
Class LinkCode

java.lang.Object
  extended by urv.olsr.data.LinkCode
All Implemented Interfaces:
java.io.Serializable, org.jgroups.util.Streamable

public class LinkCode
extends java.lang.Object
implements java.io.Serializable, org.jgroups.util.Streamable

This field specifies information about the link between the interface of the sender and the following list of neighbor interfaces. It also specifies information about the status of the neighbor. Link codes, not known by a node, are silently discarded. The following four "Link Types" are REQUIRED by OLSR: - UNSPEC_LINK - indicating that no specific information about the links is given. - ASYM_LINK - indicating that the links are asymmetric (i.e., the neighbor interface is "heard"). - SYM_LINK - indicating that the links are symmetric with the interface. - LOST_LINK - indicating that the links have been lost. The following three "Neighbor Types" are REQUIRED by OLSR: - SYM_NEIGH - indicating that the neighbors have at least one symmetrical link with this node. - MPR_NEIGH - indicating that the neighbors have at least one symmetrical link AND have been selected as MPR by the sender. - NOT_NEIGH - indicating that the nodes are either no longer or have not yet become symmetric neighbors. Note that an implementation should be careful in confusing neither Link Type with Neighbor Type nor the constants (confusing SYM_NEIGH with SYM_LINK for instance). A link code advertising: Link Type == SYM_LINK AND Neighbor Type == NOT_NEIGH is invalid, and any links advertised as such MUST be silently discarded without any processing. Likewise a Neighbor Type field advertising a numerical value which is not one of the constants SYM_NEIGH, MPR_NEIGH, NOT_NEIGH, is invalid, and any links advertised as such MUST be silently discarded without any processing.

Author:
Gerard Paris Aixala
See Also:
Serialized Form

Field Summary
static int ASYM_LINK
           
static int LOST_LINK
           
static int MPR_NEIGH
           
static int NOT_NEIGH
           
static int SYM_LINK
           
static int SYM_NEIGH
           
static int UNSPEC_LINK
           
 
Constructor Summary
LinkCode()
           
LinkCode(int neighborType, int linkType)
           
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 int getLinkType()
           
 int getNeighborType()
           
 int hashCode()
           
 void readFrom(java.io.DataInputStream in)
           
 void setLinkType(int linkType)
           
 void setNeighborType(int neighborType)
           
 java.lang.String toString()
           
 void writeTo(java.io.DataOutputStream out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPEC_LINK

public static final int UNSPEC_LINK
See Also:
Constant Field Values

ASYM_LINK

public static final int ASYM_LINK
See Also:
Constant Field Values

SYM_LINK

public static final int SYM_LINK
See Also:
Constant Field Values

LOST_LINK

public static final int LOST_LINK
See Also:
Constant Field Values

SYM_NEIGH

public static final int SYM_NEIGH
See Also:
Constant Field Values

MPR_NEIGH

public static final int MPR_NEIGH
See Also:
Constant Field Values

NOT_NEIGH

public static final int NOT_NEIGH
See Also:
Constant Field Values
Constructor Detail

LinkCode

public LinkCode()

LinkCode

public LinkCode(int neighborType,
                int linkType)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

readFrom

public void readFrom(java.io.DataInputStream in)
              throws java.io.IOException,
                     java.lang.IllegalAccessException,
                     java.lang.InstantiationException
Specified by:
readFrom in interface org.jgroups.util.Streamable
Throws:
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException

writeTo

public void writeTo(java.io.DataOutputStream out)
             throws java.io.IOException
Specified by:
writeTo in interface org.jgroups.util.Streamable
Throws:
java.io.IOException

getLinkType

public int getLinkType()
Returns:
the linkType

getNeighborType

public int getNeighborType()
Returns:
the neighborType

setLinkType

public void setLinkType(int linkType)
Parameters:
linkType - The linkType to set.

setNeighborType

public void setNeighborType(int neighborType)
Parameters:
neighborType - The neighborType to set.