summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJerome Forissier <[email protected]>2024-10-16 12:04:09 +0200
committerTom Rini <[email protected]>2024-10-16 11:11:56 -0600
commit3c656c928bd7c8bd48341b813057db8ed08d6bfb (patch)
tree6ffcbe7faee884b1c82d971861f1c3aec2aa4e00 /include
parent3135b9a9162a51a22447d1e269871c4cacac3a4e (diff)
net: lwip: add wget command
Add support for the wget command with NET_LWIP. The command normally expects a URL: wget [loadaddr] url, but it also accepts the legacy syntax: wget [loadaddr] [server:]file. The server IP may alternatively be supplied via ${httpserverip} which has higher priority than ${serverip}. Based on code initially developed by Maxim U. Signed-off-by: Jerome Forissier <[email protected]> Co-developed-by: Maxim Uvarov <[email protected]> Cc: Maxim Uvarov <[email protected]> Signed-off-by: Jerome Forissier <[email protected]> Acked-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/net-lwip.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/net-lwip.h b/include/net-lwip.h
index ff9d03b23e8..1c3583f82a1 100644
--- a/include/net-lwip.h
+++ b/include/net-lwip.h
@@ -16,8 +16,26 @@ void net_lwip_remove_netif(struct netif *netif);
struct netif *net_lwip_get_netif(void);
int net_lwip_rx(struct udevice *udev, struct netif *netif);
+/**
+ * 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);
+/**
+ * wget_validate_uri() - varidate the uri
+ *
+ * @uri: uri string of target file of wget
+ * Return: true if uri is valid, false if uri is invalid
+ */
+bool wget_validate_uri(char *uri);
+
int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
int do_ping(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[]);
#endif /* __NET_LWIP_H__ */