simnet
Class FilterRouter

java.lang.Object
  extended byjava.lang.Thread
      extended bysimnet.Node
          extended bysimnet.Router
              extended bysimnet.FilterRouter
All Implemented Interfaces:
Pluggable, java.lang.Runnable, SimnetWindowListener

public class FilterRouter
extends Router

A router that implements ingress and egress filtering on all inbound links. Note that the ingress/egress filters may be manually removed after a link is added.


Field Summary
static int FILTER_BASE_RULE
          The ID to start creating filtering rules at.
 
Fields inherited from class simnet.Router
fixed_bits
 
Fields inherited from class simnet.Node
applications, default_plugins_loaded, frame, frozen, id, in_filters, in_links, ipid, isNatted, keep_going, name, natGW, ns, out_filters, out_links, pause, proc, random, resolver, routing_table, running, sim, sleeping, transports, ui, win
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FilterRouter()
           
 
Method Summary
 void addLink(int direction, Link link)
          Add a link and then add the appropriate filter rules for it (inbound links only).
protected  void filterExternal(int from)
          Add filter rules for an external node.
protected  void filterInternal(int from)
          Add filter rules for an internal node.
 void initialize(int node_id, java.lang.String node_name)
          Initialize like a normal router, and then add filter rules for all existing (inbound) links.
 
Methods inherited from class simnet.Router
forward, getFixedBits, getNodeClass, setFixedBits
 
Methods inherited from class simnet.Node
addBPF, addRule, clear, closeWindow, command, command, deleteRule, empty, finalize, getApplication, getHostByName, getLink, getPluginCount, getTitleString, getTransport, getTransport, integrate, isolate, kill, lookup, lookup, out, prePlugout, printout, printout, processWindowCommand, removeBPF, removeLink, run, setupNAT, start, stateful_kill, stateful_start, toString, toString, 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, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER_BASE_RULE

public static final int FILTER_BASE_RULE
The ID to start creating filtering rules at.

See Also:
Constant Field Values
Constructor Detail

FilterRouter

public FilterRouter()
Method Detail

initialize

public void initialize(int node_id,
                       java.lang.String node_name)
Initialize like a normal router, and then add filter rules for all existing (inbound) links.

Overrides:
initialize in class Router
Parameters:
node_id - ID of new node
node_name - name of new node

addLink

public void addLink(int direction,
                    Link link)
Add a link and then add the appropriate filter rules for it (inbound links only).

Overrides:
addLink in class Node
Parameters:
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

filterInternal

protected void filterInternal(int from)
Add filter rules for an internal node.


filterExternal

protected void filterExternal(int from)
Add filter rules for an external node.