4 #define E_NM_PATH "/org/freedesktop/NetworkManager"
5 #define _E_NM_SERVICE "org.freedesktop.NetworkManager"
6 #define _E_NM_INTERFACE "org.freedesktop.NetworkManager"
7 #define _E_NM_INTERFACE_ACCESSPOINT "org.freedesktop.NetworkManager.AccessPoint"
8 #define _E_NM_INTERFACE_DEVICE "org.freedesktop.NetworkManager.Device"
9 #define _E_NM_INTERFACE_DEVICE_WIRELESS "org.freedesktop.NetworkManager.Device.Wireless"
10 #define _E_NM_INTERFACE_DEVICE_WIRED "org.freedesktop.NetworkManager.Device.Wired"
11 #define _E_NM_INTERFACE_IP4CONFIG "org.freedesktop.NetworkManager.IP4Config"
12 #define _E_NM_INTERFACE_CONNECTION_ACTIVE "org.freedesktop.NetworkManager.Connection.Active"
13 #define _E_NMS_PATH "/org/freedesktop/NetworkManagerSettings"
14 #define E_NMS_SERVICE_SYSTEM "org.freedesktop.NetworkManagerSystemSettings"
15 #define E_NMS_SERVICE_USER "org.freedesktop.NetworkManagerUserSettings"
16 #define _E_NMS_INTERFACE "org.freedesktop.NetworkManagerSettings"
17 #define _E_NMS_INTERFACE_CONNECTION "org.freedesktop.NetworkManagerSettings.Connection"
19 #define e_nm_call_new(member) dbus_message_new_method_call(_E_NM_SERVICE, E_NM_PATH, _E_NM_INTERFACE, member)
20 #define e_nms_call_new(service, member) dbus_message_new_method_call(service, _E_NMS_PATH, _E_NMS_INTERFACE, member)
21 #define e_nms_connection_call_new(service, conn, member) dbus_message_new_method_call(service, conn, _E_NMS_INTERFACE_CONNECTION, member)
23 #define e_nm_properties_get(con, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, E_NM_PATH, _E_NM_INTERFACE, prop, (E_DBus_Method_Return_Cb) cb, data)
24 #define e_nm_access_point_properties_get(con, dev, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_ACCESSPOINT, prop, (E_DBus_Method_Return_Cb) cb, data)
25 #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)
26 #define e_nm_device_wired_properties_get(con, dev, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_DEVICE_WIRED, prop, (E_DBus_Method_Return_Cb) cb, data)
27 #define e_nm_device_wireless_properties_get(con, dev, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_DEVICE_WIRELESS, prop, (E_DBus_Method_Return_Cb) cb, data)
28 #define e_nm_ip4_config_properties_get(con, dev, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_IP4CONFIG, prop, (E_DBus_Method_Return_Cb) cb, data)
29 #define e_nm_active_connection_properties_get(con, dev, prop, cb, data) e_dbus_properties_get(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_CONNECTION_ACTIVE, prop, (E_DBus_Method_Return_Cb) cb, data)
31 #define e_nm_signal_handler_add(con, sig, cb, data) e_dbus_signal_handler_add(con, _E_NM_SERVICE, E_NM_PATH, _E_NM_INTERFACE, sig, cb, data)
32 #define e_nm_access_point_signal_handler_add(con, dev, sig, cb, data) e_dbus_signal_handler_add(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_ACCESSPOINT, sig, cb, data)
33 #define e_nm_device_signal_handler_add(con, dev, sig, cb, data) e_dbus_signal_handler_add(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_DEVICE, sig, cb, data)
34 #define e_nm_device_wired_signal_handler_add(con, dev, sig, cb, data) e_dbus_signal_handler_add(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_DEVICE_WIRED, sig, cb, data)
35 #define e_nm_device_wireless_signal_handler_add(con, dev, sig, cb, data) e_dbus_signal_handler_add(con, _E_NM_SERVICE, dev, _E_NM_INTERFACE_DEVICE_WIRELESS, sig, cb, data)
37 #define e_nms_signal_handler_add(con, service, sig, cb, data) e_dbus_signal_handler_add(con, service, _E_NMS_PATH, _E_NMS_INTERFACE, sig, cb, data)
39 typedef struct E_NM_Internal E_NM_Internal;
44 E_DBus_Connection *conn;
46 int (*state_changed)(E_NM *nm, E_NM_State state);
47 int (*properties_changed)(E_NM *nm);
48 int (*device_added)(E_NM *nm, const char *device);
49 int (*device_removed)(E_NM *nm, const char *device);
55 typedef struct E_NM_Device_Internal E_NM_Device_Internal;
56 struct E_NM_Device_Internal
62 int (*state_changed)(E_NM_Device *device, E_NM_State new_state, E_NM_State old_state, E_NM_Device_State_Reason reason);
63 int (*properties_changed)(E_NM_Device *device);
69 typedef struct E_NM_Access_Point_Internal E_NM_Access_Point_Internal;
70 struct E_NM_Access_Point_Internal
76 int (*properties_changed)(E_NM_Access_Point *device);
82 typedef struct E_NM_IP4_Config_Internal E_NM_IP4_Config_Internal;
83 struct E_NM_IP4_Config_Internal
90 typedef struct E_NMS_Internal E_NMS_Internal;
95 int (*new_connection)(E_NMS *nms, E_NMS_Context context, const char *connection);
101 typedef struct E_NMS_Connection_Internal E_NMS_Connection_Internal;
102 struct E_NMS_Connection_Internal
106 E_NMS_Context context;
111 typedef struct E_NM_Active_Connection_Internal E_NM_Active_Connection_Internal;
112 struct E_NM_Active_Connection_Internal
114 E_NM_Active_Connection conn;
119 typedef int (*Object_Cb)(void *data, void *reply);
120 #define OBJECT_CB(function) ((Object_Cb)function)
122 typedef struct Property Property;
123 typedef struct Property_Data Property_Data;
128 void (*func)(Property_Data *data, DBusMessageIter *iter);
142 typedef struct Reply_Data Reply_Data;
146 int (*cb_func)(void *data, void *reply);
151 void property(void *data, DBusMessage *msg, DBusError *err);
152 void parse_properties(void *data, Property *properties, DBusMessage *msg);
154 void *cb_nm_object_path_list(DBusMessage *msg, DBusError *err);
155 void free_nm_object_path_list(void *data);
156 void *cb_nm_settings(DBusMessage *msg, DBusError *err);
157 void free_nm_settings(void *data);
159 int check_arg_type(DBusMessageIter *iter, char type);
161 void property_data_free(Property_Data *data);
163 const char *ip4_address2str(unsigned int address);