Commit 4b823a86 authored by Dan Winship's avatar Dan Winship

core: port NMBusManager to gdbus

Also remove some now-unused NMBusManager API
parent 073991f5
......@@ -258,4 +258,23 @@ _g_key_file_save_to_file (GKeyFile *key_file,
#endif
#if GLIB_CHECK_VERSION (2, 36, 0)
#define g_credentials_get_unix_pid(creds, error) \
G_GNUC_EXTENSION ({ \
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
(g_credentials_get_unix_pid) ((creds), (error)); \
G_GNUC_END_IGNORE_DEPRECATIONS \
})
#else
#define g_credentials_get_unix_pid(creds, error) \
G_GNUC_EXTENSION ({ \
struct ucred *native_creds; \
\
native_creds = g_credentials_get_native ((creds), G_CREDENTIALS_TYPE_LINUX_UCRED); \
g_assert (native_creds); \
native_creds->pid; \
})
#endif
#endif /* __NM_GLIB_H__ */
This diff is collapsed.
......@@ -23,17 +23,11 @@
#define __NM_BUS_MANAGER_H__
#include "config.h"
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#include "nm-default.h"
G_BEGIN_DECLS
typedef gboolean (* NMDBusSignalHandlerFunc) (DBusConnection * connection,
DBusMessage * message,
gpointer user_data);
#define NM_TYPE_BUS_MANAGER (nm_bus_manager_get_type ())
#define NM_BUS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), NM_TYPE_BUS_MANAGER, NMBusManager))
#define NM_BUS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), NM_TYPE_BUS_MANAGER, NMBusManagerClass))
......@@ -42,7 +36,6 @@ typedef gboolean (* NMDBusSignalHandlerFunc) (DBusConnection * connection,
#define NM_BUS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), NM_TYPE_BUS_MANAGER, NMBusManagerClass))
#define NM_BUS_MANAGER_DBUS_CONNECTION_CHANGED "dbus-connection-changed"
#define NM_BUS_MANAGER_NAME_OWNER_CHANGED "name-owner-changed"
#define NM_BUS_MANAGER_PRIVATE_CONNECTION_NEW "private-connection-new"
#define NM_BUS_MANAGER_PRIVATE_CONNECTION_DISCONNECTED "private-connection-disconnected"
......@@ -55,18 +48,13 @@ typedef struct {
/* Signals */
void (*dbus_connection_changed) (NMBusManager *mgr,
DBusConnection *connection);
void (*name_owner_changed) (NMBusManager *mgr,
const char *name,
const char *old_owner,
const char *new_owner);
GDBusConnection *connection);
void (*private_connection_new) (NMBusManager *mgr,
DBusGConnection *connection);
GDBusConnection *connection);
void (*private_connection_disconnected) (NMBusManager *mgr,
DBusGConnection *connection);
GDBusConnection *connection);
} NMBusManagerClass;
GType nm_bus_manager_get_type (void);
......@@ -74,20 +62,12 @@ GType nm_bus_manager_get_type (void);
NMBusManager * nm_bus_manager_get (void);
void nm_bus_manager_setup (NMBusManager *instance);
char * nm_bus_manager_get_name_owner (NMBusManager *self,
const char *name,
GError **error);
gboolean nm_bus_manager_start_service (NMBusManager *self);
gboolean nm_bus_manager_name_has_owner (NMBusManager *self,
const char *name);
DBusConnection * nm_bus_manager_get_dbus_connection (NMBusManager *self);
DBusGConnection * nm_bus_manager_get_connection (NMBusManager *self);
GDBusConnection * nm_bus_manager_get_connection (NMBusManager *self);
gboolean nm_bus_manager_get_caller_info (NMBusManager *self,
DBusGMethodInvocation *context,
GDBusMethodInvocation *context,
char **out_sender,
gulong *out_uid,
gulong *out_pid);
......@@ -97,8 +77,8 @@ gboolean nm_bus_manager_get_unix_user (NMBusManager *self,
gulong *out_uid);
gboolean nm_bus_manager_get_caller_info_from_message (NMBusManager *self,
DBusConnection *connection,
DBusMessage *message,
GDBusConnection *connection,
GDBusMessage *message,
char **out_sender,
gulong *out_uid,
gulong *out_pid);
......@@ -109,20 +89,20 @@ void nm_bus_manager_register_object (NMBusManager *self,
void nm_bus_manager_unregister_object (NMBusManager *self, gpointer object);
gpointer nm_bus_manager_get_registered_object (NMBusManager *self,
const char *path);
void nm_bus_manager_private_server_register (NMBusManager *self,
const char *path,
const char *tag);
DBusGProxy *nm_bus_manager_new_proxy (NMBusManager *self,
DBusGMethodInvocation *context,
GDBusProxy *nm_bus_manager_new_proxy (NMBusManager *self,
GDBusMethodInvocation *context,
GType proxy_type,
const char *name,
const char *path,
const char *iface);
#if !HAVE_DBUS_GLIB_GMI_GET_CONNECTION
DBusGConnection *dbus_g_method_invocation_get_g_connection (DBusGMethodInvocation *context);
#endif
G_END_DECLS
#endif /* __NM_BUS_MANAGER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment