Blame libnm-core/nm-setting-ovs-interface.c

Packit Service a1bd4f
/* SPDX-License-Identifier: LGPL-2.1+ */
Packit 5756e2
/*
Packit 5756e2
 * Copyright (C) 2017 Red Hat, Inc.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
#include "nm-default.h"
Packit 5756e2
Packit 5756e2
#include "nm-setting-ovs-interface.h"
Packit 5756e2
Packit 5756e2
#include "nm-connection-private.h"
Packit 5756e2
#include "nm-setting-connection.h"
Packit 5756e2
#include "nm-setting-private.h"
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * SECTION:nm-setting-ovs-interface
Packit 5756e2
 * @short_description: Describes connection properties for Open vSwitch interfaces.
Packit 5756e2
 *
Packit 5756e2
 * The #NMSettingOvsInterface object is a #NMSetting subclass that describes properties
Packit 5756e2
 * necessary for Open vSwitch interfaces.
Packit 5756e2
 **/
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit Service a1bd4f
NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_TYPE, );
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMSettingOvsInterface:
Packit 5756e2
 *
Packit 5756e2
 * Open vSwitch Interface Settings
Packit 5756e2
 */
Packit 5756e2
struct _NMSettingOvsInterface {
Packit Service a1bd4f
    NMSetting parent;
Packit 5756e2
Packit Service a1bd4f
    char *type;
Packit 5756e2
};
Packit 5756e2
Packit 5756e2
struct _NMSettingOvsInterfaceClass {
Packit Service a1bd4f
    NMSettingClass parent;
Packit 5756e2
};
Packit 5756e2
Packit Service a1bd4f
G_DEFINE_TYPE(NMSettingOvsInterface, nm_setting_ovs_interface, NM_TYPE_SETTING)
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * nm_setting_ovs_interface_get_interface_type:
Packit 5756e2
 * @self: the #NMSettingOvsInterface
Packit 5756e2
 *
Packit 5756e2
 * Returns: the #NMSettingOvsInterface:type property of the setting
Packit 5756e2
 *
Packit 5756e2
 * Since: 1.10
Packit 5756e2
 **/
