1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301 USA.
19 * Copyright 2013 Red Hat, Inc.
22 #include "nm-default.h"
24 #include "nm-setting-generic.h"
25 #include "nm-setting-private.h"
28 * SECTION:nm-setting-generic
29 * @short_description: Describes connection properties for generic devices
30 * @include: nm-setting-generic.h
32 * The #NMSettingGeneric object is a #NMSetting subclass that describes
33 * optional properties that apply to "generic" devices (ie, devices that
34 * NetworkManager does not specifically recognize).
36 * There are currently no properties on this object; it exists only to be
37 * the "connection type" setting on #NMConnections for generic devices.
43 * nm_setting_generic_error_quark:
45 * Registers an error quark for #NMSettingGeneric if necessary.
47 * Returns: the error quark used for #NMSettingGeneric errors.
52 nm_setting_generic_error_quark (void)
56 if (G_UNLIKELY (!quark))
57 quark = g_quark_from_static_string ("nm-setting-generic-error-quark");
61 G_DEFINE_TYPE_WITH_CODE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING,
62 _nm_register_setting (NM_SETTING_GENERIC_SETTING_NAME,
65 NM_SETTING_GENERIC_ERROR))
66 NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GENERIC)
68 #define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
72 } NMSettingGenericPrivate;
74 /**************************************************************************/
77 * nm_setting_generic_new:
79 * Creates a new #NMSettingGeneric object with default values.
81 * Returns: (transfer full): the new empty #NMSettingGeneric object
86 nm_setting_generic_new (void)
88 return (NMSetting *) g_object_new (NM_TYPE_SETTING_GENERIC, NULL);
92 nm_setting_generic_init (NMSettingGeneric *setting)
97 nm_setting_generic_class_init (NMSettingGenericClass *setting_class)
99 g_type_class_add_private (setting_class, sizeof (NMSettingGenericPrivate));