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. Dealing with possible list of numeric option values (pxe-system-type) (Boylan, Ross) 2. Re: Dealing with possible list of numeric option values (pxe-system-type) (glenn.satch...@uniq.com.au) ---------------------------------------------------------------------- Message: 1 Date: Mon, 16 Nov 2020 04:22:25 +0000 From: "Boylan, Ross" <ross.boy...@ucsf.edu> To: "dhcp-users@lists.isc.org" <dhcp-users@lists.isc.org> Cc: Ross Boylan <rossboy...@stanfordalumni.org> Subject: Dealing with possible list of numeric option values (pxe-system-type) Message-ID: <byapr05mb573688f97e4d8eda8b53deee87...@byapr05mb5736.namprd05.prod.outlook.com> Content-Type: text/plain; charset="iso-8859-1" According to RFC 4578 and the dhcp-options man page, pxe-system-type has values that are a list of one or more uint16's. dhcp-eval and dhcp-options didn't seem to say exactly how I could work with it, or, more directly, what the result of using "option pxe-system-type" in a conditional expression is: a string? a number? a list? My first guess was if option pxe-system-type = 7 then .... Should that work? I notice all the examples on this list seem to use the form if option pxe-system-type = 00:07 then .. suggesting the values are converted to a stream of bytes after promotion to 32 bit integer size. Further, it sounds as if there might be multiple values supplied. Is there any good way to figure if 7 is one of them? Will option pxe-system-type = 00:07 fail if there is more than one element returned, even if the first one is 7? Maybe in practice it is never an issue? I'm also curious how options that are lists with elements other than numbers work. Thanks. Ross Boylan cc's appreciated ------------------------------ Message: 2 Date: Mon, 16 Nov 2020 17:36:19 +1100 From: glenn.satch...@uniq.com.au 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: <5debfd2d46c8da9eccef842a6d927...@uniq.com.au> Content-Type: text/plain; charset=US-ASCII; format=flowed Hi Ross 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. regards, Glenn On 2020-11-16 15:22, Boylan, Ross wrote: > According to RFC 4578 and the dhcp-options man page, pxe-system-type > has values that are a list of one or more uint16's. dhcp-eval and > dhcp-options didn't seem to say exactly how I could work with it, or, > more directly, what the result of using "option pxe-system-type" in a > conditional expression is: a string? a number? a list? > > My first guess was > if option pxe-system-type = 7 then .... > Should that work? I notice all the examples on this list seem to use > the form > if option pxe-system-type = 00:07 then .. > suggesting the values are converted to a stream of bytes after > promotion to 32 bit integer size. > > Further, it sounds as if there might be multiple values supplied. Is > there any good way to figure if 7 is one of them? > Will option pxe-system-type = 00:07 fail if there is more than one > element returned, even if the first one is 7? > Maybe in practice it is never an issue? > > I'm also curious how options that are lists with elements other than > numbers work. > > Thanks. > Ross Boylan > cc's appreciated > _______________________________________________ > 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 ------------------------------ 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 14 *******************************************