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: Server configuration using conditional evaluation
      (glenn.satch...@uniq.com.au)


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

Message: 1
Date: Mon, 13 Feb 2023 15:02:42 +1100
From: glenn.satch...@uniq.com.au
To: Users of ISC DHCP <dhcp-users@lists.isc.org>
Subject: Re: Server configuration using conditional evaluation
Message-ID: <cd244f66b323d3e0c0036f524b247...@uniq.com.au>
Content-Type: text/plain; charset=UTF-8; format=flowed

The dhcp-eval man page shows the syntax for switch(), binary-to-ascii() 
and substring(). It's important that you use the right length for the 
substring() so that it can do the binary-to-ascii() correctly. It might 
be that the value from the switch is null or not calculated as you 
expected.

switch (binary-to-ascii(16, 32, ".", substring(option dhcp6.ia-na, 0, 
4)))

Here the substring() is taking the 4 bytes starting at offset 0 - the 
first four bytes.

Then binary-to-ascii is treating that as a 32 bit number and displaying 
it as two 16 bit numbers with a "." in  between. Do you know what the 
dhcp6.ia-na is that is being sent so you can manually confirm the 
function is doing what you expect?

regards,
Glenn

On 2023-02-12 22:47, Darren Ankney wrote:
> The error could start earlier than what you've shown here.  Have a
> look earlier in your file and see if there are missing } or if there
> are unterminated ' or " which would mask your ending }  ATM, I can't
> seem to find man pages for ISC DHCP documenting the use of switch, so
> I'll just assume you've used the correct syntax there.
> 
> On Sat, Feb 11, 2023 at 12:20 PM Thomas K?ller
> <tho...@koeller.dyndns.org> wrote:
>> 
>> Am 11.02.23 um 18:09 schrieb Greg Sloop <gr...@sloop.net>:
>> > This config didn't start out as a Windows file with cr lf line endings
>> > did it? (And is still in that format?)
>> 
>> No, definitely not, all line endings ar lf only.
>> --
>> 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 171, Issue 5
******************************************

Reply via email to