execute problems

Glenn Satchell Glenn.Satchell at uniq.com.au
Sat Sep 23 13:32:01 UTC 2006


>
>On Mon, Sep 18, 2006 at 04:58:41PM +0200, Jon Otterholm wrote:
>> I'm trying to use the new "execute" function in isc-dhcpd-V3.1.0a1 with 
>> not all good results.
>>
>> I allso have problems with logging of MAC when there are zeros in the 
>> address - they are all left out. For example 0a:0b:0c:0d:0e:0f becoms 
>> a:b:c:d:e:f in the logfile.
>
See this message for a way to generate the format you want:

  http://marc.theaimsgroup.com/?l=dhcp-server&m=105689607527110&w=2

concat (
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 1, 1))),2),
":",
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 2, 1))),2),
":",
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 3, 1))),2),
":",
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 4, 1))),2),
":",
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 5, 1))),2),
":",
suffix (concat ("0", binary-to-ascii (16, 8, "", substring(hardware, 6, 1))),2)
);

Basically gets each binary char, converts to ascii, sticks a 0 on the
front, then takes the last two chars, then concatenates the whole
thing.

regards,
-glenn
--
Glenn Satchell     mailto:glenn.satchell at uniq.com.au | Some days we are
Uniq Advances Pty Ltd         http://www.uniq.com.au | the flies;  some
PO Box 70 Paddington NSW Australia 2021              | days we  are the
tel:0409-458-580  tel:02-9380-6360  fax:02-9380-6416 | windscreens...


More information about the dhcp-users mailing list