From patchwork Wed Oct 19 17:32:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Liu X-Patchwork-Id: 616444 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp445955pvb; Wed, 19 Oct 2022 10:33:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7due21tctUvMXHVWlIzD9LbJ0ASIcrTGUINJbNjg3whUz770eI2eqI9BkXeV1V5knin5Kq X-Received: by 2002:a17:90b:4a11:b0:20d:382d:3994 with SMTP id kk17-20020a17090b4a1100b0020d382d3994mr10773457pjb.173.1666200801070; Wed, 19 Oct 2022 10:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666200801; cv=none; d=google.com; s=arc-20160816; b=AMYL0lohQVsn3WViTtvDsCYsYR1nuQtleeywueriw1P90ReBd/n8lcnDnNBywftO1c Xg9tYiiaFUVdJVTHvpbX+rFKTJW0EFWwXxprfFMxALewHiC3H+JV61Ya53OoNkE1fAUA w4Rl1I6VbGnxQS3NKcbv725CD0k3mkruQbl7AYbUYGQZLALTAZGxjJ8s2Jz7RmJhlCNh Qr39lKkbkqgDze0FR+r645dD40oNCGXuatFB9osM8q4ICBHhlnLOfPhnwp0hA3nYgBvH +A7GKxEb/TWgrLWrch5+9OpRSe47Bh+0vd6NGQaIY9tX3kIsscwv6Qek1Nw2SFNNkWoq VV/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=b7Qsm4tZ7fLohXfJqgIeI/TcBqtOD3bNmWh3EGs4DIY=; b=KaURJj+1q68iz+7wdnOo3et2H1Fy3KNkn9MPKR16ounSPlUZzae6iJzY0upbNLULbe H5eGJu6JuTuAgqvdeGzxpJ6CD1X+ii0Gr/6ydCUUUvPbLDp2ak1iYJMAUJq/S1TK6Hr9 DoiQF1XN21rWanPDtsWyBpRkjS4dD2R5U96ckMbYMZB0ye56AVk5hyJHlhxUGZgI9llP c3rJFk02m39vZ1C8zRgHJLmz+l5je/b8ifG2tbUpqBLm3svd3v8sh+B0XFYOVE91eXeW FDf5Tp/LZuhwfWlXXaZh93RzRcIYFM3Ah0XKRj0+t7jkodvbS2Ic/FduOd9rYwjTfyRl YWmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DcxzNCev; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id s5-20020a170902b18500b00174a8d357b0si17941974plr.202.2022.10.19.10.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 10:33:21 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DcxzNCev; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9D9C184D85; Wed, 19 Oct 2022 19:33:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DcxzNCev"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 388258493F; Wed, 19 Oct 2022 19:33:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6BED68493F for ; Wed, 19 Oct 2022 19:33:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=paul.liu@linaro.org Received: by mail-pj1-x1029.google.com with SMTP id o17-20020a17090aac1100b0020d98b0c0f4so739659pjq.4 for ; Wed, 19 Oct 2022 10:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=b7Qsm4tZ7fLohXfJqgIeI/TcBqtOD3bNmWh3EGs4DIY=; b=DcxzNCevdkkOpwcLEX0rRDI+UPXjLru1kTaP/Mjfaobee3unA9MRmB6OEpvBnahSqM YC1lE7a5pBDkHJDbQkEXxO1PwlcJJqEGPEyMe3Z6fhZ9EEg+utMg7w+SAVyq0K/UKbWy QQp9eZfuTopttja2OYO6ES4opRH6fL5JbfLW8bkPT8/tr3uTnExvSSNJTl1M3sMsl//i Pm3sQgr3sqRVmWNkUoiyzH2WIp83nWz5RUgZTAmRSKTS3WplPT6JUvlCzDa638G2j3EM TGNQL/LZoAxyJKi6dKybH4Y72byZEn+bPw9iOcMrOBCc6PXQd/EKiY6VOLCDT/mnFbm8 2OHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b7Qsm4tZ7fLohXfJqgIeI/TcBqtOD3bNmWh3EGs4DIY=; b=qCizwHbXTh3GyJZmgxPT7BEG17EhWKa+9spMrLVJ2sa1GXDTEMgahsPRLR9udbUYgJ k6jLy5r8ek9YYmOjVd4I51Tlcdfftq1/UewyzAn++3zx9ItNGRDoovhmj1NNgT3a49zd 98r2Te4Wh1AXekDEZCWD6e4KWD6dye8HudMG0btCKY48reEbB29QZ7zijCGIoD8ZecHM Cbjc2XeSYrShYVSz8t6vHA5CRMaP65EMaHDEJrYCPyf1TpqpiuS9QrytRiS3gQBdmlPI pdq2ZZovlCxeMu5TEC4qM0RY8sZrTwxKGotMgdvwHftAqP1tux9OlTA8nsGkhbJjLfvF 7A0A== X-Gm-Message-State: ACrzQf3DSptITlmO0Vr9PyVKxVpMVzx8mTPwwT70+t+DZsd0OBRkRXyE KCLwiM+9ADGEpORVjbicGSi2J6K6cKjBKA== X-Received: by 2002:a17:902:6945:b0:17b:f38b:900f with SMTP id k5-20020a170902694500b0017bf38b900fmr9490051plt.85.1666200787387; Wed, 19 Oct 2022 10:33:07 -0700 (PDT) Received: from localhost ([111.184.129.17]) by smtp.gmail.com with ESMTPSA id q8-20020a170902eb8800b00176a2d23d1asm10934462plg.56.2022.10.19.10.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 10:33:06 -0700 (PDT) From: "Ying-Chun Liu (PaulLiu)" To: u-boot@lists.denx.de Cc: "Ying-Chun Liu (PaulLiu)" Subject: [PATCH v19 0/4] add TCP and HTTP for downloading images Date: Thu, 20 Oct 2022 01:32:56 +0800 Message-Id: <20221019173300.1288072-1-paul.liu@linaro.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This patch is a refresh from previous patches made by Duncan Hare . I've contacted him and continue to work on this patch. This patch introduce a TCP stack with SACK. And a simple wget command to download images from http server. v1-v12: Made by Duncan, didn't tracked. v13: Fix some issues which is reviewed by Christian v14: Add options to enable/disable SACK. v15: Fix various syntax errors reviewed by Michal. Remove magic numbers. Use kernel-doc format. v16: Add more kernel-doc. Fix more double spaces. v17: Fix wget with address timeout issue reported by Ramon. v18: Add documentation for wget command. v19: Add unit test for wget command. Ying-Chun Liu (PaulLiu) (4): net: Add TCP protocol net: Add wget application doc: cmd: wget: add documentation test: cmd: add test for wget command. cmd/Kconfig | 7 + cmd/net.c | 13 + doc/usage/cmd/wget.rst | 61 ++++ doc/usage/index.rst | 1 + include/net.h | 38 ++- include/net/tcp.h | 299 +++++++++++++++++ include/net/wget.h | 22 ++ net/Kconfig | 16 + net/Makefile | 2 + net/net.c | 36 +++ net/tcp.c | 720 +++++++++++++++++++++++++++++++++++++++++ net/wget.c | 438 +++++++++++++++++++++++++ test/cmd/Makefile | 1 + test/cmd/wget.c | 206 ++++++++++++ 14 files changed, 1850 insertions(+), 10 deletions(-) create mode 100644 doc/usage/cmd/wget.rst create mode 100644 include/net/tcp.h create mode 100644 include/net/wget.h create mode 100644 net/tcp.c create mode 100644 net/wget.c create mode 100644 test/cmd/wget.c