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

Simon Hobson dhcp1 at thehobsons.co.uk
Wed Dec 19 14:35:50 UTC 2012


perl-list wrote:
> 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-configsevery timesomeone 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.

Sorry, I don't understand what the problem is.

If you are having to match on <some option> then presumably you have some idea what is in the option. In all cases, if you are using something like "option blah = <something>" then there's no problem. If you expect <something> to look like a string then specify the string in quotes :
option option-82 = "Switch 0 Port 3"
If you expect it to be "non text" then specify it as a hex string :
option option-82 = "00:03" # if, for example, the equipment just sent two octets with switch and port number

This will work with all sites, using a common config format. All it requires is that you put quotes in your database round text values, and not around hex representations.


If this doesn't cover your problem, then perhaps you'd better expand on what your problem is.


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


More information about the dhcp-users mailing list