summary refs log tree commit diff
path: root/clients/cli
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-05-11 17:08:25 +0200
committerMichael Biebl <biebl@debian.org>2016-05-11 17:08:25 +0200
commit73e152af6e3fb4f5848bfb8394484026ff119003 (patch)
treed5a8b37778d3a95c51511451b38b6a329b94cb41 /clients/cli
parent78c3b8801ecf4975e5da1af3b10ae20dd2d876de (diff)
Imported Upstream version 1.2.2 upstream/1.2.2
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/agent.c3
-rw-r--r--clients/cli/common.c4
-rw-r--r--clients/cli/connections.c15
-rw-r--r--clients/cli/devices.c98
-rw-r--r--clients/cli/general.c3
-rw-r--r--clients/cli/nmcli-completion7
-rw-r--r--clients/cli/nmcli.c4
-rw-r--r--clients/cli/nmcli.h6
-rw-r--r--clients/cli/settings-docs.c2
-rw-r--r--clients/cli/settings.c7
-rw-r--r--clients/cli/utils.c116
-rw-r--r--clients/cli/utils.h4
12 files changed, 50 insertions, 219 deletions
diff --git a/clients/cli/agent.c b/clients/cli/agent.c
index 0e39ba97..b8a56d23 100644
--- a/clients/cli/agent.c
+++ b/clients/cli/agent.c
@@ -207,9 +207,6 @@ do_agent (NmCli *nmc, int argc, char **argv)
 		nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
 		return nmc->return_value;
 	}
-	/* Compare NM and nmcli versions */
-	if (!nmc_versions_match (nmc))
-		return nmc->return_value;
 
 	if (argc == 0) {
 		nmc->return_value = do_agent_all (nmc, 0, NULL);
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 0aa5efc2..0888f063 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -1170,10 +1170,6 @@ nmc_set_in_readline (gboolean in_readline)
 	pthread_mutex_unlock (&readline_mutex);
 }
 
-/* Global variable defined in nmcli.c */
-extern NmCli nm_cli;
-
-
 static char *
 nmc_readline_helper (const char *prompt)
 {
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 3fca37f5..1f1dae59 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -261,9 +261,6 @@ typedef struct {
 } TabCompletionInfo;
 static TabCompletionInfo nmc_tab_completion = {NULL, NULL, NULL, NULL};
 
-/* Global variable defined in nmcli.c - used for TAB completion */
-extern NmCli nm_cli;
-
 static char *gen_connection_types (const char *text, int state);
 
 static void
@@ -1970,12 +1967,19 @@ device_state_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
 		         nm_object_get_path (NM_OBJECT (active)));
 		quit ();
 	} else if (   ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
-	           && state >= NM_DEVICE_STATE_IP_CONFIG) {
+	           && state >= NM_DEVICE_STATE_IP_CONFIG
+	           && state <= NM_DEVICE_STATE_ACTIVATED) {
 		if (nmc->print_output == NMC_PRINT_PRETTY)
 			nmc_terminal_erase_line ();
 		g_print (_("Connection successfully activated (master waiting for slaves) (D-Bus active path: %s)\n"),
 		         nm_object_get_path (NM_OBJECT (active)));
 		quit ();
+	} else if (   ac_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
+	           && state == NM_DEVICE_STATE_FAILED) {
+		if (nmc->print_output == NMC_PRINT_PRETTY)
+			nmc_terminal_erase_line ();
+		g_print (_("Error: Connection activation failed."));
+		quit ();
 	} else if (active && ac_state != NM_ACTIVE_CONNECTION_STATE_ACTIVATING) {
 		g_string_printf (nmc->return_text, _("Error: Connection activation failed."));
 		nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION;
@@ -11051,9 +11055,6 @@ do_connections (NmCli *nmc, int argc, char **argv)
 		nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
 		return nmc->return_value;
 	}
-	/* Compare NM and nmcli versions */
-	if (!nmc_versions_match (nmc))
-		return nmc->return_value;
 
 	/* Get the connection list */
 	nmc->connections = nm_client_get_connections (nmc->client);
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 449fa7db..65c4be72 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -286,7 +286,7 @@ usage (void)
 	              "  show [<ifname>]\n\n"
 	              "  set [ifname] <ifname> [autoconnect yes|no] [managed yes|no]\n\n"
 	              "  connect <ifname>\n\n"
