1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* kdbus-d.h kdbus related daemon functions
4 * Copyright (C) 2013 Samsung Electronics
6 * Licensed under the Academic Free License version 2.1
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version and under the terms of the GNU
12 * Lesser General Public License as published by the
13 * Free Software Foundation; either version 2.1 of the License, or (at
14 * your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <dbus/dbus-bus.h>
33 #include <dbus/dbus-server.h>
34 #include <linux/types.h>
35 #include <dbus/dbus-transport-kdbus.h>
37 __u64 sender_name_to_id(const char* name, DBusError* error);
38 char* make_kdbus_bus(DBusBusType type, DBusError *error);
39 DBusServer* empty_server_init(char* address);
41 dbus_bool_t kdbus_register_policy (const DBusString *service_name, DBusConnection* connection);
42 dbus_uint32_t kdbus_request_name(DBusConnection* connection, const DBusString *service_name, dbus_uint32_t flags, __u64 sender_id);
43 dbus_uint32_t kdbus_release_name(DBusConnection* connection, const DBusString *service_name, __u64 sender_id);
44 dbus_bool_t kdbus_list_services (DBusConnection* connection, char ***listp, int *array_len);
45 dbus_bool_t kdbus_add_match_rule (DBusConnection* connection, DBusMessage* message, const char* text, DBusError* error);
46 dbus_bool_t kdbus_remove_match (DBusConnection* connection, DBusMessage* message, DBusError* error);
48 dbus_bool_t add_match_kdbus (DBusTransport* transport, __u64 id, const char *rule);
49 dbus_bool_t remove_match_kdbus (DBusTransport* transport, __u64 id);
59 int kdbus_NameQuery(const char* name, DBusTransport* transport, struct nameInfo* pInfo);
61 int kdbus_get_name_owner(DBusConnection* connection, const char* name, char* owner);
62 dbus_bool_t kdbus_get_unix_user(DBusConnection* connection, const char* name, unsigned long* uid, DBusError* error);
63 dbus_bool_t kdbus_get_connection_unix_process_id(DBusConnection* connection, const char* name, unsigned long* pid, DBusError* error);
64 dbus_bool_t kdbus_get_connection_unix_selinux_security_context(DBusConnection* connection, DBusMessage* message, DBusMessage* reply, DBusError* error);
66 dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection, unsigned long *uid);
67 dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection, unsigned long *pid);
69 DBusConnection* daemon_as_client(DBusBusType type, char* address, DBusError *error);
70 dbus_bool_t register_daemon_name(DBusConnection* connection);
71 DBusConnection* create_phantom_connection(DBusConnection* connection, const char* unique_name, DBusError* error);
72 dbus_bool_t register_kdbus_starters(DBusConnection* connection);
73 dbus_bool_t update_kdbus_starters(DBusConnection* connection);
75 void handleNameOwnerChanged(DBusMessage *msg, BusTransaction *transaction, DBusConnection *connection);