From 8cf18da1a971dbfe121c1fc1836bb4af942d06dc Mon Sep 17 00:00:00 2001 From: Masahisa Kojima Date: Fri, 10 Nov 2023 13:25:35 +0900 Subject: net: wget: add wget with dns utility function Current wget takes the target uri in this format: ":" e.g.) 192.168.1.1:/bar The http server ip address must be resolved before calling wget. This commit adds the utility function runs wget with dhs. User can call wget with the uri like "http://foo/bar". Signed-off-by: Masahisa Kojima Reviewed-by: Ilias Apalodimas Reviewed-by: Ramon Fried Reviewed-by: Simon Glass Signed-off-by: Ilias Apalodimas --- include/net.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/net.h') diff --git a/include/net.h b/include/net.h index e63a946002..61f9018769 100644 --- a/include/net.h +++ b/include/net.h @@ -930,4 +930,13 @@ void eth_set_enable_bootdevs(bool enable); static inline void eth_set_enable_bootdevs(bool enable) {} #endif +/** + * wget_with_dns() - runs dns host IP address resulution before wget + * + * @dst_addr: destination address to download the file + * @uri: uri string of target file of wget + * Return: downloaded file size, negative if failed + */ +int wget_with_dns(ulong dst_addr, char *uri); + #endif /* __NET_H__ */ -- cgit v1.2.3