From patchwork Mon Nov 20 15:54:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1866125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=HmhegWgK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13a; helo=mail-lf1-x13a.google.com; envelope-from=swupdate+bncbaabbwmc52vamgqexodzwrq@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x13a.google.com (mail-lf1-x13a.google.com [IPv6:2a00:1450:4864:20::13a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SYsXY6NHPz1ySZ for ; Tue, 21 Nov 2023 02:55:09 +1100 (AEDT) Received: by mail-lf1-x13a.google.com with SMTP id 2adb3069b0e04-5079a8c68c6sf4163720e87.1 for ; Mon, 20 Nov 2023 07:55:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700495706; cv=pass; d=google.com; s=arc-20160816; b=O+tH2GljkIcMaZAJxNcdtQpe/6F2kYSgS1OfIM9uCj3/uKCnqZ9W33yCUMH34vAgt2 1TOBsJ+QPzlH7pqBC4OjeB/Sy/mkc+5iGQIQVFVPhciR/tIRoVn4Ko4oLayyhV722pbt 3onVlX8cPtWnHLse61I1o/eFHCFq7XP2Up9WoTsRdaZNVux07TIQ9EHNraQt/l7WzBNW YemH0DZ0nWx+4KBSjA1qZxo5F3nGPmxXp1VbJYYEMWKQhR1k0K1ZyZEKzkrR7T6UNZai HODkYkibBggeXoq/C9OSX43I0KMiyx+IdcG2ZTXNXYymfu0xi3CbmoE9gt53JM3dMImc 2Jdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=bwK5MbS2BkVP5+tuA9jkSl6IebTx5X5XFTcLYUvqexM=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=FyL9z6gosbP2xb5+EZS70Oie1TiTbnCBVpeYw1wxT2nd3zSZ9lRpDO2K2d6RvUML8I cbf1Xdj9T49vS9iBtco/8PaQgSezRfyTNHsHf5Zb7X4sKM+A9UXX/+Edelb0Kl0hAfuO Dn14HQB3sRKXrLHHD1YL9cur6j0EiO2uEnpcsyB8X+vxvrAdXBuYdhhcAGHJxZOir397 f4Lhncwkjs++iFBXUBdnnwT8PG9KsDa2XIFdwS/XPX6oDqvrNaP+HJLqe6G5fZLfu5qj fi5ZaXN8rZ9E5GmSbuz3uSaVYSix48jHXTzhXEamx20jtSp7nS0Gs74slCl+/cRJ3BTY LIOw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1700495706; x=1701100506; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=bwK5MbS2BkVP5+tuA9jkSl6IebTx5X5XFTcLYUvqexM=; b=HmhegWgKQx2GNeut9vHZyOArU8gGqoJMH4JZtqm/raQs6sSbu3YUcH6qDSpXHAztDu 58bZ6dAQEowp/F0rtWX/k4nP3HSif07v97rooVK9Y8pG9+Ul4CZgJt4yRSPy+wXoQGP/ 5E+TAJnPPK+ObfW+TFmoyLyZCCQRDB98UMjp0fJAa83qrwvyqDiAfk7I6Dgonz9+ivma GfLnwpnryNC2jBdfB/EDmjN3/5IqsBGVjcTztAWts52iemsCi5RuojC5g36YiopCPBgw 29sKXmxM247NX7bGMxF/26RKKOYdboXNsQYDSS+03YzqElh/JMlyiUGYt7W2Hza+PVcj 1sfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700495706; x=1701100506; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=bwK5MbS2BkVP5+tuA9jkSl6IebTx5X5XFTcLYUvqexM=; b=nuo14Xk/d5t+jE8Uq0+CoY7JuJB0VLIIPYD9KIUT6SfSzcgIZjKOM4FPuhnIBUKtkc FBEmQjfKl5UKg6IMsdAZNkyZFXYf2XZH797Q8U2mPAK8cWwCKUZ9AHEV5Aa977F8kbMY /5yJkMFsV3xjxDRkd+4mDNMx1qgk55fQsY/+b3nj3xNFaBRaeFSXg35agBgX3pOyIAKd dJ4NlPoOweicj+yIEA8herqLCi0SJ+KBzZdzIWqSg5URLcImdqgEbUBDkYUDqWrL+xOO RKbmH0bdQ1n1iNrdDUmooOQ2n13NulXeAMYx9siXVwLGKWusFjcixvOXfAmmFft0XKek Qbug== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0YwMGHkdVrcHogZ+BVnv0m2IzwjOseq0SbeFlBsrgCI64iKxoDEy gQYZKwa2YvFqMcYiuyJTRcE= X-Google-Smtp-Source: AGHT+IFt4cS6V7IitG3a8H9vpD/Y5v2rzMqhC2gxA8b3Z+J1q9Kgc9YVKoJqhna93yZdM1InWN4RFQ== X-Received: by 2002:a19:ae11:0:b0:50a:9f28:5efe with SMTP id f17-20020a19ae11000000b0050a9f285efemr6084734lfc.19.1700495705772; Mon, 20 Nov 2023 07:55:05 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6512:23a7:b0:50a:a6b2:1d1e with SMTP id c39-20020a05651223a700b0050aa6b21d1els247821lfv.2.-pod-prod-01-eu; Mon, 20 Nov 2023 07:55:04 -0800 (PST) X-Received: by 2002:a05:6512:312a:b0:500:99a9:bc40 with SMTP id p10-20020a056512312a00b0050099a9bc40mr5598214lfd.69.1700495703764; Mon, 20 Nov 2023 07:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700495703; cv=none; d=google.com; s=arc-20160816; b=R1cmGN5VCz5E++hV6w7HZ5WOk/VkESIeRagRn3mKt15Qap7eHVjwkGz0kSFkmh7p8B MkEyaCVixDurynqtUFbPGU4g63KfgfTYntoo1uOa7wS/dWvMgTmK/aclq/LfA0MwCTUZ bzQkAMTEeNh412u+of6wRFVWZ7xa/qgs6q39zINbKQti5ZPdHmbMmuGnK5hFE5jT5rR1 qYxllLtJQ2MONCnI5UdwQ8X9iGjfhX8VF3qawgvpxA9ypq3eKhs2+ES7szXG/kVl1EjV m4qXEIWNH6d6KA5e2KU5ZYniPUjUBfVq/DjjArtEeflwCkPN39IfrZdjRZ4f1yj829dj EUNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=nWsp7YCL8nvaKFFLXUTSUwYTiN9y1BkkYF/YyamV5W0=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=aAmrpbCvuoTquY4Dl/rXHRSdYQYdlBP97dz2ITMMK4LtbXfUfn2zy/D5084MbO8Ywv 1T05J2wgLST0PtyuItjRD0YLgwVi/clUsv2dWu3MECOSMkh6k+N8Ued6bZ9npNQ6oLEK dX5gz8+Wb1OLE9laRbLwyuPKLQsZX9HdN6zIhUEYaQ2bteZUGIstFqbw1JKn+1uYkmnd rFnIyaHNda50Ts7dkHXWNxukBZ7s0I7HWD+6YC0bHwhV+6xQv8G5Noi96AIAp/MBsNTX ZLaX5xYWbYZMqqA4hXgzCE0arg5e+31td+Fu4ZzbSLy/BLIBWle5WeZc1qKgm0uraUAb ooyQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id br35-20020a056512402300b0050aa8602e82si200873lfb.10.2023.11.20.07.55.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 07:55:03 -0800 (PST) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MRCFu-1qkIT43sVI-00NER2; Mon, 20 Nov 2023 16:55:02 +0100 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 07/13] Improve comments in the channel_curl Date: Mon, 20 Nov 2023 16:54:53 +0100 Message-Id: <20231120155459.45188-8-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231120155459.45188-1-stefano.babic@swupdate.org> References: <20231120155459.45188-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1:ioTl6LFDwcuz/JPE/UOnu1XmlOSD094UE9idZcSFDhnYsFh4Flq UcSoCu7WtdLbZm9zISvV8T7f9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V43hTP3cIwwCQewqL KOOD3+cDqLfArD1dkcrgBRmhQP2hNCTpJ+l8= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic --- include/channel_curl.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/include/channel_curl.h b/include/channel_curl.h index 25d3602d..b1fc65c2 100644 --- a/include/channel_curl.h +++ b/include/channel_curl.h @@ -12,11 +12,9 @@ #include #include "swupdate_status.h" -/* Curl Channel Implementation Private Header File. +/** Curl Channel Implementation Header File. * - * This is a "private" header for testability, i.e., the declarations and - * definitions herein should be used by code employing the curl channel - * (e.g. server_hawkbit.c) and unit tests only. + * This is the specific channel implementation using libcurl. */ typedef enum { @@ -27,6 +25,10 @@ typedef enum { CHANNEL_DELETE, } channel_method_t; +/* + * format for a response: the channel can just transfer + * or try to parse the answer with a specific format + */ typedef enum { CHANNEL_PARSE_NONE, CHANNEL_PARSE_JSON, @@ -35,13 +37,19 @@ typedef enum { #define USE_PROXY_ENV (char *)0x11 +/* + * Structure to configure the connection and to + * exchange data. + * This is passed to the channel methods (defined in channel.h) + * to set up the connection. + */ typedef struct { - char *url; - char *unix_socket; - char *cached_file; + char *url; /* URL for connection */ + char *unix_socket; /* if set, the UNIX Socket is taken for local connection */ + char *cached_file; /* Retrieve file from cached file before getting from network */ char *auth; - char *request_body; - char *iface; + char *request_body; /* Buffer for the answer */ + char *iface; /* Set a specific interface */ json_object *json_reply; char *raw_reply; bool dry_run;