From 4da1368dd7a8eaeec85111b3248c4e198e5d3187 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 22 Feb 2013 13:47:51 +0200 Subject: [PATCH] service: Add function to manipulate DNS search domains --- src/connman.h | 2 ++ src/service.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/connman.h b/src/connman.h index 617d62a..2001875 100644 --- a/src/connman.h +++ b/src/connman.h @@ -605,6 +605,8 @@ int __connman_service_set_ignore(struct connman_service *service, connman_bool_t ignore); void __connman_service_set_userconnect(struct connman_service *service, connman_bool_t userconnect); +void __connman_service_set_search_domains(struct connman_service *service, + char **domains); void __connman_service_set_string(struct connman_service *service, const char *key, const char *value); diff --git a/src/service.c b/src/service.c index f375c72..236879e 100644 --- a/src/service.c +++ b/src/service.c @@ -4748,6 +4748,25 @@ void __connman_service_set_userconnect(struct connman_service *service, service->userconnect = userconnect; } +void __connman_service_set_search_domains(struct connman_service *service, + char **domains) +{ + int index; + + index = __connman_service_get_index(service); + if (index < 0) + return; + + if (service->domains != NULL) { + remove_searchdomains(service, index, service->domains); + g_strfreev(service->domains); + + service->domains = g_strdupv(domains); + + update_nameservers(service); + } +} + static void service_complete(struct connman_service *service) { reply_pending(service, EIO); -- 2.7.4