|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
verinec.importer.analysis.AnalysisThread
public class AnalysisThread
A thread to run sniffing, traceroute and portscans from
| Nested Class Summary | |
|---|---|
class |
AnalysisThread.AnalyserStatus
This Klass allows the store the actual state of the sniffing, traceroutes, host lookups and the scanning. |
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected AnalysisThread.AnalyserStatus |
analysisState
The object which store the state of the tasks |
protected Logger |
log
For logging. |
private StartLookUpHost |
lookUpHosts
The starter of the loolups for the host names |
private int |
lookUpHostsMaxSynchronousThread
The number of maximum synchronous host look ups |
private long |
numUnknownHosts
this variable is needed to destinquish unknown hosts and to number them |
private AnalysisConfigPanel |
panel
Reference to the panel holding the configuration. |
private HostCommRenderer |
root
The root, ie the host where this application is running |
private Hashtable |
sniffingResult
Map of host information: ip->HostCommRenderer. |
private Hashtable |
studioResult
The Nodes which are allready in the Studio |
(package private) Hashtable |
trResult
The same structure to save the traces like it is used to save the host form the sniffing |
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AnalysisThread(AnalysisConfigPanel panel)
|
|
| Method Summary | |
|---|---|
private int |
calcNifPos(HostCommRenderer r,
HostCommRenderer c)
Compute the position of a network interface. |
private PCNode |
createPCNode(HostCommRenderer host)
Convert the data of a HostCommRenderer to a PCNode. |
AnalysisThread.AnalyserStatus |
getAnalysisState()
Fetch the object, where the actual analysis state is stored. |
private NwInterface |
getClientNetworkInterface(String ip,
PCNode pc)
Get the network inteface which was detected by the traceroute |
private NwInterface |
getNetworkInterfaceFormPCNode(String ip,
PCNode pc)
Get a network interface (NwInterface) with a specified ip form a PCNode. |
protected AnalysisConfigPanel |
getPanel()
Fetch the main panel of the importer dialog. |
HostCommRenderer |
getRoot()
Fetch the root, i.e. the host where verinec is running. |
private NwInterface |
getRootNetworkInterface(String ip,
PCNode pc)
Get the network inteface which wasn't detected by the traceroute |
private VerinecStudio |
getStudio()
Fetch the verinec studio. |
private void |
initPositionsForStudio()
This method starts the computation of the postions for the nodes in the studion. |
void |
lookUpHostName(HostCommRenderer host)
Look up the host name of a HostCommRenderer. |
void |
lookUpHostUpdate(int tasksCount,
int finishedTasks)
Update the state the look ups for the host names. |
void |
printMessage(String m)
Print a message. |
private PCNode |
return2Analyser_createNodes(HostCommRenderer r,
Element nodes)
This method returns the found hosts to the studio if the traceroutes where used. |
private void |
return2Analyser()
This method returns the found hosts to the studio. |
void |
run()
Check settings and run sniffing, traceroute and portscans. |
void |
scanUpdateState()
Update the status of the scans. |
private void |
setPositionsForStudio(HostCommRenderer r,
int radius,
double alpha,
double sector,
int parentX,
int parentY)
The computation of a node's postion in the stuido. |
void |
sniffingAddToResult(String ip,
HostCommRenderer host)
Add a host to the sniffing result. |
HostCommRenderer |
sniffingGetHost(String ip)
Get the host renderer for an ip. |
Hashtable |
sniffingGetResult()
Fetch the result of the sniffing. |
void |
sniffingInitState(int id,
int mode,
long count)
Initialize the state for the sniffing. |
void |
sniffingPrintResult()
Print all the results of the sniffing, ie every host which was found. |
void |
sniffingUpdateState(int id)
Update the actual state of the sniffing. |
protected void |
sniffStep()
|
private void |
sortTreeData(HostCommRenderer r)
Sort a subtree, i.e. this methode arrange the childs of a node in a way, so that a child with a lot of children is followed by one with only a few. |
PCNode |
studioGetHost(String ip)
Try to get the HostCommRenderer of an ip from the studio result. |
Element |
studioGetHostFromReprository(HostCommRenderer host)
This method makes a lookup of a host in the reprository of the studio, to test if this one was allready found and safed in the studio. |
Hashtable |
studioGetResult()
Fetch the result of the studio, ie the pcnodes which are in the gui. |
private void |
studioInitResult()
Load and save the Nodes from the Studio to provide fast and easy access for tests. |
boolean |
studioIsHostInStudio(HostCommRenderer host)
Tests if a host is found in the studio. |
static boolean |
testAccessRights()
This method tests if the user has sufficent rights for capturing, that is if he can set the device into promiscious mode. |
protected void |
traceStep()
Perform the trace step. |
void |
trAddToResult(String ip,
HostCommRenderer host)
Add a new host to the traceroute result. |
void |
trAddToResult(Vector hops,
HostCommRenderer target)
Add a vector of ips to the traceroute result and create the tree structure. |
HostCommRenderer |
trGetHost(String ip)
Try to get the HostCommRenderer of an ip from the traceroute result. |
void |
trPrintResult()
Print the whole result form the traceroutes to the standart output |
void |
trUpdateState()
Update the state of the Traceroutes. |
private boolean |
trWasExecuted()
It tests if the traceroutes where executed. |
void |
updateState()
Update the display of the actual analysis state. |
| 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 |
|---|
protected Logger log
protected AnalysisThread.AnalyserStatus analysisState
private final AnalysisConfigPanel panel
private Hashtable sniffingResult
sniffingGetHost(java.lang.String) to report found hosts.
Hashtable trResult
private Hashtable studioResult
private int lookUpHostsMaxSynchronousThread
private HostCommRenderer root
private StartLookUpHost lookUpHosts
private long numUnknownHosts
| Constructor Detail |
|---|
public AnalysisThread(AnalysisConfigPanel panel)
panel - The configuration panel instance.| Method Detail |
|---|
public void run()
Performed when the run button is clicked:
run in interface Runnablerun in class Threadprotected void sniffStep()
public HostCommRenderer sniffingGetHost(String ip)
ip - The ip in string representation.
public Hashtable sniffingGetResult()
public void sniffingAddToResult(String ip,
HostCommRenderer host)
ip - The ip of the host.host - The HostCommRenderer which was created by the sniffer.public void sniffingUpdateState(int id)
id - The id of the task, which progressed.
public void sniffingInitState(int id,
int mode,
long count)
id - The id of the task.mode - The mode of sniffing, eg TIMEcount - The number of packages or the time period in sec.public void sniffingPrintResult()
public void lookUpHostUpdate(int tasksCount,
int finishedTasks)
tasksCount - The number of all tasks which were started.finishedTasks - The number of finished look ups.public void lookUpHostName(HostCommRenderer host)
host - The host, whose name shoul be resolved.
protected void traceStep()
throws TraceRouteException
TraceRouteException - if something fails.public HostCommRenderer trGetHost(String ip)
ip - The ip of the desired host
public void trAddToResult(String ip,
HostCommRenderer host)
ip - The ip of the new host.host - The HostCommRenderer of the new host.private void studioInitResult()
public Hashtable studioGetResult()
public PCNode studioGetHost(String ip)
ip - The ip of the desired host
public void trAddToResult(Vector hops,
HostCommRenderer target)
hops - A Vector of ips as string representation.target - The target host, which was found by the sniffer.public void trUpdateState()
private boolean trWasExecuted()
public void trPrintResult()
public void scanUpdateState()
private void return2Analyser()
AnalysisConfigPanel.DEBUG is true, creates a file in java.io.tmpdir named
scan_results.xml for debugging purposes.
private PCNode return2Analyser_createNodes(HostCommRenderer r,
Element nodes)
r - The renderer to returnnodes - The parent element for the node
private NwInterface getRootNetworkInterface(String ip,
PCNode pc)
ip - The ip of the desired network inteface.pc - The owner host.
private NwInterface getClientNetworkInterface(String ip,
PCNode pc)
ip - The ip of the desired network inteface.pc - The owner host.
private NwInterface getNetworkInterfaceFormPCNode(String ip,
PCNode pc)
ip - The desired ip.pc - The PCNode which may own the desired network interface.
private PCNode createPCNode(HostCommRenderer host)
host - A HostCommRenderer with host data to be converted to XML.
private int calcNifPos(HostCommRenderer r,
HostCommRenderer c)
r - The parent Node, i.e. this node is closer to the root than the other.c - The child Node.
private void initPositionsForStudio()
private void setPositionsForStudio(HostCommRenderer r,
int radius,
double alpha,
double sector,
int parentX,
int parentY)
r - The node, which postion should be computed.radius - The actual radius of the circle.alpha - The actual start angle.sector - The sector which can be used to place the node.parentX - The x positon of the parent node.parentY - The y positon of the parent node.private void sortTreeData(HostCommRenderer r)
r - The root node of the subtree, which should be sorted.private VerinecStudio getStudio()
public boolean studioIsHostInStudio(HostCommRenderer host)
host - The host, which should be locked up.
public Element studioGetHostFromReprository(HostCommRenderer host)
host - The host, which should be locked up.
public static boolean testAccessRights()
public HostCommRenderer getRoot()
protected AnalysisConfigPanel getPanel()
public AnalysisThread.AnalyserStatus getAnalysisState()
public void updateState()
public void printMessage(String m)
m - The message to desplay.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||