How to retrieve custom DHCP options on client?
Is there any way for a linux client to retrieve custom options from a DHCP server and have it available for another application, output to a file, etc.?
I have a situation where a headless linux box is going to be installed in a location with web proxying, and it needs to auto-detect the settings and refresh them periodically in order to make outgoing http requests. This means retrieving a wpad file location via DHCP, and if that fails by DNS. I've got the DNS query figured out and have it working on my little test network. Configuration on the server side to provide the wpad url option is simple enough as well. But actually getting the option on the client side is a mystery to me. Unfortunately, I can't get confirmation from the IT people where this is going that this is sufficient, so I so need to support the DHCP request (DHCPINFORM, option 252) as well to cover my bases, and I'm getting nowhere on it. As I see it, my options are:
1. Write a program to handle the low level sockets directly. Worst case scenario for me, as I have very little experience in programming sockets so trying to dig through the RFC to support the message directly is going to be a major headache and take way too much time.
2. Configure the linux dhcp client to automatically request the option and store/log it somewhere for later reference. Haven't found any way to do this in documentation, so not likely unless I missed something.
3. Search for a command-line script/application to perform the operation. No luck so far.
4. Find a library where someone has already done the low level work so I can program just using the API. Was almost successful on this one, found a java library JDHCP.jar that had everything I wanted, but it apparently is old and didn't work properly... I could get it to make a request but not receive the response, though the DHCP server clearly logged a response :(
Any ideas or references would be most welcome!