2004-07-24 Havoc Pennington <hp@redhat.com>
[platform/upstream/dbus.git] / bus / selinux.h
1 /* selinux.h  SELinux security check headers for D-BUS
2  *
3  * Author: Matthew Rickard <mjricka@epoch.ncsc.mil>
4  *
5  * Licensed under the Academic Free License version 2.0
6  * 
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  *
21  */
22
23 #ifndef BUS_SELINUX_H
24 #define BUS_SELINUX_H
25
26 #include <dbus/dbus-hash.h>
27 #include <dbus/dbus-connection.h>
28 #include "services.h"
29
30 dbus_bool_t bus_selinux_init     (void);
31 void        bus_selinux_shutdown (void);
32
33 void bus_selinux_id_ref    (BusSELinuxID *sid);
34 void bus_selinux_id_unref  (BusSELinuxID *sid);
35
36 DBusHashTable* bus_selinux_id_table_new    (void);
37 BusSELinuxID*  bus_selinux_id_table_lookup (DBusHashTable    *service_table,
38                                             const DBusString *service_name);
39 dbus_bool_t    bus_selinux_id_table_insert (DBusHashTable    *service_table,
40                                             const char       *service_name,
41                                             const char       *service_context);
42 DBusHashTable* bus_selinux_id_table_union  (DBusHashTable    *base,
43                                             DBusHashTable    *override);
44 void           bus_selinux_id_table_print  (DBusHashTable    *service_table);
45
46
47
48 dbus_bool_t bus_selinux_allows_acquire_service (DBusConnection *connection,
49                                                 BusSELinuxID   *service_sid);
50 dbus_bool_t bus_selinux_allows_send            (DBusConnection *sender,
51                                                 DBusConnection *proposed_recipient);
52
53
54
55 BusSELinuxID* bus_selinux_init_connection_id (DBusConnection *connection,
56                                               DBusError      *error);
57
58
59
60 #endif /* BUS_SELINUX_H */