All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class calypso.core.routing.Route

java.lang.Object
   |
   +----calypso.core.routing.Route

public class Route
extends Object
A class representing routes to IP destinations. A route consists of:

Version:
$Revision: 1.3 $
Author:
Juhana Räsänen
See Also:
RouteTable

Variable Index

 o gateway
 o ipAddr
 o masklen
 o outport
 o target

Constructor Index

 o Route(InetAddress, int, int)
Constructor to create a route without associated gateway.
 o Route(InetAddress, int, int, InetAddress)
Constructor to create a route with associated gateway.

Method Index

 o getAddress()
Returns the IP address of the destination
 o getGateway()
Returns the IP address of the gateway host for this route.
 o getMask()
Computes and returns the bit mask of this route.
 o getPort()
Returns the outgoing port number of this route.
 o toString()
Returns the string representation of the route.

Variables

 o ipAddr
 long ipAddr
 o masklen
 int masklen
 o outport
 int outport
 o target
 InetAddress target
 o gateway
 InetAddress gateway

Constructors

 o Route
 Route(InetAddress ip_,
       int maskLength_,
       int outPort_)
Constructor to create a route without associated gateway.

Parameters:
ip_ - The destination address of the route
maskLength_ - The number of bits used in matching the route
outPort_ - The outgoing port number
 o Route
 Route(InetAddress ip_,
       int maskLength_,
       int outPort_,
       InetAddress gw_)
Constructor to create a route with associated gateway.

Parameters:
ip_ - The destination address of the route
maskLength_ - The number of bits used in matching the route
outPort_ - The outgoing port number
gw_ - The IP address of the gateway host

Methods

 o getPort
 public int getPort()
Returns the outgoing port number of this route.

Returns:
The port n umber as an integer
 o getMask
 public long getMask()
Computes and returns the bit mask of this route. The mask is computed using the saved mask length. The mask can be ANDed with an IP address when matching them.

Returns:
The bit mask as a long value
 o getAddress
 public InetAddress getAddress()
Returns the IP address of the destination

Returns:
Destination address
 o getGateway
 public InetAddress getGateway()
Returns the IP address of the gateway host for this route. If the destination is not directly connected to this switch, the gateway must be specified.

Returns:
Gateway host IP address
 o toString
 public String toString()
Returns the string representation of the route. The gateway address is not shown if it is not specified in the route.

Returns:
The string representation of the route
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index