[PATCH] vpn: Add a new field so VPN plugins can specify multiple domains



---
 include/NetworkManagerVPN.h         |    3 +++
 src/vpn-manager/nm-vpn-connection.c |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/include/NetworkManagerVPN.h b/include/NetworkManagerVPN.h
index f4ef93d..8ee5b9a 100644
--- a/include/NetworkManagerVPN.h
+++ b/include/NetworkManagerVPN.h
@@ -151,6 +151,9 @@ typedef enum {
 /* string: DNS domain name */
 #define NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN      "domain"
 
+/* array of strings: DNS domain names */
+#define NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS     "domains"
+
 /* string: Login message */
 #define NM_VPN_PLUGIN_IP4_CONFIG_BANNER      "banner"
 
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index 212be0b..abcce4f 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -547,6 +547,15 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
 	if (val)
 		nm_ip4_config_add_domain (config, g_value_get_string (val));
 
+	val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_DOMAINS);
+	if (val) {
+		GStrv domains = (GStrv *) g_value_get_boxed (val);
+		GStrv domain;
+
+		for (domain = domains; *domain; domain++)
+			nm_ip4_config_add_domain (config, *domain);
+	}
+
 	val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_BANNER);
 	if (val) {
 		g_free (priv->banner);
-- 
1.7.9.1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]