[syslinux] IP details in COM32 module

H. Peter Anvin hpa at zytor.com
Mon Jun 11 17:22:00 PDT 2007


Coe, Colin C. (Unix Engineer) wrote:

> 
> The code that parse the DHCP info looks like this (should look pretty
> familiar):
> --
> unsigned int i;
> for (i = 0; i < dhcp_params.length; i++) {
>    const struct option_val *o = dhcp_params.buffer;
>    printf("Counter: %d, %s: %s\n", i, o[i].desc, o[i].value);
> }         
> --
> Shouldn't all of the DHCP info get printed?  Is there any reason that
> the option 'host-name' isn't showing up in the list?
> 

DHCP, unlike BOOTP, doesn't by default send all the options, only the
options requested by the client -- at least in theory.  This rather
conflicts with PXE's way of doing things, which is to can packets for
later examination.  DHCP clients are supposed to be able to ask for more
information by sending a DHCPINFORM packets, but there are *many*
pitfalls to that strategy.

ISC DHCP can be made to send the additional information, fortunately, by
 using a construct like:

http://syslinux.zytor.com/archives/2002-July/000708.html

> Alternatively, is there any way of doing a reverse DNS lookup on the
> workstations IP address?

There is, but you'd have to:

- Parse the DHCP response to get the DNS server entries.
- Send a DNS query packet for the appropriate lookup
  (X.Y.Z.W -> W.Z.Y.X.in-addr.arpa)
- Parse the response.

Right now I don't have any wrapper functions for sending and receiving
raw UDP packets, although that probably would be a good idea to have.

	-hpa




More information about the Syslinux mailing list