SSF.Net
Class _link

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.Net.link
              |
              +--SSF.Net._link
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, FailureInformation
Direct Known Subclasses:
OpticalLink

public class _link
extends link
implements FailureInformation

This class is a bridge to access package attributes by subclasses. It also contains some utilities for a link. This class was developed at the National Institute of Standards and Technology by employees of the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. We would appreciate acknowledgement if the software is used. NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
private  boolean failure
          Indicates if the link is failed.
private  int id
          The id of this link.
protected  boolean inConfiguration
          Indicator if the class is in the configuration mode (true).
 
Fields inherited from class SSF.Net.link
attachedCount, attachedInterfaces, cidr, dumpTo, ip, ipaddr, link_hw, net, nhi, prefix
 
Fields inherited from class com.renesys.raceway.SSF.Entity
 
Constructor Summary
_link(Net N, java.lang.String use_nhi)
          Constructor
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configures the link.
 void configOptional(com.renesys.raceway.DML.Configuration cfg)
          Configures optional values.
 int getAttachedCount()
          Get the number of attached interfaces.
static int getAttachedCount(link ofLink)
          Return the number of attached interfaces for the given link
 java.util.Hashtable getAttachedInterfaces()
          Table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC and ONIC.
static java.util.Hashtable getAttachedInterfaces(link ofLink)
          Return the table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC.
 java.lang.String getCidr()
          CIDR block address, in l1/l2/l3/l4/l5...
 tcpDump getDumpTo()
          Probe to which traffic is dumped (if non-null)
 int getID()
          Get the id of this link.
 java.lang.String getIp()
          IP network address of attached interfaces, in a.b.c.d/m format.
static java.lang.String getIp(link ofLink)
          get IP network address of attached interfaces, in a.b.c.d/m format
 int getIpaddr()
          IP network address of attached interfaces.
static int getIpaddr(link ofLink)
          return the IP network address of attached interfaces for a link
 linkLayer getLinkLayer()
          Future link layer interface -- determines level-2 routing semantics for packets written on any attached interface.
static linkLayer getLinkLayer(link ofLink)
          Get the future link layer interface.
 Net getNet()
          Get the Net object that contains the link.
 java.lang.String getNhi()
          NHI address of point of link definition.
static NIC[] getNICs(link lnk)
          Return the attached NIC for the given link
 int getPrefix()
          IP prefix length (default: /32).
static int getPrefix(link ofLink)
          get IP prefix length (default: /32)
 boolean isFailure()
          Retruns if the link is failed.
protected  void notifyNIC()
          Informs the NIC's on both sides about the change of the link status.
 void setAttachedCount(int newAttachedCount)
          Set the number of attached interfaces.
static void setAttachedCount(int newAttachedCount, link ofLink)
          Set the number of attached interfaces for a link
 void setAttachedInterfaces(java.util.Hashtable newAttachedInterfaces)
          Table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC and ONIC.
static void setAttachedInterfaces(java.util.Hashtable newAttachedInterfaces, link ofLink)
          Set the hashtable mapping the nhi to the NICs for a link
 void setCidr(java.lang.String newCidr)
          CIDR block address, in l1/l2/l3/l4/l5...
 void setDumpTo(tcpDump newTcpDump)
          Probe to which traffic is dumped (if non-null)
 void setFailure(boolean newValue)
          Modify the failure attribute.
 void setID(int newID)
          Set the ID for this optical link.
 void setIp(java.lang.String newIp)
          Set up the IP network address of attached interfaces, in a.b.c.d/m format.
static void setIp(java.lang.String newIp, link ofLink)
          Set the ip adress of a link
 void setIpaddr(int newIpaddr)
          IP network address of attached interfaces.
static void setIpaddr(int newIpaddr, link ofLink)
          Set the ip adress of a link
 void setLinkLayer(linkLayer newLinkLayer)
          set up the future link layer interface.
