<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>I didn’t chech ‘man dhcp-eval’, and that’s done by now
</span></font><font face=Wingdings><span lang=EN-GB style='font-family:Wingdings'>J</span></font><span
lang=EN-GB><o:p></o:p></span></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>It’s true that need an ‘AND’ operator, but for before
testing the second condition, I need to declare the vendor-option-space, like
in my example:<o:p></o:p></span></font></p>

<pre><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    #condition1<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option  vendor-class-identifier, 0, 15) = "Name of Device1";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    # If the device is of the type DEVICE 1, it’s the value of the suboption 3 which is tested<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    # I have to declare vendor-option-space as DEVICE1 before checking the second condition<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    <b><span
style='font-weight:bold'>vendor-option-space</span></b> <b><span
style='font-weight:bold'>DEVICE1;</span></b><o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    <o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    #condition2<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option DEVICE1.suboption1, 0, 4) = "value1");<o:p></o:p></span></font></pre>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Would you tell me what do u think about a ‘match if’
in an ‘if’ like in the following proposition ?<o:p></o:p></span></font></p>

<div style='mso-element:para-border-div;border:inset 1.0pt;padding:5.0pt 5.0pt 5.0pt 5.0pt'><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt'>class "Device1" {<o:p></o:p></span></font></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt'>    if substring    (option  vendor-class-identifier, 0, 15) = "Name of Device1"{<o:p></o:p></span></font></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
style='font-size:10.0pt'>        </span></font><span lang=EN-GB>vendor-option-space DEVICE1;<o:p></o:p></span></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt'>        match  if  substring    (option DEVICE1.suboption1, 0, 4) = "value1");<o:p></o:p></span></font></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt'>    }<o:p></o:p></span></font></pre><pre
style='border:none;padding:0cm'><font size=2 face="Courier New"><span
lang=EN-GB style='font-size:10.0pt'>}<o:p></o:p></span></font></pre></div>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Best regards<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Olivier<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'>-----Message d'origine-----<br>
De : dhcp-users-bounce@isc.org [mailto:dhcp-users-bounce@isc.org] De la
part de Simon Hobson<br>
Envoyé : mardi 4 mars 2008 12:07<br>
<br>
<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span style='font-size:
10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>À : dhcp-users@isc.org<br>
Objet : Re: Encapsulated match if<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Olivier Bax de Keating wrote:<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>In each classes, I put 2 "match if", and
I know <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>that this syntax is probably not correct. I'm <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>searching for the good one, I mean, a way to <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>encapsulate 2 conditions of match, with "if
Š" <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>if it exists, or subclasses (but it seems to me <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>>that they are not done for that ?)<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Have you checked 'man dhcp-eval' ?<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Two features you probably want to look at :<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>AND : if match if ( condition 1 AND condition 2 )<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Fairly obvious, matches if both conditions are true.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>match-first-value : match-first-value ( expression 1,
expression 2, ... )<o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'><o:p> </o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>Function that returns the first non-null value. <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>So if expression 1 has a value then it is <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>returned, but if it is null then expression 2 is <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>returned, and so on. I'm not sure you need this, <o:p></o:p></span></font></p>

<p class=MsoPlainText><font size=2 face="Courier New"><span lang=EN-GB
style='font-size:10.0pt'>as I'm not entirely sure what the question is !<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>De :</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Olivier Bax de
Keating <br>
<b><span style='font-weight:bold'>Envoyé :</span></b> mardi 4 mars 2008
11:39<br>
<b><span style='font-weight:bold'>À :</span></b> 'dhcp-users@isc.org'<br>
<b><span style='font-weight:bold'>Objet :</span></b> Encapsulated match if</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>I’m new to dhcpd servers, but I’d like to know if
it’s possible to filter devices on a vendor suboption, which depends on the </span></font><span
lang=EN-GB>vendor-class-identifier.<br>
I give an example of what I’d like in the following lines. <o:p></o:p></span></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'><o:p> </o:p></span></font></p>

<div style='border:inset 1.0pt;padding:5.0pt 5.0pt 5.0pt 5.0pt'><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>#codes device1<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>option space DEVICE1;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>option DEVICE1.suboption1 code 3 = text;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>option DEVICE1.suboption2 code 4 = unsigned integer 16;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>#codes device2 (la suboption1 est commune aux deux appareils, mais n'a pas le même numéro de code)<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>option space DEVICE2;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>option DEVICE2.suboption1 code 1 = text;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>option DEVICE2.suboption3 code 3 = ip-address;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>class "Device1" {<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option  vendor-class-identifier, 0, 15) = "Name of Device1";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    </span># Si l'appareil est de type DEVICE 1, le c'est le sous code 3 qui est testé<o:p></o:p></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>    </span></font><span
lang=EN-GB>vendor-option-space DEVICE1;<o:p></o:p></span></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option DEVICE1.suboption1, 0, 4) = "value1");<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>}<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>class "Device2" {<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option  vendor-class-identifier, 0, 15) = "Name of Device2";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    </span># Si l'appareil est de type DEVICE 2, le c'est le sous code 1 qui est testé<o:p></o:p></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>    </span></font><span
lang=EN-GB>vendor-option-space DEVICE2;<o:p></o:p></span></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    match  if  substring    (option DEVICE2.suboption1, 0, 4) = "value1");<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>}<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>shared-network mynetwork{<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    option server.min-lease-time 600000;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    option server.default-lease-time 700000;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    option server.max-lease-time 800000;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    subnet 127.0.0.1 netmask 255.255.255.0 {<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>        option tftp-server-name "localhost";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    }<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'><o:p> </o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    pool {<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>        allow members of "Device1";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>        allow members of "Device2";<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>        range 127.0.0.10 127.0.0.40;<o:p></o:p></span></font></pre><pre><font
size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt'>    </span>}<o:p></o:p></font></pre><pre><font
size=2 face="Courier New"><span style='font-size:10.0pt'>}<o:p></o:p></span></font></pre></div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<!-- END TEMPLATE: bbcode_code -->

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-GB
style='font-size:12.0pt'>The IPs and domain names are for the example only. In
each classes, I put 2 “match if”, and I know that this syntax is probably not
correct. I’m searching for the good one, I mean, a way to encapsulate 2
conditions of match, with “if …” if it exists, or subclasses (but it seems to
me that they are not done for that ?)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thx for all<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Best regards<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Olivier</span></font><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

</div>

</body>

</html>