summaryrefslogtreecommitdiffstats
path: root/src/net/tcp
Commit message (Collapse)AuthorAgeFilesLines
...
* [http] GET / if URI doesn't contain a pathJoshua Oreman2010-01-271-1/+2
| | | | | | | | | | | Commit 3d9dd93 introduced a regression in HTTP: if a URI without a path is specified (e.g. http://netboot.me), we send the empty string as our GET request. Reintroduce an extra slash when uri->path is NULL, to turn this into the expected GET /. Reported-by: Kyle Kienapfel <doctor.whom@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [ftp] User and password URI support for the FTP protocolgL2n30Y06arv22010-01-211-2/+24
| | | | | | | | | | | | The default user and password are used for anonymous FTP by default. This patch adds support for an explicit user name and password in an FTP URI: imgfetch ftp://user:password@server.com/path/to/file Edited-by: Stefan Hajnoczi <stefanha@gmail.com>. Bugs are my fault. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [uri] Decode/encode URIs when parsing/unparsingJoshua Oreman2010-01-211-19/+12Star
| | | | | | | | | | | | | | | Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [scsi] Make LUN a property of the SCSI backend onlyMichael Brown2009-08-101-1/+0Star
| | | | | Nothing within the SCSI core actually refers to the LUN, so we can simplify matters by treating it as purely a property of the backend.
* [scsi] Generalise iscsi_parse_lun() to scsi_parse_lun()Michael Brown2009-08-101-37/+1Star
|
* [scsi] Generalise iscsi_detached_command() to scsi_detached_command()Michael Brown2009-08-101-6/+1Star
|
* [scsi] Make SCSI command issuing partially asynchronousMichael Brown2009-07-181-18/+11Star
| | | | | Move the icky call to step() from iscsi.c to scsi.c; this takes it at least one step further away from where it really doesn't belong.
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-183-0/+6
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [http] Support HTTP redirectionMichael Brown2009-03-301-0/+28
|
* [xfer] Implement xfer_vreopen() to properly handle redirectionsMichael Brown2009-03-303-4/+4
| | | | | When handling a redirection event, we need to close the existing connection before opening the new connection.
* [iscsi] Include credentials in iBFT only if used during iSCSI loginMichael Brown2009-02-201-12/+11Star
| | | | | | | | Avoid passing credentials in the iBFT that were available but not required for login. This works around a problem in the Microsoft iSCSI initiator, which will refuse to initiate sessions if the CHAP password is fewer than 12 characters, even if the target ends up not asking for CHAP authentication.
* [http] Send authentication information whenever username is presentMichael Brown2009-02-171-9/+8Star
| | | | | Send authentication information if the username is present, even if the password is empty.
* [xfer] Make consistent assumptions that xfer metadata can never be NULLMichael Brown2009-02-152-2/+2
| | | | | | | | | | | | | The documentation in xfer.h and xfer.c does not say that the metadata parameter is optional in calls such as xfer_deliver_iob_meta() and the deliver_iob() method. However, some code in net/ is prepared to accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer directly to the deliver_iob() method. Fix this mess of conflicting assumptions by making everything assume that the metadata parameter is mandatory, and fixing xfer_deliver_as_iob() to pass in a dummy metadata structure (as is already done in xfer_deliver_iob()).
* [http] Allow for URI encodings within username and passwordMichael Brown2009-02-131-2/+15
|
* [http] Add support for HTTP Basic authenticationMichael Brown2009-02-131-0/+28
|
* [iobuf] Add iob_disown() and use it where it simplifies codeMichael Brown2009-02-011-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | There are many functions that take ownership of the I/O buffer they are passed as a parameter. The caller should not retain a pointer to the I/O buffer. Use iob_disown() to automatically nullify the caller's pointer, e.g.: xfer_deliver_iob ( xfer, iob_disown ( iobuf ) ); This will ensure that iobuf is set to NULL for any code after the call to xfer_deliver_iob(). iob_disown() is currently used only in places where it simplifies the code, by avoiding an extra line explicitly setting the I/O buffer pointer to NULL. It should ideally be used with each call to any function that takes ownership of an I/O buffer. (The SSA optimisations will ensure that use of iob_disown() gets optimised away in cases where the caller makes no further use of the I/O buffer pointer anyway.) If gcc ever introduces an __attribute__((free)), indicating that use of a function argument after a function call should generate a warning, then we should use this to identify all applicable function call sites, and add iob_disown() as necessary.
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-191-1/+1
| | | | | | This brings us in to line with Linux definitions, and also simplifies adding x86_64 support since both platforms have 2-byte shorts, 4-byte ints and 8-byte long longs.
* [makefile] Add -Wformat-nonliteral as an extra warning categoryMichael Brown2008-10-101-20/+41
| | | | | | | | | | | -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>.
* [iscsi] Fix LUN parsing in the iSCSI root-pathMichael Brown2008-09-281-11/+14
|
* [iscsi] Change default initiator name prefix to "iqn.2000-01.org.etherboot:"Michael Brown2008-09-191-1/+1
| | | | | | | | | | | | 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.
* [iSCSI] Add support for mutual CHAPMichael Brown2008-08-111-45/+266
| | | | Allow initiator to verify target authentication using CHAP.
* [ftp] Terminate processing after receiving an errorSergey Vlasov2008-07-301-0/+1
| | | | | | | | | 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>
* [ftp] Cope with RETR completion prior to all data receivedMichael Brown2008-07-301-15/+33
| | | | | | | | | | | | 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.
* [iSCSI] Produce meaningful errors on login failureMichael Brown2008-06-041-3/+34
| | | | | | | | 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.
* [iSCSI] Offer CHAP authentication only if we have a username and passwordMichael Brown2008-04-241-4/+5
| | | | | | | | | | | | | | | | 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.
* [http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 clientH. Peter Anvin2008-03-311-1/+1
| | | | | | | | | | | | | | | 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.
* [Settings] Remove assumption that all settings have DHCP tag valuesMichael Brown2008-03-251-11/+19
| | | | | | | | | | | | 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.
* [Settings] DHCP is now working using the new settings API.Michael Brown2008-03-211-2/+4
|
* [Settings] Introduce settings applicators.Michael Brown2008-03-211-56/+85
| | | | | | | Convert DHCP option applicators in dns.c and iscsi.c to settings applicators. Kill off DHCP option applicators.
* Fixes for EqualLogic iSCSI targets:Michael Brown2008-02-071-7/+19
| | | | | | | 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).
* Make seek information part of the xfer metadata, rather than an entirelyMichael Brown2008-01-083-6/+0Star
| | | | | | | separate xfer method. Add missing .alloc_iob entries to several xfer_interface_operations structures.
* Fix off-by-one error (discovered by Shao Miller).Michael Brown2008-01-071-1/+1
|
* Various warnings fixups for OpenBSD with gcc-3.3.5.Michael Brown2007-12-071-1/+1
|
* Work around a bug in the OpenSolaris iSCSI target.Michael Brown2007-11-051-3/+10
| | | | | | | | | | | | | | | 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.
* Allowed zero-cost enforced ordering of features in startup bannerMichael Brown2007-08-024-3/+6
| | | | | | list. Added FEATURE() macros to most relevant (non-driver) files.
* Use otherwise-useless byte in DHCP feature option as a version numberMichael Brown2007-08-023-1/+7
|
* Add FEATURE() macro, plus code to display features at startup time,Michael Brown2007-08-021-0/+3
| | | | | and generate DHCP options to indicate features to DHCP server (and to PXE NBPs).
* Allowed HTTPS to be a separately configurable feature.Michael Brown2007-07-302-13/+67
|
* TLS now working again.Michael Brown2007-07-301-9/+8Star
|
* Merge branch 'symcheck2'Michael Brown2007-07-281-1/+1
|\
| * make http_open staticHolger Lubitz2007-07-271-1/+1
| |
* | Prepare for iBFT merge when possible. iscsiboot.c contains a really,Michael Brown2007-07-261-18/+98
|/ | | | | | 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.
* Added missing "static" declarationsMichael Brown2007-07-171-2/+2
|
* May be required in some disconnect scenariosMichael Brown2007-07-101-0/+1
|
* Add missing staticMichael Brown2007-07-091-1/+1
|
* Fix TX state machine and miscellaneous other bits.Michael Brown2007-07-091-38/+70
|
* Fix root-path parsing.Michael Brown2007-07-091-36/+35Star
|
* Ready to start testingMichael Brown2007-07-081-20/+24
|
* Code in place to use a hypothetical SCSI interface.Michael Brown2007-07-081-8/+23
|
* Everything except the SCSI interface should now be presentMichael Brown2007-07-081-38/+274
|