static void setLinkLayer(linkLayer newLinkLayer, link ofLink)
          Set the future link layer interface packets written on any attached interface.
 void setNet(Net newNet)
          Set the Net object that contains the link.
 void setNhi(java.lang.String newNhi)
          NHI address of point of link definition.
 void setPrefix(int newPrefix)
          IP prefix length (default: /32).
static void setPrefix(int newPrefix, link ofLink)
          set IP prefix length
 
Methods inherited from class SSF.Net.link
delay
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resumeAll, startAll, startAll, startClient, startClient, startServer, W, Z
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

failure

private boolean failure
Indicates if the link is failed. (Default false)

Since:
1.1

id

private int id
The id of this link. This id is unique in the system. (Default == -1)


inConfiguration

protected boolean inConfiguration
Indicator if the class is in the configuration mode (true).

Constructor Detail

_link

public _link(Net N,
             java.lang.String use_nhi)
Constructor

Parameters:
N - the Net that contains this link
use_nhi - The NHI address to use for this link.
Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configures the link. This configuration is basically the same as the config of the superclass. the addition is the optinal configuration call configOptional.

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class link
Parameters:
cfg - the configuration object.
Throws:
com.renesys.raceway.DML.configException - if a configuration exception occurs.
Since:
1.1

configOptional

public void configOptional(com.renesys.raceway.DML.Configuration cfg)
                    throws com.renesys.raceway.DML.configException
Configures optional values.

Parameters:
cfg - the configuration object.
Throws:
com.renesys.raceway.DML.configException - if an configuration exceprion occurs.
Since:
1.1

isFailure

public boolean isFailure()
Retruns if the link is failed.

Specified by:
isFailure in interface FailureInformation
Returns:
true if the link is failed.
Since:
1.1

setFailure

public void setFailure(boolean newValue)
Modify the failure attribute.

Parameters:
newValue - True if the link becomes failed.

notifyNIC

protected void notifyNIC()
Informs the NIC's on both sides about the change of the link status.


getID

public int getID()
Get the id of this link.

Returns:
The id.

setID

public void setID(int newID)
           throws com.renesys.raceway.DML.configException
Set the ID for this optical link.

Parameters:
newID - The id to use.
Throws:
com.renesys.raceway.DML.configException - when the ID is < 0 or already in use.

getAttachedCount

public int getAttachedCount()
Get the number of attached interfaces.

Returns:
The number of attached interfaces.

setAttachedCount

public void setAttachedCount(int newAttachedCount)
Set the number of attached interfaces.

Parameters:
newAttachedCount - The number of attached interfaces.

getAttachedInterfaces

public java.util.Hashtable getAttachedInterfaces()
Table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC and ONIC.

Returns:
The table between NHI adress and instances of NIC (and ONIC).

setAttachedInterfaces

public void setAttachedInterfaces(java.util.Hashtable newAttachedInterfaces)
Table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC and ONIC.


getCidr

public java.lang.String getCidr()
CIDR block address, in l1/l2/l3/l4/l5... format.

Returns:
the CIDR block address of this link.

setCidr

public void setCidr(java.lang.String newCidr)
CIDR block address, in l1/l2/l3/l4/l5... format.

Parameters:
newCidr - The CIDR block address of the link.

getIp

public java.lang.String getIp()
IP network address of attached interfaces, in a.b.c.d/m format.

Returns:
The IP address of the link.

setIp

public void setIp(java.lang.String newIp)
Set up the IP network address of attached interfaces, in a.b.c.d/m format.

Parameters:
newIp - The IP address of the link as String format.

getIpaddr

public int getIpaddr()
IP network address of attached interfaces.

Returns:
the IP address of the link as int.

setIpaddr

public void setIpaddr(int newIpaddr)
IP network address of attached interfaces.

Parameters:
newIpaddr - The IP address of the link as int.

getNet

public Net getNet()
Get the Net object that contains the link.

