summaryrefslogtreecommitdiffstats
path: root/src/net/dhcpopts.c
Commit message (Collapse)AuthorAgeFilesLines
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | | | | | | | | | Relicence files with kind permission from the following contributors: Alex Williamson <alex.williamson@redhat.com> Eduardo Habkost <ehabkost@redhat.com> Greg Jednaszewski <jednaszewski@gmail.com> H. Peter Anvin <hpa@zytor.com> Marin Hannache <git@mareo.fr> Robin Smidsrød <robin@smidsrod.no> Shao Miller <sha0.miller@gmail.com> Thomas Horsten <thomas@horsten.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Copy exactly the required length when resizing DHCP optionsMichael Brown2014-02-261-3/+1Star
| | | | | | | | | | | When resizing DHCP options, iPXE currently calculates the length to be copied by subtracting the destination pointer from the end of buffer pointer. This works and guarantees not to write beyond the end of the buffer, but may end up reading beyond the end of the buffer. Fix by calculating the required length exactly. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Formalise notion of setting applicabilityMichael Brown2011-03-221-0/+12
| | | | | | | | | | | | | | | Expose a function setting_applies() to allow a caller to determine whether or not a particular setting is applicable to a particular settings block. Restrict DHCP-backed settings blocks to accepting only DHCP-based settings. Restrict network device settings blocks to accepting only DHCP-based settings and network device-specific settings such as "mac". Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nvo] Allow resizing of non-volatile stored option blocksMichael Brown2011-01-191-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Allow use of custom reallocation functions for DHCP option blocksMichael Brown2011-01-111-56/+59
| | | | | | | | Allow functions other than realloc() to be used to reallocate DHCP option block data, and specify the reallocation function at the time of calling dhcpopt_init(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Rename length fields for DHCP optionsMichael Brown2011-01-101-17/+17
| | | | | | Rename "len" to "used_len" and "max_len" to "alloc_len". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-2/+2
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Append new DHCP options versus prependShao Miller2010-01-141-4/+15
| | | | | | | | | | | | | Change the behaviour for adding DHCP options into a DHCP packet so that we now append options, rather than insert them in front of whatever options might already be present. Apparently, the DHCP relay logic on a Nortel 470-48T layer 2 switch cares about the order of DHCP options. If we build a DHCP packet pre-populated with some options, their order will now be preserved, except for encapsulated options. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [Settings] Remove assumption that all settings have DHCP tag valuesMichael Brown2008-03-251-3/+13
| | | | | | | | | | | | Allow for settings to be described by something other than a DHCP option tag if desirable. Currently used only for the MAC address setting. Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c. Remove notion of settings from dhcppkt.c. Rationalise dhcp.c to use settings API only for final registration of the DHCP options, rather than using {store,fetch}_setting throughout.
* [Settings] DHCP is now working using the new settings API.Michael Brown2008-03-211-5/+15
|
* [Settings] Migrate DHCP and NVO code to the new settings API (untested)Michael Brown2008-03-211-248/+216Star
|
* [DHCP] Kill off some no-longer-used DHCP functionsMichael Brown2008-03-211-118/+0Star
|
* [Settings] Use a settings applicator to set the default TFTP URI.Michael Brown2008-03-211-35/+0Star
|
* [Settings] Introduce settings applicators.Michael Brown2008-03-211-24/+0Star
| | | | | | | Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
* Various warnings fixups for OpenBSD with gcc-3.3.5.Michael Brown2007-12-071-2/+2
|
* Remove some assumptions about DHCP obtaining only a single options block.Michael Brown2007-11-211-3/+3
|
* Apply global DHCP options when register_dhcp_options() is called. DoMichael Brown2007-07-061-0/+12
| | | | not apply DHCP options in dhcp_configure_netdev().
* Add concept of DHCP option applicators.Michael Brown2007-07-051-0/+49
|
* Update DHCP to use data-xfer interface (not yet tested).Michael Brown2007-06-281-9/+2Star
|
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* Use stdlib.h for malloc() instead of malloc.h.Michael Brown2006-12-201-1/+1
|
* Fail gracefully when set_dhcp_option() is called with options==NULL.Michael Brown2006-08-111-1/+6
|
* Add dhcp_snprintf() for extracting DHCP string options.Michael Brown2006-07-201-0/+34
|
* Added dhcp_ipv4_option() and friends.Michael Brown2006-07-201-0/+55
| | | | Added test code to configure the interface for IPv4 after DHCP.
* Add block identification to debug messagesMichael Brown2006-07-191-8/+12
|
* Allow for calling find_dhcp_option() with "options" set to NULL, in orderMichael Brown2006-07-191-21/+97
| | | | | | | to search through all registered option blocks. Move some static inlines that are likely to be used frequently into dhcpopts.c as normal functions, to save space.
* Add sketch code to reassemble a DHCP packet from our internal "everythingMichael Brown2006-07-171-8/+24
| | | | | | | | | | is a DHCP option" data structures. We need this code in order to be able to return a DHCP packet to a PXE NBP which reflects options from our multiple sources (e.g. NVS and DHCP server). This is expensive, but necessary. Having paid this cost, we may as well try to use the same code to generate our DHCP request packets, since the process is similar.
* Add code to modify DHCP option values within a block.Michael Brown2006-07-131-75/+182
|
* Provide a mechanism for returning the encapsulator as well as theMichael Brown2006-06-281-15/+23
| | | | | encapsulated option; this will be needed for modifications to the options block.
* Add priority mechanismMichael Brown2006-06-281-16/+67
|
* Change dhcp_num_option() to return the numerical value directly.Michael Brown2006-06-281-19/+15Star
|
* First stab at DHCP option handling in a way that will allow us to haveMichael Brown2006-06-271-0/+217
multiple option sources (e.g. multiple DHCP replies, non-volatile storage etc.)