de.fhkl.zw.mkup.rattrap.localizer.tools
Class TracertWrapper

java.lang.Object
  extended by de.fhkl.zw.mkup.rattrap.localizer.tools.TracertWrapper

public class TracertWrapper
extends java.lang.Object

TracertWrapper is a wrapper around the common traceroute program that exists on many operating systems. In Windows, the program is called tracert. Surprisingly the Unix program name is longer. It is traceroute.

Version:
1.0 31 Aug 1998
Author:
Terrence Truta

Field Summary
static int MAX_HOPS
           
 
Constructor Summary
TracertWrapper()
           
TracertWrapper(java.lang.String host)
           
 
Method Summary
 void execute()
          Builds the command line string to execute traceroute depending on the operating system.
 ChartData getChartData()
          Returns the data that was collected running traceroute.
static void main(java.lang.String[] args)
          Test driver for this class.
 void parseUnixOutput(java.io.BufferedReader in)
          Parse the output of the traceroute program in Unix.
 void parseWin95Output(java.io.BufferedReader in)
          Parses the output of the tracert program in Windows 95.
 void setAddress(java.lang.String addr)
          Sets the address to perform the traceroute to.
 void setProgressIncr(int progress)
          Sets the amount that the progress bar will be updated after each line of traceroute output.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_HOPS

public static final int MAX_HOPS
See Also:
Constant Field Values
Constructor Detail

TracertWrapper

public TracertWrapper(java.lang.String host)

TracertWrapper

public TracertWrapper()
Method Detail

setAddress

public void setAddress(java.lang.String addr)
Sets the address to perform the traceroute to.


setProgressIncr

public void setProgressIncr(int progress)
Sets the amount that the progress bar will be updated after each line of traceroute output.


getChartData

public ChartData getChartData()
Returns the data that was collected running traceroute.

See Also:
ChartData

main

public static void main(java.lang.String[] args)
Test driver for this class.


execute

public void execute()
Builds the command line string to execute traceroute depending on the operating system. After execution it creates a BufferedReader object and calls the appropriate method to parse the output depending on the OS.


parseWin95Output

public void parseWin95Output(java.io.BufferedReader in)
Parses the output of the tracert program in Windows 95. It will probably work with Windows NT but it hasn't been tested in that environment.


parseUnixOutput

public void parseUnixOutput(java.io.BufferedReader in)
Parse the output of the traceroute program in Unix. Also works in Linux. This is more complex than the output of the win95 version. Miraculously it works too!