Revision 9b0a0ba9 filter/test.conf2

View differences:

filter/test.conf2
18 18

  
19 19
protocol kernel {
20 20
	disabled;
21
	ipv4;			# Must be specified at least one channel
21 22
#	learn;			# Learn all routes from the kernel
22 23
#	scan time 10;		# Scan kernel tables every 10 seconds
23 24
}
......
25 26
protocol static {
26 27
#	disabled;
27 28

  
28
	import filter { print "ahoj"; 
29
	print source;
30
	if source = RTS_STATIC then {
31
		print "It is from static";
32
	}
33
	print from;
34
	from = 1.2.3.4;
35
	print from;
36
	print scope;
37
	scope = SCOPE_HOST;
38
	print scope;
39
	if !(scope ~ [ SCOPE_HOST, SCOPE_SITE ]) then {
40
		print "Failed in test";
41
		quitbird;
42
	}
43
		
44
	preference = 15;
45
	print preference;
46
	preference = 29;
47
	print preference;
48
	rip_metric = 1;
49
	print rip_metric;
50
	rip_metric = rip_metric + 5;
51
	print rip_metric;
52
	bgp_community = - empty - ; 
53
	print "nazdar";
54
	bgp_community = add(bgp_community, (1,2));
55
	print "cau";
56
	bgp_community = add(bgp_community, (2,3));
57
	bgp_community.add((4,5));
58
	print "community = ", bgp_community;
59
	bgp_community.delete((2,3));
60
	print "community = ", bgp_community;
61
	bgp_community.empty;
62
	print "community = ", bgp_community;
63
	print "done";
64
	};
29
	ipv4 {
30
		export all;
31

  
32
		import filter {
33
			print "ahoj";
34
			print source;
35
			if source = RTS_STATIC then {
36
				print "It is from static";
37
			}
38
			print from;
39
			from = 1.2.3.4;
40
			print from;
41
			print scope;
42
			scope = SCOPE_HOST;
43
			print scope;
44
			if !(scope ~ [ SCOPE_HOST, SCOPE_SITE ]) then {
45
				print "Failed in test";
46
				quitbird;
47
			}
65 48

  
49
			preference = 15;
50
			print preference;
51
			preference = 29;
52
			print preference;
53
			rip_metric = 1;
54
			print rip_metric;
55
			rip_metric = rip_metric + 5;
56
			print rip_metric;
57

  
58
#
59
# TODO: uncomment this part after finishing BGP integration version
60
#
61
#			bgp_community = -empty-;
62
#			print "hi";
63
#			bgp_community = add(bgp_community, (1,2));
64
#			print "hello";
65
#			bgp_community = add(bgp_community, (2,3));
66
#			bgp_community.add((4,5));
67
#			print "community = ", bgp_community;
68
#			bgp_community.delete((2,3));
69
#			print "community = ", bgp_community;
70
#			bgp_community.empty;
71
#			print "community = ", bgp_community;
72
#			print "done";
73
		};
74
	};
66 75
	route 0.0.0.0/0 via 195.113.31.113;
67 76
	route 62.168.0.0/25 reject;
68 77
	route 1.2.3.4/32 via 195.113.31.124;
69
#	route 10.0.0.0/8 reject;
70
#	route 10.1.1.0:255.255.255.0 via 62.168.0.3;
71
#	route 10.1.2.0:255.255.255.0 via 62.168.0.3;
72
#	route 10.1.3.0:255.255.255.0 via 62.168.0.4;
73
#	route 10.2.0.0/24 via "arc0";
74
	export all;
78
	route 10.0.0.0/8 reject;
79
	route 10.1.1.0:255.255.255.0 via 62.168.0.3;
80
	route 10.1.2.0:255.255.255.0 via 62.168.0.3;
81
	route 10.1.3.0:255.255.255.0 via 62.168.0.4;
82
	route 10.2.0.0/24 via "arc0";
75 83
}

Also available in: Unified diff