From patchwork Mon Jul 17 14:17:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3288 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:1496:b0:d7:3b0f:3938 with SMTP id b22csp7504728dyh; Mon, 17 Jul 2023 07:18:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGXlW8pQVfsgNAknJELCEtxoMdKB5EPYXnojYGnrVh88isa92/1SwpraV0GkjB0F5HF7nXS X-Received: by 2002:a17:90b:4ac3:b0:263:7d57:814e with SMTP id mh3-20020a17090b4ac300b002637d57814emr10152940pjb.45.1689603500591; Mon, 17 Jul 2023 07:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689603500; cv=none; d=google.com; s=arc-20160816; b=VWKqXkZpwK7/+hMHtrQ9P4V8J8uIQW4HnsY2rObneTjPHRaf6Y9ddyYeKbb3/LJ2yk c5pWUoz2UfQv+AGLjChDb2poSg2m/l/9EadK9PFrqIm2pfcb1Gg8w4Q71oDgmYSb6MbR ZlvbEZoQlwE8XLKfy4pdLGxzYQLwjoo+ad65Jzj9fxd2/XTXzNKxw/iqRj6w/82BzAyV djrEGZU9CA5eCV9awo7k8KFnPmjSv1ptPLuvL+jP4ZNBlUz76EAJCbU8gJl2nbKFF4Rv NzAd9t5akwhIZw+AnywhwVgZjIZXMdBcaclEWo/Ffu9SOZQN1Uxm+CxMXPq2KhDfOU+d 7qlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:date:from :dkim-signature:dkim-signature:dkim-signature; bh=UQVe/BCHW2ylo79oJwVPCbkYOT2wfWvBSFfKLLom07I=; fh=9vhRlZcpCP80UjWrCI6q3ngtdEXG/FvhUoPNKY8Aubc=; b=dpUkcs4lzuv/+k4X5J//8YdPXEw8J9bUnvZl/nVPAPr//b5VHT/V2TaT41CkyZ3sO2 t2kfy5+UFc/zmFgKs6edKYr7PBFV7xL3M46wI2uxcgZVuVuUQczLJIMfvtZkOZzCeTIc iTjPBcKtZdI14I1NaLRqZf+SMxktxLBbgd3jgOQMndL9S/Urbe9ttNjheDoU88DNK/Xl CqGIUAld1UG5kHbnBxldtMnzG1JBv6vYVAkig7gSvXo1k6HJ0NN5XXpRR7Q6/q1gfJkO YbbcNcCBewJJUUYW1K3p+ik6+SFWO1AJQflUCqCV16QnIj/qJDI61Vnq6y44x/9jFNBA 76yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=h5IAcZ4Y; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=THR8eYqd; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=PZNOILYB; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id lx13-20020a17090b4b0d00b00259b2afc651si6062816pjb.62.2023.07.17.07.18.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2023 07:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=h5IAcZ4Y; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=THR8eYqd; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=PZNOILYB; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qLP2b-0005PY-2P; Mon, 17 Jul 2023 14:17:34 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qLP2Z-0005PR-Fw for openvpn-devel@lists.sourceforge.net; Mon, 17 Jul 2023 14:17:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:Date:From :Sender:To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rZLpM1eo3qp2xweRL9Fop8x88QoAhbMTm80GpQYHLcw=; b=h5IAcZ4Y/yqwdk+ylcaxLhhPhc 7C9OQdkwgV0J4L0WNILmCQ9ySjDZ7UYX2rtyY003ifzd4r6vSFjtAMiQjF4Nw/igIiIBCi/twtK19 /wsE2EmysjmCmGIwer1DmbdE8tTs7+Mdc9/QDORq9aJUo5QiCPyH1x5lGmC3Vk3OT3ZM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:Date:From:Sender:To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=rZLpM1eo3qp2xweRL9Fop8x88QoAhbMTm80GpQYHLcw=; b=T HR8eYqd1fsucox+wLGvt5QU1PdIV6oceDI08bm1bfQw8uZA8eCu+vvj9/t5+XWMJ0imcwqw+2yYF0 lOADdYSo1Nu/c71pDb1/lqOMjMzdrk1RDUl+iYIfRxtIPQ67YwJU6MJmaVOYRCOVcDfrnUfdoWH7e dd27FT3qoDkiaW9E=; Received: from mail-wm1-f54.google.com ([209.85.128.54]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qLP2Y-00AfQm-JI for openvpn-devel@lists.sourceforge.net; Mon, 17 Jul 2023 14:17:32 +0000 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-3fc04692e20so46630435e9.0 for ; Mon, 17 Jul 2023 07:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1689603444; x=1692195444; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:date:from:from:to:cc :subject:date:message-id:reply-to; bh=rZLpM1eo3qp2xweRL9Fop8x88QoAhbMTm80GpQYHLcw=; b=PZNOILYBjXwqDkYQqezwhAkZFyDeB2LQX5H2+/gZuKdnpGH/69l7mUMpUAA2GFnci/ 9GAfKFojucHTKhDsFAfsWzzCZxBR0S/1l5ESbkILXf8Cxce9K858HNh2En7E44EGclES Qs/IDH3ZseATOsKY+iIJH5/OJ2zqT8eC/EO4TFNz8BW8f6cEG8RF1cbNJtkWhJrn6JIL /Cnw/XXvh78cMmWacf/bldIYeC4vfgeBhdL9AdXk/GFtuqXWQI6aghI/NtES+VwKDCgS s3qF7BYTeJnTQaGsZ6BBUSLb8f8Zfsv+2Xe7oL5UtxjDGpnJeNQ38va5D2Z7a55/rt04 sxVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689603444; x=1692195444; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rZLpM1eo3qp2xweRL9Fop8x88QoAhbMTm80GpQYHLcw=; b=XbaiTIwIKElWOK5Eo/Eh85OPCl8d9d55VjDE0jW73k1oH/f6o1HFffbDP7IX3WanPp J1jbeXKdOg3DYtL83ZnBmJcbtpqz/Y6N5IC5eva52Nso9kecBVOMh3TjS2MD7BBSSUw6 c+iQMqPB/AziQ7HX1aSEeruwMkjncF6F2wdzXB8Xs8NM4lgBgi+uSctBcXyBCdgnlkXj +eZ3jkrhqhnRRbg+6hG1TynajRCWRlTAahasYdx4tREeI84AX0MhCd39AZyd10LHo6AI 9Yq9KG+zgWUFgdxywmuIW1stKESWmDl+gg8tDxDLjeK9LejqVHjYEnwGR+UpRnClTKT1 sksA== X-Gm-Message-State: ABy/qLZIIr0TUKGYd2R65YCMTih2erGLJj3XPDZtzmv8AEsN2BQd8ZRg jYVd0tXlX4Cb9+MMA90e8RKbsw== X-Received: by 2002:a5d:6511:0:b0:30e:19a8:4b0a with SMTP id x17-20020a5d6511000000b0030e19a84b0amr11119214wru.2.1689603444149; Mon, 17 Jul 2023 07:17:24 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id d3-20020a5d6443000000b0031433443265sm19472539wrw.53.2023.07.17.07.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 07:17:23 -0700 (PDT) From: "stipa (Code Review)" X-Google-Original-From: "stipa (Code Review)" X-Gerrit-PatchSet: 2 Date: Mon, 17 Jul 2023 14:17:22 +0000 Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I465febdf7ee5fe573e88255844f718efb60f8e8a X-Gerrit-Change-Number: 202 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: d598871ca9fb7b4814ee8d8edfb26d20479bb6ed References: Message-ID: <3ddf7a93b6ac1215fe1bab9a3bfe32c7c054c1f4-HTML@gerrit.openvpn.net> MIME-Version: 1.0 User-Agent: Gerrit/3.8.0 X-Spam-Score: 1.0 (+) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: stipa has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/202?usp=email ) Change subject: Print DCO client stats on SIGUSR2 Content analysis details: (1.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 MISSING_HEADERS Missing To: header -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.54 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.54 listed in list.dnswl.org] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1qLP2Y-00AfQm-JI Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Print DCO client stats on SIGUSR2 X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: lstipakov@gmail.com, arne-openvpn@rfc2549.org, heiko@openvpn.net, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com, a@unstable.cc Cc: plaisthos , d12fk , openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1771677680166361975?= X-GMAIL-MSGID: =?utf-8?q?1771677680166361975?= stipa has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/202?usp=email ) Change subject: Print DCO client stats on SIGUSR2 ...................................................................... Print DCO client stats on SIGUSR2 Change-Id: I465febdf7ee5fe573e88255844f718efb60f8e8a Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20230322113249.2039-1-lstipakov@gmail.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26471.html Signed-off-by: Gert Doering (cherry picked from commit d5238627e4fab93a6c09816c60eb90e237b626c3) --- M src/openvpn/sig.c M src/openvpn/sig.h 2 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/02/202/2 diff --git a/src/openvpn/sig.c b/src/openvpn/sig.c index 5b89bb4..05c0054 100644 --- a/src/openvpn/sig.c +++ b/src/openvpn/sig.c @@ -300,18 +300,23 @@ * Triggered by SIGUSR2 or F2 on Windows. */ void -print_status(const struct context *c, struct status_output *so) +print_status(struct context *c, struct status_output *so) { struct gc_arena gc = gc_new(); status_reset(so); + if (dco_enabled(&c->options)) + { + dco_get_peer_stats(c); + } + status_printf(so, "OpenVPN STATISTICS"); status_printf(so, "Updated,%s", time_string(0, 0, false, &gc)); status_printf(so, "TUN/TAP read bytes," counter_format, c->c2.tun_read_bytes); status_printf(so, "TUN/TAP write bytes," counter_format, c->c2.tun_write_bytes); - status_printf(so, "TCP/UDP read bytes," counter_format, c->c2.link_read_bytes); - status_printf(so, "TCP/UDP write bytes," counter_format, c->c2.link_write_bytes); + status_printf(so, "TCP/UDP read bytes," counter_format, c->c2.link_read_bytes + c->c2.dco_read_bytes); + status_printf(so, "TCP/UDP write bytes," counter_format, c->c2.link_write_bytes + c->c2.dco_write_bytes); status_printf(so, "Auth read bytes," counter_format, c->c2.link_read_bytes_auth); #ifdef USE_COMP if (c->c2.comp_context) @@ -402,7 +407,7 @@ } static void -process_sigusr2(const struct context *c) +process_sigusr2(struct context *c) { struct status_output *so = status_open(NULL, 0, M_INFO, NULL, 0); print_status(c, so); diff --git a/src/openvpn/sig.h b/src/openvpn/sig.h index 4858eb9..b09dfab 100644 --- a/src/openvpn/sig.h +++ b/src/openvpn/sig.h @@ -69,7 +69,7 @@ void print_signal(const struct signal_info *si, const char *title, int msglevel); -void print_status(const struct context *c, struct status_output *so); +void print_status(struct context *c, struct status_output *so); void remap_signal(struct context *c);