david/ipxe
Archived
1
0
Commit Graph

1053 Commits

Author SHA1 Message Date
Michael Brown
d9751edafa [infiniband] Flush uncompleted work queue entries at QP teardown
Avoid leaking I/O buffers in ib_destroy_qp() by completing any
outstanding work queue entries with a generic error code.  This
requires the completion handlers to be available to ib_destroy_qp(),
which is done by making them static configuration parameters of the CQ
(set by ib_create_cq()) rather than being provided on each call to
ib_poll_cq().

This mimics the functionality of netdev_{tx,rx}_flush().  The netdev
flush functions would previously have been catching any I/O buffers
leaked by the IPoIB data queue (though not by the IPoIB metadata
queue).
2008-11-11 05:31:06 +00:00
Michael Brown
9a52ba0cfa [netdevice] Retain and report detailed error breakdowns
netdev_rx_err() and netdev_tx_complete_err() get passed the error
code, but currently use it only in debug messages.

Retain error numbers and frequencey counts for up to
NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX.
This allows the "ifstat" command to report the reasons for TX/RX
errors in most cases, even in non-debug builds.
2008-11-08 05:30:30 +00:00
Michael Brown
43aa69d7b3 [aoe] Start retry timer before potential temporary transmission failure
The retry timer needs to be running as soon as we know that we are
trying to transmit a command.  If transmission fails because of a
temporary error condition, then the timer will allow us to retry the
transmission later.
2008-11-08 04:36:42 +00:00
Michael Brown
0a6c66a830 [settings] Add the notion of a "tag magic" to numbered settings
Settings can be constructed using a dotted-decimal notation, to allow
for access to unnamed settings.  The default interpretation is as a
DHCP option number (with encapsulated options represented as
"<encapsulating option>.<encapsulated option>".

In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to
interpret the dotted-decimal notation as referring to non-DHCP
options.  In this case, it becomes necessary for these contexts to
ignore standard DHCP options, otherwise we end up trying to, for
example, retrieve the boot filename from SMBIOS.

Allow settings blocks to specify a "tag magic".  When dotted-decimal
notation is used to construct a setting, the tag magic value of the
originating settings block will be ORed in to the tag number.
Store/fetch methods can then check for the magic number before
interpreting arbitrarily-numbered settings.
2008-10-30 21:47:14 +00:00
Michael Brown
cbf9003d66 [tftp] Add EUNIQ_xx values to differentiate the many EINVAL errors 2008-10-21 23:00:13 +01:00
Michael Brown
3a505dfc35 [netdevice] Change link-layer push() and pull() methods to take raw types
EFI requires us to be able to specify the source address for
individual transmitted packets, and to be able to extract the
destination address on received packets.

Take advantage of this to rationalise the push() and pull() methods so
that push() takes a (dest,source,proto) tuple and pull() returns a
(dest,source,proto) tuple.
2008-10-16 05:13:40 +01:00
Michael Brown
6b9cc25556 [netdevice] Split multicast hashing out into an mc_hash method
Multicast hashing is an ugly overlap between network and link layers.
EFI requires us to provide access to this functionality, so move it
out of ipv4.c and expose it as a method of the link layer.
2008-10-16 05:12:56 +01:00
Michael Brown
f945d6d201 [retry] Use a separate flag to indicate that a retry timer is running
Using start==0 to indicate a stopped timer is dangerous, because 0 is a
valid value for the current tick counter.
2008-10-12 15:11:20 +01:00
Michael Brown
2e812235f4 [makefile] Add -Wformat-nonliteral as an extra warning category
-Wformat-nonliteral is not enabled by -Wall and needs to be explicitly
 specified.

Modified the few files that use nonliteral format strings to work with
this new setting in place.

Inspired by a patch from Carl Karsten <carl@personnelware.com> and an
identical patch from Rorschach <r0rschach@lavabit.com>.
2008-10-10 18:41:24 +01:00
Michael Brown
2d41dead08 [iscsi] Fix LUN parsing in the iSCSI root-path 2008-09-27 23:53:31 +01:00
Michael Brown
aa8d972581 [dhcp] Accept BOOTP as well as DHCP 2008-09-25 01:35:15 +01:00
Michael Brown
0e408658b9 [iscsi] Change default initiator name prefix to "iqn.2000-01.org.etherboot:"
The domain etherboot.org was actually registered on 2000-01-09, not
2000-09-01.  (To put it another way, it was registered on 1/9/2000 (US
date format) rather than 1/9/2000 (sensible date format); this may
illuminate the cause of the error.)

"iqn.2000-09.org.etherboot:" is still valid as per RFC3720, but may be
surprising to users, so change it to something less unexpected.

Thanks to the anonymous contributor for pointing this one out.
2008-09-19 17:46:07 +01:00
Michael Brown
30fb3b3810 [undi] Fill in ProtType correctly in PXENV_UNDI_ISR
Determine the network-layer packet type and fill it in for UNDI
clients.  This is required by some NBPs such as emBoot's winBoot/i.

This change requires refactoring the link-layer portions of the
gPXE netdevice API, so that it becomes possible to strip the
link-layer header without passing the packet up the network stack.
2008-08-20 03:21:37 +01:00
Michael Brown
a1d0f6ed2e [dhcp] Do not restrict minimum retry time for ProxyDHCPREQUEST
The ProxyDHCPREQUEST is a unicast packet, so the first request will
almost always be lost due to not having the IP address in the ARP
cache.  If the minimum retry time is set to one second (as per commit
ff2b6a5), then ProxyDHCP will time out and give up before managing to
successfully transmit a request.

The DHCP timers need to be reworked anyway, so this mild hack is
acceptable for now.
2008-08-13 21:51:53 +01:00
Andrew Schran
ff2b6a512d [retry] Added configurable timeouts to retry timer
New min_timeout and max_timeout fields in struct retry_timer allow
users of this timer to set their own desired minimum and maximum
timeouts, without being constrained to a single global minimum and
maximum. Users of the timer can still elect to use the default global
values by leaving the min_timeout and max_timeout fields as 0.
2008-08-12 01:05:26 +01:00
Michael Brown
5d4839b577 [iSCSI] Add support for mutual CHAP
Allow initiator to verify target authentication using CHAP.
2008-08-11 03:43:12 +01:00
Michael Brown
f178436bb1 [pxe] If no ProxyDHCPACK exists, use DHCPACK for the fake ProxyDHCPACK packet
WinPE seems to have a bug that causes it to always use the TFTP server
IP address and filename from the ProxyDHCPACK packet, even if the
ProxyDHCPACK packet doesn't exist.  This causes it to end up
attempting to fetch a file such as

  tftp://0.0.0.0/bootmgr.exe

If we don't have a ProxyDHCPACK to use, we pretend that it was a copy
of the DHCPACK packet.  This works around the problem, and hopefully
won't surprise any NBPs.
2008-08-02 03:03:42 +01:00
Michael Brown
ed73d53503 [dhcp] Work around a bug in Altiris RDP
Altiris erroneously cares about the ordering of DHCP options, and will
get confused if we don't construct them in the order it expects.

This is observed (so far) only when attempting to deploy 64-bit Win2k3.
2008-08-01 21:49:11 +01:00
Sergey Vlasov
e6cd16946a [ftp] Terminate processing after receiving an error
When an error reply (not 1xx, 2xx or 3xx) was received, ftp_reply()
invoked ftp_done() to close connections, but did not return, and the
rest of code in this function could try to send commands to the closed
control connection.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
2008-07-30 20:27:09 +01:00
Michael Brown
8f4c2b4a4c [ftp] Cope with RETR completion prior to all data received
Based on a patch contributed by Sergey Vlasov <vsu@altlinux.ru> :

  In my testing with "qemu -net user" the 226 response to RETR was
  often received earlier than final packets of the data connection;
  this caused the received file to become truncated without any error
  indication.  Fix this by adding an intermediate state FTP_TRANSFER
  between FTP_RETR and FTP_QUIT, so that the transfer is considered to
  be complete only when both the end of data connection is encountered
  and the final reply to the RETR command is received.
2008-07-30 20:22:49 +01:00
Michael Brown
21e9e801e2 [udp] Avoid reusing auto-allocated ports after connection close.
This duplicates a fix made to tcp.c in commit
d5735c631c.
2008-07-10 04:21:10 +01:00
Michael Brown
6f39dfe6c0 [dhcp] Verify DHCP server source port
Verifying server ID and DHCP transaction ID is insufficient to
differentiate between DHCPACK and ProxyDHCPACK when the DHCP server and
Proxy DHCP server are the same machine.
2008-07-10 04:11:09 +01:00
Michael Brown
2df682c5be [dhcp] Allow DHCP non-option settings to be cleared
dhcppkt_store() is supposed to clear the setting if passed NULL for the
setting data.  In the case of fixed-location fields (e.g. client IP
address), this requires setting the content of the field to all-zeros.
2008-07-08 01:13:59 +01:00
Michael Brown
227bb05a50 [tftp] Strip the initial '/' to keep Windows TFTP servers happy. 2008-07-02 15:01:25 -07:00
Michael Brown
fdb8481de1 [dhcp] Verify server identifier on ProxyDHCPACKs
Perform the same test for a matching DHCP_SERVER_IDENTIFIER on
ProxyDHCPACKs as we do for DHCPACKs.  Otherwise, a retransmitted
DHCPACK can end up being treated as the ProxyDHCPACK.

I have a vague and unsettling memory that this test was deliberately
omitted, but I can't remember why, and can't find anything in the VC
logs.
2008-06-30 17:56:37 -07: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
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
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
5102033215 [DHCP] Add "dhcp-server" setting to help end-user diagnostics 2008-06-05 15:43:34 +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
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
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
35a5836677 [Infiniband] Move event-queue process from driver to Infiniband core 2008-04-21 13:23:11 +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
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
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
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
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
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
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
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
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
1edbcd4246 [Settings] Use a settings applicator to set the default TFTP URI. 2008-03-21 00:26:29 +00:00
Michael Brown
aec9b8a41b [Settings] Use a settings applicator to configure IPv4 routes. 2008-03-21 00:01:27 +00:00
Michael Brown
cf03304620 [Settings] Introduce settings applicators.
Convert DHCP option applicators in dns.c and iscsi.c to settings
applicators.

Kill off DHCP option applicators.
2008-03-20 23:15:48 +00:00
Michael Brown
acfa14423e [Settings] Add per-netdevice settings block
Add a configuration settings block for each net device.  This will
provide the parent scope for settings applicable only to that network
device (e.g. non-volatile options stored on the NIC, options obtained via
DHCP, etc.).

Expose the MAC address as a setting.
2008-03-20 21:06:53 +00:00
Alexey Zaytsev
a1572e0ab0 Modify gPXE core and drivers to work with the new timer subsystem
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
2008-03-02 03:41:10 +03:00
Michael Brown
844828cb15 [DHCP] Fix RFC4390 client identifier constructions.
RFC 4390 provides for the DHCP client identifier to contain the link-layer
hardware type and MAC address when the MAC address exceeds 16 bytes.
However, the hardware type field is only 8 bits; we were assuming 16 bits.
2008-02-27 16:55:46 +00:00
Michael Brown
bc3f0a25c6 [Infiniband] Add preliminary support for multi-port devices.
Arbel and Hermon cards both have multiple ports.  Add the
infrastructure required to register each port as a separate IB
device.  Don't yet register more than one port, since registration
will currently fail unless a valid link is detected.

Use ib_*_{set,get}_{drv,owner}data wrappers to access driver- and
owner-private data on Infiniband structures.
2008-02-27 13:59:56 +00:00
Michael Brown
6570203571 [Infiniband] Centralise MAD operations
Pull out common code for handling management datagrams from arbel.c
and hermon.c into infiniband.c.

Add port number to struct ib_device.

Add open(), close() and mad() methods to struct ib_device_operations.
2008-02-26 22:56:19 +00:00
Michael Brown
ea5ad4be91 [Infiniband] Fix typo in debug statement 2008-02-23 10:48:18 +00:00
Michael Brown
563955ce37 [Infiniband] Add missing list_del()s in ib_create_qp() failure path. 2008-02-23 10:48:10 +00:00
Michael Brown
428c6342bc Fixes for EqualLogic iSCSI targets:
Allow port numbers in iSCSI redirection.

  Wait for SCSI status, not just the final data-in (which may be followed
  by an explicit SCSI Response PDU if the S bit is not set).
2008-02-07 22:46:26 +00:00
Michael Brown
122abb50af Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe 2008-01-22 18:53:01 +00:00
Michael Brown
f6a8158eed Make seek information part of the xfer metadata, rather than an entirely
separate xfer method.

Add missing .alloc_iob entries to several xfer_interface_operations
structures.
2008-01-08 16:46:55 +00:00
Michael Brown
3311169707 When the DHCP file/sname fields are empty, don't allow them to override
their equivalent DHCP-option-specified values.
2008-01-07 13:50:32 +00:00
Michael Brown
82bae302b1 Fix off-by-one error (discovered by Shao Miller). 2008-01-07 13:12:43 +00:00
Michael Brown
f3265b4bf8 Add preliminary support for MTFTP. 2007-12-26 18:51:20 +00:00
Michael Brown
1949641d10 Fix compiler warnings that appear only on OpenBSD. 2007-12-06 14:16:46 -06:00
Michael Brown
798f7f6b8e Kill off some warnings-problematic debug statements in ndp.c; the code
is non-functional anyway.
2007-12-07 01:51:08 +00:00
Michael Brown
df868476e7 Various warnings fixups for OpenBSD with gcc-3.3.5. 2007-12-07 00:11:43 +00:00
Michael Brown
423e9d72f3 udp_open_promisc() calls udp_open_common() with peer==NULL. 2007-11-28 11:56:14 +00:00
Michael Brown
3b1efba864 Add RFC2090 TFTP multicast support. 2007-11-28 10:57:26 +00:00
Michael Brown
f770744ee0 Quick hack to be able to accept transfers from servers that don't
supply options.
2007-11-25 16:06:29 +00:00
Michael Brown
b3abf25e3c Allow DHCP server to instruct gPXE to ignore ProxyDHCP (which will
also avoid waiting for ProxyDHCP offers).

Also reduce the ProxyDHCP timeout, because it's already irritating me.
2007-11-21 22:10:04 +00:00
Michael Brown
0becbf5fba Add ProxyDHCP support. 2007-11-21 21:51:43 +00:00
Michael Brown
fb809da2df Remove some assumptions about DHCP obtaining only a single options block. 2007-11-21 04:48:18 +00:00
Michael Brown
8d18338ae7 Add PXE-required DHCP options to DHCPDISCOVER and DHCPREQUEST packets. 2007-11-21 03:57:30 +00:00
Michael Brown
26f3a09ccf Add UUID to DHCP request as option 97 (if available). 2007-11-21 03:29:53 +00:00
Michael Brown
c194b0c4bf Work around a bug in the OpenSolaris iSCSI target.
We didn't specify values for MaxRecvDataSegmentLength and
MaxBurstLength (to save space, since we were happy with the
RFC-defined default values of 8kB and 256kB respectively).  However,
the OpenSolaris target (incorrectly) assumes default values of zero
for these parameters.

The upshot was that the OpenSolaris target would get stuck in an
endless loop trying to send us the first 512-byte sector, zero bytes
at a time, and would eventually run out of memory and core-dump.

Fixed by explicitly specifying the default values for these two
parameters.
2007-11-05 13:29:05 +00:00
Michael Brown
2303c45d65 Force a netdevice poll in net_tx() before attempting to transmit
packet, to work around the problem whereby small TX rings get backed
up because we haven't yet poll()ed for TX completions.
2007-10-04 14:46:56 +01:00
Michael Brown
267a4483ab Added an almost obscene amount of debugging and assertion code while
tracking down a bug that turned out to be a free_iob() used where I
needed a netdev_tx_complete().  This left the freed I/O buffer on the
net device's TX list, with bad, bad consequences later.

Also fixed the bug in question.
2007-09-17 19:01:10 +01:00
Michael Brown
387a1a8556 Minor debug message improvement. 2007-09-17 18:57:32 +01:00
Michael Brown
f6f1f2b7bb Prepare for adding a metadata queue to IPoIB 2007-09-17 06:12:33 +01:00
Michael Brown
4e78a53cf2 IPoIB code separated out to ipoib.c. 2007-09-17 05:04:58 +01:00
Michael Brown
7e85f0d296 create_qp() and destroy_qp() now written (but not tested). 2007-09-16 20:54:21 +01:00
Michael Brown
251cc84ed6 Started implementing create_qp() and destroy_qp(). 2007-09-16 19:03:24 +01:00
Michael Brown
b21d4ca21e Revert to dev_priv/owner_priv scheme, rather than container_of; it
makes it easier to put the generic allocation code into infiniband.c
2007-09-16 17:25:15 +01:00
Michael Brown
37fc40bc8c post_recv() now works, and we can pass data on the IPoIB queue pair
using entirely our own code.
2007-09-15 23:33:25 +01:00
Michael Brown
8deef093d9 Direct polling of TX completion queue now works. 2007-09-15 20:58:29 +01:00
Michael Brown
08e8dfd801 Now handling TX completions in our poll loop. 2007-09-14 11:10:25 +01:00
Michael Brown
30a19c3f1c Can now both send and receive packets. LL header format not yet
fixed; still using a quick hack-up just to be able to pass through
data.
2007-09-13 14:43:12 +01:00
Michael Brown
7e4e5af462 Use RFC4390 whenever hardware address exceeds 16 bytes; this allows us
to construct DHCP packets suitable for Infiniband.
2007-09-13 01:53:04 +01:00
Michael Brown
c0d99245a9 Bugfix: DHCP message type should be a one-byte option... (d'oh) 2007-09-13 01:13:57 +01:00
Michael Brown
7b6d11e713 Started IB driver rewrite 2007-09-12 22:17:43 +01:00
Michael Brown
972f293e46 Check for correct block number in tftp_rx_data().
(Problem observed by Clay McClure in VMware Fusion.)
2007-09-08 19:30:25 +01:00
Michael Brown
00d93c6dd9 Minor style fix: structure fields are generally initialised in the
order in which they occur.
2007-09-06 13:37:47 +01:00
Marty Connor
14e1d3cc4d TFTP default blocksize fix from Vampyre 2007-08-30 13:51:38 -04:00
Michael Brown
746d0f8feb Merge commit 'holger/strings' 2007-08-23 21:51:57 +01:00
Holger Lubitz
f92096d180 use malloc attribute 2007-08-20 20:30:24 +02:00
Holger Lubitz
bc9f960b66 use malloc attribute 2007-08-20 20:30:17 +02:00
Holger Lubitz
6f0eca1400 use malloc attribute 2007-08-20 20:30:11 +02:00
Michael Brown
2ff1b1245b Use start_timer_nodelay() in protocols which rely on the retry timer
to generate the initial transmission; this cuts off around 0.3s per
instantiated connection.
2007-08-13 11:03:33 -07:00
Michael Brown
0a3c2b80ea Add start_timer_nodelay() 2007-08-13 10:59:00 -07:00
Michael Brown
9fd6a0418f Allowed zero-cost enforced ordering of features in startup banner
list.

Added FEATURE() macros to most relevant (non-driver) files.
2007-08-02 14:51:03 +01:00
Michael Brown
67afe84292 Use otherwise-useless byte in DHCP feature option as a version number 2007-08-02 04:36:00 +01:00
Michael Brown
0acb016840 Add FEATURE() macro, plus code to display features at startup time,
and generate DHCP options to indicate features to DHCP server (and to
PXE NBPs).
2007-08-02 04:24:39 +01:00
Holger Lubitz
fdd5fbe3ae fix gcc 4.2.1 warning: initialized field overwritten 2007-08-02 01:56:50 +01:00
Michael Brown
79691961ba Add identifier for the network device into the DHCP request. 2007-07-31 03:32:22 +01:00
Michael Brown
5e26df0325 Centralise construction of the DHCP request and response packets. 2007-07-31 03:02:21 +01:00
Michael Brown
847ac4f336 tls_change_cipher() can complain about null cipher and digest
algorithms; we only need the pubkey check disabled (and only because
pubkey algorithms are not yet integrated into the crypto_algorithm
subsystem).
2007-07-30 03:30:27 +01:00
Michael Brown
60e3aa4d75 Change #warnings to FIXMEs, so that we can build without NO_WERROR=1 2007-07-30 03:06:08 +01:00
Michael Brown
bf3d8fb1aa Allowed HTTPS to be a separately configurable feature. 2007-07-30 03:01:04 +01:00
Michael Brown
6fc9ed167e TLS now working again. 2007-07-30 02:48:38 +01:00
Michael Brown
43013da9bf Quick hack to get AoE back in to the tree, on a par with the current
iSCSI hack.
2007-07-29 02:31:14 +01:00
Michael Brown
e3484e26eb Merge branch 'symcheck2' 2007-07-28 22:55:31 +01:00
Holger Lubitz
e6cfa7ced9 make http_open static 2007-07-27 21:59:09 +02:00
Holger Lubitz
fa11865de0 make add_ndp_entry static 2007-07-27 21:37:29 +02:00
Michael Brown
47a86bca2d Prepare for iBFT merge when possible. iscsiboot.c contains a really,
really ugly hack at present, but that doesn't hugely matter since I'm
aiming to change the interface to iSCSI devices anyway within the next
week.
2007-07-26 02:13:38 +01:00
Michael Brown
9aa61ad5a2 Add per-file error identifiers 2007-07-24 17:11:31 +01:00
Michael Brown
94415b7669 Added missing "static" declarations 2007-07-17 01:42:10 +01:00
Michael Brown
f44969f7df nameserver should be static 2007-07-17 01:21:20 +01:00
Michael Brown
096fa94f0c Add support for TCP timestamps 2007-07-13 11:32:53 +01:00
Michael Brown
eb530845d4 Adjust received length to take into account any already-received data
in tcp_rx_data().

Clarify comments on discarding duplicate or out-of-order data.
2007-07-13 11:31:58 +01:00
Michael Brown
d5735c631c Avoid reusing auto-allocated ports after connection close. 2007-07-13 11:25:00 +01:00
Michael Brown
b3e44a24b1 May be required in some disconnect scenarios 2007-07-10 06:31:11 +01:00
Michael Brown
9dc6a1e678 Remove some obsolete stream-API files 2007-07-09 03:53:06 +01:00
Michael Brown
fd4fcb57db Add missing static 2007-07-09 01:04:54 +01:00
Michael Brown
fabd0f5fec Fix TX state machine and miscellaneous other bits. 2007-07-09 00:52:45 +01:00
Michael Brown
ef9fd938d0 Fix root-path parsing. 2007-07-09 00:00:34 +01:00
Michael Brown
b94420a52b Ready to start testing 2007-07-08 22:01:49 +01:00
Michael Brown
edd1b173a7 Code in place to use a hypothetical SCSI interface. 2007-07-08 19:33:26 +01:00
Michael Brown
f2fa390ae6 Everything except the SCSI interface should now be present 2007-07-08 18:51:56 +01:00
Michael Brown
9b28b25332 iSCSI updated to use data-xfer interface on the socket side (TCP).
SCSI interface not yet implemented.
2007-07-08 16:04:13 +01:00
Michael Brown
edded7546e Limit xmit window to one MTU. (Path MTU discovery not yet
implemented; should be done at some point.)
2007-07-08 14:33:53 +01:00
Michael Brown
237e23c1c9 Add debug message when nameserver setting is applied/changed via DHCP. 2007-07-08 14:31:51 +01:00
Michael Brown
35afb379af TCP limits advertised TCP window to size of application window
obtained via xfer_window().
2007-07-08 14:14:59 +01:00
Michael Brown
b34d4d0449 Separate the "is data ready" function of xfer_seek() into an
xfer_window() function, which can return a scalar rather than a
boolean.
2007-07-08 14:11:07 +01:00
Michael Brown
ca4c6f9eee Kill off unused request() method in data-xfer interface. 2007-07-08 02:10:54 +01:00
Michael Brown
4c418d2100 Use net_device_operations structure and netdev_nullify() to allow for
safe dropping of the netdev ref by the driver while other refs still
exist.

Add netdev_irq() method.  Net device open()/close() methods should no
longer enable or disable IRQs.

Remove rx_quota; it wasn't used anywhere and added too much complexity
to implementing correct interrupt-masking behaviour in pxe_undi.c.
2007-07-07 16:43:39 +01:00
Holger Lubitz
a4d3476e0e convert to zalloc 2007-07-06 21:08:54 +02:00
Holger Lubitz
389c63d7c4 convert to zalloc 2007-07-06 21:08:41 +02:00
Holger Lubitz
32e4ca8ae3 convert to zalloc 2007-07-06 21:08:29 +02:00
Holger Lubitz
da3c785816 convert to zalloc 2007-07-06 20:52:58 +02:00
Holger Lubitz
2b9fb513f4 convert to zalloc 2007-07-06 20:52:01 +02:00
Holger Lubitz
7872b890fe convert to zalloc 2007-07-06 20:50:32 +02:00
Holger Lubitz
7fa85d19b9 convert to zalloc 2007-07-06 20:49:26 +02:00
Holger Lubitz
dc6c1c294d convert to zalloc 2007-07-06 20:47:15 +02:00
Michael Brown
934b70d62c Apply global DHCP options when register_dhcp_options() is called. Do
not apply DHCP options in dhcp_configure_netdev().
2007-07-06 17:07:50 +01:00
Michael Brown
1567b69895 Add concept of DHCP option applicators. 2007-07-05 18:38:14 +01:00
Michael Brown
539ff45fd0 Allow recording of TX and RX errors to aid in end-user debugging. 2007-07-05 17:18:27 +01:00
Michael Brown
8156f6bd19 Switch compiler warning on tcp_open() to a #warning 2007-07-05 12:00:35 +01:00
Michael Brown
a5f33ea283 Added missing line to set return status code. 2007-07-03 21:22:12 +01:00
Michael Brown
fd86c819ba Use a linker-table based system to automatically mark and start up
permanent processes, rather than requiring each one to have its own
initialisation function.
2007-07-03 20:09:14 +01:00
Marty Connor
4bcfe7507b Merge branch 'master' of /pub/scm/gpxe 2007-07-03 13:20:54 -04:00
Marty Connor
c77704cb60 Warnings purge: src/{crypto,hci,net} 2007-07-03 13:20:22 -04:00
Michael Brown
0924cf678e Implemented (untested) PXENV_START_UNDI. 2007-07-03 18:17:14 +01:00
Michael Brown
5b52630a9c Never attempt to route the broadcast address. 2007-07-03 13:55:45 +01:00
Michael Brown
4968caab82 Add trivial net device statistics (TX and RX packet count), reported
via UNDI API and also by ifstat command; may be useful for debugging.
2007-07-03 00:15:53 +01:00
Marty Connor
0297a63877 Merge branch 'master' of ssh://rom.etherboot.org/pub/scm/gpxe 2007-07-02 15:36:19 -04:00
Marty Connor
f04899bf6c Warnings purge 2007-07-02 15:33:34 -04:00
Michael Brown
332614a382 Add untested support for UNDI transmit and receive. 2007-07-02 20:05:58 +01:00
Michael Brown
d7e471f654 Improve debugging 2007-07-01 22:04:19 +01:00
Michael Brown
3bf5eb49d0 Can't use strncpy() to copy strings that aren't NUL-terminated to
begin with.
2007-07-01 03:22:28 +01:00
Michael Brown
acd598b4f9 Don't build option-overloaded packets; they just confuse people (ISC
DHCPD and Windows RIS in particular).
2007-06-30 01:32:53 +01:00
Michael Brown
c73bff7ae5 Set current working URI based on TFTP server specified by DHCP. 2007-06-28 21:22:25 +01:00
Michael Brown
d465ae9785 Bugfix: iobuf->data always points to the start of the allocated
portion, not to the bit we want to currently write to...
2007-06-28 18:38:50 +01:00
Michael Brown
5de837cc67 Mildly ugly hack to force correct linkage. 2007-06-28 18:06:25 +01:00
Michael Brown
1ec7bb789d Add dhcp_configure_netdev() 2007-06-28 15:18:26 +01:00
Michael Brown
cf33b568dc Forgot to set initial session state. Now works! 2007-06-28 01:55:01 +01:00
Michael Brown
73fe1ba9dd Kill off job::start() (it was only ever added as part of an aborted
attempt at triggering TCP-related protocols to start).
2007-06-28 01:09:45 +01:00
Michael Brown
07dc294de8 Update DHCP to use data-xfer interface (not yet tested). 2007-06-27 23:20:36 +01:00
Michael Brown
f77815f2b1 Kill off hotplug.h and just make net devices normal reference-counted
structures.

DHCP still broken and #if 0'd out.
2007-06-27 14:48:31 +01:00
Michael Brown
e381714c07 Partial migration of UDP to data-xfer interface. (Will not link at
present; DHCP is broken).
2007-06-20 01:13:35 +01:00
Michael Brown
2d4c72b762 Remove unused headers. 2007-06-11 23:40:34 +01:00
Michael Brown
f87bc837f4 Updated DNS to use not-yet-implemented UDP data-xfer API. 2007-06-11 23:30:44 +01:00
Michael Brown
01b4bde8a0 Updated TFTP and PXE UDP API code to use not-yet-implemented data-xfer
UDP API.
2007-06-11 18:11:29 +01:00
Michael Brown
95adce0ce1 Add concept of transfer metadata, to be used by UDP in order to
implement sendto()/recvfrom() equivalents.
2007-06-11 15:04:39 +01:00
Michael Brown
6f0a6c09db Merge branch 'master' into mcb-tcp-xfer 2007-06-08 16:33:24 +01:00
Michael Brown
335b99a39d Move [v]ssnprintf() from iscsi.c into vsprintf.c; we need them
elsewhere as well.
2007-05-31 13:26:50 +00:00
Michael Brown
4ccd1e8198 Should call ftp_done() if constructor fails. 2007-05-29 15:37:30 +00:00
Michael Brown
735e07268e Update HTTP to use data-xfer interface. 2007-05-29 15:37:09 +00:00
Michael Brown
0dfd5b84fd Updated FTP to use data-xfer API. 2007-05-28 20:11:02 +00:00
Michael Brown
3acd51597a Add sanity check and extra debug message 2007-05-28 20:06:41 +00:00
Michael Brown
63719deea9 Introduce name resolution interface and named socket opener. 2007-05-27 01:07:00 +00:00
Michael Brown
1311b4194c Eliminate PF_INET; just use the AF_INET from the struct sockaddr instead. 2007-05-26 20:41:23 +00:00
Michael Brown
b8618d76db Modify data-xfer semantics: it is no longer necessary to call one of
request(), seek() or deliver_xxx() in order to start the data flow.
Autonomous generators must be genuinely autonomous (having their own
process), or otherwise arrange to be called.  TCP does this by
starting the retry timer immediately.

Add some debugging statements.
2007-05-26 15:04:36 +00:00
Michael Brown
3601103381 Modify process semantics; rescheduling is now automatic.
Add reference-counting to processes.

Add timer_running() test.
2007-05-26 15:00:56 +00:00
Michael Brown
1136c19fa4 Updated tcp.c to provide a standardised data transfer interface. 2007-05-25 15:58:42 +00:00
Michael Brown
776357214e Rename pkbpad.c to iobpad.c 2007-05-19 18:42:27 +00:00
Michael Brown
3e2c6b6736 pkbuff->iobuf changeover
Achieved via Perl using:

perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \
	-e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \
	-e 's/pkb/iobuf/g; s/PKB/IOB/g;'
2007-05-19 18:39:40 +00:00
Anselm Martin Hoffmeister
ed7dc02a95 hoffmeis: Preparations for syslog support (LOGSERVER in DHCP, linewise
output buffering defintions and the like)
2007-04-09 18:01:43 +00:00
Anselm Martin Hoffmeister
ff5aac826a hoffmeis: Fixing situation where absence of a newdata() handler for UDP
connections might break things. Only-sending applications like syslog()
do not need a newdata() handler, so added a check if that handler exists.
2007-04-09 17:34:10 +00:00
Michael Brown
520d9c36af Updated ISAPnP, EISA, MCA and ISA buses to current device model.
ISA 3c509 is currently non-functional, although the EISA (3c509-eisa) and
MCA (3c529) variants should build OK.

None of this code is yet tested.
2007-03-10 18:08:33 +00:00
Michael Brown
af3149d18e Allow queries in GET requests 2007-02-01 21:01:47 +00:00
Michael Brown
3fd10074d8 SSL needs quite a lot of spare memory 2007-02-01 09:38:16 +00:00
Michael Brown
2c67167929 Don't pass through zero-length requests 2007-02-01 07:18:56 +00:00
Michael Brown
a3695b1ff6 Placeholder for TLS insertion 2007-01-31 03:47:42 +00:00
Michael Brown
2d726144f7 Filter insertion now actually works 2007-01-31 03:43:59 +00:00
Michael Brown
138967dd6b Tidy up debug messages 2007-01-31 03:05:49 +00:00
Michael Brown
e38e516463 Add insert_filter() function 2007-01-31 03:04:56 +00:00
Michael Brown
6d32f0e6e2 Changed to use the generic stream API. 2007-01-31 02:09:13 +00:00
Michael Brown
02f18565da First sketch of stream API 2007-01-31 00:40:35 +00:00
Michael Brown
55601b2d38 Placeholder 2007-01-30 22:55:19 +00:00
Michael Brown
2f7eac1646 Low-overhead filter streams 2007-01-30 12:17:03 +00:00
Michael Brown
bde8878eef Keep HTTP progress updated, and display a progress indicator during the
download
2007-01-29 04:19:45 +00:00
Michael Brown
92a78c8e15 Added SIGKILL handler 2007-01-19 15:19:52 +00:00
Michael Brown
73b09ecba6 Use stdio.h instead of vsprintf.h 2007-01-19 01:13:12 +00:00
Michael Brown
4e3976711d A working name resolution framework 2007-01-18 22:38:13 +00:00
Michael Brown
075f8144ff Have DHCP set the nameserver, rather than DNS read the DHCP nameserver
value.
2007-01-18 21:22:03 +00:00
Michael Brown
c014f607a8 Use total free memory as advertised window. This seems to be sufficient
to avoid drops even on slow NICs.
2007-01-18 20:39:17 +00:00
Michael Brown
6d4e37cf42 Move include/malloc.h to include/gpxe/malloc.h, since everything in there
is now gPXE-specific.  (The standard malloc() et al have been in stdlib.h
for a while).

Add free memory counter.
2007-01-18 20:11:04 +00:00
Michael Brown
5ff23aa406 Include stdlib.h rather than malloc.h 2007-01-18 20:06:03 +00:00
Michael Brown
05f4c3d176 Remove the one-packet-per-poll-cycle limit; it seems to no longer be
needed now that performance is up.
2007-01-18 16:50:35 +00:00
Michael Brown
6c72bf13a1 Presize the download buffer when we see the Content-Length header;
this saves around 70us per received packet (which is around 50% of the
overall packet processing time).
2007-01-18 13:26:57 +00:00
Michael Brown
08da93a311 Reorder functions to more closely reflect the flow of control 2007-01-18 13:10:26 +00:00
Michael Brown
06630a3036 Switch from calloc() to malloc()+memset() to match the practices used
almost everywhere else.
2007-01-18 12:45:58 +00:00
Michael Brown
dd6d94004f HTTP/DNS now working fully asynchronously. HTTP/IP addresses and any
other protocol won't work at the moment.
2007-01-18 03:39:45 +00:00
Michael Brown
99e58865c7 Use struct sockaddr rather than struct sockaddr_tcpip
Tidy up code
2007-01-18 03:35:00 +00:00
Michael Brown
f11da20f25 When a network device is specified to tcpip_tx() or it's children, treat
it as a fallback network device rather than an explicitly forced network
device.

Clear routing table entries before re-attempting DHCP.
2007-01-16 04:09:13 +00:00
Michael Brown
1a1fc23417 Improve debugging 2007-01-16 03:29:15 +00:00
Michael Brown
bcdb6fad3e Improve debug messages 2007-01-16 03:19:40 +00:00
Michael Brown
835d35749f Improved debugging 2007-01-16 03:10:37 +00:00
Michael Brown
143d14614d Quickly hack in DNS resolution as a proof of concept 2007-01-15 17:32:52 +00:00
Michael Brown
9af12d5fba A working DNS resolver (not yet tied in to anything) 2007-01-15 17:31:35 +00:00
Michael Brown
df0397f334 Update TFTP and FTP to take the same temporary URI scheme as HTTP 2007-01-15 09:58:26 +00:00
Michael Brown
afa752f5fb Protocol's get() method no longer takes ownership of the URI. HTTP is the
exception rather than the rule; we may as well keep things clean for other
protocols.
2007-01-15 09:18:06 +00:00
Michael Brown
1f92c6b3e8 Must free http on the error path; nothing else will do it 2007-01-15 09:08:40 +00:00
Michael Brown
c676591cd1 Unmaintained example code is probably worse than useless. 2007-01-15 09:06:12 +00:00
Michael Brown
4e20d73bb5 Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS.  (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).

Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
2007-01-15 08:49:10 +00:00
Michael Brown
76aa9ad07d Make TCP give up immediately when it receives -ENETUNREACH from
tcpip_tx().  This avoids the irritating wait when you accidentally type
"kernel pxelinux.0" before bringing up the network interface.

Add ENETUNREACH to strerror()'s list.
2007-01-14 16:47:03 +00:00
Michael Brown
c953c1a1c3 Use -ENETUNREACH to mean "no reachable network device exists, don't bother
retrying".
2007-01-14 16:22:10 +00:00
Michael Brown
526d314266 Advertise a larger MSS to improve TCP performance. 2007-01-13 17:36:17 +00:00
Michael Brown
497c3a5aad Fixed HTTP 2007-01-12 19:18:13 +00:00
Michael Brown
ad22cccc09 No need to maintain a received byte count; we always fill in sequential
order so we can just use buffer->fill.
2007-01-12 17:16:46 +00:00
Michael Brown
0010e10ef3 Update TFTP to use a struct buffer rather than a callback.
Add debug autocolourisation to TFTP.
2007-01-11 15:14:54 +00:00
Michael Brown
037da9d840 I hate NULL pointer dereferences. 2007-01-11 05:27:02 +00:00
Michael Brown
a3ed0cbbc7 Extract packet-padding login from rtl8139.c to a separate pkbpad.c file. 2007-01-11 05:25:50 +00:00
Michael Brown
6918cf9e9e Change FTP to use a data buffer rather than a callback function. 2007-01-11 04:51:20 +00:00
Michael Brown
d9ba8f790b Add route() function to display routing table. 2007-01-10 20:38:20 +00:00
Michael Brown
1fa5cd0e2b Add find_pci_netdev() 2007-01-10 16:16:05 +00:00
Michael Brown
dad5274522 Add "name" field to struct device to allow human-readable hardware device
names.

Add "dev" pointer in struct net_device to tie network interfaces back to a
hardware device.

Force natural alignment of data types in __table() macros.  This seems to
prevent gcc from taking the unilateral decision to occasionally increase
their alignment (which screws up the table packing).
2007-01-10 04:22:09 +00:00
Michael Brown
cc9b32c405 Remove uIP; we haven't used it for quite some time now. 2007-01-10 02:52:58 +00:00
Michael Brown
753e156844 Allow udp_{send,sendto,sendto_via} to be called outside of the
udp_senddata() callback.  This will simplify any UDP protocols that don't
need the temporary buffer.
2007-01-10 02:46:39 +00:00
Michael Brown
649b789e93 DHCP transmits via specified net device, so no need to create a dummy
routing table entry just to fool ipv4.c any more.
2007-01-10 02:37:23 +00:00
Michael Brown
c821a7b20d Add udp_sendto_via() to allow e.g. DHCP to transmit without first having
to set up dummy routing entries.
2007-01-10 02:31:38 +00:00
Michael Brown
f008b77ba2 Allow an explicit network device to be specified for IP-layer
transmissions.
2007-01-10 02:25:11 +00:00
Michael Brown
d24b80acf2 Added network interface management commands 2007-01-10 01:55:07 +00:00
Michael Brown
98b6154c3e Add "name" field to network device, to facilitate netdev commands. 2007-01-09 23:48:18 +00:00
Michael Brown
c65fae2475 Add RX quotas to the net device poll() method. This avoids the problem
of alloc_pkb() exhaustion when e.g. an iSCSI-booted DOS session is left
idle for a long time at the C:\ prompt and builds up a huge packet
backlog.
2007-01-09 21:47:01 +00:00
Michael Brown
18e5353bed Rename pkb_available() to pkb_tailroom() for consistency with Linux's
skb_tailroom().  Add pkb_headroom().
2007-01-09 20:56:31 +00:00
Michael Brown
b7fcfe8ece Added net device TX queue; this will be needed to support the PXE UNDI API
(which will need us to wait for TX completions).

Added debug autocolourisation to netdevice.c
2007-01-09 20:18:31 +00:00
Michael Brown
8a268073a7 Move start/stop/expire debug messages to DBG2() level. 2007-01-09 17:39:52 +00:00
Michael Brown
2eeb7c4fe7 Define "connected" as
"when SYN is ACKed and we have already received SYN", or
  "when SYN is received and we have already had SYN ACKed"

rather than just

  "when SYN is ACKed"

This avoids spuriously calling the connected() method when we receive
a RST,ACK in response to a SYN.
2007-01-09 05:01:22 +00:00
Michael Brown
aaca21a2b6 We can't assert that the RX engine is idle in iscsi_done(), because it
may be called during the RX data processor, before the RX engine
transitions back to idle.  It doesn't really matter if the RX engine
isn't idle when iscsi_done() is called, because it will just pick up
where it left off on the next call.  (The same is not true for the TX
engine, so keep the TX engine assertion.)
2007-01-09 04:42:23 +00:00
Michael Brown
6ea07b9247 Use debug auto-colourisation. 2007-01-09 04:38:39 +00:00
Michael Brown
76525294ee Clean up connection closing and permanent failure logic. 2007-01-09 04:31:33 +00:00
Michael Brown
20681d6168 Allow empty checksums on received packets 2007-01-04 05:17:28 +00:00
Michael Brown
0c03bb5a9a Make open() and close() an official part of the netdevice API.
Call netdevice's poll() and transmit() methods only when device is open.
2007-01-04 04:20:08 +00:00
Michael Brown
7fafa89258 A DHCP session holds a persistent reference to a network device 2007-01-04 03:42:28 +00:00
Michael Brown
b29861a5aa IPv6 minirouting table entries hold persistent references to net devices. 2007-01-04 03:28:30 +00:00
Michael Brown
b22d4405c0 An AoE session holds a persistent reference to a net device. 2007-01-04 03:21:45 +00:00
Michael Brown
35b5e5d3f5 Minirouting table entries hold a persistent reference to a net_device. 2007-01-04 03:10:21 +00:00
Michael Brown
bdf79ec8dc Use hotplug support to notify persistent reference holders when a
net_device is unregistered.
2007-01-04 03:09:28 +00:00
Michael Brown
b0daa99dce Send RST packets when we get a non-matching connection, or receive an
out-of-range ACK.
2007-01-03 22:21:59 +00:00
Michael Brown
eea1167a85 Accept RST on received packets 2007-01-03 21:51:36 +00:00
Michael Brown
94fc68895d Improve consistency between TCP and UDP RX datapaths 2007-01-03 21:13:11 +00:00
Michael Brown
a0525a4ed3 Verify checksums on the RX datapath.
Simplify checksum generation on the TX datapath.
2007-01-03 20:48:52 +00:00
Michael Brown
285beeff7c Tidy up debug messages
Move routing into a separate function
2007-01-03 16:39:11 +00:00
Michael Brown
718294553b Fix compiler warning 2007-01-03 15:56:15 +00:00
Michael Brown
83e1340d88 Use autocolourisation 2006-12-29 14:09:23 +00:00
Michael Brown
feb4f65d1e Use auto-colourisation for debug messages.
Truncate TX length to TCP window at time of transmission rather than at
time of adding to TX packet; this is conceptually cleaner and also allows
the application to call tcp_send() multiple times to build up a single
packet.
2006-12-29 14:03:03 +00:00
Michael Brown
ce9819af27 Redefine TCP state to include "flags that have been sent" rather than
"flags that are currently being sent".  This allows at least one special
case (checking that we haven't already sent a FIN in tcp_rx_fin()) to be
collapsed.
2006-12-29 00:44:31 +00:00
Michael Brown
be31970e36 Don't send a second FIN if we receive a FIN while in FIN_WAIT_2 2006-12-27 23:44:05 +00:00
Michael Brown
61ed298bc7 Merge changes from mcb-tcp-fixes branch. 2006-12-27 23:09:46 +00:00
Michael Brown
1a11cc5c5b Added times to start/stop log messages 2006-12-27 22:56:39 +00:00
Michael Brown
4cc1c1bd4c Ensure that old TCP connection state is destroyed before attempting to
reopen connection.  (The TCP API will soon change to render this step
unnecessary.)
2006-12-22 13:04:50 +00:00
Michael Brown
a2e3357825 Cannot immediately overwrite the peer address when we parse
TargetAddress from the login response, because we still need the old
address while we close the connection!
2006-12-22 12:24:12 +00:00
Michael Brown
66a7ed23cb Make start_timer() and stop_timer() robust against incorrect usage. 2006-12-22 01:35:21 +00:00
Michael Brown
d6f9152bfa Avoid null pointer dereferences when no username/password specified. 2006-12-21 18:38:24 +00:00
Michael Brown
6ceb55fad0 When login fails, leave the session open but not in full feature
phase.  In iscsi_issue(), detect this state and immediately refuse the
operation.  This avoids trying multiple logins when scsi.c tries
several times to read the drive capacity.
2006-12-21 17:43:43 +00:00
Michael Brown
ab242a760d Add ability to shut down iSCSI connection 2006-12-21 17:17:47 +00:00
Michael Brown
60a3f77711 Close UDP connection when DHCP completes. 2006-12-20 07:19:48 +00:00
Michael Brown
a646e38f03 Use stdlib.h for malloc() instead of malloc.h. 2006-12-19 23:42:46 +00:00
Michael Brown
04c09823bd Request all the options that we're prepared to do anything with. 2006-12-12 16:18:20 +00:00
Michael Brown
a1af111a87 Also request root-path. 2006-12-08 15:49:46 +00:00
Michael Brown
38ae94f8ce A cleaner method of handling login redirection; just use the existing
reconnection mechanism.  This avoids the problems of trying to reuse
the TCP connection structure before the old connection has cleanly exited.
2006-12-06 19:53:56 +00:00
Michael Brown
5edb85c8b4 Work around another confused-by-RST bug 2006-12-06 18:09:33 +00:00
Michael Brown
b9f9230661 Work around another instance of the port re-use bug. 2006-12-05 23:15:35 +00:00
Michael Brown
8c3d09c564 Tweaked retry messages 2006-12-05 23:12:54 +00:00
Michael Brown
9600af14a3 Added debug messages 2006-12-05 22:53:49 +00:00
Michael Brown
cc0b92652f Call closed() method only when the connection is genuinely in the
TCP_CLOSED state (i.e. after the final FIN/ACK exchange), and has been
removed from the list of TCP connections.
2006-12-05 22:53:28 +00:00
Michael Brown
fcc70c9d60 Ensure that tcp_rx() always frees its received packet buffer. 2006-12-05 21:23:23 +00:00
Michael Brown
28c711b91d Killed off spurious <stdio.h> inclusion 2006-12-05 21:16:52 +00:00
Michael Brown
3fbfbad0f7 Avoid calling NULL methods! 2006-12-05 21:09:37 +00:00
Michael Brown
89bcb57201 Update ftp.c to work with Nikhil's TCP stack.
Remove the now-totally-obsolete sockaddr_in field from tcp.h.
2006-12-05 19:07:47 +00:00
Michael Brown
6842dd3222 Handle TargetAddress 2006-12-05 01:41:32 +00:00
Michael Brown
67577556a2 Handle strings as complete units, instead of a byte at a time. 2006-12-05 01:08:56 +00:00
Michael Brown
3a7d762c1c Add iscsi_rx_buffered_data() and supporting infrastructure. 2006-12-05 00:39:05 +00:00
Michael Brown
3f0b4d9ed8 Updated to use asynchronous operation model for iSCSI requests
Added CHAP authentication
2006-11-28 00:29:02 +00:00
Michael Brown
fedc186fd7 Split login into security negotation and operational parameter
negotiation phases, to allow inclusion of CHAP authentication.
2006-10-03 09:17:38 +00:00
Michael Brown
88e38fa148 We don't actually have a stdio.h header file. Our printf() functions are
defined in vsprintf.h.  (This may change, since vsprintf.h is a
non-standard name, but for now it's the one to use.)

There should be no need to include vsprintf.h just for DBG() statements,
since include/compiler.h forces it in for a debug build anyway.
2006-09-27 10:58:14 +00:00
Marty Connor
6ac78f6aff added stdio.h to includes for DBG compilation 2006-09-27 05:57:06 +00:00
Michael Brown
0dca1dc8ce Made eth_ntoa() public for use in legacy drivers' DBG() statements. 2006-09-15 12:34:34 +00:00
Michael Brown
095fce14f8 Added extra debugging 2006-08-30 13:39:07 +00:00
Michael Brown
cab3f4502b Correct option number for DHCP_DNS_SERVERS, and add it to the request
list.
2006-08-27 01:37:58 +00:00
Nikhil Chandru Rao
dccb8358bd Fixed a bug in the TCP state machine. Added a transition from ESTABLISHED to LAST_ACK on receiving a FIN,ACK 2006-08-19 16:14:53 +00:00
Nikhil Chandru Rao
d1d334b8e1 IP6 support 2006-08-19 15:58:22 +00:00
Michael Brown
f1e1dfae3d Added RX tracing as well. 2006-08-16 00:15:40 +00:00
Michael Brown
0743dc5b0d Added some minimal debugging for transmitted PDUs. 2006-08-15 23:56:18 +00:00
Derek Pryor
562ab6d65c Bug fixes to the HTTP protocol code 2006-08-12 19:05:08 +00:00
Derek Pryor
0f88703019 Bug fixes to the HTTP protocol code 2006-08-12 18:54:59 +00:00
Michael Brown
db0ff1731f Fail gracefully when set_dhcp_option() is called with options==NULL. 2006-08-11 18:16:34 +00:00
Derek Pryor
25ea34a8d7 New HTTP protocol and test code 2006-08-11 14:13:02 +00:00
Michael Brown
2497270c14 command->data_{in,out} are now userptr_t, so it is invalid to compare
against NULL.
2006-08-10 17:35:14 +00:00
Michael Brown
ea5fa82b91 Fixed variable name in assertion 2006-08-10 17:09:48 +00:00
Michael Brown
c3a4f3c5da Towards an RFC2988-compliant timer. 2006-08-09 15:54:17 +00:00
Michael Brown
f0718d562f Don't call stop_timer() from within the timer expiry callback; it's
already stopped.

Don't call start_timer() when sending a dataless ACK.  This may or may
not be the right thing to do; I can't tell.

Back out broken "send ACK only if required to" logic temporarily.
2006-08-09 15:50:20 +00:00
Nikhil Chandru Rao
3aff701001 Changed the TCP state machines behaviour in the ESTABLISHED state 2006-08-09 15:04:26 +00:00
Michael Brown
dc8b96b446 Temporarily work around the bug when port numbers are reused between
subsequent runs.
2006-08-09 14:44:58 +00:00
Michael Brown
09688cb3b5 Correct some packet ownership and freeing bugs. 2006-08-09 14:27:07 +00:00
Michael Brown
43d601b678 out_flags was being set but never used.
Use just random() to allocate initial sequence numbers; the previous
algorithm ended up with a high probability of zeroing the high word.
2006-08-09 13:35:03 +00:00
Michael Brown
065a2a486d Port the UDP port allocation code to TCP 2006-08-09 12:08:20 +00:00
Michael Brown
de0c36a98a Remove some of the confusion surrounding the amount to strip off from
a TCP packet before passing to newdata().
2006-08-09 12:01:09 +00:00
Michael Brown
867c7aef59 iphdr->hlen includes the IP header, so truncate packet *before*
stripping the header.  Also fix an htons/ntohs confusion.
2006-08-09 11:52:53 +00:00
Marty Connor
ee9ae8130a Remove _PROTOCOL macros for gcc 3.2 compatibility 2006-08-09 04:42:14 +00:00
Michael Brown
e9561aafc0 Derive xid dynamically from the netdev, so that we can call
create_dhcp_packet() from pxe_preboot.c, after the dhcp_session is long
gone.

Expose the functions required by pxe_preboot.c
2006-08-09 02:56:40 +00:00
Michael Brown
a3d508b648 Clarified packet ownership transfer between a few functions.
Added a large number of missing calls to free_pkb().  In the case of UDP,
no received packets were ever freed, which lead to memory exhaustion
remarkably quickly once pxelinux started up.

In general, any function with _rx() in its name which accepts a pk_buff
*must* either call free_pkb() or pass the pkb to another _rx() function
(e.g. the next layer up the stack).  Since the UDP (and TCP) layers don't
pass packet buffers up to the higher-layer protocols (the
"applications"), they must free the packet buffer after calling the
application's newdata() method.
2006-08-09 01:24:32 +00:00
Michael Brown
d1a123b1f4 Added TFTP test code (currently just dumps file to console). 2006-08-09 00:09:29 +00:00
Michael Brown
3611cb17b7 Initial (untested) implementation of TFTP over the new UDP API. 2006-08-08 23:45:52 +00:00
Nikhil Chandru Rao
409f69a08a Changed ipv4_dump() to consume only one line. 2006-08-08 22:26:35 +00:00
Nikhil Chandru Rao
8bf38fb400 Corrected bugs in the TCP logic. There might be a few more which need to be taken care of. 2006-08-08 22:25:20 +00:00
Michael Brown
68e33224ef gcc3 compatibility: removed ARP_NET_PROTOCOL(). 2006-08-08 17:44:25 +00:00
Nikhil Chandru Rao
d2bdf81505 Removed some bugs in TCP 2006-08-08 03:42:30 +00:00
Nikhil Chandru Rao
cb42e573a0 Added retransmissions to TCP 2006-08-07 18:52:26 +00:00
Michael Brown
885a630ddf Fix routing when a gateway exists. This should probably be split into
a separate function.
2006-08-07 17:51:19 +00:00
Michael Brown
d0e4f198d6 Add iSCSI to the DHCP tests.
Start updating iscsi.c to use Nikhil's TCP API.
2006-08-07 16:48:24 +00:00
Nikhil Chandru Rao
6714ec745a Minor corrections 2006-08-07 07:37:23 +00:00
Michael Brown
eb24eece0e Convert some trivial functions to static inlines. 2006-08-03 23:42:03 +00:00
Michael Brown
ffe0e24249 Make the UDP senddata() methods return a status code.
udp_connect() now follows the standard BSD sockets semantics and simply
sets the default address for outgoing packets; it doesn't filter incoming
packets.
2006-08-03 23:10:14 +00:00
Michael Brown
a0a872f7f1 Updated PXE UDP implementation to use the new Etherboot UDP API.
Updated PXE API dispatcher to use copy_{to,from}_user, and moved to
arch/i386 since the implementation is quite architecture-dependent.
(The individual PXE API calls can be largely
architecture-independent.)
2006-08-02 23:08:10 +00:00
Michael Brown
467e9627cc Added features that will be required for PXE UDP support.
Introduced struct sockaddr_tcpip, to simplify code that deals with
both IPv4 and IPv6 addresses.

Reorganised parts of tcpip.c and udp.c.
2006-08-02 00:02:21 +00:00
Nikhil Chandru Rao
9225f4edac TCP support 2006-08-01 20:46:50 +00:00
Nikhil Chandru Rao
c24546c70b Minor changes to the network layer rx() functions 2006-08-01 20:27:26 +00:00
Michael Brown
beadd82208 Remove unused functions. 2006-08-01 14:26:02 +00:00
Michael Brown
1ebb68e49a Renamed trans_{rx,tx}() to tcpip_{rx,tx}(), since they are specific to
the TCP/IP protocol suite (rather than being general transport-layer
functions).
2006-08-01 14:22:04 +00:00
Michael Brown
3a0e293123 Renamed tcpip_if.[ch] to tcpip.[ch] 2006-08-01 14:18:09 +00:00
Michael Brown
21c3d63c2e We shouldn't need to allocate a TX packet buffer when calling newdata();
if the application wants to send data then it will have to use the normal
senddata() mechanism.
2006-08-01 14:13:58 +00:00
Michael Brown
ae277992c2 Request bootfile name; it doesn't seem to be automatically supplied by
all servers.
2006-08-01 14:12:27 +00:00
Michael Brown
3085f03ad4 Request Etherboot encapsulated options.
Parameter request list is yet another option that ISC dhcpd ignores
unless it's in the main options block.

Fix logic error in parsing file and sname fields.
2006-07-20 14:14:41 +00:00
Michael Brown
b26806cf18 Add dhcp_snprintf() for extracting DHCP string options. 2006-07-20 14:13:11 +00:00
Michael Brown
16d04386b6 Switch default stack to Nikhil's TCP/IP stack 2006-07-20 02:53:15 +00:00
Michael Brown
e74e20cb55 Remove the static IP address hack from netdevice.c, and change the
default test to the DHCP test.
2006-07-20 02:51:52 +00:00
Michael Brown
00a1f000b1 Added dhcp_ipv4_option() and friends.
Added test code to configure the interface for IPv4 after DHCP.
2006-07-20 02:49:59 +00:00
Michael Brown
6a0b4c9772 Free up any allocated options if we fail 2006-07-20 02:25:39 +00:00
Michael Brown
764cb41456 Document memory ownership. 2006-07-20 02:23:42 +00:00
Michael Brown
7ca1bb0fbe Now successfully negotiates the whole DHCPDISCOVER/OFFER/REQUEST/ACK
cycle.  :)
2006-07-20 02:19:06 +00:00
Michael Brown
30d9bcdc6e Rename unwieldy function 2006-07-20 00:24:25 +00:00
Michael Brown
9ad5cede96 Set DHCP_MESSAGE_TYPE option within the main options block. This
doesn't seem to be required by the RFCs, but at least ISC dhcpd and
ethereal refuse to recognise it otherwise.
2006-07-20 00:18:50 +00:00
Michael Brown
881b90e82c Packets without a DHCP_MESSAGE_TYPE option are probably just BOOTP
packets.
2006-07-20 00:03:25 +00:00
Michael Brown
29b358dd39 conn->local_port is now network-endian; do not swap when comparing
against value in header.

Temporarily disable RX checksumming; it's broken and is holding up
work on higher-layer protocols
.
2006-07-20 00:03:01 +00:00
Michael Brown
36c94eae78 Clarify hexiness of header length 2006-07-20 00:01:50 +00:00
Michael Brown
2c0eb6eb1d Correct TCP/IP checksum generation. 2006-07-19 23:38:05 +00:00
Michael Brown
0768670fd8 udp_open() takes ports in network-endian order. 2006-07-19 21:56:27 +00:00
Nikhil Chandru Rao
13dbf5494d Minor edits 2006-07-19 21:05:58 +00:00
Michael Brown
224529d8dd Now capable of sending what, to me, looks like a valid DHCPDISCOVER
(apart from the bad UDP checksum).
2006-07-19 20:50:50 +00:00
Michael Brown
a38010fb0e Make udp_send() call udp_sendto(), rather than vice-versa. 2006-07-19 20:38:49 +00:00
Michael Brown
7c84b74185 A small but very critical bug. 2006-07-19 20:16:46 +00:00
Michael Brown
82f3295794 Use more standardised format specifiers in debug messages (e.g. %p for
a pointer).
2006-07-19 18:45:18 +00:00
Michael Brown
ab633f6a73 Reserve space for lower-layer headers when allocating packet buffer.
Use pkb_available() rather than pkb_len() (which will always return 0
on a freshly allocated buffer).

udp_send() should assume that the buffer has already been allocated.
2006-07-19 18:21:30 +00:00
Michael Brown
e8daeb62b1 Eliminate confusion between functions that return pointers and
functions that return status codes.

Zero the DHCP packet buffer *before* creating the options structures
inside it.
2006-07-19 18:11:31 +00:00
Michael Brown
3369f93036 Add block identification to debug messages 2006-07-19 17:58:27 +00:00
Michael Brown
6d9d48537e Added some debug messages and DHCP test code 2006-07-19 17:49:31 +00:00
Michael Brown
317b962b65 Proof of concept: transmit a single DHCPDISCOVER and dump out any
parsed DHCP responses.
2006-07-19 17:32:13 +00:00
Michael Brown
16fc9858db Beginnings of DHCP protocol implementation 2006-07-19 17:01:06 +00:00
Nikhil Chandru Rao
bf515d3d65 Minor edit in net/udp.c 2006-07-19 16:27:54 +00:00
Nikhil Chandru Rao
ab577e1a3a The following edits were made: \
1. Updated UDP send data code\
2. Corrected internet checksum\
3. Moved udp_buffer() and udp_buflen() to udp.c from udp.h
2006-07-19 16:25:23 +00:00
Michael Brown
254fe6e00e Split DHCP packet creation into two parts: creating the basic packet
structure, and populating it with options.  This should allow us to
use the same basic options list for both DHCPDISCOVER and DHCPREQUEST,
plus making it much easier to set the non-constant parameters
(e.g. requested IP address) in request packets.
2006-07-19 12:12:45 +00:00
Michael Brown
e40ebb67de Allow for calling find_dhcp_option() with "options" set to NULL, in order
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.
2006-07-19 11:05:38 +00:00
Michael Brown
6c01d3bb95 Fix creation of the htype field; the ll_proto field from which it is
derived is a 16-bit big-endian field, but htype is only 8 bits wide.
2006-07-17 13:07:14 +00:00
Michael Brown
b24947f0c0 Add sketch code to reassemble a DHCP packet from our internal "everything
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.
2006-07-17 12:47:22 +00:00
Michael Brown
12da7ea475 Add (untested) code for parsing a received DHCP packet and constructing a
DHCP options block from the contents.
2006-07-15 19:24:55 +00:00
Michael Brown
19e8b41562 Add code to modify DHCP option values within a block. 2006-07-13 20:49:04 +00:00
Nikhil Chandru Rao
5f651f8622 Added fragment reassembly code 2006-06-30 08:52:03 +00:00
Nikhil Chandru Rao
8de630c62b Removing net/interface.c and include/gpxe/interface.h 2006-06-29 06:51:11 +00:00
Michael Brown
51d62d1a3c Provide a mechanism for returning the encapsulator as well as the
encapsulated option; this will be needed for modifications to the options
block.
2006-06-28 18:59:54 +00:00
Nikhil Chandru Rao
c9ea710930 Renamed net/interface.c and include/gpxe/interface.h to net/tcpip_if.c and include/gpxe/tcpip_if.h respectively. Made changes in the other files. 2006-06-28 15:43:08 +00:00
Michael Brown
291f072b82 Add priority mechanism 2006-06-28 13:48:02 +00:00
Michael Brown
bd0c8b21ad Change dhcp_num_option() to return the numerical value directly. 2006-06-28 12:16:41 +00:00
Nikhil Chandru Rao
6e2c97b0c0 Added ipv4_pseudo_header structure 2006-06-28 09:59:27 +00:00
Nikhil Chandru Rao
41b399d672 Fixed endianness of 16- and 32- bit values 2006-06-28 09:10:35 +00:00
Nikhil Chandru Rao
a6c6b3d739 Fixed whitespaces; updated UDP code 2006-06-28 07:46:28 +00:00
Michael Brown
0bcaa8a21f First stab at DHCP option handling in a way that will allow us to have
multiple option sources (e.g. multiple DHCP replies, non-volatile
storage etc.)
2006-06-27 17:24:07 +00:00
Michael Brown
35557914e3 Simplify ipv4_tx() by not having a separate "source" variable now that
we are constructing the IP header ourselves.

Formatting fix-ups (80 column limit is mandatory!)
2006-06-26 16:10:34 +00:00
Michael Brown
b49de73950 Factorise out common code 2006-06-26 16:01:24 +00:00
Michael Brown
e517a4771b Split ipv6 functions out from ipv4.c 2006-06-26 15:33:46 +00:00
Michael Brown
e04ea505c9 Whitespace fixes 2006-06-26 13:45:24 +00:00
Nikhil Chandru Rao
90fbff8f34 added support for processing and transmitting without uIP 2006-06-25 05:16:54 +00:00
Nikhil Chandru Rao
74339b3c6e updated UDP interface 2006-06-25 05:13:17 +00:00
Nikhil Chandru Rao
fdc05e2664 created interface for transport-network interface 2006-06-25 05:12:07 +00:00
Michael Brown
3a660f9b25 Update ftp.c and hello.c to use the generic async_operations API. 2006-06-19 15:46:58 +00:00
Michael Brown
8637834031 Made the temporary buffer part of the TCP senddata() API, to ease the
transition away from uIP.

Prepared ipv4.c for transition away from uIP.
2006-06-17 23:20:54 +00:00
Michael Brown
3c8aafa209 Simplify RX data path.
Kill off the static single net device and move to proper dynamic
registration (which we need with the new device model).

Break the (flawed) assumption that all network-layer protocols can use
ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP
protocol using ARP_NET_PROTOCOL() and provide a single method for checking
the existence of a local network-layer address.
2006-06-17 22:36:27 +00:00
Michael Brown
968501e323 For consistency 2006-06-16 13:17:40 +00:00
Michael Brown
bcdcd796fb 32kB window is actually larger than our typical receive ring size.
Shrink to 4kB for now.  We might want to see if it can be made
genuinely indicative of the RX ring size in the new TCP
implementation.
2006-06-16 13:16:59 +00:00
Michael Brown
bbd9e28061 Simplify TX datapath. 2006-06-16 00:19:46 +00:00
Michael Brown
d78581297b Improve tcpdump legibility. 2006-06-01 19:23:52 +00:00
Michael Brown
48fb6c6dc2 Updated retry timer mechanism to incorporate smoothed RTT estimation.
AoE now uses the retry timer mechanism.
2006-06-01 14:33:52 +00:00
Michael Brown
f6d20bb0f4 Put in a method to get the MAC address for the AoE target. (It's not
elegant, but it works).
2006-05-31 19:12:17 +00:00
Michael Brown
99ef98d0bf ATA devices are now asynchronous. The ATA layer itself now performs the
async_wait(), though we may wish to move this higher up the stack, and
consider making the block device model asynchronous.  (There is only a
marginal cost for synchronous devices, since they can simply call
async_done() before returning; async_wait() will work seamlessly in this
situation).
2006-05-31 18:57:11 +00:00
Michael Brown
68125bc441 Added generic asynchronous operations code.
Removed data_in_len and data_out_len from ata_command structure; the
lengths are implied by the sector count and the presence of the data_in
or data_out pointers.

Changed AoE code to use subcommands by default, and made aoe_issue()
nonblocking (with completion via async_wait()).
2006-05-31 14:34:17 +00:00
Michael Brown
552b4a178e One bit of an ASCII character can make a big difference. 2006-05-29 21:00:00 +00:00
Michael Brown
1db1a6dad3 Added first sketch of a generic retry timer mechanism. The idea is to use
these timer objects in AoE and UDP protocols (where there is no underlying
retransmission mechanism) without requiring each protocol to implement its
own individual retry logic.  Eventually, we should be able to use the same
timer code for TCP retransmissions as well.
2006-05-29 14:55:07 +00:00
Michael Brown
6541338897 Handle multi-sector reads by splitting them into subcommands. 2006-05-29 08:25:31 +00:00
Michael Brown
9a2a52693d Initial AoE implementation. Limitations are:
Cannot yet handle reads of more than two sectors

  No retransmission

  No way to find out a target's MAC address (this proof of concept uses
  broadcasts)

These limitations shall not last long!  :)
2006-05-28 23:29:43 +00:00
Michael Brown
f743de4858 Added tcp_kick(). This speed up LILO and GRUB booting by almost two
orders of magnitude.
2006-05-27 19:01:20 +00:00
Michael Brown
cd3ecac809 Avoid causing TX overflow on small TX queues. 2006-05-27 13:55:36 +00:00
Michael Brown
69b1f24a97 I have no idea how this ever worked before. 2006-05-27 13:43:56 +00:00
Michael Brown
6c50564724 Make PKB_ZLEN the minimum possible size of packet buffer (to allow for
hardware that can't autopad).
2006-05-27 13:39:45 +00:00
Michael Brown
1dbafa8950 Tidied up debugging messages 2006-05-27 13:38:49 +00:00
Michael Brown
b9cbae58fa Expert advice tells me that we *do* have to explicitly state the
options even when we want to use the defaults.
2006-05-19 17:50:49 +00:00
Michael Brown
d48d0fb1bb Add the concept of a "user pointer" (similar to the void __user * in
the kernel), which encapsulates the information needed to refer to an
external buffer.  Under normal operation, this can just be a void *
equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent.

Use this concept to avoid the need for bounce buffers in int13.c,
which reduces memory usage and opens up the possibility of using
multi-sector reads.

Extend the block-device API and the SCSI block device implementation
to support multi-sector reads.

Update iscsi.c to use user buffers.

Move the obsolete portions of realmode.h to old_realmode.h.

MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds
from power-up to C:> prompt in bochs).
2006-05-19 15:06:51 +00:00
Michael Brown
c69c1ec540 Documented login parameters that we negotiate. 2006-05-19 00:31:42 +00:00
Michael Brown
a280587cde iSCSI writes seem to be working (at least, the ethereal trace shows no
errors; still need to verify data integrity).