Packit 5756e2
const char *
Packit Service a1bd4f
nm_setting_ovs_interface_get_interface_type(NMSettingOvsInterface *self)
Packit 5756e2
{
Packit Service a1bd4f
    g_return_val_if_fail(NM_IS_SETTING_OVS_INTERFACE(self), NULL);
Packit 5756e2
Packit Service a1bd4f
    return self->type;
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
int
Packit Service a1bd4f
_nm_setting_ovs_interface_verify_interface_type(NMSettingOvsInterface *self,
Packit Service a1bd4f
                                                const char *           type,
Packit Service a1bd4f
                                                NMConnection *         connection,
Packit Service a1bd4f
                                                gboolean               normalize,
Packit Service a1bd4f
                                                gboolean *             out_modified,
Packit Service a1bd4f
                                                const char **          out_normalized_type,
Packit Service a1bd4f
                                                GError **              error)
Packit 5756e2
{
Packit Service a1bd4f
    const char *type_from_setting = NULL;
Packit Service a1bd4f
    const char *type_setting      = NULL;
Packit Service a1bd4f
    const char *connection_type;
Packit Service a1bd4f
    gboolean    is_ovs_connection_type;
Packit Service a1bd4f
Packit Service a1bd4f
    if (normalize) {
Packit Service a1bd4f
        g_return_val_if_fail(NM_IS_SETTING_OVS_INTERFACE(self), FALSE);
Packit Service a1bd4f
        g_return_val_if_fail(NM_IS_CONNECTION(connection), FALSE);
Packit Service a1bd4f
        nm_assert(self == nm_connection_get_setting_ovs_interface(connection));
Packit Service a1bd4f
    } else {
Packit Service a1bd4f
        g_return_val_if_fail(!self || NM_IS_SETTING_OVS_INTERFACE(self), FALSE);
Packit Service a1bd4f
        g_return_val_if_fail(!connection || NM_IS_CONNECTION(connection), FALSE);
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    NM_SET_OUT(out_modified, FALSE);
Packit Service a1bd4f
    NM_SET_OUT(out_normalized_type, NULL);
Packit Service a1bd4f
Packit Service a1bd4f
    if (type && !NM_IN_STRSET(type, "internal", "system", "patch", "dpdk")) {
Packit Service a1bd4f
        g_set_error(error,
Packit Service a1bd4f
                    NM_CONNECTION_ERROR,
Packit Service a1bd4f
                    NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                    _("'%s' is not a valid interface type"),
Packit Service a1bd4f
                    type);
Packit Service a1bd4f
        g_prefix_error(error,
Packit Service a1bd4f
                       "%s.%s: ",
Packit Service a1bd4f
                       NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                       NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
        return FALSE;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (!connection) {
Packit Service a1bd4f
        NM_SET_OUT(out_normalized_type, type);
Packit Service a1bd4f
        return TRUE;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    connection_type = nm_connection_get_connection_type(connection);
Packit Service a1bd4f
    if (!connection_type) {
Packit Service a1bd4f
        /* if we have an ovs-interface, then the connection type must be either
Packit Service a1bd4f
         * "ovs-interface" (for non "system" type) or anything else (for "system" type).
Packit Service a1bd4f
         *
Packit Service a1bd4f
         * The connection type usually can be normalized based on the presence of a
Packit Service a1bd4f
         * base setting. However, in this case, if the connection type is missing,
Packit Service a1bd4f
         * that is too complicate to guess what the user wanted.
Packit Service a1bd4f
         *
Packit Service a1bd4f
         * Require the use to be explicit and fail. */
Packit Service a1bd4f
        g_set_error(error,
Packit Service a1bd4f
                    NM_CONNECTION_ERROR,
Packit Service a1bd4f
                    NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                    _("A connection with a '%s' setting needs connection.type explicitly set"),
Packit Service a1bd4f
                    NM_SETTING_OVS_INTERFACE_SETTING_NAME);
Packit Service a1bd4f
        g_prefix_error(error,
Packit Service a1bd4f
                       "%s.%s: ",
Packit Service a1bd4f
                       NM_SETTING_CONNECTION_SETTING_NAME,
Packit Service a1bd4f
                       NM_SETTING_CONNECTION_TYPE);
Packit Service a1bd4f
        return FALSE;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (nm_streq(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME)) {
Packit Service a1bd4f
        if (type && nm_streq(type, "system")) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection of type '%s' cannot have ovs-interface.type \"system\""),
Packit Service a1bd4f
                        NM_SETTING_OVS_INTERFACE_SETTING_NAME);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
        is_ovs_connection_type = TRUE;
Packit Service a1bd4f
    } else {
Packit Service a1bd4f
        if (type && !nm_streq(type, "system")) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection of type '%s' cannot have an ovs-interface.type \"%s\""),
Packit Service a1bd4f
                        connection_type,
Packit Service a1bd4f
                        type);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
        is_ovs_connection_type = FALSE;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (nm_connection_get_setting_by_name(connection, NM_SETTING_OVS_PATCH_SETTING_NAME)) {
Packit Service a1bd4f
        type_from_setting = "patch";
Packit Service a1bd4f
        type_setting      = NM_SETTING_OVS_PATCH_SETTING_NAME;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (nm_connection_get_setting_by_name(connection, NM_SETTING_OVS_DPDK_SETTING_NAME)) {
Packit Service a1bd4f
        if (type_from_setting) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection can not have both '%s' and '%s' settings at the same time"),
Packit Service a1bd4f
                        NM_SETTING_OVS_DPDK_SETTING_NAME,
Packit Service a1bd4f
                        type_setting);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
        type_from_setting = "dpdk";
Packit Service a1bd4f
        type_setting      = NM_SETTING_OVS_DPDK_SETTING_NAME;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (type_from_setting) {
Packit Service a1bd4f
        if (!is_ovs_connection_type) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection with '%s' setting must be of connection.type "
Packit Service a1bd4f
                          "\"ovs-interface\" but is \"%s\""),
Packit Service a1bd4f
                        NM_SETTING_OVS_PATCH_SETTING_NAME,
Packit Service a1bd4f
                        connection_type);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
Packit Service a1bd4f
        if (type) {
Packit Service a1bd4f
            if (!nm_streq(type, type_from_setting)) {
Packit Service a1bd4f
                g_set_error(error,
Packit Service a1bd4f
                            NM_CONNECTION_ERROR,
Packit Service a1bd4f
                            NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                            _("A connection with '%s' setting needs to be of '%s' interface type, "
Packit Service a1bd4f
                              "not '%s'"),
Packit Service a1bd4f
                            type_setting,
Packit Service a1bd4f
                            type_from_setting,
Packit Service a1bd4f
                            type);
Packit Service a1bd4f
                g_prefix_error(error,
Packit Service a1bd4f
                               "%s.%s: ",
Packit Service a1bd4f
                               NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                               NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
                return FALSE;
Packit Service a1bd4f
            }
Packit Service a1bd4f
            NM_SET_OUT(out_normalized_type, type);
Packit Service a1bd4f
            return TRUE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
        type = type_from_setting;
Packit Service a1bd4f
        goto normalize;
Packit Service a1bd4f
    } else {
Packit Service a1bd4f
        if (nm_streq0(type, "patch")) {
Packit Service a1bd4f
            g_set_error(
Packit Service a1bd4f
                error,
Packit Service a1bd4f
                NM_CONNECTION_ERROR,
Packit Service a1bd4f
                NM_CONNECTION_ERROR_MISSING_SETTING,
Packit Service a1bd4f
                _("A connection with ovs-interface.type '%s' setting a 'ovs-patch' setting"),
Packit Service a1bd4f
                type);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (type) {
Packit Service a1bd4f
        NM_SET_OUT(out_normalized_type, type);
Packit Service a1bd4f
        return TRUE;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (is_ovs_connection_type)
Packit Service a1bd4f
        type = "internal";
Packit Service a1bd4f
    else
Packit Service a1bd4f
        type = "system";
Packit Service a1bd4f
Packit Service a1bd4f
    NM_SET_OUT(out_normalized_type, type);
Packit 5756e2
Packit 5756e2
normalize:
Packit Service a1bd4f
    if (!normalize) {
Packit Service a1bd4f
        if (!self) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_MISSING_SETTING,
Packit Service a1bd4f
                        _("Missing ovs interface setting"));
Packit Service a1bd4f
            g_prefix_error(error, "%s: ", NM_SETTING_OVS_INTERFACE_SETTING_NAME);
Packit Service a1bd4f
        } else {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_MISSING_PROPERTY,
Packit Service a1bd4f
                        _("Missing ovs interface type"));
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_OVS_INTERFACE_TYPE);
Packit Service a1bd4f
        }
Packit Service a1bd4f
        return NM_SETTING_VERIFY_NORMALIZABLE_ERROR;
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    if (!self) {
Packit Service a1bd4f
        self = NM_SETTING_OVS_INTERFACE(nm_setting_ovs_interface_new());
Packit Service a1bd4f
        nm_connection_add_setting(connection, NM_SETTING(self));
Packit Service a1bd4f
    }
Packit Service a1bd4f
    g_object_set(self, NM_SETTING_OVS_INTERFACE_TYPE, type, NULL);
Packit Service a1bd4f
    NM_SET_OUT(out_modified, TRUE);
Packit Service a1bd4f
Packit Service a1bd4f
    return TRUE;
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
static int
Packit Service a1bd4f
verify(NMSetting *setting, NMConnection *connection, GError **error)
Packit 5756e2
{
Packit Service a1bd4f
    NMSettingOvsInterface *self  = NM_SETTING_OVS_INTERFACE(setting);
Packit Service a1bd4f
    NMSettingConnection *  s_con = NULL;
Packit Service a1bd4f
Packit Service a1bd4f
    if (connection) {
Packit Service a1bd4f
        const char *slave_type;
Packit Service a1bd4f
Packit Service a1bd4f
        s_con = nm_connection_get_setting_connection(connection);
Packit Service a1bd4f
        if (!s_con) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_MISSING_SETTING,
Packit Service a1bd4f
                        _("missing setting"));
Packit Service a1bd4f
            g_prefix_error(error, "%s: ", NM_SETTING_CONNECTION_SETTING_NAME);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
Packit Service a1bd4f
        if (!nm_setting_connection_get_master(s_con)) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection with a '%s' setting must have a master."),
Packit Service a1bd4f
                        NM_SETTING_OVS_INTERFACE_SETTING_NAME);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_CONNECTION_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_CONNECTION_MASTER);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
Packit Service a1bd4f
        slave_type = nm_setting_connection_get_slave_type(s_con);
Packit Service a1bd4f
        if (slave_type && !nm_streq(slave_type, NM_SETTING_OVS_PORT_SETTING_NAME)) {
Packit Service a1bd4f
            g_set_error(error,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR,
Packit Service a1bd4f
                        NM_CONNECTION_ERROR_INVALID_PROPERTY,
Packit Service a1bd4f
                        _("A connection with a '%s' setting must have the slave-type set to '%s'. "
Packit Service a1bd4f
                          "Instead it is '%s'"),
Packit Service a1bd4f
                        NM_SETTING_OVS_INTERFACE_SETTING_NAME,
Packit Service a1bd4f
                        NM_SETTING_OVS_PORT_SETTING_NAME,
Packit Service a1bd4f
                        slave_type);
Packit Service a1bd4f
            g_prefix_error(error,
Packit Service a1bd4f
                           "%s.%s: ",
Packit Service a1bd4f
                           NM_SETTING_CONNECTION_SETTING_NAME,
Packit Service a1bd4f
                           NM_SETTING_CONNECTION_SLAVE_TYPE);
Packit Service a1bd4f
            return FALSE;
Packit Service a1bd4f
        }
Packit Service a1bd4f
    }
Packit Service a1bd4f
Packit Service a1bd4f
    return _nm_setting_ovs_interface_verify_interface_type(self,
Packit Service a1bd4f
                                                           self->type,
Packit Service a1bd4f
                                                           connection,
Packit Service a1bd4f
                                                           FALSE,
Packit Service a1bd4f
                                                           NULL,
Packit Service a1bd4f
                                                           NULL,
Packit Service a1bd4f
                                                           error);
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
static void
Packit Service a1bd4f
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
Packit 5756e2
{
Packit Service a1bd4f
    NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
Packit Service a1bd4f
Packit Service a1bd4f
    switch (prop_id) {
Packit Service a1bd4f
    case PROP_TYPE:
Packit Service a1bd4f
        g_value_set_string(value, self->type);
Packit Service a1bd4f
        break;
Packit Service a1bd4f
    default:
Packit Service a1bd4f
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
Packit Service a1bd4f
        break;
Packit Service a1bd4f
    }
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
static void
Packit Service a1bd4f
set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Packit 5756e2
{
Packit Service a1bd4f
    NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
Packit Service a1bd4f
Packit Service a1bd4f
    switch (prop_id) {
Packit Service a1bd4f
    case PROP_TYPE:
Packit Service a1bd4f
        g_free(self->type);
Packit Service a1bd4f
        self->type = g_value_dup_string(value);
Packit Service a1bd4f
        break;
Packit Service a1bd4f
    default:
Packit Service a1bd4f
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
Packit Service a1bd4f
        break;
Packit Service a1bd4f
    }
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
static void
Packit Service a1bd4f
nm_setting_ovs_interface_init(NMSettingOvsInterface *self)
Packit Service a1bd4f
{}
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * nm_setting_ovs_interface_new:
Packit 5756e2
 *
Packit 5756e2
 * Creates a new #NMSettingOvsInterface object with default values.
Packit 5756e2
 *
Packit 5756e2
 * Returns: (transfer full): the new empty #NMSettingOvsInterface object
Packit 5756e2
 *
Packit 5756e2
 * Since: 1.10
Packit 5756e2
 **/
Packit 5756e2
NMSetting *
Packit Service a1bd4f
nm_setting_ovs_interface_new(void)
Packit 5756e2
{
Packit Service a1bd4f
    return g_object_new(NM_TYPE_SETTING_OVS_INTERFACE, NULL);
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
static void
Packit Service a1bd4f
finalize(GObject *object)
Packit 5756e2
{
Packit Service a1bd4f
    NMSettingOvsInterface *self = NM_SETTING_OVS_INTERFACE(object);
Packit 5756e2
Packit Service a1bd4f
    g_free(self->type);
Packit 5756e2
Packit Service a1bd4f
    G_OBJECT_CLASS(nm_setting_ovs_interface_parent_class)->finalize(object);
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
static void
Packit Service a1bd4f
nm_setting_ovs_interface_class_init(NMSettingOvsInterfaceClass *klass)
Packit 5756e2
{
Packit Service a1bd4f
    GObjectClass *  object_class  = G_OBJECT_CLASS(klass);
Packit Service a1bd4f
    NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
Packit Service a1bd4f
Packit Service a1bd4f
    object_class->get_property = get_property;
Packit Service a1bd4f
    object_class->set_property = set_property;
Packit Service a1bd4f
    object_class->finalize     = finalize;
Packit Service a1bd4f
Packit Service a1bd4f
    setting_class->verify = verify;
Packit Service a1bd4f
Packit Service a1bd4f
    /**
Packit Service a1bd4f
     * NMSettingOvsInterface:type:
Packit Service a1bd4f
     *
Packit Service a1bd4f
     * The interface type. Either "internal", "system", "patch", "dpdk", or empty.
Packit Service a1bd4f
     *
Packit Service a1bd4f
     * Since: 1.10
Packit Service a1bd4f
     **/
Packit Service a1bd4f
    obj_properties[PROP_TYPE] = g_param_spec_string(NM_SETTING_OVS_INTERFACE_TYPE,
Packit Service a1bd4f
                                                    "",
Packit Service a1bd4f
                                                    "",
Packit Service a1bd4f
                                                    NULL,
Packit Service a1bd4f
                                                    G_PARAM_READWRITE | NM_SETTING_PARAM_INFERRABLE
Packit Service a1bd4f
                                                        | G_PARAM_STATIC_STRINGS);
Packit Service a1bd4f
Packit Service a1bd4f
    g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
Packit Service a1bd4f
Packit Service a1bd4f
    _nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_OVS_INTERFACE);
Packit 5756e2
}