next up previous contents
Next: Variable use list Up: File formats Previous: File formats   Contents


Location map

When invoked with the option -l location_file, tcc writes the source code locations of traffic control elements to the specified file.

The file format is as follows:

type identifier tag file_name line_number

type
is the type of the element (see below)
identifier
is a string that uniquely identifies the element
tag
is a user-provided identifier (``-'' if no identifier was provided)
file_name
is the name of the source file containing the definition of the element (``-'' if no file name is available; note that tcc uses the name <stdin> for standard input)
line_number
is the approximate line number

The format of the identifier depends on the type of the element:

Type name Identifier string
device interface
qdisc interface:qdisc
class interface:qdisc:class_number
filter interface:qdisc:class_number:priority
tunnel interface:qdisc:class_number:priority:tunnel_number
element interface:qdisc:class_number:priority:element_index
police bucket_number

qdisc is the queuing discipline number for egress, or ingress at ingress. For filter and element, class_number is an empty string if the filter is rooted at the queuing discipline. element_index is the zero-based number of the element on that filter. Note that buckets are also identified as policers.

Programs reading location maps should not make any assumption about the order in which entries are written.

Future versions of tcc may add more fields to a map line, so any programs reading location maps should not assume that a line ends after the line number.

Example:

dev "eth0" {
    prio (1) {
        class (1,"aTag")
            if 1
        {
            fifo (2,tag "another_tag");
        }
    }
}

yields the following location map:

device eth0 - <stdin> 1
qdisc eth0:1 - <stdin> 2
class eth0:1:1 aTag <stdin> 3
qdisc eth0:2 another_tag <stdin> 6
filter eth0:1::1 - <stdin> 2
element eth0:1::1:0 - <stdin> 4

Note that if is converted into a filter with elements.


next up previous contents
Next: Variable use list Up: File formats Previous: File formats   Contents
Martin A. Brown 2003-11-06