net.clackrouter.component.simplerouter
Class Level3Demux

java.lang.Object
  extended by net.clackrouter.component.base.ClackComponent
      extended by net.clackrouter.component.simplerouter.Level3Demux
All Implemented Interfaces:
Alarm

public class Level3Demux
extends ClackComponent

Demultiplexes between Level 3 packets, sending TCP, UDP and ICMP packets to a different output port.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent
ClackComponent.Waiter
 
Field Summary
static int ICMP_OUT
           
static int IP_IN
           
static int NUM_PORTS
           
static int OTHER_OUT
           
static int TCP_OUT
           
static int UDP_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
Level3Demux(Router router, java.lang.String name)
           
 
Method Summary
 void acceptPacket(VNSPacket packet, int port_number)
          The starting point for packet-processing when packets are "pushed" to this component.
 java.awt.Color getColor()
          The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class.
 int getICMPCount()
           
 int getOtherCount()
           
 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.
 int getTCPCount()
           
 int getUDPCount()
           
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, 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

IP_IN

public static int IP_IN

TCP_OUT

public static int TCP_OUT

UDP_OUT

public static int UDP_OUT

ICMP_OUT

public static int ICMP_OUT

OTHER_OUT

public static int OTHER_OUT

NUM_PORTS

public static int NUM_PORTS
Constructor Detail

Level3Demux

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

getTCPCount

public int getTCPCount()

getUDPCount

public int getUDPCount()

getICMPCount

public int getICMPCount()

getOtherCount

public int getOtherCount()

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)
Description copied from class: ClackComponent

The starting point for packet-processing when packets are "pushed" to this component.

The default implementation warns that the packet is being ignored.

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

getPropertiesView

public javax.swing.JPanel getPropertiesView()
Description copied from class: ClackComponent
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. This method creates a default property view, and can be overriden to provide custom properties views

Overrides:
getPropertiesView in class ClackComponent
Returns:
this component's property view

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