X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=util.c;h=12e52085735508950874bacc4af2dcce571a7a66;hb=c72aa74324481a2ee642b1739baec10eb616cbca;hp=c459f1340a6d406caf528eebf2f777e173ed3a76;hpb=22c77971bb13c37344fc73fe9b8d72ed96181df2;p=secnet.git diff --git a/util.c b/util.c index c459f13..12e5208 100644 --- a/util.c +++ b/util.c @@ -227,6 +227,14 @@ void phase_hooks_init(void) LIST_INIT(&hooks[i]); } +void clear_phase_hooks(uint32_t phase) +{ + struct phase_hook *h, *htmp; + LIST_FOREACH_SAFE(h, &hooks[phase], entry, htmp) + free(h); + LIST_INIT(&hooks[phase]); +} + bool_t add_hook(uint32_t phase, hook_fn *fn, void *state) { struct phase_hook *h;