-/* $OpenBSD: hce.c,v 1.42 2008/07/19 10:52:32 reyk Exp $ */
+/* $OpenBSD: hce.c,v 1.43 2008/07/19 11:38:54 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
host->last_up = host->up;
- if (TAILQ_EMPTY(&host->children))
+ if (SLIST_EMPTY(&host->children))
return;
/* Notify for all other hosts that inherit the state from this one */
- TAILQ_FOREACH(h, &host->children, child) {
+ SLIST_FOREACH(h, &host->children, child) {
h->up = hostup;
hce_notify_done(h, msg);
}
-/* $OpenBSD: parse.y,v 1.120 2008/07/19 10:52:32 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.121 2008/07/19 11:38:54 reyk Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
$$->conf.id = 0; /* will be set later */
$$->conf.retry = $2;
$$->conf.parentid = $3;
- TAILQ_INIT(&$$->children);
+ SLIST_INIT(&$$->children);
}
;
h->conf.parentid);
errors++;
} else
- TAILQ_INSERT_TAIL(&ph->children,
+ SLIST_INSERT_HEAD(&ph->children,
h, child);
}
}
}
h->conf.tableid = tb->conf.id;
h->tablename = tb->conf.name;
- TAILQ_INIT(&h->children);
+ SLIST_INIT(&h->children);
TAILQ_INSERT_TAIL(&tb->hosts, h, entry);
}
-/* $OpenBSD: pfe.c,v 1.49 2008/07/19 10:52:32 reyk Exp $ */
+/* $OpenBSD: pfe.c,v 1.50 2008/07/19 11:38:54 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
&host->conf.id, sizeof(host->conf.id));
log_debug("disable_host: disabled host %d", host->conf.id);
- /* Disable all children */
- TAILQ_FOREACH(h, &host->children, child)
- disable_host(c, id, h);
-
- if (!host->conf.parentid)
+ if (!host->conf.parentid) {
+ /* Disable all children */
+ SLIST_FOREACH(h, &host->children, child)
+ disable_host(c, id, h);
pfe_sync();
+ }
return (0);
}
&host->conf.id, sizeof(host->conf.id));
log_debug("enable_host: enabled host %d", host->conf.id);
- /* Enable all children */
- TAILQ_FOREACH(h, &host->children, child)
- enable_host(c, id, h);
-
- if (!host->conf.parentid)
+ if (!host->conf.parentid) {
+ /* Enable all children */
+ SLIST_FOREACH(h, &host->children, child)
+ enable_host(c, id, h);
pfe_sync();
+ }
return (0);
}
-/* $OpenBSD: relayd.h,v 1.107 2008/07/19 10:52:32 reyk Exp $ */
+/* $OpenBSD: relayd.h,v 1.108 2008/07/19 11:38:54 reyk Exp $ */
/*
* Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
struct host {
TAILQ_ENTRY(host) entry;
- TAILQ_ENTRY(host) child;
- TAILQ_HEAD(,host) children;
+ SLIST_ENTRY(host) child;
+ SLIST_HEAD(,host) children;
struct host_config conf;
u_int32_t flags;
char *tablename;