+static bool condition_test_host(Condition *c) {
+ sd_id128_t x, y;
+ char *h;
+ int r;
+ bool b;
+
+ assert(c);
+ assert(c->parameter);
+ assert(c->type == CONDITION_HOST);
+
+ if (sd_id128_from_string(c->parameter, &x) >= 0) {
+
+ r = sd_id128_get_machine(&y);
+ if (r < 0)
+ return c->negate;
+
+ return sd_id128_equal(x, y);
+ }
+
+ h = gethostname_malloc();
+ if (!h)
+ return c->negate;
+
+ b = fnmatch(c->parameter, h, FNM_CASEFOLD) == 0;
+ free(h);
+
+ return b == !c->negate;
+}
+
+static bool condition_test_ac_power(Condition *c) {
+ int r;
+
+ assert(c);
+ assert(c->parameter);
+ assert(c->type == CONDITION_AC_POWER);
+
+ r = parse_boolean(c->parameter);
+ if (r < 0)
+ return !c->negate;
+
+ return ((on_ac_power() != 0) == !!r) == !c->negate;
+}
+
+static bool condition_test(Condition *c) {