-	              "  reapply <ifname> ...\n\n"
+	              "  reapply <ifname>\n\n"
 	              "  disconnect <ifname> ...\n\n"
 	              "  delete <ifname> ...\n\n"
 	              "  monitor <ifname> ...\n\n"
@@ -342,7 +342,7 @@ usage_device_reapply (void)
 {
 	g_printerr (_("Usage: nmcli device reapply { ARGUMENTS | help }\n"
 	              "\n"
-	              "ARGUMENTS := <ifname> ...\n"
+	              "ARGUMENTS := <ifname>\n"
 	              "\n"
 	              "Attempts to update device with changes to the currently active connection\n"
                       "made since it was last applied.\n\n"));
@@ -1835,11 +1835,10 @@ reapply_device_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 	GError *error = NULL;
 
 	if (!nm_device_reapply_finish (device, result, &error)) {
-		g_string_printf (nmc->return_text, _("Error: not all connections reapplied."));
-		g_printerr (_("Error: Reapplying connection to device '%s' (%s) failed: %s\n"),
-		            nm_device_get_iface (device),
-		            nm_object_get_path (NM_OBJECT (device)),
-		            error->message);
+		g_string_printf (nmc->return_text, _("Error: Reapplying connection to device '%s' (%s) failed: %s"),
+		                 nm_device_get_iface (device),
+		                 nm_object_get_path (NM_OBJECT (device)),
+		                 error->message);
 		g_error_free (error);
 		nmc->return_value = NMC_RESULT_ERROR_DEV_DISCONNECT;
 		device_cb_info_finish (info, device);
@@ -1847,7 +1846,7 @@ reapply_device_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 		if (nmc->print_output == NMC_PRINT_PRETTY)
 			nmc_terminal_erase_line ();
 		g_print (_("Connection successfully reapplied to device '%s'.\n"),
-			 nm_device_get_iface (device));
+		         nm_device_get_iface (device));
 		device_cb_info_finish (info, device);
 	}
 }
