Re: [PATCH 09/45] vpn: Add VPN agent use callback for plugins

Denis Kenzior <[email protected]> Fri, 1 Aug 2025 14:39:16 -0500
Newsgroups dev.linux.lists.connman
Message-ID <[email protected]>
Hi Jussi,

On 7/11/25 9:27 AM, Jussi Laakkonen wrote:
> Add callback that can be used by the VPN plugins to tell the vpn_driver
> whether it uses VPN agent or not. Default to using VPN agent if the
> function is not defined.
> 
> This is done to accommodate the state transition in vpn-provider when
> the VPN does not utilize VPN agent.

What about the case where previous credentials are cached?

> ---
>   vpn/plugins/vpn.c  | 22 ++++++++++++++++++++++
>   vpn/plugins/vpn.h  |  1 +
>   vpn/vpn-provider.h |  1 +
>   3 files changed, 24 insertions(+)
> 

<snip>

> diff --git a/vpn/plugins/vpn.h b/vpn/plugins/vpn.h
> index a8d24fc3..b24cbf9b 100644
> --- a/vpn/plugins/vpn.h
> +++ b/vpn/plugins/vpn.h
> @@ -57,6 +57,7 @@ struct vpn_driver {
>   	int (*route_env_parse) (struct vpn_provider *provider, const char *key,
>   			int *family, unsigned long *idx,
>   			enum vpn_provider_route_type *type);
> +	bool (*uses_vpn_agent) (struct vpn_provider *provider);

The only user of this would seem to be wireguard which blankly returns false. 
Can this be made into a boolean of a set of flags instead?

>   };
>   
>   int vpn_register(const char *name, const struct vpn_driver *driver,

Regards,
-Denis