net.clackrouter.component.simplerouter
Class ICMPDemux
java.lang.Object
net.clackrouter.component.base.ClackComponent
net.clackrouter.component.simplerouter.ICMPDemux
- All Implemented Interfaces:
- Alarm
public class ICMPDemux
- extends ClackComponent
Demultiplexes a subset of ICMP types to different output ports.
Currently demultiplexed are the following types: Echo Request, Destination Unreachable,
Echo Reply, and TTL-Exceeded. An additional output takes all other ICMP types.
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 |
Method Summary |
void |
acceptPacket(VNSPacket packet,
int port_number)
Checks the TYPE field in the ICMP header and sends the packet to the corrresponding port. |
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer class. |
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, getPropertiesView, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, initializeProperties, 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 |
ICMP_IN
public static int ICMP_IN
ECHO_REQUEST_OUT
public static int ECHO_REQUEST_OUT
UNREACH_OUT
public static int UNREACH_OUT
ECHO_REPLY_OUT
public static int ECHO_REPLY_OUT
TTL_EXCEEDED_OUT
public static int TTL_EXCEEDED_OUT
OTHER_OUT
public static int OTHER_OUT
NUM_PORTS
public static int NUM_PORTS
ICMPDemux
public ICMPDemux(Router router,
java.lang.String name)
setupPorts
protected void setupPorts(int numports)
- Description copied from class:
ClackComponent
- Allocates an array of ClackPort objects to be used by this component
- Overrides:
setupPorts
in class ClackComponent
- Parameters:
numports
- the number of ports to create
acceptPacket
public void acceptPacket(VNSPacket packet,
int port_number)
- Checks the TYPE field in the ICMP header and sends the packet to the corrresponding port.
- Overrides:
acceptPacket
in class ClackComponent
- Parameters:
packet
- The pushed packetport_number
- The number of the port that this packet is arriving on
getColor
public java.awt.Color getColor()
- Description copied from class:
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.
- Overrides:
getColor
in class ClackComponent
- Returns:
- the rendering color