|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.simplerouter.IPRouteLookup
public class IPRouteLookup
Performs route lookup for an IP packet, identifying local packets, setting the output interface for forwarding, or dropping the packet.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
protected java.util.Hashtable |
mPortsToInterface
|
protected RoutingTable |
mRtable
|
static int |
NUM_PORTS
|
static int |
PORT_IP_IN
|
static int |
PORT_LOCAL
|
static int |
PORT_NOROUTE
|
static int |
PORT_OUT
|
Fields inherited from class net.clackrouter.component.base.ClackComponent |
---|
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view |
Constructor Summary | |
---|---|
IPRouteLookup(Router router,
java.lang.String name)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
Accept IP packet and either forward, drop, or pass on for local processing. |
protected void |
debug_addr_print(IPPacket ippacket)
|
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
javax.swing.JPanel |
getPropertiesView()
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. |
RoutingTable |
getRoutingTable()
|
java.util.Properties |
getSerializableProperties(boolean isTransient)
Serialize the routing table state for reloading the router |
protected java.net.InetAddress |
getSourceFromRtable(java.net.InetAddress dest)
Finds the correct source address for a given destination. |
void |
initializeProperties(java.util.Properties props)
Load and static entries that have been hard-coded into the topo file |
protected boolean |
ipForward(IPPacket packet)
Internal function used to forward a packet, either sending it to the local output port, dropping it, or forwarding it via an output port. |
protected boolean |
isForUs(IPPacket egg)
|
void |
setRoutingTable(RoutingTable table)
|
protected void |
setupPorts(int numports)
Allocates an array of ClackPort objects to be used by this component |
Methods inherited from class net.clackrouter.component.base.ClackComponent |
---|
createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, isHierarchical, isModifying, log, notifyAlarm, poll, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setView, showErrorDialog, signalError, try_repaint, unregisterListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int PORT_IP_IN
public static int PORT_NOROUTE
public static int PORT_LOCAL
public static int PORT_OUT
public static int NUM_PORTS
protected RoutingTable mRtable
protected java.util.Hashtable mPortsToInterface
Constructor Detail |
---|
public IPRouteLookup(Router router, java.lang.String name)
Method Detail |
---|
protected void setupPorts(int numports)
ClackComponent
setupPorts
in class ClackComponent
numports
- the number of ports to createpublic void acceptPacket(VNSPacket packet, int port_number)
acceptPacket
in class ClackComponent
packet
- The pushed packetport_number
- The number of the port that this packet is arriving onprotected boolean isForUs(IPPacket egg)
protected java.net.InetAddress getSourceFromRtable(java.net.InetAddress dest)
Used in the case of "local packets" such as ICMP messages that need their source address set according to the interface they are being forwarded out of.
dest
- destination IP address of the packet
public RoutingTable getRoutingTable()
public void setRoutingTable(RoutingTable table)
protected boolean ipForward(IPPacket packet)
packet
-
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class ClackComponent
public java.awt.Color getColor()
ClackComponent
The color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer
class.
Other renderers may ignore this value.
getColor
in class ClackComponent
protected void debug_addr_print(IPPacket ippacket)
public void initializeProperties(java.util.Properties props)
initializeProperties
in class ClackComponent
props
- all property values serialized for this componentpublic java.util.Properties getSerializableProperties(boolean isTransient)
getSerializableProperties
in class ClackComponent
isTransient
- flag indicating if serialization is transient
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |