|
||||||||||
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.extension.TCPMonitor
public class TCPMonitor
A class for tracking and analyzing the TCP flows being forwarded by a router.
TODO: This class provides the basic infrastructure for tracking TCP flows and keeping certain stats about the flows. It's property view is meant to give a graphical view of all this data but both have fallen into a state of disrepair and need a little care before they will be usuable again.
Nested Class Summary | |
---|---|
class |
TCPMonitor.TCPFlow
Helper class to contain all information about a single TCP flow. |
static interface |
TCPMonitor.TCPFlowListener
Listener interface for classes wishing to be updated about changes to a TCPMonitor.TCPFlow . |
class |
TCPMonitor.TimerCallback
|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
static int |
NUM_PORTS
|
static int |
PORT_IN
|
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 | |
---|---|
TCPMonitor(Router router,
java.lang.String name)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
Extracts TCP packets from the IP that is being passed through the component and analyzes them. |
java.lang.String |
createKey(java.net.InetAddress aAddr,
int aPort,
java.net.InetAddress bAddr,
int bPort)
|
java.util.Hashtable |
getFlowMap()
Get map from flow id to TCPFlow objects |
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. |
boolean |
isModifying()
Reports whether this component modifies packets passed through it This value is used by the static checking algorithm used to make sure port connections are valid. |
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, getColor, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, initializeProperties, isHierarchical, 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_IN
public static int PORT_OUT
public static int NUM_PORTS
Constructor Detail |
---|
public TCPMonitor(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 boolean isModifying()
ClackComponent
isModifying
in class ClackComponent
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class ClackComponent
public void acceptPacket(VNSPacket packet, int port_number)
We identify a flow by a 4-tuple of (host A address, host A port, host B address, host B port). We arbitrarily define host A to be the host with the numerically lower address when the two addresses are compared as integers.
Each flow then has a TCPMonitor.TCPFlow
object that is updated each time we see a packet.
acceptPacket
in class ClackComponent
packet
- The pushed packetport_number
- The number of the port that this packet is arriving onpublic java.util.Hashtable getFlowMap()
public java.lang.String createKey(java.net.InetAddress aAddr, int aPort, java.net.InetAddress bAddr, int bPort)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |