|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsimnet.IPFilter
simnet.SimpleFilter
A simple implementation of a set of rules and BPF filters. Rules are run in order by number until a match is found, and the allow/deny of that rule determines action. For packets that are allowed, all BPFs are run on them.
| Field Summary | |
Vektor |
bpfs
The Vector that holds this Filter' s BPF rules |
private java.util.Hashtable |
removeHash
|
java.util.TreeSet |
rules
This Filer' s rule list |
| Fields inherited from class simnet.IPFilter |
id |
| Constructor Summary | |
SimpleFilter()
|
|
| Method Summary | |
void |
addBPF(BPF bpf)
Adds the specified BPF rule to the BPF table. |
void |
addRule(int rule_id,
int action,
int protocol,
int src_id,
int dest_id,
int dest_port)
Adds a rule with the specified fields to this Filter's rule list. |
void |
addRule(Rule rule)
Adds the specified rule to this Filter' s rule list. |
boolean |
in(IP_Packet ipp)
Processes incoming IP packets by checking them against each Rule in increasing order of their IDs. |
void |
initialize(int filter_id)
Initializes a new SimpleFilter by initializing its ID and default rules. |
boolean |
prePlugout(java.lang.Object replacement)
No special cleanup is needed. |
void |
removeBPF(BPF bpf)
Removes the specified BPF rule from the BPF table. |
void |
removeRule(int rid)
Removes the Rule with the specified ID from the rule list. |
java.lang.String |
toString()
Returns a String listinag all of this Filter's Rules. |
| Methods inherited from class simnet.IPFilter |
finalize |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public java.util.TreeSet rules
public Vektor bpfs
private java.util.Hashtable removeHash
| Constructor Detail |
public SimpleFilter()
| Method Detail |
public void initialize(int filter_id)
initialize in class IPFilterfilter_id - the ID of this filterpublic boolean in(IP_Packet ipp)
in in class IPFilteripp - the incoming IP packet
public void addRule(Rule rule)
addRule in class IPFilterrule - the rule to add
public void addRule(int rule_id,
int action,
int protocol,
int src_id,
int dest_id,
int dest_port)
addRule in class IPFilterrule_id - the unique ID of this Ruleaction - the action to take when a packet has been matched (either
Simnet.ALLOW or Simnet.DENY)protocol - the Rule' s protocolsrc_id - the Rule' s source Nodedest_id - the Rule's destination Nodedest_port - the Rule' s destination portpublic void removeRule(int rid)
removeRule in class IPFilterrid - The Rule's IDpublic void addBPF(BPF bpf)
addBPF in class IPFilterbpf - the BPF rule to addpublic void removeBPF(BPF bpf)
removeBPF in class IPFilterbpf - the BPF rule to removepublic java.lang.String toString()
public boolean prePlugout(java.lang.Object replacement)
prePlugout in interface Pluggable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||