Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/dist/bind/bin/named Pull up revision 1.1 (new) (request...
details: https://anonhg.NetBSD.org/src/rev/2e75391e973f
branches: netbsd-1-4
changeset: 469789:2e75391e973f
user: he <he%NetBSD.org@localhost>
date: Sat Dec 04 16:55:14 1999 +0000
description:
Pull up revision 1.1 (new) (requested by christos and veego):
Update to BIND 8.2.2-P5.
diffstat:
dist/bind/bin/named/ns_maint.c | 1746 +++++++++++++++
dist/bind/bin/named/ns_ncache.c | 272 ++
dist/bind/bin/named/ns_notify.c | 381 +++
dist/bind/bin/named/ns_parser.h | 147 +
dist/bind/bin/named/ns_parser.y | 1970 +++++++++++++++++
dist/bind/bin/named/ns_parseutil.c | 246 ++
dist/bind/bin/named/ns_parseutil.h | 67 +
dist/bind/bin/named/ns_req.c | 2102 +++++++++++++++++++
dist/bind/bin/named/ns_resp.c | 3977 ++++++++++++++++++++++++++++++++++++
dist/bind/bin/named/ns_signal.c | 266 ++
10 files changed, 11174 insertions(+), 0 deletions(-)
diffs (truncated from 11214 to 300 lines):
diff -r 82724f39c8f5 -r 2e75391e973f dist/bind/bin/named/ns_maint.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/bind/bin/named/ns_maint.c Sat Dec 04 16:55:14 1999 +0000
@@ -0,0 +1,1746 @@
+/* $NetBSD: ns_maint.c,v 1.1.1.1.2.2 1999/12/04 16:55:14 he Exp $ */
+
+#if !defined(lint) && !defined(SABER)
+static const char sccsid[] = "@(#)ns_maint.c 4.39 (Berkeley) 3/2/91";
+static const char rcsid[] = "Id: ns_maint.c,v 8.95 1999/10/13 16:39:09 vixie Exp";
+#endif /* not lint */
+
+/*
+ * Copyright (c) 1986, 1988
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * 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, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION 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.
+ */
+
+/*
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 1999 by Check Point Software Technologies, Inc.
+ *
+ * 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, and that
+ * the name of Check Point Software Technologies Incorporated not be used
+ * in advertising or publicity pertaining to distribution of the document
+ * or software without specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND CHECK POINT SOFTWARE TECHNOLOGIES
+ * INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
+ * IN NO EVENT SHALL CHECK POINT SOFTWARE TECHNOLOGIES INCORPRATED
+ * 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.
+ */
+
+#include "port_before.h"
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/un.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <assert.h>
+#include <errno.h>
+#include <signal.h>
+#include <resolv.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <time.h>
+#include <unistd.h>
+
+#include <isc/eventlib.h>
+#include <isc/logging.h>
+#include <isc/memcluster.h>
+
+#include <isc/dst.h>
+
+#include "port_after.h"
+
+#include "named.h"
+
+static int nxfers(struct zoneinfo *, int),
+ bottom_of_zone(struct databuf *, int);
+
+static void startxfer(struct zoneinfo *),
+ abortxfer(struct zoneinfo *),
+ tryxfer(void),
+ purge_z_2(struct hashbuf *, int);
+
+#ifndef HAVE_SPAWNXFER
+static pid_t spawnxfer(char **, struct zoneinfo *);
+#endif
+
+static time_t stats_time; /* Redundant ??? XXX ogud */
+
+ /* State of all running zone transfers */
+static struct {
+ pid_t xfer_pid;
+ int xfer_state; /* see below */
+ WAIT_T xfer_status;
+} xferstatus[MAX_XFERS_RUNNING];
+
+#define XFER_IDLE 0
+#define XFER_RUNNING 1
+#define XFER_DONE 2
+
+
+/*
+ * Perform routine zone maintenance.
+ */
+void
+zone_maint(struct zoneinfo *zp) {
+ gettime(&tt);
+
+ ns_debug(ns_log_maint, 1, "zone_maint('%s'); now %lu",
+ zp->z_origin[0] == '\0' ? "." : zp->z_origin,
+ (u_long)tt.tv_sec);
+
+#ifdef DEBUG
+ if (debug >= 2)
+ printzoneinfo((zp - zones), ns_log_maint, 2);
+#endif
+
+ switch (zp->z_type) {
+
+ case Z_SECONDARY:
+ /*FALLTHROUGH*/
+#ifdef STUBS
+ case Z_STUB:
+#endif
+ if (zp->z_serial != 0 &&
+ ((zp->z_lastupdate+zp->z_expire) < (u_int32_t)tt.tv_sec)) {
+ /* calls purge_zone */
+ do_reload(zp->z_origin, zp->z_type, zp->z_class, 0);
+ /* reset zone state */
+ zp->z_flags &= ~Z_AUTH;
+ zp->z_refresh = INIT_REFRESH;
+ zp->z_retry = INIT_REFRESH;
+ zp->z_serial = 0;
+ }
+ if ((zp->z_flags & (Z_NEED_RELOAD|Z_NEED_XFER|Z_QSERIAL)) != 0)
+ {
+ ns_retrytime(zp, tt.tv_sec);
+ break;
+ }
+ if (zp->z_flags & Z_XFER_RUNNING) {
+ abortxfer(zp);
+ /*
+ * Check again in 30 seconds in case the first
+ * abort doesn't work.
+ */
+ if (zp->z_time != 0 && zp->z_time <= tt.tv_sec)
+ zp->z_time = tt.tv_sec + 30;
+ break;
+ }
+ /*
+ * If we don't have the zone loaded or dialup is off
+ * or we attempted a qserial_query before and the queue was
+ * full attempt to verify / load the zone.
+ */
+ if ((zp->z_serial == 0) || (zp->z_flags & Z_NEED_QSERIAL) ||
+ (zp->z_dialup == zdialup_no) ||
+ (zp->z_dialup == zdialup_use_default &&
+ NS_OPTION_P(OPTION_NODIALUP)))
+ qserial_query(zp);
+ else {
+ ns_info(ns_log_default, "Suppressed qserial_query(%s)",
+ *(zp->z_origin) ? zp->z_origin : ".");
+ ns_refreshtime(zp, tt.tv_sec);
+ }
+ break;
+
+#ifdef BIND_UPDATE
+ case Z_PRIMARY:
+ if ((zp->z_flags & Z_DYNAMIC) == 0)
+ break;
+ if (tt.tv_sec >= zp->z_soaincrtime &&
+ zp->z_soaincrintvl > 0 &&
+ zp->z_flags & Z_NEED_SOAUPDATE) {
+ if (incr_serial(zp) < 0) {
+ /* Try again later. */
+ ns_error(ns_log_maint,
+ "error updating serial number for %s from %d",
+ zp->z_origin,
+ zp->z_serial);
+ zp->z_soaincrtime = 0;
+ (void)schedule_soa_update(zp, 0);
+ }
+
+ }
+ if (tt.tv_sec >= zp->z_dumptime &&
+ zp->z_dumpintvl > 0 &&
+ zp->z_flags & Z_NEED_DUMP) {
+ if (zonedump(zp, ISNOTIXFR) < 0) {
+ /* Try again later. */
+ ns_error(ns_log_maint,
+ "zone dump for '%s' failed, rescheduling",
+ zp->z_origin);
+ zp->z_dumptime = 0;
+ (void)schedule_dump(zp);
+ }
+ if (zp->z_maintain_ixfr_base)
+ ixfr_log_maint(zp);
+ }
+ break;
+#endif /* BIND_UPDATE */
+
+ default:
+ break;
+ }
+
+ /*
+ * It is essential that we never try to set a timer in the past
+ * or for now because doing so could cause an infinite loop.
+ */
+ INSIST(zp->z_time == 0 || zp->z_time > tt.tv_sec);
+
+ sched_zone_maint(zp);
+}
+
+static void
+do_zone_maint(evContext ctx, void *uap, struct timespec due,
+ struct timespec inter) {
+ ztimer_info zti = uap;
+ struct zoneinfo *zp;
+
+ INSIST(zti != NULL);
+
+ ns_debug(ns_log_maint, 1, "do_zone_maint for zone %s (class %s)",
+ zti->name, p_class(zti->class));
+ zp = find_zone(zti->name, zti->class);
+ if (zp == NULL) {
+ ns_error(ns_log_maint,
+ "do_zone_maint: %s zone '%s' (class %s) is not authoritative",
+ zoneTypeString(zti->type), zti->name,
+ p_class(zti->class));
+ return;
+ }
+ if (zp->z_type != zti->type) {
+ ns_error(ns_log_maint,
+ "do_zone_maint: %s zone '%s' (class %s) has changed its type",
+ zoneTypeString(zti->type), zti->name,
+ p_class(zti->class));
+ return;
+ }
+
Home |
Main Index |
Thread Index |
Old Index