|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.clackrouter.component.base.ClackComponent
net.clackrouter.component.tcp.TCP
public class TCP
A class representing a simplified TCP stack on a local host.
This TCP stack can respresent multiple IP addresses, and Transmission Control Blocks (TCBs) for ports on each of those addresses. This component takes care of demultiplexing packets for processing by each TCB, and also performs the TCP checksum. Some portions of TCP behavior are simplified from that of a real TCP stack. For example, sender or receiver side congestion control is not implemented, and reset packets are ignored.
Nested Class Summary | |
---|---|
static class |
TCP.UpdateEvent
TCP specific class to provide more information to a GUI object about changes to the TCP data. |
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_INTERNAL_TO_NET
|
static int |
PORT_NET_OUT
|
static int |
PORT_UNREACH_OUT
|
static int |
TYPE_CLIENT
|
static int |
TYPE_SERVER
|
static int |
TYPE_UNKNOWN
|
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 | |
---|---|
TCP(Router r,
java.lang.String name)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_num)
Strips the IP header and handles the packet for one of the following three cases: If the port is a simple client-end of a connection, it hands the packet to this TCB. |
void |
createMapping(TCB tcb)
method called when a socket is bound to a local address with bind() |
TCB |
createTCB(java.lang.String name)
Used to create a Transmission Control Block (TCB) to be associated with a socket. |
ClackView |
getHierarchicalView()
Supplies hierarchical view that implements ClackView if ClackComponent.isHierarchical() is true |
boolean |
isHierarchical()
Tells whether this component is hierarchical, that is, capable of being zoomed into within a Clack Router. |
void |
removeTCB(TCB tcb)
Not currently used, but removes a mapping once a socket no longer exists on a port. |
TCB |
serverAcceptCall(TCB tcb)
Method used when the server port identified by this TCB is calling accept() |
void |
setupClientMapping(TCB tcb)
Sets the type of this TCB to CLIENT and creates a mapping for later look-ups. |
void |
setupListenMapping(TCB tcb)
Sets the type of this TCB to LISTENING and creates a mapping for later look-ups. |
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, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getPropertiesView, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, initializeProperties, 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 TYPE_UNKNOWN
public static int TYPE_SERVER
public static int TYPE_CLIENT
public static int PORT_IN
public static int PORT_NET_OUT
public static int PORT_UNREACH_OUT
public static int PORT_INTERNAL_TO_NET
public static int NUM_PORTS
Constructor Detail |
---|
public TCP(Router r, java.lang.String name)
Method Detail |
---|
protected void setupPorts(int numports)
ClackComponent
setupPorts
in class ClackComponent
numports
- the number of ports to createpublic boolean isHierarchical()
ClackComponent
isHierarchical
in class ClackComponent
public ClackView getHierarchicalView()
ClackComponent
ClackView
if ClackComponent.isHierarchical()
is true
getHierarchicalView
in class ClackComponent
public void acceptPacket(VNSPacket packet, int port_num)
acceptPacket
in class ClackComponent
packet
- The pushed packetport_num
- The number of the port that this packet is arriving onpublic TCB serverAcceptCall(TCB tcb) throws java.lang.Exception
java.lang.Exception
public TCB createTCB(java.lang.String name)
name
- a name identifying the TCB and socket.
public void createMapping(TCB tcb) throws java.lang.Exception
java.lang.Exception
public void setupListenMapping(TCB tcb) throws java.lang.Exception
tcb
-
java.lang.Exception
public void setupClientMapping(TCB tcb)
tcb
- public void removeTCB(TCB tcb)
tcb
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |