Merge changes for 'nmcli con modify' (rh #1044027)

It allows set vs. append property value by 'nmcli con modify' and also
inside interactive editor.

And also allow doing temporary changes with 'nmcli con modify'.

https://bugzilla.gnome.org/show_bug.cgi?id=724036
https://bugzilla.redhat.com/show_bug.cgi?id=1044027
This commit is contained in:
Jiří Klimeš 2014-02-28 12:11:24 +01:00
commit 1472d76744
20 changed files with 1649 additions and 299 deletions

View file

@ -268,7 +268,7 @@ usage (void)
#endif
" down [id | uuid | path | apath] <ID>\n\n"
" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n"
" modify [id | uuid | path] <ID> <setting>.<property> <value>\n\n"
" modify [--temporary] [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n\n"
" edit [id | uuid | path] <ID>\n"
" edit [type <new_con_type>] [con-name <new_con_name>]\n\n"
" delete [id | uuid | path] <ID>\n\n"
@ -416,10 +416,22 @@ usage_connection_modify (void)
fprintf (stderr,
_("Usage: nmcli connection modify { ARGUMENTS | help }\n"
"\n"
"ARGUMENTS := [id | uuid | path] <ID> <setting name>.<property name> [<value>]\n"
"ARGUMENTS := [id | uuid | path] <ID> ([+|-]<setting>.<property> <value>)+\n"
"\n"
"Modify a single property in the connection profile.\n"
"The profile is identified by its name, UUID or D-Bus path.\n\n"));
"Modify one or more properties of the connection profile.\n"
"The profile is identified by its name, UUID or D-Bus path. For multi-valued\n"
"properties you can use optional '+' or '-' prefix to the property name.\n"
"The '+' sign allows appending items instead of overwriting the whole value.\n"
"The '-' sign allows removing selected items instead of the whole value.\n"
"\n"
"Examples:\n"
"nmcli con mod home-wifi wifi.ssid rakosnicek\n"
"nmcli con mod em1-1 ipv4.method manual ipv4.addr \"192.168.1.2/24, 10.10.1.5/8\"\n"
"nmcli con mod em1-1 +ipv4.dns 8.8.4.4\n"
"nmcli con mod em1-1 -ipv4.dns 1\n"
"nmcli con mod em1-1 -ipv6.addr \"abbe::cafe/56\"\n"
"nmcli con mod bond0 +bond.options mii=500\n"
"nmcli con mod bond0 -bond.options downdelay\n\n"));
}
static void
@ -6169,18 +6181,25 @@ editor_sub_usage (const char *command)
"This command sets provided <value> to this property\n"));
break;
case NMC_EDITOR_SUB_CMD_ADD:
printf (_("add [<value>] :: add new option to the property\n\n"
"This command add provided <value> to this property, if "
printf (_("add [<value>] :: append new value to the property\n\n"
"This command adds provided <value> to this property, if "
"the property is of a container type. For single-valued "
"properties it replaces the value (same as 'set').\n"));
"properties the property value is replaced (same as 'set').\n"));
break;
case NMC_EDITOR_SUB_CMD_CHANGE:
printf (_("change :: change current value\n\n"
"Displays current value and allows editing it.\n"));
break;
case NMC_EDITOR_SUB_CMD_REMOVE:
printf (_("remove [<index>|<option>] :: delete the value\n\n"
"Removes the property value (sets it to default).\n"));
printf (_("remove [<value>|<index>|<option name>] :: delete the value\n\n"
"Removes the property value. For single-valued properties, this sets the\n"
"property back to its default value. For container-type properties, this removes\n"
"all the values of that property, or you can specify an argument to remove just\n"
"a single item or option. The argument is either a value or index of the item to\n"
"remove, or an option name (for properties with named options).\n\n"
"Examples: nmcli ipv4.dns> remove 8.8.8.8\n"
" nmcli ipv4.dns> remove 2\n"
" nmcli bond.options> remove downdelay\n\n"));
break;
case NMC_EDITOR_SUB_CMD_DESCRIBE:
printf (_("describe :: describe property\n\n"
@ -7825,7 +7844,10 @@ modify_connection_cb (NMRemoteConnection *connection,
}
static NMCResultCode
do_connection_modify (NmCli *nmc, int argc, char **argv)
do_connection_modify (NmCli *nmc,
gboolean temporary,
int argc,
char **argv)
{
NMConnection *connection = NULL;
NMRemoteConnection *rc = NULL;
@ -7834,15 +7856,26 @@ do_connection_modify (NmCli *nmc, int argc, char **argv)
const char *con_type;
const char *name;
const char *selector = NULL;
const char *set_prop;
char *value = NULL;
const char *s_dot_p;
const char *value;
char **strv = NULL;
const char *setting_name;
char *property_name = NULL;
gboolean append = FALSE;
gboolean remove = FALSE;
GError *error = NULL;
nmc->should_wait = FALSE;
/* create NMClient */
nmc->get_client (nmc);
if (!nm_client_get_manager_running (nmc->client)) {
g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
goto finish;
}
if (argc == 0) {
g_string_printf (nmc->return_text, _("Error: No arguments provided."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
@ -7862,96 +7895,143 @@ do_connection_modify (NmCli *nmc, int argc, char **argv)
name = *argv;
}
name = *argv;
next_arg (&argc, &argv);
set_prop = *argv;
next_arg (&argc, &argv);
value = g_strjoinv (" ", argv);
if (!name) {
g_string_printf (nmc->return_text, _("Error: connection ID is missing."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
if (!set_prop) {
g_string_printf (nmc->return_text, _("Error: <setting>.<property> argument is missing."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
/* NULL value means deleting/setting default property value */
/* create NMClient */
nmc->get_client (nmc);
if (!nm_client_get_manager_running (nmc->client)) {
g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
goto finish;
}
connection = find_connection (nmc->system_connections, selector, name, NULL);
if (!connection) {
g_string_printf (nmc->return_text, _("Error: Unknown connection '%s'."), name);
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
goto finish;
}
strv = g_strsplit (set_prop, ".", 2);
if (g_strv_length (strv) != 2) {
g_string_printf (nmc->return_text, _("Error: invalid <setting>.<property> '%s'."),
set_prop);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
rc = nm_remote_settings_get_connection_by_uuid (nmc->system_settings,
nm_connection_get_uuid (connection));
if (!rc) {
g_string_printf (nmc->return_text, _("Error: Unknown connection '%s'."), name);
nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
goto finish;
}
s_con = nm_connection_get_setting_connection (NM_CONNECTION (rc));
g_assert (s_con);
con_type = nm_setting_connection_get_connection_type (s_con);
setting_name = check_valid_name (strv[0], get_valid_settings_array (con_type), &error);
if (!setting_name) {
g_string_printf (nmc->return_text, _("Error: invalid or not allowed setting '%s': %s."),
strv[0], error->message);
if (next_arg (&argc, &argv) != 0) {
g_string_printf (nmc->return_text, _("Error: <setting>.<property> argument is missing."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
setting = nm_connection_get_setting_by_name (NM_CONNECTION (rc), setting_name);
if (!setting) {
setting = nmc_setting_new_for_name (setting_name);
if (!setting) {
/* This should really not happen */
g_string_printf (nmc->return_text,
"Error: don't know how to create '%s' setting.",
setting_name);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
/* Go through arguments and set properties */
while (argc) {
s_dot_p = *argv;
next_arg (&argc, &argv);
value = *argv;
next_arg (&argc, &argv);
if (!s_dot_p) {
g_string_printf (nmc->return_text, _("Error: <setting>.<property> argument is missing."));
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
nm_connection_add_setting (NM_CONNECTION (rc), setting);
if (!value) {
g_string_printf (nmc->return_text, _("Error: value for '%s' is missing."), s_dot_p);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
/* Empty string will reset the value to default */
if (value[0] == '\0')
value = NULL;
if (s_dot_p[0] == '+') {
s_dot_p++;
append = TRUE;
} else if (s_dot_p[0] == '-') {
s_dot_p++;
remove = TRUE;
}
strv = g_strsplit (s_dot_p, ".", 2);
if (g_strv_length (strv) != 2) {
g_string_printf (nmc->return_text, _("Error: invalid <setting>.<property> '%s'."),
s_dot_p);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
setting_name = check_valid_name (strv[0], get_valid_settings_array (con_type), &error);
if (!setting_name) {
g_string_printf (nmc->return_text, _("Error: invalid or not allowed setting '%s': %s."),
strv[0], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
setting = nm_connection_get_setting_by_name (NM_CONNECTION (rc), setting_name);
if (!setting) {
setting = nmc_setting_new_for_name (setting_name);
if (!setting) {
/* This should really not happen */
g_string_printf (nmc->return_text,
"Error: don't know how to create '%s' setting.",
setting_name);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
goto finish;
}
nm_connection_add_setting (NM_CONNECTION (rc), setting);
}
property_name = is_property_valid (setting, strv[1], &error);
if (!property_name) {
g_string_printf (nmc->return_text, _("Error: invalid property '%s': %s."),
strv[1], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
if (!remove) {
/* Set/add value */
if (!append)
nmc_setting_reset_property (setting, property_name, NULL);
if (!nmc_setting_set_property (setting, property_name, value, &error)) {
g_string_printf (nmc->return_text, _("Error: failed to modify %s.%s: %s."),
strv[0], strv[1], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
} else {
/* Remove value
* - either empty: remove whole value
* - or specified by index <0-n>: remove item at the index
* - or option name: remove item with the option name
*/
if (value) {
unsigned long idx;
if (nmc_string_to_uint (value, TRUE, 0, G_MAXUINT32, &idx))
nmc_setting_remove_property_option (setting, property_name, NULL, idx, &error);
else
nmc_setting_remove_property_option (setting, property_name, value, 0, &error);
if (error) {
g_string_printf (nmc->return_text, _("Error: failed to remove a value from %s.%s: %s."),
strv[0], strv[1], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
} else
nmc_setting_reset_property (setting, property_name, NULL);
}
g_strfreev (strv);
strv = NULL;
}
property_name = is_property_valid (setting, strv[1], &error);
if (!property_name) {
g_string_printf (nmc->return_text, _("Error: invalid property '%s': %s."),
strv[1], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
if (!nmc_setting_set_property (setting, property_name, value, &error)) {
g_string_printf (nmc->return_text, _("Error: failed to modify %s.%s: %s."),
strv[0], strv[1], error->message);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
goto finish;
}
update_connection (!temporary, rc, modify_connection_cb, nmc);
nm_remote_connection_commit_changes (rc,
modify_connection_cb,
nmc);
finish:
nmc->should_wait = (nmc->return_value == NMC_RESULT_SUCCESS);
g_free (value);
g_free (property_name);
g_strfreev (strv);
if (strv)
g_strfreev (strv);
g_clear_error (&error);
return nmc->return_value;
}
@ -8265,11 +8345,18 @@ parse_cmd (NmCli *nmc, int argc, char **argv)
nmc->return_value = do_connection_load (nmc, argc-1, argv+1);
}
else if (matches (*argv, "modify") == 0) {
gboolean temporary = FALSE;
if (nmc_arg_is_help (*(argv+1))) {
usage_connection_modify ();
goto usage_exit;
}
nmc->return_value = do_connection_modify (nmc, argc-1, argv+1);
next_arg (&argc, &argv);
if (nmc_arg_is_option (*argv, "temporary")) {
temporary = TRUE;
next_arg (&argc, &argv);
}
nmc->return_value = do_connection_modify (nmc, temporary, argc, argv);
}
else {
usage ();

File diff suppressed because it is too large Load diff

View file

@ -172,8 +172,11 @@ global:
nm_setting_802_1x_get_type;
nm_setting_802_1x_new;
nm_setting_802_1x_remove_altsubject_match;
nm_setting_802_1x_remove_altsubject_match_by_value;
nm_setting_802_1x_remove_eap_method;
nm_setting_802_1x_remove_eap_method_by_value;
nm_setting_802_1x_remove_phase2_altsubject_match;
nm_setting_802_1x_remove_phase2_altsubject_match_by_value;
nm_setting_802_1x_set_ca_cert;
nm_setting_802_1x_set_client_cert;
nm_setting_802_1x_set_phase2_ca_cert;
@ -264,7 +267,9 @@ global:
nm_setting_connection_new;
nm_setting_connection_permissions_user_allowed;
nm_setting_connection_remove_permission;
nm_setting_connection_remove_permission_by_value;
nm_setting_connection_remove_secondary;
nm_setting_connection_remove_secondary_by_value;
nm_setting_dcb_error_get_type;
nm_setting_dcb_error_quark;
nm_setting_dcb_flags_get_type;
@ -361,9 +366,13 @@ global:
nm_setting_ip4_config_get_type;
nm_setting_ip4_config_new;
nm_setting_ip4_config_remove_address;
nm_setting_ip4_config_remove_address_by_value;
nm_setting_ip4_config_remove_dns;
nm_setting_ip4_config_remove_dns_by_value;
nm_setting_ip4_config_remove_dns_search;
nm_setting_ip4_config_remove_dns_search_by_value;
nm_setting_ip4_config_remove_route;
nm_setting_ip4_config_remove_route_by_value;
nm_setting_ip6_config_add_address;
nm_setting_ip6_config_add_dns;
nm_setting_ip6_config_add_dns_search;
@ -393,9 +402,13 @@ global:
nm_setting_ip6_config_new;
nm_setting_ip6_config_privacy_get_type;
nm_setting_ip6_config_remove_address;
nm_setting_ip6_config_remove_address_by_value;
nm_setting_ip6_config_remove_dns;
nm_setting_ip6_config_remove_dns_by_value;
nm_setting_ip6_config_remove_dns_search;
nm_setting_ip6_config_remove_dns_search_by_value;
nm_setting_ip6_config_remove_route;
nm_setting_ip6_config_remove_route_by_value;
nm_setting_need_secrets;
nm_setting_new_from_hash;
nm_setting_olpc_mesh_error_get_type;
@ -475,6 +488,8 @@ global:
nm_setting_vlan_get_type;
nm_setting_vlan_new;
nm_setting_vlan_remove_priority;
nm_setting_vlan_remove_priority_by_value;
nm_setting_vlan_remove_priority_str_by_value;
nm_setting_vpn_add_data_item;
nm_setting_vpn_add_secret;
nm_setting_vpn_error_get_type;
@ -499,6 +514,7 @@ global:
nm_setting_wimax_new;
nm_setting_wired_add_mac_blacklist_item;
nm_setting_wired_add_s390_option;
nm_setting_wired_clear_mac_blacklist_items;
nm_setting_wired_error_get_type;
nm_setting_wired_error_quark;
nm_setting_wired_get_auto_negotiate;
@ -520,10 +536,12 @@ global:
nm_setting_wired_get_valid_s390_options;
nm_setting_wired_new;
nm_setting_wired_remove_mac_blacklist_item;
nm_setting_wired_remove_mac_blacklist_item_by_value;
nm_setting_wired_remove_s390_option;
nm_setting_wireless_add_mac_blacklist_item;
nm_setting_wireless_add_seen_bssid;
nm_setting_wireless_ap_security_compatible;
nm_setting_wireless_clear_mac_blacklist_items;
nm_setting_wireless_error_get_type;
nm_setting_wireless_error_quark;
nm_setting_wireless_get_band;
@ -546,6 +564,7 @@ global:
nm_setting_wireless_get_type;
nm_setting_wireless_new;
nm_setting_wireless_remove_mac_blacklist_item;
nm_setting_wireless_remove_mac_blacklist_item_by_value;
nm_setting_wireless_security_add_group;
nm_setting_wireless_security_add_pairwise;
nm_setting_wireless_security_add_proto;
@ -574,8 +593,11 @@ global:
nm_setting_wireless_security_get_wep_tx_keyidx;
nm_setting_wireless_security_new;
nm_setting_wireless_security_remove_group;
nm_setting_wireless_security_remove_group_by_value;
nm_setting_wireless_security_remove_pairwise;
nm_setting_wireless_security_remove_pairwise_by_value;
nm_setting_wireless_security_remove_proto;
nm_setting_wireless_security_remove_proto_by_value;
nm_setting_wireless_security_set_wep_key;
nm_utils_ap_mode_security_valid;
nm_utils_bin2hexstr;

View file

@ -276,6 +276,38 @@ nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_EAP);
}
/**
* nm_setting_802_1x_remove_eap_method_by_value:
* @setting: the #NMSetting8021x
* @eap: the name of the EAP method to remove
*
* Removes the allowed EAP method @method.
*
* Returns: %TRUE if the EAP method was founs and removed, %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_802_1x_remove_eap_method_by_value (NMSetting8021x *setting,
const char *eap)
{
NMSetting8021xPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE);
g_return_val_if_fail (eap != NULL, FALSE);
priv = NM_SETTING_802_1X_GET_PRIVATE (setting);
for (iter = priv->eap; iter; iter = g_slist_next (iter)) {
if (!strcmp (eap, (char *) iter->data)) {
priv->eap = g_slist_delete_link (priv->eap, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_EAP);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_802_1x_clear_eap_methods:
* @setting: the #NMSetting8021x
@ -682,6 +714,39 @@ nm_setting_802_1x_remove_altsubject_match (NMSetting8021x *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_ALTSUBJECT_MATCHES);
}
/**
* nm_setting_802_1x_remove_altsubject_match_by_value:
* @setting: the #NMSetting8021x
* @altsubject_match: the altSubjectName to remove
*
* Removes the allowed altSubjectName @altsubject_match.
*
* Returns: %TRUE if the alternative subject name match was found and removed,
* %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_802_1x_remove_altsubject_match_by_value (NMSetting8021x *setting,
const char *altsubject_match)
{
NMSetting8021xPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE);
g_return_val_if_fail (altsubject_match != NULL, FALSE);
priv = NM_SETTING_802_1X_GET_PRIVATE (setting);
for (iter = priv->altsubject_matches; iter; iter = g_slist_next (iter)) {
if (!strcmp (altsubject_match, (char *) iter->data)) {
priv->altsubject_matches = g_slist_delete_link (priv->altsubject_matches, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_ALTSUBJECT_MATCHES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_802_1x_clear_altsubject_matches:
* @setting: the #NMSetting8021x
@ -1229,6 +1294,40 @@ nm_setting_802_1x_remove_phase2_altsubject_match (NMSetting8021x *setting, guint
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES);
}
/**
* nm_setting_802_1x_remove_phase2_altsubject_match_by_value:
* @setting: the #NMSetting8021x
* @phase2_altsubject_match: the "phase 2" altSubjectName to remove
*
* Removes the allowed "phase 2" altSubjectName @phase2_altsubject_match.
*
* Returns: %TRUE if the alternative subject name match for "phase 2" was found and removed,
* %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_802_1x_remove_phase2_altsubject_match_by_value (NMSetting8021x *setting,
const char *phase2_altsubject_match)
{
NMSetting8021xPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE);
g_return_val_if_fail (phase2_altsubject_match != NULL, FALSE);
priv = NM_SETTING_802_1X_GET_PRIVATE (setting);
for (iter = priv->phase2_altsubject_matches; iter; iter = g_slist_next (iter)) {
if (!strcmp (phase2_altsubject_match, (char *) iter->data)) {
priv->phase2_altsubject_matches = g_slist_delete_link (priv->phase2_altsubject_matches, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_802_1x_clear_phase2_altsubject_matches:
* @setting: the #NMSetting8021x

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2012 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -170,6 +170,8 @@ guint32 nm_setting_802_1x_get_num_eap_methods (NMSetting8
const char * nm_setting_802_1x_get_eap_method (NMSetting8021x *setting, guint32 i);
gboolean nm_setting_802_1x_add_eap_method (NMSetting8021x *setting, const char *eap);
void nm_setting_802_1x_remove_eap_method (NMSetting8021x *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_802_1x_remove_eap_method_by_value (NMSetting8021x *setting, const char *eap);
void nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting);
const char * nm_setting_802_1x_get_identity (NMSetting8021x *setting);
@ -195,11 +197,14 @@ const char * nm_setting_802_1x_get_subject_match (NMSetting8
guint32 nm_setting_802_1x_get_num_altsubject_matches (NMSetting8021x *setting);
const char * nm_setting_802_1x_get_altsubject_match (NMSetting8021x *setting,
guint32 i);
guint32 i);
gboolean nm_setting_802_1x_add_altsubject_match (NMSetting8021x *setting,
const char *altsubject_match);
const char *altsubject_match);
void nm_setting_802_1x_remove_altsubject_match (NMSetting8021x *setting,
guint32 i);
guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_802_1x_remove_altsubject_match_by_value (NMSetting8021x *setting,
const char *altsubject_match);
void nm_setting_802_1x_clear_altsubject_matches (NMSetting8021x *setting);
NMSetting8021xCKScheme nm_setting_802_1x_get_client_cert_scheme (NMSetting8021x *setting);
@ -232,14 +237,17 @@ gboolean nm_setting_802_1x_set_phase2_ca_cert (NMSetting8
const char * nm_setting_802_1x_get_phase2_subject_match (NMSetting8021x *setting);
guint32 nm_setting_802_1x_get_num_phase2_altsubject_matches (NMSetting8021x *setting);
const char * nm_setting_802_1x_get_phase2_altsubject_match (NMSetting8021x *setting,
guint32 i);
gboolean nm_setting_802_1x_add_phase2_altsubject_match (NMSetting8021x *setting,
const char *phase2_altsubject_match);
void nm_setting_802_1x_remove_phase2_altsubject_match (NMSetting8021x *setting,
guint32 i);
void nm_setting_802_1x_clear_phase2_altsubject_matches (NMSetting8021x *setting);
guint32 nm_setting_802_1x_get_num_phase2_altsubject_matches (NMSetting8021x *setting);
const char * nm_setting_802_1x_get_phase2_altsubject_match (NMSetting8021x *setting,
guint32 i);
gboolean nm_setting_802_1x_add_phase2_altsubject_match (NMSetting8021x *setting,
const char *phase2_altsubject_match);
void nm_setting_802_1x_remove_phase2_altsubject_match (NMSetting8021x *setting,
guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_802_1x_remove_phase2_altsubject_match_by_value (NMSetting8021x *setting,
const char *phase2_altsubject_match);
void nm_setting_802_1x_clear_phase2_altsubject_matches (NMSetting8021x *setting);
NMSetting8021xCKScheme nm_setting_802_1x_get_phase2_client_cert_scheme (NMSetting8021x *setting);
const GByteArray * nm_setting_802_1x_get_phase2_client_cert_blob (NMSetting8021x *setting);

View file

@ -447,6 +447,51 @@ nm_setting_connection_remove_permission (NMSettingConnection *setting,
g_object_notify (G_OBJECT (setting), NM_SETTING_CONNECTION_PERMISSIONS);
}
/**
* nm_setting_connection_remove_permission_by_value:
* @setting: the #NMSettingConnection
* @ptype: the permission type; at this time only "user" is supported
* @pitem: the permission item formatted as required for @ptype
* @detail: (allow-none): unused at this time; must be %NULL
*
* Removes the permission from the connection.
* At this time, only the "user" permission type is supported, and @pitem must
* be a username. See #NMSettingConnection:permissions: for more details.
*
* Returns: %TRUE if the permission was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
*/
gboolean
nm_setting_connection_remove_permission_by_value (NMSettingConnection *setting,
const char *ptype,
const char *pitem,
const char *detail)
{
NMSettingConnectionPrivate *priv;
Permission *p;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE);
g_return_val_if_fail (ptype, FALSE);
g_return_val_if_fail (strlen (ptype) > 0, FALSE);
g_return_val_if_fail (detail == NULL, FALSE);
/* Only "user" for now... */
g_return_val_if_fail (strcmp (ptype, "user") == 0, FALSE);
priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
for (iter = priv->permissions; iter; iter = g_slist_next (iter)) {
p = iter->data;
if (strcmp (pitem, p->item) == 0) {
permission_free ((Permission *) iter->data);
priv->permissions = g_slist_delete_link (priv->permissions, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_CONNECTION_PERMISSIONS);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_connection_get_autoconnect:
@ -660,6 +705,39 @@ nm_setting_connection_remove_secondary (NMSettingConnection *setting, guint32 id
g_object_notify (G_OBJECT (setting), NM_SETTING_CONNECTION_SECONDARIES);
}
/**
* nm_setting_connection_remove_secondary_by_value:
* @setting: the #NMSettingConnection
* @sec_uuid: the secondary connection UUID to remove
*
* Removes the secondary coonnection UUID @sec_uuid.
*
* Returns: %TRUE if the secondary connection UUID was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_connection_remove_secondary_by_value (NMSettingConnection *setting,
const char *sec_uuid)
{
NMSettingConnectionPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE);
g_return_val_if_fail (sec_uuid != NULL, FALSE);
g_return_val_if_fail (sec_uuid[0] != '\0', FALSE);
priv = NM_SETTING_CONNECTION_GET_PRIVATE (setting);
for (iter = priv->secondaries; iter; iter = g_slist_next (iter)) {
if (!strcmp (sec_uuid, (char *) iter->data)) {
priv->secondaries = g_slist_delete_link (priv->secondaries, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_CONNECTION_SECONDARIES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_connection_get_gateway_ping_timeout:
* @setting: the #NMSettingConnection

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2012 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -128,14 +128,23 @@ gboolean nm_setting_connection_add_permission (NMSettingConnection *set
const char *detail);
void nm_setting_connection_remove_permission (NMSettingConnection *setting,
guint32 idx);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_connection_remove_permission_by_value (NMSettingConnection *setting,
const char *ptype,
const char *pitem,
const char *detail);
const char *nm_setting_connection_get_master (NMSettingConnection *setting);
gboolean nm_setting_connection_is_slave_type (NMSettingConnection *setting,
const char *type);
const char *nm_setting_connection_get_slave_type (NMSettingConnection *setting);
guint32 nm_setting_connection_get_num_secondaries (NMSettingConnection *setting);
const char *nm_setting_connection_get_secondary (NMSettingConnection *setting, guint32 idx);
gboolean nm_setting_connection_add_secondary (NMSettingConnection *setting, const char *sec_uuid);
void nm_setting_connection_remove_secondary (NMSettingConnection *setting, guint32 idx);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_connection_remove_secondary_by_value (NMSettingConnection *setting, const char *sec_uuid);
NM_AVAILABLE_IN_0_9_10
guint32 nm_setting_connection_get_gateway_ping_timeout (NMSettingConnection *setting);

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -218,6 +218,37 @@ nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
}
/**
* nm_setting_ip4_config_remove_dns_by_value:
* @setting: the #NMSettingIP4Config
* @dns: the DNS server to remove
*
* Removes the DNS server @dns.
*
* Returns: %TRUE if the DNS server was found and removed; %FALSE if it was not.
* domain was already known
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip4_config_remove_dns_by_value (NMSettingIP4Config *setting, guint32 dns)
{
NMSettingIP4ConfigPrivate *priv;
int i;
g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
for (i = 0; i < priv->dns->len; i++) {
if (dns == g_array_index (priv->dns, guint32, i)) {
g_array_remove_index (priv->dns, i);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip4_config_clear_dns:
* @setting: the #NMSettingIP4Config
@ -326,6 +357,39 @@ nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
}
/**
* nm_setting_ip4_config_remove_dns_search_by_value:
* @setting: the #NMSettingIP4Config
* @dns_search: the search domain to remove
*
* Removes the DNS search domain @dns_search.
*
* Returns: %TRUE if the DNS search domain was found and removed; %FALSE if it was not.
*
* Since 0.9.10
**/
gboolean
nm_setting_ip4_config_remove_dns_search_by_value (NMSettingIP4Config *setting,
const char *dns_search)
{
NMSettingIP4ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
g_return_val_if_fail (dns_search != NULL, FALSE);
g_return_val_if_fail (dns_search[0] != '\0', FALSE);
priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
if (!strcmp (dns_search, (char *) iter->data)) {
priv->dns_search = g_slist_delete_link (priv->dns_search, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_DNS_SEARCH);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip4_config_clear_dns_searches:
* @setting: the #NMSettingIP4Config
@ -436,6 +500,39 @@ nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
}
/**
* nm_setting_ip4_config_remove_address_by_value:
* @setting: the #NMSettingIP4Config
* @address: the IP address to remove
*
* Removes the address @address.
*
* Returns: %TRUE if the address was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip4_config_remove_address_by_value (NMSettingIP4Config *setting,
NMIP4Address *address)
{
NMSettingIP4ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
g_return_val_if_fail (address != NULL, FALSE);
priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
if (nm_ip4_address_compare ((NMIP4Address *) iter->data, address)) {
nm_ip4_address_unref ((NMIP4Address *) iter->data);
priv->addresses = g_slist_delete_link (priv->addresses, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ADDRESSES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip4_config_clear_addresses:
* @setting: the #NMSettingIP4Config
@ -547,6 +644,39 @@ nm_setting_ip4_config_remove_route (NMSettingIP4Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
}
/**
* nm_setting_ip4_config_remove_route_by_value:
* @setting: the #NMSettingIP4Config
* @route: the route to remove
*
* Removes the route @route.
*
* Returns: %TRUE if the route was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting,
NMIP4Route *route)
{
NMSettingIP4ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
g_return_val_if_fail (route != NULL, FALSE);
priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting);
for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
if (nm_ip4_route_compare ((NMIP4Route *) iter->data, route)) {
nm_ip4_route_unref ((NMIP4Route *) iter->data);
priv->routes = g_slist_delete_link (priv->routes, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP4_CONFIG_ROUTES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip4_config_clear_routes:
* @setting: the #NMSettingIP4Config

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2010 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -189,24 +189,32 @@ guint32 nm_setting_ip4_config_get_num_dns (NMSettingIP4Config *
guint32 nm_setting_ip4_config_get_dns (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_dns (NMSettingIP4Config *setting, guint32 dns);
void nm_setting_ip4_config_remove_dns (NMSettingIP4Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip4_config_remove_dns_by_value (NMSettingIP4Config *setting, guint32 dns);
void nm_setting_ip4_config_clear_dns (NMSettingIP4Config *setting);
guint32 nm_setting_ip4_config_get_num_dns_searches (NMSettingIP4Config *setting);
const char * nm_setting_ip4_config_get_dns_search (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_dns_search (NMSettingIP4Config *setting, const char *dns_search);
void nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting, guint32 i);
void nm_setting_ip4_config_clear_dns_searches (NMSettingIP4Config *setting);
guint32 nm_setting_ip4_config_get_num_dns_searches (NMSettingIP4Config *setting);
const char * nm_setting_ip4_config_get_dns_search (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_dns_search (NMSettingIP4Config *setting, const char *dns_search);
void nm_setting_ip4_config_remove_dns_search (NMSettingIP4Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip4_config_remove_dns_search_by_value (NMSettingIP4Config *setting, const char *dns_search);
void nm_setting_ip4_config_clear_dns_searches (NMSettingIP4Config *setting);
guint32 nm_setting_ip4_config_get_num_addresses (NMSettingIP4Config *setting);
NMIP4Address *nm_setting_ip4_config_get_address (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_address (NMSettingIP4Config *setting, NMIP4Address *address);
void nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i);
void nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting);
guint32 nm_setting_ip4_config_get_num_addresses (NMSettingIP4Config *setting);
NMIP4Address *nm_setting_ip4_config_get_address (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_address (NMSettingIP4Config *setting, NMIP4Address *address);
void nm_setting_ip4_config_remove_address (NMSettingIP4Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip4_config_remove_address_by_value (NMSettingIP4Config *setting, NMIP4Address *address);
void nm_setting_ip4_config_clear_addresses (NMSettingIP4Config *setting);
guint32 nm_setting_ip4_config_get_num_routes (NMSettingIP4Config *setting);
NMIP4Route * nm_setting_ip4_config_get_route (NMSettingIP4Config *setting, guint32 i);
gboolean nm_setting_ip4_config_add_route (NMSettingIP4Config *setting, NMIP4Route *route);
void nm_setting_ip4_config_remove_route (NMSettingIP4Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip4_config_remove_route_by_value (NMSettingIP4Config *setting, NMIP4Route *route);
void nm_setting_ip4_config_clear_routes (NMSettingIP4Config *setting);
gboolean nm_setting_ip4_config_get_ignore_auto_routes (NMSettingIP4Config *setting);

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
*/
#include <string.h>
@ -241,6 +241,37 @@ nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
}
/**
* nm_setting_ip6_config_remove_dns_by_value:
* @setting: the #NMSettingIP6Config
* @dns: the IPv6 address of the DNS server to remove
*
* Removes the DNS server at index @i.
*
* Returns: %TRUE if the DNS server was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip6_config_remove_dns_by_value (NMSettingIP6Config *setting,
const struct in6_addr *addr)
{
NMSettingIP6ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
for (iter = priv->dns; iter; iter = g_slist_next (iter)) {
if (!memcmp (addr, (struct in6_addr *) iter->data, sizeof (struct in6_addr))) {
priv->dns = g_slist_delete_link (priv->dns, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip6_config_clear_dns:
* @setting: the #NMSettingIP6Config
@ -347,6 +378,39 @@ nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
}
/**
* nm_setting_ip6_config_remove_dns_search_by_value:
* @setting: the #NMSettingIP6Config
* @dns_search: the search domain to remove
*
* Removes the DNS search domain @dns_search.
*
* Returns: %TRUE if the DNS search domain was found and removed; %FALSE if it was not.
*
* Since 0.9.10
**/
gboolean
nm_setting_ip6_config_remove_dns_search_by_value (NMSettingIP6Config *setting,
const char *dns_search)
{
NMSettingIP6ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
g_return_val_if_fail (dns_search != NULL, FALSE);
g_return_val_if_fail (dns_search[0] != '\0', FALSE);
priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
for (iter = priv->dns_search; iter; iter = g_slist_next (iter)) {
if (!strcmp (dns_search, (char *) iter->data)) {
priv->dns_search = g_slist_delete_link (priv->dns_search, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_DNS_SEARCH);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip6_config_clear_dns_searches:
* @setting: the #NMSettingIP6Config
@ -457,6 +521,38 @@ nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
}
/**
* nm_setting_ip6_config_remove_address_by_value:
* @setting: the #NMSettingIP6Config
* @address: the address to remove
*
* Removes the address @address.
*
* Returns: %TRUE if the address was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip6_config_remove_address_by_value (NMSettingIP6Config *setting,
NMIP6Address *address)
{
NMSettingIP6ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
g_return_val_if_fail (address != NULL, FALSE);
priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
for (iter = priv->addresses; iter; iter = g_slist_next (iter)) {
if (nm_ip6_address_compare ((NMIP6Address *) iter->data, address)) {
priv->addresses = g_slist_delete_link (priv->addresses, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ADDRESSES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip6_config_clear_addresses:
* @setting: the #NMSettingIP6Config
@ -568,6 +664,39 @@ nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i)
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
}
/**
* nm_setting_ip6_config_remove_route_by_value:
* @setting: the #NMSettingIP6Config
* @route: the route to remove
*
* Removes the route @route.
*
* Returns: %TRUE if the route was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_ip6_config_remove_route_by_value (NMSettingIP6Config *setting,
NMIP6Route *route)
{
NMSettingIP6ConfigPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
g_return_val_if_fail (route != NULL, FALSE);
priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting);
for (iter = priv->routes; iter; iter = g_slist_next (iter)) {
if (nm_ip6_route_compare ((NMIP6Route *) iter->data, route)) {
nm_ip6_route_unref ((NMIP6Route *) iter->data);
priv->routes = g_slist_delete_link (priv->routes, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_IP6_CONFIG_ROUTES);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_ip6_config_clear_routes:
* @setting: the #NMSettingIP6Config

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2012 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
*/
#ifndef NM_SETTING_IP6_CONFIG_H
@ -219,24 +219,32 @@ guint32 nm_setting_ip6_config_get_num_dns (NMSettingIP
const struct in6_addr *nm_setting_ip6_config_get_dns (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_dns (NMSettingIP6Config *setting, const struct in6_addr *dns);
void nm_setting_ip6_config_remove_dns (NMSettingIP6Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip6_config_remove_dns_by_value (NMSettingIP6Config *setting, const struct in6_addr *dns);
void nm_setting_ip6_config_clear_dns (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting);
const char * nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting, const char *dns_search);
void nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_dns_searches (NMSettingIP6Config *setting);
const char * nm_setting_ip6_config_get_dns_search (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_dns_search (NMSettingIP6Config *setting, const char *dns_search);
void nm_setting_ip6_config_remove_dns_search (NMSettingIP6Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip6_config_remove_dns_search_by_value (NMSettingIP6Config *setting, const char *dns_search);
void nm_setting_ip6_config_clear_dns_searches (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting);
NMIP6Address * nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_address (NMSettingIP6Config *setting, NMIP6Address *address);
void nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i);
void nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_addresses (NMSettingIP6Config *setting);
NMIP6Address * nm_setting_ip6_config_get_address (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_address (NMSettingIP6Config *setting, NMIP6Address *address);
void nm_setting_ip6_config_remove_address (NMSettingIP6Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip6_config_remove_address_by_value (NMSettingIP6Config *setting, NMIP6Address *address);
void nm_setting_ip6_config_clear_addresses (NMSettingIP6Config *setting);
guint32 nm_setting_ip6_config_get_num_routes (NMSettingIP6Config *setting);
NMIP6Route * nm_setting_ip6_config_get_route (NMSettingIP6Config *setting, guint32 i);
gboolean nm_setting_ip6_config_add_route (NMSettingIP6Config *setting, NMIP6Route *route);
void nm_setting_ip6_config_remove_route (NMSettingIP6Config *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_ip6_config_remove_route_by_value (NMSettingIP6Config *setting, NMIP6Route *route);
void nm_setting_ip6_config_clear_routes (NMSettingIP6Config *setting);
gboolean nm_setting_ip6_config_get_ignore_auto_routes (NMSettingIP6Config *setting);

View file

@ -18,7 +18,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2011 - 2013 Red Hat, Inc.
* (C) Copyright 2011 - 2014 Red Hat, Inc.
*/
#include <stdlib.h>
@ -421,6 +421,78 @@ nm_setting_vlan_remove_priority (NMSettingVlan *setting,
set_map (setting, map, g_slist_delete_link (list, item));
}
/**
* nm_setting_vlan_remove_priority_by_value:
* @setting: the #NMSettingVlan
* @map: the type of priority map
* @from: the priority to map to @to
* @to: the priority to map @from to
*
* Removes the priority map @form:@to from the #NMSettingVlan:ingress_priority_map
* or #NMSettingVlan:egress_priority_map (according to @map argument)
* properties.
*
* Returns: %TRUE if the priority mapping was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
*/
gboolean
nm_setting_vlan_remove_priority_by_value (NMSettingVlan *setting,
NMVlanPriorityMap map,
guint32 from,
guint32 to)
{
GSList *list = NULL, *iter = NULL;
PriorityMap *item;
g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE);
g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE);
list = get_map (setting, map);
for (iter = list; iter; iter = g_slist_next (iter)) {
item = iter->data;
if (item->from == from && item->to == to) {
priority_map_free ((PriorityMap *) (iter->data));
set_map (setting, map, g_slist_delete_link (list, iter));
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_vlan_remove_priority_str_by_value:
* @setting: the #NMSettingVlan
* @map: the type of priority map
* @str: the string which contains a priority map, like "3:7"
*
* Removes the priority map @str from the #NMSettingVlan:ingress_priority_map
* or #NMSettingVlan:egress_priority_map (according to @map argument)
* properties.
*
* Returns: %TRUE if the priority mapping was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
*/
gboolean
nm_setting_vlan_remove_priority_str_by_value (NMSettingVlan *setting,
NMVlanPriorityMap map,
const char *str)
{
GSList *list;
PriorityMap *item;
g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE);
g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE);
list = get_map (setting, map);
item = priority_map_new_from_str (map, str);
if (!item)
return FALSE;
return nm_setting_vlan_remove_priority_by_value (setting, map, item->from, item->to);
}
/**
* nm_setting_vlan_clear_priorities:
* @setting: the #NMSettingVlan

View file

@ -18,7 +18,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2011 Red Hat, Inc.
* (C) Copyright 2011 - 2014 Red Hat, Inc.
*/
#ifndef NM_SETTING_VLAN_H
@ -136,6 +136,17 @@ void nm_setting_vlan_remove_priority (NMSettingVlan *setting,
NMVlanPriorityMap map,
guint32 idx);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_vlan_remove_priority_by_value (NMSettingVlan *setting,
NMVlanPriorityMap map,
guint32 from,
guint32 to);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_vlan_remove_priority_str_by_value (NMSettingVlan *setting,
NMVlanPriorityMap map,
const char *str);
void nm_setting_vlan_clear_priorities (NMSettingVlan *setting, NMVlanPriorityMap map);
gboolean nm_setting_vlan_add_priority_str (NMSettingVlan *setting,

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -297,6 +297,7 @@ nm_setting_wired_add_mac_blacklist_item (NMSettingWired *setting, const char *ma
priv->mac_address_blacklist = g_slist_append (priv->mac_address_blacklist,
g_ascii_strup (mac, -1));
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST);
return TRUE;
}
@ -323,6 +324,61 @@ nm_setting_wired_remove_mac_blacklist_item (NMSettingWired *setting, guint32 idx
g_free (elt->data);
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, elt);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST);
}
/**
* nm_setting_wired_remove_mac_blacklist_item_by_value:
* @setting: the #NMSettingWired
* @mac: the MAC address string (hex-digits-and-colons notation) to remove from
* the blacklist
*
* Removes the MAC address @mac from the blacklist.
*
* Returns: %TRUE if the MAC address was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wired_remove_mac_blacklist_item_by_value (NMSettingWired *setting, const char *mac)
{
NMSettingWiredPrivate *priv;
GSList *iter;
guint8 buf[32];
g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE);
g_return_val_if_fail (mac != NULL, FALSE);
if (!nm_utils_hwaddr_aton (mac, ARPHRD_ETHER, buf))
return FALSE;
priv = NM_SETTING_WIRED_GET_PRIVATE (setting);
for (iter = priv->mac_address_blacklist; iter; iter = g_slist_next (iter)) {
if (!strcasecmp (mac, (char *) iter->data)) {
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_wired_clear_mac_blacklist_items:
* @setting: the #NMSettingWired
*
* Removes all blacklisted MAC addresses.
*
* Since: 0.9.10
**/
void
nm_setting_wired_clear_mac_blacklist_items (NMSettingWired *setting)
{
g_return_if_fail (NM_IS_SETTING_WIRED (setting));
g_slist_free_full (NM_SETTING_WIRED_GET_PRIVATE (setting)->mac_address_blacklist, g_free);
NM_SETTING_WIRED_GET_PRIVATE (setting)->mac_address_blacklist = NULL;
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST);
}
/**

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2011 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -103,6 +103,11 @@ gboolean nm_setting_wired_add_mac_blacklist_item (NMSettingWired *
NM_AVAILABLE_IN_0_9_10
void nm_setting_wired_remove_mac_blacklist_item (NMSettingWired *setting,
guint32 idx);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_wired_remove_mac_blacklist_item_by_value (NMSettingWired *setting,
const char *mac);
NM_AVAILABLE_IN_0_9_10
void nm_setting_wired_clear_mac_blacklist_items (NMSettingWired *setting);
guint32 nm_setting_wired_get_mtu (NMSettingWired *setting);

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -256,6 +256,38 @@ nm_setting_wireless_security_remove_proto (NMSettingWirelessSecurity *setting, g
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_PROTO);
}
/**
* nm_setting_wireless_security_remove_proto_by_value:
* @setting: the #NMSettingWirelessSecurity
* @proto: the protocol to remove, one of "wpa" or "rsn"
*
* Removes a protocol from the allowed protocol list.
*
* Returns: %TRUE if the protocol was found and removed; %FALSE it it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wireless_security_remove_proto_by_value (NMSettingWirelessSecurity *setting,
const char *proto)
{
NMSettingWirelessSecurityPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE);
g_return_val_if_fail (proto != NULL, FALSE);
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->proto; iter; iter = g_slist_next (iter)) {
if (strcasecmp (proto, (char *) iter->data) == 0) {
priv->proto = g_slist_delete_link (priv->proto, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_PROTO);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_wireless_security_clear_protos:
* @setting: the #NMSettingWirelessSecurity
@ -371,6 +403,39 @@ nm_setting_wireless_security_remove_pairwise (NMSettingWirelessSecurity *setting
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
}
/**
* nm_setting_wireless_security_remove_pairwise_by_value:
* @setting: the #NMSettingWirelessSecurity
* @pairwise: the encryption algorithm to remove, one of "tkip" or "ccmp"
*
* Removes an encryption algorithm from the allowed pairwise encryption
* algorithm list.
*
* Returns: %TRUE if the encryption algorith was found and removed; %FALSE it it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wireless_security_remove_pairwise_by_value (NMSettingWirelessSecurity *setting,
const char *pairwise)
{
NMSettingWirelessSecurityPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE);
g_return_val_if_fail (pairwise != NULL, FALSE);
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->pairwise; iter; iter = g_slist_next (iter)) {
if (strcasecmp (pairwise, (char *) iter->data) == 0) {
priv->pairwise = g_slist_delete_link (priv->pairwise, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_PAIRWISE);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_wireless_security_clear_pairwise:
* @setting: the #NMSettingWirelessSecurity
@ -487,6 +552,40 @@ nm_setting_wireless_security_remove_group (NMSettingWirelessSecurity *setting, g
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_GROUP);
}
/**
* nm_setting_wireless_security_remove_group_by_value:
* @setting: the #NMSettingWirelessSecurity
* @group: the encryption algorithm to remove, one of "wep40", "wep104",
* "tkip", or "ccmp"
*
* Removes an encryption algorithm from the allowed groupwise encryption
* algorithm list.
*
* Returns: %TRUE if the algorithm was found and removed; %FALSE it it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wireless_security_remove_group_by_value (NMSettingWirelessSecurity *setting,
const char *group)
{
NMSettingWirelessSecurityPrivate *priv;
GSList *iter;
g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE);
g_return_val_if_fail (group != NULL, FALSE);
priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (setting);
for (iter = priv->group; iter; iter = g_slist_next (iter)) {
if (strcasecmp (group, (char *) iter->data) == 0) {
priv->group = g_slist_delete_link (priv->group, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_SECURITY_GROUP);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_wireless_security_clear_groups:
* @setting: the #NMSettingWirelessSecurity

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2011 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -137,23 +137,29 @@ NMSetting * nm_setting_wireless_security_new (void);
const char *nm_setting_wireless_security_get_key_mgmt (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_protos (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_proto (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_proto (NMSettingWirelessSecurity *setting, const char *proto);
void nm_setting_wireless_security_remove_proto (NMSettingWirelessSecurity *setting, guint32 i);
void nm_setting_wireless_security_clear_protos (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_protos (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_proto (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_proto (NMSettingWirelessSecurity *setting, const char *proto);
void nm_setting_wireless_security_remove_proto (NMSettingWirelessSecurity *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_wireless_security_remove_proto_by_value (NMSettingWirelessSecurity *setting, const char *proto);
void nm_setting_wireless_security_clear_protos (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_pairwise (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_pairwise (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_pairwise (NMSettingWirelessSecurity *setting, const char *pairwise);
void nm_setting_wireless_security_remove_pairwise (NMSettingWirelessSecurity *setting, guint32 i);
void nm_setting_wireless_security_clear_pairwise (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_pairwise (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_pairwise (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_pairwise (NMSettingWirelessSecurity *setting, const char *pairwise);
void nm_setting_wireless_security_remove_pairwise (NMSettingWirelessSecurity *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_wireless_security_remove_pairwise_by_value (NMSettingWirelessSecurity *setting, const char *proto);
void nm_setting_wireless_security_clear_pairwise (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_groups (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_group (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_group (NMSettingWirelessSecurity *setting, const char *group);
void nm_setting_wireless_security_remove_group (NMSettingWirelessSecurity *setting, guint32 i);
void nm_setting_wireless_security_clear_groups (NMSettingWirelessSecurity *setting);
guint32 nm_setting_wireless_security_get_num_groups (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_group (NMSettingWirelessSecurity *setting, guint32 i);
gboolean nm_setting_wireless_security_add_group (NMSettingWirelessSecurity *setting, const char *group);
void nm_setting_wireless_security_remove_group (NMSettingWirelessSecurity *setting, guint32 i);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_wireless_security_remove_group_by_value (NMSettingWirelessSecurity *setting, const char *proto);
void nm_setting_wireless_security_clear_groups (NMSettingWirelessSecurity *setting);
const char *nm_setting_wireless_security_get_psk (NMSettingWirelessSecurity *setting);
NMSettingSecretFlags nm_setting_wireless_security_get_psk_flags (NMSettingWirelessSecurity *setting);

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2013 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -533,6 +533,7 @@ nm_setting_wireless_add_mac_blacklist_item (NMSettingWireless *setting, const ch
priv->mac_address_blacklist = g_slist_append (priv->mac_address_blacklist,
g_ascii_strup (mac, -1));
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
return TRUE;
}
@ -559,6 +560,61 @@ nm_setting_wireless_remove_mac_blacklist_item (NMSettingWireless *setting, guint
g_free (elt->data);
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, elt);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
}
/**
* nm_setting_wireless_remove_mac_blacklist_item_by_value:
* @setting: the #NMSettingWireless
* @mac: the MAC address string (hex-digits-and-colons notation) to remove from
* the blacklist
*
* Removes the MAC address @mac from the blacklist.
*
* Returns: %TRUE if the MAC address was found and removed; %FALSE if it was not.
*
* Since: 0.9.10
**/
gboolean
nm_setting_wireless_remove_mac_blacklist_item_by_value (NMSettingWireless *setting, const char *mac)
{
NMSettingWirelessPrivate *priv;
GSList *iter;
guint8 buf[32];
g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
g_return_val_if_fail (mac != NULL, FALSE);
if (!nm_utils_hwaddr_aton (mac, ARPHRD_ETHER, buf))
return FALSE;
priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
for (iter = priv->mac_address_blacklist; iter; iter = g_slist_next (iter)) {
if (!strcasecmp (mac, (char *) iter->data)) {
priv->mac_address_blacklist = g_slist_delete_link (priv->mac_address_blacklist, iter);
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
return TRUE;
}
}
return FALSE;
}
/**
* nm_setting_wireless_clear_mac_blacklist_items:
* @setting: the #NMSettingWireless
*
* Removes all blacklisted MAC addresses.
*
* Since: 0.9.10
**/
void
nm_setting_wireless_clear_mac_blacklist_items (NMSettingWireless *setting)
{
g_return_if_fail (NM_IS_SETTING_WIRELESS (setting));
g_slist_free_full (NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist, g_free);
NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_blacklist = NULL;
g_object_notify (G_OBJECT (setting), NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST);
}
/**

View file

@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
* (C) Copyright 2007 - 2011 Red Hat, Inc.
* (C) Copyright 2007 - 2014 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@ -145,6 +145,11 @@ gboolean nm_setting_wireless_add_mac_blacklist_item (NMSettingWire
NM_AVAILABLE_IN_0_9_10
void nm_setting_wireless_remove_mac_blacklist_item (NMSettingWireless *setting,
guint32 idx);
NM_AVAILABLE_IN_0_9_10
gboolean nm_setting_wireless_remove_mac_blacklist_item_by_value (NMSettingWireless *setting,
const char *mac);
NM_AVAILABLE_IN_0_9_10
void nm_setting_wireless_clear_mac_blacklist_items (NMSettingWireless *setting);
guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting);
gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting);

View file

@ -21,7 +21,7 @@
.\"
.\" Copyright (C) 2010 - 2014 Red Hat, Inc.
.\"
.TH NMCLI "1" "14 January 2014"
.TH NMCLI "1" "25 February 2014"
.SH NAME
nmcli \- command\(hyline tool for controlling NetworkManager
@ -619,16 +619,30 @@ See also \fInm-settings\fP(5) for all NetworkManager settings and property names
descriptions; and \fInmcli-examples\fP(5) for sample editor sessions.
.RE
.TP
.B modify [ id | uuid | path ] <ID> <setting name>.<property name> [<value>]
.B modify [--temporary] [ id | uuid | path ] <ID> [+|-]<setting>.<property> <value>
.B [+|-]<setting>.<property> <value> ...
.br
Modify a single property in the connection.
Modify one or more properties in the connection profile.
.br
The connection is identified by its name, UUID or D-Bus path. If <ID> is
ambiguous, a keyword \fIid\fP, \fIuuid\fP or \fIpath\fP can be used.
See \fInm-settings\fP(5) for setting and property names, their descriptions
and default values. This command supports abbreviations for \fIsetting name\fP
and \fIproperty name\fP provided they are unique. When \fIvalue\fP is not
specified, the property will be set to the default value (deleted).
ambiguous, a keyword \fIid\fP, \fIuuid\fP or \fIpath\fP can be used. See
\fInm-settings\fP(5) for setting and property names, their descriptions and
default values. This command supports abbreviations for \fIsetting name\fP and
\fIproperty name\fP provided they are unique. Empty \fIvalue\fP ("") removes
the property value (sets the property to the default value). The provided
value overwrites the existing property value.
.br
If you want to append an item to the existing value, use \fI+\fP prefix for the
property name. If you want to remove just one item from container-type
property, use \fI-\fP prefix for the property name and specify a value or an
zero-based index of the item to remove (or option name for properties with
named options) as \fIvalue\fP. Of course, \fI+|-\fP only have a real effect for
multi-value (container) properties like ipv4.dns, ipv4.addresses, bond.options,
etc.
.br
The changes to the connection profile will be saved persistently by
NetworkManager, unless \fI--temporary\fP option is provided, in which case the
changes won't persist over NetworkManager restart.
.TP
.B delete [ id | uuid | path ] <ID>
.br
@ -897,6 +911,18 @@ modifies 'autoconnect' property in the 'connection' setting of 'ethernet\(hy2' c
.IP
modifies 'mtu' property in the 'wifi' setting of 'Home Wi\(hyFi' connection.
.IP "\fB\f(CWnmcli con mod em1-1 ipv4.method manual ipv4.addr \(dq\&192.168.1.23/24 192.168.1.1, 10.10.1.5/8, 10.0.0.11\(dq\&\fP\fP"
.IP
sets manual addressing and the addresses in em1-1 profile.
.IP "\fB\f(CWnmcli con modify ABC +ipv4.dns 8.8.8.8\fP\fP"
.IP
appends a Google public DNS server to DNS servers in ABC profile.
.IP "\fB\f(CWnmcli con modify ABC -ipv4.addresses \(dq\&192.168.100.25/24 192.168.1.1\(dq\&\fP\fP"
.IP
removes the specified IP address from (static) profile ABC.
.SH NOTES
\fInmcli\fP accepts abbreviations, as long as they are a unique prefix in the set
of possible options. As new options get added, these abbreviations are not guaranteed