simnet
Class Traceroute

java.lang.Object
  extended byjava.lang.Thread
      extended bysimnet.Application
          extended bysimnet.Traceroute
All Implemented Interfaces:
BPFConsumer, Pluggable, PlugoutListener, java.lang.Runnable, SimnetWindowListener

public class Traceroute
extends Application
implements BPFConsumer, Pluggable

An application that performs traceroutes.


Field Summary
private  BPF bpf
           
private  int last_ipid
          The ipid of the last packet we sent out
private  boolean noresponse
          Variable that is set when no ICMP Time Exceeded response is received
private  int resp_src
          the source of the response
private  boolean running
           
 
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
Traceroute()
           
 
Method Summary
protected  boolean check(ICMP_Packet icmpp)
          Check if this packet was in response to our last packet.
 void inBPF(int bpf_id, IP_Packet ip_packet)
          Processes incoming IP packets from the previously loaded BPF rule.
 boolean prePlugout(java.lang.Object replacement)
          A traceroute application can only be removed if it is not currently tracerout'ing
 void tr(java.lang.Integer dest)
          Performs a traceroute to the specified Node.
 void tr(java.lang.String destination)
          Performs a traceroute to the specified Node.
 void traceroute(int dest)
          Performs a traceroute to the specified Node.
 void traceroute(java.lang.Integer destination)
          Performs a traceroute to the specified Node.
 void traceroute(java.lang.String destination)
          Performs a traceroute to the specified Node.
 
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

running

private boolean running

noresponse

private boolean noresponse
Variable that is set when no ICMP Time Exceeded response is received


resp_src

private int resp_src
the source of the response


bpf

private BPF bpf

last_ipid

private int last_ipid
The ipid of the last packet we sent out

Constructor Detail

Traceroute

public Traceroute()
Method Detail

tr

public void tr(java.lang.Integer dest)
Performs a traceroute to the specified Node. Same as traceroute(int) Called direcly from the UserInterface to provide an shorter traceroute command.

Parameters:
dest - the ID of destination node

tr

public void tr(java.lang.String destination)
Performs a traceroute to the specified Node. Same as traceroute(int) Called direcly from the UserInterface to provide an shorter traceroute command that takes Node names as argument.

Parameters:
destination - the ID of destination node

traceroute

public void traceroute(java.lang.String destination)
Performs a traceroute to the specified Node. Same as traceroute(int) Called direcly from the UserInterface to provide a traceroute command that takes Node names as argument.

Parameters:
destination - the ID of destination node

traceroute

public void traceroute(java.lang.Integer destination)
Performs a traceroute to the specified Node. Same as traceroute(int) Called direcly from the UserInterface to provide a traceroute command.

Parameters:
destination - the ID of destination node

traceroute

public void traceroute(int dest)
Performs a traceroute to the specified Node.

Parameters:
dest - the ID of destination node

prePlugout

public boolean prePlugout(java.lang.Object replacement)
A traceroute application can only be removed if it is not currently tracerout'ing

Specified by:
prePlugout in interface Pluggable
Returns:
if this object can now be removed (was the operation sucessful)

inBPF

public void inBPF(int bpf_id,
                  IP_Packet ip_packet)
Processes incoming IP packets from the previously loaded BPF rule.

Specified by:
inBPF in interface BPFConsumer
Parameters:
bpf_id - the ID of the BPF rule that the ip_packet matched
ip_packet - incoming IP packet

check

protected boolean check(ICMP_Packet icmpp)
Check if this packet was in response to our last packet.