Skip to contentSkip to conversation

plugin: Fix documentation typo for type_mask

PATCH In review David Sommerseth 3 participants 5 messages May 8, 2017 – May 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 plugin: Fix documentation typo for type_mask

The v3 plug-in API was slightly misleading, as that interface does not need to use an int pointer to setting the type_mask from the plug-in.

---
 include/openvpn-plugin.h.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/openvpn-plugin.h.in +2 -2
index ec83f3a6..5e6f8743 100644
@@ -347,12 +347,12 @@ struct openvpn_plugin_args_open_in
  *
  * STRUCT MEMBERS
  *
- * *type_mask : The plug-in should set this value to the logical OR of all script
+ * type_mask  : The plug-in should set this value to the logical OR of all script
  *              types which the plug-in wants to intercept.  For example, if the
  *              script wants to intercept the client-connect and client-disconnect
  *              script types:
  *
- *              *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT)
+ *              type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT)
  *                         | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT)
  *
  * *handle :    Pointer to a global plug-in context, created by the plug-in.  This pointer
Signature · 1 line
2.11.0
#1 lore raw

Hi,

Quoted 14 lines · David Sommerseth

*
* STRUCT MEMBERS
*
- * *type_mask : The plug-in should set this value to the logical OR of all script
+ * type_mask : The plug-in should set this value to the logical OR of all script
* types which the plug-in wants to intercept. For example,
if the
* script wants to intercept the client-connect and
client-disconnect
* script types:
*
- * *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PL

Quoted 9 lines

UGIN_CLIENT_CONNECT)
+ * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PL
UGIN_CLIENT_CONNECT)
* | OPENVPN_PLUGIN_MASK(OPENVPN_PL
UGIN_CLIENT_DISCONNECT)
*
* *handle : Pointer to a global plug-in context, created by the
plug-in. This pointer

Asking to set *handle to context_ptr is wrong too. One can't dereference handle. So it will have to be interpreted as set handle to pointer to pointer to the context but that is wrong.

But as discussed in the other thread I think we should also change the definition of handle in this struct.

Reference to *handle in line 390 needs correction too (comment only -- struct is fine).

Thanks,

Selva

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Quoted 23 lines · Selva Nair

Hi,

On Mon, May 8, 2017 at 10:19 AM, David Sommerseth <[email protected]... <mailto:[email protected]...>> wrote:

* * STRUCT MEMBERS * - * *type_mask : The plug-in should set this value to the logical OR of all script + * type_mask : The plug-in should set this value to the logical OR of all script * types which the plug-in wants to intercept. For example, if the * script wants to intercept the client-connect and client-disconnect
* script types: * - * *type_mask =
OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) + * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_CONNECT) * | OPENVPN_PLUGIN_MASK(OPENVPN_PLUGIN_CLIENT_DISCONNECT) * * *handle
: Pointer to a global plug-in context, created by the plug-in.
This pointer

Asking to set *handle to context_ptr is wrong too. One can't dereference handle. So it will have to be interpreted as set handle to pointer to pointer to the context but that is wrong.

Quoted 5 lines

But as discussed in the other thread I think we should also change the definition of handle in this struct.

Reference to *handle in line 390 needs correction too (comment only -- struct is fine).

Yes, I saw that, but thought we should fix that when we know what is
the right solution for the *handle vs handle. Just to keep things
separate.

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJZEIdjAAoJEIbPlEyWcf3yGkQP/AispEyYNNsMKo9X9ZH082Xi ZMoExmzPJ3cYiDRGZ0Clo8FYOF/Z6xAng3LOuMPIGbFUt/ZGPuEGqJ33Ot5U1qL3 pfjUJdpCb/jLTx4FvTRcpKRPZht9I5EAk4DHXDwhkEph2twKcjCLV3pciKExFEw6 J8jEpH+0qRAODdW2ilsaDsn56omeEQXQzzIS35Pg+mXTG7XaMHGIpFN7Cw6Paq5z VDW2ScPXbg9O0+vOKi6RDgAy9iiSXoLO291xrld7tA9XWty6FuPvakqemPaW79NI 17QYVqVY+gix4SPkdc1B/Morv4U3Ueif8pVjNV88skBywoPCTTZs6rL0Z2z0b3M4 zjULfVH+tAHnU0S2CM1CdS/EsO7DQ034FmdYhKhUh3DcXm62m0IPKOoMooLZ+3SF BcKef2cm/v6UFDOlJxmb9b6m2E1Z/msYKFcSjls3sDZCxLbJ2WtDT8rgLX5UMDeh M/elhBn02x9skfM3Z+Q7kGbq8F865937uweaGlAIb4m96OL2AKAAm1FZQREued3k DYJ/zh4I/i7WSU/RnyZA7d9Zxt+Ii5tU4hAtCPccqehoSNMbU0K4ZC/2wwpqNRGk jQ1baWfVzme9swXlZMHIP6htefoL+OWF4Ax41qM32kCDgGNhpT5k0yTA33tYjZh0 KNzigRuu+taxBXeAhKtq
=900I
-----END PGP SIGNATURE-----

