1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* signals.h Bus signal connection implementation
4 * Copyright (C) 2003 Red Hat, Inc.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 #include <dbus/dbus.h>
28 #include <dbus/dbus-string.h>
29 #include <dbus/dbus-sysdeps.h>
30 #include "connection.h"
34 BUS_MATCH_MESSAGE_TYPE = 1 << 0,
35 BUS_MATCH_INTERFACE = 1 << 1,
36 BUS_MATCH_MEMBER = 1 << 2,
37 BUS_MATCH_SENDER = 1 << 3,
38 BUS_MATCH_DESTINATION = 1 << 4,
39 BUS_MATCH_PATH = 1 << 5,
40 BUS_MATCH_ARGS = 1 << 6,
41 BUS_MATCH_PATH_NAMESPACE = 1 << 7,
42 BUS_MATCH_CLIENT_IS_EAVESDROPPING = 1 << 8
45 BusMatchRule* bus_match_rule_new (DBusConnection *matches_go_to);
46 BusMatchRule* bus_match_rule_ref (BusMatchRule *rule);
47 void bus_match_rule_unref (BusMatchRule *rule);
49 dbus_bool_t bus_match_rule_set_message_type (BusMatchRule *rule,
51 dbus_bool_t bus_match_rule_set_interface (BusMatchRule *rule,
52 const char *interface);
53 dbus_bool_t bus_match_rule_set_member (BusMatchRule *rule,
55 dbus_bool_t bus_match_rule_set_sender (BusMatchRule *rule,
57 dbus_bool_t bus_match_rule_set_destination (BusMatchRule *rule,
58 const char *destination);
59 dbus_bool_t bus_match_rule_set_path (BusMatchRule *rule,
61 dbus_bool_t is_namespace);
62 dbus_bool_t bus_match_rule_set_arg (BusMatchRule *rule,
64 const DBusString *value,
66 dbus_bool_t is_namespace);
68 /* Calling this methods a client declares that it is creating a rule which
69 * needs to eavesdrop (e.g., dbus-monitor), any other created rules not
70 * setting themselves as eavesdropping won't receive any message not addressed
71 * to them, when eavedrop is enabled in the policy. On the other hand, when
72 * eavedrop is not enabled in policy, this method won't have any effect */
73 void bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule,
74 dbus_bool_t is_eavesdropping);
76 dbus_bool_t bus_match_rule_get_client_is_eavesdropping (BusMatchRule *rule);
78 BusMatchRule* bus_match_rule_parse (DBusConnection *matches_go_to,
79 const DBusString *rule_text,
82 #ifdef DBUS_ENABLE_STATS
83 dbus_bool_t bus_match_rule_dump (BusMatchmaker *matchmaker,
84 DBusConnection *conn_filter,
85 DBusMessageIter *arr_iter);
88 BusMatchmaker* bus_matchmaker_new (void);
89 BusMatchmaker* bus_matchmaker_ref (BusMatchmaker *matchmaker);
90 void bus_matchmaker_unref (BusMatchmaker *matchmaker);
92 dbus_bool_t bus_matchmaker_add_rule (BusMatchmaker *matchmaker,
94 dbus_bool_t bus_matchmaker_remove_rule_by_value (BusMatchmaker *matchmaker,
97 void bus_matchmaker_remove_rule (BusMatchmaker *matchmaker,
99 void bus_matchmaker_disconnected (BusMatchmaker *matchmaker,
100 DBusConnection *connection);
101 dbus_bool_t bus_matchmaker_get_recipients (BusMatchmaker *matchmaker,
102 BusConnections *connections,
103 DBusConnection *sender,
104 DBusConnection *addressed_recipient,
105 DBusMessage *message,
106 DBusList **recipients_p);
108 #endif /* BUS_SIGNALS_H */