4 * Created on: Feb 26, 2014
8 #ifndef DBUS_SIGNALS_H_
9 #define DBUS_SIGNALS_H_
11 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
12 /* signals.h Bus signal connection implementation
14 * Copyright (C) 2003 Red Hat, Inc.
16 * Licensed under the Academic Free License version 2.1
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software
30 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34 #include <dbus/dbus.h>
35 #include <dbus/dbus-string.h>
36 #include <dbus/dbus-sysdeps.h>
37 #include <dbus/dbus-transport.h>
39 typedef struct Matchmaker Matchmaker;
40 typedef struct MatchRule MatchRule;
42 #ifndef MATCH_ARG_NAMESPACE
43 #define MATCH_ARG_NAMESPACE 0x4000000u
45 #ifndef MATCH_ARG_IS_PATH
46 #define MATCH_ARG_IS_PATH 0x8000000u
51 MATCH_MESSAGE_TYPE = 1 << 0,
52 MATCH_INTERFACE = 1 << 1,
53 MATCH_MEMBER = 1 << 2,
54 MATCH_SENDER = 1 << 3,
55 MATCH_DESTINATION = 1 << 4,
58 MATCH_PATH_NAMESPACE = 1 << 7,
59 MATCH_CLIENT_IS_EAVESDROPPING = 1 << 8
62 void match_rule_unref (MatchRule *rule);
63 void match_rule_set_cookie (MatchRule *rule, dbus_uint64_t cookie);
64 dbus_uint64_t match_rule_get_cookie (MatchRule *rule);
66 /* Calling this methods a client declares that it is creating a rule which
67 * needs to eavesdrop (e.g., dbus-monitor), any other created rules not
68 * setting themselves as eavesdropping won't receive any message not addressed
69 * to them, when eavedrop is enabled in the policy. On the other hand, when
70 * eavedrop is not enabled in policy, this method won't have any effect */
71 //void bus_match_rule_set_client_is_eavesdropping (BusMatchRule *rule,
72 // dbus_bool_t is_eavesdropping);
74 DBusList ** matchmaker_get_rules (Matchmaker *matchmaker,
76 const char *interface,
79 MatchRule* match_rule_parse (DBusConnection *matches_go_to,
80 const DBusString *rule_text,
83 dbus_bool_t match_rule_equal_lib (MatchRule *a, MatchRule *b);
86 Matchmaker* matchmaker_new (void);
88 dbus_bool_t matchmaker_add_rule (Matchmaker *matchmaker,
90 DBusList* matchmaker_get_rules_list (Matchmaker *matchmaker,
92 dbus_bool_t matchmaker_remove_rule_by_value (Matchmaker *matchmaker,
95 void free_matchmaker (Matchmaker *matchmaker);
97 dbus_bool_t match_rule_matches (DBusTransport *transport,
100 MatchFlags already_matched);
102 #ifdef DBUS_ENABLE_VERBOSE_MODE
103 char* match_rule_to_string (MatchRule *rule);
106 int _match_rule_get_message_type (MatchRule *rule);
107 const char * _match_rule_get_interface (MatchRule *rule);
108 const char * _match_rule_get_member (MatchRule *rule);
109 const char * _match_rule_get_sender (MatchRule *rule);
110 const char * _match_rule_get_destination (MatchRule *rule);
111 const char * _match_rule_get_path (MatchRule *rule);
112 const char * _match_rule_get_path_namespace (MatchRule *rule);
113 int _match_rule_get_args_len (MatchRule *rule);
114 const char * _match_rule_get_args (MatchRule *rule, int i);
115 unsigned int _match_rule_get_arg_lens (MatchRule *rule, int i);
117 #endif /* DBUS_SIGNALS_H_ */