From patchwork Mon Jul 17 14:17:17 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: 3290 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:1496:b0:d7:3b0f:3938 with SMTP id b22csp7504806dyh; Mon, 17 Jul 2023 07:18:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUGwj0SWab4lnNNrxgSIz82jL98IvY+AhXnkDlk8AQmHpyGd1Mrf5+CSl8gyNFHnG85jxc X-Received: by 2002:a05:6a20:3c8d:b0:134:d4d3:f0ab with SMTP id b13-20020a056a203c8d00b00134d4d3f0abmr3224757pzj.4.1689603506410; Mon, 17 Jul 2023 07:18:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689603506; cv=none; d=google.com; s=arc-20160816; b=a3v+8xS4N6dC5JDWw2FACm1tffdgpzc3jvT+XT3dS5xk7/YI55eMzLZBLDVhFT2oTS 26bhzIWmO0CLrLQRPsAhiDR37v5ki9utNrL6EjkKF18hmW5XzCKPztq7uQQqzb0pSL38 vcl/Hj4MM/nl40X8uUNY/eIXN1bG95dADUPVLqAt2qEk8k2qcR335fUupmuwwomiwopz zjzYCP4Td0vtjFmFv5Jpk7Iz6+aeiL6rwKAbV6EjssB3ADbslzKJWxy9Ltq5va15lFD+ f6rR7mg4CpwPjmCDnyOws6mQOYYwaBbQ5uQ3FxbtBEfDgUs25JEGV31axccJ3q5iaTrT yFsw== 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:in-reply-to:auto-submitted:to :date:from:dkim-signature:dkim-signature:dkim-signature; bh=gnVFGXa10BERNNj13s+Wsj5biaOCdwmfAGB9YInOX6I=; fh=ovemRHYHu4aNxyHrXTFvRzJtpliwp1oHtOLyt5M1ZPE=; b=Zg2YR2moJJK/MyTPWNvtbCUCSLgnZAwRGgKvFE5sCKul6GX2MmEG9rjiMRO5cwyXbg pmszY3modKOn5t2nD8J2pJdO2DCTHVLauZ3JwCVqxjHYy5vCziXMzk06LUDJ25X0jmCD MkF9vT84jxJG8cE2FS7kTbUsI265587jHan/1SJlQ5mFUdcRKTZK2fzAOYLheCUarMBP Ovm2BsmUfNa66diUUuIBHHOVbZ5ev1/ki+VmTnMs8Qu0aeabAHbb7C7wGLGH0PUAc3wQ S2d03W8X/tBmPFd3pumuwMEgYpSyPB6xtiIO5GJrQ2qI5r30qC7AWZ/2tdBYQRgwlUq+ RWIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=hXm8oDBF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=A01K1pzQ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=EOzFSQ+X; 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 t15-20020a6549cf000000b0054ff5fb84dfsi11435687pgs.191.2023.07.17.07.18.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2023 07:18:26 -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=hXm8oDBF; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=A01K1pzQ; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=EOzFSQ+X; 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-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qLP2f-0000zK-E6; Mon, 17 Jul 2023 14:17:37 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qLP2c-0000zE-39 for openvpn-devel@lists.sourceforge.net; Mon, 17 Jul 2023 14:17:34 +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:In-Reply-To:Subject:List-Unsubscribe:List-Id: Cc:To:Date:From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Help:List-Subscribe :List-Post:List-Owner:List-Archive; bh=N8xCWuc/W8P54WWpDJ9fVvYmNUTof+8F7FwZA51fU10=; b=hXm8oDBFXoauUPf4ggqBa9JS2U BllmthRRQls20/8XmJj7zQynfjyTlognyE4rg/MIpKm3B3DE0J+J8cLoYa06RaYzcxYZf4bBlEiY0 dDkEtgPYBzy+I23cqm6AYpjPOfCxgGuvibjiggZVMqnzXr+HIRYi/ZBePd+kPakUaz0A=; 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:In-Reply-To:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From: Sender:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=N8xCWuc/W8P54WWpDJ9fVvYmNUTof+8F7FwZA51fU10=; b=A 01K1pzQ+tbqZGjOS/QFiV2WzjjPz89/Jlgo4OyinDV+glbx+4XXrqVsx5iptsRGk4JP6n5nzb0D6n GI8DS8A9ssrFOLLdQSRAoVwhjQCoBkYTE+cUsgl9BHaSKho5zeAGbUWj2kTdJ3fhBindpYMmEqqaX OIKJCUgoCRgrSy58=; Received: from mail-wr1-f43.google.com ([209.85.221.43]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1qLP2V-00049c-G0 for openvpn-devel@lists.sourceforge.net; Mon, 17 Jul 2023 14:17:34 +0000 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-313e742a787so2796854f8f.1 for ; Mon, 17 Jul 2023 07:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1689603439; x=1692195439; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:in-reply-to:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=N8xCWuc/W8P54WWpDJ9fVvYmNUTof+8F7FwZA51fU10=; b=EOzFSQ+XTa8z9f+qB0Bd9rUSIa4X+o45t6WxBNvVLryNSn2rYYKIyQabxlkwPmbWB6 pcmooIpuhnWx/ntF/LX5b6WbH3nKks5uY4u8gLz2szGO7Wm5nm7KIO3NZ8N549/jmQCq VP56C/ftQaAxoaGepIXt1qosoLfbeHncbNf2jYPB50jJbf1mgGCrthEn5cHCGBKZOK7I 3YIU5bNIstv0Qm0GsD5oCeY/rDcDjjnHrq039w+/IsYZ0BulQen4ybr7WdILtjCu5sY7 6MuoRatKMxx9NtCI7IHmBBlZbhncWuEgoU09j/iwVdALx1Bh5S6h8xpVWt0+uisaIU2o i3MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689603439; x=1692195439; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:in-reply-to:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N8xCWuc/W8P54WWpDJ9fVvYmNUTof+8F7FwZA51fU10=; b=PISOinCBG2fid9v4xscfKVk/fakIJf47BSA9uiSf93DJEQgjM+j/xLaqng3z54LrMM 3qp9BiB4DDb7CEMUzfp8x1UaXNJ6I47+20W+3+Arj5e0psDB7489x7ojcz9PA9tWZG+2 7Hww/UORM/kEG0QC+Zi6LtAwifBVdlMSTC4TG6PbMzpVkGIKw287f6XUCChRBs3pAnBI 8MNMCVNeaWXdyJk+6YnhoCZ+k5Fh5GzhlFHtU1ZsAvAFM5eZ6UhD0J0/VfLdgsvDoWfT tnRXckH4oASNzEVSK+Ss4B+qGyagv+VCVbJxbXb0+11mbbPPItgTVu1mkby3+JRZiMkx J8vw== X-Gm-Message-State: ABy/qLbuc7OS0l+WfbmwtuAG5EQ6v/xWK+QWON+RlRTDzOwp51RSodUb TA/y8sHOtQS6ful/NUCOnb72ew== X-Received: by 2002:a5d:5644:0:b0:313:f75b:c552 with SMTP id j4-20020a5d5644000000b00313f75bc552mr7151638wrw.15.1689603438801; Mon, 17 Jul 2023 07:17:18 -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 q4-20020adfcd84000000b0031134bcdacdsm19439321wrj.42.2023.07.17.07.17.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 07:17:18 -0700 (PDT) From: "flichtenheld (Code Review)" X-Google-Original-From: "flichtenheld (Code Review)" X-Gerrit-PatchSet: 2 Date: Mon, 17 Jul 2023 14:17:17 +0000 To: stipa Auto-Submitted: auto-generated X-Gerrit-MessageType: merged X-Gerrit-Change-Id: I465febdf7ee5fe573e88255844f718efb60f8e8a X-Gerrit-Change-Number: 202 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: d598871ca9fb7b4814ee8d8edfb26d20479bb6ed In-Reply-To: References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: flichtenheld has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/202?usp=email ) Change subject: Print DCO client stats on SIGUSR2 Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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.221.43 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.43 listed in list.dnswl.org] 0.0 HTML_MESSAGE BODY: HTML included in message -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_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1qLP2V-00049c-G0 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: frank@lichtenheld.com, arne-openvpn@rfc2549.org, heiko@openvpn.net, openvpn-devel@lists.sourceforge.net, lstipakov@gmail.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?1771677686278845162?= flichtenheld has submitted this change. ( 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(-) 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);