summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2010-08-03 17:35:34 +0200
committerOndrej Filip <feela@network.cz>2010-08-03 17:35:34 +0200
commit946dc15c928d9a48cdcc857bc80f4fabf9a4e2bf (patch)
treeca33049ffa215410422dfbfd46d2307fb75b2c23 /doc
parente0e8c04a83bbe24cdcf3836ca171ce60db299b1f (diff)
Documentation update and improvement of tests related to expressions in sets.
Diffstat (limited to 'doc')
-rw-r--r--doc/bird.sgml14
1 files changed, 13 insertions, 1 deletions
diff --git a/doc/bird.sgml b/doc/bird.sgml
index 2f65f137..8b2e8ee7 100644
--- a/doc/bird.sgml
+++ b/doc/bird.sgml
@@ -706,9 +706,21 @@ incompatible with each other (that is to prevent you from shooting in the foot).
Filters recognize four types of sets. Sets are similar to strings: you can pass them around
but you can't modify them. Literals of type <cf>int set</cf> look like <cf>
[ 1, 2, 5..7 ]</cf>. As you can see, both simple values and ranges are permitted in
- sets. For pair sets, expressions like <cf/(123,*)/ can be used to denote ranges (in
+ sets.
+ For pair sets, expressions like <cf/(123,*)/ can be used to denote ranges (in
that case <cf/(123,0)..(123,65535)/). You can also use <cf/(123,5..100/ for range
<cf/(123,5)..(123,100)/.
+ You can also use expressions for both, pair sets and int sets. However it must
+ be possible to evaluate these expressions before daemon boots. So you can use
+ only constants inside them. E.g.
+ <code>
+ define one=1;
+ int set odds;
+ pair set ps;
+
+ odds = [ one, (2+1), (6-one), (2*2*2-1), 9, 11 ];
+ ps = [ (1,(one+one)), (3,4)..(4,8), (5,*), (6,3..6) ];
+ </code>
Sets of prefixes are special: their literals does not allow ranges, but allows
prefix patterns that are written as <cf><M>ipaddress</M>/<M>pxlen</M>{<M>low</M>,<M>high</M>}</cf>.