~ubuntu-branches/ubuntu/trusty/systemd/trusty

« back to all changes in this revision

Viewing changes to src/libsystemd-bus/bus-match.h

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Michael Biebl, Michael Stapelberg, Daniel Schaal, Ondrej Balaz
  • Date: 2013-09-12 00:13:11 UTC
  • mfrom: (1.1.11) (9.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: package-import@ubuntu.com-20130912001311-dz35it34wr2lbday
Tags: 204-3
[ Michael Biebl ]
* Upload to unstable.
* Use /bin/bash in debug-shell.service as Debian doesn't have /sbin/sushell.
* Only import net.ifaces cmdline property for network devices.
* Generate strict dependencies between the binary packages using a
  shlibs.local file and add an explicit versioned dependency on
  libsystemd-login0 to systemd to ensure packages are upgraded in sync.
  Closes: #719444
* Drop obsolete Replaces: libudev0 from udev package.
* Use correct paths for various binaries, like /sbin/quotaon, which are
  installed in / and not /usr in Debian.  Closes: #721347
* Don't install kernel-install(8) man page since we don't install the
  corresponding binary either.  Closes: #722180
* Cherry-pick upstream fixes to make switching runlevels and starting
  reboot via ctrl-alt-del more robust.
* Cherry-pick upstream fix to properly apply ACLs to Journal files.

[ Michael Stapelberg ]
* Make systemctl enable|disable call update-rc.d for SysV init scripts.
  Closes: #709780
* Don't mount /tmp as tmpfs by default and make it possible to enable this
  feature via "systemctl enable tmp.mount".

[ Daniel Schaal ]
* Add bug-script to systemd and udev.  Closes: #711245

[ Ondrej Balaz ]
* Recognize discard option in /etc/crypttab.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
2
 
 
3
#pragma once
 
4
 
 
5
/***
 
6
  This file is part of systemd.
 
7
 
 
8
  Copyright 2013 Lennart Poettering
 
9
 
 
10
  systemd is free software; you can redistribute it and/or modify it
 
11
  under the terms of the GNU Lesser General Public License as published by
 
12
  the Free Software Foundation; either version 2.1 of the License, or
 
13
  (at your option) any later version.
 
14
 
 
15
  systemd is distributed in the hope that it will be useful, but
 
16
  WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
18
  Lesser General Public License for more details.
 
19
 
 
20
  You should have received a copy of the GNU Lesser General Public License
 
21
  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
22
***/
 
23
 
 
24
#include "hashmap.h"
 
25
 
 
26
#include "sd-bus.h"
 
27
 
 
28
enum bus_match_node_type {
 
29
        BUS_MATCH_ROOT,
 
30
        BUS_MATCH_VALUE,
 
31
        BUS_MATCH_LEAF,
 
32
 
 
33
        /* The following are all different kinds of compare nodes */
 
34
        BUS_MATCH_MESSAGE_TYPE,
 
35
        BUS_MATCH_SENDER,
 
36
        BUS_MATCH_DESTINATION,
 
37
        BUS_MATCH_INTERFACE,
 
38
        BUS_MATCH_MEMBER,
 
39
        BUS_MATCH_PATH,
 
40
        BUS_MATCH_PATH_NAMESPACE,
 
41
        BUS_MATCH_ARG,
 
42
        BUS_MATCH_ARG_LAST = BUS_MATCH_ARG + 63,
 
43
        BUS_MATCH_ARG_PATH,
 
44
        BUS_MATCH_ARG_PATH_LAST = BUS_MATCH_ARG_PATH + 63,
 
45
        BUS_MATCH_ARG_NAMESPACE,
 
46
        BUS_MATCH_ARG_NAMESPACE_LAST = BUS_MATCH_ARG_NAMESPACE + 63,
 
47
        _BUS_MATCH_NODE_TYPE_MAX,
 
48
        _BUS_MATCH_NODE_TYPE_INVALID = -1
 
49
};
 
50
 
 
51
struct bus_match_node {
 
52
        enum bus_match_node_type type;
 
53
        struct bus_match_node *parent, *next, *prev, *child;
 
54
 
 
55
        union {
 
56
                struct {
 
57
                        char *str;
 
58
                        uint8_t u8;
 
59
                } value;
 
60
                struct {
 
61
                        sd_bus_message_handler_t callback;
 
62
                        void *userdata;
 
63
                        unsigned last_iteration;
 
64
                } leaf;
 
65
                struct {
 
66
                        /* If this is set, then the child is NULL */
 
67
                        Hashmap *children;
 
68
                } compare;
 
69
        };
 
70
};
 
71
 
 
72
int bus_match_run(sd_bus *bus, struct bus_match_node *root, int ret, sd_bus_message *m);
 
73
 
 
74
int bus_match_add(struct bus_match_node *root, const char *match, sd_bus_message_handler_t callback, void *userdata, struct bus_match_node **ret);
 
75
int bus_match_remove(struct bus_match_node *root, const char *match, sd_bus_message_handler_t callback, void *userdata);
 
76
 
 
77
void bus_match_free(struct bus_match_node *node);
 
78
 
 
79
void bus_match_dump(struct bus_match_node *node, unsigned level);
 
80
 
 
81
const char* bus_match_node_type_to_string(enum bus_match_node_type t, char buf[], size_t l);
 
82
enum bus_match_node_type bus_match_node_type_from_string(const char *k, size_t n);