]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1710. [func] 'rndc notify zone [class [view]]' resend the NOTIFY
authorMark Andrews <marka@isc.org>
Mon, 11 Oct 2004 05:30:20 +0000 (05:30 +0000)
committerMark Andrews <marka@isc.org>
Mon, 11 Oct 2004 05:30:20 +0000 (05:30 +0000)
                        messages for the specified zone. [RT #9479]

CHANGES
bin/named/control.c
bin/named/include/named/control.h
bin/named/include/named/server.h
bin/named/server.c
bin/rndc/rndc.c

diff --git a/CHANGES b/CHANGES
index 06c6b6b74077afb3859d803f0854fc50c35fcc87..9fa7c71fad9d50ddc2d26f7f8b00f3fa43eeacbb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -82,7 +82,8 @@
 
 1711.  [func]          'rndc unfreeze' has been deprecated by 'rndc thaw'.
 
-1710.  [placeholder]   rt9479
+1710.  [func]          'rndc notify zone [class [view]]' resend the NOTIFY
+                       messages for the specified zone. [RT #9479]
 
 1709.  [port]          solaris: add SMF support from Sun.
 
index f61bb957e746ca1812fc260dd5a7ea7b44f54430..917784868b30c9fbb034b222296866aaa87f58b7 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: control.c,v 1.21 2004/09/03 03:42:58 marka Exp $ */
+/* $Id: control.c,v 1.22 2004/10/11 05:30:15 marka Exp $ */
 
 #include <config.h>
 
@@ -132,6 +132,8 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
                isc_timermgr_poke(ns_g_timermgr);
        } else if (command_compare(command, NS_COMMAND_NULL)) {
                result = ISC_R_SUCCESS;
+       } else if (command_compare(command, NS_COMMAND_NOTIFY)) {
+               result = ns_server_notifycommand(ns_g_server, command, text);
        } else {
                isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                              NS_LOGMODULE_CONTROL, ISC_LOG_WARNING,
index 1c9a8131733863b09e91536e6ccfdaa464a2aa8d..8e2b2cdaf7b1321ac5b9447dbd5608c45e671072 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: control.h,v 1.15 2004/09/03 03:42:58 marka Exp $ */
+/* $Id: control.h,v 1.16 2004/10/11 05:30:19 marka Exp $ */
 
 #ifndef NAMED_CONTROL_H
 #define NAMED_CONTROL_H 1
@@ -51,6 +51,7 @@
 #define NS_COMMAND_TIMERPOKE   "timerpoke"
 #define NS_COMMAND_RECURSING   "recursing"
 #define NS_COMMAND_NULL                "null"
+#define NS_COMMAND_NOTIFY      "notify"
 
 isc_result_t
 ns_controls_create(ns_server_t *server, ns_controls_t **ctrlsp);
index 1d48e4bd5f35a14a21ef6d0d3191581bb3e71538..2aafc9cccce89bcc18f5694fc2133731253fe5bf 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.h,v 1.74 2004/07/20 07:13:34 marka Exp $ */
+/* $Id: server.h,v 1.75 2004/10/11 05:30:19 marka Exp $ */
 
 #ifndef NAMED_SERVER_H
 #define NAMED_SERVER_H 1
@@ -141,6 +141,12 @@ ns_server_reconfigcommand(ns_server_t *server, char *args);
  * Act on a "reconfig" command from the command channel.
  */
 
+isc_result_t
+ns_server_notifycommand(ns_server_t *server, char *args, isc_buffer_t *text);
+/*
+ * Act on a "notify" command from the command channel.
+ */
+
 isc_result_t
 ns_server_refreshcommand(ns_server_t *server, char *args, isc_buffer_t *text);
 /*
index 7688400d1bf763cfd4ea8e2f73724d6a56a643ef..c20ed69db89f440cf73a81c1de85ede11d2b8652 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.430 2004/10/05 04:38:17 marka Exp $ */
+/* $Id: server.c,v 1.431 2004/10/11 05:30:16 marka Exp $ */
 
 #include <config.h>
 
@@ -3438,6 +3438,29 @@ ns_server_reconfigcommand(ns_server_t *server, char *args) {
        return (ISC_R_SUCCESS);
 }
 
+/*
+ * Act on a "notify" command from the command channel.
+ */
+isc_result_t
+ns_server_notifycommand(ns_server_t *server, char *args, isc_buffer_t *text) {
+       isc_result_t result;
+       dns_zone_t *zone = NULL;
+       const unsigned char msg[] = "zone notify queued";
+
+       result = zone_from_args(server, args, &zone);
+       if (result != ISC_R_SUCCESS)
+               return (result);
+       if (zone == NULL)
+               return (ISC_R_UNEXPECTEDEND);
+       
+       dns_zone_notify(zone);
+       dns_zone_detach(&zone);
+       if (sizeof(msg) <= isc_buffer_availablelength(text))
+               isc_buffer_putmem(text, msg, sizeof(msg));
+
+       return (ISC_R_SUCCESS);
+}      
+
 /*
  * Act on a "refresh" command from the command channel.
  */
index 0430148d5ca37a0400b4f28a5368c9fe6a7b4040..d2f16edc5695c2707ce130ba42b93278c7df6e61 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc.c,v 1.99 2004/09/03 03:42:58 marka Exp $ */
+/* $Id: rndc.c,v 1.100 2004/10/11 05:30:20 marka Exp $ */
 
 /*
  * Principal Author: DCL
@@ -104,6 +104,8 @@ command is one of the following:\n\
                Suspend updates to a dynamic zone.\n\
   thaw zone [class [view]]\n\
                Enable updates to a frozen dynamic zone and reload it.\n\
+  notify zone [class [view]]\n\
+               Resend NOTIFY messages for the zone.\n\
   reconfig     Reload configuration file and new zones only.\n\
   stats                Write server statistics to the statistics file.\n\
   querylog     Toggle query logging.\n\