summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
Commit message (Collapse)AuthorAgeFilesLines
...
* [peerdist] Add individual block download mechanismMichael Brown2015-08-172-0/+145
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Add segment discovery mechanismMichael Brown2015-08-172-0/+117
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Rewrite HTTP core to support content encodingsMichael Brown2015-08-172-5/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the HTTP core to allow for the addition of arbitrary content encoding mechanisms, such as PeerDist and gzip. The core now exposes http_open() which can be used to create requests with an explicitly selected HTTP method, an optional requested content range, and an optional request body. A simple wrapper provides the preexisting behaviour of creating either a GET request or an application/x-www-form-urlencoded POST request (if the URI includes parameters). The HTTP SAN interface is now implemented using the generic block device translator. Individual blocks are requested using http_open() to create a range request. Server connections are now managed via a connection pool; this allows for multiple requests to the same server (e.g. for SAN blocks) to be completely unaware of each other. Repeated HTTPS connections to the same server can reuse a pooled connection, avoiding the per-connection overhead of establishing a TLS session (which can take several seconds if using a client certificate). Support for HTTP SAN booting and for the Basic and Digest authentication schemes is now optional and can be controlled via the SANBOOT_PROTO_HTTP, HTTP_AUTH_BASIC, and HTTP_AUTH_DIGEST build configuration options in config/general.h. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Add generic block device translatorMichael Brown2015-08-162-0/+39
| | | | | | | Add a generic mechanism for providing block devices on top of a data transfer interface (such as HTTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Hold off watchdog timer while runningMichael Brown2015-08-032-0/+32
| | | | | | | | | | | | | | | | UEFI platforms may provide a watchdog timer, which will reboot the machine if an operating system takes more than five minutes to load. This can cause long-lived iPXE downloads (or interactive shell sessions) to unexpectedly reboot. Fix by resetting the watchdog timer every ten seconds while the iPXE main processing loop continues to run. Reported-by: Bradley B Williams <bradleybwilliams@swbell.net> Reported-by: John Clark <john.r.clark.3@gmail.com> Reported-by: wdriever@gmail.com Reported-by: Charlie Beima <cbeima@indiana.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Support SHA-{224,384,512} in X.509 certificatesMichael Brown2015-08-022-0/+26
| | | | | | | | | Add support for SHA-224, SHA-384, and SHA-512 as digest algorithms in X.509 certificates, and allow the choice of public-key, cipher, and digest algorithms to be configured at build time via config/crypto.h. Originally-implemented-by: Tufan Karadere <tufank@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add ASN.1 OIDs for sha{224,384,512}WithRsaEncryptionTufan Karadere2015-08-021-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Report supported signature algorithms in ClientHelloMichael Brown2015-08-021-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Check for UART existence in uart_select()Michael Brown2015-07-311-0/+1
| | | | | | | | | | | Check for existence of the UART in uart_select(), not just in uart_init(). This allows uart_select() to refuse to set a non-working address in uart->base, which in turns means that the serial console code will not attempt to use a non-existent UART. Reported-by: Torgeir Wulfsberg <Torgeir.Wulfsberg@kongsberg.com> Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [elf] Reject ELFBoot images requiring virtual addressingMichael Brown2015-07-291-0/+11
| | | | | | | | | | | | | | We do not set up any kind of virtual addressing before invoking an ELFBoot image. Reject if the image's program headers indicate that virtual addresses are not equal to physical addresses. This avoids problems when loading some RHEL5 kernels, which seem to include ELFBoot headers using virtual addressing. With this change, these kernels are no longer detected as ELFBoot, and so may be (correctly) detected as bzImage instead. Reported-by: Torgeir.Wulfsberg@kongsberg.com Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linebuf] Support buffering of multiple linesMichael Brown2015-07-281-6/+6
| | | | | | | | Allow line buffer to accumulate multiple lines, with buffered_line() returning each freshly-completed line as it is encountered. This allows buffered lines to be subsequently processed as a group. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pool] Add a generic concept of a pooled connectionMichael Brown2015-07-281-0/+127
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Add support for constructing and decoding retrieval messagesMichael Brown2015-07-281-0/+376
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Add support for constructing and decoding discovery messagesMichael Brown2015-07-282-0/+48
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [peerdist] Include trimmed range within content information blockMichael Brown2015-07-281-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow network devices to disclaim IRQ support at runtimeMichael Brown2015-07-281-1/+10
| | | | | | | | | | | | | | | | VLAN and 802.11 devices use a network device operations structure that wraps an underlying structure. For example, the vlan_operations structure wraps the network device operations structure of the underlying trunk device. This can cause false positives from the current implementation of netdev_irq_supported(), which will always report that VLAN devices support interrupts since it has no visibility into the support provided by the underlying trunk device. Fix by allowing network devices to explicitly flag that interrupts are not supported, despite the presence of an irq() method. Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Allow IPv4 socket addresses to include a scope IDMichael Brown2015-07-282-3/+17
| | | | | | | | | | | | Extend the IPv6 concept of "scope ID" (indicating the network device index) to IPv4 socket addresses, so that IPv4 multicast transmissions may specify the transmitting network device. The scope ID is not (currently) exposed via the string representation of the socket address, since IPv4 does not use the IPv6 concept of link-local addresses (which could legitimately be specified in a URI). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Redefine IP address constants to avoid unnecessary byte swappingMichael Brown2015-07-281-9/+15
| | | | | | | | Redefine various IPv4 address constants and testing macros to avoid unnecessary byte swapping at runtime, and slightly rename the macros to prevent code from accidentally using the old definitions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Treat a missing network device name as "netX"Michael Brown2015-07-281-0/+3
| | | | | | | | | When an IPv6 socket address string specifies a link-local or multicast address but does not specify the requisite network device name (e.g. "fe80::69ff:fe50:5845" rather than "fe80::69ff:fe50:5845%net0"), assume the use of "netX". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Replace AES implementationMichael Brown2015-07-272-13/+32
| | | | | | | | | Replace the AES implementation from AXTLS with a dedicated iPXE implementation which is slightly smaller and around 1000% faster. This implementation has been verified using the existing self-tests based on the NIST AES test vectors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add ECB block cipher mode (for debug and self-tests only)Michael Brown2015-07-272-0/+56
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add bit-rotation functions for 8-bit and 16-bit valuesMichael Brown2015-07-271-0/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xferbuf] Add xfer_buffer() to provide direct access to underlying bufferMichael Brown2015-07-221-0/+5
| | | | | | | Allow data transfer buffer users to provide direct access to their underlying data transfer buffer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xferbuf] Generalise to handle umalloc()-based buffersMichael Brown2015-07-221-1/+70
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Add xfer_check_order() utility functionMichael Brown2015-07-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Add intf_poke() helperMichael Brown2015-07-221-0/+5
| | | | | | | Reduce the cost of implementing object methods which convey no information beyond the fact that the method has been called. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Add profile_custom() for profiling with arbitrary time unitsMichael Brown2015-07-221-0/+14
| | | | | | | | Provide profile_custom() as a trivial wrapper around profile_update() to allow for the use of the profiling infrastructure by code using timers other than the default profile_timestamp() provider. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fault] Add inject_corruption() to randomly corrupt dataMichael Brown2015-07-221-0/+21
| | | | | | | Provide an inject_corruption() function that can be used to randomly corrupt data bytes with configurable probabilities. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fault] Generalise NETDEV_DISCARD_RATE fault injection mechanismMichael Brown2015-07-222-0/+33
| | | | | | | Provide a generic inject_fault() function that can be used to inject random faults with configurable probabilities. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fix receive and transmit completion reportingMichael Brown2015-07-221-14/+13Star
| | | | | | | | | | | | | | | | Fix the TxBuf value filled in by GetStatus() to report the transmit buffer address as required by the (now clarified) specification. Simplify "interrupt" handling in GetStatus() to report only that one or more packets have been transmitted or received; there is no need to report one GetStatus() "interrupt" per packet. Simplify receive handling to dequeue received packets immediately from the network device into an internal list (thereby avoiding the hacks previously used to determine when to report new packet arrivals). Originally-fixed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Gracefully close connections during shutdownMichael Brown2015-07-041-0/+7
| | | | | | | | | | | | | | | We currently do not wait for a received FIN before exiting to boot a loaded OS. In the common case of booting from an HTTP server, this means that the TCP connection is left consuming resources on the server side: the server will retransmit the FIN several times before giving up. Fix by initiating a graceful close of all TCP connections and waiting (for up to one second) for all connections to finish closing gracefully (i.e. for the outgoing FIN to have been sent and ACKed, and for the incoming FIN to have been received and ACKed at least once). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [gdb] Allow gdbstub to be started on an arbitrary serial portMichael Brown2015-06-291-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Attempt to generate ARPs as needed to repopulate REMAC cacheMichael Brown2015-06-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The only way to map an eIPoIB MAC address (REMAC) to an IPoIB MAC address is to intercept an incoming ARP request or reply. If we do not have an REMAC cache entry for a particular destination MAC address, then we cannot transmit the packet. This can arise in at least two situations: - An external program (e.g. a PXE NBP using the UNDI API) may attempt to transmit to a destination MAC address that has been obtained by some method other than ARP. - Memory pressure may have caused REMAC cache entries to be discarded. This is fairly likely on a busy network, since REMAC cache entries are created for all received (broadcast) ARP requests. (We can't sensibly avoid creating these cache entries, since they are required in order to send an ARP reply, and when we are being used via the UNDI API we may have no knowledge of which IP addresses are "ours".) Attempt to ameliorate the situation by generating a semi-spurious ARP request whenever we find a missing REMAC cache entry. This will hopefully trigger an ARP reply, which would then provide us with the information required to populate the REMAC cache. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Use new UART abstraction in serial console driverMichael Brown2015-06-292-9/+7Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [gdb] Use new UART abstraction in GDB serial transportMichael Brown2015-06-291-9/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Add general abstraction of a 16550-compatible UARTMichael Brown2015-06-292-0/+132
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [stp] Add support for detecting Spanning Tree Protocol non-forwarding portsMichael Brown2015-06-252-0/+77
| | | | | | | | | | | | | | | | | | A fairly common end-user problem is that the default configuration of a switch may leave the port in a non-forwarding state for a substantial length of time (tens of seconds) after link up. This can cause iPXE to time out and give up attempting to boot. We cannot force the switch to start forwarding packets sooner, since any attempt to send a Spanning Tree Protocol bridge PDU may cause the switch to disable our port (if the switch happens to have the Bridge PDU Guard feature enabled for the port). For non-ancient versions of the Spanning Tree Protocol, we can detect whether or not the port is currently forwarding and use this to inform the network device core that the link is currently blocked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add a generic concept of a "blocked link"Michael Brown2015-06-251-0/+17
| | | | | | | | | | | | When Spanning Tree Protocol (STP) is used, there may be a substantial delay (tens of seconds) from the time that the link goes up to the time that the port starts forwarding packets. Add a generic concept of a "blocked link" (i.e. a link which is up but which is not expected to communicate successfully), and allow "ifstat" to indicate when a link is blocked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add intelxvf driver for Intel 10 GigE virtual function NICsMichael Brown2015-05-161-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add support for mailbox used by virtual functionsMichael Brown2015-05-161-0/+1
| | | | | | | | Virtual functions use a mailbox to communicate with the physical function driver: this covers functionality such as obtaining the MAC address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add basic support for USB keyboardsMichael Brown2015-05-122-0/+3
| | | | | | | | | | | | When USB network card drivers are used, the BIOS' legacy USB capability is necessarily disabled since there is no way to share the host controller between the BIOS and iPXE. This currently results in USB keyboards becoming non-functional in USB-enabled builds of iPXE. Fix by adding basic support for USB keyboards, enabled by default in iPXE builds which include USB support. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add generic USB human interface device (HID) frameworkMichael Brown2015-05-122-0/+107
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add USB_INTERRUPT_OUT internal typeMichael Brown2015-05-111-2/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Disambiguate received ICMPv6 errorsMichael Brown2015-05-111-0/+12
| | | | | Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Provide usb_endpoint_name() for use by host controller driversMichael Brown2015-05-101-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uhci] Add support for UHCI host controllersMichael Brown2015-05-102-0/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ehci] Allow UHCI/OHCI controllers to locate the EHCI companion controllerMichael Brown2015-05-091-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add find_usb_bus_by_location() helper functionMichael Brown2015-05-091-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Maintain single lists of halted endpoints and changed portsMichael Brown2015-05-091-6/+0Star
| | | | | | | | | | When an EHCI hotplug action results in the controller disowning the port, it will result in a hotplug action on the corresponding UHCI or OHCI controller. Allow such hotplug actions to be carried out as part of the same call to usb_step() or usb_register_bus(), by maintaining a single central list of changed ports. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Maintain a list of all USB busesMichael Brown2015-05-091-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>