|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
simnet.Node
The abstract base class for all Nodes.
| Field Summary | |
(package private) java.util.Hashtable |
applications
A Hashtable that holds all Application objects keyed by their unique IDs |
(package private) boolean |
default_plugins_loaded
Whether or not the default plugins have been loaded. |
(package private) SimnetWindow |
frame
The window frame |
(package private) boolean |
frozen
Global state variable that is set when the Node is in frozen state. |
int |
id
The unique ID of this Node (IP address) |
protected java.util.Hashtable |
in_filters
A Hashtable that holds all incoming IPFilters keyed by their unique IDs |
protected java.util.Hashtable |
in_links
A Hashtable that holds all incoming Links keyed by their unique IDs |
(package private) int |
ipid
Global counter that keeps track of the value previously used for an IP packet' s IP ID field. |
boolean |
isNatted
|
(package private) boolean |
keep_going
When being plugged out, this will be set to false, so that this node's thread can stop running. |
java.lang.String |
name
The name of this Node |
(package private) NATRouter |
natGW
|
(package private) NodeStatistics |
ns
Tracking packet statistics |
protected java.util.Hashtable |
out_filters
A Hashtable that holds all outgoing IPFilters keyed by their unique IDs |
protected java.util.Hashtable |
out_links
A Hashtable that holds all outgoing Links keyed by their unique IDs |
(package private) boolean |
pause
Global state variable that is set when the Node is in pause state. |
(package private) LinkProcessor |
proc
This Node' s LinkProcessor. |
protected java.util.Random |
random
A random number generator |
Resolver |
resolver
The resolver for this node. |
(package private) RoutingTable |
routing_table
The routing table for this node. |
(package private) boolean |
running
Global state variable that is set when the Node is in running state. |
protected Simulator |
sim
The Simulator (Simulator.getSim()) |
(package private) boolean |
sleeping
Global state variable that is set when the Node is in sleeping state. |
(package private) java.util.Hashtable |
transports
A Hashtable that holds all Transport objects keyed by their unique IDs |
protected UserInterface |
ui
The User Interface (UserInterface.getUI()) |
(package private) boolean |
win
Keeps track of whether an output window has been opened |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Node()
|
|
| Method Summary | |
void |
addBPF(BPF bpf,
int direction,
int link_id)
Adds the specified BPF rule to the IPFilter associated with the specified Link. |
void |
addLink(int direction,
Link link)
Adds the specified Link to this Node's link table. |
void |
addRule(Rule rule,
int direction,
int link_id)
Adds the specified firewall rule to the IPFilter associated with the specified Link. |
void |
clear()
Clears all of this Node' s stats |
void |
closeWindow()
Close this node's window (if it is open). |
boolean |
command(java.lang.Object target,
java.lang.String command,
java.lang.Object[] args)
Invoke the method command on the object target with the given arguments. |
boolean |
command(java.lang.String command,
java.lang.Object[] args)
Attempts to invoke the specified command with the specified arguments by searching through all this Node's Applications, Transports, Link Processor, Routing Table, Resolver, and the Node itself. |
void |
deleteRule(int rule_id,
int direction,
int link_id)
Removes the specified firewall rule from the IPFilter associated with the specified Link. |
boolean |
empty(java.util.Hashtable link_table)
Determines whether the specified Links are empty or not. |
protected void |
finalize()
For debugging. |
protected abstract void |
forward(IP_Packet ip_packet)
Forwards incoming IP packets to the appropriate transport protocol (after stripping the IP header). |
Application |
getApplication(int pid)
Returns the Application with the specified (unique) Process ID. |
int |
getHostByName(java.lang.String host)
Looks up the ip for this host using the resolver. |
Link |
getLink(int to_id)
Returns the Link whose To node is specified by the given Node ID. |
abstract int |
getNodeClass()
Returns the class of this Node (either Router or Host) |
int |
getPluginCount()
Returns the number of plugins that are loaded on this node. |
java.lang.String |
getTitleString()
Returns the title that currently describes the state of the node or application that this window is for. |
Transport |
getTransport(int tid)
Returns the Transport with the specified unique ID. |
Transport |
getTransport(java.lang.String trans)
Returns the Transport with the specified name. |
void |
initialize(int node_id,
java.lang.String node_name)
Initializes a new Node by setting its ID, name and a pointer to the Simulator, all to the specified values. |
void |
integrate()
Integrate this node by enabling all of its links. |
void |
isolate()
Isolate this node by disabling all of its links. |
void |
kill()
Pauses this Node's thread |
java.lang.String |
lookup(int nid)
Determines the name of the Node with the specified ID. |
int |
lookup(java.lang.String name)
Determines the ID of the Node with the specified name. |
boolean |
out(int dest,
Packet packet)
Adds IP and Frame headers to outgoing Transport packets before enqueing them on the appropriate Link. |
boolean |
prePlugout(java.lang.Object replacement)
To be replaced, stop our thread; to be removed, remove links and then stop the thread. |
void |
printout(int level,
int src,
java.lang.String msg)
To make the old code compile (temporary) |
void |
printout(java.lang.String category,
int level,
int src,
java.lang.String message)
Prints the specified message if the current verbosity level is equal to or higher than the specified level and the specified category should be shown. |
void |
processWindowCommand(java.lang.String text)
The command text has been input in the window. |
void |
removeBPF(BPF bpf,
int direction,
int link_id)
Removes the specified BPF rule from the IPFilter associated with the specified Link. |
boolean |
removeLink(int direction,
int other)
Removes the specified Link in this Node's link table. |
void |
run()
Wait for packets, and forward them. |
void |
setupNAT(NATRouter natGW)
Set a flag so we know that we are natted, and a pointer to our gateway. |
void |
start()
Starts this Node' s thread |
void |
stateful_kill()
Starts this Node' s thread if it is not running. |
void |
stateful_start()
Pauses this Node' s thread if it is running. |
private java.lang.String |
tabularize(java.lang.String string)
Inserts tabs in a string (is this used?). |
java.lang.String |
toString()
Returns a string with information about this Node. |
java.lang.String |
toString(int type)
Returns a string with information about this Node The type determines the kind of information returned: 0 - all 1 - loaded plugins 2 - link information 3 - firewall rules |
void |
window()
Starts an Individual Interface Window (IIW) associated with this node. |
| 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, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int id
public java.lang.String name
protected Simulator sim
protected UserInterface ui
protected java.util.Hashtable in_filters
protected java.util.Hashtable out_filters
protected java.util.Hashtable in_links
protected java.util.Hashtable out_links
LinkProcessor proc
RoutingTable routing_table
public Resolver resolver
java.util.Hashtable transports
java.util.Hashtable applications
protected java.util.Random random
NodeStatistics ns
boolean running
boolean pause
boolean sleeping
boolean frozen
transient boolean keep_going
int ipid
public boolean isNatted
NATRouter natGW
boolean default_plugins_loaded
SimnetWindow frame
boolean win
| Constructor Detail |
public Node()
| Method Detail |
public abstract int getNodeClass()
public void setupNAT(NATRouter natGW)
natGW - The node who assigned us an ip.
public void initialize(int node_id,
java.lang.String node_name)
node_id - this Node's unique IDnode_name - this Node' s namepublic void start()
public void run()
run in interface java.lang.Runnableprotected abstract void forward(IP_Packet ip_packet)
ip_packet - incoming IP packet to be forwardedpublic int getHostByName(java.lang.String host)
public void kill()
public boolean out(int dest,
Packet packet)
dest - destination Nodepacket - outgoing Transport packet
public void addLink(int direction,
Link link)
direction - specifies whether the Link should be added
to the incoming link table (Simnet.IN) or the outgoing link
table (Simnet.OUT)link - the Link object to add
public boolean removeLink(int direction,
int other)
direction - specifies whether the Link should be added
to the incoming link table (Simnet.IN) or the outgoing link
table (Simnet.OUT)other - the id (IP) of the other end of the link to remove
public void isolate()
public void integrate()
public void addRule(Rule rule,
int direction,
int link_id)
rule - the firewall rule to adddirection - specifies whether the link is incoming (Simnet.IN)
or outgoing (Simnet.OUT)link_id - specifies the ID of the Link to which the rule
should be added
public void deleteRule(int rule_id,
int direction,
int link_id)
rule_id - the ID of the firewall rule to removedirection - specifies whether the link is incoming (Simnet.IN)
or outgoing (Simnet.OUT)link_id - specifies the ID of the Link from which the rule
should be removed
public void addBPF(BPF bpf,
int direction,
int link_id)
bpf - the bpf rule to adddirection - specifies whether the link is incoming (Simnet.IN)
or outgoing (Simnet.OUT)link_id - the ID of the Link. Here the ID of the Link really refers to
the ID of the Node it connects to (on the other end). This is confusing since
Links actually have their own IDs...
public void removeBPF(BPF bpf,
int direction,
int link_id)
bpf - the ID of the firewall rule to removedirection - specifies whether the link is incoming (Simnet.IN)
or outgoing (Simnet.OUT)link_id - ...public void stateful_kill()
public void stateful_start()
public boolean command(java.lang.String command,
java.lang.Object[] args)
command - the command to invokeargs - the command' s arguments
public boolean command(java.lang.Object target,
java.lang.String command,
java.lang.Object[] args)
public Transport getTransport(int tid)
tid - the Transport' s ID
public Transport getTransport(java.lang.String trans)
trans - the Transport' s name
public Application getApplication(int pid)
pid - the Application's Process ID
public Link getLink(int to_id)
to_id - the ID of the Link' s To Node
public java.lang.String lookup(int nid)
nid - the Node' s ID
public int lookup(java.lang.String name)
name - the Node' s name
public void clear()
public boolean empty(java.util.Hashtable link_table)
link_table - a link table
public void window()
public java.lang.String getTitleString()
getTitleString in interface SimnetWindowListenerpublic void closeWindow()
closeWindow in interface SimnetWindowListenerpublic void processWindowCommand(java.lang.String text)
processWindowCommand in interface SimnetWindowListener
public void printout(java.lang.String category,
int level,
int src,
java.lang.String message)
category - the category of the messagelevel - the verbosity level of the messagesrc - the ID of the source Node of the messagemessage - the error message
public void printout(int level,
int src,
java.lang.String msg)
public java.lang.String toString()
public java.lang.String toString(int type)
type - determines the kind of information to return
private java.lang.String tabularize(java.lang.String string)
string - string to format
public int getPluginCount()
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggableprotected void finalize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||