mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 07:51:38 +00:00
net: wget: add definition of struct wget_http_info
The struct wget_http_info exposes the HTTP information of the last HTTP request issued by wget, and it controls whether the efi bootdevice is set, and whether the buffer size needs to be checked (lwip stack only). This information is otherwise discarded. The wget_http_info struct can be used by HTTP drivers to have more control over HTTP requests. Signed-off-by: Adriano Cordova <adrianox@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
657b799585
commit
408af97674
1 changed files with 48 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <env.h>
|
#include <env.h>
|
||||||
#include <hexdump.h>
|
#include <hexdump.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
|
#include <linux/sizes.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <rand.h>
|
#include <rand.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -506,4 +507,51 @@ int wget_with_dns(ulong dst_addr, char *uri);
|
||||||
bool wget_validate_uri(char *uri);
|
bool wget_validate_uri(char *uri);
|
||||||
//int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
|
//int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum wget_http_method - http method
|
||||||
|
*/
|
||||||
|
enum wget_http_method {
|
||||||
|
WGET_HTTP_METHOD_GET,
|
||||||
|
WGET_HTTP_METHOD_POST,
|
||||||
|
WGET_HTTP_METHOD_PATCH,
|
||||||
|
WGET_HTTP_METHOD_OPTIONS,
|
||||||
|
WGET_HTTP_METHOD_CONNECT,
|
||||||
|
WGET_HTTP_METHOD_HEAD,
|
||||||
|
WGET_HTTP_METHOD_PUT,
|
||||||
|
WGET_HTTP_METHOD_DELETE,
|
||||||
|
WGET_HTTP_METHOD_TRACE,
|
||||||
|
WGET_HTTP_METHOD_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* define MAX_HTTP_HEADERS_SIZE - maximum headers buffer size
|
||||||
|
*
|
||||||
|
* When receiving http headers, wget fills a buffer with up
|
||||||
|
* to MAX_HTTP_HEADERS_SIZE bytes of header information.
|
||||||
|
*/
|
||||||
|
#define MAX_HTTP_HEADERS_SIZE SZ_64K
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* __NET_COMMON_H__ */
|
#endif /* __NET_COMMON_H__ */
|
||||||
|
|
Loading…
Add table
Reference in a new issue