simnet
Class IPFilter

java.lang.Object
  extended bysimnet.IPFilter
Direct Known Subclasses:
SimpleFilter

public abstract class IPFilter
extends java.lang.Object

Maintain a set of Rules and BPF Filters for a link.


Field Summary
 int id
          Filter ID
 
Constructor Summary
IPFilter()
           
 
Method Summary
abstract  void addBPF(BPF bpf)
          Adds the specified BPF rule to this IPFilter.
abstract  void addRule(int rule_id, int action, int protocol, int src_id, int dest_id, int dest_port)
          Adds a firewall rule matching the specified criterias to this IPFilter.
abstract  void addRule(Rule rule)
          Adds the specified firewall rule to this IPFilter.
protected  void finalize()
          For debugging
abstract  boolean in(IP_Packet ipp)
          Processes incoming IP packets from the IP stack This is an abstract class that must be implemented by every IPFilter.
abstract  void initialize(int filter_id)
          Initializes a new IPFilter by setting its ID.
abstract  void removeBPF(BPF bpf)
          Removes the specified BPF rule from this IPFilter.
abstract  void removeRule(int rid)
          Removes the firewall rule with the specified ID from this IPFilter.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public int id
Filter ID

Constructor Detail

IPFilter

public IPFilter()
Method Detail

initialize

public abstract void initialize(int filter_id)
Initializes a new IPFilter by setting its ID. This is an abstract class that must be implemented by every IPFilter.

Parameters:
filter_id - the filter' s ID

in

public abstract boolean in(IP_Packet ipp)
Processes incoming IP packets from the IP stack This is an abstract class that must be implemented by every IPFilter.

Parameters:
ipp - incoming data

addRule

public abstract void addRule(Rule rule)
Adds the specified firewall rule to this IPFilter. This is an abstract class that must be implemented by every IPFilter.

Parameters:
rule - the firewall rule to add

addRule

public abstract void addRule(int rule_id,
                             int action,
                             int protocol,
                             int src_id,
                             int dest_id,
                             int dest_port)
Adds a firewall rule matching the specified criterias to this IPFilter. This is an abstract class that must be implemented by every IPFilter.

Parameters:
rule_id - the ID of the firewall rule to add
action - the action to take on a matching packet. Either Simnet.DENY or Simnet.ALLOW
protocol - the protocol to match
src_id - the source ID to match
dest_id - the destination ID to match
dest_port - the destination port to match

removeRule

public abstract void removeRule(int rid)
Removes the firewall rule with the specified ID from this IPFilter. This is an abstract class that must be implemented by every IPFilter.

Parameters:
rid - ID of the firewall rulee to add

addBPF

public abstract void addBPF(BPF bpf)
Adds the specified BPF rule to this IPFilter. This is an abstract class that must be implemented by every IPFilter.

Parameters:
bpf - the bpf rule to add

removeBPF

public abstract void removeBPF(BPF bpf)
Removes the specified BPF rule from this IPFilter. This is an abstract class that must be implemented by every IPFilter.

Parameters:
bpf - the bpf rule to add

finalize

protected void finalize()
For debugging