david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

2521 Commits

Author SHA1 Message Date
Stefan Hajnoczi 7eb555a8ae [GDB] Obey flow control when GDB connects. 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi fe79edfc3d [GDB] Remove unused DR6 debug register variable 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 578b056730 [GDB] UDP clean up and add netdev refcnt 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 3715c8c721 [GDB] Zero-extend 16-bit segment registers
When the 16-bit segment registers are accessed using 32-bit instructions
the high order bytes are undefined on older CPUs.  We now explicitly
zero the high order bytes when snapshotting the CPU state.  This ensures
that the GDB stub reports consistent values for the segment registers.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 5504fa9047 [GDB] Add copyright header for gdbmach.c 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 19386ec2c8 [GDB] Add watch and rwatch hardware watchpoints 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 6e670b5f38 [GDB] Remote debugging over UDP
This commit implements GDB over UDP.  Using UDP is more complex than
serial and has required some restructuring.

The GDB stub is now built using one or both of GDBSERIAL and GDBUDP
config.h options.

To enter the debugger, execute the gPXE shell command:
gdbstub <transport> [<options>...]

Where <transport> is "serial" or "udp".  For "udp", the name of a
configured network device is required:
gdbstub udp net0

The GDB stub listens on UDP port 43770 by default.
2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 9ec3ff95f0 [GDB] Atomic read/write for device memory 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 59b5465b30 [GDB] Handle kill and detach packets.
This commit also includes a test to ensure that single stepping works,
since continue, kill, detach, and single step all share code.
2008-06-30 19:19:48 +01:00
Michael Brown 27731d975e [romprefix] Fix PMM detection start address
Commit fd0aef9 introduced a typo that caused PMM detection to start at
paragraph 0xe00 rather than 0xe000.  (Detection would still work, since it
would scan until it ran out of base memory, but it would end up scanning
an unnecessarily large portion of base memory.)

Spotted by Sebastian Herbszt <herbszt@gmx.de>.
2008-06-28 23:18:11 +01:00
Michael Brown 4c75e9ded4 [nvs] Add support for ST M25P32 SPI flash devices 2008-06-27 14:39:25 -07:00
Michael Brown 2596a9aa9c [misc] Fix building on OpenBSD
OpenBSD throws compiler warnings that we can't reproduce on Linux, for
some reason.

Original patch from Dewey Hylton <dewey@hyltown.com>.
2008-06-27 22:35:26 +01:00
H. Peter Anvin b7882065f5 [a20] Send a null command to the KBC after changing A20
Send a null command, specifically "pulse outputs" with no outputs
selected, to the KBC after changing A20.  This was apparently done by DOS,
presumably as a synchronization hack, and the authors of the UHCI spec
thought it was inherent.  Therefore, there are systems out there (e.g. HP
DL360 G5) which will stop responsing to "legacy USB" unless they see the
null command, 0xFF, written to port 0x64 at the end of the A20 toggling
sequence.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-06-27 22:29:13 +01:00
Michael Brown 2b9e7a4767 [libc] Remove unused le32_to_cpup(x) and cpu_to_le16p() macros
If we ever need these macros, they should be defined in
include/{big,little}_bswap.h, and the whole family should be defined.
2008-06-27 22:12:44 +01:00
Steven Walter 14fe4d4ba5 [tg3] Recognize the BCM5789
Add an entry to tg3_nics for the BCM5789

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
2008-06-27 22:12:43 +01:00
Michael Brown ddf5c8d4d3 [cmdline] Fix image command-line construction for zero-length argument lists
This fixes a bug introduced in commit 4c85017.
2008-06-27 21:50:18 +01:00
Michael Brown 0ea821c7b7 [script] Remove arbitrary limit on script line lengths 2008-06-18 00:43:58 +01:00
Michael Brown 0d91c37ce5 [legacy] Align legacy drivers' __shared data to the maximum possible
Some drivers that still use the legacy-driver wrapper (tg3 in particular)
apparently do not specify their alignment constraints properly.  This
hack forces any __shared data to be maximally aligned.

