From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Tue, 06 Nov 2007 11:37:12 -0500 Subject: [U-Boot-Users] DHCP vendor or class ID option In-Reply-To: References: Message-ID: <47309838.4020705@qstreams.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Jeff, Jeffrey Mann wrote: > U-boot users: > > I have been searching the list and reading source code trying to > figure out if something that acomplishes vendor class ids or user > class ids has been implemented in u-boot's dhcp services. (microsoft > has a few articles that discuss uses of class IDS. > http://support.microsoft.com/kb/266675) > > What I am trying to acomplish is this: I would like to be able to set > slightly different DHCP options when the DHCP request comes from a > board running u-boot. The point of this is to provide a shorter lease > time (so we don't exceed the size of the address pool when testing > boards) and also to allow different TFTP server addresses to be sent > to these boards. > > I see that bp_vend[OPT_SIZE] exists in struct type Bootp_t. Is this a > vendor class id? I see around line 334 in bootp.c this is coppied from > BOOTP_VENDOR_MAGIC. Is setting a vendor class ID as simple as setting > a value for BOOTP_VENDOR_MAGIC in the config file? I cannot find an > example in any other board files. > > Thanks, > > Jeffrey Mann > > BOOTP_VENDOR_MAGIC is a fixed value (99.130.83.99) as defined in RFC 1048, (and its successor, RFC 1533). You can implement whatever vendor extensions you want in U-boot. If you want to use vendor extensions, put this in your board's config header file: #define CONFIG_BOOTP_VENDOREX and supply the following two board functions: u8 *dhcp_vendorex_prep (u8 *e); /* Function for filling in extensions */ u8 *dhcp_vendorex_proc (u8 *e); /* Function for processing the response */ There are a few boards in the tree that use this. Just grep for CONFIG_BOOTP_VENDOREX You might want to read this, too, for syntax etc.: http://www.faqs.org/rfcs/rfc1533.html Does this make sense? regards, Ben