|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
verinec.importer.analysis.AAnalyserTask
verinec.importer.analysis.sniffer.SnifferThread
public class SnifferThread
Captures packets on the specified network device.
An instance of this Class will be created for each device. It captures
the traffic on an interface and adds detected information to the list of
known hosts.
As there is only one global list of hosts, thus if we detect the a host with
the same IP on more than one interface, it will be considered the same host.
In redundant networks, this avoids duplicating hosts.
(If there are two different hosts with the same IP visible from our machine,
the network is in a very bad analysisState indeed.)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
private double |
count
Time in seconds or number of packets. |
private jpcap.NetworkInterface |
device
Device name to sniff. |
private double |
final_count
The number of packages or the time for the sniffing |
private int |
id
The identifier of this thread |
private Logger |
logger
The logger for this object |
private int |
mode
One of the modes defined in Configure. |
private StartSniffer |
startSniffer
Reference to the main application. |
private double |
t_start
The time when the execution of the sniffer starts |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
SnifferThread(jpcap.NetworkInterface device,
int mode,
long count,
StartSniffer startSniffer,
int id)
Create a new Sniffer. |
|
| Method Summary | |
|---|---|
void |
abortOperation()
Stop packet capturing on this interface. |
private void |
ARPTreatment(jpcap.packet.Packet packet)
Analyses an ARP Packet. |
private void |
ICMPTreatment(jpcap.packet.Packet packet)
Analyses an ICMP Packet. |
private void |
OtherIPTreatement(jpcap.packet.IPPacket packet)
Unrecognized IPPacket.. |
void |
packetArrived(jpcap.packet.Packet packet)
Depending on packet type, invokes the appropriate analysis. |
void |
run()
Configuring jpcap as defined in the ConfigPanel and sniff on the specified interface. |
private void |
sniff()
Stop packet capturing on this interface. |
private void |
TCPTreatment(jpcap.packet.TCPPacket packet)
Analyses a TCP packet. |
private void |
TCPUDPTreatement(jpcap.packet.IPPacket packet,
int srcPort,
int dstPort)
Common treatement for tcp and udp packets. |
private boolean |
testContinueSniffing()
|
private void |
UDPTreatement(jpcap.packet.UDPPacket packet)
Analyses a UDP packet. |
private void |
updateCount()
|
| Methods inherited from class verinec.importer.analysis.AAnalyserTask |
|---|
getStarter, printMessage, setStarter |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int mode
private jpcap.NetworkInterface device
private double count
private double final_count
private double t_start
private StartSniffer startSniffer
private Logger logger
private int id
| Constructor Detail |
|---|
public SnifferThread(jpcap.NetworkInterface device,
int mode,
long count,
StartSniffer startSniffer,
int id)
device - The interface to sniff on.mode - A mode defined in StartSniffer.ConfigPanel: TIME,PACKETS,SIMULATE.count - Time in seconds or number of packets.startSniffer - The sniffer common object.id - to report back to the sniffer common object.| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Thread
private void sniff()
throws IOException
IOException - if capturing is interrupted.private void updateCount()
private boolean testContinueSniffing()
public void packetArrived(jpcap.packet.Packet packet)
packet - The received packet.private void OtherIPTreatement(jpcap.packet.IPPacket packet)
packet - An arbitrary IP packet.private void TCPTreatment(jpcap.packet.TCPPacket packet)
packet - TCP packet to analyse.private void UDPTreatement(jpcap.packet.UDPPacket packet)
packet - UDP packet to analyse.
private void TCPUDPTreatement(jpcap.packet.IPPacket packet,
int srcPort,
int dstPort)
packet - The IP packet to analyse.srcPort - Source port the packet originates from.dstPort - Destination port the packet was addressed to.private void ARPTreatment(jpcap.packet.Packet packet)
packet - Packet to analyse.private void ICMPTreatment(jpcap.packet.Packet packet)
packet - Packet to analyse.public void abortOperation()
abortOperation in class AAnalyserTask
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||