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

Simon Hobson dhcp1 at thehobsons.co.uk
Sat Dec 22 12:13:58 UTC 2012


Sten Carlsen wrote:


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


> Shouldn't this be: option option-82 = 00:03 --> no quotes?

Oops, yes.


perl-list wrote:
> The problem is that the config isn't human generated. Was trying to avoid maintaining a list of equipment for option 82 purposes and instead just providing a field in which any ASCII text could be entered. But, since there needs to be a distinction still, there will need to be a list of possible equipment that could be generating the option 82 so that we can correlate whether it is ASCII or binary in the packet. We could have the user choose ASCII or binary but they probably wouldn't know what we are talking about. So, in the drop down we will have choices such as Cisco, Juniper, Brocade, Calix, Occam ... I know, for example, that Brocade is binary and that Occam is ASCII. Some vendors use a telco standard (name escapes me at themoment) for the option 82 , some use their own made up standard. Occam seems to have the most reasonable setup by letting the user define what ASCII text should be returned per port so that they can name them based on something that has specific mea
 ning. Anyways - it is (not)a lotof fun :)
Then I think the problem isn't so much that you need to know whether it's text or binary, but that you are accepting input from people who cannot be trusted to enter the right information - though I can see why there's a need for that.
Presumably you'll also be doing input validation, to at least try and make sure that users enter the right format - in which case, not only do you need to know if it's text or binary, but also the format to validate against. Non-technical users ("have the user choose ASCII or binary but they probably wouldn't know what we are talking about" impies non-technical) plus unvalidated input == recipe for problems.
You'll also need to check for uniqueness - otherwise if a user enters the worng information, they could conflict with another user's setting and cause a denial of service.


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