]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/dbus-execute.h
update TODO
[thirdparty/systemd.git] / src / dbus-execute.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foodbusexecutehfoo
4 #define foodbusexecutehfoo
5
6 /***
7 This file is part of systemd.
8
9 Copyright 2010 Lennart Poettering
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include <dbus/dbus.h>
26
27 #include "manager.h"
28
29 #define BUS_EXEC_STATUS_INTERFACE(prefix) \
30 " <property name=\"" prefix "StartTimestamp\" type=\"t\" access=\"read\"/>\n" \
31 " <property name=\"" prefix "ExitTimestamp\" type=\"t\" access=\"read\"/>\n" \
32 " <property name=\"" prefix "PID\" type=\"u\" access=\"read\"/>\n" \
33 " <property name=\"" prefix "Code\" type=\"i\" access=\"read\"/>\n" \
34 " <property name=\"" prefix "Status\" type=\"i\" access=\"read\"/>\n"
35
36 #define BUS_EXEC_CONTEXT_INTERFACE \
37 " <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
38 " <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \
39 " <property name=\"LimitCPU\" type=\"t\" access=\"read\"/>\n" \
40 " <property name=\"LimitFSIZE\" type=\"t\" access=\"read\"/>\n" \
41 " <property name=\"LimitDATA\" type=\"t\" access=\"read\"/>\n" \
42 " <property name=\"LimitSTACK\" type=\"t\" access=\"read\"/>\n" \
43 " <property name=\"LimitCORE\" type=\"t\" access=\"read\"/>\n" \
44 " <property name=\"LimitRSS\" type=\"t\" access=\"read\"/>\n" \
45 " <property name=\"LimitNOFILE\" type=\"t\" access=\"read\"/>\n" \
46 " <property name=\"LimitAS\" type=\"t\" access=\"read\"/>\n" \
47 " <property name=\"LimitNPROC\" type=\"t\" access=\"read\"/>\n" \
48 " <property name=\"LimitMEMLOCK\" type=\"t\" access=\"read\"/>\n" \
49 " <property name=\"LimitLOCKS\" type=\"t\" access=\"read\"/>\n" \
50 " <property name=\"LimitSIGPENDING\" type=\"t\" access=\"read\"/>\n" \
51 " <property name=\"LimitMSGQUEUE\" type=\"t\" access=\"read\"/>\n" \
52 " <property name=\"LimitNICE\" type=\"t\" access=\"read\"/>\n" \
53 " <property name=\"LimitRTPRIO\" type=\"t\" access=\"read\"/>\n" \
54 " <property name=\"LimitRTTIME\" type=\"t\" access=\"read\"/>\n" \
55 " <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/>\n" \
56 " <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>\n" \
57 " <property name=\"OOMScoreAdjust\" type=\"i\" access=\"read\"/>\n" \
58 " <property name=\"Nice\" type=\"i\" access=\"read\"/>\n" \
59 " <property name=\"IOScheduling\" type=\"i\" access=\"read\"/>\n" \
60 " <property name=\"CPUSchedulingPolicy\" type=\"i\" access=\"read\"/>\n" \
61 " <property name=\"CPUSchedulingPriority\" type=\"i\" access=\"read\"/>\n" \
62 " <property name=\"CPUAffinity\" type=\"ay\" access=\"read\"/>\n" \
63 " <property name=\"TimerSlackNS\" type=\"t\" access=\"read\"/>\n" \
64 " <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>\n" \
65 " <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \
66 " <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" \
67 " <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n" \
68 " <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" \
69 " <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \
70 " <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
71 " <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
72 " <property name=\"SyslogLevelPrefix\" type=\"b\" access=\"read\"/>\n" \
73 " <property name=\"Capabilities\" type=\"s\" access=\"read\"/>\n" \
74 " <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
75 " <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
76 " <property name=\"User\" type=\"s\" access=\"read\"/>\n" \
77 " <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \
78 " <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>\n" \
79 " <property name=\"TCPWrapName\" type=\"s\" access=\"read\"/>\n" \
80 " <property name=\"PAMName\" type=\"s\" access=\"read\"/>\n" \
81 " <property name=\"ReadWriteDirectories\" type=\"as\" access=\"read\"/>\n" \
82 " <property name=\"ReadOnlyDirectories\" type=\"as\" access=\"read\"/>\n" \
83 " <property name=\"InaccessibleDirectories\" type=\"as\" access=\"read\"/>\n" \
84 " <property name=\"MountFlags\" type=\"t\" access=\"read\"/>\n" \
85 " <property name=\"PrivateTmp\" type=\"b\" access=\"read\"/>\n" \
86 " <property name=\"SameProcessGroup\" type=\"b\" access=\"read\"/>\n" \
87 " <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \
88 " <property name=\"KillSignal\" type=\"i\" access=\"read\"/>\n" \
89 " <property name=\"UtmpIdentifier\" type=\"s\" access=\"read\"/>\n"
90
91 #define BUS_EXEC_COMMAND_INTERFACE(name) \
92 " <property name=\"" name "\" type=\"a(sasbttuii)\" access=\"read\"/>\n"
93
94 #define BUS_EXEC_CONTEXT_PROPERTIES(interface, context) \
95 { interface, "Environment", bus_property_append_strv, "as", (context).environment }, \
96 { interface, "EnvironmentFiles", bus_execute_append_env_files, "a(sb)", (context).environment_files }, \
97 { interface, "UMask", bus_property_append_mode, "u", &(context).umask }, \
98 { interface, "LimitCPU", bus_execute_append_rlimits, "t", &(context) }, \
99 { interface, "LimitFSIZE", bus_execute_append_rlimits, "t", &(context) }, \
100 { interface, "LimitDATA", bus_execute_append_rlimits, "t", &(context) }, \
101 { interface, "LimitSTACK", bus_execute_append_rlimits, "t", &(context) }, \
102 { interface, "LimitCORE", bus_execute_append_rlimits, "t", &(context) }, \
103 { interface, "LimitRSS", bus_execute_append_rlimits, "t", &(context) }, \
104 { interface, "LimitNOFILE", bus_execute_append_rlimits, "t", &(context) }, \
105 { interface, "LimitAS", bus_execute_append_rlimits, "t", &(context) }, \
106 { interface, "LimitNPROC", bus_execute_append_rlimits, "t", &(context) }, \
107 { interface, "LimitMEMLOCK", bus_execute_append_rlimits, "t", &(context) }, \
108 { interface, "LimitLOCKS", bus_execute_append_rlimits, "t", &(context) }, \
109 { interface, "LimitSIGPENDING", bus_execute_append_rlimits, "t", &(context) }, \
110 { interface, "LimitMSGQUEUE", bus_execute_append_rlimits, "t", &(context) }, \
111 { interface, "LimitNICE", bus_execute_append_rlimits, "t", &(context) }, \
112 { interface, "LimitRTPRIO", bus_execute_append_rlimits, "t", &(context) }, \
113 { interface, "LimitRTTIME", bus_execute_append_rlimits, "t", &(context) }, \
114 { interface, "WorkingDirectory", bus_property_append_string, "s", (context).working_directory }, \
115 { interface, "RootDirectory", bus_property_append_string, "s", (context).root_directory }, \
116 { interface, "OOMScoreAdjust", bus_execute_append_oom_score_adjust, "i", &(context) }, \
117 { interface, "Nice", bus_execute_append_nice, "i", &(context) }, \
118 { interface, "IOScheduling", bus_execute_append_ioprio, "i", &(context) }, \
119 { interface, "CPUSchedulingPolicy", bus_execute_append_cpu_sched_policy, "i", &(context) }, \
120 { interface, "CPUSchedulingPriority", bus_execute_append_cpu_sched_priority, "i", &(context) }, \
121 { interface, "CPUAffinity", bus_execute_append_affinity,"ay", &(context) }, \
122 { interface, "TimerSlackNSec", bus_execute_append_timer_slack_nsec, "t", &(context) }, \
123 { interface, "CPUSchedulingResetOnFork", bus_property_append_bool, "b", &(context).cpu_sched_reset_on_fork }, \
124 { interface, "NonBlocking", bus_property_append_bool, "b", &(context).non_blocking }, \
125 { interface, "StandardInput", bus_execute_append_input, "s", &(context).std_input }, \
126 { interface, "StandardOutput", bus_execute_append_output, "s", &(context).std_output }, \
127 { interface, "StandardError", bus_execute_append_output, "s", &(context).std_error }, \
128 { interface, "TTYPath", bus_property_append_string, "s", (context).tty_path }, \
129 { interface, "SyslogPriority", bus_property_append_int, "i", &(context).syslog_priority }, \
130 { interface, "SyslogIdentifier", bus_property_append_string, "s", (context).syslog_identifier }, \
131 { interface, "SyslogLevelPrefix", bus_property_append_bool, "b", &(context).syslog_level_prefix }, \
132 { interface, "Capabilities", bus_execute_append_capabilities, "s",&(context) }, \
133 { interface, "SecureBits", bus_property_append_int, "i", &(context).secure_bits }, \
134 { interface, "CapabilityBoundingSet", bus_execute_append_capability_bs, "t", &(context).capability_bounding_set_drop }, \
135 { interface, "User", bus_property_append_string, "s", (context).user }, \
136 { interface, "Group", bus_property_append_string, "s", (context).group }, \
137 { interface, "SupplementaryGroups", bus_property_append_strv, "as", (context).supplementary_groups }, \
138 { interface, "TCPWrapName", bus_property_append_string, "s", (context).tcpwrap_name }, \
139 { interface, "PAMName", bus_property_append_string, "s", (context).pam_name }, \
140 { interface, "ReadWriteDirectories", bus_property_append_strv, "as", (context).read_write_dirs }, \
141 { interface, "ReadOnlyDirectories", bus_property_append_strv, "as", (context).read_only_dirs }, \
142 { interface, "InaccessibleDirectories", bus_property_append_strv, "as", (context).inaccessible_dirs }, \
143 { interface, "MountFlags", bus_property_append_ul, "t", &(context).mount_flags }, \
144 { interface, "PrivateTmp", bus_property_append_bool, "b", &(context).private_tmp }, \
145 { interface, "SameProcessGroup", bus_property_append_bool, "b", &(context).same_pgrp }, \
146 { interface, "KillMode", bus_execute_append_kill_mode, "s", &(context).kill_mode }, \
147 { interface, "KillSignal", bus_property_append_int, "i", &(context).kill_signal }, \
148 { interface, "UtmpIdentifier", bus_property_append_string, "s", (context).utmp_id }
149
150 #define BUS_EXEC_STATUS_PROPERTIES(interface, estatus, prefix) \
151 { interface, prefix "StartTimestamp", bus_property_append_usec, "t", &(estatus).start_timestamp.realtime }, \
152 { interface, prefix "ExitTimestamp", bus_property_append_usec, "t", &(estatus).start_timestamp.realtime }, \
153 { interface, prefix "PID", bus_property_append_pid, "u", &(estatus).pid }, \
154 { interface, prefix "Code", bus_property_append_int, "i", &(estatus).code }, \
155 { interface, prefix "Status", bus_property_append_int, "i", &(estatus).status }
156
157 #define BUS_EXEC_COMMAND_PROPERTY(interface, command, name) \
158 { interface, name, bus_execute_append_command, "a(sasbttuii)", (command) }
159
160 int bus_execute_append_output(Manager *m, DBusMessageIter *i, const char *property, void *data);
161 int bus_execute_append_input(Manager *m, DBusMessageIter *i, const char *property, void *data);
162 int bus_execute_append_oom_score_adjust(Manager *m, DBusMessageIter *i, const char *property, void *data);
163 int bus_execute_append_nice(Manager *m, DBusMessageIter *i, const char *property, void *data);
164 int bus_execute_append_ioprio(Manager *m, DBusMessageIter *i, const char *property, void *data);
165 int bus_execute_append_cpu_sched_policy(Manager *m, DBusMessageIter *i, const char *property, void *data);
166 int bus_execute_append_cpu_sched_priority(Manager *m, DBusMessageIter *i, const char *property, void *data);
167 int bus_execute_append_affinity(Manager *m, DBusMessageIter *i, const char *property, void *data);
168 int bus_execute_append_timer_slack_nsec(Manager *m, DBusMessageIter *i, const char *property, void *data);
169 int bus_execute_append_capabilities(Manager *m, DBusMessageIter *i, const char *property, void *data);
170 int bus_execute_append_capability_bs(Manager *m, DBusMessageIter *i, const char *property, void *data);
171 int bus_execute_append_rlimits(Manager *m, DBusMessageIter *i, const char *property, void *data);
172 int bus_execute_append_command(Manager *m, DBusMessageIter *u, const char *property, void *data);
173 int bus_execute_append_kill_mode(Manager *m, DBusMessageIter *i, const char *property, void *data);
174 int bus_execute_append_env_files(Manager *m, DBusMessageIter *i, const char *property, void *data);
175
176 #endif