string data expressions (was Re: using option 82 to assign a static ip-address)

perl-list perl-list at network1.net
Mon Dec 17 17:38:51 UTC 2012


bah - that is what I feared. The problem I have is not knowing what will be received at each site (depends on vendor) and hoping to find a solution that works with all to prevent re-configs every time someone somewhere adds some new equipment, and worse yet, matching things in a multi-vendor environment when you aren't sure what will come from where. 

----- Original Message -----

> From: "Simon Hobson" <dhcp1 at thehobsons.co.uk>
> To: "Users of ISC DHCP" <dhcp-users at lists.isc.org>
> Sent: Monday, December 17, 2012 11:22:47 AM
> Subject: Re: string data expressions (was Re: using option 82 to
> assign a static ip-address)

> At Mon, 17 Dec 2012 10:03:45 -0500 (EST), perl-list wrote:
> > So the best solution is to convert everything to binary?

> No, the best solution is to use whatever is best for your situation.

> When dealing with "text" data it's probably easier to deal with text,
> eg if your device sends a value that is a text string, then do a
> text comparison <something> ="VLAN 1 Port 4". Similarly for other
> "text" values such as hostnames, domain names, etc.

> When dealing with "binary" data (such as MAC addresses), it's
> probably easier to use hex. Eg, <something> = 00:11:22:33:44:55.

> There's no "conversion" involved. To the program, values are
> collections of bytes - it doesn't care if it's something us humans
> usually deal with as text, or something that's "not text", it's just
> a collection of bytes. When specifying a string to match against in
> the config file, then we have a choice of syntax to use - in either
> case there's a conversion from the textual representation we use in
> the config file into a list of bytes. If we use "Text" then the
> program will convert that text into four bytes, if instead we use
> 54:65:78:74 then we still end up with the same four bytes after the
> program has parsed our config.

> --
> Simon Hobson

> Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
> author Gladys Hobson. Novels - poetry - short stories - ideal as
> Christmas stocking fillers. Some available as e-books.
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20121217/3616ead3/attachment.html>


More information about the dhcp-users mailing list