next up previous contents
Next: Adding new traffic control Up: File formats Previous: Location map   Contents


Variable use list

When invoked with the option -u variable_use_file, tcc writes the names of all variables and their content to the specified file.

Each line is in one of the following formats:

{ type identifier

{

}

$name = number

$name = number unit

$name = expression

$name = type identifier

name is the variable name. number is an integer or a floating-point number. unit is the unit of measurement, without prefix. Units are described in section 2.7.2.

For variables containing non-constant expressions, simply the word expression is output as the value. Future versions of tcc may add further information after this keyword.

For variables containing traffic control elements, the format is identical to the first two fields in the location map entry of that element. Note that only queuing disciplines, classes, filters, buckets, and policers can be assigned to variables.

The beginning of a scope is indicated with an opening curly brace followed by the identifier of the element that started the scope. Scopes created by nesting a block directly within another block have no element identifying the scope and are denoted by a line containing only the opening curly brace. Likewise, the end of a scope is indicated with a closing curly brace.

Example:

prio {
    $foo = 42
}

yields the following variable use list:

{ device eth0
{ qdisc eth0:1
$foo = 42
}
}

Note that the scope for the default device is automatically generated. As a special case, the scope of an unnumbered class is marked with the identifier interface:qdisc:unnumbered

Programs reading a variable use list file should not make any assumption about the order in which entries within the same scope are written. Variables with the same name will appear once per distinct variable, within the respective scope.

Note that forward-declared variables are placed in the scope of their assignment, and not the scope of their declaration.

Future versions of tcc may include whitespace before dollar signs and curly braces. Furthermore, the syntax $name = forward is reserved for possible future use.


next up previous contents
Next: Adding new traffic control Up: File formats Previous: Location map   Contents
Martin A. Brown 2003-11-06