Hi Jukka,
On Thu, Nov 17, 2011 at 04:25:36PM +0200, Jukka Rissanen wrote:
> diff --git a/src/resolver.c b/src/resolver.c
> index 68fa4f7..1d5c61e 100644
> --- a/src/resolver.c
> +++ b/src/resolver.c
> @@ -54,6 +54,22 @@ struct resolvfile_entry {
> };
>
> static GList *resolvfile_list = NULL;
> +static GHashTable *notifier_hash = NULL;
> +
> +/*
> + * Notifier notifies the caller about all nameservers
> + * that have a lifetime and were append via netlink
> + */
> +struct notifier_data {
> + gchar *interface;
> + gpointer user_data;
> + void (*nameserver_added) (const char *interface,
> + gpointer user_data,
> + const char *nameserver);
> + void (*nameserver_removed) (const char *interface,
> + gpointer user_data,
> + const char *nameserver);
> +};
So I wonder if having resolver.c calling directly into service.c would be
simpler. I may be missing some corner cases, but here is what I think:
- From the below resolver.c routines, you could get a service pointer through
__connman_service_lookup_from_index(). You could even check that the service
you get is in a READY/ONLINE state with __connman_service_ipconfig_get_state()
if needed (In the append case, we can safely assume that we are in an online
state since we are getting autoconfig nameservers entries).
- Then you could call _connman_service_nameserver_append() on the service
pointer. I don't see why we should treat those nameserver entries differently
from the ones we get e.g. from dhcp (v4 or v6).
Would that make sense to you ?
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman