SSF.OS.BGP4.Policy
Class Rule

java.lang.Object
  |
  +--SSF.OS.BGP4.Policy.Rule

public class Rule
extends java.lang.Object

This class captures the notion of a policy rule used for BGP route filtering.


Constructor Summary
Rule()
          Constructs a default policy rule which denies all routes.
Rule(java.util.ArrayList clauselist)
          Constructs the policy rule with the given clauses.
Rule(boolean permit)
          Constructs a policy rule to either deny all routes or permit all routes.
 
Method Summary
 void add_clause(Clause c)
          Adds a clause to the policy rule at the end of the list.
 boolean apply_to(Route r)
          Applies the policy rule to the given route, determining whether it will be denied or permitted, and applying any desired attribute manipulation on those which are permitted.
 java.lang.String toString()
          Puts the rule into string form suitable for output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(boolean permit)
Constructs a policy rule to either deny all routes or permit all routes. The rule will contain no actions.

Parameters:
permit - Whether to permit all routes or deny all routes.

Rule

public Rule()
Constructs a default policy rule which denies all routes. Because failure to match any clauses in a policy rule implies denial, we need only have zero clauses.


Rule

public Rule(java.util.ArrayList clauselist)
Constructs the policy rule with the given clauses.

Method Detail

add_clause

public void add_clause(Clause c)
Adds a clause to the policy rule at the end of the list.


apply_to

public boolean apply_to(Route r)
Applies the policy rule to the given route, determining whether it will be denied or permitted, and applying any desired attribute manipulation on those which are permitted.

Returns:
whether or not to permit the route

toString

public java.lang.String toString()
Puts the rule into string form suitable for output.

Overrides:
toString in class java.lang.Object
Returns:
the rule in string form