next up previous contents
Next: File formats Up: Targets Previous: The ``C'' target   Contents

The external target

The external target is enabled with the command-line option -xall:name or -xif:name, where name is the corresponding external program.

The external interface is described in chapter 7. As discussed further in that chapter, tcc may build a hybrid configuration combining tc and elements from the external interface with -xif:name, while it uses only the external interface with -xall:name.

Example:

The following configuration

egress {
    drop if tcp_sport != PORT_SSH;
}

yields, when invoking tcc with -xif:err (the external program tcc-ext-err simply echoes the configuration data from tcc on standard error):

tc commands on standard output:

tc qdisc add dev eth0 handle 1:0 root dsmark indices 1 default_index 0

External configuration on standard error:

# 7700
block eth0 egress
offset 100 = 0+(0:4:4 << 5)
action 0 = drop
action 1 = unspec
match 0:72:8=0x06 100:0:16=0x0016 action 1
match 0:72:8=0x06 action 0
match action 1
# END

When invoking tcc with -xall:err, we only get an external configuration, on standard error:

# fc00
offset 100 = 0+(0:4:4 << 5)
block eth0 egress
qdisc 1 = dsmark indices 1
action 0 = drop
action 1 = unspec
match 0:72:8=0x06 100:0:16=0x0016 action 1
match 0:72:8=0x06 action 0
match action 1
# END

Note: the comment lines (# ...) are inserted by tcc-ext-err and are not part of the configuration data passed from tcc.



Martin A. Brown 2003-11-06