1999-11-30 02:43:11 +00:00
|
|
|
#if !defined(lint) && !defined(SABER)
|
2002-05-13 19:31:58 +00:00
|
|
|
static const char rcsid[] = "$Id: ns_notify.c,v 8.20 2002/04/25 05:27:12 marka Exp $";
|
1999-11-30 02:43:11 +00:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
/*
|
2000-05-26 07:17:19 +00:00
|
|
|
* Copyright (c) 1994-2000 by Internet Software Consortium.
|
1999-11-30 02:43:11 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
|
|
|
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
|
|
|
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
|
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
|
|
|
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Import. */
|
|
|
|
|
|
|
|
#include "port_before.h"
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <sys/file.h>
|
|
|
|
#include <sys/un.h>
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#include <arpa/nameser.h>
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <resolv.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <isc/eventlib.h>
|
|
|
|
#include <isc/logging.h>
|
|
|
|
#include <isc/memcluster.h>
|
|
|
|
|
|
|
|
#include <isc/dst.h>
|
|
|
|
|
|
|
|
#include "port_after.h"
|
|
|
|
|
|
|
|
#include "named.h"
|
|
|
|
|
|
|
|
#ifdef BIND_NOTIFY
|
|
|
|
|
|
|
|
/* Types. */
|
|
|
|
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify {
|
1999-11-30 02:43:11 +00:00
|
|
|
char * name;
|
|
|
|
ns_class class;
|
|
|
|
ns_type type;
|
|
|
|
evTimerID timer;
|
2002-05-13 19:31:58 +00:00
|
|
|
LINK(struct pnotify) link;
|
1999-11-30 02:43:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Forward. */
|
|
|
|
|
|
|
|
static void sysnotify(const char *, ns_class, ns_type);
|
|
|
|
static void sysnotify_slaves(const char *, const char *,
|
|
|
|
ns_class, ns_type, int, int *, int *);
|
|
|
|
static void sysnotify_ns(const char *, const char *,
|
|
|
|
ns_class, ns_type, int, int *, int *);
|
2002-05-13 19:31:58 +00:00
|
|
|
static void free_notify(struct pnotify *);
|
1999-11-30 02:43:11 +00:00
|
|
|
static void notify_timer(evContext, void *,
|
|
|
|
struct timespec, struct timespec);
|
|
|
|
|
|
|
|
/* Local. */
|
|
|
|
|
2002-05-13 19:31:58 +00:00
|
|
|
static LIST(struct pnotify) pending_notifies;
|
|
|
|
static LIST(struct pnotify) loading_notifies;
|
1999-11-30 02:43:11 +00:00
|
|
|
|
|
|
|
/* Public. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ns_notify(dname, class, type)
|
|
|
|
* call this when a zone has changed and its slaves need to know.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ns_notify(const char *dname, ns_class class, ns_type type) {
|
|
|
|
static const char no_room[] = "%s failed, cannot notify for zone %s";
|
|
|
|
int delay, max_delay;
|
|
|
|
struct zoneinfo *zp;
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify *ni;
|
1999-11-30 02:43:11 +00:00
|
|
|
|
|
|
|
zp = find_auth_zone(dname, class);
|
|
|
|
if (zp == NULL) {
|
|
|
|
ns_warning(ns_log_notify,
|
|
|
|
"no zone found for notify (\"%s\" %s %s)",
|
|
|
|
(dname && *dname) ? dname : ".",
|
|
|
|
p_class(class), p_type(type));
|
|
|
|
return;
|
|
|
|
}
|
2000-05-26 07:17:19 +00:00
|
|
|
if (ns_samename(dname, zp->z_origin) != 1) {
|
|
|
|
ns_warning(ns_log_notify,
|
|
|
|
"notify not called with top of zone (\"%s\" %s %s)",
|
|
|
|
(dname && *dname) ? dname : ".",
|
|
|
|
p_class(class), p_type(type));
|
|
|
|
return;
|
|
|
|
}
|
1999-11-30 02:43:11 +00:00
|
|
|
if ((zp->z_flags & Z_NOTIFY) != 0) {
|
|
|
|
ns_info(ns_log_notify,
|
|
|
|
"suppressing duplicate notify (\"%s\" %s %s)",
|
|
|
|
(dname && *dname) ? dname : ".",
|
|
|
|
p_class(class), p_type(type));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ni = memget(sizeof *ni);
|
|
|
|
if (ni == NULL) {
|
|
|
|
ns_info(ns_log_notify, no_room, "memget", dname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ni->name = savestr(dname, 0);
|
|
|
|
if (ni->name == NULL) {
|
|
|
|
memput(ni, sizeof *ni);
|
|
|
|
ni = NULL;
|
|
|
|
ns_info(ns_log_notify, no_room, "memget", dname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ni->class = class;
|
|
|
|
ni->type = type;
|
2001-01-28 23:00:22 +00:00
|
|
|
INIT_LINK(ni, link);
|
1999-11-30 02:43:11 +00:00
|
|
|
evInitID(&ni->timer);
|
|
|
|
|
2000-05-26 07:17:19 +00:00
|
|
|
if (loading != 0) {
|
|
|
|
APPEND(loading_notifies, ni, link);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-11-30 02:43:11 +00:00
|
|
|
/* Delay notification for from five seconds up to fifteen minutes. */
|
2001-07-30 16:51:36 +00:00
|
|
|
max_delay = MIN(nzones, 895);
|
1999-11-30 02:43:11 +00:00
|
|
|
max_delay = MAX(max_delay, 25);
|
|
|
|
delay = 5 + (rand() % max_delay);
|
|
|
|
if (evSetTimer(ev, notify_timer, ni,
|
|
|
|
evAddTime(evNowTime(), evConsTime(delay, 0)),
|
|
|
|
evConsTime(0, 0), &ni->timer) < 0) {
|
|
|
|
ns_error(ns_log_notify, "evSetTimer() failed: %s",
|
|
|
|
strerror(errno));
|
2002-02-04 19:12:46 +00:00
|
|
|
ni->name = freestr(ni->name);
|
1999-11-30 02:43:11 +00:00
|
|
|
memput(ni, sizeof *ni);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
zp->z_flags |= Z_NOTIFY;
|
|
|
|
APPEND(pending_notifies, ni, link);
|
|
|
|
ns_debug(ns_log_notify, 3,
|
|
|
|
"ns_notify(%s, %s, %s): ni %p, zp %p, delay %d",
|
|
|
|
(dname && *dname) ? dname : ".",
|
|
|
|
p_class(class), p_type(type),
|
|
|
|
ni, zp, delay);
|
|
|
|
}
|
|
|
|
|
2000-05-26 07:17:19 +00:00
|
|
|
void
|
|
|
|
notify_afterload() {
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify *ni;
|
2000-05-26 07:17:19 +00:00
|
|
|
|
|
|
|
INSIST(loading == 0);
|
|
|
|
while ((ni = HEAD(loading_notifies)) != NULL) {
|
|
|
|
UNLINK(loading_notifies, ni, link);
|
|
|
|
ns_notify(ni->name, ni->class, ni->type);
|
2002-02-04 19:12:46 +00:00
|
|
|
ni->name = freestr(ni->name);
|
2000-05-26 07:17:19 +00:00
|
|
|
memput(ni, sizeof *ni);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-11-30 02:43:11 +00:00
|
|
|
/*
|
|
|
|
* ns_unnotify()
|
|
|
|
* call this when all pending notifies are now considered junque.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ns_unnotify(void) {
|
|
|
|
while (!EMPTY(pending_notifies)) {
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify *ni = HEAD(pending_notifies);
|
1999-11-30 02:43:11 +00:00
|
|
|
|
|
|
|
INSIST(LINKED(ni, link));
|
|
|
|
UNLINK(pending_notifies, ni, link);
|
|
|
|
free_notify(ni);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-05-26 07:17:19 +00:00
|
|
|
/*
|
|
|
|
* ns_stopnotify(const char *dname, ns_class class)
|
|
|
|
* stop notifies for this particular zone.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
ns_stopnotify(const char *dname, ns_class class) {
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify *ni;
|
2000-05-26 07:17:19 +00:00
|
|
|
|
|
|
|
ni = HEAD(pending_notifies);
|
|
|
|
while (ni != NULL &&
|
|
|
|
(ni->class != class || ns_samename(ni->name, dname) != 1))
|
|
|
|
ni = NEXT(ni, link);
|
|
|
|
|
|
|
|
if (ni != NULL) {
|
|
|
|
UNLINK(pending_notifies, ni, link);
|
|
|
|
free_notify(ni);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-11-30 02:43:11 +00:00
|
|
|
/* Private. */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* sysnotify(dname, class, type)
|
|
|
|
* cause a NOTIFY request to be sysquery()'d to each slave server
|
|
|
|
* of the zone that "dname" is within.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
sysnotify(const char *dname, ns_class class, ns_type type) {
|
2001-01-28 23:00:22 +00:00
|
|
|
const char *zname;
|
2000-05-26 07:17:19 +00:00
|
|
|
u_int32_t zserial;
|
1999-11-30 02:43:11 +00:00
|
|
|
int nns, na, i;
|
|
|
|
struct zoneinfo *zp;
|
|
|
|
struct in_addr *also_addr;
|
|
|
|
|
|
|
|
ns_debug(ns_log_notify, 3, "sysnotify(%s, %s, %s)",
|
|
|
|
dname, p_class(class), p_type(type));
|
|
|
|
zp = find_auth_zone(dname, class);
|
|
|
|
if (zp == NULL) {
|
|
|
|
ns_warning(ns_log_notify, "sysnotify: can't find \"%s\" (%s)",
|
|
|
|
dname, p_class(class));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (ns_samename(dname, zp->z_origin) != 1) {
|
|
|
|
ns_warning(ns_log_notify, "sysnotify: not auth for zone %s",
|
|
|
|
dname);
|
|
|
|
return;
|
|
|
|
}
|
2002-05-13 19:31:58 +00:00
|
|
|
if (zp->z_notify == notify_no ||
|
|
|
|
(zp->z_notify == notify_use_default &&
|
|
|
|
server_options->notify == notify_no))
|
1999-11-30 02:43:11 +00:00
|
|
|
return;
|
|
|
|
if (zp->z_type != z_master && zp->z_type != z_slave) {
|
|
|
|
ns_warning(ns_log_notify, "sysnotify: %s not master or slave",
|
|
|
|
dname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
zname = zp->z_origin;
|
2000-05-26 07:17:19 +00:00
|
|
|
zserial = zp->z_serial;
|
1999-11-30 02:43:11 +00:00
|
|
|
nns = na = 0;
|
2002-05-13 19:31:58 +00:00
|
|
|
if (zp->z_notify == notify_yes ||
|
|
|
|
(zp->z_notify == notify_use_default &&
|
|
|
|
server_options->notify == notify_yes))
|
|
|
|
sysnotify_slaves(dname, zname, class, type,
|
|
|
|
zp - zones, &nns, &na);
|
1999-11-30 02:43:11 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Handle any global or zone-specific also-notify clauses
|
|
|
|
*/
|
|
|
|
if (zp->z_notify_count != 0) {
|
|
|
|
/* zone-specific also notify */
|
|
|
|
|
|
|
|
ns_debug(ns_log_notify, 3, "zone notify ns = %d",
|
|
|
|
zp->z_notify_count);
|
|
|
|
|
|
|
|
also_addr = zp->z_also_notify;
|
|
|
|
for (i = 0; i < zp->z_notify_count; i++) {
|
|
|
|
ns_debug(ns_log_notify, 4, "notifying %s",
|
|
|
|
inet_ntoa(*also_addr));
|
2002-02-04 19:12:46 +00:00
|
|
|
sysquery(dname, class, type, also_addr, NULL, 1,
|
|
|
|
ns_port, NS_NOTIFY_OP, 0);
|
1999-11-30 02:43:11 +00:00
|
|
|
also_addr++;
|
|
|
|
}
|
|
|
|
nns += zp->z_notify_count;
|
|
|
|
na += zp->z_notify_count;
|
|
|
|
} else if (server_options->notify_count != 0) {
|
|
|
|
ns_debug(ns_log_notify, 4, "global notify ns = %d",
|
|
|
|
server_options->notify_count);
|
|
|
|
also_addr = server_options->also_notify;
|
|
|
|
for (i = 0; i < server_options->notify_count; i++) {
|
|
|
|
ns_debug(ns_log_notify, 3, "notifying %s",
|
|
|
|
inet_ntoa(*also_addr));
|
2002-02-04 19:12:46 +00:00
|
|
|
sysquery(dname, class, type, also_addr, NULL, 1,
|
|
|
|
ns_port, ns_o_notify, 0);
|
1999-11-30 02:43:11 +00:00
|
|
|
also_addr++;
|
|
|
|
}
|
|
|
|
nns += server_options->notify_count;
|
|
|
|
na += server_options->notify_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nns != 0 || na != 0)
|
|
|
|
ns_info(ns_log_notify,
|
2000-05-26 07:17:19 +00:00
|
|
|
"Sent NOTIFY for \"%s %s %s %u\" (%s); %d NS, %d A",
|
|
|
|
dname, p_class(class), p_type(type), zserial, zname, nns, na);
|
1999-11-30 02:43:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
sysnotify_slaves(const char *dname, const char *zname,
|
|
|
|
ns_class class, ns_type type,
|
|
|
|
int zn, int *nns, int *na)
|
|
|
|
{
|
|
|
|
const char *mname, *fname;
|
|
|
|
struct hashbuf *htp;
|
|
|
|
struct namebuf *np;
|
|
|
|
struct databuf *dp;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Master.
|
|
|
|
*/
|
|
|
|
htp = hashtab;
|
|
|
|
np = nlookup(zname, &htp, &fname, 0);
|
|
|
|
if (np == NULL) {
|
|
|
|
ns_warning(ns_log_notify,
|
|
|
|
"sysnotify: found name \"%s\" but not zone",
|
|
|
|
dname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mname = NULL;
|
|
|
|
for (dp = np->n_data; dp != NULL; dp = dp->d_next) {
|
|
|
|
if (dp->d_zone == DB_Z_CACHE || !match(dp, class, ns_t_soa))
|
|
|
|
continue;
|
|
|
|
if (dp->d_type == ns_t_sig)
|
|
|
|
continue;
|
|
|
|
if (mname) {
|
|
|
|
ns_notice(ns_log_notify,
|
|
|
|
"multiple SOA's for zone \"%s\"?",
|
|
|
|
zname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mname = (char *) dp->d_data;
|
|
|
|
}
|
|
|
|
if (mname == NULL) {
|
|
|
|
ns_notice(ns_log_notify, "no SOA found for zone \"%s\"",
|
|
|
|
zname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (dp = np->n_data; dp != NULL; dp = dp->d_next) {
|
|
|
|
if (dp->d_zone == DB_Z_CACHE || !match(dp, class, ns_t_ns))
|
|
|
|
continue;
|
|
|
|
if (dp->d_type == ns_t_sig)
|
|
|
|
continue;
|
|
|
|
if (ns_samename((char*)dp->d_data, mname) == 1)
|
|
|
|
continue;
|
|
|
|
sysnotify_ns(dname, (char *)dp->d_data, class, type,
|
|
|
|
zn, nns, na);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
sysnotify_ns(const char *dname, const char *aname,
|
|
|
|
ns_class class, ns_type type,
|
|
|
|
int zn, int *nns, int *na)
|
|
|
|
{
|
|
|
|
struct databuf *adp;
|
|
|
|
struct namebuf *anp;
|
|
|
|
const char *fname;
|
|
|
|
struct in_addr nss[NSMAX];
|
|
|
|
struct hashbuf *htp;
|
2002-05-13 19:31:58 +00:00
|
|
|
int is_us, nsc, auth6, neg;
|
2001-07-30 16:51:36 +00:00
|
|
|
int cname = 0;
|
1999-11-30 02:43:11 +00:00
|
|
|
|
|
|
|
htp = hashtab;
|
|
|
|
anp = nlookup(aname, &htp, &fname, 0);
|
|
|
|
nsc = 0;
|
|
|
|
is_us = 0;
|
2002-05-13 19:31:58 +00:00
|
|
|
auth6 = 0;
|
|
|
|
neg = 0;
|
1999-11-30 02:43:11 +00:00
|
|
|
if (anp != NULL)
|
|
|
|
for (adp = anp->n_data; adp; adp = adp->d_next) {
|
|
|
|
struct in_addr ina;
|
|
|
|
|
2002-05-13 19:31:58 +00:00
|
|
|
if (adp->d_class != class)
|
|
|
|
continue;
|
|
|
|
if (adp->d_rcode == NXDOMAIN) {
|
|
|
|
neg = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (adp->d_type == T_CNAME && adp->d_rcode == 0) {
|
2001-07-30 16:51:36 +00:00
|
|
|
cname = 1;
|
|
|
|
ns_error(ns_log_notify,
|
|
|
|
"NS '%s' for '%s/%s' is a CNAME",
|
|
|
|
*aname ? aname : ".",
|
|
|
|
*dname ? dname : ".",
|
|
|
|
p_class(class));
|
|
|
|
break;
|
|
|
|
}
|
2002-05-13 19:31:58 +00:00
|
|
|
if ((adp->d_type == T_AAAA || adp->d_type == ns_t_a6) &&
|
|
|
|
(zones[adp->d_class].z_type == z_master ||
|
|
|
|
zones[adp->d_class].z_type == z_slave)) {
|
|
|
|
auth6 = 1;
|
|
|
|
continue;
|
|
|
|
}
|
1999-11-30 02:43:11 +00:00
|
|
|
if (!match(adp, class, T_A))
|
|
|
|
continue;
|
2002-05-13 19:31:58 +00:00
|
|
|
if (adp->d_rcode) {
|
|
|
|
neg = 1;
|
|
|
|
continue;
|
|
|
|
}
|
1999-11-30 02:43:11 +00:00
|
|
|
if (adp->d_type == ns_t_sig)
|
|
|
|
continue;
|
|
|
|
ina = ina_get(adp->d_data);
|
|
|
|
if (aIsUs(ina)) {
|
|
|
|
is_us = 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (nsc < NSMAX)
|
|
|
|
nss[nsc++] = ina;
|
|
|
|
} /*next A*/
|
|
|
|
if (nsc == 0) {
|
2002-05-13 19:31:58 +00:00
|
|
|
if (!is_us && !cname && !auth6 && !neg &&
|
|
|
|
!NS_OPTION_P(OPTION_NOFETCHGLUE)) {
|
1999-11-30 02:43:11 +00:00
|
|
|
struct qinfo *qp;
|
|
|
|
|
2002-02-04 19:12:46 +00:00
|
|
|
qp = sysquery(aname, class, ns_t_a, NULL, NULL, 0,
|
|
|
|
ns_port, ns_o_query, 0);
|
1999-11-30 02:43:11 +00:00
|
|
|
if (qp != NULL)
|
|
|
|
qp->q_notifyzone = zn;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2002-02-04 19:12:46 +00:00
|
|
|
sysquery(dname, class, type, nss, NULL, nsc, ns_port, ns_o_notify, 0);
|
1999-11-30 02:43:11 +00:00
|
|
|
(*nns)++;
|
|
|
|
*na += nsc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-13 19:31:58 +00:00
|
|
|
free_notify(struct pnotify *ni) {
|
1999-11-30 02:43:11 +00:00
|
|
|
struct zoneinfo *zp;
|
|
|
|
|
|
|
|
INSIST(!LINKED(ni, link));
|
|
|
|
zp = find_auth_zone(ni->name, ni->class);
|
2000-05-26 07:17:19 +00:00
|
|
|
if (zp != NULL && ns_samename(ni->name, zp->z_origin) == 1) {
|
1999-11-30 02:43:11 +00:00
|
|
|
INSIST((zp->z_flags & Z_NOTIFY) != 0);
|
|
|
|
zp->z_flags &= ~Z_NOTIFY;
|
|
|
|
}
|
|
|
|
if (evTestID(ni->timer)) {
|
|
|
|
evClearTimer(ev, ni->timer);
|
|
|
|
evInitID(&ni->timer);
|
|
|
|
}
|
2002-02-04 19:12:46 +00:00
|
|
|
ni->name = freestr(ni->name);
|
1999-11-30 02:43:11 +00:00
|
|
|
memput(ni, sizeof *ni);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
notify_timer(evContext ctx, void *uap,
|
|
|
|
struct timespec due,
|
|
|
|
struct timespec inter)
|
|
|
|
{
|
2002-05-13 19:31:58 +00:00
|
|
|
struct pnotify *ni = uap;
|
1999-11-30 02:43:11 +00:00
|
|
|
|
2002-02-04 19:12:46 +00:00
|
|
|
UNUSED(ctx);
|
|
|
|
UNUSED(due);
|
|
|
|
UNUSED(inter);
|
|
|
|
|
1999-11-30 02:43:11 +00:00
|
|
|
INSIST(evTestID(ni->timer));
|
|
|
|
evInitID(&ni->timer);
|
|
|
|
INSIST(LINKED(ni, link));
|
|
|
|
UNLINK(pending_notifies, ni, link);
|
|
|
|
sysnotify(ni->name, ni->class, ni->type);
|
|
|
|
free_notify(ni);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /*BIND_NOTIFY*/
|