Hi Daniel,

On Mon, Dec 13, 2010 at 03:07:57PM +0100, Daniel Wagner wrote:
> From: Daniel Wagner <[email protected]>
> 
> ---
>  plugins/openvpn.c |   82 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 82 insertions(+), 0 deletions(-)
> 
> diff --git a/plugins/openvpn.c b/plugins/openvpn.c
> index 0a71f5d..9f8989d 100644
> --- a/plugins/openvpn.c
> +++ b/plugins/openvpn.c
> @@ -42,12 +42,74 @@
>  
>  static DBusConnection *connection;
>  
> +struct ov_route {
> +     char *host;
> +     char *netmask;
> +     char *gateway;
> +};
Ok, so you're keeping a routing hash table within openvpn.c in order to
protect your code against the route_* openvpn environment variables being sent
unordered.
Although I think this is very unlikely, I still belive that it makes sense.
I would appreciate if you could just comment on that here, so that we could
still easily maintain this code once you become BMW new CTO ;)

> @@ -115,6 +181,18 @@ static int ov_notify(DBusMessage *msg, struct 
> connman_provider *provider)
>                       g_strfreev(options);
>               }
>  
> +             route = ov_route_lookup(key, "route_network_", routes);
> +             if (route != NULL)
> +                     route->host = g_strdup(value);
So here I'd like to keep the whole internal parsing and prefix stuff into the
actual lookup routine. It would be renamed ov_append_route(key, routes), and
would check if key has a valid prefix, and if so do its magic.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to