Closed mrock42 closed 7 years ago
I think you meant --option 51[hex]=0060
?
Using it as "--option 51[hex]=0000003C" works correctly to use a timeout of 60 seconds. So when passing in like "--option 51=0060" it is using the ascii values... that's unusual. Without the [hex], shouldn't it use the displayed number as the value? so "--option 51=60" would be 60 seconds?
Well, DHCPTest can't know all possible DHCP options, as there are some used privately, so it can't know how the value is encoded for every option. Right now the default encoding is string (ASCII). Autodetecting the type from the value is also problematic because a numeric value might be actually intended as a string one.
I'm happy with the hex. I'm happy that you put this together, even if there was no way to set the option!
No pressure from me, but if you wanted, it seems that leasetime, timeoffset, renewaltime, rebindingtime are all specially handled currently, and that you could extend that to parse a numeric string.
Okay. Sorry, I haven't looked at the code in a while, and I think the type specification was actually implemented by someone else.
When specifying a lease time, such as with --option 51=0060 , I see an output like:
Using --option 51="0060" or --option "51=0060" results in the same output as above.