Note that this provides only 16-byte alignment; it is not possible to
request alignment to any greater than 16 bytes using
__attribute__((aligned)), since the relocation code will preserve only 16
byte alignment (and operation under -DKEEP_IT_REAL cannot preserve more
that 16 byte alignment).

Idea proposed by Tim Hockin <thockin@google.com>
2008-06-14 20:01:14 +01:00
Michael Brown cd0e9bcd22 [prefix] When we have to hook INT 19, chain to original handler if possible
When the BIOS doesn't support BBS, hooking INT 19 is the only way to add
ourselves as a boot device.  If we have to do this, we should at least
try to chain to the original INT 19 vector if our boot fails.

Idea suggested by Andrew Schran <aschran@google.com>
2008-06-14 13:49:26 +01:00
Stefan Hajnoczi a71b4df1c9 [via-rhine] Fix erroneous uses of memory I/O instead of port I/O 2008-06-12 15:21:42 +01:00
Michael Brown 31c6df5365 [cleanup] Remove long-obsolete gpxe/async.h header file 2008-06-12 13:15:53 +01:00
Michael Brown ac28d054c8 [bzimage] Support kernel command lines of greater than 256 characters
2.6.22+ kernels have an extra field in the bzimage_header structure to
indicate the maximum permitted command-line length.  Use this if it is
available.
2008-06-12 02:19:10 +01:00
Michael Brown 4c85017968 [cmdline] Remove arbitrary limit on the length of image command lines 2008-06-12 02:12:10 +01:00
Michael Brown 031b30898a [smbios] Fix SMBIOS string fetching
A bug in read_smbios_string() was causing the starting offset of the
SMBIOS structure to be added twice, resulting in completely the wrong
strings being returned.

Bug identified by Martin Herweg <m.herweg@gmx.de>
2008-06-11 13:43:58 +01:00
Michael Brown c3811d4a13 [slam] Add support for SLAM window lengths of greater than one packet
Add the definition of SLAM_MAX_BLOCKS_PER_NACK, which is roughly
equivalent to a TCP window size; it represents the maximum number of
packets that will be requested in a single NACK.

Note that, to keep the code size down, we still limit ourselves to
requesting only a single range per NACK; if the missing-block list is
discontiguous then we may request fewer than SLAM_MAX_BLOCKS_PER_NACK
blocks.
2008-06-11 13:16:02 +01:00
Michael Brown 50810955e9 [console] Call cpu_nap() only if there is no input waiting
Avoid calling cpu_nap() until after we have determined that there is
no input ready to read.  This avoids delaying for one timer interrupt
(~50ms) in the case of

  if ( iskey() )
     char = getkey()

which happens to be present in monojob.c, which is where we spend most
of our time looping (e.g. during any download).

This should eliminate the irritating tendency of gPXE to lose
keypresses.

Discovered on a Dell system where the serial port seems to send in a
constant stream of 0xff characters; this wouldn't be a problem in
itself except that each one triggers the 50ms delay (as mentioned
above), which really kills performance.
2008-06-11 12:06:10 +01:00
Michael Brown 5d36ec6721 [slam] Implement SLAM flow control
On any fast network, or with any driver that may drop packets
(e.g. Infiniband, which has very small RX rings), the traditional
usage of the SLAM protocol will result in enormous numbers of packet
drops and a consequent large number of retransmissions.

By adapting the client behaviour, we can force the server to act more
like a multicast TFTP server, with flow control provided by a single
master client.

