SV: Allow statement in pool

Lars Jacobsen lj at sydfynsel.dk
Fri Mar 2 11:34:23 UTC 2007



> Simon Hobson 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.
> 

Thank you, its clear to me now.

But still I cant get it to work creating a 3. class based on two others.

I have tried several evaluations/syntaxes and again it might be because
they all evaluate to "true", instead of combining the content(members)
of the two classes. Maybe I should try using "concat".


### TEST LMC 1130-ch1-stb###
class "1130-ch1-stb" {
         match if  ( (class = "1130-ch1") AND (class = "db-stb") );
}        

### TEST LMC 1130-ch1-stb###
class "1130-ch1-stb" {
         match if  ( ("1130-ch1") AND ("db-stb") );
}        

### TEST LMC 1130-ch1-stb###
class "1130-ch1-stb" {
         match if  ( (members of "1130-ch1") AND (members of "db-stb")
);
}        

### TEST LMC 1130-ch1-stb###
class "1130-ch1-stb" {
         members of  ( ("1130-ch1") AND ("db-stb") );
}   




More information about the dhcp-users mailing list