Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/e_dbus
Dir : e17/libs/e_dbus/src/lib/nm
Modified Files:
E_Nm.h e_nm_device.c e_nm_private.h
Log Message:
stefan's nm patches
===================================================================
RCS file: /cvs/e/e17/libs/e_dbus/src/lib/nm/E_Nm.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- E_Nm.h 14 Mar 2008 08:15:10 -0000 1.6
+++ E_Nm.h 25 Mar 2008 18:22:01 -0000 1.7
@@ -142,28 +142,24 @@
/* org.freedesktop.NetworkManager.Device api */
- EAPI int e_nm_device_get_name(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data);
+ EAPI int e_nm_device_get_udi(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data);
+ EAPI int e_nm_device_get_interface(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void
*data);
+ EAPI int e_nm_device_get_driver(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data);
+ EAPI int e_nm_device_get_capabilities(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void
*data);
+ EAPI int e_nm_device_get_ip4address(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void
*data);
+ EAPI int e_nm_device_get_state(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data);
+ EAPI int e_nm_device_get_ip4config(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void
*data);
+ EAPI int e_nm_device_get_carrier(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data);
EAPI int e_nm_device_get_type(E_NM_Context *ctx, const char *device,
E_DBus_Callback_Func cb_func, void *data);
- EAPI int e_nm_device_get_hal_udi(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data);
- EAPI int e_nm_device_get_ip4_address(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void
*data);
- EAPI int e_nm_device_get_link_active(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void
*data);
- EAPI int e_nm_device_wireless_get_strength(E_NM_Context *ctx,
- const char *device,
- E_DBus_Callback_Func cb_func,
- void *data);
- EAPI int e_nm_device_wireless_get_active_network(E_NM_Context *ctx,
- const char *device,
- E_DBus_Callback_Func
cb_func,
- void *data);
- EAPI int e_nm_device_wireless_get_networks(E_NM_Context *ctx,
- const char *device,
- E_DBus_Callback_Func cb_func,
- void *data);
/* org.freedesktop.NetworkManager.Devices api */
/* TODO: EAPI int e_nm_network_get_name() */
@@ -172,11 +168,6 @@
/* TODO: EAPI int e_nm_network_get_frequency() */
/* TODO: EAPI int e_nm_network_get_rate() */
/* TODO: EAPI int e_nm_network_get_encrypted() */
-
-/* org.freedesktop.NetworkManagerInfo api */
-/* signals */
-/* TODO: EAPI void e_nmi_callback_trusted_network_update() */
-/* TODO: EAPI void e_nmi_callback_preferred_network_update() */
#ifdef __cplusplus
}
===================================================================
RCS file: /cvs/e/e17/libs/e_dbus/src/lib/nm/e_nm_device.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_nm_device.c 4 Nov 2007 07:51:37 -0000 1.2
+++ e_nm_device.c 25 Mar 2008 18:22:01 -0000 1.3
@@ -1,17 +1,15 @@
/*
* This file defines functions that query each of the functions provided by
- * the NetworkManager Device interface.
+ * the org.freedesktop.NetworkManager.Device DBus interface.
*/
#include "E_Nm.h"
#include "e_nm_private.h"
#include <Ecore_Data.h>
+
/**
- * Get the system name of a NetworkManager device
- *
- * Returns an Ecore_List of dbus object paths for network devices. This list is
- * of const char *, and is freed automatically after the callback returns.
+ * Get the UDI of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -19,20 +17,33 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_get_name(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_udi(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getName",
- DBUS_TYPE_STRING);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Udi", cb_func, data);
}
/**
- * Return the type of a an NM device:
+ * Get the interface name of a NetworkManager device
*
- * 0: unknown
- * 1: wired
- * 2: wireless
+ * @param ctx an e_nm context
+ * @param device a NetworkManager device to communicate with
+ * @param cb a callback, used when the method returns (or an error is received)
+ * @param data user data to pass to the callback function
+ */
+EAPI int
+e_nm_device_get_interface(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
+{
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Interface", cb_func, data);
+}
+
+
+/**
+ * Get the driver name of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -40,16 +51,16 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_get_type(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_driver(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getType",
- DBUS_TYPE_INT32);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Driver", cb_func, data);
}
/**
- * Get the HAL UDI of a NetworkManager device
+ * Get the capabilities of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -57,11 +68,11 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_get_hal_udi(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_capabilities(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getHalUdi",
- DBUS_TYPE_STRING);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Capabilities", cb_func, data);
}
@@ -74,16 +85,16 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_get_ip4_address(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_ip4address(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getIP4Address",
- DBUS_TYPE_UINT32);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Ip4Address", cb_func, data);
}
/**
- * Get the link status of a NetworkManager device
+ * Get the state of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -91,17 +102,16 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_get_link_active(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_state(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getLinkActive",
- DBUS_TYPE_BOOLEAN);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "State", cb_func, data);
}
/**
- * Get the signal strength of a the wireless network that a NetworkManager
- * device is connected to.
+ * Get the IPv4 config object path of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -109,16 +119,16 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_wireless_get_strength(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_ip4config(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getStrength",
- DBUS_TYPE_INT32);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Ip4Config", cb_func, data);
}
/**
- * Find the NetworkManager device's currently associated wireless network
+ * Get the carrier status of a NetworkManager device
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -126,18 +136,20 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_wireless_get_active_network(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void
*data)
+e_nm_device_get_carrier(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- return e_nm_get_from_device(ctx, device, cb_func, data, "getActiveNetwork",
- DBUS_TYPE_STRING);
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "Carrier", cb_func, data);
}
/**
- * Get the list of available wireless networks
+ * Return the type of a an NM device:
*
- * Returns an Ecore_List of wireless network names
+ * 0: unknown
+ * 1: wired
+ * 2: wireless
*
* @param ctx an e_nm context
* @param device a NetworkManager device to communicate with
@@ -145,15 +157,9 @@
* @param data user data to pass to the callback function
*/
EAPI int
-e_nm_device_wireless_get_networks(E_NM_Context *ctx, const char *device,
- E_DBus_Callback_Func cb_func, void *data)
+e_nm_device_get_type(E_NM_Context *ctx, const char *device,
+ E_DBus_Callback_Func cb_func, void *data)
{
- DBusMessage *msg;
- int ret;
-
- msg = e_nm_device_call_new(device, "getNetworks");
- ret = e_dbus_method_call_send(ctx->conn, msg, cb_nm_string_list, cb_func,
free_nm_string_list, -1, data) ? 1 : 0;
- dbus_message_unref(msg);
- return ret;
+ /* FIXME: Decide how to handle the return value for this functions */
+ e_nm_device_properties_get(ctx->conn, device, "DeviceType", cb_func, data);
}
-
===================================================================
RCS file: /cvs/e/e17/libs/e_dbus/src/lib/nm/e_nm_private.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_nm_private.h 9 Mar 2008 16:08:42 -0000 1.2
+++ e_nm_private.h 25 Mar 2008 18:22:01 -0000 1.3
@@ -16,6 +16,7 @@
#define e_nm_network_call_new(member)
dbus_message_new_method_call(E_NM_SERVICE, E_NM_PATH_NETWORK_MANAGER,
E_NM_INTERFACE_NETWORK_MANAGER, member)
+#define e_nm_device_properties_get(con, dev, prop, cb, data)
e_dbus_properties_get(con, E_NM_SERVICE, dev, E_NM_INTERFACE_DEVICE, prop,
(E_DBus_Method_Return_Cb) cb, data)
struct E_NM_Context
{
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs