summaryrefslogtreecommitdiffstats
path: root/src/net/tcp/httpcore.c
diff options
context:
space:
mode:
authorMichael Brown2020-10-16 16:08:19 +0200
committerMichael Brown2020-10-19 14:07:40 +0200
commitb50ad5f09ab11f7d5b61a9a5c21637ea139fda08 (patch)
tree612f63e058acdb9cd838755f5a2461166febeac5 /src/net/tcp/httpcore.c
parent[efi] Provide efi_uri_path() to construct a URI device path (diff)
downloadipxe-b50ad5f09ab11f7d5b61a9a5c21637ea139fda08.tar.gz
ipxe-b50ad5f09ab11f7d5b61a9a5c21637ea139fda08.tar.xz
ipxe-b50ad5f09ab11f7d5b61a9a5c21637ea139fda08.zip
[http] Allow HTTP connection to be described using an EFI device path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/tcp/httpcore.c')
-rw-r--r--src/net/tcp/httpcore.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/net/tcp/httpcore.c b/src/net/tcp/httpcore.c
index f755fb72..01bb496b 100644
--- a/src/net/tcp/httpcore.c
+++ b/src/net/tcp/httpcore.c
@@ -56,6 +56,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/profile.h>
#include <ipxe/vsprintf.h>
#include <ipxe/errortab.h>
+#include <ipxe/efi/efi_path.h>
#include <ipxe/http.h>
/* Disambiguate the various error causes */
@@ -519,6 +520,18 @@ __weak int http_block_read_capacity ( struct http_transaction *http __unused,
return -ENOTSUP;
}
+/**
+ * Describe as an EFI device path
+ *
+ * @v http HTTP transaction
+ * @ret path EFI device path, or NULL on error
+ */
+static EFI_DEVICE_PATH_PROTOCOL *
+http_efi_describe ( struct http_transaction *http ) {
+
+ return efi_uri_path ( http->uri );
+}
+
/** HTTP data transfer interface operations */
static struct interface_operation http_xfer_operations[] = {
INTF_OP ( block_read, struct http_transaction *, http_block_read ),
@@ -526,6 +539,8 @@ static struct interface_operation http_xfer_operations[] = {
http_block_read_capacity ),
INTF_OP ( xfer_window_changed, struct http_transaction *, http_step ),
INTF_OP ( intf_close, struct http_transaction *, http_close ),
+ EFI_INTF_OP ( efi_describe, struct http_transaction *,
+ http_efi_describe ),
};
/** HTTP data transfer interface descriptor */