From patchwork Tue Sep 7 12:31:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 1942 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id iCRYHoLoN2E8WAAAIUCqbw (envelope-from ) for ; Tue, 07 Sep 2021 18:32:34 -0400 Received: from proxy9.mail.ord1c.rsapps.net ([172.28.255.1]) by director10.mail.ord1d.rsapps.net with LMTP id sKxcHoLoN2EJSQAApN4f7A (envelope-from ) for ; Tue, 07 Sep 2021 18:32:34 -0400 Received: from smtp22.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.ord1c.rsapps.net with LMTPS id yHjnHYLoN2H1VAAAgxtkuw (envelope-from ) for ; Tue, 07 Sep 2021 18:32:34 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp22.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 7e8bd1be-102b-11ec-b706-a0369f0d84d2-1-1 Received: from [216.105.38.7] ([216.105.38.7:49804] helo=lists.sourceforge.net) by smtp22.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 16/6E-32712-188E7316; Tue, 07 Sep 2021 18:32:34 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1mNjd5-0007DY-FL; Tue, 07 Sep 2021 22:31:47 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mNjd3-0007DQ-Gc for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=V+atD+qBkOOsM1g2Y0UO12BCU5yGdUPfF7OXh0L/HX8=; b=mKb2vrO6qv/9CFGCS6DNFRWE+0 cowRHK+5O0CyCb3XuHdbpp7Z+OCjMIsAgcTHRL09Mxe6I/bDferqnFqe4R/9xZfAYIoLy+CkGTaGV TELy48l011idlgdS5ve0wpawM4v05fk+f28+0hhtqR4yjhiMqY2+z0pRFyKxqOq/u+R8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=V+atD+qBkOOsM1g2Y0UO12BCU5yGdUPfF7OXh0L/HX8=; b=X/ILKjQmtK5JOdQwjRtgN0aeej vbCaUBV2IcvsnXv/e/hfQg+kU7rMEuhK0f1Esp/0ru8p/Ph8wCDbKTiw5CbRz/V8aMqCLSRz8jGa/ kz61yl3Ko3pSrMRAD96h9zjDDCdmoJBPoH+bW5N2+fyi6h0sIVkYYIAsCXZaLFkaFh98=; Received: from mail-io1-f52.google.com ([209.85.166.52]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1mNjd2-001aU0-OG for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:45 +0000 Received: by mail-io1-f52.google.com with SMTP id g9so547120ioq.11 for ; Tue, 07 Sep 2021 15:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V+atD+qBkOOsM1g2Y0UO12BCU5yGdUPfF7OXh0L/HX8=; b=p/95OJA8PuncBj6wG3Q7NFfnvu25RhDoN9SNomp3emgr6hVBxSlpasudY9tHicryqv YLMvpsfe+/1zBtOPwmZGgvTlOx8l6U1GGLPnINpsw6J19M2iedC5cMMuLpSpgQYrLy9o LrYU0x/RfAhUrYAn8H/6NeA3chQGg38Kk3GXR4U3cekthY/m7bqJWedOX6+2Y0M/DmVj 6rdRyBiHRo3bfCzmqhusUO3c67NVBYhrzLEgLpdOtulIWwkS3DsTcWzA6hpmvxwy2tfs 1jXhHY7mA9ScMwCkXMuUb5hS7ipw5Ne4/9XbvbU5aSNSIbvDQmkElTP0mNupfLSE8yX9 zMyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V+atD+qBkOOsM1g2Y0UO12BCU5yGdUPfF7OXh0L/HX8=; b=gk+SB1dHyenlbPi8wPfgXG8l82xoiHW/cF4hxbYXl8Q0su6rkLAEsfrq6Cw36Z9XZT PLibF+GQm/+NFTiaoUVDwEweudatjFtzo5ZDELHka2odQ8QdEEk08dQuNgTPTlCdX/Us 7uZ2g0ReCxZXKGNzg0evmB3R/+YCtSeJ4J/qjbfX4pcT4eqew/Dym1r+28V8/djy6zcG uqO5JaDsM7WgTB6cDbg7KAz2hD2mRekt8Eocw7Ok/MuTYqIKQHHJDEcHonvdTmnwo3Sd LYNkeQQXXPIUuN4ZEJiyI8iigjpb+4Y43Bx1mZXmwUze2Ka+5XdTNSLCtSsnsxOuSA1v XW6A== X-Gm-Message-State: AOAM530CwACsSwTuZSq3fG+EpIkCxEAo4zbn+sHeOt0Wb6JkyStHAHkT ng/WbhC/KAjvSfRN41OrFpC69I3ERS0= X-Google-Smtp-Source: ABdhPJwgtsIXYi22QHzRUil0hUGeP7CgZzSSMQZGpzssLCSiKjg9NWX9Xf6oL9kS6qN7i679YC/RtQ== X-Received: by 2002:a5d:8715:: with SMTP id u21mr428679iom.1.1631053898874; Tue, 07 Sep 2021 15:31:38 -0700 (PDT) Received: from uranus.home.sansel.ca (bras-vprn-tnhlon4053w-lp130-02-70-51-223-174.dsl.bell.ca. [70.51.223.174]) by smtp.gmail.com with ESMTPSA id b10sm224405ils.13.2021.09.07.15.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 15:31:38 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Sep 2021 18:31:24 -0400 Message-Id: <20210907223126.8440-1-selva.nair@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210825210232.22509-1-selva.nair@gmail.com> References: <20210825210232.22509-1-selva.nair@gmail.com> MIME-Version: 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: From: Selva Nair Selecting the remote host via the management iterface (management-query-remote) provides a restrictive user experience as there is no easy way to tabulate all available remote entries and show a list [...] Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.52 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.52 listed in wl.mailspike.net] -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_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1mNjd2-001aU0-OG Subject: [Openvpn-devel] [PATCH v3 1/3] Add remote-count and remote-entry query via management 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair Selecting the remote host via the management iterface (management-query-remote) provides a restrictive user experience as there is no easy way to tabulate all available remote entries and show a list to the user to choose from. Fix that. Two new commands for querying the management interface are added: (i) remote-entry-count : returns the number of remotes specified in the config file. Example result: 10 END (ii) remote-entry-get i [j]: returns the remote entry at index i in the form index,host,port,protocol. Or, if j is present all entries from index i to j-1 are returned, one per line. Example result for i = 2: 2,ovpn.example.com,1194,udp END Example result for i = 2, j = 4 2,ovpn.example.com,1194,udp 3,ovpn.example.com,443,tcp-client END remote-entry-get all: returns all remote entries. v2: use independent callback functions for the two commands v3: return results as 0 or more lines terminated by END, as done for all other similar commands. v1 was fashioned after pkcs11-id-count and pkcs11-id-get which uses a format not consistent with the rest of the management commands. See also management-notes.txt Signed-off-by: Selva Nair Acked-By: Arne Schwabe --- Changes.rst | 5 +++ doc/management-notes.txt | 60 ++++++++++++++++++++++++++++++++++ src/openvpn/init.c | 44 +++++++++++++++++++++++++ src/openvpn/manage.c | 70 ++++++++++++++++++++++++++++++++++++++++ src/openvpn/manage.h | 4 ++- 5 files changed, 182 insertions(+), 1 deletion(-) diff --git a/Changes.rst b/Changes.rst index 637ed97a..fa5d5ffa 100644 --- a/Changes.rst +++ b/Changes.rst @@ -4,6 +4,11 @@ Overview of changes in 2.6 New features ------------ +New management commands to enumerate and list remote entries + Use ``remote-entry-count`` and ``remote-entry-get`` + commands from the management interface to get the number of + remote entries and the entries themselves. + Keying Material Exporters (RFC 5705) based key generation As part of the cipher negotiation OpenVPN will automatically prefer the RFC5705 based key material generation to the current custom diff --git a/doc/management-notes.txt b/doc/management-notes.txt index 84e3d04b..544caf46 100644 --- a/doc/management-notes.txt +++ b/doc/management-notes.txt @@ -897,6 +897,66 @@ the 10.0.0.0/8 netblock is allowed: 10.10.0.1. Also, the client may not interact with external IP addresses using an "unknown" protocol (i.e. one that is not IPv4 or ARP). +COMMAND -- remote-entry-count (OpenVPN 2.6+ management version > 3) +------------------------------------------------------------------- + +Retrieve available number of remote host/port entries + +Example: + + Management interface client sends: + + remote-entry-count + + OpenVPN daemon responds with + + 5 + END + +COMMAND -- remote-entry-get (OpenVPN 2.6+ management version > 3) +------------------------------------------------------------------ + + remote-entry-get [] + +Retrieve remote entry (host, port and protocol) for index + or indices from to +1. Alternatively + = "all" retrieves all remote entries. + +Example 1: + + Management interface client sends: + + remote-entry-get 1 + + OpenVPN daemon responds with + + 1,vpn.example.com,1194,udp + END + +Example 2: + + Management interface client sends: + + remote-entry-get 1 3 + + OpenVPN daemon responds with + + 1,vpn.example.com,1194,udp + 2,vpn.example.net,443,tcp-client + END + +Example 3: + Management interface client sends: + + remote-entry-get all + + OpenVPN daemon with 3 connection entries responds with + + 1,vpn.example.com,1194,udp + 2,vpn.example.com,443,tcp-client + 3,vpn.example.net,443,udp + END + COMMAND -- remote (OpenVPN AS 2.1.5/OpenVPN 2.3 or higher) -------------------------------------------- diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 386aee23..39dcfcef 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -330,6 +330,48 @@ management_callback_send_cc_message(void *arg, return status; } +static unsigned int +management_callback_remote_entry_count(void *arg) +{ + assert(arg); + struct context *c = (struct context *) arg; + struct connection_list *l = c->options.connection_list; + + return l->len; +} + +static bool +management_callback_remote_entry_get(void *arg, unsigned int index, char **remote) +{ + assert(arg); + assert(remote); + + struct context *c = (struct context *) arg; + struct connection_list *l = c->options.connection_list; + bool ret = true; + + if (index < l->len) + { + struct connection_entry *ce = l->array[index]; + const char *proto = proto2ascii(ce->proto, ce->af, false); + + /* space for output including 2 commas and a nul */ + int len = strlen(ce->remote) + strlen(ce->remote_port) + strlen(proto) + 2 + 1; + char *out = malloc(len); + check_malloc_return(out); + + openvpn_snprintf(out, len, "%s,%s,%s", ce->remote, ce->remote_port, proto); + *remote = out; + } + else + { + ret = false; + msg(M_WARN, "Out of bounds index in management query for remote entry: index = %u", index); + } + + return ret; +} + static bool management_callback_remote_cmd(void *arg, const char **p) { @@ -3944,6 +3986,8 @@ init_management_callback_p2p(struct context *c) #ifdef TARGET_ANDROID cb.network_change = management_callback_network_change; #endif + cb.remote_entry_count = management_callback_remote_entry_count; + cb.remote_entry_get = management_callback_remote_entry_get; management_set_callback(management, &cb); } #endif diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index f86c87f2..f2a51d6c 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -94,6 +94,8 @@ man_help(void) msg(M_CLIENT, "net : (Windows only) Show network info and routing table."); msg(M_CLIENT, "password type p : Enter password p for a queried OpenVPN password."); msg(M_CLIENT, "remote type [host port] : Override remote directive, type=ACCEPT|MOD|SKIP."); + msg(M_CLIENT, "remote-entry-count : Get number of available remote entries."); + msg(M_CLIENT, "remote-entry-get i|all [j]: Get remote entry at index = i to to j-1 or all."); msg(M_CLIENT, "proxy type [host port flags] : Enter dynamic proxy server info."); msg(M_CLIENT, "pid : Show process ID of the current OpenVPN process."); #ifdef ENABLE_PKCS11 @@ -829,6 +831,63 @@ man_pkcs11_id_get(struct management *man, const int index) #endif /* ifdef ENABLE_PKCS11 */ +static void +man_remote_entry_count(struct management *man) +{ + unsigned count = 0; + if (man->persist.callback.remote_entry_count) + { + count = (*man->persist.callback.remote_entry_count)(man->persist.callback.arg); + msg(M_CLIENT, "%u", count); + msg(M_CLIENT, "END"); + } + else + { + msg(M_CLIENT, "ERROR: The remote-entry-count command is not supported by the current daemon mode"); + } +} + +#define min(a,b) ((a) < (b) ? (a) : (b)) + +static void +man_remote_entry_get(struct management *man, const char *p1, const char *p2) +{ + ASSERT(p1); + + if (man->persist.callback.remote_entry_get + && man->persist.callback.remote_entry_count) + { + bool res; + unsigned int from, to; + unsigned int count = (*man->persist.callback.remote_entry_count)(man->persist.callback.arg); + + from = (unsigned int) atoi(p1); + to = p2? (unsigned int) atoi(p2) : from + 1; + + if (!strcmp(p1, "all")) + { + from = 0; + to = count; + } + + for (unsigned int i = from; i < min(to, count); i++) + { + char *remote = NULL; + res = (*man->persist.callback.remote_entry_get)(man->persist.callback.arg, i, &remote); + if (res && remote) + { + msg(M_CLIENT, "%u,%s", i, remote); + } + free(remote); + } + msg(M_CLIENT, "END"); + } + else + { + msg(M_CLIENT, "ERROR: The remote-entry command is not supported by the current daemon mode"); + } +} + static void man_hold(struct management *man, const char *cmd) { @@ -1601,6 +1660,17 @@ man_dispatch_command(struct management *man, struct status_output *so, const cha } } #endif + else if (streq(p[0], "remote-entry-count")) + { + man_remote_entry_count(man); + } + else if (streq(p[0], "remote-entry-get")) + { + if (man_need(man, p, 1, MN_AT_LEAST)) + { + man_remote_entry_get(man, p[1], p[2]); + } + } else if (streq(p[0], "proxy")) { if (man_need(man, p, 1, MN_AT_LEAST)) diff --git a/src/openvpn/manage.h b/src/openvpn/manage.h index 6d6f2fb1..5de0a7da 100644 --- a/src/openvpn/manage.h +++ b/src/openvpn/manage.h @@ -31,7 +31,7 @@ #include "socket.h" #include "mroute.h" -#define MANAGEMENT_VERSION 3 +#define MANAGEMENT_VERSION 4 #define MANAGEMENT_N_PASSWORD_RETRIES 3 #define MANAGEMENT_LOG_HISTORY_INITIAL_SIZE 100 #define MANAGEMENT_ECHO_BUFFER_SIZE 100 @@ -186,6 +186,8 @@ struct management_callback #ifdef TARGET_ANDROID int (*network_change)(void *arg, bool samenetwork); #endif + unsigned int (*remote_entry_count)(void *arg); + bool (*remote_entry_get)(void *arg, unsigned int index, char **remote); }; /* From patchwork Tue Sep 7 12:31:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 1944 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id ysHrBYjoN2GNWAAAIUCqbw (envelope-from ) for ; Tue, 07 Sep 2021 18:32:40 -0400 Received: from proxy8.mail.ord1c.rsapps.net ([172.28.255.1]) by director11.mail.ord1d.rsapps.net with LMTP id sGzZBIjoN2FMUQAAvGGmqA (envelope-from ) for ; Tue, 07 Sep 2021 18:32:40 -0400 Received: from smtp24.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy8.mail.ord1c.rsapps.net with LMTPS id OK5+BIjoN2HAKQAAHz/atg (envelope-from ) for ; Tue, 07 Sep 2021 18:32:40 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp24.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 81c1271c-102b-11ec-aab2-b8ca3a674470-1-1 Received: from [216.105.38.7] ([216.105.38.7:44548] helo=lists.sourceforge.net) by smtp24.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id A4/4E-36340-788E7316; Tue, 07 Sep 2021 18:32:39 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1mNjdD-00016A-Ge; Tue, 07 Sep 2021 22:31:55 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNjdB-000164-CO for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4zDFloCj9rgMgs814sk6iHyK+0scrrPI7574Vsd0boA=; b=U1cDpKjHdHYUsbdSyW7PapqIg/ 0E50nw0kpYfVNbkjtkCdDc82jrvpEkU38H9t3JyYCIl2c/Q0Uw2mKvucdm2nzbXShFQBc4VHJpy/r Gkgo26e4K5Q8zaQV/mlHZD3sTKizjx34ouSPtQO5lzK9yPeDk4GY0yd+QnwQCO7214rA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4zDFloCj9rgMgs814sk6iHyK+0scrrPI7574Vsd0boA=; b=jo/haBpNHeHWPwcx4U76avCvQ7 bvNUNKQXsv7MnCc5iorIcJvP7lpJtP/h5ZmZifuhPosUAkEcTRWfpXbg5vhkhf/RhUq+I/jC26H9H mRHVUBXUBz/8rFt0nphMsm6XB64dXGqvuZxI+L31/9FljwbyHV5+j4UaeHhBCQxGwhY0=; Received: from mail-il1-f173.google.com ([209.85.166.173]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1mNjd9-0005kt-Uf for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:53 +0000 Received: by mail-il1-f173.google.com with SMTP id j15so272828ila.1 for ; Tue, 07 Sep 2021 15:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4zDFloCj9rgMgs814sk6iHyK+0scrrPI7574Vsd0boA=; b=O8d5S0lNL5voSn5TNjOaLO0AYq9QsTUZqYuzTX447uXip9WVL8WHT+c9vjDLXYqlFU clPw9/xfgYi7q8PmumDnCmROyVY695pBKEpTl8Yk/zfq4ars1ehnm/5jZ9A0ReOKYjEt MraF1/6wiMQ8EA0i6JGSf+tWheOxOWWrATOl5LikVCiclPIn6ofmTtSTMgJ06dHaF71I eBwdgyiyB9IePaYkO9ejVx5FpjXjYe+DWtbxemPIeWBRhyGY4EFBEzv/r6X2DZIXGtfV JLhwiZD98V6jk3zMzLc6/ZrH5FNTXg2ItGull+U/dBj5fQwXsyKf3ceHWvFOteDePpug H2+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4zDFloCj9rgMgs814sk6iHyK+0scrrPI7574Vsd0boA=; b=iiiGXV4tbUGCd+itsK1WWfPdgr5G1TXWBPms0yjeoVad//BcALYOpirGHQZoLa0e1I 2PN03s+q0zyccxo+ivMoQyjRlqJiZW5mgbwJPMqlW2daFI9wxp6DKWiZKJNKLX47z+Qf EeVedQcXARGsuZFw6YwkFXy9QsnHjnh0xUTH2EJEM39qXRrGNFQ1lIKbYHAaTgdG0KUf vvG4kKNjr7THPwBV68l5G1mPoZOJ/JJqMr+8Ci2Rv5SSEC95K83Jcm0wKTT+Gh2hvyxS MSF6JoBfzZXEeSJidAxTm+yWVcq+ijCRBOQeuwzMXKQ2utyYt++637QBNjvVjB/MzOai 767g== X-Gm-Message-State: AOAM533FKgnOfnetLa0Y0cwwHKkJvhQk2PnlKn41ndHdAesElAD2ad6b Tp8JGAyofdLdP6+NktRDmtxKdULIQio= X-Google-Smtp-Source: ABdhPJzAGcukdpxJtSRBMyQPsWD35Lrw5UkvFny1m2RAll+qfS3rZA8N/stH+BPM11tmyzSXpuhYaA== X-Received: by 2002:a05:6e02:198d:: with SMTP id g13mr378215ilf.319.1631053906230; Tue, 07 Sep 2021 15:31:46 -0700 (PDT) Received: from uranus.home.sansel.ca (bras-vprn-tnhlon4053w-lp130-02-70-51-223-174.dsl.bell.ca. [70.51.223.174]) by smtp.gmail.com with ESMTPSA id b10sm224405ils.13.2021.09.07.15.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 15:31:45 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Sep 2021 18:31:25 -0400 Message-Id: <20210907223126.8440-2-selva.nair@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210907223126.8440-1-selva.nair@gmail.com> References: <20210825210232.22509-1-selva.nair@gmail.com> <20210907223126.8440-1-selva.nair@gmail.com> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.173 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.173 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -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 X-Headers-End: 1mNjd9-0005kt-Uf Subject: [Openvpn-devel] [PATCH v3 2/3] Permit unlimited connection entries and remotes 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair Currently we allow a max of 64 connection entries and remotes. A larger number would allow users with 100's of independent config files for different end points of same provider to consolidate them to connection entries. v2,v3: no change Signed-off-by: Selva Nair Acked-By: Arne Schwabe@rfc2549.org --- Changes.rst | 2 ++ src/openvpn/options.c | 34 ++++++++++++++++++++++++++++------ src/openvpn/options.h | 6 ++++-- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/Changes.rst b/Changes.rst index fa5d5ffa..9b1fb294 100644 --- a/Changes.rst +++ b/Changes.rst @@ -4,6 +4,8 @@ Overview of changes in 2.6 New features ------------ +Support unlimited number of connection entries and remote entries + New management commands to enumerate and list remote entries Use ``remote-entry-count`` and ``remote-entry-get`` commands from the management interface to get the number of diff --git a/src/openvpn/options.c b/src/openvpn/options.c index f00b3019..38f97a39 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -888,6 +888,14 @@ init_options(struct options *o, const bool init_gc) void uninit_options(struct options *o) { + if (o->connection_list) { + free(o->connection_list->array); + CLEAR(*o->connection_list); + } + if (o->remote_list) { + free(o->remote_list->array); + CLEAR(*o->remote_list); + } if (o->gc_owned) { gc_free(&o->gc); @@ -1946,10 +1954,17 @@ alloc_connection_entry(struct options *options, const int msglevel) struct connection_list *l = alloc_connection_list_if_undef(options); struct connection_entry *e; - if (l->len >= CONNECTION_LIST_SIZE) + if (l->len == l->capacity) { - msg(msglevel, "Maximum number of 'connection' options (%d) exceeded", CONNECTION_LIST_SIZE); - return NULL; + int capacity = l->capacity + CONNECTION_LIST_SIZE; + struct connection_entry **ce = realloc(l->array, capacity*sizeof(struct connection_entry *)); + if (ce == NULL) + { + msg(msglevel, "Unable to process more connection options: out of memory. Number of entries = %d", l->len); + return NULL; + } + l->array = ce; + l->capacity = capacity; } ALLOC_OBJ_GC(e, struct connection_entry, &options->gc); l->array[l->len++] = e; @@ -1972,10 +1987,17 @@ alloc_remote_entry(struct options *options, const int msglevel) struct remote_list *l = alloc_remote_list_if_undef(options); struct remote_entry *e; - if (l->len >= CONNECTION_LIST_SIZE) + if (l->len == l->capacity) { - msg(msglevel, "Maximum number of 'remote' options (%d) exceeded", CONNECTION_LIST_SIZE); - return NULL; + int capacity = l->capacity + CONNECTION_LIST_SIZE; + struct remote_entry **re = realloc(l->array, capacity*sizeof(struct remote_entry *)); + if (re == NULL) + { + msg(msglevel, "Unable to process more remote options: out of memory. Number of entries = %d", l->len); + return NULL; + } + l->array = re; + l->capacity = capacity; } ALLOC_OBJ_GC(e, struct remote_entry, &options->gc); l->array[l->len++] = e; diff --git a/src/openvpn/options.h b/src/openvpn/options.h index b0e40cb7..98977d41 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -168,15 +168,17 @@ struct remote_entry struct connection_list { + int capacity; int len; int current; - struct connection_entry *array[CONNECTION_LIST_SIZE]; + struct connection_entry **array; }; struct remote_list { + int capacity; int len; - struct remote_entry *array[CONNECTION_LIST_SIZE]; + struct remote_entry **array; }; enum vlan_acceptable_frames From patchwork Tue Sep 7 12:31:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 1943 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net with LMTP id aGPfDoToN2E7WAAAIUCqbw (envelope-from ) for ; Tue, 07 Sep 2021 18:32:36 -0400 Received: from proxy1.mail.ord1c.rsapps.net ([172.28.255.1]) by director13.mail.ord1d.rsapps.net with LMTP id MPilDoToN2EUHgAA91zNiA (envelope-from ) for ; Tue, 07 Sep 2021 18:32:36 -0400 Received: from smtp12.gate.ord1c ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy1.mail.ord1c.rsapps.net with LMTPS id mOt4MIPoN2GmNgAA2VeTtA (envelope-from ) for ; Tue, 07 Sep 2021 18:32:35 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp12.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 7fc490d4-102b-11ec-aff9-bc305bf03e5c-1-1 Received: from [216.105.38.7] ([216.105.38.7:43854] helo=lists.sourceforge.net) by smtp12.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9F/4E-16805-388E7316; Tue, 07 Sep 2021 18:32:36 -0400 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.90_1) (envelope-from ) id 1mNjdD-0000GQ-Fn; Tue, 07 Sep 2021 22:31:55 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNjdC-0000GD-E9 for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=YJVuGx/hTTat9f47Cb/JArgyijM7muN3SFXTLYJRwGY=; b=cIRClS0KfwBo80aFGPFJoohBrC SMwrXbM2yvo/3vF68Hm9IhHoLZh+Y6iYKbYqaI3vmkw3yz84Q4DyodfcR++X7ARYr+Hp9eNRaFik6 tcEyUKddkMZZcWkKxCdwmYgHHffgHvh5myKi4u4XayaJhNpQzIPh4MTPZCHLH9LECcIw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YJVuGx/hTTat9f47Cb/JArgyijM7muN3SFXTLYJRwGY=; b=IXqbhnqlvQbLlcCR1SBse9V6Nw fhV+iVKAGm6gV/gXE55xA6uGN/95XykxhOWIH2fSNy8JkBjePclDexEsdvhZ5Zes85dEeQI2A7bZY FrTe9OD+lE3rbA1WBRXMqaOh3tS5Qs1RW++Xli8TjCR/Lf1+bbjh2FbRUYYWPkkt4/1U=; Received: from mail-il1-f169.google.com ([209.85.166.169]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1mNjdB-001aUK-QL for openvpn-devel@lists.sourceforge.net; Tue, 07 Sep 2021 22:31:54 +0000 Received: by mail-il1-f169.google.com with SMTP id a1so252826ilj.6 for ; Tue, 07 Sep 2021 15:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YJVuGx/hTTat9f47Cb/JArgyijM7muN3SFXTLYJRwGY=; b=GjpVaeNOr6G/KEhPJGTTggDf7FHA11W93Ghy+rcFsZY+EojE6DWhWLkYRYYn5191F8 uVzKnYsajbZ8LVsuP3/mJlG/fQ3o9NEaJj2mbLkq8Bvgx5OPnNo8R06oS/JA9bv91Ar9 p/rmUFZStGDERETtZupOcQwZh9xqEepjfdH8iNsFbLibkIZXTqIrGp5K59072mLq3Q9f JvbdIl+pmcs+doegWXO8/H8KL8KURqf3ndJrqVXKcdX9pZZYMBKXio+whW94/8uPhMHt t7CWAXgqLK/2QWBI9fbo1EzZ2tpCViWxo9SdFH+EAisvi+lV5v39OhkyQCDRcQGE/bgU zIzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YJVuGx/hTTat9f47Cb/JArgyijM7muN3SFXTLYJRwGY=; b=qWf2oT0xBCRbRFOwLWM5GpBt2Ecdbn5uT1eEfKH5zW+AxUgvflaZbp2CiSjWakoDrM qE/Ndbg+9TYuwUM75cj65kx69gOb7k3xXzT+c+wojDsOfVnXmlkD7piJ1jsJ/zbTMQ9z Kx/xKS6XpgtRzioE+KMnOelrSbFsV/C2lDGEz4FjI6grVZD7cY97idDZWFI5vUSZaZug 6e+KaJF3HVjlkhlel5XEIqzsjrK5iwTv4YRPO3naCQ9V/iqV7A7UyuQ2dVlXcAFWmjv5 mCFAUq0QA6Vibxmjv/k66jEpHXezS0f8q4/IbJM5gYrJmiEwHQR9wRbLrqlXSUBweRbA 11jw== X-Gm-Message-State: AOAM531a/0N/iY5lB6DS9U/btSUQztJAQl+z19uCVMxVG6f4k0KavOSg ZYSJND13HFFe9WBVSvmVFtfS1pN4JKQ= X-Google-Smtp-Source: ABdhPJw/Ta9swJdWDzUPhIVRluKzuovp1x40BYii2VnvQoSWBwU3F8mvsmrmAcv5PcFu/goE46Z/gA== X-Received: by 2002:a92:c80d:: with SMTP id v13mr424307iln.198.1631053908032; Tue, 07 Sep 2021 15:31:48 -0700 (PDT) Received: from uranus.home.sansel.ca (bras-vprn-tnhlon4053w-lp130-02-70-51-223-174.dsl.bell.ca. [70.51.223.174]) by smtp.gmail.com with ESMTPSA id b10sm224405ils.13.2021.09.07.15.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 15:31:47 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Tue, 7 Sep 2021 18:31:26 -0400 Message-Id: <20210907223126.8440-3-selva.nair@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210907223126.8440-1-selva.nair@gmail.com> References: <20210825210232.22509-1-selva.nair@gmail.com> <20210907223126.8440-1-selva.nair@gmail.com> MIME-Version: 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: From: Selva Nair The message "ERROR: The 'foo' commmand is not supported by current daemon mode" is repeatedly used in manage.c. Move it to a function for uniformity in messaging. v3, v3: no change Signed-off-by: Selva Nair --- src/openvpn/manage.c | 34 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 14 deletions(-) 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 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.169 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.169 listed in list.dnswl.org] -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_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1mNjdB-001aUK-QL Subject: [Openvpn-devel] [PATCH v3 3/3] Use a template for "unsupported management commands" error 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair The message "ERROR: The 'foo' commmand is not supported by current daemon mode" is repeatedly used in manage.c. Move it to a function for uniformity in messaging. v3, v3: no change Signed-off-by: Selva Nair Acked-By: Arne Schwabe --- src/openvpn/manage.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index f2a51d6c..b75014c2 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -447,6 +447,12 @@ man_signal(struct management *man, const char *name) } } +static void +man_command_unsupported(const char *command_name) +{ + msg(M_CLIENT, "ERROR: The '%s' command is not supported by the current daemon mode", command_name); +} + static void man_status(struct management *man, const int version, struct status_output *so) { @@ -456,7 +462,7 @@ man_status(struct management *man, const int version, struct status_output *so) } else { - msg(M_CLIENT, "ERROR: The 'status' command is not supported by the current daemon mode"); + man_command_unsupported("status"); } } @@ -572,7 +578,7 @@ man_kill(struct management *man, const char *victim) } else { - msg(M_CLIENT, "ERROR: The 'kill' command is not supported by the current daemon mode"); + man_command_unsupported("kill"); } gc_free(&gc); @@ -777,7 +783,7 @@ man_net(struct management *man) } else { - msg(M_CLIENT, "ERROR: The 'net' command is not supported by the current daemon mode"); + man_command_unsupported("net"); } } @@ -799,7 +805,7 @@ man_send_cc_message(struct management *man, const char *message, const char *par } else { - msg(M_CLIENT, "ERROR: This command is not supported by the current daemon mode"); + man_command_unsupported("cr-repsonse"); } } #ifdef ENABLE_PKCS11 @@ -843,7 +849,7 @@ man_remote_entry_count(struct management *man) } else { - msg(M_CLIENT, "ERROR: The remote-entry-count command is not supported by the current daemon mode"); + man_command_unsupported("remote-entry-count"); } } @@ -884,7 +890,7 @@ man_remote_entry_get(struct management *man, const char *p1, const char *p2) } else { - msg(M_CLIENT, "ERROR: The remote-entry command is not supported by the current daemon mode"); + man_command_unsupported("remote-entry-get"); } } @@ -973,7 +979,7 @@ in_extra_dispatch(struct management *man) } else { - msg(M_CLIENT, "ERROR: The client-auth command is not supported by the current daemon mode"); + man_command_unsupported("client-auth"); } break; @@ -997,7 +1003,7 @@ in_extra_dispatch(struct management *man) } else { - msg(M_CLIENT, "ERROR: The client-pf command is not supported by the current daemon mode"); + man_command_unsupported("client-pf"); } break; @@ -1082,7 +1088,7 @@ man_client_pending_auth(struct management *man, const char *cid_str, } else { - msg(M_CLIENT, "ERROR: The client-pending-auth command is not supported by the current daemon mode"); + man_command_unsupported("client-pending-auth"); } } } @@ -1133,7 +1139,7 @@ man_client_deny(struct management *man, const char *cid_str, const char *kid_str } else { - msg(M_CLIENT, "ERROR: The client-deny command is not supported by the current daemon mode"); + man_command_unsupported("client-deny"); } } } @@ -1158,7 +1164,7 @@ man_client_kill(struct management *man, const char *cid_str, const char *kill_ms } else { - msg(M_CLIENT, "ERROR: The client-kill command is not supported by the current daemon mode"); + man_command_unsupported("client-kill"); } } } @@ -1173,7 +1179,7 @@ man_client_n_clients(struct management *man) } else { - msg(M_CLIENT, "ERROR: The nclients command is not supported by the current daemon mode"); + man_command_unsupported("nclients"); } } @@ -1297,7 +1303,7 @@ man_proxy(struct management *man, const char **p) } else { - msg(M_CLIENT, "ERROR: The proxy command is not supported by the current daemon mode"); + man_command_unsupported("proxy"); } } @@ -1318,7 +1324,7 @@ man_remote(struct management *man, const char **p) } else { - msg(M_CLIENT, "ERROR: The remote command is not supported by the current daemon mode"); + man_command_unsupported("remote"); } }