From patchwork Thu Apr 1 02:13:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1685 X-Patchwork-Delegate: a@unstable.cc Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id kFLnHDvHZWBeFAAAIUCqbw (envelope-from ) for ; Thu, 01 Apr 2021 09:14:35 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id mGeJHDvHZWA8CgAAfY0hYg (envelope-from ) for ; Thu, 01 Apr 2021 09:14:35 -0400 Received: from smtp20.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTPS id mFhNHDvHZWDiGQAAAY1PeQ (envelope-from ) for ; Thu, 01 Apr 2021 09:14: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: smtp20.gate.ord1d.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; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 33a00eca-92ec-11eb-8022-525400b8bfda-1-1 Received: from [216.105.38.7] ([216.105.38.7:53430] helo=lists.sourceforge.net) by smtp20.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 4F/AE-13943-A37C5606; Thu, 01 Apr 2021 09:14: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 1lRx8v-0007EV-1V; Thu, 01 Apr 2021 13:13:49 +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 1lRx8t-0007EO-Ml for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 13:13:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=LEg34XuGlLWjkPopzl+0+q31ZRS+VRnLIo0BJ2UcbaU=; b=nIo959T2Zocvd3WyvVuh6hhhtb tc9jXQLvSAh4/nZQlhN0e62HnlWCTDSEFg9Y3T8MC4K+PUyGIDCBa5MGPjqi9OZBq+aKokIS3gv1F Yoyp6g3eusB+TLdk+P4+RZSi654Iw0Hzu7AFnsqIJ+1mM4XuW3N8Jl+ABzmgjFHjbSvY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding: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=LEg34XuGlLWjkPopzl+0+q31ZRS+VRnLIo0BJ2UcbaU=; b=ElGfVCjUC/V7Ezl3GlpJbrm8O7 tgecCpt9pA6W8YZOE7BHU+geenXsIQEhfjvPxrTYegY00YM/Cjrf33XnZAWPAdgU4fQlxjIIdhWnS 0/QnGO71fA/BAyTIip8FKroKlqBJ0syQGIpJTbg4wfdDgSreDnsbc0lZ57IIUihY2+Iw=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lRx8q-0003Uj-DJ for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 13:13:47 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1lRx8k-000J83-0K for openvpn-devel@lists.sourceforge.net; Thu, 01 Apr 2021 15:13:38 +0200 Received: (nullmailer pid 3741 invoked by uid 10006); Thu, 01 Apr 2021 13:13:37 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Thu, 1 Apr 2021 15:13:27 +0200 Message-Id: <20210401131337.3684-5-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210401131337.3684-1-arne@rfc2549.org> References: <20210401131337.3684-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] X-Headers-End: 1lRx8q-0003Uj-DJ Subject: [Openvpn-devel] [PATCH 04/14] Add documentation on EVENT_READ/EVENT_WRITE constants 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Signed-off-by: Arne Schwabe --- src/openvpn/forward.c | 3 ++- src/openvpn/openvpn.h | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c index 6f7a50048..98caf6651 100644 --- a/src/openvpn/forward.c +++ b/src/openvpn/forward.c @@ -1880,7 +1880,8 @@ io_wait_dowork(struct context *c, const unsigned int flags) unsigned int tuntap = 0; struct event_set_return esr[4]; - /* These shifts all depend on EVENT_READ and EVENT_WRITE */ + /* These shifts all depend on EVENT_READ (=1) and EVENT_WRITE (=2) */ + /* and are added to the shift. */ static int socket_shift = 0; /* depends on SOCKET_READ and SOCKET_WRITE */ static int tun_shift = 2; /* depends on TUN_READ and TUN_WRITE */ static int err_shift = 4; /* depends on ES_ERROR */ diff --git a/src/openvpn/openvpn.h b/src/openvpn/openvpn.h index 0ddaeb730..322ab3ee1 100644 --- a/src/openvpn/openvpn.h +++ b/src/openvpn/openvpn.h @@ -245,7 +245,17 @@ struct context_2 int event_set_max; bool event_set_owned; - /* event flags returned by io_wait */ + /* event flags returned by io_wait, + * All these event are their respective shift as defined in io_wait_dowork + * adding a shift of 0 for the READ event and 1 for the write event. + * + * E.g. management_shift = 6; + * MANAGMENT_READ = (1<<(6+0)), + * MANAGEMNET_WRITE = (1<<(6+1)) + * + * Some shifts (error, file_close) are using read/write for diferent + * signals. + */ #define SOCKET_READ (1<<0) #define SOCKET_WRITE (1<<1) #define TUN_READ (1<<2)