Hello All,
My question is regarding the dhclient version isc-dhclient-V3.0.5-RedHat.
I need to send some vendor specific information from my DHCP server to its clients. For this to happen, I have done following:
Server side: In dhcpd.conf, following lines have been added:
#option space scf;
set vendor-string = option vendor-class-identifier;
option space Example;
option Example.param code 200 = string;
class "ExampleClass" {
match if option vendor-class-identifier = "ExampleClass";
vendor-option-space Example;
option Example.param "http://www.google.com";
}
_________________________________________________________________________________
Client Side: In /etc/dhclient.conf file, following lines have been added:
option space Example;
option Example.param code 200 = string;
request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, ntp-servers,
vendor-encapsulated-options;
send vendor-class-identifier "ExampleClass";
_________________________________________________________________________________
After doing this, I am successfully able to receive the data in $new_vendor_encapsulated_options on the client side as I can see through my dhclient-script which runs each time the lease renews/expires.
But my question is regarding, how to decode this information. The information I am receiving is like following:
c8:15:68:74:74:70:3a:2f:2f:77:77:77:2e:67:6f:6f:67:6c:65:2e:63:6f:6d
where first two bytes c8=200 (Example.param's code) and 0x15=21 (Length of the field) and following 21 characters represent the information (
http://google.com)
Now I can simply parse the packet and read it in this way. But I am quite positive there has to be a cleaner and standard way of decoding the packet as sometimes these packets are nested into multiple levels.
The following blog mentions a $INP() function that is used for decoding:
http://wsidhcp.blogspot.com/2012/03/...cp-server.html
But if I use the $INP in the given manner, it gives me error. Can someone please help here?