libnm: various cleanup of NMP2PPeer and NMDeviceP2PWifi
- fix leaking hw_address in finalize(). - reorder code. - avoid double tabs in GObject property definitions. - hide struct definitions from header. - don't use signal slots in class structure. - use NM_GOBJECT_PROPERTIES_DEFINE_BASE(). - add missing NM_AVAILABLE_IN_1_16 annotations.
This commit is contained in:
@@ -14,8 +14,7 @@
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright 2007 - 2008 Novell, Inc.
|
||||
* Copyright 2007 - 2018 Red Hat, Inc.
|
||||
* Copyright 2018 - 2019 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#include "nm-default.h"
|
||||
@@ -35,37 +34,19 @@
|
||||
|
||||
#include "introspection/org.freedesktop.NetworkManager.Device.P2PWireless.h"
|
||||
|
||||
G_DEFINE_TYPE (NMDeviceP2PWifi, nm_device_p2p_wifi, NM_TYPE_DEVICE)
|
||||
|
||||
#define NM_DEVICE_P2P_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_P2P_WIFI, NMDeviceP2PWifiPrivate))
|
||||
|
||||
void _nm_device_p2p_wifi_set_p2p_wireless_enabled (NMDeviceP2PWifi *device, gboolean enabled);
|
||||
static void state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct {
|
||||
NMDeviceP2PWifi *device;
|
||||
GSimpleAsyncResult *simple;
|
||||
} RequestScanInfo;
|
||||
|
||||
typedef struct {
|
||||
NMDBusDeviceP2PWifi *proxy;
|
||||
|
||||
char *hw_address;
|
||||
|
||||
gboolean group_owner;
|
||||
GByteArray *wfd_ies;
|
||||
GPtrArray *peers;
|
||||
} NMDeviceP2PWifiPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||
PROP_HW_ADDRESS,
|
||||
PROP_GROUP_OWNER,
|
||||
PROP_WFDIES,
|
||||
PROP_PEERS,
|
||||
|
||||
LAST_PROP
|
||||
};
|
||||
);
|
||||
|
||||
enum {
|
||||
PEER_ADDED,
|
||||
@@ -73,8 +54,44 @@ enum {
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
typedef struct {
|
||||
NMDBusDeviceP2PWifi *proxy;
|
||||
|
||||
char *hw_address;
|
||||
|
||||
GByteArray *wfd_ies;
|
||||
GPtrArray *peers;
|
||||
|
||||
gboolean group_owner;
|
||||
} NMDeviceP2PWifiPrivate;
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi:
|
||||
*
|
||||
* Since: 1.16
|
||||
*/
|
||||
struct _NMDeviceP2PWifi {
|
||||
NMDevice parent;
|
||||
NMDeviceP2PWifiPrivate _priv;
|
||||
};
|
||||
|
||||
struct _NMDeviceP2PWifiClass {
|
||||
NMDeviceClass parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NMDeviceP2PWifi, nm_device_p2p_wifi, NM_TYPE_DEVICE)
|
||||
|
||||
#define NM_DEVICE_P2P_WIFI_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMDeviceP2PWifi, NM_IS_DEVICE_P2P_WIFI, NMDevice, NMObject)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* nm_device_p2p_wifi_get_hw_address:
|
||||
* @device: a #NMDeviceP2PWifi
|
||||
@@ -406,20 +423,15 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (wifi_class);
|
||||
NMDeviceClass *device_class = NM_DEVICE_CLASS (wifi_class);
|
||||
|
||||
g_type_class_add_private (wifi_class, sizeof (NMDeviceP2PWifiPrivate));
|
||||
|
||||
/* virtual methods */
|
||||
object_class->get_property = get_property;
|
||||
object_class->dispose = dispose;
|
||||
object_class->finalize = finalize;
|
||||
|
||||
nm_object_class->init_dbus = init_dbus;
|
||||
|
||||
device_class->connection_compatible = connection_compatible;
|
||||
device_class->get_setting_type = get_setting_type;
|
||||
device_class->get_hw_address = get_hw_address;
|
||||
|
||||
/* properties */
|
||||
nm_object_class->init_dbus = init_dbus;
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi:hw-address:
|
||||
@@ -428,12 +440,11 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_HW_ADDRESS,
|
||||
obj_properties[PROP_HW_ADDRESS] =
|
||||
g_param_spec_string (NM_DEVICE_P2P_WIFI_HW_ADDRESS, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
/**
|
||||
@@ -443,12 +454,11 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_GROUP_OWNER,
|
||||
obj_properties[PROP_GROUP_OWNER] =
|
||||
g_param_spec_boolean (NM_DEVICE_P2P_WIFI_GROUP_OWNER, "", "",
|
||||
FALSE,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi:wfd-ies:
|
||||
@@ -457,13 +467,12 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_WFDIES,
|
||||
obj_properties[PROP_WFDIES] =
|
||||
g_param_spec_variant (NM_DEVICE_P2P_WIFI_WFDIES, "", "",
|
||||
G_VARIANT_TYPE ("ay"),
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi:peers: (type GPtrArray(NMP2PPeer))
|
||||
@@ -472,14 +481,13 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_PEERS,
|
||||
obj_properties[PROP_PEERS] =
|
||||
g_param_spec_boxed (NM_DEVICE_P2P_WIFI_PEERS, "", "",
|
||||
G_TYPE_PTR_ARRAY,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/* signals */
|
||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi::peer-added:
|
||||
@@ -494,8 +502,7 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
g_signal_new ("peer-added",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (NMDeviceP2PWifiClass, peer_added),
|
||||
NULL, NULL,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_OBJECT);
|
||||
@@ -513,8 +520,7 @@ nm_device_p2p_wifi_class_init (NMDeviceP2PWifiClass *wifi_class)
|
||||
g_signal_new ("peer-removed",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (NMDeviceP2PWifiClass, peer_removed),
|
||||
NULL, NULL,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_OBJECT);
|
||||
|
@@ -14,8 +14,7 @@
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright 2007 - 2008 Novell, Inc.
|
||||
* Copyright 2007 - 2018 Red Hat, Inc.
|
||||
* Copyright 2018 - 2019 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __NM_DEVICE_P2P_WIFI_H__
|
||||
@@ -41,41 +40,34 @@ G_BEGIN_DECLS
|
||||
#define NM_DEVICE_P2P_WIFI_PEERS "peers"
|
||||
#define NM_DEVICE_P2P_WIFI_WFDIES "wfdies"
|
||||
|
||||
/**
|
||||
* NMDeviceP2PWifi:
|
||||
*/
|
||||
struct _NMDeviceP2PWifi {
|
||||
NMDevice parent;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
NMDeviceClass parent;
|
||||
|
||||
/* Signals */
|
||||
void (*peer_added) (NMDeviceP2PWifi *device, NMP2PPeer *peer);
|
||||
void (*peer_removed) (NMDeviceP2PWifi *device, NMP2PPeer *peer);
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMDeviceP2PWifiClass;
|
||||
typedef struct _NMDeviceP2PWifiClass NMDeviceP2PWifiClass;
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
GType nm_device_p2p_wifi_get_type (void);
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
const char * nm_device_p2p_wifi_get_hw_address (NMDeviceP2PWifi *device);
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
gboolean nm_device_p2p_wifi_get_group_owner (NMDeviceP2PWifi *device);
|
||||
|
||||
#if 0
|
||||
gboolean nm_device_p2p_wifi_get_wfdies (NMDeviceP2PWifi *device);
|
||||
#endif
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
NMP2PPeer * nm_device_p2p_wifi_get_peer_by_path (NMDeviceP2PWifi *device,
|
||||
const char *path);
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
const GPtrArray * nm_device_p2p_wifi_get_peers (NMDeviceP2PWifi *device);
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
gboolean nm_device_p2p_wifi_start_find (NMDeviceP2PWifi *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
gboolean nm_device_p2p_wifi_stop_find (NMDeviceP2PWifi *device,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
@@ -14,8 +14,7 @@
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright 2007 - 2008 Novell, Inc.
|
||||
* Copyright 2007 - 2018 Red Hat, Inc.
|
||||
* Copyright 2018 - 2019 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#include "nm-default.h"
|
||||
@@ -32,29 +31,9 @@
|
||||
#include "nm-dbus-interface.h"
|
||||
#include "nm-object-private.h"
|
||||
|
||||
G_DEFINE_TYPE (NMP2PPeer, nm_p2p_peer, NM_TYPE_OBJECT)
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_P2P_PEER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_P2P_PEER, NMP2PPeerPrivate))
|
||||
|
||||
typedef struct {
|
||||
NM80211ApFlags flags;
|
||||
|
||||
char *name;
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *model_number;
|
||||
char *serial;
|
||||
|
||||
GBytes *wfd_ies;
|
||||
|
||||
char *hw_address;
|
||||
|
||||
guint8 strength;
|
||||
int last_seen;
|
||||
} NMP2PPeerPrivate;
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
NM_GOBJECT_PROPERTIES_DEFINE_BASE (
|
||||
PROP_FLAGS,
|
||||
PROP_NAME,
|
||||
PROP_MANUFACTURER,
|
||||
@@ -65,10 +44,44 @@ enum {
|
||||
PROP_HW_ADDRESS,
|
||||
PROP_STRENGTH,
|
||||
PROP_LAST_SEEN,
|
||||
);
|
||||
|
||||
LAST_PROP
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *manufacturer;
|
||||
char *model;
|
||||
char *model_number;
|
||||
char *serial;
|
||||
|
||||
GBytes *wfd_ies;
|
||||
|
||||
char *hw_address;
|
||||
|
||||
int last_seen;
|
||||
|
||||
NM80211ApFlags flags;
|
||||
|
||||
guint8 strength;
|
||||
} NMP2PPeerPrivate;
|
||||
|
||||
/**
|
||||
* NMP2PPeer:
|
||||
*/
|
||||
struct _NMP2PPeer {
|
||||
NMObject parent;
|
||||
NMP2PPeerPrivate _priv;
|
||||
};
|
||||
|
||||
struct _NMP2PPeerClass {
|
||||
NMObjectClass parent;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (NMP2PPeer, nm_p2p_peer, NM_TYPE_OBJECT)
|
||||
|
||||
#define NM_P2P_PEER_GET_PRIVATE(self) _NM_GET_PRIVATE (self, NMP2PPeer, NM_IS_P2P_PEER, NMObject)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* nm_p2p_peer_get_flags:
|
||||
* @peer: a #NMP2PPeer
|
||||
@@ -279,25 +292,27 @@ nm_p2p_peer_connection_valid (NMP2PPeer *peer, NMConnection *connection)
|
||||
const char *hw_address;
|
||||
const char *setting_peer;
|
||||
|
||||
s_p2p_wifi = (NMSettingP2PWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_P2P_WIRELESS);
|
||||
if (!s_p2p_wifi)
|
||||
return FALSE;
|
||||
|
||||
s_con = nm_connection_get_setting_connection (connection);
|
||||
if (!s_con)
|
||||
return FALSE;
|
||||
|
||||
ctype = nm_setting_connection_get_connection_type (s_con);
|
||||
if (!ctype || !nm_streq (ctype, NM_SETTING_P2P_WIRELESS_SETTING_NAME))
|
||||
return FALSE;
|
||||
|
||||
s_p2p_wifi = (NMSettingP2PWireless*) nm_connection_get_setting (connection, NM_TYPE_SETTING_P2P_WIRELESS);
|
||||
if (!s_p2p_wifi)
|
||||
if ( !ctype
|
||||
|| !nm_streq (ctype, NM_SETTING_P2P_WIRELESS_SETTING_NAME))
|
||||
return FALSE;
|
||||
|
||||
/* HW Address check */
|
||||
hw_address = nm_p2p_peer_get_hw_address (peer);
|
||||
if (!hw_address)
|
||||
return FALSE;
|
||||
|
||||
setting_peer = nm_setting_p2p_wireless_get_peer (s_p2p_wifi);
|
||||
if ( !setting_peer
|
||||
|| g_strcmp0 (hw_address, setting_peer))
|
||||
|| !nm_streq (hw_address, setting_peer))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@@ -329,7 +344,7 @@ GPtrArray *
|
||||
nm_p2p_peer_filter_connections (NMP2PPeer *peer, const GPtrArray *connections)
|
||||
{
|
||||
GPtrArray *filtered;
|
||||
int i;
|
||||
guint i;
|
||||
|
||||
filtered = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
for (i = 0; i < connections->len; i++) {
|
||||
@@ -344,6 +359,33 @@ nm_p2p_peer_filter_connections (NMP2PPeer *peer, const GPtrArray *connections)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
init_dbus (NMObject *object)
|
||||
{
|
||||
NMP2PPeerPrivate *priv = NM_P2P_PEER_GET_PRIVATE (object);
|
||||
const NMPropertiesInfo property_info[] = {
|
||||
{ NM_P2P_PEER_FLAGS, &priv->flags },
|
||||
{ NM_P2P_PEER_NAME, &priv->name },
|
||||
{ NM_P2P_PEER_MANUFACTURER, &priv->manufacturer },
|
||||
{ NM_P2P_PEER_MODEL, &priv->model },
|
||||
{ NM_P2P_PEER_MODEL_NUMBER, &priv->model_number },
|
||||
{ NM_P2P_PEER_SERIAL, &priv->serial },
|
||||
{ NM_P2P_PEER_WFD_IES, &priv->wfd_ies },
|
||||
{ NM_P2P_PEER_HW_ADDRESS, &priv->hw_address },
|
||||
{ NM_P2P_PEER_STRENGTH, &priv->strength },
|
||||
{ NM_P2P_PEER_LAST_SEEN, &priv->last_seen },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
NM_OBJECT_CLASS (nm_p2p_peer_parent_class)->init_dbus (object);
|
||||
|
||||
_nm_object_register_properties (object,
|
||||
NM_DBUS_INTERFACE_P2P_PEER,
|
||||
property_info);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
get_property (GObject *object,
|
||||
guint prop_id,
|
||||
@@ -389,6 +431,8 @@ get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
nm_p2p_peer_init (NMP2PPeer *peer)
|
||||
{
|
||||
@@ -406,53 +450,24 @@ finalize (GObject *object)
|
||||
g_free (priv->model_number);
|
||||
g_free (priv->serial);
|
||||
|
||||
if (priv->wfd_ies)
|
||||
g_free (priv->hw_address);
|
||||
|
||||
g_bytes_unref (priv->wfd_ies);
|
||||
|
||||
G_OBJECT_CLASS (nm_p2p_peer_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
init_dbus (NMObject *object)
|
||||
nm_p2p_peer_class_init (NMP2PPeerClass *klass)
|
||||
{
|
||||
NMP2PPeerPrivate *priv = NM_P2P_PEER_GET_PRIVATE (object);
|
||||
const NMPropertiesInfo property_info[] = {
|
||||
{ NM_P2P_PEER_FLAGS, &priv->flags },
|
||||
{ NM_P2P_PEER_NAME, &priv->name },
|
||||
{ NM_P2P_PEER_MANUFACTURER, &priv->manufacturer },
|
||||
{ NM_P2P_PEER_MODEL, &priv->model },
|
||||
{ NM_P2P_PEER_MODEL_NUMBER, &priv->model_number },
|
||||
{ NM_P2P_PEER_SERIAL, &priv->serial },
|
||||
{ NM_P2P_PEER_WFD_IES, &priv->wfd_ies },
|
||||
{ NM_P2P_PEER_HW_ADDRESS, &priv->hw_address },
|
||||
{ NM_P2P_PEER_STRENGTH, &priv->strength },
|
||||
{ NM_P2P_PEER_LAST_SEEN, &priv->last_seen },
|
||||
{ NULL },
|
||||
};
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (klass);
|
||||
|
||||
NM_OBJECT_CLASS (nm_p2p_peer_parent_class)->init_dbus (object);
|
||||
|
||||
_nm_object_register_properties (object,
|
||||
NM_DBUS_INTERFACE_P2P_PEER,
|
||||
property_info);
|
||||
}
|
||||
|
||||
static void
|
||||
nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (peer_class);
|
||||
NMObjectClass *nm_object_class = NM_OBJECT_CLASS (peer_class);
|
||||
|
||||
g_type_class_add_private (peer_class, sizeof (NMP2PPeerPrivate));
|
||||
|
||||
/* virtual methods */
|
||||
object_class->get_property = get_property;
|
||||
object_class->finalize = finalize;
|
||||
|
||||
nm_object_class->init_dbus = init_dbus;
|
||||
|
||||
/* properties */
|
||||
|
||||
/**
|
||||
* NMP2PPeer:flags:
|
||||
*
|
||||
@@ -460,13 +475,12 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_FLAGS,
|
||||
obj_properties[PROP_FLAGS] =
|
||||
g_param_spec_flags (NM_P2P_PEER_FLAGS, "", "",
|
||||
NM_TYPE_802_11_AP_FLAGS,
|
||||
NM_802_11_AP_FLAGS_NONE,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:name:
|
||||
@@ -475,12 +489,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_NAME,
|
||||
obj_properties[PROP_NAME] =
|
||||
g_param_spec_string (NM_P2P_PEER_NAME, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:manufacturer:
|
||||
@@ -489,12 +502,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_MANUFACTURER,
|
||||
obj_properties[PROP_MANUFACTURER] =
|
||||
g_param_spec_string (NM_P2P_PEER_MANUFACTURER, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:model:
|
||||
@@ -503,12 +515,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_MODEL,
|
||||
obj_properties[PROP_MODEL] =
|
||||
g_param_spec_string (NM_P2P_PEER_MODEL, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:model-number:
|
||||
@@ -517,12 +528,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_MODEL_NUMBER,
|
||||
obj_properties[PROP_MODEL_NUMBER] =
|
||||
g_param_spec_string (NM_P2P_PEER_MODEL_NUMBER, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:serial:
|
||||
@@ -531,12 +541,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_SERIAL,
|
||||
obj_properties[PROP_SERIAL] =
|
||||
g_param_spec_string (NM_P2P_PEER_SERIAL, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:wfd-ies:
|
||||
@@ -545,12 +554,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_WFD_IES,
|
||||
obj_properties[PROP_WFD_IES] =
|
||||
g_param_spec_boxed (NM_P2P_PEER_WFD_IES, "", "",
|
||||
G_TYPE_BYTES,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
/**
|
||||
* NMP2PPeer:hw-address:
|
||||
*
|
||||
@@ -558,12 +566,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_HW_ADDRESS,
|
||||
obj_properties[PROP_HW_ADDRESS] =
|
||||
g_param_spec_string (NM_P2P_PEER_HW_ADDRESS, "", "",
|
||||
NULL,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:strength:
|
||||
@@ -572,12 +579,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_STRENGTH,
|
||||
obj_properties[PROP_STRENGTH] =
|
||||
g_param_spec_uchar (NM_P2P_PEER_STRENGTH, "", "",
|
||||
0, G_MAXUINT8, 0,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* NMP2PPeer:last-seen:
|
||||
@@ -587,10 +593,11 @@ nm_p2p_peer_class_init (NMP2PPeerClass *peer_class)
|
||||
*
|
||||
* Since: 1.16
|
||||
**/
|
||||
g_object_class_install_property
|
||||
(object_class, PROP_LAST_SEEN,
|
||||
obj_properties[PROP_LAST_SEEN] =
|
||||
g_param_spec_int (NM_P2P_PEER_LAST_SEEN, "", "",
|
||||
-1, G_MAXINT, -1,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
}
|
||||
|
@@ -14,8 +14,7 @@
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Copyright 2007 - 2008 Novell, Inc.
|
||||
* Copyright 2007 - 2011 Red Hat, Inc.
|
||||
* Copyright 2018 - 2019 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __NM_P2P_PEER_H__
|
||||
@@ -47,21 +46,7 @@ G_BEGIN_DECLS
|
||||
#define NM_P2P_PEER_STRENGTH "strength"
|
||||
#define NM_P2P_PEER_LAST_SEEN "last-seen"
|
||||
|
||||
/**
|
||||
* NMP2PPeer:
|
||||
*/
|
||||
NM_AVAILABLE_IN_1_16
|
||||
struct _NMP2PPeer {
|
||||
NMObject parent;
|
||||
};
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
typedef struct {
|
||||
NMObjectClass parent;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[4];
|
||||
} NMP2PPeerClass;
|
||||
typedef struct _NMP2PPeerClass NMP2PPeerClass;
|
||||
|
||||
NM_AVAILABLE_IN_1_16
|
||||
GType nm_p2p_peer_get_type (void);
|
||||
|
Reference in New Issue
Block a user