summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorYing-Chun Liu (PaulLiu) <[email protected]>2022-11-08 14:17:29 +0800
committerTom Rini <[email protected]>2022-11-28 13:06:39 -0500
commitcfbae48219fd81f6c9e1a7b5ee160cdd3005f958 (patch)
treecf1e9db0754ad81314df553a1c69c9e1edeef482 /include/net
parenta3bf193bf4ea8703bcf96b1a34713fb2ae87aa39 (diff)
net: Add wget application
This commit adds a simple wget command that can download files from http server. The command syntax is wget ${loadaddr} <path of the file from server> Signed-off-by: Duncan Hare <[email protected]> Signed-off-by: Ying-Chun Liu (PaulLiu) <[email protected]> Reviewed-by: Simon Glass <[email protected]> Cc: Christian Gmeiner <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Michal Simek <[email protected]> Cc: Ramon Fried <[email protected]> Reviewed-by: Ramon Fried <[email protected]>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/wget.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/wget.h b/include/net/wget.h
new file mode 100644
index 00000000000..da0920de118
--- /dev/null
+++ b/include/net/wget.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Duncan Hare Copyright 2017
+ */
+
+/**
+ * wget_start() - begin wget
+ */
+void wget_start(void);
+
+enum wget_state {
+ WGET_CLOSED,
+ WGET_CONNECTING,
+ WGET_CONNECTED,
+ WGET_TRANSFERRING,
+ WGET_TRANSFERRED
+};
+
+#define DEBUG_WGET 0 /* Set to 1 for debug messages */
+#define SERVER_PORT 80
+#define WGET_RETRY_COUNT 30
+#define WGET_TIMEOUT 2000UL