From 6dcd54b0de026b997a0260eac4661ef84e3e82c6 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 1 Aug 2017 20:28:05 +0200 Subject: [PATCH] clients: add support for ovs-interface setting --- clients/cli/connections.c | 1 + clients/common/nm-meta-setting-desc.c | 23 +++++++++++++++++++++++ libnm/NetworkManager.h | 1 + shared/nm-meta-setting.c | 6 ++++++ shared/nm-meta-setting.h | 1 + 5 files changed, 32 insertions(+) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 0e618b72e6..0ece209479 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -136,6 +136,7 @@ const NmcMetaGenericInfo *const nmc_fields_con_active_details_general[] = { NM_SETTING_BRIDGE_PORT_SETTING_NAME","\ NM_SETTING_TEAM_SETTING_NAME","\ NM_SETTING_TEAM_PORT_SETTING_NAME"," \ + NM_SETTING_OVS_INTERFACE_SETTING_NAME","\ NM_SETTING_OVS_PATCH_SETTING_NAME","\ NM_SETTING_DCB_SETTING_NAME"," \ NM_SETTING_TUN_SETTING_NAME"," \ diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index cf1d82a1f1..41ee370e42 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -5803,6 +5803,18 @@ static const NMMetaPropertyInfo *const property_infos_PPPOE[] = { NULL }; +#undef _CURRENT_NM_META_SETTING_TYPE +#define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_INTERFACE +static const NMMetaPropertyInfo *const property_infos_OVS_INTERFACE[] = { + PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_INTERFACE_TYPE, + .property_type = &_pt_gobject_string, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA ( + .values_static = VALUES_STATIC ("internal", "patch"), + ), + ), + NULL +}; + #undef _CURRENT_NM_META_SETTING_TYPE #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_OVS_PATCH static const NMMetaPropertyInfo *const property_infos_OVS_PATCH[] = { @@ -6731,6 +6743,7 @@ _setting_init_fcn_wireless (ARGS_SETTING_INIT_FCN) #define SETTING_PRETTY_NAME_MACSEC N_("MACsec connection") #define SETTING_PRETTY_NAME_MACVLAN N_("macvlan connection") #define SETTING_PRETTY_NAME_OLPC_MESH N_("OLPC Mesh connection") +#define SETTING_PRETTY_NAME_OVS_INTERFACE N_("OpenVSwitch interface settings") #define SETTING_PRETTY_NAME_OVS_PATCH N_("OpenVSwitch patch interface settings") #define SETTING_PRETTY_NAME_PPP N_("PPP settings") #define SETTING_PRETTY_NAME_PPPOE N_("PPPoE") @@ -6881,6 +6894,16 @@ const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[] = { ), .setting_init_fcn = _setting_init_fcn_olpc_mesh, ), + SETTING_INFO (OVS_INTERFACE, + .valid_parts = NM_META_SETTING_VALID_PARTS ( + NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_INTERFACE, TRUE), + NM_META_SETTING_VALID_PART_ITEM (OVS_PATCH, FALSE), + NM_META_SETTING_VALID_PART_ITEM (IP4_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM (IP6_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), + ), + ), SETTING_INFO (OVS_PATCH), SETTING_INFO (PPPOE, /* PPPoE is a base connection type from historical reasons. diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h index 6aa40b6f7d..a83c3a7245 100644 --- a/libnm/NetworkManager.h +++ b/libnm/NetworkManager.h @@ -76,6 +76,7 @@ #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" #include "nm-setting-olpc-mesh.h" +#include "nm-setting-ovs-interface.h" #include "nm-setting-ovs-patch.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" diff --git a/shared/nm-meta-setting.c b/shared/nm-meta-setting.c index b44becd2d0..313d469542 100644 --- a/shared/nm-meta-setting.c +++ b/shared/nm-meta-setting.c @@ -43,6 +43,7 @@ #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" #include "nm-setting-olpc-mesh.h" +#include "nm-setting-ovs-interface.h" #include "nm-setting-ovs-patch.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" @@ -236,6 +237,11 @@ const NMMetaSettingInfo nm_meta_setting_infos[] = { .setting_name = NM_SETTING_OLPC_MESH_SETTING_NAME, .get_setting_gtype = nm_setting_olpc_mesh_get_type, }, + [NM_META_SETTING_TYPE_OVS_INTERFACE] = { + .meta_type = NM_META_SETTING_TYPE_OVS_INTERFACE, + .setting_name = NM_SETTING_OVS_INTERFACE_SETTING_NAME, + .get_setting_gtype = nm_setting_ovs_interface_get_type, + }, [NM_META_SETTING_TYPE_OVS_PATCH] = { .meta_type = NM_META_SETTING_TYPE_OVS_PATCH, .setting_name = NM_SETTING_OVS_PATCH_SETTING_NAME, diff --git a/shared/nm-meta-setting.h b/shared/nm-meta-setting.h index 6c2ba2f7a6..6b35c4acfd 100644 --- a/shared/nm-meta-setting.h +++ b/shared/nm-meta-setting.h @@ -75,6 +75,7 @@ typedef enum { NM_META_SETTING_TYPE_MACSEC, NM_META_SETTING_TYPE_MACVLAN, NM_META_SETTING_TYPE_OLPC_MESH, + NM_META_SETTING_TYPE_OVS_INTERFACE, NM_META_SETTING_TYPE_OVS_PATCH, NM_META_SETTING_TYPE_PPP, NM_META_SETTING_TYPE_PPPOE,