Returns:
The Net object that contains the link.

setNet

public void setNet(Net newNet)
Set the Net object that contains the link.

Parameters:
newNet - The Net object that contains the link.

getNhi

public java.lang.String getNhi()
NHI address of point of link definition.

Returns:
The NHI address of the link

setNhi

public void setNhi(java.lang.String newNhi)
NHI address of point of link definition.

Parameters:
newNhi - The NHI address of the link

getPrefix

public int getPrefix()
IP prefix length (default: /32).

Returns:
the IP prefix length.

setPrefix

public void setPrefix(int newPrefix)
IP prefix length (default: /32).

Parameters:
newPrefix - The IP prefix length of this link.

getLinkLayer

public linkLayer getLinkLayer()
Future link layer interface -- determines level-2 routing semantics for packets written on any attached interface.

Returns:
The linkLayer that manages packets transmission.

setLinkLayer

public void setLinkLayer(linkLayer newLinkLayer)
set up the future link layer interface.

Parameters:
newLinkLayer - The linkLayer that manages packets transmission.

getDumpTo

public tcpDump getDumpTo()
Probe to which traffic is dumped (if non-null)

Returns:
The tcpDump for this link.

setDumpTo

public void setDumpTo(tcpDump newTcpDump)
Probe to which traffic is dumped (if non-null)

Parameters:
newTcpDump - The tcpDump for this link.

getAttachedInterfaces

public static java.util.Hashtable getAttachedInterfaces(link ofLink)
Return the table mapping NHI addresses, which are "N:N:N:N:H(I)" strings, to instances of NIC.


setAttachedInterfaces

public static void setAttachedInterfaces(java.util.Hashtable newAttachedInterfaces,
                                         link ofLink)
Set the hashtable mapping the nhi to the NICs for a link

Parameters:
ofLink - The link to modify

getAttachedCount

public static int getAttachedCount(link ofLink)
Return the number of attached interfaces for the given link

Parameters:
ofLink - The link we want to have the number of interfaces
Returns:
the number of attached interfaces for the given link

setAttachedCount

public static void setAttachedCount(int newAttachedCount,
                                    link ofLink)
Set the number of attached interfaces for a link

Parameters:
newAttachedCount - The number of attached interfaces
ofLink - The link to modify

getIpaddr

public static int getIpaddr(link ofLink)
return the IP network address of attached interfaces for a link

Parameters:
ofLink - The link we want to have information
Returns:
the IP network address of attached interfaces

setIpaddr

public static void setIpaddr(int newIpaddr,
                             link ofLink)
Set the ip adress of a link

Parameters:
ofLink - The link we want to have information

getIp

public static java.lang.String getIp(link ofLink)
get IP network address of attached interfaces, in a.b.c.d/m format

Parameters:
ofLink - The link we want to have information

setIp

public static void setIp(java.lang.String newIp,
                         link ofLink)
Set the ip adress of a link

Parameters:
newIp - the IP to assign
ofLink - The link we want to have information

getPrefix

public static int getPrefix(link ofLink)
get IP prefix length (default: /32)

Parameters:
ofLink - The link we want to have information
Returns:
The IP prefix length

setPrefix

public static void setPrefix(int newPrefix,
                             link ofLink)
set IP prefix length

Parameters:
ofLink - The link we want to have information

getLinkLayer

public static linkLayer getLinkLayer(link ofLink)
Get the future link layer interface. packets written on any attached interface.

Parameters:
ofLink - The link we want to have information .
Returns:
The linkLayer that manages packet transmission.

setLinkLayer

public static void setLinkLayer(linkLayer newLinkLayer,
                                link ofLink)
Set the future link layer interface packets written on any attached interface.

Parameters:
newLinkLayer - The link layer that manages packet transmission.
ofLink - The link we want to have information

getNICs

public static NIC[] getNICs(link lnk)
Return the attached NIC for the given link

Returns:
The NICs attached to the link