unit.h revision d0bfe5243aa6fd9ccdd33fe3c9dfa0a08026d1ab
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering This file is part of systemd.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering Copyright 2010 Lennart Poettering
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering (at your option) any later version.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering systemd is distributed in the hope that it will be useful, but
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering Lesser General Public License for more details.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringtypedef enum UnitActiveState UnitActiveState;
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poetteringtypedef enum UnitDependency UnitDependency;
1ca208fb4f93e5869704af1812cbff7130a2fc03Zbigniew Jędrzejewski-Szmektypedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poetteringstatic inline bool UNIT_IS_ACTIVE_OR_RELOADING(UnitActiveState t) {
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering return t == UNIT_ACTIVE || t == UNIT_RELOADING;
7410616cd9dbbec97cf98d75324da5cda2b2f7a2Lennart Poetteringstatic inline bool UNIT_IS_ACTIVE_OR_ACTIVATING(UnitActiveState t) {
7410616cd9dbbec97cf98d75324da5cda2b2f7a2Lennart Poettering return t == UNIT_ACTIVE || t == UNIT_ACTIVATING || t == UNIT_RELOADING;
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poetteringstatic inline bool UNIT_IS_INACTIVE_OR_DEACTIVATING(UnitActiveState t) {
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering return t == UNIT_INACTIVE || t == UNIT_FAILED || t == UNIT_DEACTIVATING;
7410616cd9dbbec97cf98d75324da5cda2b2f7a2Lennart Poetteringstatic inline bool UNIT_IS_INACTIVE_OR_FAILED(UnitActiveState t) {
7410616cd9dbbec97cf98d75324da5cda2b2f7a2Lennart Poettering return t == UNIT_INACTIVE || t == UNIT_FAILED;
821b2e792159e237a1e5a1ea4bb6ae2e55d64be5Lukas Nykryn /* Positive dependencies */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Inverse of the above */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_REQUIRED_BY, /* inverse of 'requires' and 'requisite' is 'required_by' */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_REQUIRED_BY_OVERRIDABLE, /* inverse of 'requires_overridable' and 'requisite_overridable' is 'soft_required_by' */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_BOUND_BY, /* inverse of 'binds_to' */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Negative dependencies */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_CONFLICTS, /* inverse of 'conflicts' is 'conflicted_by' */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_BEFORE, /* inverse of 'before' is 'after' and vice versa */
cca1dfddd4ce4357113663532696488427cc54e4Lennart Poettering /* On Failure */
cca1dfddd4ce4357113663532696488427cc54e4Lennart Poettering /* Triggers (i.e. a socket triggers a service) */
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering /* Propagate reloads */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Reference information for GC logic */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering UNIT_REFERENCES, /* Inverse of 'references' is 'referenced_by' */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering char *id; /* One name is special because we use it for identification. Points to an entry in the names set */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering char *fragment_path; /* if loaded from a config file this is the primary path to it */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering char *source_path; /* if converted, the source file */
4c1fc3e404d648c70bd2f50ac50aeac6ece8872eDaniel Mack /* If there is something to do with this unit, then this is the installed job for it */
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41Michal Schmidt /* JOB_NOP jobs are special and can be installed without disturbing the real job. */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* References to this */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Conditions to check */
73b80ec2d999c45ce13f3e034704249d80829f7eLennart Poettering /* Counterparts in the cgroup filesystem */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering /* Per type list */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* All units which have requires_mounts_for set */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering LIST_FIELDS(Unit, has_requires_mounts_for);
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Load queue */
73b80ec2d999c45ce13f3e034704249d80829f7eLennart Poettering /* D-Bus queue */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Cleanup queue */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* GC queue */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Used during GC sweeps */
7410616cd9dbbec97cf98d75324da5cda2b2f7a2Lennart Poettering /* When deserializing, temporarily store the job type for this
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering * unit here, if there was a job scheduled.
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering * Only for deserializing from a legacy version. New style uses full
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering * serialized jobs. */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering int deserialized_job; /* This is actually of type JobType */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering /* Error code when we didn't manage to load the unit (negative) */
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering /* Cached unit file state */
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering /* Garbage collect us we nobody wants or requires us anymore */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering /* Create default dependencies */
73b80ec2d999c45ce13f3e034704249d80829f7eLennart Poettering /* Refuse manual starting, allow starting only indirectly via dependency. */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering /* Don't allow the user to stop this unit manually, allow stopping only indirectly via dependency. */
e48fdd84432bbf9c2ecc339183258c7c33116032Lennart Poettering /* Allow isolation requests */
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering /* Isolate OnFailure unit */
1af7211984a8dba3c5ba40fae794c4c55f5e6bd3Lennart Poettering /* Ignore this unit when isolating */
73b80ec2d999c45ce13f3e034704249d80829f7eLennart Poettering /* Ignore this unit when snapshotting */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Did the last condition check suceed? */
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering /* Keeps tracks of references to a unit. This is useful so
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering * that we can merge two units if necessary and correct all
1a14a53cfded6e78c6e8dfb73fdff0039971d642Lennart Poettering * references to them */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers const char *finished_start_job[_JOB_RESULT_MAX];
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* How much memory does an object of this unit type need */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* Config file sections this unit type understands, separated
cca1dfddd4ce4357113663532696488427cc54e4Lennart Poettering * by NUL chars */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* This should reset all type-specific variables. This should
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * not allocate memory, and is called with zero-initialized
a0b1209c4a59754f428894e0485413542da50014Zbigniew Jędrzejewski-Szmek * data. It should hence only initialize variables that need
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * to be set != 0. */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* This should free all type-specific variables. It should be
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * idempotent. */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Actually load data from disk. This may fail, and should set
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * load_state to UNIT_LOADED, UNIT_MERGED or leave it at
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * UNIT_STUB if no configuration could be found. */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* If a a lot of units got created via enumerate(), this is
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * where to actually set the state and call unit_notify(). */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering void (*dump)(Unit *u, FILE *f, const char *prefix);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering int (*kill)(Unit *u, KillWho w, KillMode m, int signo, DBusError *error);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* Write all data that cannot be restored from other sources
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * away using unit_serialize_item() */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering int (*serialize)(Unit *u, FILE *f, FDSet *fds);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* Restore one item from the serialization */
a0b1209c4a59754f428894e0485413542da50014Zbigniew Jędrzejewski-Szmek int (*deserialize_item)(Unit *u, const char *key, const char *data, FDSet *fds);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* Boils down the more complex internal state of this unit to
a0b1209c4a59754f428894e0485413542da50014Zbigniew Jędrzejewski-Szmek * a simpler one that the engine can understand */
a0b1209c4a59754f428894e0485413542da50014Zbigniew Jędrzejewski-Szmek UnitActiveState (*active_state)(Unit *u);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering /* Returns the substate specific to this unit type as
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * string. This is purely information so that we can give the
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * user a more fine grained explanation in which actual state a
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * unit is in. */
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering const char* (*sub_state_to_string)(Unit *u);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Return true when there is reason to keep this entry around
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poettering * even nothing references it and it isn't active in any
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Return true when this unit is suitable for snapshotting */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*fd_event)(Unit *u, int fd, uint32_t events, Watch *w);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*sigchld_event)(Unit *u, pid_t pid, int code, int status);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Reset failed state if we are in failed state */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Called whenever any of the cgroups this unit watches for
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * ran empty */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Called whenever a process of this unit sends us a message */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*notify_message)(Unit *u, pid_t pid, char **tags);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Called whenever a name thus Unit registered for comes or
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * goes away. */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*bus_name_owner_change)(Unit *u, const char *name, const char *old_owner, const char *new_owner);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Called whenever a bus PID lookup finishes */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers void (*bus_query_pid_done)(Unit *u, const char *name, pid_t pid);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Called for each message received on the bus */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers DBusHandlerResult (*bus_message_handler)(Unit *u, DBusConnection *c, DBusMessage *message);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Return the unit this unit is following */
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9Lennart Poettering /* Return the set of units that are following each other */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* This is called for each unit type and should be used to
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * enumerate existing devices and load them. However,
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * everything that is loaded here should still stay in
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * inactive state. It is the job of the coldplug() call above
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * to put the units into the initial state. */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* Type specific cleanups. */
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers /* When sending out PropertiesChanged signal, which properties
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * shall be invalidated? This is a NUL separated list of
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sievers * strings, to minimize relocations a little. */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen /* The interface name */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen UnitStatusMessageFormats status_message_formats;
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen /* Can units of this type have multiple names? */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen /* Instances make no sense for this type */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen /* Exclude from automatic gc */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenextern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX];
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen/* For casting a unit into the various unit types */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen static inline MixedCase* UPPERCASE(Unit *u) { \
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen if (_unlikely_(!u || u->type != UNIT_##UPPERCASE)) \
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen return (MixedCase*) u; \
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersen/* For casting the various unit types into a unit */
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_dependency_by_name(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_two_dependencies_by_name(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_dependency_by_name_inverse(Unit *u, UnitDependency d, const char *name, const char *filename, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_two_dependencies_by_name_inverse(Unit *u, UnitDependency d, UnitDependency e, const char *name, const char *path, bool add_reference);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_exec_dependencies(Unit *u, ExecContext *c);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_cgroup(Unit *u, CGroupBonding *b);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_cgroup_from_text(Unit *u, const char *name);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom GundersenCGroupBonding* unit_get_default_cgroup(Unit *u);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_cgroup_attribute(Unit *u, const char *controller, const char *name, const char *value, CGroupAttributeMapCallback map_callback);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_set_description(Unit *u, const char *description);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_merge_by_name(Unit *u, const char *other);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_load_fragment_and_dropin_optional(Unit *u);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_dump(Unit *u, FILE *f, const char *prefix);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_kill(Unit *u, KillWho w, KillMode m, int signo, DBusError *error);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_success);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_watch_fd(Unit *u, int fd, uint32_t events, Watch *w);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_watch_timer(Unit *u, usec_t delay, Watch *w);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_watch_bus_name(Unit *u, const char *name);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_unwatch_bus_name(Unit *u, const char *name);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint set_unit_path(const char *p);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_load_related_unit(Unit *u, const char *type, Unit **_found);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_get_related_unit(Unit *u, const char *type, Unit **_found);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieverschar *unit_name_printf(Unit *u, const char* text);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieverschar *unit_full_printf(Unit *u, const char *text);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_serialize(Unit *u, FILE *f, FDSet *fds);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_serialize_item_format(Unit *u, FILE *f, const char *key, const char *value, ...) _printf_attr_(4,5);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_deserialize(Unit *u, FILE *f, FDSet *fds);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_add_node_link(Unit *u, const char *what, bool wants);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversvoid unit_status_printf(Unit *u, const char *status, const char *format, ...);
59512f21d77d984cf1363fb0d1770218c5e17020Kay Sieversint unit_add_default_target_dependency(Unit *u, Unit *target);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenint unit_add_one_mount_link(Unit *u, Mount *m);
7a1494aa4e4a131d73e866cf1e7eb7b6e47dbab8Tom Gundersenconst char *unit_active_state_to_string(UnitActiveState i);
59512f21d77d984cf1363fb0d1770218c5e17020Kay SieversUnitActiveState unit_active_state_from_string(const char *s);
61331eab0a53cd9b8446eab6d1ebf1a046d8efc1Lennart Poetteringconst char *unit_dependency_to_string(UnitDependency i);