SSF.OS.BGP4.Util
Class AS_descriptor

java.lang.Object
  |
  +--SSF.OS.BGP4.Util.AS_descriptor

public class AS_descriptor
extends java.lang.Object

This class manages the assignment of autonomous system identifiers. It is not intended to have any instantiated objects. An AS can be identified by its NHI prefix address, which is the NHI prefix address of the Net construct which defines the AS's encompassing border. A hash is constructed to map each such NHI prefix address to a unique integer for times when an integer AS descriptor (in other words, a traditional AS number) is desired.


Field Summary
static int NO_AS
          Indicates an undefined AS number.
 
Constructor Summary
AS_descriptor()
           
 
Method Summary
static java.lang.String as2nh(int asnum)
          Returns the AS NHI prefix address associated with a given AS number.
static java.lang.String get_as_nh(Host thehost)
          Determines the NHI prefix address of the AS in which a host lies and returns it.
static int nh2as(java.lang.String nh)
          Returns the AS number associated with a given AS NHI prefix address.
static void register(java.lang.String nh, int asn)
          Registers a given integer as the AS number for a given NHI prefix address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_AS

public static final int NO_AS
Indicates an undefined AS number. An node with this value for its AS number either does not know its true AS number or is not enclosed in a defined AS.

See Also:
Constant Field Values
Constructor Detail

AS_descriptor

public AS_descriptor()
Method Detail

get_as_nh

public static final java.lang.String get_as_nh(Host thehost)
Determines the NHI prefix address of the AS in which a host lies and returns it. Returns an empty string if the host is not contained within an AS.

Parameters:
thehost - The host whose AS is to be identified.
Returns:
the NHI prefix address of the AS in which the host lies

register

public static void register(java.lang.String nh,
                            int asn)
Registers a given integer as the AS number for a given NHI prefix address. The NHI prefix address must be that of a Net which is an AS boundary. If the simulation is distributed and the modeler assigns the same AS number to two different ASes, each on a different physical machine being used for the simulation, then the problem will go uncaught.

Parameters:
nh - An NHI prefix address to which to map a given AS number.
asn - An AS number to map to the given NHI prefix address.

nh2as

public static int nh2as(java.lang.String nh)
Returns the AS number associated with a given AS NHI prefix address.

Parameters:
nh - The NHI prefix address to be converted.
Returns:
the AS number associated with the NHI prefix address

as2nh

public static java.lang.String as2nh(int asnum)
Returns the AS NHI prefix address associated with a given AS number. Returns null if there is no NHI prefix address associated with the given AS number.

Parameters:
asnum - The AS number to be converted.
Returns:
the NHI prefix address associated with the AS number