#3 lore raw

Hi,

Quoted 4 lines · David Sommerseth
Quoted 2 lines · Selva Nair

Hi,

On Mon, May 8, 2017 at 10:19 AM, David Sommerseth <[email protected]...>

Quoted 35 lines
Quoted 35 lines

wrote:
*
* STRUCT MEMBERS
*
- * *type_mask : The plug-in should set this value to the logical OR of all script
+ * type_mask : The plug-in should set this value to the logical OR of all script
* types which the plug-in wants to intercept. For
example, if the
* script wants to intercept the client-connect and
client-disconnect
* script types:
*
- * *type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PL
UGIN_CLIENT_CONNECT)
+ * type_mask = OPENVPN_PLUGIN_MASK(OPENVPN_PL
UGIN_CLIENT_CONNECT)
* | OPENVPN_PLUGIN_MASK(OPENVPN_PL
UGIN_CLIENT_DISCONNECT)
*
* *handle : Pointer to a global plug-in context, created by the
plug-in. This pointer

Asking to set *handle to context_ptr is wrong too. One can't dereference handle. So it will have to be interpreted as set handle to pointer to pointer to the context but that is wrong.

But as discussed in the other thread I think we should also change the definition of handle in this struct.

Quoted 6 lines
Quoted 2 lines

Reference to *handle in line 390 needs correction too (comment only -- struct is fine).

Yes, I saw that, but thought we should fix that when we know what is
the right solution for the *handle vs handle. Just to keep things
separate.

OK, that makes sense. Then this is good to go.

ACK.

Selva

#4 lore raw
In reply to David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Your patch has been applied to the following branches

commit 26e3427cfa128c5d8ac7e212769ba29afac4f3d9 (master) commit e9bb49ba2ff372fad9ca1d1ab9fbdf9761cf2a40 (release/2.4)

Author: David Sommerseth
Date:   Mon May 8 16:19:39 2017 +0200
     plugin: Fix documentation typo for type_mask

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Selva Nair <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg14576.html
     Signed-off-by: David Sommerseth <[email protected]...>

- --
kind regards,

David Sommerseth

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJZEZ50AAoJEIbPlEyWcf3yYp0P/2g1fBrg1P2SNOYkZeSGespB XS5EXrrl+lncJ5HbCHV+DcPZLt5iM0WzkebBo+Re4u656AYe9fNypQUgLY9DEIoR K71n0cadKr69PpJDT+Nw8qSv49VwXhLjdv10Ci39B8h/+ZNvJru/0sMsipbPACk/ UZxVXezp3ALoIg3L8HH2WJz1iV5YGM0GTEO8M3RInoWSkRJ0tjhPfr0Rb9P8iaRi 4cgIIa/j+qPofH1KNrTzYo8+9LyTwAMoASC/BDQQiOQWG05+eahnBvXSqzpkUEZm +wOv9DuyLaUw2fTmrknf+1g4nJEWNgR7HPh3JAK+0N+voF2i5W+TuTIX0jPjCD97 qJCOGG60Jz73EwqBmiNo4czhX64vqmJCRmeWE0qFtadCSpM4yRen7yp0McXo7RXX IxqHY0ZXKyTErFrfzTVdGSkkBcjqYjpchAxiPXiOTw0iZM82qyGhuxqH95l/sJGd QSaBl0kpmCNpJ8onlLysR5Iyz8KZh3p4GNnHh0ViGJLny79IfqbYm0ohk2Br32nd TcvaRofPck9OKDJeIijomb7jU5ngZusKXsTPnUUD11vvwz/Y0hALD1Aft8vqzV+x I3uVdl95+ratzZ5FDveX2uJPsQhXrJN7yfc+0TcyeBQKutOPIpXV397IoPN2nghK rzPSEo4J9EtxVSLuk3hI
=eSJl
-----END PGP SIGNATURE-----