next up previous contents
Next: The drop construct Up: The tcng language Previous: Queuing disciplines   Contents

Classes

A class specification begins with the keyword class, followed by an optional list of parameters, in parentheses, zero or more selectors (selectors are typically if constructs, see section [*]), and an optional list of items attached to the class, in curly braces.

Examples:

// clear TOS byte of all packets with EF and no ECN bits set

dsmark(set_tc_index) {
    class (0x2e << 2, mask 0);
}

egress {
    class (<$one>)
        if ip_dst == 10.0.0.1;
    class (<$two>)
        if ip_dst == 10.0.0.2;
    class (<$three>)
        if 1;

    prio {
        $one = class (1);
        $two = class (2);
        $three = class (3);
    }
}

The number of a class is usually automatically assigned. It can be explicitly set by including it among the parameters, e.g.

class (1) ...;



Subsections

Martin A. Brown 2003-03-14