next up previous contents
Next: Advanced variables: structures Up: Under the hood Previous: Implementation limitations   Contents

Policing primitives

An if construct can reach a decision (such as to attribute a packet to a specific class or to drop it) in two ways: either by returning ``true'' (i.e. a non-zero value), in which case the corresponding class or drop action is taken, or by encountering a so-called policing primitive while evaluating the classification expression.

The following policing primitives are available:

drop
indicates to the queuing discipline that the packet be dropped and terminates further evaluation of the if expression
reclassify
accepts the packet, but indicates to the queuing discipline that the packet be reclassified.

The policing primitives can be used like any Boolean expression.

Examples:

// The rate limiter from the previous example

$p = bucket(rate 50kbps,burst 3kB,mpu 200B);

ingress {
    class (1) if (conform $p && count $p) || drop;
}



Martin A. Brown 2003-11-06