@@ -1855,14 +1854,14 @@ reapply_device_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 static NMCResultCode
 do_device_reapply (NmCli *nmc, int argc, char **argv)
 {
-	NMDevice **devices;
-	NMDevice *device;
+	gs_free NMDevice **devices = NULL;
+	NMDevice *device = NULL;
 	DeviceCbInfo *info = NULL;
-	GSList *queue = NULL, *iter;
-	char **arg_arr = NULL;
 	char **arg_ptr = argv;
 	int arg_num = argc;
 	int i;
+	gs_free char *device_name_free = NULL;
+	const char *device_name = NULL;
 
 	/* Set default timeout for reapply operation. */
 	if (nmc->timeout == -1)
@@ -1870,69 +1869,48 @@ do_device_reapply (NmCli *nmc, int argc, char **argv)
 
 	if (argc == 0) {
 		if (nmc->ask) {
-			char *line = nmc_readline (PROMPT_INTERFACES);
-			nmc_string_to_arg_array (line, NULL, FALSE, &arg_arr, &arg_num);
-			g_free (line);
-			arg_ptr = arg_arr;
+			device_name_free = nmc_readline (PROMPT_INTERFACE);
+			device_name = device_name_free;
 		}
-		if (arg_num == 0) {
+		if (!device_name) {
 			g_string_printf (nmc->return_text, _("Error: No interface specified."));
 			nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
-			goto error;
+			return nmc->return_value;
 		}
+	} else if (argc == 1) {
+		device_name = arg_ptr[0];
+		next_arg (&arg_num, &arg_ptr);
+	} else {
+		next_arg (&arg_num, &arg_ptr);
+		g_string_printf (nmc->return_text, _("Error: unsupported argument '%s'."), *arg_ptr);
+		nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+		return nmc->return_value;
 	}
 
 	devices = get_devices_sorted (nmc->client);
-	while (arg_num > 0) {
-		device = NULL;
-		for (i = 0; devices[i]; i++) {
-			if (!g_strcmp0 (nm_device_get_iface (devices[i]), *arg_ptr)) {
-				device = devices[i];
-				break;
-			}
-		}
-
-		if (device) {
-			if (!g_slist_find (queue, device))
-				queue = g_slist_prepend (queue, device);
-			else
-				g_printerr (_("Warning: argument '%s' is duplicated.\n"), *arg_ptr);
-		} else {
-			g_printerr (_("Error: Device '%s' not found.\n"), *arg_ptr);
-			g_string_printf (nmc->return_text, _("Error: not all devices found."));
-			nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
+	for (i = 0; devices[i]; i++) {
+		if (!g_strcmp0 (nm_device_get_iface (devices[i]), device_name)) {
+			device = devices[i];
+			break;
 		}
-
-		/* Take next argument */
-		next_arg (&arg_num, &arg_ptr);
 	}
-	g_free (devices);
 
-	if (!queue) {
-		g_string_printf (nmc->return_text, _("Error: no valid device provided."));
+	if (!device) {
+		g_string_printf (nmc->return_text, _("Error: device '%s' not found."), device_name);
 		nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND;
-		goto error;
+		return nmc->return_value;
 	}
-	queue = g_slist_reverse (queue);
-
-	info = g_slice_new0 (DeviceCbInfo);
-	info->nmc = nmc;
 
 	nmc->nowait_flag = (nmc->timeout == 0);
 	nmc->should_wait = TRUE;
 
-	for (iter = queue; iter; iter = g_slist_next (iter)) {
-		device = iter->data;
-
-		info->queue = g_slist_prepend (info->queue, g_object_ref (device));
+	info = g_slice_new0 (DeviceCbInfo);
+	info->nmc = nmc;
+	info->queue = g_slist_prepend (info->queue, g_object_ref (device));
 
-		/* Now reapply the connection to the device */
-		nm_device_reapply_async (device, NULL, 0, 0, NULL, reapply_device_cb, info);
-	}
+	/* Now reapply the connection to the device */
+	nm_device_reapply_async (device, NULL, 0, 0, NULL, reapply_device_cb, info);
 
-error:
-	g_strfreev (arg_arr);
-	g_slist_free (queue);
 	return nmc->return_value;
 }
 
@@ -3594,9 +3572,6 @@ is_single_word (const char* line)
 		return FALSE;
 }
 
-/* Global variable defined in nmcli.c */
-extern NmCli nm_cli;
-
 static char *
 gen_func_ifnames (const char *text, int state)
 {
@@ -3670,9 +3645,6 @@ do_devices (NmCli *nmc, int argc, char **argv)
 		nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
 		return nmc->return_value;
 	}
-	/* Compare NM and nmcli versions */
-	if (!nmc_versions_match (nmc))
-		return nmc->return_value;
 
 	if (argc == 0) {
 		if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error))
diff --git a/clients/cli/general.c b/clients/cli/general.c
index 15e73e28..0704688f 100644
--- a/clients/cli/general.c
+++ b/clients/cli/general.c
@@ -345,9 +345,6 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl
 		return FALSE;
 	}
 
-	if (!nmc_versions_match (nmc))
-		return FALSE;
-
 	state = nm_client_get_state (nmc->client);
 	startup = nm_client_get_startup (nmc->client);
 	connectivity = nm_client_get_connectivity (nmc->client);
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion
index 7f79180f..3c87f6f9 100644
--- a/clients/cli/nmcli-completion
+++ b/clients/cli/nmcli-completion
@@ -178,9 +178,6 @@ _nmcli_compl_OPTIONS()
             pretty)
                 _nmcli_array_delete_at words 0
                 ;;
-            nocheck)
-                _nmcli_array_delete_at words 0
-                ;;
             ask)
                 _nmcli_array_delete_at words 0
                 ;;
@@ -804,7 +801,7 @@ _nmcli()
     local COMMAND_CONNECTION_ACTIVE=""
 
     HELP_ONLY_AS_FIRST=
