[PATCH v2 0/7] wget: Expose wget to applications

Adriano Cordova adrianox at gmail.com
Mon Nov 11 22:08:54 CET 2024


Currently the wget command is focused on downloading the next boot stage.
This series proposes to set wget as a general purpose HTTP request interface.
This series splits the wget code from the wget command and exposes wget HTTP
requests for applications to use. This comes in preparation for an efi HTTP 
driver.

This series proposes to expose wget via the following struct:

/**
 * struct wget_http_info - wget parameters
 * @method:		HTTP Method. Filled by client.
 * @status_code:	HTTP status code. Filled by wget.
 * @file_size:		download size. Filled by wget.
 * @buffer_size:	size of client-provided buffer. Filled by client.
 * @set_bootdev:	set boot device with download. Filled by client.
 * @check_buffer_size:	check download does not exceed buffer size.
 *			Filled by client.
 * @hdr_cont_len:	content length according to headers. Filled by wget
 * @headers:		buffer for headers. Filled by wget.
 */
struct wget_http_info {
	enum wget_http_method method;
	u32 status_code;
	ulong file_size;
	ulong buffer_size;
	bool set_bootdev;
	bool check_buffer_size;
	u32 hdr_cont_len;
	char *headers;
};

The client can then pass such struct to wget in a network stack 
agnostic way.


Adriano Cordova (7):
  net: Kconfig: add CONFIG_WGET symbol
  net: wget: add definition of struct wget_http_info
  net: wget: Add interface to issue wget_requests using wget_http_info
  net: wget: integrate struct wget_info into legacy wget code
  net: wget: make wget_with_dns return value compatible with its lwip
    version
  net/lwip: wget: put server_name and port into wget_ctx
  net/lwip: wget: integrate struct wget_info into wget code

 cmd/Kconfig          |  5 +--
 cmd/net.c            |  2 +
 include/net-common.h | 54 ++++++++++++++++++++++++-
 include/net-lwip.h   |  9 -----
 net/Kconfig          |  9 +++++
 net/Makefile         |  2 +-
 net/lwip/Makefile    |  2 +-
 net/lwip/wget.c      | 50 +++++++++++++++++++++---
 net/net-common.c     | 14 +++++++
 net/wget.c           | 93 +++++++++++++++++++++++++++++++++-----------
 10 files changed, 196 insertions(+), 44 deletions(-)

-- 
2.43.0



More information about the U-Boot mailing list