diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-12-18 21:28:54 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-12-18 21:28:54 -0800 |
commit | edf83518677fce7cc169d84bb6e5bcd1f81994b9 (patch) | |
tree | a7a3219e7c5de1aabe94e3b66ba58c9eaa18c647 /src/resolver.c | |
parent | 2c2eb881de75f722f4d3fba6da3c063f4e57fa0e (diff) | |
download | connman-edf83518677fce7cc169d84bb6e5bcd1f81994b9.tar.gz connman-edf83518677fce7cc169d84bb6e5bcd1f81994b9.tar.bz2 connman-edf83518677fce7cc169d84bb6e5bcd1f81994b9.zip |
Store flag for public DNS servers
Diffstat (limited to 'src/resolver.c')
-rw-r--r-- | src/resolver.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/resolver.c b/src/resolver.c index 5fc01a6b..fa6880c8 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -32,11 +32,14 @@ #include "connman.h" +#define RESOLVER_FLAG_PUBLIC (1 << 0) + struct entry_data { struct connman_resolver *resolver; char *interface; char *domain; char *server; + unsigned int flags; }; static GSList *entry_list = NULL; @@ -133,21 +136,14 @@ void connman_resolver_unregister(struct connman_resolver *resolver) remove_entries(matches); } -/** - * connman_resolver_append: - * @interface: network interface - * @domain: domain limitation - * @server: server address - * - * Append resolver server address to current list - */ -int connman_resolver_append(const char *interface, const char *domain, - const char *server) +static int append_resolver(const char *interface, const char *domain, + const char *server, unsigned int flags) { struct entry_data *entry; GSList *list; - DBG("interface %s domain %s server %s", interface, domain, server); + DBG("interface %s domain %s server %s flags %d", + interface, domain, server, flags); if (server == NULL) return -EINVAL; @@ -159,6 +155,7 @@ int connman_resolver_append(const char *interface, const char *domain, entry->interface = g_strdup(interface); entry->domain = g_strdup(domain); entry->server = g_strdup(server); + entry->flags = flags; entry_list = g_slist_append(entry_list, entry); @@ -178,6 +175,22 @@ int connman_resolver_append(const char *interface, const char *domain, } /** + * connman_resolver_append: + * @interface: network interface + * @domain: domain limitation + * @server: server address + * + * Append resolver server address to current list + */ +int connman_resolver_append(const char *interface, const char *domain, + const char *server) +{ + DBG("interface %s domain %s server %s", interface, domain, server); + + return append_resolver(interface, domain, server, 0); +} + +/** * connman_resolver_remove: * @interface: network interface * @domain: domain limitation @@ -261,7 +274,7 @@ int connman_resolver_append_public_server(const char *server) { DBG("server %s", server); - return connman_resolver_append(NULL, NULL, server); + return append_resolver(NULL, NULL, server, RESOLVER_FLAG_PUBLIC); } /** |