1 /* -*- mode: C; c-file-style: "gnu" -*- */
2 /* policy.h Bus security policy
4 * Copyright (C) 2003 Red Hat, Inc.
6 * Licensed under the Academic Free License version 1.2
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.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <dbus/dbus.h>
28 #include <dbus/dbus-string.h>
34 BUS_POLICY_RULE_RECEIVE,
44 BusPolicyRuleType type;
46 unsigned int allow : 1; /**< #TRUE if this allows, #FALSE if it denies */
52 /* either can be NULL meaning "any" */
59 /* either can be NULL meaning "any" */
66 /* can be NULL meaning "any" */
85 BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type,
87 void bus_policy_rule_ref (BusPolicyRule *rule);
88 void bus_policy_rule_unref (BusPolicyRule *rule);
90 BusPolicy* bus_policy_new (void);
91 void bus_policy_ref (BusPolicy *policy);
92 void bus_policy_unref (BusPolicy *policy);
93 BusClientPolicy* bus_policy_create_client_policy (BusPolicy *policy,
94 DBusConnection *connection);
95 dbus_bool_t bus_policy_allow_user (BusPolicy *policy,
98 BusClientPolicy* bus_client_policy_new (void);
99 void bus_client_policy_ref (BusClientPolicy *policy);
100 void bus_client_policy_unref (BusClientPolicy *policy);
101 dbus_bool_t bus_client_policy_check_can_send (BusClientPolicy *policy,
102 BusRegistry *registry,
103 DBusConnection *receiver,
104 DBusMessage *message);
105 dbus_bool_t bus_client_policy_check_can_receive (BusClientPolicy *policy,
106 BusRegistry *registry,
107 DBusConnection *sender,
108 DBusMessage *message);
109 dbus_bool_t bus_client_policy_check_can_own (BusClientPolicy *policy,
110 DBusConnection *connection,
111 const DBusString *service_name);
112 dbus_bool_t bus_client_policy_append_rule (BusClientPolicy *policy,
113 BusPolicyRule *rule);
114 void bus_client_policy_optimize (BusClientPolicy *policy);
117 #endif /* BUS_POLICY_H */