A Syntax issue with match

Martin McCormick martin at dc.cis.okstate.edu
Thu Nov 18 18:25:13 UTC 2010


Is there some treasure trove of syntax examples for dhcp
evaluations? the man page is excellent for communicating the
various things we can test for, but the biggest difficulty as in
stuck all day and nothing to show for it is nuts and bolts
syntax. I have two boolean expressions that each work separately
and should work in series connected by & but nothing I have
tried, so far, seems to fit.

One of the expressions is:

match if substring (option host-name, 0, 6) = "TSTEXP";

The other is identical except it matches a hardware string so we
want to match if both of the tests are true. I have not found
anything that seems to let you do the "&" on both expressions,
something like:

class "and-test" {
match if substring (option host-name,0,6) = "ABCDEF"; & substring (hardware,0,4) = 1:aF:A5:A4;
}

I have tried various groupings using parentheses and braces
since we "match if" both expressions evaluate as true, but the
parser doesn't like any of it so far.

	I once saw a sample named.conf file years ago in which
every single option was shown set to something. A comment at the
beginning said that it is guaranteed not to work anywhere but the
syntax for each directive is guaranteed to be valid. It's the
picture that helps you understand the thousand words which
explain it all.

Thanks.

Martin McCormick



More information about the dhcp-users mailing list