summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [efi] Allow for optional protocolsMichael Brown2014-05-191-0/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nfs] Rewrite NFS URI handlingMarin Hannache2014-05-182-0/+30
| | | | | | | | Get the NFS URI manipulation code out of nfs_open.c. The resulting code is now much more readable. Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Allow interrupts to be excluded from profiling resultsMichael Brown2014-05-041-12/+79
| | | | | | | | | Interrupt processing adds noise to profiling results. Allow interrupts (from within protected mode) to be profiled separately, with time spent within the interrupt handler being excluded from any other profiling currently in progress. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Provide methods for profiling individual stages of operationsMichael Brown2014-05-031-7/+35
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow for a debug level of zeroMichael Brown2014-04-281-15/+2Star
| | | | | | | | Allow for an explicit debug level of zero, which will enable assertions and profiling (i.e. anything controlled by NDEBUG) without generating any debug messages. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "profstat" command to display profiling statisticsMichael Brown2014-04-281-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Add generic profiling infrastructureMichael Brown2014-04-281-47/+61
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add flsll()Michael Brown2014-04-271-4/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add isqrt() function to find integer square rootsMichael Brown2014-04-261-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add inline assembly implementation of flsl() using BSR instructionMichael Brown2014-04-241-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add support for subjectAltName and wildcard certificatesMichael Brown2014-03-312-0/+19
| | | | | Originally-implemented-by: Alex Chernyakhovsky <achernya@google.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow signed timestamp error margin to be configured at build timeMichael Brown2014-03-301-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Generalise X.509 cache to a full certificate storeMichael Brown2014-03-286-65/+63Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expand the concept of the X.509 cache to provide the functionality of a certificate store. Certificates in the store will be automatically used to complete certificate chains where applicable. The certificate store may be prepopulated at build time using the CERT=... build command line option. For example: make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt Certificates within the certificate store are not implicitly trusted; the trust list is specified using TRUST=... as before. For example: make bin/ipxe.usb CERT=root.crt TRUST=root.crt This can be used to embed the full trusted root certificate within the iPXE binary, which is potentially useful in an HTTPS-only environment in which there is no HTTP server from which to automatically download cross-signed certificates or other certificate chain fragments. This usage of CERT= extends the existing use of CERT= to specify the client certificate. The client certificate is now identified automatically by checking for a match against the private key. For example: make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add pubkey_match() to check for matching public/private key pairsMichael Brown2014-03-271-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Remove dynamically-allocated storage for certificate OCSP URIMichael Brown2014-03-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Remove dynamically-allocated storage for certificate nameMichael Brown2014-03-251-1/+4
| | | | | | | | | | | | | | iPXE currently allocates a copy the certificate's common name as a string. This string is used by the TLS and CMS code to check certificate names against an expected name, and also appears in debugging messages. Provide a function x509_check_name() to centralise certificate name checking (in preparation for adding subjectAlternativeName support), and a function x509_name() to provide a name to be used in debugging messages, and remove the dynamically allocated string. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Disable SNP devices when running iPXE as the applicationMichael Brown2014-03-141-0/+4
| | | | | | | | | | | | | Some UEFI builds will set up a timer to continuously poll any SNP devices. This can drain packets from the network device's receive queue before iPXE gets a chance to process them. Use netdev_rx_[un]freeze() to explicitly indicate when we expect our network devices to be driven via the external SNP API (as we do with the UNDI API on the standard BIOS build), and disable the SNP API except when receive queue processing is frozen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Notify upper-layer drivers when RX processing is (un)frozenMichael Brown2014-03-141-20/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow driver to be unloadedMichael Brown2014-03-101-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for 64-bit EFI_STATUS codesMichael Brown2014-03-101-10/+15
| | | | | | | On a 64-bit build, EFI_STATUS codes are 64-bit quantities, with the "error/warning" bit located in bit 63. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-101-3/+6
| | | | | | | | | | | | | | | | | | iPXE will detect timeout failures in several situations: network link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc. This does not cover all possible circumstances. For example, if a connection to a web server is successfully established and the web server acknowledges the HTTP request but never sends any data in response, then no timeout will be triggered. There is no timeout defined within the HTTP specifications, and the underlying TCP connection will not generate a timeout since it has no way to know that the HTTP layer is expecting to receive data from the server. Add a "--timeout" parameter to "imgfetch", "chain", etc. If no progress is made (i.e. no data is downloaded) within the timeout period, then the download will be aborted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mii] Add mii_dump() to dump all MII registersMichael Brown2014-03-101-0/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Calculate correct MSS from peer addressMichael Brown2014-03-041-10/+0Star
| | | | | | | | | | | | | | | | | | | iPXE currently advertises a fixed MSS of 1460, which is correct only for IPv4 over Ethernet. For IPv6 over Ethernet, the value should be 1440 (allowing for the larger IPv6 header). For non-Ethernet link layers, the value should reflect the MTU of the underlying network device. Use tcpip_mtu() to calculate the transport-layer MTU associated with the peer address, and calculate the MSS to allow for an optionless TCP header as per RFC 6691. As a side benefit, we can now fail a connection immediately with a meaningful error message if we have no route to the destination address. Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_mtu() to determine the maximum transmission unitMichael Brown2014-03-041-0/+3
| | | | | | | | Provide the function tcpip_mtu() to allow external code to determine the (transport-layer) maximum transmission unit for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_netdev() to determine the transmitting network deviceMichael Brown2014-03-041-0/+8
| | | | | | | Provide the function tcpip_netdev() to allow external code to determine the transmitting network device for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Enable infrastructure to specify an autoboot device locationAlex Williamson2014-03-031-1/+3
| | | | | | | | | | | | | | | | | | iPXE will currently attempt to boot from every network device for which it has a driver. Where a system has more than one network device supported by iPXE, this renders BIOS IPL lists ineffective. Allow an autoboot device location to be specified. If such a location is specified, then only devices matching that location will be used as part of the automatic boot sequence. If no such location is specified, then all devices will be used. Note that this does not affect the "autoboot" command, which will continue to use all devices. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add the "ipstat" commandMichael Brown2014-03-031-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Add IP statistics collection as per RFC 4293Michael Brown2014-03-023-1/+194
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Ensure every image has a fully resolved URIMichael Brown2014-02-271-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Refactor URI parsing and formattingMichael Brown2014-02-271-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | Add support for parsing of URIs containing literal IPv6 addresses (e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe"). Duplicate URIs by directly copying the relevant fields, rather than by formatting and reparsing a URI string. This relaxes the requirements on the URI formatting code and allows it to focus on generating human-readable URIs (e.g. by not escaping ':' characters within literal IPv6 addresses). As a side-effect, this allows relative URIs containing parameter lists (e.g. "../boot.php##params") to function as expected. Add validity check for FTP paths to ensure that only printable characters are accepted (since FTP is a human-readable line-based protocol with no support for character escaping). Construct TFTP next-server+filename URIs directly, rather than parsing a constructed "tftp://..." string, Add self-tests for URI functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [params] Use reference counters for form parameter listsMichael Brown2014-02-271-2/+39
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Support DNS search listsMichael Brown2014-02-053-61/+121
| | | | | | | | | | | 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>
* [cmdline] Rename "console" command's --bpp option to --depthMichael Brown2014-01-221-1/+1
| | | | | | | | | | Rename the "--bpp" option to "--depth", to free up the single-letter option "-b" for "--bottom" in preparation for adding margin support. This does not break backwards compatibility with documented features, since the "console" command has not yet been documented. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Allow for an arbitrary margin around the text areaMichael Brown2014-01-222-0/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Centre background picture on consoleMichael Brown2014-01-221-8/+0Star
| | | | | | | | | | | | | | | | | | | | | | | Centre the background picture on the console, to give a more consistent result when the aspect ratio does not match the requested width and height. Once drawn for the first time, nothing should ever overwrite the margins of the display. We can therefore eliminate the logic used to redraw only the margin areas, and use much simpler code to draw the complete initial background image. Simplify the redrawing logic further by making the background picture buffer equal in size to the frame buffer. In the common case of a background picture which is designed to fill the screen, this wastes no extra memory, and the combined code simplifications reduce the size of fbcon.o by approximately 15%. Redefine the concept of "margin" to match the intuitive definition (i.e. the size of the gap, rather than the position of the boundary line). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [png] Add support for PNG imagesMichael Brown2014-01-122-0/+180
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Add memcmp_user()Michael Brown2014-01-123-0/+43
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add abs()Michael Brown2014-01-121-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [deflate] Add support for DEFLATE decompressionMichael Brown2014-01-062-0/+284
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add okx() macro taking an explicit file name and line numberMichael Brown2014-01-061-3/+6
| | | | | | | | | Allow test reports to specify an explicit file name and line number using the extended okx() macro. This allows large blocks of test report code such as tcpip_random_ok() to be implemented as functions rather than macros. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add isprint()Michael Brown2014-01-061-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Fix compilation under FreeBSDMichael Brown2013-12-211-1/+1
| | | | | Reported-by: Dewey Hylton <dewey@hyltown.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add concept of a "magic" colourMichael Brown2013-12-091-0/+11
| | | | | | | | The magic basic colour can be remapped at runtime from COLOR_NORMAL_BG (usually blue) to COLOR_DEFAULT (which will be transparent as a background colour on the framebuffer console). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add centralised concept of colours and colour pairsMichael Brown2013-12-092-0/+75
| | | | | | | | | | | | | Add a centralised concept of colours and colour pairs (using the default colour pairs as configured via config/colour.h). A colour pair consists of a pair of colour indices. Add the ability to redefine both a colour pair and an individual colour index, with minimal overhead if this feature is not required (e.g. because the relevant shell commands are not present in the build). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow consoles to update the recorded console sizeMichael Brown2013-12-062-4/+23
| | | | | | | | | | | | | | | | | | | | Provide a mechanism for consoles to update the recorded console width and height, and use this width and height to provide the curses COLS and LINES variables. We choose not to use ANSI escape sequences to obtain the width and height, for two reasons: - iPXE's model is that all output is sent to all consoles; we could therefore end up with multiple consoles reporting conflicting widths and heights - when a serial console is in use, we probably don't want to resize the output shown on the BIOS console to match the size of the serial console, since it's likely that the serial console is in use only for debugging. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Expose NDP-provided settings (including the DNS server)Michael Brown2013-12-051-0/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcpv6] Add DHCPv6 "filename" settingMichael Brown2013-12-051-0/+6
| | | | 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-052-18/+36
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcpv6] Use DUID-UUID form of client DUIDMichael Brown2013-12-051-8/+7Star
| | | | | | Use the system UUID to generate the client DUID-UUID as per RFC 6355. Signed-off-by: Michael Brown <mcb30@ipxe.org>