|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
simnet.Application
simnet.PacketDump
An application that will record specified types of packets to a file.
| Field Summary | |
protected static int |
count
|
(package private) java.io.FileOutputStream |
fos
The output stream to this Node' s log file |
(package private) BPF |
inbpf
The BPF rule used to capture incoming packets |
protected static int |
maxLen
How much of the data of a TCP/UDP packet to include in the dump (<=0 means all). |
(package private) BPF |
outbpf
The BPF rule used to capture outgoing packets |
| Fields inherited from class simnet.Application |
appid, appstart, frame, initialized, node, NODE_ID, pid, random, sim, win |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
PacketDump()
|
|
| Method Summary | |
void |
dump(java.lang.Integer src,
java.lang.Integer dest)
Logs all packets matching the specified source and destination to a log file by initializing appropriate BPF rules and the log file. |
void |
dump(java.lang.Integer src,
java.lang.Integer src_fb,
java.lang.Integer dest,
java.lang.Integer dest_fb)
|
void |
dump(int src,
int dest)
Logs all packets matching the specified source and destination to a log file by initializing appropriate BPF rules and the log file. |
void |
dump(int src,
int src_fb,
int dest,
int dest_fb)
new version of dump constructor that uses fixed bits; new rules overwrites old ones. |
void |
dump(java.lang.String src,
java.lang.Integer src_fb,
java.lang.String dest,
java.lang.Integer dest_fb)
|
void |
dump(java.lang.String src,
int src_fb,
java.lang.String dest,
int dest_fb)
|
void |
dump(java.lang.String src,
java.lang.String dest)
Logs all packets matching the specified source and destination to a log file by initializing appropriate BPF rules and the log file. |
java.lang.String |
fix(int num,
int len)
Returns a string representation of num with leading zeros. |
static java.lang.String |
getIPString(int ip)
|
static int |
getMaxDataLen()
|
static int |
getNextID()
|
void |
inBPF(int bpf_id,
IP_Packet ipp)
Processes incoming IP packets from the previously loaded BPF rule and outputs header information to the log file. |
boolean |
prePlugout(java.lang.Object replacement)
If another packet dumper is being plugged in, keep the file open and let the BPF's transfer to our replacement; otherwise, remove the BPF rules and close the file. |
static void |
setMaxDataLen(int i)
|
static void |
setMaxDataLen(java.lang.Integer i)
|
void |
stopdump()
Stops the logging of all packets by removing the previously loaded BPF rules. |
| Methods inherited from class simnet.Application |
closeWindow, customInit, finalize, getTitleString, initialize, plugoutNotification, printout, printout, processWindowCommand, rawOut, run, window |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static int count
protected static int maxLen
java.io.FileOutputStream fos
BPF inbpf
BPF outbpf
| Constructor Detail |
public PacketDump()
| Method Detail |
public static int getNextID()
public static int getMaxDataLen()
public static void setMaxDataLen(java.lang.Integer i)
public static void setMaxDataLen(int i)
public void dump(java.lang.Integer src,
java.lang.Integer dest)
src - the packet sourcedest - the packet destination
public void dump(java.lang.Integer src,
java.lang.Integer src_fb,
java.lang.Integer dest,
java.lang.Integer dest_fb)
public void dump(java.lang.String src,
java.lang.Integer src_fb,
java.lang.String dest,
java.lang.Integer dest_fb)
public void dump(java.lang.String src,
int src_fb,
java.lang.String dest,
int dest_fb)
public void dump(java.lang.String src,
java.lang.String dest)
src - the packet sourcedest - the packet destination
public void dump(int src,
int dest)
src - the packet sourcedest - the packet destination
public void dump(int src,
int src_fb,
int dest,
int dest_fb)
public void stopdump()
public java.lang.String fix(int num,
int len)
public static java.lang.String getIPString(int ip)
public void inBPF(int bpf_id,
IP_Packet ipp)
inBPF in interface BPFConsumerbpf_id - the ID of the BPF rule that the ip_packet matchedipp - incoming IP packetpublic boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||