<p>Bird is configured using text configuration file. At startup, bird reads <file/bird.conf/
(unless -c command line parameter is given). Really simple configuration file might look like this:
-<cf>
+<cf><verb>
protocol kernel {
persist; # Don't remove routes on bird shutdown
export all;
import all;
}
-</cf>
+</verb></cf>
<p>You can find example of more complicated configuration file in <file>doc/bird.conf.example</file>.
<p>Filter basically looks like this:
-<cf>
+<cf><verb>
filter not_too_far
int var;
{
else
accept "ok";
}
-</cf>
+</verb></cf>
<p>As you can see, filter has a header, list of local variables, and body. Header consists of <cf/filter/ keyword, followed by (unique) name of filter. List of local variables consists of
pairs <cf><I>type name</I>;</cf>, where each pair defines one local variable. Body consists of
over. Functions can have zero or more parameters, and can have local variables. Function basically
looks like this:
-<cf>
+<cf><verb>
function name ()
int local_variable;
{
{
print parameter;
}
-</cf>
+</verb></cf>
<p>Unlike C, variables are declared after function line but before first {. You can not declare
variables in nested blocks. Functions are called like in C: <cf>name(); with_parameters(5);</cf>.
or both commands. <cf>else</cf> clause may be ommited. Case is
used like this:
-<cf>
+<cf><verb>
case <I>argument</I> {
2: print "dva"; print "jeste jednou dva";
3 .. 5: print "tri az pet";
else: print "neco jineho";
}
-</cf>
+</verb></cf>
where <I>argument</I> is any argument that can be on the left side of ~ operator, and anything that
could be member of set is allowed before :. Multiple commands are allowed without {} grouping. If
<p>In addition, rip defines two filter variables, both of type it. <cf>rip_metric</cf> is rip
metric of current route, <cf>rip_tag</cf> is tag of current route.
-<cf>
+<cf><verb>
protocol rip MyRIP_test {
debug all;
import filter { print "importing"; accept; };
export filter { print "exporting"; accept; };
}
-</cf>
+</verb></cf>
</article>