Send dhcp-users mailing list submissions to
        dhcp-users@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/dhcp-users
or, via email, send a message with subject or body 'help' to
        dhcp-users-requ...@lists.isc.org

You can reach the person managing the list at
        dhcp-users-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of dhcp-users digest..."


Today's Topics:

   1. Re: Dealing with possible list of numeric option values
      (pxe-system-type) (Simon Hobson)


----------------------------------------------------------------------

Message: 1
Date: Mon, 16 Nov 2020 12:44:18 +0000
From: Simon Hobson <dh...@thehobsons.co.uk>
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Dealing with possible list of numeric option values
        (pxe-system-type)
Message-ID: <a89561de-636b-40ad-a8e1-0a0deaccc...@thehobsons.co.uk>
Content-Type: text/plain; charset=us-ascii

glenn.satch...@uniq.com.au wrote:

> Lists are encoded as a byte stream of concatenated values, so a list of int32 
> would be groups of 4 bytes, int16 as groups of 2 bytes, etc.
> 
> You might be able to use the regex match to pick a value in the subsequent 
> byte stream, regex is defined in dhcp-eval as
> 
> data-expression-1 ~= data-expression-2
> 
> such as
> 
> if option pxe-system-type ~= 00:07 then ...
> 
> I haven't tested this, so you may want to verify my suggestion.

It may be fine in this case, but in the general case you need to be careful not 
to have false matches across options. E.g. if there were two options of (say) 
ff:00 and 07:1f (in that order) then neither option is 00:07, but if you do an 
unconstrained regex match then it would detect 00:07.

I suppose one way would be to do a match along the lines of :
substr(option,0,2)=00:07 or substr(option,2,2)=00:07 or ... or 
substr(option,2n,2)=00:07

But then you can quickly get into a bit of a mess, and are still hardcoding a 
specific limit in number of values you will search through.

There is a bigger issue if an option is not made up of elements that are all 
the same set length - and I think that would need external processing to split 
out individual elements.

Simon



------------------------------

Subject: Digest Footer

_______________________________________________
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

dhcp-users mailing list
dhcp-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/dhcp-users


------------------------------

End of dhcp-users Digest, Vol 145, Issue 15
*******************************************

Reply via email to