public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Adriano Cordova <adrianox@gmail.com>
To: u-boot@lists.denx.de
Cc: joe.hershberger@ni.com, rfried.dev@gmail.com,
	jerome.forissier@linaro.org, xypron.glpk@gmx.de,
	Adriano Cordova <adrianox@gmail.com>
Subject: [PATCH 0/7] wget: Expose wget to applications
Date: Wed,  6 Nov 2024 09:47:31 -0300	[thread overview]
Message-ID: <20241106124731.209482-1-adrianox@gmail.com> (raw)

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:

/*
*method:		Filled by client. Desired HTTP Method
*status_code:		Filled by wget. HTTP status code
*file_size:		Filled by wget. Download size
*buffer_size:		Filled by client. Size of client-provided buffer
*set_bootdev:		Filled by client. Set boot device with the next download
*check_buffer_size:	Filled by client. Check download does not exceed buffer size
*hdr_cont_len:		Filled by wget. Content length according to the HTTP headers
*headers:		Filled by wget. Client-provided buffer for headers
*/
struct wget_http_info {
	enum wget_http_method method;
	ulong status_code;
	ulong file_size;
	ulong buffer_size;
	bool set_bootdev; 
	bool check_buffer_size;
	u32 hdr_cont_len;
	char* headers;
};

extern struct wget_http_info wget_info;

The client can then set wget_info and call wget with wget_with_dns in a network stack 
agnostic way, providing the buffer and the uri as arguments.


Adriano Cordova (7):
  net: Kconfig: add CONFIG_WGET symbol
  net: wget: add definition of struct wget_http_info
  net: wget: Add a global struct 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 +--
 include/net-common.h | 29 ++++++++++++++
 net/Kconfig          |  8 ++++
 net/Makefile         |  2 +-
 net/lwip/Makefile    |  2 +-
 net/lwip/wget.c      | 47 ++++++++++++++++++++---
 net/net-common.c     | 10 +++++
 net/wget.c           | 91 +++++++++++++++++++++++++++++++++-----------
 8 files changed, 160 insertions(+), 34 deletions(-)

-- 
2.43.0


                 reply	other threads:[~2024-11-06 14:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241106124731.209482-1-adrianox@gmail.com \
    --to=adrianox@gmail.com \
    --cc=jerome.forissier@linaro.org \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox