ipconfig: Add function to set the IPv6 privacy option
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Fri, 22 Feb 2013 11:47:53 +0000 (13:47 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 22 Feb 2013 12:43:29 +0000 (14:43 +0200)
src/connman.h
src/ipconfig.c

index 8c167981e5896704f1c5265c6ac54718400460d3..1f74e2388cd2934ad15c2c2f1b8add2f651de8fc 100644 (file)
@@ -362,6 +362,8 @@ int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
 int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
                GKeyFile *keyfile, const char *identifier, const char *prefix);
 gboolean __connman_ipconfig_ipv6_privacy_enabled(struct connman_ipconfig *ipconfig);
+int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
+                                       const char *value);
 
 int __connman_ipconfig_set_rp_filter();
 void __connman_ipconfig_unset_rp_filter(int old_value);
index 06c488afa6b7cdba165a5b88e9f687812f42cd61..6927936f44f6d6c367f4b4969e94cbacfa1ce5c2 100644 (file)
@@ -1718,6 +1718,25 @@ static int string2privacy(const char *privacy)
                return 0;
 }
 
+int __connman_ipconfig_ipv6_set_privacy(struct connman_ipconfig *ipconfig,
+                                       const char *value)
+{
+       int privacy;
+
+       if (ipconfig == NULL)
+               return -EINVAL;
+
+       DBG("ipconfig %p privacy %s", ipconfig, value);
+
+       privacy = string2privacy(value);
+
+       ipconfig->ipv6_privacy_config = privacy;
+
+       enable_ipv6(ipconfig);
+
+       return 0;
+}
+
 void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
                                                        DBusMessageIter *iter)
 {