net.clackrouter.component.simplerouter
Class ICMPEcho

java.lang.Object
  extended by net.clackrouter.component.base.ClackComponent
      extended by net.clackrouter.component.simplerouter.ICMPEcho
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Alarm

public class ICMPEcho
extends ClackComponent
implements java.lang.Cloneable, java.io.Serializable

Class to reply to ICMP Echo requests to any local interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent
ClackComponent.Waiter
 
Field Summary
static int ECHO_IN
           
static int ECHO_OUT
           
static int NUM_PORTS
           
 
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
ICMPEcho(Router router, java.lang.String name)
           
 
Method Summary
 void acceptPacket(VNSPacket packet, int port_number)
          Processing Echo request and replies to the source address with an Echo Reply packet.
 void addListener(ICMPListener l)
           
 java.awt.Color getColor()
          The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class.
 void removeListener(ICMPListener l)
           
 void sendEchoRequest(java.net.InetAddress dest, int identifier, int seq_num)
           
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
 

Field Detail

ECHO_IN

public static int ECHO_IN

ECHO_OUT

public static int ECHO_OUT

NUM_PORTS

public static int NUM_PORTS
Constructor Detail

ICMPEcho

public ICMPEcho(Router router,
                java.lang.String name)
Method Detail

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)
Processing Echo request and replies to the source address with an Echo Reply packet.

Overrides:
acceptPacket in class ClackComponent
Parameters:
packet - The pushed packet
port_number - The number of the port that this packet is arriving on

sendEchoRequest

public void sendEchoRequest(java.net.InetAddress dest,
                            int identifier,
                            int seq_num)

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

addListener

public void addListener(ICMPListener l)

removeListener

public void removeListener(ICMPListener l)