diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-02-01 15:19:29 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-02-22 21:05:04 +0100 |
commit | 4db7890faee9028b90f0d27dc7e1b3ed1c71382c (patch) | |
tree | 83730e825e87b28ecbb5562fb62677c4fc6a3d2d | |
parent | b42f780e045c69e6b2c350dcd6de760c673a78e0 (diff) | |
download | NetworkManager-4db7890faee9028b90f0d27dc7e1b3ed1c71382c.tar.gz |
cli: support dummy connections
-rw-r--r-- | clients/cli/connections.c | 10 | ||||
-rw-r--r-- | clients/cli/settings.c | 7 | ||||
-rw-r--r-- | clients/cli/settings.h | 1 | ||||
-rw-r--r-- | libnm/nm-object.c | 2 | ||||
-rw-r--r-- | man/nmcli.xml | 1 |
5 files changed, 20 insertions, 1 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 2b87b32b6f..fd2b7e7232 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -183,6 +183,7 @@ NmcOutputField nmc_fields_settings_names[] = { SETTING_FIELD (NM_SETTING_MACVLAN_SETTING_NAME, nmc_fields_setting_macvlan + 1), /* 28 */ SETTING_FIELD (NM_SETTING_VXLAN_SETTING_NAME, nmc_fields_setting_vxlan + 1), /* 29 */ SETTING_FIELD (NM_SETTING_PROXY_SETTING_NAME, nmc_fields_setting_proxy + 1), /* 30 */ + SETTING_FIELD (NM_SETTING_DUMMY_SETTING_NAME, nmc_fields_setting_dummy + 1), /* 31 */ {NULL, NULL, 0, NULL, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTINGS_NAMES_ALL_X NM_SETTING_CONNECTION_SETTING_NAME","\ @@ -477,6 +478,7 @@ usage_connection_add (void) " [source-port-min <0-65535>]\n" " [source-port-max <0-65535>]\n" " [destination-port <0-65535>]\n\n" + " dummy: \n\n" " SLAVE_OPTIONS:\n" " bridge: [priority <0-63>]\n" " [path-cost <1-65535>]\n" @@ -3071,6 +3073,13 @@ static const NameItem nmc_vxlan_settings [] = { { NULL, NULL, NULL, FALSE } }; +static const NameItem nmc_dummy_settings [] = { + { NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_DUMMY_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_WIRED_SETTING_NAME, "ethernet", NULL, FALSE }, + { NULL, NULL, NULL, FALSE } +}; + /* Available connection types */ static const NameItem nmc_valid_connection_types[] = { { NM_SETTING_GENERIC_SETTING_NAME, NULL, nmc_generic_settings }, /* Needs to be first. */ @@ -3098,6 +3107,7 @@ static const NameItem nmc_valid_connection_types[] = { { NM_SETTING_MACSEC_SETTING_NAME, NULL, nmc_macsec_settings }, { NM_SETTING_MACVLAN_SETTING_NAME, NULL, nmc_macvlan_settings }, { NM_SETTING_VXLAN_SETTING_NAME, NULL, nmc_vxlan_settings }, + { NM_SETTING_DUMMY_SETTING_NAME, NULL, nmc_dummy_settings }, { NULL, NULL, NULL } }; diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 3d3760dc62..047e50f616 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.c @@ -717,6 +717,13 @@ NmcOutputField nmc_fields_setting_dcb[] = { NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH","\ NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS +/* Available fields for NM_SETTING_DUMMY_SETTING_NAME */ +NmcOutputField nmc_fields_setting_dummy[] = { + SETTING_FIELD ("name"), /* 0 */ + {NULL, NULL, 0, NULL, FALSE, FALSE, 0} +}; +#define NMC_FIELDS_SETTING_DUMMY_ALL "name" + /* Available fields for NM_SETTING_TUN_SETTING_NAME */ NmcOutputField nmc_fields_setting_tun[] = { SETTING_FIELD ("name"), /* 0 */ diff --git a/clients/cli/settings.h b/clients/cli/settings.h index ad503f9ef6..f663aa46d4 100644 --- a/clients/cli/settings.h +++ b/clients/cli/settings.h @@ -95,5 +95,6 @@ extern NmcOutputField nmc_fields_setting_macvlan[]; extern NmcOutputField nmc_fields_setting_macsec[]; extern NmcOutputField nmc_fields_setting_vxlan[]; extern NmcOutputField nmc_fields_setting_proxy[]; +extern NmcOutputField nmc_fields_setting_dummy[]; #endif /* NMC_SETTINGS_H */ diff --git a/libnm/nm-object.c b/libnm/nm-object.c index 0d85b6a3ed..1e8d83eb02 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -1054,7 +1054,7 @@ init_if (GDBusInterface *interface, gpointer user_data) props = g_dbus_proxy_get_cached_property_names (proxy); - for (prop = props; *prop; prop++) { + for (prop = props; prop && *prop; prop++) { val = g_dbus_proxy_get_cached_property (proxy, *prop); str = g_variant_print (val, TRUE); handle_property_changed (self, *prop, val); diff --git a/man/nmcli.xml b/man/nmcli.xml index d7610c8cce..a2d9223c3f 100644 --- a/man/nmcli.xml +++ b/man/nmcli.xml @@ -925,6 +925,7 @@ <listitem><para><literal>ip-tunnel</literal></para></listitem> <listitem><para><literal>macvlan</literal></para></listitem> <listitem><para><literal>vxlan</literal></para></listitem> + <listitem><para><literal>dummy</literal></para></listitem> </itemizedlist> <para>The most typical uses are described in the <link linkend='examples' endterm='examples.title' /> section.</para> |