]> git.ipfire.org Git - thirdparty/bird.git/blob - bird.conf
b1220c32341ac6db275191fb2ae6abb1e8eafe46
[thirdparty/bird.git] / bird.conf
1 /*
2 * This is an example configuration file.
3 */
4
5 # Yet another comment
6
7 router id 62.168.0.1;
8
9 define xyzzy = 120+10;
10
11 function callme (int arg1; int arg2;)
12 {
13 print "Function callme called arguments " arg1 " and " arg2;
14
15 case arg1 {
16 2: print "dva"; print "jeste jednou dva";
17 [ 3 .. 5 ]: print "tri az pet";
18 else: print "neco jineho";
19 }
20 }
21
22 function startup ()
23 int i;
24 prefix px;
25 {
26 print "Testing filter language:";
27 i = 4;
28 i = 1230 + i;
29 print " arithmetics: 1234 = " i;
30 printn " if statements ";
31 if i = 4 then { print "*** FAIL: if 0"; quitbird; } else printn ".";
32 if 1234 = i then printn "."; else { print "*** FAIL: if 1 else"; }
33 if 1 <= 1 then printn "."; else { print "*** FAIL: test 3"; }
34 if 1234 < 1234 then { print "*** FAIL: test 4"; quitbird; } else print "ok";
35
36 print " data types; must be true: " 1.2.3.4 = 1.2.3.4 "," 1 ~ [1,2,3] "," 5 ~ [1..20] "," 2 ~ [ 1, 2, 3 ] "," 5 ~ [ 4 .. 7 ] "," 1.2.3.4 ~ [ 1.2.3.3..1.2.3.5 ];
37 print " data types: must be false: " 1 ~ [ 2, 3, 4 ] "," 5 ~ [ 2, 3, 4, 7..11 ] "," 1.2.3.4 ~ [ 1.2.3.3, 1.2.3.5 ] "," (1,2) > (2,2) "," (1,1) > (1,1);
38
39 px = 1.2.3.4/18;
40 print "Testing prefixes: 1.2.3.4/18 = " px;
41 print "Testing pairs: (1,2) = " (1,2);
42
43 print "Testing functions...";
44 callme ( 1, 2 );
45 callme ( 2, 2 );
46 callme ( 3, 2 );
47 callme ( 4, 2 );
48 callme ( 7, 2 );
49
50 print "done";
51 quitbird;
52 # print "*** FAIL: this is unreachable";
53 }
54
55 filter testf
56 int j;
57 {
58 print "Heya, filtering route to " rta.net.ip " prefixlen " rta.net.len;
59 print "This route was from " rta.from;
60 accept;
61 }
62
63 protocol rip MyRIP_test {
64 preference xyzzy;
65 debug all;
66 port 1520;
67 period 5;
68 garbagetime 30;
69 interface "*" { mode broadcast; };
70 export filter testf;
71 honour neighbour;
72 passwords { password "ahoj" from 0 to 10;
73 password "nazdar" from 10;
74 }
75 authentication md5;
76 }
77
78 protocol device {
79 # disabled;
80 # interface "eth*", "ppp*";
81 }
82
83 #protocol kernel {
84 # disabled;
85 # learn; # Learn all routes from the kernel
86 # scan time 10; # Scan kernel tables every 10 seconds
87 #}
88
89 protocol static {
90 # disabled;
91 route 0.0.0.0/0 via 62.168.0.13;
92 route 62.168.0.0/25 reject;
93 # route 10.0.0.0/8 reject;
94 # route 10.1.1.0:255.255.255.0 via 62.168.0.3;
95 # route 10.1.2.0:255.255.255.0 via 62.168.0.3;
96 # route 10.1.3.0:255.255.255.0 via 62.168.0.4;
97 # route 10.2.0.0/24 via "arc0";
98 }