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:
- CIDR-type IP address/mask length pair, eg. 10.0.0.0/8 represents a
route to any IP address matching 10.*.*.*
- Output port number as integer
- Optional gateway host address, if the destination is not directly
connected to this switch.
- Version:
- $Revision: 1.3 $
- Author:
- Juhana Räsänen
- See Also:
- RouteTable
-
gateway
-
-
ipAddr
-
-
masklen
-
-
outport
-
-
target
-
-
Route(InetAddress, int, int)
- Constructor to create a route without associated gateway.
-
Route(InetAddress, int, int, InetAddress)
- Constructor to create a route with associated gateway.
-
getAddress()
- Returns the IP address of the destination
-
getGateway()
- Returns the IP address of the gateway host for this route.
-
getMask()
- Computes and returns the bit mask of this route.
-
getPort()
- Returns the outgoing port number of this route.
-
toString()
- Returns the string representation of the route.
ipAddr
long ipAddr
masklen
int masklen
outport
int outport
target
InetAddress target
gateway
InetAddress gateway
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
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
getPort
public int getPort()
- Returns the outgoing port number of this route.
- Returns:
- The port n umber as an integer
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
getAddress
public InetAddress getAddress()
- Returns the IP address of the destination
- Returns:
- Destination address
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
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