-    local LONG_OPTIONS=(terse pretty mode fields colors escape nocheck ask show-secrets wait version help)
+    local LONG_OPTIONS=(terse pretty mode fields colors escape ask show-secrets wait version help)
     _nmcli_compl_OPTIONS
     i=$?
 
@@ -1428,12 +1425,12 @@ _nmcli()
                         fi
                         ;;
                     sh|sho|show| \
+                    r|re|rea|reap|reapp|reappl|reapply| \
                     c|co|con|conn|conne|connec|connect)
                         if [[ ${#words[@]} -eq 3 ]]; then
                             _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
                         fi
                         ;;
-                    r|re|rea|reap|reapp|reappl|reapply| \
                     d|di|dis|disc|disco|discon|disconn|disconne|disconnec|disconnect| \
                     de|del|dele|delet|delete| \
                     m|mo|mon|moni|monit|monito|monitor)
diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c
index a7f21161..7e788654 100644
--- a/clients/cli/nmcli.c
+++ b/clients/cli/nmcli.c
@@ -89,7 +89,6 @@ usage (const char *prog_name)
 	              "  -c[olors] auto|yes|no                      whether to use colors in output\n"
 	              "  -f[ields] <field1,field2,...>|all|common   specify fields to output\n"
 	              "  -e[scape] yes|no                           escape columns separators in values\n"
-	              "  -n[ocheck]                                 don't check nmcli and NetworkManager versions\n"
 	              "  -a[sk]                                     ask for missing parameters\n"
 	              "  -s[how-secrets]                            allow displaying passwords\n"
 	              "  -w[ait] <seconds>                          set timeout waiting for finishing operations\n"
@@ -254,7 +253,7 @@ parse_command_line (NmCli *nmc, int argc, char **argv)
 			}
 			nmc->required_fields = g_strdup (argv[1]);
 		} else if (matches (opt, "-nocheck") == 0) {
-			nmc->nocheck_ver = TRUE;
+			/* ignore for backward compatibility */
 		} else if (matches (opt, "-ask") == 0) {
 			nmc->ask = TRUE;
 		} else if (matches (opt, "-show-secrets") == 0) {
@@ -545,7 +544,6 @@ nmc_init (NmCli *nmc)
 	nmc->required_fields = NULL;
 	nmc->output_data = g_ptr_array_new_full (20, g_free);
 	memset (&nmc->print_fields, '\0', sizeof (NmcPrintFields));
-	nmc->nocheck_ver = FALSE;
 	nmc->ask = FALSE;
 	nmc->show_secrets = FALSE;
 	nmc->use_colors = NMC_USE_COLOR_AUTO;
diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h
index 1b9a08b8..34100f00 100644
--- a/clients/cli/nmcli.h
+++ b/clients/cli/nmcli.h
@@ -59,7 +59,7 @@ typedef enum {
 	/* NetworkManager is not running */
 	NMC_RESULT_ERROR_NM_NOT_RUNNING = 8,
 
-	/* nmcli and NetworkManager versions mismatch */
+	/* No more used, keep to preserve API */
 	NMC_RESULT_ERROR_VERSIONS_MISMATCH = 9,
 
 	/* Connection/Device/AP not found */
@@ -152,7 +152,6 @@ typedef struct _NmCli {
 	char *required_fields;                            /* Required fields in output: '--fields' option */
 	GPtrArray *output_data;                           /* GPtrArray of arrays of NmcOutputField structs - accumulates data for output */
 	NmcPrintFields print_fields;                      /* Structure with field indices to print */
-	gboolean nocheck_ver;                             /* Don't check nmcli and NM versions: option '--nocheck' */
 	gboolean ask;                                     /* Ask for missing parameters: option '--ask' */
 	gboolean show_secrets;                            /* Whether to display secrets (both input and output): option '--show-secrets' */
 	gboolean in_editor;                               /* Whether running the editor - nmcli con edit' */
@@ -162,6 +161,8 @@ typedef struct _NmCli {
 	NmcTermColor editor_prompt_color;                 /* Color of prompt in connection editor */
 } NmCli;
 
+extern NmCli nm_cli;
+
 /* Error quark for GError domain */
 #define NMCLI_ERROR (nmcli_error_quark ())
 GQuark nmcli_error_quark (void);
@@ -170,5 +171,4 @@ gboolean nmc_seen_sigint (void);
 void     nmc_clear_sigint (void);
 void     nmc_set_sigquit_internal (void);
 
-
 #endif /* NMC_NMCLI_H */
diff --git a/clients/cli/settings-docs.c b/clients/cli/settings-docs.c
index 0f882c9b..f4fb6a15 100644
--- a/clients/cli/settings-docs.c
+++ b/clients/cli/settings-docs.c
@@ -264,7 +264,7 @@ NmcPropertyDesc setting_ipv4[] = {
 };
   
 NmcPropertyDesc setting_ipv6[] = {
-	{ "addr-gen-mode", "Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: \"eui64\", \"stable-privacy\" or unset. If the property is set to \"eui64\", the addresses will be generated using the interface tokens derived from  hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of \"stable-privacy\" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. Leaving this unset causes a default that could be subject to change in future versions to be used. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option." },
+	{ "addr-gen-mode", "Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: \"eui64\", or \"stable-privacy\". If the property is set to \"eui64\", the addresses will be generated using the interface tokens derived from  hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of \"stable-privacy\" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. On D-Bus, the absence of an addr-gen-mode setting equals enabling \"stable-privacy\". For keyfile plugin, the absence of the setting on disk means \"eui64\" so that the property doesn't change on upgrade from older versions. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option." },
 	{ "addresses", "Array of IP addresses." },
 	{ "dad-timeout", "Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network.  If an address conflict is detected, the activation will fail.  A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or 3 seconds).  A value greater than zero is a timeout in milliseconds." },
 	{ "dhcp-hostname", "If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time." },
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index 06e9fb47..1651aab2 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -2082,13 +2082,6 @@ typedef struct {
 	NmcPropertyFuncsFields
 } NmcPropertyFuncs;
 
-/*
- * We need NmCli in some _set_property functions, and they aren't passed NmCli.
- * So use the global variable.
- */
-/* Global variable defined in nmcli.c */
-extern NmCli nm_cli;
-
 NMSetting *
 nmc_setting_new_for_name (const char *name)
 {
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index d05ea285..a406eee4 100644
--- a/clients/cli/utils.c
+++ b/clients/cli/utils.c
@@ -182,60 +182,6 @@ ssid_to_hex (const char *str, gsize len)
 }
 
 /*
- * Converts IPv4 address from guint32 in network-byte order to text representation.
- * Returns: text form of the IP or NULL (then error is set)
- */
-char *
-nmc_ip4_address_as_string (guint32 ip, GError **error)
-{
-	guint32 tmp_addr;
-	char buf[INET_ADDRSTRLEN];
-
-	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-	memset (&buf, '\0', sizeof (buf));
-	tmp_addr = ip;
-
-	if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) {
-		return g_strdup (buf);
-	} else {
-		g_set_error (error, NMCLI_ERROR, 0, _("Error converting IP4 address '0x%X' to text form"),
-		             ntohl (tmp_addr));
-		return NULL;
-	}
-}
-
-/*
- * Converts IPv6 address in in6_addr structure to text representation.
- * Returns: text form of the IP or NULL (then error is set)
- */
-char *
-nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error)
-{
-	char buf[INET6_ADDRSTRLEN];
-
-	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-	memset (&buf, '\0', sizeof (buf));
-
-	if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) {
-		return g_strdup (buf);
-	} else {
-		if (error) {
-			int j;
-			GString *ip6_str = g_string_new (NULL);
-			g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]);
-			for (j = 1; j < 16; j++)
-				g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]);
-			g_set_error (error, NMCLI_ERROR, 0, _("Error converting IP6 address '%s' to text form"),
-			             ip6_str->str);
-			g_string_free (ip6_str, TRUE);
-		}
-		return NULL;
-	}
-}
-
-/*
  * Erase terminal line using ANSI escape sequences.
  * It prints <ESC>[2K sequence to erase the line and then \r to return back
  * to the beginning of the line.
@@ -707,23 +653,6 @@ finish:
 }
 
 /*
- * Convert string array (char **) to GSList.
- *
- * Returns: pointer to newly created GSList. Caller should free it.
- */
-GSList *
-nmc_util_strv_to_slist (char **strv)
-{
-	GSList *list = NULL;
-	guint i = 0;
-
-	while (strv && strv[i])
-		list = g_slist_prepend (list, g_strdup (strv[i++]));
-
-	return g_slist_reverse (list);
-}
-
-/*
  * Convert string array (char **) to description string in the form of:
  * "[string1, string2, ]"
  *
@@ -1359,48 +1288,3 @@ print_data (NmCli *nmc)
 	}
 }
 
-/*
-* Compare versions of nmcli and NM daemon.
-* Return: TRUE  - the versions match (when only major and minor match, print a warning)
-*         FALSE - versions mismatch
-*/
-gboolean
-nmc_versions_match (NmCli *nmc)
-{
-	const char *nm_ver = NULL;
-	const char *dot;
-	gboolean match = FALSE;
-
-	g_return_val_if_fail (nmc != NULL, FALSE);
-
-	/* --nocheck option - don't compare the versions */
-	if (nmc->nocheck_ver)
-		return TRUE;
-
-	nmc->get_client (nmc);
-	nm_ver = nm_client_get_version (nmc->client);
-	if (nm_ver) {
-		if (!strcmp (nm_ver, VERSION))
-			match = TRUE;
-		else {
-			dot = strchr (nm_ver, '.');
-			if (dot) {
-				dot = strchr (dot + 1, '.');
-				if (dot && !strncmp (nm_ver, VERSION, dot-nm_ver)) {
-					g_printerr (_("Warning: nmcli (%s) and NetworkManager (%s) versions don't match. Use --nocheck to suppress the warning.\n"),
-					            VERSION, nm_ver);
-					match = TRUE;
-				}
-			}
-		}
-	}
-
-	if (!match) {
-		g_string_printf (nmc->return_text, _("Error: nmcli (%s) and NetworkManager (%s) versions don't match. Force execution using --nocheck, but the results are unpredictable."),
-		                 VERSION, nm_ver ? nm_ver : _("unknown"));
-		nmc->return_value = NMC_RESULT_ERROR_VERSIONS_MISMATCH;
-	}
-
-	return match;
-}
-
diff --git a/clients/cli/utils.h b/clients/cli/utils.h
index 8047fe7f..eab60d3a 100644
--- a/clients/cli/utils.h
+++ b/clients/cli/utils.h
@@ -69,8 +69,6 @@ gboolean nmc_string_to_uint (const char *str,
                              unsigned long int *value);
 gboolean nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error);
 gboolean nmc_string_to_tristate (const char *str, NMCTriStateValue *val, GError **error);
-char *nmc_ip4_address_as_string (guint32 ip, GError **error);
-char *nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error);
 void nmc_terminal_erase_line (void);
 void nmc_terminal_show_progress (const char *str);
 const char *nmc_term_color_sequence (NmcTermColor color);
@@ -83,7 +81,6 @@ char *nmc_get_user_input (const char *ask_str);
 int nmc_string_to_arg_array (const char *line, const char *delim, gboolean unquote,
                              char ***argv, int *argc);
 const char *nmc_string_is_valid (const char *input, const char **allowed, GError **error);
-GSList *nmc_util_strv_to_slist (char **strv);
 char * nmc_util_strv_for_display (const char **strv, gboolean brackets);
 char **nmc_strsplit_set (const char *str, const char *delimiter, int max_tokens);
 int nmc_string_screen_width (const char *start, const char *end);
@@ -105,6 +102,5 @@ NmcOutputField *nmc_dup_fields_array (NmcOutputField fields[], size_t size, guin
 void nmc_empty_output_fields (NmCli *nmc);
 void print_required_fields (NmCli *nmc, const NmcOutputField field_values[]);
 void print_data (NmCli *nmc);
-gboolean nmc_versions_match (NmCli *nmc);
 
 #endif /* NMC_UTILS_H */