mac address host-name problem

Chow Chi Ho (FP&HO) chchow at cabletv.com.hk
Fri Mar 16 08:07:18 UTC 2007


it works,

many thx

-----Original Message-----
From: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org]On Behalf Of Ray Phillips
Sent: Friday, March 16, 2007 3:48 PM
To: dhcp-users at isc.org
Subject: Re: mac address host-name problem


>I am using  " binary-to-ascii (16,8, "", substring (hardware, 4, 1)) 
>" to convert  mac, 0:e0:6f:a:c:e ,  to ascii "0e06face".
>How can I convert the mac to ascii "00e06f0a0c0e"

I think the following, which is derived from one of Glenn's postings 
to the list [1], is a solution:

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)
)



Ray


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



More information about the dhcp-users mailing list