TR: Encapsulated match if

Olivier Bax de Keating olivier.baxdekeating.external at aastra.com
Thu Mar 6 10:01:25 UTC 2008


Hi Bruce,

Thx for the answer. Do u know a way to get informations about regular expressions in dhcpd v4 (samples ...)?

I have one last question : I'd like to do a "match if" on a vendor-encapsulated-options suboption.

I tried : 
#codes device1
option space DEVICE1;
option DEVICE1.suboption0 code 2 = unsigned integer 8;
option DEVICE1.suboption1 code 3 = text;

class "Device1" {
    vendor-option-space DEVICE1;
    match  if  substring    (option DEVICE1.suboption1, 0, 6) = "value1");
}


To test it, I used dhcpcd and in the dhclient.conf, I put :
send vendor-encapsulated-options 02:01:12:03:06:76:61:6c:75:65:31

But it seemed not to work.

I googled on it and found http://www.lica.cz/admin/pool/dhcpd.conf this example.



class "AmiNET110 fisys" 
{ 
  match if (option vendor-class-identifier="Aminoaminet110fisys") or 
           ((substring( option vendor-encapsulated-options, 2, 9)="aminet110") 
            and (substring(option vendor-encapsulated-options, 13, 5)="fisys")); 
  vendor-option-space AMINO;
  option AMINO.homepage "http://www.lica.cz";

They don't use the AMINO structure for the matches, but only for setting the encapsulated values.

I tried smthg like the previous example:

class "Device1" {
    match  if  substring    (option vendor-encapsulated-options, 5, 6) = "value1");
}


It worked, but this implies that the number and the length of the vendor-encapsulated-options shouldn't be modified between different versions of a same device (for example). So, is there a way to use the Buffer in the "match if" ?

Thx for all

Olivier




-----Message d'origine-----
De : Bruce Hudson [mailto:Bruce.Hudson at Dal.Ca] 
Envoyé : mercredi 5 mars 2008 16:45
À : Olivier Bax de Keating
Objet : Re: Encapsulated match if


    Sorry about the previous garbage message.

    As I understand it, version 4.0 of the server should include operators 
that would allow you to do regular expression matching against the parameter
request list. That may allow you to find an parameter anywhere in the list.
--
Bruce A. Hudson				| Bruce.Hudson at Dal.CA
UCIS, Networks and Systems		|
Dalhousie University			|
Halifax, Nova Scotia, Canada		| (902) 494-3405


More information about the dhcp-users mailing list