From patchwork Wed Jan 10 15:28:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 858347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c09::23c; helo=mail-wm0-x23c.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbgpd3djakgqeaohkabi@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="ctQPsWfb"; dkim-atps=neutral Received: from mail-wm0-x23c.google.com (mail-wm0-x23c.google.com [IPv6:2a00:1450:400c:c09::23c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zGtHw1MMGz9s7s for ; Thu, 11 Jan 2018 02:30:36 +1100 (AEDT) Received: by mail-wm0-x23c.google.com with SMTP id 194sf7824311wmv.9 for ; Wed, 10 Jan 2018 07:30:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1515598233; cv=pass; d=google.com; s=arc-20160816; b=qfOoj2PaiDGIU/aVt8ls8LRrTDg8pG+YG4i+zkgqZ+VPiHCDsGJnBAgDuZwXDLiuhx gyW0oCu0WNu/aDCYNHuntZL4+7Tco0DVlXhG3S/SIoZzFYeikCvYFXByFlhGl0AY76Mj RWOV/+SQ0Y2SZsHezpbJiA8VZuCjFM1ZbjIQiQNgmCVsvolp9/mcrEmRNirSYRIWUUA/ dYI7JtHamyWlPKtzbKcA1ye2mM9RGHWF+53dRIQaIfemHP/7GjIrzGawpueyj9oMF33k 00n+TMfHhny5MaM+TNypI28B677x8Ip4k2hN7vBUkyjXL4Cv4aQOs3qmZ1ysKk7eg8fb TIPQ== 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:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=z1M+08uRUpijh9/JJK6v00A7MnVg4Icx+/xHGaz+vIk=; b=UcEw8A8Mmce0RiIarF0lqV607T4wYHx1q2RpazcgBqujQyY497YkvLOvPxb56w38MF EATEETM+PGDBb3TaqZuCRqSaskKPMImgoDUVsJMPnVbJTrDCjlEpVe3FsiwVx/EQiqz7 qt21m5V0Grk4vVrZzTlfPBSSfrNf3C7xnj0ofuSM0aQWkAEVl7neV39epiPjfKFiG79N ayMKkkPu9UJm1J8h51wkj6Fxj+uL5gPepfgTf17LoB3IpcrrPz2Jnv+yT3R4Dl3IARnT 5kCHPeEc77EI0Ril5WP7RkTbxFaACbS2MmoRoxahsZrSzpUmGe8TH4SYaUDWlfXrUmaa Ntfg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=z1M+08uRUpijh9/JJK6v00A7MnVg4Icx+/xHGaz+vIk=; b=ctQPsWfb86pSs4pBcu5PgMP8UeUEEvxiuoaMnOeFTVEJQQWRV51YhmW4ZX0Dql2lFj fMHDHeiXcyh4zGXQ9YkAjSh24BnEpRY4ZvfSNjEr+dhDxQWZYdVQYPS/KtH50u+UxkV3 chqBAcuTFXJLPdk6+wuDDvSjUZ4J9ujstET5Ae60ICbfOzP55rfYiM6NtAjIO4Jvl+V3 8DvGh6U6vvQpHBW3HBSR8jkrViWR8/e5LqUX1DWTlvMWCmzixahahi3xy1T/gDP3k2MB gew6gbVkUUo4+iPhHNTJ8CXV9Fe8SOsPh7FyBTCf0N1ErDuixPPIm30rgnzHvn7Wc8Pz Qqpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=z1M+08uRUpijh9/JJK6v00A7MnVg4Icx+/xHGaz+vIk=; b=XpQeWeH0Tg0wXYHW1M/dRnrf6yTY6JE0IM+i7PM5NF0tNXigI+ajuuHpv1ioyCoxey Tj/yB/9vTq+IFXY/HR2t1u5E2lC6CLgGEkfujagRMwkCFLo7rF8dB73X1Ohq5a5sYpcD bRfK60fIu3MVfJDT4uQEJd+b1Sqi8mAvW3nY5N56WG+hlgK2kMuFEmBIOut5+CqhYI4U YFrSwWTNZyOGCrKwnxNPKKY5E9tnh6hDs6+jalOkw8Jnl57MdJTb6kAjWxGZI/iNpkcp JlfOyiu5jzf1cjDd4Uv3cIOxUbL+t3UG3lvpUzP3oobXoFSQlMQW6YpHOzn+rpVFKcLI ENrg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AKGB3mJYodSEDSIkSFxOWo9mlZZdcIJD+lPUTSqyrTTVyfjgfIdlpX8j NWyyZChra9xmYtWXTkVl57E= X-Google-Smtp-Source: ACJfBouC1EPRzvuEHOfdM78bi+tIlwjm7tIlcuY9gbSQ4yZ7ET2HmSmjbOkE+uDTt7Dr5sDdKrC5AQ== X-Received: by 10.28.247.11 with SMTP id v11mr202277wmh.6.1515598233869; Wed, 10 Jan 2018 07:30:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.142.69 with SMTP id 5ls2917602edx.5.gmail; Wed, 10 Jan 2018 07:30:33 -0800 (PST) X-Received: by 10.80.138.134 with SMTP id j6mr6180868edj.0.1515598233279; Wed, 10 Jan 2018 07:30:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515598233; cv=none; d=google.com; s=arc-20160816; b=BLiKzXu/+MD7UvMfvC2NrOyOgQLXI/RPmqTiglbf5fzotlaPms/rf5lg9qN32c2H6Z A/XTr8Jj7K4n7dBlwMYQa+zgW/15RyPqwmhmcArgAmUw61njlsFTa5wSKdOThQg77EAb G/ekob4G7d0ajqwOl76yoz89Ha/tfWpuv47VUvD5CW90Qta3m8FN2ua/eARsrgQiqxL2 4ku3da/HsBhWC+bS3abrPOsiMCmNzl5oSVwxwuAUODHvTl/tr8z96Z+9z+UQSM7QMSdd omf5075GNdaisnEKhlMRwLe25uikKk9n0pXM15Smlc8em2BZal4srmhakKRwT3cRgp15 I4CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=9iK1gzBSt4yoKxHWMFQaGgRprpi7EytJBkpD4tHb8KQ=; b=dvQ3W9/OHgXKGJBvTfJIkb9wYmJRRmVlLvJUx2Tvpt9RSkwLuj9mJqvAbNdtfv6MUr BmZnIUvEaWbGm2ixZiRYJdSaELldWVoCTSEyHZWl2VlcGAbeML7i1FjgY9DkR7aj8RAe ikHOK0JfI/A7wzk1aKTC9EEFbcNg2GfxKlKSfuBE4ILq8sTZm3CnSuEviiRhQrh/3fXO CZyniEkdYoOk65Y40WVEYkBfZlwSIUWBa3YMHgljBDBGc6nrp3+mZOn6xfKt8jQUeQ9o uwIh33jASZd0XcJAclB79bTLF6aUqtA+0xwqi75iZ6EHAyYIyvQKSeOu2nWAuDBiyp9l oyrg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id d4si526774eda.2.2018.01.10.07.30.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 07:30:33 -0800 (PST) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w0AFUWZS010190 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 10 Jan 2018 16:30:32 +0100 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.251]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w0AFUWoY029694; Wed, 10 Jan 2018 16:30:32 +0100 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] channel_curl: make sourcetype configurable Date: Wed, 10 Jan 2018 16:28:04 +0100 Message-Id: <20180110152804.20163-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.15.1 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com 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: , As channel_curl can be used generically, it should not unconditionally report sourcetype=SOURCE_SURICATTA, hence introduce a 'source' field in channel_data_t. Signed-off-by: Christian Storm --- corelib/channel_curl.c | 2 +- include/channel_curl.h | 1 + suricatta/server_hawkbit.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index 608f5d3..264b38e 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -679,7 +679,7 @@ channel_op_res_t channel_get_file(channel_t *this, void *data, int file_handle) if (file_handle == FD_USE_IPC) { for (int retries = 3; retries >= 0; retries--) { - file_handle = ipc_inst_start_ext(SOURCE_SURICATTA, + file_handle = ipc_inst_start_ext(channel_data->source, channel_data->info == NULL ? 0 : strlen(channel_data->info), channel_data->info); if (file_handle > 0) diff --git a/include/channel_curl.h b/include/channel_curl.h index 4b23cf8..8015eb5 100644 --- a/include/channel_curl.h +++ b/include/channel_curl.h @@ -58,4 +58,5 @@ typedef struct { int (*checkdwl)(void); struct swupdate_digest *dgst; char sha1hash[SHA_DIGEST_LENGTH * 2 + 1]; + sourcetype source; } channel_data_t; diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 746f4a1..670c7ae 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -140,6 +140,7 @@ server_hawkbit_t server_hawkbit = {.url = NULL, .channel = NULL}; static channel_data_t channel_data_defaults = {.debug = false, + .source = SOURCE_SURICATTA, .retries = DEFAULT_RESUME_TRIES, .retry_sleep = DEFAULT_RESUME_DELAY,