0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering This file is part of systemd.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering Copyright 2013 Lennart Poettering
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering systemd is free software; you can redistribute it and/or modify it
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering under the terms of the GNU Lesser General Public License as published by
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering (at your option) any later version.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering systemd is distributed in the hope that it will be useful, but
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering Lesser General Public License for more details.
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering You should have received a copy of the GNU Lesser General Public License
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
86e9cbcaeda647eb4f1db77333f7069d5bf549f1Lennart Poetteringtypedef int (*bus_property_set_t) (sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_map_id128(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_message_map_all_properties(sd_bus_message *m, const struct bus_properties_map *map, void *userdata);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_message_map_properties_changed(sd_bus_message *m, const struct bus_properties_map *map, void *userdata);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map, void *userdata);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringtypedef bool (*check_idle_t)(void *userdata);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_event_loop_with_idle(sd_event *e, sd_bus *bus, const char *name, usec_t timeout, check_idle_t check_idle, void *userdata);
86e9cbcaeda647eb4f1db77333f7069d5bf549f1Lennart Poetteringint bus_name_has_owner(sd_bus *c, const char *name, sd_bus_error *error);
d76f90f1711e55d23ee6c8c0957fa3db17927327Lennart Poetteringint bus_test_polkit(sd_bus_message *call, int capability, const char *action, const char **details, uid_t good_user, bool *_challenge, sd_bus_error *e);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_verify_polkit_async(sd_bus_message *call, int capability, const char *action, const char **details, bool interactive, uid_t good_user, Hashmap **registry, sd_bus_error *error);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringvoid bus_verify_polkit_async_registry_free(Hashmap *registry);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_connect_system_systemd(sd_bus **_bus);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_connect_user_systemd(sd_bus **_bus);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_connect_transport(BusTransport transport, const char *host, bool user, sd_bus **bus);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_connect_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_print_property(const char *name, sd_bus_message *property, bool all);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_print_all_properties(sd_bus *bus, const char *dest, const char *path, char **filter, bool all);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringint bus_property_get_bool(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering#define bus_property_get_usec ((sd_bus_property_get_t) NULL)
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering#define bus_property_set_usec ((sd_bus_property_set_t) NULL)
105e151299dc1208855380be2b22d0db2d66ebc6Lennart Poetteringassert_cc(sizeof(int) == sizeof(int32_t));
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poettering#define bus_property_get_int ((sd_bus_property_get_t) NULL)
0d2cd47617b423f37d7425be7a56ae2fca8ff9f6Lennart Poetteringassert_cc(sizeof(unsigned) == sizeof(unsigned));
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering#define bus_property_get_unsigned ((sd_bus_property_get_t) NULL)
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering/* On 64bit machines we can use the default serializer for size_t and
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering * friends, otherwise we need to cast this manually */
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poettering#define bus_property_get_size ((sd_bus_property_get_t) NULL)
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poetteringint bus_property_get_size(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_long ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_ulong ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_property_get_long(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_property_get_ulong(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering/* uid_t and friends on Linux 32 bit. This means we can just use the
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering * default serializer for 32bit unsigned, for serializing it, and map
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering * it to NULL here */
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringassert_cc(sizeof(uid_t) == sizeof(uint32_t));
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_uid ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringassert_cc(sizeof(gid_t) == sizeof(uint32_t));
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_gid ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringassert_cc(sizeof(pid_t) == sizeof(uint32_t));
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_pid ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringassert_cc(sizeof(mode_t) == sizeof(uint32_t));
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define bus_property_get_mode ((sd_bus_property_get_t) NULL)
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_parse_unit_info(sd_bus_message *message, UnitInfo *u);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define BUS_DEFINE_PROPERTY_GET_ENUM(function, name, type) \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering const char *path, \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering const char *value; \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering value = strempty(name##_to_string(*field)); \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering r = sd_bus_message_append_basic(reply, 's', value); \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering struct __useless_struct_to_allow_trailing_semicolon__
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering#define BUS_PROPERTY_DUAL_TIMESTAMP(name, offset, flags) \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering SD_BUS_PROPERTY(name, "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, realtime), (flags)), \
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poettering SD_BUS_PROPERTY(name "Monotonic", "t", bus_property_get_usec, (offset) + offsetof(struct dual_timestamp, monotonic), (flags))
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_append_unit_property_assignment(sd_bus_message *m, const char *assignment);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringtypedef struct BusWaitForJobs BusWaitForJobs;
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_wait_for_jobs_new(sd_bus *bus, BusWaitForJobs **ret);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringvoid bus_wait_for_jobs_free(BusWaitForJobs *d);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_wait_for_jobs_add(BusWaitForJobs *d, const char *path);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_wait_for_jobs(BusWaitForJobs *d, bool quiet, const char *extra_args);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_wait_for_jobs_one(BusWaitForJobs *d, const char *path, bool quiet);
30c778094b90a637c6691c462a66df81eeb865b5Lennart PoetteringDEFINE_TRIVIAL_CLEANUP_FUNC(BusWaitForJobs*, bus_wait_for_jobs_free);
30c778094b90a637c6691c462a66df81eeb865b5Lennart Poetteringint bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, UnitFileChange **changes, unsigned *n_changes);
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poetteringint bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, const char *external_id, char **ret_path);
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poetteringint bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external);
8e54f5d90a6b9dd1ff672fb97ea98de66c49e332Lennart Poetteringint bus_property_get_rlimit(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);