summaryrefslogtreecommitdiff
path: root/libnm-glib
diff options
context:
space:
mode:
authorTambet Ingo <tambet@gmail.com>2008-08-12 08:05:21 +0000
committerTambet Ingo <tambet@gmail.com>2008-08-12 08:05:21 +0000
commit0f534a9f8f7cae561ab379a9c4b2696927d79b39 (patch)
tree6f1fe1f8b43b7d96c9f3588fd86ffe4bed1599df /libnm-glib
parentc29ae2d0035479ac90f2963205548ff4748da784 (diff)
downloadNetworkManager-0f534a9f8f7cae561ab379a9c4b2696927d79b39.tar.gz
2008-08-12 Tambet Ingo <tambet@gmail.com>
Start documenting libnm-glib public API using gtk-doc. * libnm-glib/nm-serial-device.c: * libnm-glib/nm-object.c: * libnm-glib/nm-gsm-device.c: * libnm-glib/nm-device.c: * libnm-glib/nm-device-wifi.c: * libnm-glib/nm-device-ethernet.c: * libnm-glib/nm-client.c: * libnm-glib/nm-cdma-device.c: Document the public API. * docs/libnm-glib/libnm-glib.types: Implement. * docs/libnm-glib/Makefile.am: Implement. * autogen.sh: * configure.in: * Makefile.am: Add gtk-doc support. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3932 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/nm-cdma-device.c9
-rw-r--r--libnm-glib/nm-client.c142
-rw-r--r--libnm-glib/nm-device-ethernet.c50
-rw-r--r--libnm-glib/nm-device-wifi.c116
-rw-r--r--libnm-glib/nm-device.c154
-rw-r--r--libnm-glib/nm-gsm-device.c9
-rw-r--r--libnm-glib/nm-object.c28
-rw-r--r--libnm-glib/nm-serial-device.c27
8 files changed, 535 insertions, 0 deletions
diff --git a/libnm-glib/nm-cdma-device.c b/libnm-glib/nm-cdma-device.c
index 9266707ecd..afd2b6a4ae 100644
--- a/libnm-glib/nm-cdma-device.c
+++ b/libnm-glib/nm-cdma-device.c
@@ -87,6 +87,15 @@ nm_cdma_device_class_init (NMCdmaDeviceClass *device_class)
object_class->dispose = dispose;
}
+/**
+ * nm_cdma_device_new:
+ * @connection: the #DBusGConnection
+ * @path: the DBus object path of the device
+ *
+ * Creates a new #NMCdmaDevice.
+ *
+ * Returns: a new device
+ **/
GObject *
nm_cdma_device_new (DBusGConnection *connection, const char *path)
{
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index 9d0fa2fa97..0def21e045 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -381,6 +381,12 @@ nm_client_class_init (NMClientClass *client_class)
object_class->dispose = dispose;
/* properties */
+
+ /**
+ * NMClient:state:
+ *
+ * The current daemon state.
+ **/
g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_uint (NM_CLIENT_STATE,
@@ -389,6 +395,11 @@ nm_client_class_init (NMClientClass *client_class)
NM_STATE_UNKNOWN, NM_STATE_DISCONNECTED, NM_STATE_UNKNOWN,
G_PARAM_READABLE));
+ /**
+ * NMClient::manager-running:
+ *
+ * Whether the daemon is running.
+ **/
g_object_class_install_property
(object_class, PROP_MANAGER_RUNNING,
g_param_spec_boolean (NM_CLIENT_MANAGER_RUNNING,
@@ -397,6 +408,11 @@ nm_client_class_init (NMClientClass *client_class)
FALSE,
G_PARAM_READABLE));
+ /**
+ * NMClient::wireless-enabled:
+ *
+ * Whether wireless is enabled.
+ **/
g_object_class_install_property
(object_class, PROP_WIRELESS_ENABLED,
g_param_spec_boolean (NM_CLIENT_WIRELESS_ENABLED,
@@ -405,6 +421,11 @@ nm_client_class_init (NMClientClass *client_class)
TRUE,
G_PARAM_READWRITE));
+ /**
+ * NMClient::wireless-hardware-enabled:
+ *
+ * Whether the wireless hardware is enabled.
+ **/
g_object_class_install_property
(object_class, PROP_WIRELESS_HARDWARE_ENABLED,
g_param_spec_boolean (NM_CLIENT_WIRELESS_HARDWARE_ENABLED,
@@ -413,6 +434,11 @@ nm_client_class_init (NMClientClass *client_class)
TRUE,
G_PARAM_READABLE));
+ /**
+ * NMClient::active-connections:
+ *
+ * The active connections.
+ **/
g_object_class_install_property
(object_class, PROP_ACTIVE_CONNECTIONS,
g_param_spec_boxed (NM_CLIENT_ACTIVE_CONNECTIONS,
@@ -422,6 +448,14 @@ nm_client_class_init (NMClientClass *client_class)
G_PARAM_READABLE));
/* signals */
+
+ /**
+ * NMClient::device-added:
+ * @client: the client that received the signal
+ * @device: the new device
+ *
+ * Notifies that a #NMDevice is added.
+ **/
signals[DEVICE_ADDED] =
g_signal_new ("device-added",
G_OBJECT_CLASS_TYPE (object_class),
@@ -432,6 +466,13 @@ nm_client_class_init (NMClientClass *client_class)
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
+ /**
+ * NMClient::device-removed:
+ * @widget: the client that received the signal
+ * @device: the removed device
+ *
+ * Notifies that a #NMDevice is removed.
+ **/
signals[DEVICE_REMOVED] =
g_signal_new ("device-removed",
G_OBJECT_CLASS_TYPE (object_class),
@@ -443,6 +484,13 @@ nm_client_class_init (NMClientClass *client_class)
G_TYPE_OBJECT);
}
+/**
+ * nm_client_new:
+ *
+ * Creates a new #NMClient.
+ *
+ * Returns: a new #NMClient
+ **/
NMClient *
nm_client_new (void)
{
@@ -541,6 +589,15 @@ client_device_removed_proxy (DBusGProxy *proxy, char *path, gpointer user_data)
}
}
+/**
+ * nm_client_get_devices:
+ * @client: a #NMClient
+ *
+ * Gets all the detected devices.
+ *
+ * Returns: a #GPtrArray containing all the #NMDevice<!-- -->s.
+ * The returned array is owned by the client and should not be modified.
+ **/
const GPtrArray *
nm_client_get_devices (NMClient *client)
{
@@ -571,6 +628,15 @@ nm_client_get_devices (NMClient *client)
return handle_ptr_array_return (priv->devices);
}
+/**
+ * nm_client_get_device_by_path:
+ * @client: a #NMClient
+ * @object_path: the object path to search for
+ *
+ * Gets a #NMDevice from a #NMClient.
+ *
+ * Returns: the #NMDevice for the given @object_path or %NULL if none is found.
+ **/
NMDevice *
nm_client_get_device_by_path (NMClient *client, const char *object_path)
{
@@ -617,6 +683,19 @@ activate_cb (DBusGProxy *proxy,
g_slice_free (ActivateDeviceInfo, info);
}
+/**
+ * nm_client_activate_connection:
+ * @client: a #NMClient
+ * @service_name: the connection's service name
+ * @connection_path: the connection's DBus path
+ * @device: the #NMDevice
+ * @specific_object: the device specific object (currently used only for
+ * activating wireless devices and should be the #NMAccessPoint<!-- -->'s path.
+ * @callback: the function to call when the call is done
+ * @user_data: user data to pass to the callback function
+ *
+ * Activates a connection with the given #NMDevice.
+ **/
void
nm_client_activate_connection (NMClient *client,
const char *service_name,
@@ -653,6 +732,13 @@ nm_client_activate_connection (NMClient *client,
info);
}
+/**
+ * nm_client_deactivate_connection:
+ * @client: a #NMClient
+ * @active: the #NMActiveConnection to deactivate
+ *
+ * Deactivates an active #NMActiveConnection.
+ **/
void
nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active)
{
@@ -672,6 +758,15 @@ nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active)
}
}
+/**
+ * nm_client_get_active_connections:
+ * @client: a #NMClient
+ *
+ * Gets the active connections.
+ *
+ * Returns: a #GPtrArray containing all the active #NMActiveConnection<!-- -->s.
+ * The returned array is owned by the client and should not be modified.
+ **/
const GPtrArray *
nm_client_get_active_connections (NMClient *client)
{
@@ -700,6 +795,14 @@ nm_client_get_active_connections (NMClient *client)
return handle_ptr_array_return (priv->active_connections);
}
+/**
+ * nm_client_wireless_get_enabled:
+ * @client: a #NMClient
+ *
+ * Determines whether the wireless is enabled.
+ *
+ * Returns: %TRUE if wireless is enabled
+ **/
gboolean
nm_client_wireless_get_enabled (NMClient *client)
{
@@ -708,6 +811,13 @@ nm_client_wireless_get_enabled (NMClient *client)
return NM_CLIENT_GET_PRIVATE (client)->wireless_enabled;
}
+/**
+ * nm_client_wireless_set_enabled:
+ * @client: a #NMClient
+ * @enabled: %TRUE to enable wireless
+ *
+ * Enables or disables wireless devices.
+ **/
void
nm_client_wireless_set_enabled (NMClient *client, gboolean enabled)
{
@@ -724,6 +834,14 @@ nm_client_wireless_set_enabled (NMClient *client, gboolean enabled)
&value);
}
+/**
+ * nm_client_wireless_hardware_get_enabled:
+ * @client: a #NMClient
+ *
+ * Determines whether the wireless hardware is enabled.
+ *
+ * Returns: %TRUE if the wireless hardware is enabled
+ **/
gboolean
nm_client_wireless_hardware_get_enabled (NMClient *client)
{
@@ -732,6 +850,14 @@ nm_client_wireless_hardware_get_enabled (NMClient *client)
return NM_CLIENT_GET_PRIVATE (client)->wireless_hw_enabled;
}
+/**
+ * nm_client_get_state:
+ * @client: a #NMClient
+ *
+ * Gets the current daemon state.
+ *
+ * Returns: the current %NMState
+ **/
NMState
nm_client_get_state (NMClient *client)
{
@@ -750,6 +876,14 @@ nm_client_get_state (NMClient *client)
return priv->state;
}
+/**
+ * nm_client_sleep:
+ * @client: a #NMClient
+ * @sleep: %TRUE to put the daemon to sleep
+ *
+ * Enables or disables networking. When the daemon is put to sleep, it'll deactivate and disable
+ * all the active devices.
+ **/
void
nm_client_sleep (NMClient *client, gboolean sleep)
{
@@ -763,6 +897,14 @@ nm_client_sleep (NMClient *client, gboolean sleep)
}
}
+/**
+ * nm_client_get_manager_running:
+ * @client: a #NMClient
+ *
+ * Determines whether the daemon is running.
+ *
+ * Returns: %TRUE if the daemon is running
+ **/
gboolean
nm_client_get_manager_running (NMClient *client)
{
diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c
index d8d43e55c3..57c423f8b5 100644
--- a/libnm-glib/nm-device-ethernet.c
+++ b/libnm-glib/nm-device-ethernet.c
@@ -32,6 +32,15 @@ enum {
#define DBUS_PROP_SPEED "Speed"
#define DBUS_PROP_CARRIER "Carrier"
+/**
+ * nm_device_ethernet_new:
+ * @connection: the #DBusGConnection
+ * @path: the DBus object path of the device
+ *
+ * Creates a new #NMDeviceEthernet.
+ *
+ * Returns: a new device
+ **/
GObject *
nm_device_ethernet_new (DBusGConnection *connection, const char *path)
{
@@ -44,6 +53,15 @@ nm_device_ethernet_new (DBusGConnection *connection, const char *path)
NULL);
}
+/**
+ * nm_device_ethernet_get_hw_address:
+ * @device: a #NMDeviceEthernet
+ *
+ * Gets the hardware (MAC) address of the #NMDeviceEthernet
+ *
+ * Returns: the hardware address. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
{
@@ -61,6 +79,14 @@ nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
return priv->hw_address;
}
+/**
+ * nm_device_ethernet_get_speed:
+ * @device: a #NMDeviceEthernet
+ *
+ * Gets the speed of the #NMDeviceEthernet.
+ *
+ * Returns: the speed of the device
+ **/
guint32
nm_device_ethernet_get_speed (NMDeviceEthernet *device)
{
@@ -78,6 +104,14 @@ nm_device_ethernet_get_speed (NMDeviceEthernet *device)
return priv->speed;
}
+/**
+ * nm_device_ethernet_get_carrier:
+ * @device: a #NMDeviceEthernet
+ *
+ * Whether the device has carrier.
+ *
+ * Returns: %TRUE if the device has carrier
+ **/
gboolean
nm_device_ethernet_get_carrier (NMDeviceEthernet *device)
{
@@ -214,6 +248,12 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *device_class)
object_class->get_property = get_property;
/* properties */
+
+ /**
+ * NMDeviceEthernet:hw-address:
+ *
+ * The hardware (MAC) address of the device.
+ **/
g_object_class_install_property
(object_class, PROP_HW_ADDRESS,
g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS,
@@ -222,6 +262,11 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDeviceEthernet:speed:
+ *
+ * The speed of the device.
+ **/
g_object_class_install_property
(object_class, PROP_SPEED,
g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED,
@@ -230,6 +275,11 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *device_class)
0, G_MAXUINT32, 0,
G_PARAM_READABLE));
+ /**
+ * NMDeviceEthernet:carrier:
+ *
+ * Whether the device has carrier.
+ **/
g_object_class_install_property
(object_class, PROP_CARRIER,
g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER,
diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c
index ae2e753450..ac6b93e251 100644
--- a/libnm-glib/nm-device-wifi.c
+++ b/libnm-glib/nm-device-wifi.c
@@ -60,6 +60,15 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
+/**
+ * nm_device_wifi_new:
+ * @connection: the #DBusGConnection
+ * @path: the DBus object path of the device
+ *
+ * Creates a new #NMDeviceWifi.
+ *
+ * Returns: a new device
+ **/
GObject *
nm_device_wifi_new (DBusGConnection *connection, const char *path)
{
@@ -72,6 +81,15 @@ nm_device_wifi_new (DBusGConnection *connection, const char *path)
NULL);
}
+/**
+ * nm_device_wifi_get_hw_address:
+ * @device: a #NMDeviceWifi
+ *
+ * Gets the hardware (MAC) address of the #NMDeviceWifi
+ *
+ * Returns: the hardware address. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_wifi_get_hw_address (NMDeviceWifi *device)
{
@@ -89,6 +107,14 @@ nm_device_wifi_get_hw_address (NMDeviceWifi *device)
return priv->hw_address;
}
+/**
+ * nm_device_wifi_get_mode:
+ * @device: a #NMDeviceWifi
+ *
+ * Gets the #NMDeviceWifi mode.
+ *
+ * Returns: the mode
+ **/
NM80211Mode
nm_device_wifi_get_mode (NMDeviceWifi *device)
{
@@ -106,6 +132,14 @@ nm_device_wifi_get_mode (NMDeviceWifi *device)
return priv->mode;
}
+/**
+ * nm_device_wifi_get_bitrate:
+ * @device: a #NMDeviceWifi
+ *
+ * Gets the bit rate of the #NMDeviceWifi.
+ *
+ * Returns: the bit rate
+ **/
guint32
nm_device_wifi_get_bitrate (NMDeviceWifi *device)
{
@@ -137,6 +171,14 @@ nm_device_wifi_get_bitrate (NMDeviceWifi *device)
return priv->rate;
}
+/**
+ * nm_device_wifi_get_capabilities:
+ * @device: a #NMDeviceWifi
+ *
+ * Gets the WIFI capabilities of the #NMDeviceWifi.
+ *
+ * Returns: the capabilities
+ **/
guint32
nm_device_wifi_get_capabilities (NMDeviceWifi *device)
{
@@ -154,6 +196,14 @@ nm_device_wifi_get_capabilities (NMDeviceWifi *device)
return priv->wireless_caps;
}
+/**
+ * nm_device_wifi_get_active_access_point:
+ * @self: a #NMDeviceWifi
+ *
+ * Gets the active #NMAccessPoint.
+ *
+ * Returns: the access point or %NULL if none is active
+ **/
NMAccessPoint *
nm_device_wifi_get_active_access_point (NMDeviceWifi *self)
{
@@ -196,6 +246,15 @@ nm_device_wifi_get_active_access_point (NMDeviceWifi *self)
return priv->active_ap;
}
+/**
+ * nm_device_wifi_get_access_points:
+ * @self: a #NMDeviceWifi
+ *
+ * Gets all the scanned access points of the #NMDeviceWifi.
+ *
+ * Returns: a #GPtrArray containing all the scanned #NMAccessPoint<!-- -->s.
+ * The returned array is owned by the client and should not be modified.
+ **/
const GPtrArray *
nm_device_wifi_get_access_points (NMDeviceWifi *self)
{
@@ -226,6 +285,15 @@ nm_device_wifi_get_access_points (NMDeviceWifi *self)
return handle_ptr_array_return (priv->aps);
}
+/**
+ * nm_device_wifi_get_access_point_by_path:
+ * @self: a #NMDeviceWifi
+ * @path: the object path of the access point
+ *
+ * Gets a #NMAccessPoint by path.
+ *
+ * Returns: the access point or %NULL if none is found.
+ **/
NMAccessPoint *
nm_device_wifi_get_access_point_by_path (NMDeviceWifi *self,
const char *path)
@@ -323,6 +391,13 @@ clean_up_aps (NMDeviceWifi *self, gboolean notify)
}
}
+/**
+ * nm_device_wifi_set_wireless_enabled:
+ * @device: a #NMDeviceWifi
+ * @enabled: %TRUE to enable the device
+ *
+ * Enables or disables the wireless device.
+ **/
void
nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device,
gboolean enabled)
@@ -547,6 +622,12 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
object_class->finalize = finalize;
/* properties */
+
+ /**
+ * NMDeviceWifi:hw-address:
+ *
+ * The hardware (MAC) address of the device.
+ **/
g_object_class_install_property
(object_class, PROP_HW_ADDRESS,
g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS,
@@ -555,6 +636,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDeviceWifi:mode:
+ *
+ * The mode of the device.
+ **/
g_object_class_install_property
(object_class, PROP_MODE,
g_param_spec_uint (NM_DEVICE_WIFI_MODE,
@@ -563,6 +649,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA,
G_PARAM_READABLE));
+ /**
+ * NMDeviceWifi:bitrate:
+ *
+ * The bit rate of the device.
+ **/
g_object_class_install_property
(object_class, PROP_BITRATE,
g_param_spec_uint (NM_DEVICE_WIFI_BITRATE,
@@ -571,6 +662,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
0, G_MAXUINT32, 0,
G_PARAM_READABLE));
+ /**
+ * NMDeviceWifi:active-access-point:
+ *
+ * The active #NMAccessPoint of the device.
+ **/
g_object_class_install_property
(object_class, PROP_ACTIVE_ACCESS_POINT,
g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT,
@@ -579,6 +675,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
NM_TYPE_ACCESS_POINT,
G_PARAM_READABLE));
+ /**
+ * NMDeviceWifi:wireless-capabilities:
+ *
+ * The wireless capabilities of the device.
+ **/
g_object_class_install_property
(object_class, PROP_WIRELESS_CAPABILITIES,
g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES,
@@ -588,6 +689,14 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
G_PARAM_READABLE));
/* signals */
+
+ /**
+ * NMDeviceWifi::access-point-added:
+ * @device: the wifi device that received the signal
+ * @ap: the new access point
+ *
+ * Notifies that a #NMAccessPoint is added to the wifi device.
+ **/
signals[ACCESS_POINT_ADDED] =
g_signal_new ("access-point-added",
G_OBJECT_CLASS_TYPE (object_class),
@@ -598,6 +707,13 @@ nm_device_wifi_class_init (NMDeviceWifiClass *device_class)
G_TYPE_NONE, 1,
G_TYPE_OBJECT);
+ /**
+ * NMDeviceWifi::access-point-removed:
+ * @device: the wifi device that received the signal
+ * @ap: the removed access point
+ *
+ * Notifies that a #NMAccessPoint is removed from the wifi device.
+ **/
signals[ACCESS_POINT_REMOVED] =
g_signal_new ("access-point-removed",
G_OBJECT_CLASS_TYPE (object_class),
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index a379555dab..d142bfe29f 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -321,6 +321,12 @@ nm_device_class_init (NMDeviceClass *device_class)
object_class->finalize = finalize;
/* properties */
+
+ /**
+ * NMDevice:interface:
+ *
+ * The interface of the device.
+ **/
g_object_class_install_property
(object_class, PROP_INTERFACE,
g_param_spec_string (NM_DEVICE_INTERFACE,
@@ -329,6 +335,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDevice:udi:
+ *
+ * The HAL UDI of the device.
+ **/
g_object_class_install_property
(object_class, PROP_UDI,
g_param_spec_string (NM_DEVICE_UDI,
@@ -337,6 +348,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDevice:driver:
+ *
+ * The driver of the device.
+ **/
g_object_class_install_property
(object_class, PROP_DRIVER,
g_param_spec_string (NM_DEVICE_DRIVER,
@@ -345,6 +361,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDevice:capabilities:
+ *
+ * The capabilities of the device.
+ **/
g_object_class_install_property
(object_class, PROP_CAPABILITIES,
g_param_spec_uint (NM_DEVICE_CAPABILITIES,
@@ -353,6 +374,11 @@ nm_device_class_init (NMDeviceClass *device_class)
0, G_MAXUINT32, 0,
G_PARAM_READABLE));
+ /**
+ * NMDevice:managed:
+ *
+ * Whether the device is managed by NetworkManager.
+ **/
g_object_class_install_property
(object_class, PROP_MANAGED,
g_param_spec_boolean (NM_DEVICE_MANAGED,
@@ -361,6 +387,11 @@ nm_device_class_init (NMDeviceClass *device_class)
FALSE,
G_PARAM_READABLE));
+ /**
+ * NMDevice:ip4-config:
+ *
+ * The #NMIP4Config of the device.
+ **/
g_object_class_install_property
(object_class, PROP_IP4_CONFIG,
g_param_spec_object (NM_DEVICE_IP4_CONFIG,
@@ -369,6 +400,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NM_TYPE_IP4_CONFIG,
G_PARAM_READABLE));
+ /**
+ * NMDevice:dhcp4-config:
+ *
+ * The #NMDHCP4Config of the device.
+ **/
g_object_class_install_property
(object_class, PROP_DHCP4_CONFIG,
g_param_spec_object (NM_DEVICE_DHCP4_CONFIG,
@@ -377,6 +413,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NM_TYPE_DHCP4_CONFIG,
G_PARAM_READABLE));
+ /**
+ * NMDevice:state:
+ *
+ * The state of the device.
+ **/
g_object_class_install_property
(object_class, PROP_STATE,
g_param_spec_uint (NM_DEVICE_STATE,
@@ -385,6 +426,11 @@ nm_device_class_init (NMDeviceClass *device_class)
0, G_MAXUINT32, 0,
G_PARAM_READABLE));
+ /**
+ * NMDevice:vendor:
+ *
+ * The vendor string of the device.
+ **/
g_object_class_install_property
(object_class, PROP_VENDOR,
g_param_spec_string (NM_DEVICE_VENDOR,
@@ -393,6 +439,11 @@ nm_device_class_init (NMDeviceClass *device_class)
NULL,
G_PARAM_READABLE));
+ /**
+ * NMDevice:product:
+ *
+ * The product string of the device.
+ **/
g_object_class_install_property
(object_class, PROP_PRODUCT,
g_param_spec_string (NM_DEVICE_PRODUCT,
@@ -402,6 +453,14 @@ nm_device_class_init (NMDeviceClass *device_class)
G_PARAM_READABLE));
/* signals */
+
+ /**
+ * NMDevice::state-changed:
+ * @device: the client that received the signal
+ * @state: the new state of the device
+ *
+ * Notifies the state change of a #NMDevice.
+ **/
signals[STATE_CHANGED] =
g_signal_new ("state-changed",
G_OBJECT_CLASS_TYPE (object_class),
@@ -413,6 +472,15 @@ nm_device_class_init (NMDeviceClass *device_class)
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
}
+/**
+ * nm_device_new:
+ * @connection: the #DBusGConnection
+ * @path: the DBus object path of the device
+ *
+ * Creates a new #NMDevice.
+ *
+ * Returns: a new device
+ **/
GObject *
nm_device_new (DBusGConnection *connection, const char *path)
{
@@ -475,6 +543,15 @@ out:
return G_OBJECT (device);
}
+/**
+ * nm_device_get_iface:
+ * @device: a #NMDevice
+ *
+ * Gets the interface name of the #NMDevice.
+ *
+ * Returns: the interface of the device. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_get_iface (NMDevice *device)
{
@@ -492,6 +569,15 @@ nm_device_get_iface (NMDevice *device)
return priv->iface;
}
+/**
+ * nm_device_get_udi:
+ * @device: a #NMDevice
+ *
+ * Gets the HAL UDI of the #NMDevice.
+ *
+ * Returns: the HAL UDI of the device. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_get_udi (NMDevice *device)
{
@@ -509,6 +595,15 @@ nm_device_get_udi (NMDevice *device)
return priv->udi;
}
+/**
+ * nm_device_get_driver:
+ * @device: a #NMDevice
+ *
+ * Gets the driver of the #NMDevice.
+ *
+ * Returns: the driver of the device. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_get_driver (NMDevice *device)
{
@@ -526,6 +621,14 @@ nm_device_get_driver (NMDevice *device)
return priv->driver;
}
+/**
+ * nm_device_get_capabilities:
+ * @device: a #NMDevice
+ *
+ * Gets the device' capabilities.
+ *
+ * Returns: the capabilities
+ **/
guint32
nm_device_get_capabilities (NMDevice *device)
{
@@ -543,6 +646,14 @@ nm_device_get_capabilities (NMDevice *device)
return priv->capabilities;
}
+/**
+ * nm_device_get_managed:
+ * @device: a #NMDevice
+ *
+ * Whether the #NMDevice is managed by NetworkManager.
+ *
+ * Returns: %TRUE if the device is managed by NetworkManager
+ **/
gboolean
nm_device_get_managed (NMDevice *device)
{
@@ -560,6 +671,14 @@ nm_device_get_managed (NMDevice *device)
return priv->managed;
}
+/**
+ * nm_device_get_ip4_config:
+ * @device: a #NMDevice
+ *
+ * Gets the current #NMIP4Config associated with the #NMDevice.
+ *
+ * Returns: the #NMIP4Config or %NULL if the device is not activated.
+ **/
NMIP4Config *
nm_device_get_ip4_config (NMDevice *device)
{
@@ -586,6 +705,15 @@ nm_device_get_ip4_config (NMDevice *device)
return priv->ip4_config;
}
+/**
+ * nm_device_get_dhcp4_config:
+ * @device: a #NMDevice
+ *
+ * Gets the current #NMDHCP4Config associated with the #NMDevice.
+ *
+ * Returns: the #NMDHCPConfig or %NULL if the device is not activated or not
+ * using DHCP.
+ **/
NMDHCP4Config *
nm_device_get_dhcp4_config (NMDevice *device)
{
@@ -612,6 +740,14 @@ nm_device_get_dhcp4_config (NMDevice *device)
return priv->dhcp4_config;
}
+/**
+ * nm_device_get_state:
+ * @device: a #NMDevice
+ *
+ * Gets the current #NMDevice state.
+ *
+ * Returns: the current device state
+ **/
NMDeviceState
nm_device_get_state (NMDevice *device)
{
@@ -807,6 +943,15 @@ nm_device_update_description (NMDevice *device)
nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT);
}
+/**
+ * nm_device_get_product:
+ * @device: a #NMDevice
+ *
+ * Gets the product string of the #NMDevice.
+ *
+ * Returns: the product name of the device. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_get_product (NMDevice *device)
{
@@ -820,6 +965,15 @@ nm_device_get_product (NMDevice *device)
return priv->product;
}
+/**
+ * nm_device_get_vendor:
+ * @device: a #NMDevice
+ *
+ * Gets the vendor string of the #NMDevice.
+ *
+ * Returns: the vendor name of the device. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_device_get_vendor (NMDevice *device)
{
diff --git a/libnm-glib/nm-gsm-device.c b/libnm-glib/nm-gsm-device.c
index c3c28f46db..7db338c8a7 100644
--- a/libnm-glib/nm-gsm-device.c
+++ b/libnm-glib/nm-gsm-device.c
@@ -87,6 +87,15 @@ nm_gsm_device_class_init (NMGsmDeviceClass *device_class)
object_class->dispose = dispose;
}
+/**
+ * nm_gsm_device_new:
+ * @connection: the #DBusGConnection
+ * @path: the DBus object path of the device
+ *
+ * Creates a new #NMGsmDevice.
+ *
+ * Returns: a new device
+ **/
NMGsmDevice *
nm_gsm_device_new (DBusGConnection *connection, const char *path)
{
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c
index 9472f25280..b981306ed2 100644
--- a/libnm-glib/nm-object.c
+++ b/libnm-glib/nm-object.c
@@ -168,6 +168,12 @@ nm_object_class_init (NMObjectClass *nm_object_class)
object_class->finalize = finalize;
/* porperties */
+
+ /**
+ * NMObject:connection:
+ *
+ * The #DBusGConnection of the object.
+ **/
g_object_class_install_property
(object_class, PROP_CONNECTION,
g_param_spec_boxed (NM_OBJECT_DBUS_CONNECTION,
@@ -176,6 +182,11 @@ nm_object_class_init (NMObjectClass *nm_object_class)
DBUS_TYPE_G_CONNECTION,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ /**
+ * NMObject:path:
+ *
+ * The DBus object path.
+ **/
g_object_class_install_property
(object_class, PROP_PATH,
g_param_spec_string (NM_OBJECT_DBUS_PATH,
@@ -185,6 +196,14 @@ nm_object_class_init (NMObjectClass *nm_object_class)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
+/**
+ * nm_object_get_connection:
+ * @object: a #NMObject
+ *
+ * Gets the #NMObject's DBusGConnection.
+ *
+ * Returns: the connection
+ **/
DBusGConnection *
nm_object_get_connection (NMObject *object)
{
@@ -193,6 +212,15 @@ nm_object_get_connection (NMObject *object)
return NM_OBJECT_GET_PRIVATE (object)->connection;
}
+/**
+ * nm_object_get_path:
+ * @object: a #NMObject
+ *
+ * Gets the DBus path of the #NMObject.
+ *
+ * Returns: the object's path. This is the internal string used by the
+ * device, and must not be modified.
+ **/
const char *
nm_object_get_path (NMObject *object)
{
diff --git a/libnm-glib/nm-serial-device.c b/libnm-glib/nm-serial-device.c
index 65815d9cf8..2baf1a2751 100644
--- a/libnm-glib/nm-serial-device.c
+++ b/libnm-glib/nm-serial-device.c
@@ -26,6 +26,15 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
+/**
+ * nm_serial_device_get_bytes_received:
+ * @self: a #NMSerialDevice
+ *
+ * Gets the amount of bytes received by the serial device.
+ * This counter is reset when the device is activated.
+ *
+ * Returns: bytes received
+ **/
guint32
nm_serial_device_get_bytes_received (NMSerialDevice *self)
{
@@ -34,6 +43,15 @@ nm_serial_device_get_bytes_received (NMSerialDevice *self)
return NM_SERIAL_DEVICE_GET_PRIVATE (self)->in_bytes;
}
+/**
+ * nm_serial_device_get_bytes_sent:
+ * @self: a #NMSerialDevice
+ *
+ * Gets the amount of bytes sent by the serial device.
+ * This counter is reset when the device is activated.
+ *
+ * Returns: bytes sent
+ **/
guint32
nm_serial_device_get_bytes_sent (NMSerialDevice *self)
{
@@ -148,6 +166,15 @@ nm_serial_device_class_init (NMSerialDeviceClass *device_class)
object_class->dispose = dispose;
/* Signals */
+
+ /**
+ * NMSerialDevice::ppp-stats:
+ * @device: the serial device that received the signal
+ * @in_bytes: the amount of bytes received
+ * @out_bytes: the amount of bytes sent
+ *
+ * Notifies that a #NMAccessPoint is added to the wifi device.
+ **/
signals[PPP_STATS] =
g_signal_new ("ppp-stats",
G_OBJECT_CLASS_TYPE (object_class),