device: renew dhcp leases on awake for software devices
[NetworkManager.git] / libnm-util / nm-setting-generic.c
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2
3 /*
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.
8  *
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.
13  *
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.
18  *
19  * Copyright 2013 Red Hat, Inc.
20  */
21
22 #include "nm-default.h"
23
24 #include "nm-setting-generic.h"
25 #include "nm-setting-private.h"
26
27 /**
28  * SECTION:nm-setting-generic
29  * @short_description: Describes connection properties for generic devices
30  * @include: nm-setting-generic.h
31  *
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).
35  *
36  * There are currently no properties on this object; it exists only to be
37  * the "connection type" setting on #NMConnections for generic devices.
38  *
39  * Since: 0.9.10
40  **/
41
42 /**
43  * nm_setting_generic_error_quark:
44  *
45  * Registers an error quark for #NMSettingGeneric if necessary.
46  *
47  * Returns: the error quark used for #NMSettingGeneric errors.
48  *
49  * Since: 0.9.10
50  **/
51 GQuark
52 nm_setting_generic_error_quark (void)
53 {
54         static GQuark quark;
55
56         if (G_UNLIKELY (!quark))
57                 quark = g_quark_from_static_string ("nm-setting-generic-error-quark");
58         return quark;
59 }
60
61 G_DEFINE_TYPE_WITH_CODE (NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING,
62                          _nm_register_setting (NM_SETTING_GENERIC_SETTING_NAME,
63                                                g_define_type_id,
64                                                1,
65                                                NM_SETTING_GENERIC_ERROR))
66 NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_GENERIC)
67
68 #define NM_SETTING_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
69
70 typedef struct {
71         int dummy;
72 } NMSettingGenericPrivate;
73
74 /**************************************************************************/
75
76 /**
77  * nm_setting_generic_new:
78  *
79  * Creates a new #NMSettingGeneric object with default values.
80  *
81  * Returns: (transfer full): the new empty #NMSettingGeneric object
82  *
83  * Since: 0.9.10
84  **/
85 NMSetting *
86 nm_setting_generic_new (void)
87 {
88         return (NMSetting *) g_object_new (NM_TYPE_SETTING_GENERIC, NULL);
89 }
90
91 static void
92 nm_setting_generic_init (NMSettingGeneric *setting)
93 {
94 }
95
96 static void
97 nm_setting_generic_class_init (NMSettingGenericClass *setting_class)
98 {
99         g_type_class_add_private (setting_class, sizeof (NMSettingGenericPrivate));
100 }