+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.
+
2008-08-12 Tambet Ingo <tambet@gmail.com>
* src/backends/*: Get rid of nm_system_should_modify_resolv_conf().
callouts \
system-settings \
tools \
- policy
+ policy \
+ docs/libnm-glib
EXTRA_DIST = \
CONTRIBUTING \
}
(cd $srcdir;
+ gtkdocize || exit 1
autoreconf --install --symlink &&
intltoolize --force &&
autoreconf &&
AC_MSG_RESULT(no)
fi
+GTK_DOC_CHECK(1.0)
+
AC_CONFIG_FILES([
Makefile
include/Makefile
man/nm-tool.1
po/Makefile.in
policy/Makefile
+docs/libnm-glib/Makefile
NetworkManager.pc
])
AC_OUTPUT
--- /dev/null
+## Process this file with automake to produce Makefile.in
+AUTOMAKE_OPTIONS = 1.6
+
+# The name of the module
+DOC_MODULE=libnm-glib
+
+# The top-level SGML file.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting functions and macros.
+DOC_SOURCE_DIR=../../libnm-glib
+
+# Extra options to supply to gtkdoc-scan.
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-scangobj.
+SCANGOBJ_OPTIONS=--type-init-func 'g_type_init();'
+
+# Extra options to supply to gtkdoc-mkdb.
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-fixref.
+FIXXREF_OPTIONS=
+
+# Used for dependencies.
+HFILE_GLOB=
+CFILE_GLOB=
+
+# Header files to ignore when scanning.
+IGNORE_HFILES= \
+ nm-dbus-utils.h \
+ nm-device-private.h \
+ nm-object-cache.h \
+ nm-object-private.h \
+ nm-types-private.h \
+ nm-access-point-bindings.h \
+ nm-client-bindings.h \
+ nm-device-bindings.h \
+ nm-device-ethernet-bindings.h \
+ nm-device-wifi-bindings.h \
+ nm-exported-connection-glue.h \
+ nm-exported-connection-bindings.h \
+ nm-settings-glue.h \
+ nm-settings-bindings.h \
+ nm-settings-system-bindings.h \
+ nm-vpn-connection-bindings.h \
+ nm-vpn-plugin-glue.h \
+ nm-active-connection-bindings.h \
+ nm-ip4-config-bindings.h \
+ nm-dhcp4-config-bindings.h
+
+# Images to copy into HTML directory.
+HTML_IMAGES =
+
+# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
+content_files =
+
+# Other files to distribute.
+extra_files =
+
+
+# CFLAGS and LDFLAGS for compiling scan program. Only needed
+# if $(DOC_MODULE).types is non-empty.
+GTKDOC_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/libnm-util \
+ -I$(top_builddir)/marshallers \
+ -I$(top_srcdir)/libnm-glib \
+ $(GLIB_CFLAGS) \
+ $(DBUS_CFLAGS)
+
+GTKDOC_LIBS = $(top_builddir)/libnm-glib/libnm_glib.la
+
+
+# include common portion ...
+include $(top_srcdir)/gtk-doc.make
+
--- /dev/null
+#include <nm-client.h>
+#include <nm-device-ethernet.h>
+#include <nm-device-wifi.h>
+#include <nm-cdma-device.h>
+#include <nm-gsm-device.h>
+#include <nm-serial-device.h>
+
+nm_object_get_type
+nm_client_get_type
+nm_device_get_type
+nm_device_ethernet_get_type
+nm_device_wifi_get_type
+nm_gsm_device_get_type
+nm_cdma_device_get_type
+nm_serial_device_get_type
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)
{
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,
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,
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,
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,
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,
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),
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),
G_TYPE_OBJECT);
}
+/**
+ * nm_client_new:
+ *
+ * Creates a new #NMClient.
+ *
+ * Returns: a new #NMClient
+ **/
NMClient *
nm_client_new (void)
{
}
}
+/**
+ * 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)
{
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)
{
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,
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)
{
}
}
+/**
+ * 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)
{
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)
{
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)
{
&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)
{
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)
{
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)
{
}
}
+/**
+ * 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)
{
#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)
{
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)
{
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)
{
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)
{
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,
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,
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,
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
}
}
+/**
+ * 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)
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,
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,
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,
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,
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,
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),
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),
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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),
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)
{
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)
{
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)
{
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)
{
return priv->driver;
}
+/**
+ * nm_device_get_capabilities:
+ * @device: a #NMDevice
+ *
+ * Gets the device' capabilities.
+ *
+ * Returns: the capabilities
+ **/
guint32
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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,
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,
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)
{
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)
{
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)
{
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)
{
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),