Allow statement in pool

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Mar 2 08:10:37 UTC 2007


Lars Jacobsen wrote:

>  > class_xy { match if ( X and Y ) }



>I noticed that you use both () and {} in one of the examples. Is there
>any difference to the server or is it just for making it easy for us
>humans to distinguish between the logic ?

No, it is required syntax.

Typically, definitions use braces, eg :

subnet .... {
   ....
}

Parentheses are used for grouping in arithmetic or logical constructs, eg :

( 1+2 ) * 3


So in the definition above, the braces are syntax for the class 
definition, the parenthesis are for logical grouping - though I think 
in the simple example would be redundant. Consider this more 
complicated example :

class_xy { match if ( ( X1 or X2 or X3 ) and ( Y1 or Y2 ) ) }

Without the grouping it would mean X1 or X2 or (X3 and Y1) or Y2 
which is a totally different meaning.


More information about the dhcp-users mailing list