summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/settings.h
Commit message (Collapse)AuthorAgeFilesLines
* [settings] Add "base64" setting typeMichael Brown2015-04-241-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+1
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Support DNS search listsMichael Brown2014-02-051-0/+1
| | | | | | | | | | | Update the DNS resolver to support DNS search lists (as provided by DHCP option 119, DHCPv6 option 24, or NDP option 31). Add validation code to ensure that parsing of DNS packets does not overrun the input, get stuck in infinite loops, or (worse) write beyond the end of allocated buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Merge SETTING_IPv4 and SETTING_IPv6Michael Brown2013-12-051-19/+17Star
| | | | | | | Allow for equivalent IPv4 and IPv6 settings (which requires equivalent settings to be adjacent within the settings list). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-051-17/+34
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetch_ipv6_setting()Michael Brown2013-12-051-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for IPv6 setting types in non-IPv6 buildsMichael Brown2013-12-051-10/+15
| | | | | | | | | Allow for the existence of references to IPv6 setting types without dragging in the whole IPv6 stack, by placing the definition of setting_type_ipv6 in core/settings.c and providing weak stub methods for parse_ipv6_setting() and format_ipv6_setting(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-051-81/+99
| | | | | | | | | | The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add "ipv6" setting typeMichael Brown2013-11-141-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Move user-class setting from dhcp.c to settings.cMichael Brown2013-11-141-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make built-in settings a linker tableMichael Brown2013-08-271-0/+22
| | | | | | | Allow for configurable provision of built-in settings by placing them in a linker table rather than an array. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Introduce the generalised concept of a numeric settingMichael Brown2013-08-011-5/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove now-unused fetchf_named_setting() and storef_named_setting()Michael Brown2013-07-221-7/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove now-unused store_named_setting()Michael Brown2013-07-191-13/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetchf_setting_copy()Michael Brown2013-07-191-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose parse_setting_name()Michael Brown2013-07-191-1/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make "netX" settings block function as a symbolic linkMichael Brown2013-07-131-0/+7
| | | | | | | | | | | | | | Add a facility for settings blocks to act as symbolic links to other settings blocks, and reimplement the "netX" virtual settings block using this facility. The primary advantage of this approach is that unscoped settings such as ${mac} and ${filename} will now reflect the settings obtained from the most recently opened network device: in most cases, this will mean the settings obtained from the most recent DHCP attempt. This should improve conformance to the principle of least astonishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "busdevfn" setting typeMichael Brown2013-07-121-0/+1
| | | | | | | Allow network device's "busloc" setting to be formatted as a PCI bus:dev.fn address using e.g. ${net0/busloc:busdevfn}. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "hexraw" setting typeMichael Brown2013-07-121-0/+1
| | | | | Originally-implemented-by: Jeppe Toustrup <ipxe@tenzer.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate settings "tag magic"Michael Brown2013-05-011-29/+46
| | | | | | | Create an explicit concept of "settings scope" and eliminate the magic values used for numerical setting tags. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetchf_named_setting_copy()Michael Brown2012-10-251-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose find_child_settings()Michael Brown2012-10-151-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use a generic setting's own type as its default typeMichael Brown2012-09-101-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fetching a named setting using a name that does not explicitly specify a type, default to using the type stored when the setting was created, rather than always defaulting to "string". This allows the behaviour of user-defined settings to match the behaviour of predefined settings (which have a sensible default type). For example: set server:ipv4 192.168.0.1 echo ${server} will now print "192.168.0.1", rather than trying to print out the raw IPv4 address bytes as a string. The downside of this change is that existing tricks for printing special characters within scripts may require (backwards-compatible) modification. For example, the "clear screen" sequence: set esc:hex 1b set cls ${esc}[2J echo ${cls} will now have to become set esc:hex 1b set cls ${esc:string}[2J # Must now explicitly specify ":string" echo ${cls} Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Move "domain" setting from dns.c to settings.cMichael Brown2012-06-201-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow trusted root certificate to be changed without a rebuildMichael Brown2012-04-191-1/+2
| | | | | | | | | | | | | | | | | | | | Changing the trusted root certificate currently requires a rebuild of the iPXE binary, which may be inconvenient or impractical. Allow the list of trusted root certificate fingerprints to be overridden using the "trust" setting, but only at the point of iPXE initialisation. This prevents untrusted sources of settings (e.g. DHCP) from subverting the chain of trust, while allowing trustworthy sources to change the trusted root certificate without requiring a rebuild. The basic idea is that if you are able to manipulate a trustworthy source of settings (e.g. VMware GuestInfo or non-volatile stored options), then you would be able to replace the iPXE binary anyway, and so no security is lost by allowing such sources to override the list of trusted root certificates. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetch_setting_copy()Michael Brown2012-04-191-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Split fetching and storing out of setting type handlersMichael Brown2012-04-171-28/+13Star
| | | | | | | Refactor setting type handlers to parse and format values, rather than storing and fetching formatted values. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for setting typesMichael Brown2012-04-171-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Impose a fixed order on settingsMichael Brown2011-03-231-17/+35
| | | | | | | Improve the appearance of the "config" user interface by ensuring that settings appear in some kind of logical order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display canonical setting name in "config" user interfaceMichael Brown2011-03-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Display canonical setting name in output of "show" commandMichael Brown2011-03-221-1/+3
| | | | | | | | | | | | | | | | | | Enable the "show" command to display the full, canonicalised name of the fetched setting. For example: iPXE> show mac net0/mac:hex = 52:54:00:12:34:56 iPXE> dhcp && show ip DHCP (net0 52:54:00:12:34:56)... ok net0.dhcp/ip:ipv4 = 10.0.0.168 iPXE> show net0/6 net0.dhcp/dns:ipv4 = 10.0.0.6 Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Provide fetch_setting_origin()Michael Brown2011-03-221-0/+2
| | | | | Inspired-by: Glenn Brown <glenn@myri.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose settings_name()Glenn Brown2011-03-221-0/+1
| | | | | | | | Expose settings_name(), shrink the unnecessarily large static buffer, properly name root settings block, and simplify. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Formalise notion of setting applicabilityMichael Brown2011-03-221-4/+36
| | | | | | | | | | | | | | | 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>
* [settings] Generalise expand_command() to expand_settings()Michael Brown2011-01-281-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetch_ipv4_array_setting()Michael Brown2010-12-091-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Apply settings block name in register_settings()Michael Brown2010-12-011-8/+3Star
| | | | | | | | Pass the settings block name as a parameter to register_settings(), rather than defining it with settings_init() (and then possibly changing it by directly manipulating settings->name). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Export find_setting()Piotr Jaroszyński2010-08-171-0/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-0/+335
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>