|
||||||||||
| 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.extension.Capture
public class Capture
Component that allows the user to capture packet through it to a PCAP file readable by Ethereal or another packet-analyzer.
Depending on the layer of the packets captured, this component will wrap the packet in dummy layers because PCAP expects Ethernet frames.
Ignore the code about JCaptor and JpcapDumper, as it was an early attempt to build in a packet analyzer that we have halted, at least for now
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
|---|
ClackComponent.Waiter |
| Field Summary | |
|---|---|
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 | |
|---|---|
Capture(Router router,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
Looks at all packets sent through the component, and keeps a copy of the packet if it is supposed to be capturing the packet, then passes the packet on. |
VNSEthernetPacket |
encapPacket(VNSPacket packet)
Encapusulates a VNSPacket with fake header layers so that TCPDump can make sense of it. |
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
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. |
void |
saveToFile(java.lang.String filename)
Writes all packets capture in the last capture sequence to the specified file |
protected void |
setupPorts(int numPorts)
Allocates an array of ClackPort objects to be used by this component |
void |
startCapture()
Signals that this component should begin capturing packets, but does not write them to file |
void |
stopCapture()
Ends capture process |
| 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, 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
| Constructor Detail |
|---|
public Capture(Router router,
java.lang.String name)
| Method Detail |
|---|
public void startCapture()
public void stopCapture()
public void saveToFile(java.lang.String filename)
throws java.lang.Exception
java.lang.Exceptionprotected void setupPorts(int numPorts)
ClackComponent
setupPorts in class ClackComponentnumPorts - the number of ports to createpublic boolean isModifying()
ClackComponent
isModifying in class ClackComponent
public void acceptPacket(VNSPacket packet,
int port_number)
Looks at all packets sent through the component, and keeps a copy of the packet if it is supposed to be capturing the packet, then passes the packet on.
acceptPacket in class ClackComponentpacket - The pushed packetport_number - The number of the port that this packet is arriving on
public VNSEthernetPacket encapPacket(VNSPacket packet)
throws java.lang.Exception
Encapusulates a VNSPacket with fake header layers so that TCPDump can make sense of it.
Assumes that the provided packet is TCP, UDP, or Ethernet.
java.lang.Exceptionpublic javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView in class ClackComponentpublic java.awt.Color getColor()
ClackComponentThe color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer class.
Other renderers may ignore this value.
getColor in class ClackComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||