This behaviour should interoperate with any traditional SLAM client
(e.g. Etherboot 5.4) on the network.  The SLAM protocol isn't actually
documented anywhere, so it's hard to define either behaviour as
compliant or otherwise.
2008-06-11 09:41:31 +01:00
Michael Brown 32e8ab4df0 [retry] Add start_timer_fixed()
Allow for timers to be started with fixed timeouts.
2008-06-11 09:37:58 +01:00
Michael Brown 3a2c8a2690 [dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFER
A missing test for dhcp->dhcpoffer in dhcp_timer_expired() was causing
the client to transition to DHCPREQUEST after timing out on waiting
for ProxyDHCP even if no DHCPOFFERs had been received.
2008-06-11 06:20:49 +01:00
Michael Brown 2456b9b4ba [slam] Request all remaining blocks if we run out of space for the blocklist
In a SLAM NACK packet, if we run out of space to represent the
missing-block list, then indicate all remaining blocks as missing.
This avoids the need to wait for the one-second timeout before
receiving the blocks that otherwise wouldn't have been requested due
to running out of space.
2008-06-10 12:36:39 +01:00
Michael Brown 1e5c2d48cb [slam] Speed up NACK transmission by restricting the block-list length
Shorter NACK packets take less time to construct and spew out less
debug output, and there's a limit to how useful it is to send a
complete missing-block list anyway; if the loss rate is high then
we're going to have to retransmit an updated missing-block list
anyway.

Also add pretty debugging output to show the list of requested blocks.
2008-06-10 11:23:34 +01:00
Michael Brown 81d92d5181 [slam] Fix multicast address parsing
slam_parse_multicast_address() was failing to strip the initial "/"
from the URI path.
2008-06-10 10:04:02 +01:00
Michael Brown 798ddf884f [undi] Ask for promiscuous packet reception when using UNDI driver
We never set up specific multicast filters; native drivers will ask
the card to receive all multicast packets.  The only way to achieve
this via the UNDI API is to enable promiscuous mode.
2008-06-10 08:56:44 +01:00
Michael Brown 72c1bb8224 [slam] Add Scalable Local Area Multicast (SLAM) protocol support
Tested against the mini-slamd server located in contrib/mini-slamd
with a single client, on a lossy network.
2008-06-10 00:04:19 +01:00
Michael Brown aa160211c2 [udp] Verify local socket address (if specified) for UDP sockets
UDP sockets can be used for multicast, at which point it becomes
plausible that we could receive packets that aren't destined for us
but that still match on a port number.
2008-06-10 00:01:29 +01:00
Michael Brown 77a5cc6b13 [ELF] Add ability to boot ELF images generated by wraplinux and mkelfImage
Delete ELF as a generic image type.  The method for invoking an
ELF-based image (as well as any tables that must be set up to allow it
to boot) will always depend on the specific architecture.  core/elf.c
now only provides the elf_load() function, to avoid duplicating
functionality between ELF-based image types.

Add arch/i386/image/elfboot.c, to handle the generic case of 32-bit
x86 ELF images.  We don't currently set up any multiboot tables, ELF
notes, etc.  This seems to be sufficient for loading kernels generated
using both wraplinux and coreboot's mkelfImage.

Note that while Etherboot 5.4 allowed ELF images to return, we don't.
There is no callback mechanism for the loaded image to shut down gPXE,
which means that we have to shut down before invoking the image.  This
means that we lose device state, protection against being trampled on,
etc.  It is not safe to continue afterwards.
2008-06-09 13:50:00 +01:00
Marty Connor fe3162ab1c [Makefile] Add $(BIN)/undionly.kpxe as default build target 2008-06-09 08:44:11 -04:00
Marty Connor db5f64ecdc [Makefile] Add "+" to end of version string for git-generated images
This "+" should be removed when a tarball release is done.
2008-06-06 16:40:16 -04:00
Michael Brown b5215803f0 [Makefile] Use .PRECIOUS instead of .SECONDARY for bin/%.tmp targets
Revert "Use .SECONDARY instead of .PRECIOUS for bin/%.tmp targets."

This reverts commit de29e5a39c.

.SECONDARY doesn't seem to work properly with the target patterns of
implicit rules.  In particular, a "make clean ; make bin/rtl8139.dsk"
will correctly leave the bin/rtl8139.dsk.tmp file present when .PRECIOUS
is used, but not when .SECONDARY is used.

This is slightly irritating since we don't want the
"do-not-delete-if-interrupted" semantics of .PRECIOUS, but it seems to be
the best compromise.
2008-06-06 14:25:25 +01:00
Michael Brown 5102033215 [DHCP] Add "dhcp-server" setting to help end-user diagnostics 2008-06-05 15:43:34 +01:00
Stefan Hajnoczi 4180815a90 [GDB] Test suite for the GDB stub 2008-06-05 00:45:51 +01:00
Stefan Hajnoczi 04bc50f025 [GDB] Add GDB stub for remote debugging
See http://etherboot.org/wiki/dev/gdbstub for documentation.
2008-06-05 00:45:50 +01:00
Stefan Hajnoczi 831db76ff7 [Serial] Split serial console from serial driver 2008-06-05 00:45:43 +01:00
Stefan Hajnoczi f866b17998 [util] config-local.h to avoid accidental commits
During development it is often handy to change the config.h options from
their defaults, for example to enable debugging features.

To prevent accidental commits of debugging config.h changes, mdc
suggested having a config-local.h that is excluded from source control.
This file acts as a temporary config.h and can override any of the
defaults.

This commit is an attempt to implement the config-local.h feature.

The config.h file now has the following as its last line:
/* @TRYSOURCE config-local.h */

The @TRYSOURCE directive causes config-local.h to be included at that
point in the file.  If config-local.h does not exist, no error will be
printed and parsing will continue as normal.  Therefore, mkconfig.pl is
"trying" to "source" config-local.h.
2008-06-05 00:45:33 +01:00
Stefan Hajnoczi 842165ef76 [GDBSYM] Remove unused gdbsym.c
The GDBSYM config.h option was an attempt at QEMU GDB debugging.  I have
removed the code since it is unused and may confuse people wanting to
use the GDB stub.
2008-06-05 00:45:32 +01:00
Michael Brown 1a68d3fef3 [TCP] Avoid shrinking TCP window
Maintain state for the advertised window length, and only ever increase
it (instead of calculating it afresh on each transmit).  This avoids
triggering "treason uncloaked" messages on Linux peers.

Respond to zero-length TCP keepalives (i.e. empty data packets
transmitted outside the window).  Even if the peer wouldn't otherwise
expect an ACK (because its packet consumed no sequence space), force an
ACK if it was outside the window.

We don't yet generate TCP keepalives.  It could be done, but it's unclear
what benefit this would have.  (Linux, for example, doesn't start sending
keepalives until the connection has been idle for two hours.)
2008-06-05 00:28:17 +01:00
Michael Brown d615b00443 [embed] Add missing register_image() to image/embedded.c
When the embedded image is a script, the unregister_image() performed by
image/script.c corrupts memory, since image/embedded.c omitted the call
to register_image().

This is the first bug fixed using Stefan Hajnoczi's gdb stub for gPXE.
2008-06-04 00:02:23 +01:00
Michael Brown 75965c9c6e [iSCSI] Produce meaningful errors on login failure
Return the most appropriate of EACCES, EPERM, ENODEV, ENOTSUP, EIO or
EINVAL depending on the exact error returned by the target, rather than
just always returning EPERM.

Also, ensure that error strings exist for these errors.
2008-06-03 23:47:20 +01:00
Michael Brown c899bdc5a8 [Makefile] Remove obsolete SRCDIRS 2008-05-23 02:35:20 +01:00
Michael Brown 7cd08434ea [prefix] Prompt for entering gPXE shell during POST
The ROM prefix now prompts the user to enter the gPXE shell during POST;
this allows for configuring gPXE without needing to attempt to boot from
it.  (It also slows down system boot by three seconds per gPXE ROM, but
hey.)

This is apparently a certain OEM's requirement for option ROMs.
2008-05-22 15:14:33 +01:00
Michael Brown fd0aef9ee1 [prefix] Add PCI bus:dev.fn to ROM product string
This allows multiple gPXE ROMs in a system to be disambiguated at boot
time; the PCI ID will show up in the boot menu for a BBS-compliant BIOS.
2008-05-21 18:43:58 +01:00
Michael Brown 30cd348689 [SMBIOS] Interpret UUIDs as being in network-endian order
Various specification documents disagree about the byte ordering of
UUIDs.  However, SMBIOS seems to use the standard in which everything is
in network-endian order.

This doesn't affect anything sent on the wire; only what gets printed on
the screen when the "uuid" variable is displayed.
2008-05-20 18:41:36 +01:00
Michael Brown 7d01bf663e [libc] Fix isdigit(), islower() and isupper().
From: Stefan Hajnoczi <stefanha@gmail.com>
2008-05-19 16:34:17 +01:00
Michael Brown 78281b09e6 [tg3] Add support for tg3-5721
From: Daniel Mealha Cabrita <dancab@utfpr.edu.br>

I've added tg3-5721 support for gPXE, the patch (against gpxe-0.9.3) is
attached to this message.

This chipset is present in HP ML150 G2 servers (possibly other HP machines
as well).
2008-05-19 16:22:13 +01:00
Michael Brown 1dcc60e5ad [IPv4] Fix multicast address checking
From: Viswanath Krishnamurthy <viswa.krish@gmail.com>

The current ipv4 incorrectly checks the IP address for multicast address.
This causes valid IPv4 unicast address to be trated as multicast address

For e.g if the PXE/tftp server IP address is 192.168.4.XXX where XXX is
224 or greater, it gets treated as multicast address and a ethernet
multicast address is sent out on the wire causing timeouts
2008-05-19 16:19:46 +01:00
Michael Brown 00ed567069 [iSCSI] Offer CHAP authentication only if we have a username and password
Some EMC targets will fail if we advertise that we can authenticate with
CHAP, but the target is configured to allow unauthenticated access to that
target.  We advertise AuthMethod=CHAP,None; the target should (I think)
select AuthMethod=None for unprotected targets.  IETD does this, but an
EMC Celerra NS83 doesn't.

Fix by offering only AuthMethod=None if the user hasn't supplied a
username and password; this means that we won't be offering CHAP
authentication unless the user is expecting to use it (in which case the
target is presumably configured appropriately).

Many thanks to Alessandro Iurlano <alessandro.iurlano@gmail.com> for
reporting and helping to diagnose this problem.
2008-04-24 13:48:29 +01:00
Michael Brown eec9814a0e [Makefile] Quick hack: always define pci_{vendor,device}_id
ROMs will refuse to build unless pci_vendor_id and pci_device_id are
defined.  We probably ought to fix up the Makefile (and the ROM prefix) so
that they're required only for PCI ROMs, but this will do for now.
2008-04-23 16:24:00 +01:00
Michael Brown 3430226d40 [MTNIC] Minor cleanups of vendor-provided driver for Mellanox 10GigE cards
Drivers are not allowed to call printf().  Converted eprintf() to DBG(),
and removed spurious startup banner.

Fixed hardcoded inclusion of little_bswap.h

Use EIO rather than 1 as an error number.
2008-04-22 17:50:30 +01:00
Michael Brown 1ba959c6b3 [NETDEV] Add notion of link state
Add ability for network devices to flag link up/down state to the
networking core.

Autobooting code will now wait for link-up before attempting DHCP.

IPoIB reflects the Infiniband link state as the network device link state
(which is not strictly correct; we also need a succesful IPoIB IPv4
broadcast group join), but is probably more informative.
2008-04-22 17:40:50 +01:00
Michael Brown d72bf13b78 [Infiniband] Fix event queue doorbell ringing on Arbel 2008-04-22 02:18:32 +01:00
Michael Brown c9fb012d4f [Infiniband] Add multiport support for Arbel cards 2008-04-22 01:37:00 +01:00
Michael Brown 35a5836677 [Infiniband] Move event-queue process from driver to Infiniband core 2008-04-21 13:23:11 +01:00
Michael Brown e55bab3ce3 [Hermon] Fix event queue doorbells.
Event queue doorbells must use UAR pages 0-127 depending on event queue
number; other doorbells must use pages 128+ (and we choose to use page
128).
2008-04-18 05:33:39 +01:00
Michael Brown a176a24ac0 [Infiniband] Add preliminary multiple port support for Hermon cards
Infiniband devices no longer block waiting for link-up in
register_ibdev().

Hermon driver needs to create an event queue and poll for link-up events.

Infiniband core needs to reread MAD parameters when link state changes.

IPoIB needs to cope with Infiniband link parameters being only partially
available at probe and open time.
2008-04-18 02:50:48 +01:00
Michael Brown 3475b693b7 [HCI] Display "Not an executable image" when appropriate
PXE is a catch-all image format with no signature checks.  If an
unsupported image file is loaded, it will be treated as a PXE image.  In
most cases, the image will be too large to be loaded as a PXE image (which
has to fit in base memory), so the error returned to the user will be that
the segment could not fit within the memory region.

Add an explicit check to pxe_image.c to reject images larger than base
memory with ENOEXEC.

Add ENOEXEC to the error string table.
2008-04-08 16:28:00 +01:00
Marty Connor fbb6a3fd65 [Drivers-r8169] Add support for newer rtl8169 variants from Hilko Bengen
03-19-2008, Hilko Bengen, Cleanups and fixes for newer cards
(successfully tested with 8110SC-d onboard NIC)
2008-03-31 09:14:23 -04:00
H. Peter Anvin b107637008 [http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 client
gPXE is not compliant with the HTTP/1.1 specification (RFC 2616),
since it lacks support for "Transfer-Encoding: chunked".  gPXE is,
however, compliant with the HTTP/1.0 specification (RFC 1945), which
does not require "Transfer-Encoding: chunked" to be supported.

The only HTTP/1.1 feature that gPXE uses is the "Host:" header, but
servers universally accept that one from HTTP/1.0 clients as an
optional extension (it is obligatory for HTTP/1.1).  gPXE does not,
for example, appear to support connection caching.  Advertising as a
HTTP/1.0 client will typically make the server close the connection
immediately upon sending the last data, which is actually beneficial
if we aren't going to keep the connection alive anyway.
2008-03-31 05:01:08 -07:00
Michael Brown feade5da6e [Settings] Expose SMBIOS via settings API
In particular, expose the system UUID as a setting ("smbios/uuid").
2008-03-28 15:35:06 +00:00
Michael Brown aa74a7d53c [DHCP] Add support for ProxyDHCP requests
The PXE spec is (as usual) unclear on precisely when ProxyDHCPREQUESTs
should be issued.  We adapt the following, slightly paranoid approach:

  If an offer contains an IP address, then it is a normal DHCPOFFER.

  If an offer contains an option #60 "PXEClient", then it is a
  ProxyDHCPOFFER.  Note that the same packet can be both a normal
  DHCPOFFER and a ProxyDHCPOFFER.

  After receiving the normal DHCPACK, if we have received a
  ProxyDHCPOFFER, we unicast a ProxyDHCPREQUEST back to the ProxyDHCP
  server on port 4011.  If we time out waiting for a ProxyDHCPACK, we
  treat this as a non-fatal error.
2008-03-27 16:45:15 +00:00
Michael Brown af466aedf1 [Settings] find_child_settings() accepts a NULL parent 2008-03-27 06:07:19 +00:00
Michael Brown 7a4e212fe2 [DHCP] Treat empty fields in DHCP packets as non-existent.
This avoids confusing other code by insisting that we have e.g. a
filename consisting of 128 zero bytes.
2008-03-27 06:06:36 +00:00
Michael Brown 978996cdae [usr] Offer user a second chance to enter the shell on boot failure 2008-03-26 23:16:20 +00:00
Michael Brown 4b267ed713 [libc] Whitespace cleanup in errno.h 2008-03-26 22:57:25 +00:00
H. Peter Anvin d810dc5be2 [PXEXT] Update documentation
Add documentation for the FILE_EXEC and FILE_CHECK_API extension
calls, and update the documentation for the FILE_READ call.
2008-03-26 15:14:55 -07:00
H. Peter Anvin 61ee294875 [PXEXT] Change the PXE return code for EWOULDBLOCK
Change the PXE return code for EWOULDBLOCK from PXENV_STATUS_FAILURE
to PXENV_STATUS_TFTP_OPEN.  This code is only used by the FILE_READ
PXEXT call, and is necessary to distinguish "error" from "no data" in
that call.

(The only other nonblocking call is UDP_READ, where the caller doesn't
care about the distinction, however, gPXE doesn't use EWOULDBLOCK
internally to represent this condition in that code.)
2008-03-26 15:12:19 -07:00
H. Peter Anvin d62e89d776 [PXEXT] Add FILE_API_CHECK API function
Add FILE_API_CHECK to the PXEXT API so the NBP can query the
availability and status of the API.
2008-03-26 15:10:56 -07:00
Michael Brown 83617e5b1c [DHCP] Save precious packet-aligned memory by copying DHCP responses
Copy DHCP responses to a standard malloc()ed buffer, rather than
retaining the I/O buffer that they arrived in.
2008-03-26 12:25:59 +00:00
Michael Brown 96edbd128f [PXEXT] Avoid queueing zero-length buffers in posix_io.c
read_user() assumes that zero-length buffers don't exist, and optimises
around this.
2008-03-25 21:10:21 +00:00
Michael Brown 92d15eff30 [Settings] Remove assumption that all settings have DHCP tag values
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.
2008-03-25 20:46:16 +00:00
Michael Brown ee5bdb0d75 [PXEXT] Avoid returning a false EOF when we have an empty buffer queued 2008-03-25 20:29:42 +00:00
Michael Brown 7234f91bf8 [DHCP] Fix DHCP state confusion.
DHCP code was using an incorrect check for whether to construct a
DHCPDISCOVER or DHCPREQUEST packet.
2008-03-25 16:38:01 +00:00
Michael Brown 8f00c84828 [Settings] Add named setting for next-server
It's probably easier to have a named setting for next-server, rather
than to explain to people why they need to pretend it is option 175.3.
2008-03-24 00:48:06 +00:00
Michael Brown c06e6d0635 [Makefile] Use -MM instead of -M in dependency generation
Using -MM strips out any system header files from the dependency list,
which means that we could safely use an external stdarg.h if we wanted
to.
2008-03-24 00:28:55 +00:00
Michael Brown dbf8a02e8f [libc] Use __builtin_va_list et al in stdarg.h
The home-grown versions don't work properly for static variadic
functions, when gcc can choose to use a non-standard calling convention.
2008-03-24 00:23:11 +00:00
Michael Brown 23e077666b [Settings] copy_settings() should not fail if some settings are missing! 2008-03-23 23:28:21 +00:00
Michael Brown 978865da2f [IPv4] Use default netmasks when no subnet mask is specified. 2008-03-23 22:20:47 +00:00
Michael Brown 2af6c8d130 [IPv4] Tidy up some header files. 2008-03-23 22:05:47 +00:00
Michael Brown ee4206a8a7 [DHCP] Fix up fake-packet creation as used by PXENV_GET_CACHED_INFO
Add dedicated functions create_dhcpdiscover(), create_dhcpack() and
create_proxydhcpack() for use by external code such as the PXE preboot
code.

Register ProxyDHCP options under the global scope "proxydhcp".

Unregister previously-acquired DHCP and ProxyDHCP settings when DHCP
succeeds.
2008-03-23 21:58:05 +00:00
Marty Connor 1741e3e761 [DHCP] FIXME: quick temporary settings fix, needs update for new API 2008-03-21 23:37:02 -04:00
Michael Brown 8fceee785f Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe 2008-03-22 00:50:06 +00:00
Michael Brown 65c0974d1f [Settings] Bugfix: store_setting() now applies changes even on root block 2008-03-22 00:40:33 +00:00
Michael Brown e5cea13e51 [Settings] Implement simple_settings backed with extensible DHCP options 2008-03-22 00:31:08 +00:00
Michael Brown a462c96ffc [Settings] DHCP is now working using the new settings API. 2008-03-21 22:55:59 +00:00
Michael Brown 8afb36c3bc [Settings] Migrate DHCP and NVO code to the new settings API (untested) 2008-03-21 22:15:31 +00:00
Michael Brown bb32b8999c [DHCP] Kill off some no-longer-used DHCP functions 2008-03-21 00:50:12 +00:00
Michael Brown a9b62cfe8c [Settings] Use a settings applicator in ibft.c 2008-03-21 00:49:44 +00:00
Michael Brown 1edbcd4246 [Settings] Use a settings applicator to set the default TFTP URI. 2008-03-21 00:26:29 +00:00
Michael Brown 720e256c50 [Misc] Kill off long-redundant tests/dhcptest.c 2008-03-21 00:07:36 +00:00
Michael Brown 0fbe484566 [IPv4] Add a config option for IPv4
IPv4 may not always be dragged into the link, so add a specific
configuration option for it.
2008-03-21 00:06:28 +00:00
Michael Brown aec9b8a41b [Settings] Use a settings applicator to configure IPv4 routes. 2008-03-21 00:01:27 +00:00