NetworkManager r3909 - in trunk: . introspection libnm-glib src src/backends src/dhcp-manager



Author: dcbw
Date: Thu Aug  7 19:22:23 2008
New Revision: 3909
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3909&view=rev

Log:
2008-08-07  Dan Williams  <dcbw redhat com>

	* introspection/nm-ip4-config.xml
	  libnm-glib/libnm-glib-test.c
	  libnm-glib/nm-ip4-config.c
	  libnm-glib/nm-ip4-config.h
	  src/NetworkManagerSystem.h
	  src/backends/NetworkManagerArch.c
	  src/backends/NetworkManagerDebian.c
	  src/backends/NetworkManagerFrugalware.c
	  src/backends/NetworkManagerGeneric.c
	  src/backends/NetworkManagerGeneric.h
	  src/backends/NetworkManagerGentoo.c
	  src/backends/NetworkManagerMandriva.c
	  src/backends/NetworkManagerPaldo.c
	  src/backends/NetworkManagerRedHat.c
	  src/backends/NetworkManagerSlackware.c
	  src/backends/NetworkManagerSuSE.c
	  src/dhcp-manager/nm-dhcp-manager.c
	  src/nm-device.c
	  src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- Remove NIS logic; should be done from dispatcher scripts instead



Modified:
   trunk/ChangeLog
   trunk/introspection/nm-ip4-config.xml
   trunk/libnm-glib/libnm-glib-test.c
   trunk/libnm-glib/nm-ip4-config.c
   trunk/libnm-glib/nm-ip4-config.h
   trunk/src/NetworkManagerSystem.h
   trunk/src/backends/NetworkManagerArch.c
   trunk/src/backends/NetworkManagerDebian.c
   trunk/src/backends/NetworkManagerFrugalware.c
   trunk/src/backends/NetworkManagerGeneric.c
   trunk/src/backends/NetworkManagerGeneric.h
   trunk/src/backends/NetworkManagerGentoo.c
   trunk/src/backends/NetworkManagerMandriva.c
   trunk/src/backends/NetworkManagerPaldo.c
   trunk/src/backends/NetworkManagerRedHat.c
   trunk/src/backends/NetworkManagerSlackware.c
   trunk/src/backends/NetworkManagerSuSE.c
   trunk/src/dhcp-manager/nm-dhcp-manager.c
   trunk/src/nm-device.c
   trunk/src/nm-ip4-config.c
   trunk/src/nm-ip4-config.h

Modified: trunk/introspection/nm-ip4-config.xml
==============================================================================
--- trunk/introspection/nm-ip4-config.xml	(original)
+++ trunk/introspection/nm-ip4-config.xml	Thu Aug  7 19:22:23 2008
@@ -14,12 +14,6 @@
     <property name="Domains" type="as" access="read">
       <tp:docstring>A list of domains this address belongs to.</tp:docstring>
     </property>
-    <property name="NisDomain" type="s" access="read">
-      <tp:docstring>The NIS domain this address belongs to.</tp:docstring>
-    </property>
-    <property name="NisServers" type="au" access="read">
-      <tp:docstring>The NIS servers associated with this address.</tp:docstring>
-    </property>
     <property name="Routes" type="aau" access="read">
       <tp:docstring>Tuples of IPv4 route/prefix/next-hop/metric.</tp:docstring>
     </property>

Modified: trunk/libnm-glib/libnm-glib-test.c
==============================================================================
--- trunk/libnm-glib/libnm-glib-test.c	(original)
+++ trunk/libnm-glib/libnm-glib-test.c	Thu Aug  7 19:22:23 2008
@@ -106,18 +106,6 @@
 		for (i = 0; i < ptr_array->len; i++)
 			g_print ("\t%s\n", (const char *) g_ptr_array_index (ptr_array, i));
 	}
-
-	g_print ("IP4 NIS domain: %s\n", nm_ip4_config_get_nis_domain (cfg));
-
-	array = nm_ip4_config_get_nis_servers (cfg);
-	if (array) {
-		g_print ("IP4 NIS servers:\n");
-		for (i = 0; i < array->len; i++) {
-			tmp = ip4_address_as_string (g_array_index (array, guint32, i));
-			g_print ("\t%s\n", tmp);
-			g_free (tmp);
-		}
-	}
 }
 
 static void

Modified: trunk/libnm-glib/nm-ip4-config.c
==============================================================================
--- trunk/libnm-glib/nm-ip4-config.c	(original)
+++ trunk/libnm-glib/nm-ip4-config.c	Thu Aug  7 19:22:23 2008
@@ -17,8 +17,6 @@
 	char *hostname;
 	GArray *nameservers;
 	GPtrArray *domains;
-	char *nis_domain;
-	GArray *nis_servers;
 	GSList *routes;
 } NMIP4ConfigPrivate;
 
@@ -28,8 +26,6 @@
 	PROP_HOSTNAME,
 	PROP_NAMESERVERS,
 	PROP_DOMAINS,
-	PROP_NIS_DOMAIN,
-	PROP_NIS_SERVERS,
 	PROP_ROUTES,
 
 	LAST_PROP
@@ -63,8 +59,6 @@
 
 	if (!strcmp (pspec->name, NM_IP4_CONFIG_NAMESERVERS))
 		nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS);
-	else if (!strcmp (pspec->name, NM_IP4_CONFIG_NIS_SERVERS))
-		nm_object_queue_notify (object, NM_IP4_CONFIG_NAMESERVERS);
 	return TRUE;
 }
 
@@ -102,8 +96,6 @@
 		{ NM_IP4_CONFIG_HOSTNAME,    nm_object_demarshal_generic,  &priv->hostname },
 		{ NM_IP4_CONFIG_NAMESERVERS, demarshal_ip4_array,          &priv->nameservers },
 		{ NM_IP4_CONFIG_DOMAINS,     demarshal_domains,            &priv->domains },
-		{ NM_IP4_CONFIG_NIS_DOMAIN,  nm_object_demarshal_generic,  &priv->nis_domain },
-		{ NM_IP4_CONFIG_NIS_SERVERS, demarshal_ip4_array,          &priv->nis_servers },
 		{ NM_IP4_CONFIG_ROUTES,      demarshal_ip4_routes_array,   &priv->routes },
 		{ NULL },
 	};
@@ -153,11 +145,8 @@
 	g_slist_free (priv->routes);
 
 	g_free (priv->hostname);
-	g_free (priv->nis_domain);
 	if (priv->nameservers)
 		g_array_free (priv->nameservers, TRUE);
-	if (priv->nis_servers)
-		g_array_free (priv->nis_servers, TRUE);
 
 	if (priv->domains) {
 		g_ptr_array_foreach (priv->domains, (GFunc) g_free, NULL);
@@ -189,12 +178,6 @@
 	case PROP_DOMAINS:
 		g_value_set_boxed (value, nm_ip4_config_get_domains (self));
 		break;
-	case PROP_NIS_DOMAIN:
-		g_value_set_string (value, nm_ip4_config_get_nis_domain (self));
-		break;
-	case PROP_NIS_SERVERS:
-		g_value_set_boxed (value, nm_ip4_config_get_nis_servers (self));
-		break;
 	case PROP_ROUTES:
 		nm_utils_ip4_routes_to_gvalue (priv->routes, value);
 		break;
@@ -249,22 +232,6 @@
 						    G_PARAM_READABLE));
 
 	g_object_class_install_property
