Structured Editor

The expression editor displays the expression in terms of clauses. A clause is a set of fields with values specified. All the fields and values within a clause will be combined by the and operator in the final expression. For example, a clause with "Source Address" set to 192.168.1.1 and "Action" set to permit will match only packets with a source address of 192.168.1.1 that the configuration will permit. If a field value is not set, it is ignored and does not contribute to the expression.

Icons on the top editor tool bar perform a number of basic operations.

Editing Clauses

To set values in a clause, click on a field name. This will activate the associated value entry field to the right of the field name. Start typing in the value entry area. The Guided Editor will give you hints for proper values in hint popup windows. You can continue typing or select a hint from the popup window. See Guided Editor for more details on the editing mechanism. After completing a value, hit return. For most fields, you can enter multiple values. These values will be interpreted as alternates. For example, if you enter 192.168.1.0/24 and 10.10.10.128 for the Destination Address field, the expression evaluation will interpret this as the Destination Address matches the network 192.168.1.0/24 or the host 10.10.10.128.

To edit an existing value, double-click the value and start editting. To delete a value, select the value, and hit delete key.

Each field and value pair is separated by an equal sign . You can click on the equal sign to toggle it to the equal sign. This effects how the field value pair is interpreted during the expression evaluation. In our example of the Destination Address field with values 192.168.1.0/24 and 10.10.10.128, if there is an equal sign, the expression will be interpreted as the Destination Address matches the network 192.168.1.0/24 or the host 10.10.10.128. If a not equal sign is shown, the expression will be evaluated as the Destination Address is not in the network 192.168.1.0/24 and it does not equal the host 10.10.10.128.

Each clause has a tool bar with three buttons.

Composing Clauses

An expression is composed of multiple clauses. The expression editor shows how clauses are combined through indentation and operators. If two clauses are at the same indentation level, they are connected by a line with the green plus circle the or operator. When evaluated, the first clause will be evaluated to find matching packets and actions. Then the second clause will be evaluated to find matching packets and actions. The resulting expression is the union of the packets and actions described in each clause.

If one clause is a child of another clause (that is the second clause is indented underneath the first clause), the results of the clauses are combined with the and operator. Effectively the outer clause is checked and if it matches, the inner clauses are checked. If the outer clause doesn't match, the inner clauses are not checked at all.

Clauses at the same level ("sibling clauses") are combined with the or operator, which means that they are all checked until one matches if all parent clauses match. If there are clauses nested under the siblings, those are checked only if their parent (one of the siblings) matches.

The expression as a whole matches if any clause without nested clauses matches. A parent clause (one with nested clauses) matches if any of its nested clauses match.

Controlling Clause Nesting

In the expression editor tool bar, there is a set of four arrow buttons.

In addition to combining clauses through and and or operators, there is also an otherwise operator. The otherwise operator can be used on the last clause in a list of clauses at the same identiation level; that is a set of clauses combined by the or operator. The clause after the otherwise operator expresses the action or scope that must apply to the packet that does not match any of the previous clauses. For example, consider one clause that specified the Source Address was 10.10.0.0/16 and the Action was permit, and after the otherwise operator another clause that specified the action of deny. This would mean that only packets with the source address in the 10.10.0.0/16 network should be permitted and all other packets should be denied. The otherwise operator provides a concise means of expressing the expected action in all "other" cases.

The last clause in a list can be converted between an or clause and an otherwise clause by toggling the icon next to the close. If it is blue plus circle or green plus circle the final clause is another or clause. If it is blue x circle or green x circle the final clause is an otherwise clause. If the operator is red

it means that the clause has an otherwise operator and was moved to a location where such an operator is not permitted. In this case it will be treated as an or. If the clause is moved to a location where otherwise is valid the operator will change back to green. You can change the operator to or but you can't change it back unless the operator is moved to a location where otherwise is valid. This is done so that the otherwise operator is not changed while a clause is being moved.

If it's still not clear what operator a clause has, hover the mouse cursor over the operator and it will provide a tool tip.