summaryrefslogtreecommitdiff
path: root/clients/cli
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-10-22 13:48:18 -0400
committerDan Winship <danw@gnome.org>2014-11-07 07:49:40 -0500
commitd34910b12860eb080b1a519f441946cbc378f769 (patch)
tree073828d78a265eb8a50c9679b1d5e3770655c35f /clients/cli
parentf8dcb9510c11055a40fd9e42448097c2751e1f2a (diff)
downloadNetworkManager-d34910b12860eb080b1a519f441946cbc378f769.tar.gz
libnm: create NMIPConfig as parent of NMIP4Config and NMIP6Config
Create NMIPConfig as the parent of NMIP4Config and NMIP6Config, and remove the two subclasses from the public API; while it's convenient to still have both internally, they are now identical to the outside world.
Diffstat (limited to 'clients/cli')
-rw-r--r--clients/cli/common.c26
-rw-r--r--clients/cli/common.h4
-rw-r--r--clients/cli/connections.c4
-rw-r--r--clients/cli/devices.c3
4 files changed, 18 insertions, 19 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 2c56976a26..5493b166d7 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -76,7 +76,7 @@ NmcOutputField nmc_fields_dhcp6_config[] = {
gboolean
-print_ip4_config (NMIP4Config *cfg4,
+print_ip4_config (NMIPConfig *cfg4,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -103,8 +103,8 @@ print_ip4_config (NMIP4Config *cfg4,
g_ptr_array_add (nmc->output_data, arr);
/* addresses */
- ptr_array = nm_ip4_config_get_addresses (cfg4);
- gw = nm_ip4_config_get_gateway (cfg4);
+ ptr_array = nm_ip_config_get_addresses (cfg4);
+ gw = nm_ip_config_get_gateway (cfg4);
if (ptr_array) {
addr_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
@@ -119,7 +119,7 @@ print_ip4_config (NMIP4Config *cfg4,
}
/* routes */
- ptr_array = nm_ip4_config_get_routes (cfg4);
+ ptr_array = nm_ip_config_get_routes (cfg4);
if (ptr_array) {
route_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
@@ -140,13 +140,13 @@ print_ip4_config (NMIP4Config *cfg4,
}
/* DNS */
- dns_arr = g_strdupv ((char **) nm_ip4_config_get_nameservers (cfg4));
+ dns_arr = g_strdupv ((char **) nm_ip_config_get_nameservers (cfg4));
/* domains */
- domain_arr = g_strdupv ((char **) nm_ip4_config_get_domains (cfg4));
+ domain_arr = g_strdupv ((char **) nm_ip_config_get_domains (cfg4));
/* WINS */
- wins_arr = g_strdupv ((char **) nm_ip4_config_get_wins_servers (cfg4));
+ wins_arr = g_strdupv ((char **) nm_ip_config_get_wins_servers (cfg4));
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
set_val_strc (arr, 0, group_prefix);
@@ -166,7 +166,7 @@ print_ip4_config (NMIP4Config *cfg4,
}
gboolean
-print_ip6_config (NMIP6Config *cfg6,
+print_ip6_config (NMIPConfig *cfg6,
NmCli *nmc,
const char *group_prefix,
const char *one_field)
@@ -192,8 +192,8 @@ print_ip6_config (NMIP6Config *cfg6,
g_ptr_array_add (nmc->output_data, arr);
/* addresses */
- ptr_array = nm_ip6_config_get_addresses (cfg6);
- gw = nm_ip6_config_get_gateway (cfg6);
+ ptr_array = nm_ip_config_get_addresses (cfg6);
+ gw = nm_ip_config_get_gateway (cfg6);
if (ptr_array) {
addr_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
@@ -208,7 +208,7 @@ print_ip6_config (NMIP6Config *cfg6,
}
/* routes */
- ptr_array = nm_ip6_config_get_routes (cfg6);
+ ptr_array = nm_ip_config_get_routes (cfg6);
if (ptr_array) {
route_arr = g_new (char *, ptr_array->len + 1);
for (i = 0; i < ptr_array->len; i++) {
@@ -229,10 +229,10 @@ print_ip6_config (NMIP6Config *cfg6,
}
/* DNS */
- dns_arr = g_strdupv ((char **) nm_ip6_config_get_nameservers (cfg6));
+ dns_arr = g_strdupv ((char **) nm_ip_config_get_nameservers (cfg6));
/* domains */
- domain_arr = g_strdupv ((char **) nm_ip6_config_get_domains (cfg6));
+ domain_arr = g_strdupv ((char **) nm_ip_config_get_domains (cfg6));
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX);
set_val_strc (arr, 0, group_prefix);
diff --git a/clients/cli/common.h b/clients/cli/common.h
index bf881bf2f4..2787b1935b 100644
--- a/clients/cli/common.h
+++ b/clients/cli/common.h
@@ -24,8 +24,8 @@
#include "nmcli.h"
-gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
-gboolean print_ip6_config (NMIP6Config *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_ip4_config (NMIPConfig *cfg4, NmCli *nmc, const char *group_prefix, const char *one_field);
+gboolean print_ip6_config (NMIPConfig *cfg6, NmCli *nmc, const char *group_prefix, const char *one_field);
gboolean print_dhcp4_config (NMDhcp4Config *dhcp4, NmCli *nmc, const char *group_prefix, const char *one_field);
gboolean print_dhcp6_config (NMDhcp6Config *dhcp6, NmCli *nmc, const char *group_prefix, const char *one_field);
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 969adb80d0..35e88b4378 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -1128,7 +1128,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* IP4 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[1].name) == 0) {
gboolean b1 = FALSE;
- NMIP4Config *cfg4 = nm_active_connection_get_ip4_config (acon);
+ NMIPConfig *cfg4 = nm_active_connection_get_ip4_config (acon);
b1 = print_ip4_config (cfg4, nmc, "IP4", group_fld);
was_output = was_output || b1;
@@ -1146,7 +1146,7 @@ nmc_active_connection_details (NMActiveConnection *acon, NmCli *nmc)
/* IP6 */
if (strcasecmp (nmc_fields_con_active_details_groups[group_idx].name, nmc_fields_con_active_details_groups[3].name) == 0) {
gboolean b1 = FALSE;
- NMIP6Config *cfg6 = nm_active_connection_get_ip6_config (acon);
+ NMIPConfig *cfg6 = nm_active_connection_get_ip6_config (acon);
b1 = print_ip6_config (cfg6, nmc, "IP6", group_fld);
was_output = was_output || b1;
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index c073ec252b..371c05bf13 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -767,8 +767,7 @@ show_device_info (NMDevice *device, NmCli *nmc)
NmcOutputField *tmpl, *arr;
size_t tmpl_len;
gboolean was_output = FALSE;
- NMIP4Config *cfg4;
- NMIP6Config *cfg6;
+ NMIPConfig *cfg4, *cfg6;
NMDhcp4Config *dhcp4;
NMDhcp6Config *dhcp6;
const char *base_hdr = _("Device details");