1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* check.h Bus security policy runtime check
4 * Copyright (C) 2014 Intel, Inc.
5 * Copyright (c) 2014 Samsung Electronics, Ltd.
7 * Licensed under the Academic Free License version 2.1
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
32 typedef void (*BusCheckResponseFunc) (BusDeferredMessage *message,
36 BUS_DEFERRED_MESSAGE_CHECK_SEND = 1 << 0,
37 BUS_DEFERRED_MESSAGE_CHECK_RECEIVE = 1 << 1,
38 BUS_DEFERRED_MESSAGE_CHECK_OWN = 1 << 2,
39 } BusDeferredMessageStatus;
42 BusCheck *bus_check_new (BusContext *context,
44 BusCheck *bus_check_ref (BusCheck *check);
45 void bus_check_unref (BusCheck *check);
47 BusContext *bus_check_get_context (BusCheck *check);
48 BusCynara *bus_check_get_cynara (BusCheck *check);
49 BusResult bus_check_privilege (BusCheck *check,
51 DBusConnection *sender,
52 DBusConnection *addressed_recipient,
53 DBusConnection *proposed_recipient,
54 const char *privilege,
55 BusDeferredMessageStatus check_type,
56 BusDeferredMessage **deferred_message);
59 BusDeferredMessage *bus_deferred_message_new (DBusMessage *message,
60 DBusConnection *sender,
61 DBusConnection *addressed_recipient,
62 DBusConnection *proposed_recipient,
65 BusDeferredMessage *bus_deferred_message_ref (BusDeferredMessage *deferred_message);
66 void bus_deferred_message_unref (BusDeferredMessage *deferred_message);
67 BusResult bus_deferred_message_dispatch (BusDeferredMessage *deferred_message);
68 dbus_bool_t bus_deferred_message_waits_for_check (BusDeferredMessage *deferred_message);
69 DBusConnection *bus_deferred_message_get_recipient (BusDeferredMessage *deferred_message);
70 void bus_deferred_message_response_received (BusDeferredMessage *deferred_message,
72 dbus_bool_t bus_deferred_message_queue_at_recipient (BusDeferredMessage *deferred_message,
73 BusTransaction *transaction,
74 dbus_bool_t full_dispatch,
76 dbus_bool_t bus_deferred_message_replace (BusDeferredMessage *old_message,
77 BusDeferredMessage *new_message);
78 void bus_deferred_message_disable_sender (BusDeferredMessage *deferred_message);
79 BusResult bus_deferred_message_get_response (BusDeferredMessage *deferred_message);
81 BusDeferredMessageStatus bus_deferred_message_get_status (BusDeferredMessage *deferred_message);
84 dbus_bool_t bus_deferred_message_expect_method_reply (BusDeferredMessage *deferred_message,
85 BusTransaction *transaction,
87 void bus_deferred_message_create_error (BusDeferredMessage *deferred_message,
88 const char *error_message,
90 void bus_deferred_message_set_policy_check_info (BusDeferredMessage *deferred_message,
91 dbus_bool_t requested_reply,
93 const char *privilege);
94 dbus_bool_t bus_deferred_message_check_message_limits (BusDeferredMessage *deferred_message,
98 #ifdef DBUS_ENABLE_EMBEDDED_TESTS
99 extern dbus_bool_t (*bus_check_test_override) (DBusConnection *connection,
100 const char *privilege);
103 #endif /* BUS_CHECK_H */