-		(object_class, PROP_NIS_DOMAIN,
-		 g_param_spec_string (NM_IP4_CONFIG_NIS_DOMAIN,
-						    "NIS domain",
-						    "NIS domain",
-						    NULL,
-						    G_PARAM_READABLE));
-
-	g_object_class_install_property
-		(object_class, PROP_NIS_SERVERS,
-		 g_param_spec_boxed (NM_IP4_CONFIG_NIS_SERVERS,
-						    "NIS servers",
-						    "NIS servers",
-						    NM_TYPE_UINT_ARRAY,
-						    G_PARAM_READABLE));
-
-	g_object_class_install_property
 		(object_class, PROP_ROUTES,
 		 g_param_spec_pointer (NM_IP4_CONFIG_ROUTES,
 						       "Routes",
@@ -380,50 +347,6 @@
 	return handle_ptr_array_return (priv->domains);
 }
 
-const char *
-nm_ip4_config_get_nis_domain (NMIP4Config *config)
-{
-	NMIP4ConfigPrivate *priv;
-
-	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
-	priv = NM_IP4_CONFIG_GET_PRIVATE (config);
-	if (!priv->nis_domain) {
-		priv->nis_domain = nm_object_get_string_property (NM_OBJECT (config),
-		                                                  NM_DBUS_INTERFACE_IP4_CONFIG,
-		                                                  "NisDomain");
-	}
-
-	return priv->nis_domain;
-}
-
-const GArray *
-nm_ip4_config_get_nis_servers (NMIP4Config *config)
-{
-	NMIP4ConfigPrivate *priv;
-	GArray *array = NULL;
-	GValue value = {0,};
-
-	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), NULL);
-
-	priv = NM_IP4_CONFIG_GET_PRIVATE (config);
-	if (!priv->nis_servers) {
-		if (nm_object_get_property (NM_OBJECT (config),
-									NM_DBUS_INTERFACE_IP4_CONFIG,
-									"NisServers",
-									&value)) {
-			array = (GArray *) g_value_get_boxed (&value);
-			if (array && array->len) {
-				priv->nis_servers = g_array_sized_new (FALSE, TRUE, sizeof (guint32), array->len);
-				g_array_append_vals (priv->nis_servers, array->data, array->len);
-			}
-			g_value_unset (&value);
-		}
-	}
-
-	return priv->nis_servers;
-}
-
 const GSList *
 nm_ip4_config_get_routes (NMIP4Config *config)
 {

Modified: trunk/libnm-glib/nm-ip4-config.h
==============================================================================
--- trunk/libnm-glib/nm-ip4-config.h	(original)
+++ trunk/libnm-glib/nm-ip4-config.h	Thu Aug  7 19:22:23 2008
@@ -27,8 +27,6 @@
 #define NM_IP4_CONFIG_HOSTNAME "hostname"
 #define NM_IP4_CONFIG_NAMESERVERS "nameservers"
 #define NM_IP4_CONFIG_DOMAINS "domains"
-#define NM_IP4_CONFIG_NIS_DOMAIN "nis-domain"
-#define NM_IP4_CONFIG_NIS_SERVERS "nis-servers"
 #define NM_IP4_CONFIG_ROUTES "routes"
 
 GType nm_ip4_config_get_type (void);
@@ -39,8 +37,6 @@
 const char *     nm_ip4_config_get_hostname    (NMIP4Config *config);
 const GArray *   nm_ip4_config_get_nameservers (NMIP4Config *config);
 const GPtrArray *nm_ip4_config_get_domains     (NMIP4Config *config);
-const char *     nm_ip4_config_get_nis_domain  (NMIP4Config *config);
-const GArray *   nm_ip4_config_get_nis_servers (NMIP4Config *config);
 const GSList *   nm_ip4_config_get_routes      (NMIP4Config *config);
 
 G_END_DECLS

Modified: trunk/src/NetworkManagerSystem.h
==============================================================================
--- trunk/src/NetworkManagerSystem.h	(original)
+++ trunk/src/NetworkManagerSystem.h	Thu Aug  7 19:22:23 2008
@@ -63,8 +63,6 @@
 gboolean        nm_system_device_is_up_with_iface (const char *iface);
 
 void			nm_system_set_hostname (NMIP4Config *config);
-void			nm_system_activate_nis (NMIP4Config *config);
-void			nm_system_shutdown_nis (void);
 
 gboolean		nm_system_device_set_mtu (const char *iface, guint32 mtu);
 

Modified: trunk/src/backends/NetworkManagerArch.c
==============================================================================
--- trunk/src/backends/NetworkManagerArch.c	(original)
+++ trunk/src/backends/NetworkManagerArch.c	Thu Aug  7 19:22:23 2008
@@ -79,16 +79,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
  * nm_system_should_modify_resolv_conf
  *
  * Can NM update resolv.conf, or is it locked down?
@@ -99,16 +89,6 @@
 }
 
 /*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerDebian.c
==============================================================================
--- trunk/src/backends/NetworkManagerDebian.c	(original)
+++ trunk/src/backends/NetworkManagerDebian.c	Thu Aug  7 19:22:23 2008
@@ -65,26 +65,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerFrugalware.c
==============================================================================
--- trunk/src/backends/NetworkManagerFrugalware.c	(original)
+++ trunk/src/backends/NetworkManagerFrugalware.c	Thu Aug  7 19:22:23 2008
@@ -63,26 +63,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerGeneric.c
==============================================================================
--- trunk/src/backends/NetworkManagerGeneric.c	(original)
+++ trunk/src/backends/NetworkManagerGeneric.c	Thu Aug  7 19:22:23 2008
@@ -230,26 +230,6 @@
 }
 
 /*
- * nm_generic_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_generic_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_generic_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_generic_shutdown_nis (void)
-{
-}
-
-/*
  * nm_generic_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerGeneric.h
==============================================================================
--- trunk/src/backends/NetworkManagerGeneric.h	(original)
+++ trunk/src/backends/NetworkManagerGeneric.h	Thu Aug  7 19:22:23 2008
@@ -51,8 +51,6 @@
 gboolean		nm_generic_device_set_up_down_with_iface		(NMDevice *dev, const char *iface, gboolean up);
 
 void			nm_generic_set_hostname (NMIP4Config *config);
-void			nm_generic_activate_nis (NMIP4Config *config);
-void			nm_generic_shutdown_nis (void);
 
 gboolean		nm_generic_should_modify_resolv_conf (void);
 

Modified: trunk/src/backends/NetworkManagerGentoo.c
==============================================================================
--- trunk/src/backends/NetworkManagerGentoo.c	(original)
+++ trunk/src/backends/NetworkManagerGentoo.c	Thu Aug  7 19:22:23 2008
@@ -72,26 +72,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerMandriva.c
==============================================================================
--- trunk/src/backends/NetworkManagerMandriva.c	(original)
+++ trunk/src/backends/NetworkManagerMandriva.c	Thu Aug  7 19:22:23 2008
@@ -66,26 +66,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerPaldo.c
==============================================================================
--- trunk/src/backends/NetworkManagerPaldo.c	(original)
+++ trunk/src/backends/NetworkManagerPaldo.c	Thu Aug  7 19:22:23 2008
@@ -65,26 +65,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerRedHat.c
==============================================================================
--- trunk/src/backends/NetworkManagerRedHat.c	(original)
+++ trunk/src/backends/NetworkManagerRedHat.c	Thu Aug  7 19:22:23 2008
@@ -64,26 +64,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerSlackware.c
==============================================================================
--- trunk/src/backends/NetworkManagerSlackware.c	(original)
+++ trunk/src/backends/NetworkManagerSlackware.c	Thu Aug  7 19:22:23 2008
@@ -61,26 +61,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-}
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/backends/NetworkManagerSuSE.c
==============================================================================
--- trunk/src/backends/NetworkManagerSuSE.c	(original)
+++ trunk/src/backends/NetworkManagerSuSE.c	Thu Aug  7 19:22:23 2008
@@ -71,101 +71,6 @@
 }
 
 /*
- * nm_system_activate_nis
- *
- * set up the nis domain and write a yp.conf
- *
- */
-void nm_system_activate_nis (NMIP4Config *config)
-{
-	shvarFile *file;
-	const char *nis_domain;
-	char *name, *buf;
-	struct in_addr temp_addr;
-	int i;
-	FILE *ypconf = NULL;
-	char addr_buf[INET_ADDRSTRLEN+1];
-
-	memset (&addr_buf, '\0', sizeof (addr_buf));
-
-	g_return_if_fail (config != NULL);
-
-	nis_domain = nm_ip4_config_get_nis_domain(config);
-
-	name = g_strdup_printf (SYSCONFDIR"/sysconfig/network/dhcp");
-	file = svNewFile (name);
-	if (!file)
-		goto out_gfree;
-
-	buf = svGetValue (file, "DHCLIENT_SET_DOMAINNAME");
-	if (!buf)
-		goto out_close;
-
-	if ((!strcmp (buf, "yes")) && nis_domain && (setdomainname (nis_domain, strlen (nis_domain)) < 0))
-			nm_warning ("Could not set nis domain name.");
-	free (buf);
-
-	buf = svGetValue (file, "DHCLIENT_MODIFY_NIS_CONF");
-	if (!buf)
-		goto out_close;
-
-	if (!strcmp (buf, "yes")) {
-		int num_nis_servers;
-
-		num_nis_servers = nm_ip4_config_get_num_nis_servers(config);
-		if (num_nis_servers > 0)
-		{
-			struct stat sb;
-
-			/* write out yp.conf and restart the daemon */
-
-			ypconf = fopen ("/etc/yp.conf", "w");
-
-			if (ypconf)
-			{
-				fprintf (ypconf, "# generated by NetworkManager, do not edit!\n\n");
-				for (i = 0; i < num_nis_servers; i++) {
-					temp_addr.s_addr = nm_ip4_config_get_nis_server (config, i);
-
-					if (!inet_ntop (AF_INET, &temp_addr, addr_buf, INET_ADDRSTRLEN))
-						nm_warning ("%s: error converting IP4 address 0x%X",
-						            __func__, ntohl (temp_addr.s_addr));
-					else
-						fprintf (ypconf, "domain %s server %s\n", nis_domain, addr_buf);
-				}
-				fprintf (ypconf, "\n");
-				fclose (ypconf);
-			} else
-				nm_warning ("Could not commit NIS changes to /etc/yp.conf.");
-
-			if (stat ("/usr/sbin/rcautofs", &sb) != -1)
-			{
-				nm_info ("Restarting autofs.");
-				nm_spawn_process ("/usr/sbin/rcautofs reload");
-			}
-		}
-	}
-	free (buf);
-
-out_close:
-	svCloseFile (file);
-out_gfree:
-	g_free (name);
-}
-
-
-/*
- * nm_system_shutdown_nis
- *
- * shutdown ypbind
- *
- */
-void nm_system_shutdown_nis (void)
-{
-}
-
-
-/*
  * nm_system_set_hostname
  *
  * set the hostname

Modified: trunk/src/dhcp-manager/nm-dhcp-manager.c
==============================================================================
--- trunk/src/dhcp-manager/nm-dhcp-manager.c	(original)
+++ trunk/src/dhcp-manager/nm-dhcp-manager.c	Thu Aug  7 19:22:23 2008
@@ -811,27 +811,6 @@
 		g_strfreev (searches);
 	}
 
-	str = g_hash_table_lookup (device->options, "new_nis_domain");
-	if (str) {
-		nm_ip4_config_set_nis_domain (ip4_config, str);
-		nm_info ("  nis domain '%s'", str);
-	}
-
-	str = g_hash_table_lookup (device->options, "new_nis_servers");
-	if (str) {
-		char **searches = g_strsplit (str, " ", 0);
-		char **s;
-
-		for (s = searches; *s; s++) {
-			if (inet_pton (AF_INET, *s, &tmp_addr) > 0) {
-				nm_ip4_config_add_nis_server (ip4_config, tmp_addr.s_addr);
-				nm_info ("  nis server '%s'", *s);
-			} else
-				nm_warning ("Ignoring invalid nis server '%s'", *s);
-		}
-		g_strfreev (searches);
-	}
-
 	str = g_hash_table_lookup (device->options, "new_static_routes");
 	if (str) {
 		char **searches = g_strsplit (str, " ", 0);

Modified: trunk/src/nm-device.c
==============================================================================
--- trunk/src/nm-device.c	(original)
+++ trunk/src/nm-device.c	Thu Aug  7 19:22:23 2008
@@ -1329,8 +1329,6 @@
 
 	priv = NM_DEVICE_GET_PRIVATE (self);
 
-	nm_system_shutdown_nis ();
-
 	/* Break the activation chain */
 	if (priv->act_source_id) {
 		g_source_remove (priv->act_source_id);
@@ -1760,7 +1758,6 @@
 	if (success) {
 		nm_device_update_ip4_address (self);
 		nm_system_set_hostname (config);
-		nm_system_activate_nis (config);
 	}
 
 	g_object_notify (G_OBJECT (self), NM_DEVICE_INTERFACE_IP4_CONFIG);

Modified: trunk/src/nm-ip4-config.c
==============================================================================
--- trunk/src/nm-ip4-config.c	(original)
+++ trunk/src/nm-ip4-config.c	Thu Aug  7 19:22:23 2008
@@ -56,8 +56,6 @@
 	GPtrArray *searches;
 
 	gchar *hostname;
-	gchar *nis_domain;
-	GArray *nis_servers;
 	GSList *routes;
 } NMIP4ConfigPrivate;
 
@@ -68,8 +66,6 @@
 	PROP_HOSTNAME,
 	PROP_NAMESERVERS,
 	PROP_DOMAINS,
-	PROP_NIS_DOMAIN,
-	PROP_NIS_SERVERS,
 	PROP_ROUTES,
 
 	LAST_PROP
@@ -95,56 +91,6 @@
 	return (NMIP4Config *) object;
 }
 
-NMIP4Config *nm_ip4_config_copy (NMIP4Config *src_config)
-{
-	NMIP4Config *dst_config;
-	NMIP4ConfigPrivate *src_priv;
-	int i;
-	int len;
-	GSList *iter;
-
-	g_return_val_if_fail (NM_IS_IP4_CONFIG (src_config), NULL);
-
-	dst_config = nm_ip4_config_new ();
-	src_priv = NM_IP4_CONFIG_GET_PRIVATE (src_config);
-
-	for (iter = src_priv->addresses; iter; iter = g_slist_next (iter)) {
-		NMSettingIP4Address *src_addr = (NMSettingIP4Address *) iter->data;
-		NMSettingIP4Address *dst_addr;
-
-		dst_addr = g_malloc0 (sizeof (NMSettingIP4Address));
-		memcpy (dst_addr, src_addr, sizeof (NMSettingIP4Address));
-		nm_ip4_config_take_address (dst_config, dst_addr);
-	}
-
-	nm_ip4_config_set_ptp_address (dst_config, nm_ip4_config_get_ptp_address (src_config));
-	nm_ip4_config_set_hostname    (dst_config, nm_ip4_config_get_hostname (src_config));
-	nm_ip4_config_set_nis_domain  (dst_config, nm_ip4_config_get_nis_domain (src_config));
-
-	len = nm_ip4_config_get_num_nameservers (src_config);
-	for (i = 0; i < len; i++)
-		nm_ip4_config_add_nameserver (dst_config, nm_ip4_config_get_nameserver (src_config, i));
-
-	len = nm_ip4_config_get_num_domains (src_config);
-	for (i = 0; i < len; i++)
-		nm_ip4_config_add_domain (dst_config, nm_ip4_config_get_domain (src_config, i));
-
-	len = nm_ip4_config_get_num_nis_servers (src_config);
-	for (i = 0; i < len; i++)
-		nm_ip4_config_add_nis_server (dst_config, nm_ip4_config_get_nis_server (src_config, i));
-
-	for (iter = src_priv->routes; iter; iter = g_slist_next (iter)) {
-		NMSettingIP4Route *src_route = (NMSettingIP4Route *) iter->data;
-		NMSettingIP4Route *dst_route;
-
-		dst_route = g_malloc0 (sizeof (NMSettingIP4Route));
-		memcpy (dst_route, src_route, sizeof (NMSettingIP4Route));
-		nm_ip4_config_take_route (dst_config, dst_route);
-	}
-
-	return dst_config;
-}
-
 void
 nm_ip4_config_take_address (NMIP4Config *config,
                             NMSettingIP4Address *address)
@@ -253,27 +199,6 @@
 		g_array_remove_range (priv->nameservers, 0, priv->nameservers->len);
 }
 
-void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis_server)
-{
-	g_return_if_fail (NM_IS_IP4_CONFIG (config));
-
-	g_array_append_val (NM_IP4_CONFIG_GET_PRIVATE (config)->nis_servers, nis_server);
-}
-
-guint32 nm_ip4_config_get_nis_server (NMIP4Config *config, guint i)
-{
-	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0);
-
-	return g_array_index (NM_IP4_CONFIG_GET_PRIVATE (config)->nis_servers, guint32, i);
-}
-
-guint32 nm_ip4_config_get_num_nis_servers (NMIP4Config *config)
-{
-	g_return_val_if_fail (NM_IS_IP4_CONFIG (config), 0);
-
-	return NM_IP4_CONFIG_GET_PRIVATE (config)->nis_servers->len;
-}
-
 void nm_ip4_config_set_hostname (NMIP4Config *config, const char *hostname)
 {
 	g_return_if_fail (NM_IS_IP4_CONFIG (config));
@@ -292,23 +217,6 @@
 	return NM_IP4_CONFIG_GET_PRIVATE (config)->hostname;
 }
 
-void nm_ip4_config_set_nis_domain (NMIP4Config *config, const char *domain) 
-{
-	g_return_if_fail (NM_IS_IP4_CONFIG (config));
-	g_return_if_fail (domain != NULL);
-	
-	if (!strlen (domain))
-		return;
-	
-	NM_IP4_CONFIG_GET_PRIVATE (config)->nis_domain = g_strdup (domain);
-}
-
-const char *nm_ip4_config_get_nis_domain (NMIP4Config *config)
-{
-	g_return_val_if_fail( NM_IS_IP4_CONFIG (config), NULL);
-	return NM_IP4_CONFIG_GET_PRIVATE (config)->nis_domain;
-}
-
 void
 nm_ip4_config_take_route (NMIP4Config *config,
 						   NMSettingIP4Route *route)
@@ -565,7 +473,6 @@
 	NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
 
 	priv->nameservers = g_array_new (FALSE, TRUE, sizeof (guint32));
-	priv->nis_servers = g_array_new (FALSE, TRUE, sizeof (guint32));
 	priv->domains = g_ptr_array_new ();
 	priv->searches = g_ptr_array_new ();
 }
@@ -577,11 +484,9 @@
 
 	nm_utils_slist_free (priv->addresses, g_free);
 	g_free (priv->hostname);
-	g_free (priv->nis_domain);
 	g_array_free (priv->nameservers, TRUE);
 	g_ptr_array_free (priv->domains, TRUE);
 	g_ptr_array_free (priv->searches, TRUE);
-	g_array_free (priv->nis_servers, TRUE);
 	nm_utils_slist_free (priv->routes, g_free);
 }
 
@@ -633,12 +538,6 @@
 	case PROP_DOMAINS:
 		g_value_set_boxed (value, priv->domains);
 		break;
-	case PROP_NIS_DOMAIN:
-		g_value_set_string (value, priv->nis_domain);
-		break;
-	case PROP_NIS_SERVERS:
-		g_value_set_boxed (value, priv->nis_servers);
-		break;
 	case PROP_ROUTES:
 		ip4_addresses_to_gvalue (priv->routes, value);
 		break;
@@ -688,20 +587,6 @@
 							 "Domains",
 							 DBUS_TYPE_G_ARRAY_OF_STRING,
 							 G_PARAM_READABLE));
-	g_object_class_install_property
-		(object_class, PROP_NIS_DOMAIN,
-		 g_param_spec_string (NM_IP4_CONFIG_NIS_DOMAIN,
-							  "NIS domain",
-							  "NIS domain name",
-							  NULL,
-							  G_PARAM_READABLE));
-	g_object_class_install_property
-		(object_class, PROP_NIS_SERVERS,
-		 g_param_spec_boxed (NM_IP4_CONFIG_NIS_SERVERS,
-							 "NIS servers",
-							 "NIS servers",
-							 DBUS_TYPE_G_UINT_ARRAY,
-							 G_PARAM_READABLE));
 
 	g_object_class_install_property
 		(object_class, PROP_ROUTES,

Modified: trunk/src/nm-ip4-config.h
==============================================================================
--- trunk/src/nm-ip4-config.h	(original)
+++ trunk/src/nm-ip4-config.h	Thu Aug  7 19:22:23 2008
@@ -72,10 +72,6 @@
 guint32		nm_ip4_config_get_num_nameservers	(NMIP4Config *config);
 void			nm_ip4_config_reset_nameservers		(NMIP4Config *config);
 
-void			nm_ip4_config_add_nis_server		(NMIP4Config *config, guint32 nis_server);
-guint32		nm_ip4_config_get_nis_server		(NMIP4Config *config, guint i);
-guint32		nm_ip4_config_get_num_nis_servers	(NMIP4Config *config);
-
 void			nm_ip4_config_take_route		(NMIP4Config *config, NMSettingIP4Route *route);
 void			nm_ip4_config_add_route			(NMIP4Config *config, NMSettingIP4Route *route);
 void			nm_ip4_config_replace_route		(NMIP4Config *config, guint32 i, NMSettingIP4Route *new_route);
@@ -86,9 +82,6 @@
 void			nm_ip4_config_set_hostname		(NMIP4Config *config, const char *hostname);
 const char * 	nm_ip4_config_get_hostname		(NMIP4Config *config);
 
-void			nm_ip4_config_set_nis_domain		(NMIP4Config *config, const char *domain);
-const char *	nm_ip4_config_get_nis_domain		(NMIP4Config *config);
-
 void			nm_ip4_config_add_domain			(NMIP4Config *config, const char *domain);
 const char *	nm_ip4_config_get_domain			(NMIP4Config *config, guint i);
 guint32		nm_ip4_config_get_num_domains		(NMIP4Config *config);



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