SCSI response PDUs are handled: status and sense data (if available) are
returned via the scsi_command structure.

Updated iSCSI session parameter usage.
2006-05-19 00:20:08 +00:00
Michael Brown
813a052dc3 Set ErrorRecoveryLevel=0 (we don't want to have to handle it). 2006-05-17 17:41:50 +00:00
Michael Brown
f25731d08f Split "iSCSI as a SCSI device" out from "iSCSI as a TCP protocol". 2006-05-14 23:29:16 +00:00
Michael Brown
2421723a15 Rewrote printf and friends to better support standard C semantics. 2006-05-14 02:51:55 +00:00
Michael Brown
5009f8d6a2 Provide a SCSI device interface to the iSCSI protocol 2006-05-13 11:39:46 +00:00
Michael Brown
2462047128 Typo 2006-04-30 18:19:39 +00:00
Michael Brown
9e1becaf8a Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
2006-04-30 16:59:45 +00:00
Michael Brown
8afb6303fb Half-way tidy 2006-04-30 15:23:29 +00:00
Michael Brown
04b6a1e004 Make all TCP methods optional; at least FTP data is a read-only
connection and so legitimately ignores acked() and senddata().
2006-04-30 13:20:40 +00:00
Michael Brown
aec0e127d2 Proof-of-concept FTP implementation 2006-04-30 12:02:07 +00:00
Michael Brown
01bd78d62a Created net/tcp and moved hello.c there 2006-04-30 09:34:11 +00:00
Michael Brown
7af478b30d Make tcp_connect() void; it will eventually have no failure case. 2006-04-30 02:13:52 +00:00
Michael Brown
9c9208a132 Put the TCP connection periodic processing in tcp.c, where it belongs. 2006-04-30 02:08:42 +00:00
Michael Brown
592a5a99c8 Moved uIP and tcp.c from proto/ to net/ 2006-04-30 01:16:37 +00:00
Michael Brown
352bf1bda2 Move init.h to gpxe/init.h. 2006-04-30 01:08:52 +00:00
Michael Brown
bac97eb979 Change semantics of network API so that packet-absorbing calls *always*
take ownership of the packet, rather than doing so only if they return
success.  This breaks semantic compatibility with Linux's
hard_start_xmit() method, but means that we don't have to worry so much
about error cases.

Split mechanism of processing received packets (net_rx_process()) out
from policy (net_step()), preparatory to putting net_step() in a separate
object.
2006-04-29 17:17:43 +00:00
Michael Brown
129c6c3968 Network layer now works as a proof of concept 2006-04-28 14:13:50 +00:00
Michael Brown
1488cd3b73 Fix a couple of broken assertions, and align the buffer correctly. 2006-04-28 14:09:31 +00:00
Michael Brown
fee8b91015 D'oh 2006-04-25 12:56:18 +00:00
Michael Brown
cf3783b4ca Actually, it's probably a good idea to have packet buffers avoid 4kB
crossings.
2006-04-25 12:11:36 +00:00
Michael Brown
00a1de964d Update to use POSIX-like API. 2006-04-25 12:04:07 +00:00
Michael Brown
53f78346bf Network API now allows for multiple network devices (although the
implementation allows for only one, and does so without compromising on
the efficiency of static allocation).

Link-layer protocols are cleanly separated from the device drivers.

Network-layer protocols are cleanly separated from individual network
devices.

Link-layer and network-layer protocols are cleanly separated from each
other.
2006-04-24 15:38:53 +00:00
Michael Brown
fdc2ee79db Network API now allows for multiple network devices (although the
implementation allows for only one, and does so without compromising on
the efficiency of static allocation).

Link-layer protocols are cleanly separated from the device drivers.

Network-layer protocols are cleanly separated from individual network
devices.

Link-layer and network-layer protocols are cleanly separated from each
other.
2006-04-24 15:33:06 +00:00
Michael Brown
6209bd873a First sketch of a new net device API. 2006-04-19 12:07:46 +00:00
Michael Brown
bdc8190c8d Remove the concept of the media-independent link-layer header and replace
it with metadata in the pkb structure.  This is required since UNDI will
want to be able to parse the link-layer header without destroying it.
2006-04-19 11:32:24 +00:00
Michael Brown
9f67ad9db0 First version. ARP protocol independence in less than the size of uIP's
Ethernet-and-IPv4-only ARP module.  :)
2006-04-19 01:43:56 +00:00