Adam Tkac 5ea70d
--- bind-9.4.0/lib/isc/include/isc/socket.h.dbus	2006-06-07 02:29:45.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/isc/include/isc/socket.h	2007-03-06 13:58:11.000000000 +0100
Adam Tkac 5ea70d
@@ -135,6 +135,10 @@
Adam Tkac 5ea70d
 #define ISC_SOCKEVENT_NEWCONN	(ISC_EVENTCLASS_SOCKET + 3)
Adam Tkac 5ea70d
 #define ISC_SOCKEVENT_CONNECT	(ISC_EVENTCLASS_SOCKET + 4)
Martin Stransky a3155a
 
Adam Tkac 5ea70d
+#define ISC_SOCKEVENT_READ_READY  (ISC_EVENTCLASS_SOCKET + 5)
Adam Tkac 5ea70d
+#define ISC_SOCKEVENT_WRITE_READY (ISC_EVENTCLASS_SOCKET + 6)
Adam Tkac 5ea70d
+#define ISC_SOCKEVENT_SELECTED    (ISC_EVENTCLASS_SOCKET + 7)
Martin Stransky a3155a
+
Martin Stransky a3155a
 /*
Adam Tkac 5ea70d
  * Internal events.
Martin Stransky a3155a
  */
Adam Tkac 5ea70d
@@ -144,7 +148,8 @@
Adam Tkac 5ea70d
 typedef enum {
Adam Tkac 5ea70d
 	isc_sockettype_udp = 1,
Adam Tkac 5ea70d
 	isc_sockettype_tcp = 2,
Adam Tkac 5ea70d
-	isc_sockettype_unix = 3
Adam Tkac 5ea70d
+	isc_sockettype_unix = 3,
Adam Tkac 5ea70d
+	isc_sockettype_fd = 8
Adam Tkac 5ea70d
 } isc_sockettype_t;
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 /*@{*/
Adam Tkac 5ea70d
@@ -747,6 +752,54 @@
Adam Tkac 5ea70d
  * \li	#ISC_R_FAILURE
Martin Stransky a3155a
  */
Martin Stransky a3155a
 
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when the isc_sockettype_fd sock 
Adam Tkac 5ea70d
+ * was select()-ed for read. If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Adam Tkac 5ea70d
+ 
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when the isc_sockettype_fd sock 
Adam Tkac 5ea70d
+ * was select()-ed for write. If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Martin Stransky a3155a
+
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets 
Adam Tkac 5ea70d
+ * have been select()-ed . If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Martin Stransky a3155a
+
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when the isc_sockettype_fd sock 
Adam Tkac 5ea70d
+ * was select()-ed for read. If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Adam Tkac 5ea70d
+ 
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when the isc_sockettype_fd sock 
Adam Tkac 5ea70d
+ * was select()-ed for write. If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Martin Stransky a3155a
+
Adam Tkac 5ea70d
+isc_socketevent_t*
Adam Tkac 5ea70d
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev );
Adam Tkac 5ea70d
+/* register the "dev" event to be sent when ALL isc_sockettype_fd sockets 
Adam Tkac 5ea70d
+ * have been select()-ed . If there is already an event registered, it
Adam Tkac 5ea70d
+ * is returned, otherwise 0 is returned. If dev is 0, removes any existing
Adam Tkac 5ea70d
+ * registered event.
Martin Stransky a3155a
+ */
Martin Stransky a3155a
+
Martin Stransky a3155a
 ISC_LANG_ENDDECLS
Martin Stransky a3155a
 
Adam Tkac 5ea70d
 #endif /* ISC_SOCKET_H */
Adam Tkac 5ea70d
--- bind-9.4.0/lib/isc/unix/socket.c.dbus	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/isc/unix/socket.c	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -159,6 +159,11 @@
Martin Stransky a3155a
 	ISC_LIST(isc_socketevent_t)		recv_list;
Martin Stransky a3155a
 	ISC_LIST(isc_socket_newconnev_t)	accept_list;
Martin Stransky a3155a
 	isc_socket_connev_t		       *connect_ev;
Martin Stransky a3155a
+        
Martin Stransky a3155a
+        /* these are used only by isc_sockettype_fd sockets:*/
Martin Stransky a3155a
+        isc_socketevent_t      *read_ready_event;
Martin Stransky a3155a
+        isc_socketevent_t      *write_ready_event;
Martin Stransky a3155a
+        isc_socketevent_t      *selected_event;
Martin Stransky a3155a
 
Martin Stransky a3155a
 	/*
Martin Stransky a3155a
 	 * Internal events.  Posted when a descriptor is readable or
Adam Tkac 5ea70d
@@ -315,7 +320,7 @@
Martin Stransky a3155a
 
Martin Stransky a3155a
 static void
Martin Stransky a3155a
 wakeup_socket(isc_socketmgr_t *manager, int fd, int msg) {
Martin Stransky a3155a
-	isc_socket_t *sock;
Martin Stransky a3155a
+	isc_socket_t *sock=0L;
Martin Stransky a3155a
 
Martin Stransky a3155a
 	/*
Martin Stransky a3155a
 	 * This is a wakeup on a socket.  If the socket is not in the
Adam Tkac 5ea70d
@@ -1311,6 +1316,9 @@
Martin Stransky a3155a
 	sock->connected = 0;
Martin Stransky a3155a
 	sock->connecting = 0;
Martin Stransky a3155a
 	sock->bound = 0;
Martin Stransky a3155a
+	sock->read_ready_event = 0L;
Martin Stransky a3155a
+	sock->write_ready_event = 0L;
Martin Stransky a3155a
+	sock->selected_event = 0L;
Martin Stransky a3155a
 
Martin Stransky a3155a
 	/*
Martin Stransky a3155a
 	 * initialize the lock
Adam Tkac 5ea70d
@@ -1426,13 +1434,16 @@
Adam Tkac 5ea70d
 	case isc_sockettype_unix:
Adam Tkac 5ea70d
 		sock->fd = socket(pf, SOCK_STREAM, 0);
Martin Stransky a3155a
 		break;
Martin Stransky a3155a
+
Martin Stransky a3155a
+	case isc_sockettype_fd:
Martin Stransky a3155a
+	        sock->fd = pf;
Martin Stransky a3155a
 	}
Martin Stransky a3155a
 
Martin Stransky a3155a
 #ifdef F_DUPFD
Martin Stransky a3155a
 	/*
Martin Stransky a3155a
 	 * Leave a space for stdio to work in.
Martin Stransky a3155a
 	 */
Martin Stransky a3155a
-	if (sock->fd >= 0 && sock->fd < 20) {
Martin Stransky a3155a
+	if ( (type != isc_sockettype_fd) && (sock->fd >= 0) && (sock->fd < 20) ) {
Martin Stransky a3155a
 		int new, tmp;
Martin Stransky a3155a
 		new = fcntl(sock->fd, F_DUPFD, 20);
Martin Stransky a3155a
 		tmp = errno;
Adam Tkac 5ea70d
@@ -1486,7 +1497,7 @@
Martin Stransky a3155a
 		}
Martin Stransky a3155a
 	}
Martin Stransky a3155a
 
Martin Stransky a3155a
-	if (make_nonblock(sock->fd) != ISC_R_SUCCESS) {
Martin Stransky a3155a
+	if ((type != isc_sockettype_fd) && (make_nonblock(sock->fd) != ISC_R_SUCCESS)) {
Martin Stransky a3155a
 		(void)close(sock->fd);
Martin Stransky a3155a
 		free_socket(&sock);
Martin Stransky a3155a
 		return (ISC_R_UNEXPECTED);
Adam Tkac 5ea70d
@@ -1777,6 +1788,38 @@
Martin Stransky a3155a
 	isc_task_send(ev->ev_sender, (isc_event_t **)&iev;;
Martin Stransky a3155a
 }
Martin Stransky a3155a
 
Martin Stransky a3155a
+static
Martin Stransky a3155a
+isc_event_t *dispatch_read_ready(isc_socketmgr_t *manager, isc_socket_t *sock)
Martin Stransky a3155a
+{
Martin Stransky a3155a
+    isc_event_t *dev = (isc_event_t*)sock->read_ready_event, *ev;
Martin Stransky a3155a
+    
Martin Stransky a3155a
+    ev = isc_mem_get(manager->mctx, dev->ev_size);
Martin Stransky a3155a
+    memcpy(ev,dev,dev->ev_size);
Martin Stransky a3155a
+    ISC_LINK_INIT(ev,ev_link);
Martin Stransky a3155a
+    isc_task_send(dev->ev_sender, &ev );
Martin Stransky a3155a
+    return (isc_event_t *)sock->selected_event;
Martin Stransky a3155a
+}
Martin Stransky a3155a
+
Martin Stransky a3155a
+static
Martin Stransky a3155a
+isc_event_t *dispatch_write_ready(isc_socketmgr_t *manager,isc_socket_t *sock)
Martin Stransky a3155a
+{
Martin Stransky a3155a
+    isc_event_t *dev = (isc_event_t*)sock->write_ready_event, *ev;
Martin Stransky a3155a
+    ev = isc_mem_get(manager->mctx, dev->ev_size);
Martin Stransky a3155a
+    memcpy(ev,dev,dev->ev_size);
Martin Stransky a3155a
+    ISC_LINK_INIT(ev,ev_link);
Martin Stransky a3155a
+    isc_task_send(dev->ev_sender, &ev );
Martin Stransky a3155a
+    return (isc_event_t *)sock->selected_event;
Martin Stransky a3155a
+}
Martin Stransky a3155a
+
Martin Stransky a3155a
+static
Martin Stransky a3155a
+void dispatch_selected(isc_socketmgr_t *manager, isc_event_t *dev)
Martin Stransky a3155a
+{   isc_event_t *ev;
Martin Stransky a3155a
+    ev = isc_mem_get(manager->mctx, dev->ev_size);
Martin Stransky a3155a
+    memcpy(ev,dev,dev->ev_size);
Martin Stransky a3155a
+    ISC_LINK_INIT(ev,ev_link);
Martin Stransky a3155a
+    isc_task_send(dev->ev_sender, &ev );
Martin Stransky a3155a
+}
Martin Stransky a3155a
+
Martin Stransky a3155a
 /*
Martin Stransky a3155a
  * Dequeue an item off the given socket's read queue, set the result code
Martin Stransky a3155a
  * in the done event to the one provided, and send it to the task it was
Adam Tkac 5ea70d
@@ -2184,6 +2227,7 @@
Martin Stransky a3155a
 	int i;
Martin Stransky a3155a
 	isc_socket_t *sock;
Martin Stransky a3155a
 	isc_boolean_t unlock_sock;
Martin Stransky a3155a
+	isc_event_t *sock_selected = 0L;
Martin Stransky a3155a
 
Martin Stransky a3155a
 	REQUIRE(maxfd <= (int)FD_SETSIZE);
Martin Stransky a3155a
 
Adam Tkac 5ea70d
@@ -2217,11 +2261,15 @@
Martin Stransky a3155a
 			unlock_sock = ISC_TRUE;
Martin Stransky a3155a
 			LOCK(&sock->lock);
Martin Stransky a3155a
 			if (!SOCK_DEAD(sock)) {
Martin Stransky a3155a
+			    if( sock->type != isc_sockettype_fd )
Martin Stransky a3155a
+			    {
Martin Stransky a3155a
 				if (sock->listener)
Martin Stransky a3155a
 					dispatch_accept(sock);
Martin Stransky a3155a
 				else
Martin Stransky a3155a
 					dispatch_recv(sock);
Martin Stransky a3155a
-			}
Martin Stransky a3155a
+			    }else			    
Martin Stransky a3155a
+				sock_selected = dispatch_read_ready(manager,sock);
Martin Stransky a3155a
+			}			    
Martin Stransky a3155a
 			FD_CLR(i, &manager->read_fds);
Martin Stransky a3155a
 		}
Martin Stransky a3155a
 	check_write:
Adam Tkac 5ea70d
@@ -2235,16 +2283,24 @@
Martin Stransky a3155a
 				LOCK(&sock->lock);
Martin Stransky a3155a
 			}
Martin Stransky a3155a
 			if (!SOCK_DEAD(sock)) {
Martin Stransky a3155a
+			    if( sock->type != isc_sockettype_fd )
Martin Stransky a3155a
+			    {
Martin Stransky a3155a
 				if (sock->connecting)
Martin Stransky a3155a
 					dispatch_connect(sock);
Martin Stransky a3155a
 				else
Martin Stransky a3155a
 					dispatch_send(sock);
Martin Stransky a3155a
+			    }else			   
Martin Stransky a3155a
+				sock_selected =	dispatch_write_ready(manager,sock);
Martin Stransky a3155a
 			}
Martin Stransky a3155a
 			FD_CLR(i, &manager->write_fds);
Martin Stransky a3155a
 		}
Martin Stransky a3155a
 		if (unlock_sock)
Martin Stransky a3155a
 			UNLOCK(&sock->lock);
Martin Stransky a3155a
 	}
Martin Stransky a3155a
+	if( sock_selected != 0L )
Martin Stransky a3155a
+	{
Martin Stransky a3155a
+	    dispatch_selected(manager, sock_selected);
Martin Stransky a3155a
+	}
Martin Stransky a3155a
 }
Martin Stransky a3155a
 
Martin Stransky a3155a
 #ifdef ISC_PLATFORM_USETHREADS
Adam Tkac 5ea70d
@@ -2263,7 +2319,7 @@
Martin Stransky a3155a
 	int cc;
Martin Stransky a3155a
 	fd_set readfds;
Martin Stransky a3155a
 	fd_set writefds;
Martin Stransky a3155a
-	int msg, fd;
Martin Stransky a3155a
+	int msg, fd = -1;
Martin Stransky a3155a
 	int maxfd;
Martin Stransky a3155a
 	char strbuf[ISC_STRERRORSIZE];
Martin Stransky a3155a
 
Adam Tkac 5ea70d
@@ -3784,3 +3840,55 @@
Martin Stransky a3155a
 	return (ISC_R_SUCCESS);
Martin Stransky a3155a
 }
Martin Stransky a3155a
 #endif /* ISC_PLATFORM_USETHREADS */
Martin Stransky a3155a
+
Martin Stransky a3155a
+isc_socketevent_t*
Martin Stransky a3155a
+isc_socket_fd_handle_reads( isc_socket_t *sock, isc_socketevent_t *dev )
Martin Stransky a3155a
+{    
Martin Stransky a3155a
+    REQUIRE(VALID_SOCKET(sock));   
Martin Stransky a3155a
+    if(dev != 0L) 
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	sock->references=1;
Martin Stransky a3155a
+	sock->read_ready_event = dev;
Martin Stransky a3155a
+	select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	dev = sock->read_ready_event ;
Martin Stransky a3155a
+	sock->read_ready_event = 0L ;
Martin Stransky a3155a
+    }
Martin Stransky a3155a
+    return dev;
Martin Stransky a3155a
+}
Martin Stransky a3155a
+
Martin Stransky a3155a
+isc_socketevent_t*
Martin Stransky a3155a
+isc_socket_fd_handle_writes( isc_socket_t *sock, isc_socketevent_t *dev )
Martin Stransky a3155a
+{
Martin Stransky a3155a
+    REQUIRE(VALID_SOCKET(sock));   
Martin Stransky a3155a
+    if(dev != 0L) 
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	sock->references=1;
Martin Stransky a3155a
+	sock->write_ready_event = dev;
Martin Stransky a3155a
+	select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);    
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	dev = sock->write_ready_event;
Martin Stransky a3155a
+	sock->write_ready_event = 0L;
Martin Stransky a3155a
+    }
Martin Stransky a3155a
+    return dev;
Martin Stransky a3155a
+}
Martin Stransky a3155a
+
Martin Stransky a3155a
+isc_socketevent_t*
Martin Stransky a3155a
+isc_socket_fd_handle_selected( isc_socket_t *sock, isc_socketevent_t *dev )
Martin Stransky a3155a
+{
Martin Stransky a3155a
+    REQUIRE(VALID_SOCKET(sock));
Martin Stransky a3155a
+    if(dev != 0L) 
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	sock->references=1;
Martin Stransky a3155a
+	sock->selected_event = dev;
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Martin Stransky a3155a
+	dev = sock->selected_event;
Martin Stransky a3155a
+	sock->selected_event = 0L;
Martin Stransky a3155a
+	sock->references=0;
Martin Stransky a3155a
+	destroy(&sock);
Martin Stransky a3155a
+    }
Martin Stransky a3155a
+    return dev;
Martin Stransky a3155a
+}
Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/forward.c.dbus	2005-07-12 03:22:20.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/forward.c	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -197,3 +197,89 @@
Adam Tkac 5ea70d
 	}
Adam Tkac 5ea70d
 	isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t));
Adam Tkac 5ea70d
 }
Martin Stransky a3155a
+
Adam Tkac 5ea70d
+/***
Adam Tkac 5ea70d
+ *** new D-BUS Dynamic Forwarding Zones functions:
Adam Tkac 5ea70d
+ ***/
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_delete(dns_fwdtable_t *fwdtable, dns_name_t *name )
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+	isc_result_t result;
Martin Stransky a3155a
+
Adam Tkac 5ea70d
+	REQUIRE(VALID_FWDTABLE(fwdtable));
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	RWLOCK(&fwdtable->rwlock, isc_rwlocktype_write);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	result = dns_rbt_deletename(fwdtable->table, name, ISC_FALSE);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_write);		    
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	return (result);
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, 
Adam Tkac 5ea70d
+			  dns_name_t *name, 
Adam Tkac 5ea70d
+			  dns_name_t *foundname,
Adam Tkac 5ea70d
+			  dns_forwarders_t **forwardersp)
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+	isc_result_t result;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	REQUIRE(VALID_FWDTABLE(fwdtable));
Adam Tkac 5ea70d
+	
Adam Tkac 5ea70d
+	RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	result = dns_rbt_findname(fwdtable->table, name, 0, foundname,
Adam Tkac 5ea70d
+				  (void **)forwardersp);
Adam Tkac 5ea70d
+	
Adam Tkac 5ea70d
+	if(result == DNS_R_PARTIALMATCH)
Adam Tkac 5ea70d
+	    result = ISC_R_SUCCESS;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	return (result);
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name,
Adam Tkac 5ea70d
+		  dns_forwarders_t **forwardersp)
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+	isc_result_t result;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	REQUIRE(VALID_FWDTABLE(fwdtable));
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	REQUIRE(forwardersp != 0L);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	RWLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	result = dns_rbt_findname(fwdtable->table, name, 0, NULL,
Adam Tkac 5ea70d
+				  (void **)forwardersp);
Adam Tkac 5ea70d
+	
Adam Tkac 5ea70d
+	if( result != ISC_R_SUCCESS )
Adam Tkac 5ea70d
+	    *forwardersp = 0L;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	RWUNLOCK(&fwdtable->rwlock, isc_rwlocktype_read);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	return (result);
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+static 
Adam Tkac 5ea70d
+void dns_fwdtable_traverse
Adam Tkac 5ea70d
+(   
Adam Tkac 5ea70d
+    dns_name_t *name,
Adam Tkac 5ea70d
+    void *node_data,
Adam Tkac 5ea70d
+    void *cbp,
Adam Tkac 5ea70d
+    void *cb_arg
Adam Tkac 5ea70d
+)
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+    dns_fwdtable_callback_t  cb = (dns_fwdtable_callback_t) cbp;
Adam Tkac 5ea70d
+    
Adam Tkac 5ea70d
+    (*cb)( name, node_data, cb_arg);
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void *cb_arg )
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+    REQUIRE(VALID_FWDTABLE(fwdtable));
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+    dns_rbt_traverse( fwdtable->table, dns_fwdtable_traverse, cb, cb_arg );
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/rbt.c.dbus	2005-10-13 03:26:06.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/rbt.c	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -2175,6 +2175,47 @@
Adam Tkac 5ea70d
 	dns_rbt_printtree(rbt->root, NULL, 0);
Adam Tkac 5ea70d
 }
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+static void
Adam Tkac 5ea70d
+dns_rbt_traverse_tree(dns_rbtnode_t *root,  dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 ) {
Adam Tkac 5ea70d
+/*
Adam Tkac 5ea70d
+ * This is used ONLY to traverse the forward table by dbus_mgr at the moment.
Adam Tkac 5ea70d
+ * Since the forward table is not likely to be large, this can be recursive.
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+	dns_name_t name;
Adam Tkac 5ea70d
+	dns_offsets_t offsets;
Adam Tkac 5ea70d
+	char buf[DNS_NAME_MAXWIRE];
Adam Tkac 5ea70d
+	isc_buffer_t buffer;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	if (root != NULL) {
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+		if (DOWN(root)) 
Adam Tkac 5ea70d
+			dns_rbt_traverse_tree(DOWN(root), cb, cb_arg1, cb_arg2);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+		if( LEFT(root) != NULL )
Adam Tkac 5ea70d
+		        dns_rbt_traverse_tree(LEFT(root), cb, cb_arg1, cb_arg2);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+		if( RIGHT(root) != NULL )
Adam Tkac 5ea70d
+		        dns_rbt_traverse_tree(RIGHT(root), cb, cb_arg1, cb_arg2);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+		if( DATA(root) == 0L )
Adam Tkac 5ea70d
+		    return;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+		dns_name_init(&name, offsets);
Adam Tkac 5ea70d
+		isc_buffer_init(&buffer, buf, DNS_NAME_MAXWIRE);
Adam Tkac 5ea70d
+		dns_name_setbuffer( &name, &buffer);
Adam Tkac 5ea70d
+		dns_rbt_fullnamefromnode(root, &name);
Adam Tkac 5ea70d
+		
Adam Tkac 5ea70d
+		(*cb)(&name, DATA(root), cb_arg1, cb_arg2);		
Adam Tkac 5ea70d
+	} 
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2  )
Adam Tkac 5ea70d
+{
Adam Tkac 5ea70d
+        REQUIRE(VALID_RBT(rbt));
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	dns_rbt_traverse_tree( rbt->root, cb, cb_arg1, cb_arg2 );       
Adam Tkac 5ea70d
+}
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 /*
Adam Tkac 5ea70d
  * Chain Functions
Adam Tkac 5ea70d
  */
Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/include/dns/rbt.h.dbus	2005-10-13 03:26:07.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/include/dns/rbt.h	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -911,6 +911,17 @@
Adam Tkac 5ea70d
 	} while (0) 
Adam Tkac 5ea70d
 #endif /* DNS_RBT_USEISCREFCOUNT */
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+typedef void (*dns_rbt_traverse_callback_t)(  dns_name_t *name,
Adam Tkac 5ea70d
+					      void *node_data,
Adam Tkac 5ea70d
+					      void *cb_arg1,
Adam Tkac 5ea70d
+					      void *cb_arg2);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+void dns_rbt_traverse( dns_rbt_t *rbt, dns_rbt_traverse_callback_t cb, void *cb_arg1, void *cb_arg2 );
Adam Tkac 5ea70d
+/* tree traversal function (only used by D-BUS dynamic forwarding dbus_mgr at
Adam Tkac 5ea70d
+ * the moment)
Martin Stransky a3155a
+ */
Martin Stransky a3155a
+
Martin Stransky a3155a
 ISC_LANG_ENDDECLS
Martin Stransky a3155a
 
Adam Tkac 5ea70d
 #endif /* DNS_RBT_H */
Adam Tkac 5ea70d
--- bind-9.4.0/lib/dns/include/dns/forward.h.dbus	2005-04-27 07:01:33.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/lib/dns/include/dns/forward.h	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -113,6 +113,37 @@
Adam Tkac 5ea70d
  * \li	all memory associated with the forwarding table is freed.
Adam Tkac 5ea70d
  */
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+/* These are ONLY used by dbus_mgr :
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_delete( dns_fwdtable_t *fwdtable, dns_name_t *name );
Adam Tkac 5ea70d
+/* 
Adam Tkac 5ea70d
+ * Removes an entry from the forwarding table.
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_find_exact(dns_fwdtable_t *fwdtable, dns_name_t *name,
Adam Tkac 5ea70d
+		  dns_forwarders_t **forwardersp);
Adam Tkac 5ea70d
+/*
Adam Tkac 5ea70d
+ * Finds an exact match for "name" in the forwarding table.  
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+isc_result_t
Adam Tkac 5ea70d
+dns_fwdtable_find_closest(dns_fwdtable_t *fwdtable, dns_name_t *name, dns_name_t *foundname,
Adam Tkac 5ea70d
+		  dns_forwarders_t **forwardersp);
Adam Tkac 5ea70d
+/*
Adam Tkac 5ea70d
+ * Finds the closest match for "*name" in the forwarding table, returning  
Adam Tkac 5ea70d
+ * the actual name matching in *name if different to *name passed in. 
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+typedef void (*dns_fwdtable_callback_t)( dns_name_t *, dns_forwarders_t *, void *);
Adam Tkac 5ea70d
+void dns_fwdtable_foreach(dns_fwdtable_t *fwdtable, dns_fwdtable_callback_t cb, void * );
Adam Tkac 5ea70d
+/* Invoke cb for each member of fwdtable 
Adam Tkac 5ea70d
+ */
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 ISC_LANG_ENDDECLS
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 #endif /* DNS_FORWARD_H */
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/main.c.dbus	2006-11-10 19:51:14.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/main.c	2007-03-06 14:11:18.000000000 +0100
Adam Tkac 5ea70d
@@ -248,7 +248,8 @@
Adam Tkac 5ea70d
 		"usage: named [-4|-6] [-c conffile] [-d debuglevel] "
Adam Tkac 5ea70d
 		"[-f|-g] [-n number_of_cpus]\n"
Adam Tkac 5ea70d
 		"             [-p port] [-s] [-t chrootdir] [-u username]\n"
Adam Tkac 5ea70d
-		"             [-m {usage|trace|record|size|mctx}]\n");
Adam Tkac 5ea70d
+		"             [-m {usage|trace|record|size|mctx}]\n"
Adam Tkac 5ea70d
+		"	      [-D ]\n");
Adam Tkac 5ea70d
 }
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 static void
Adam Tkac 5ea70d
@@ -356,7 +357,7 @@
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 	isc_commandline_errprint = ISC_FALSE;
Adam Tkac 5ea70d
 	while ((ch = isc_commandline_parse(argc, argv,
Adam Tkac 5ea70d
-			           "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:")) != -1) {
Adam Tkac 5ea70d
+			           "46c:C:d:fgi:lm:n:N:p:P:st:u:vx:D")) != -1) {
Adam Tkac 5ea70d
 		switch (ch) {
Adam Tkac 5ea70d
 		case '4':
Adam Tkac 5ea70d
 			if (disable4)
Adam Tkac 5ea70d
@@ -445,6 +446,9 @@
Adam Tkac 5ea70d
 		case 'v':
Adam Tkac 5ea70d
 			printf("BIND %s\n", ns_g_version);
Adam Tkac 5ea70d
 			exit(0);
Adam Tkac 5ea70d
+		case 'D':
Adam Tkac 5ea70d
+		        ns_g_dbus = 1;
Adam Tkac 5ea70d
+			break;
Adam Tkac 5ea70d
 		case '?':
Adam Tkac 5ea70d
 			usage();
Adam Tkac 5ea70d
 			ns_main_earlyfatal("unknown option '-%c'",
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/log.c.dbus	2006-06-09 02:54:08.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/log.c	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -44,6 +44,7 @@
Martin Stransky a3155a
 	{ "queries",	 		0 },
Martin Stransky a3155a
 	{ "unmatched",	 		0 },
Martin Stransky a3155a
 	{ "update-security",		0 },
Martin Stransky a3155a
+	{ "dbus",                       0 },
Martin Stransky a3155a
 	{ NULL, 			0 }
Martin Stransky a3155a
 };
Martin Stransky a3155a
 
Adam Tkac 5ea70d
@@ -63,6 +64,7 @@
Martin Stransky a3155a
 	{ "notify",	 		0 },
Martin Stransky a3155a
 	{ "control",	 		0 },
Martin Stransky a3155a
 	{ "lwresd",	 		0 },
Martin Stransky a3155a
+	{ "dbus",                       0 },
Martin Stransky a3155a
 	{ NULL, 			0 }
Martin Stransky a3155a
 };
Martin Stransky a3155a
 
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/include/named/server.h.dbus	2006-03-10 00:46:20.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/include/named/server.h	2007-03-06 14:12:02.000000000 +0100
Adam Tkac 5ea70d
@@ -97,6 +97,8 @@
Adam Tkac 5ea70d
 	ns_dispatchlist_t	dispatches;
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 	dns_acache_t		*acache;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
+	ns_dbus_mgr_t *         dbus_mgr;
Adam Tkac 5ea70d
 };
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 #define NS_SERVER_MAGIC			ISC_MAGIC('S','V','E','R')
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/include/named/types.h.dbus	2005-04-29 02:15:38.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/include/named/types.h	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -40,4 +40,6 @@
Adam Tkac 5ea70d
 typedef struct ns_dispatch		ns_dispatch_t;
Adam Tkac 5ea70d
 typedef ISC_LIST(ns_dispatch_t)		ns_dispatchlist_t;
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+typedef struct ns_dbus_mgr              ns_dbus_mgr_t ;
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 #endif /* NAMED_TYPES_H */
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/include/named/globals.h.dbus	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/include/named/globals.h	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -114,6 +114,8 @@
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 EXTERN int			ns_g_listen		INIT(3);
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+EXTERN int                      ns_g_dbus               INIT(0);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 #undef EXTERN
Adam Tkac 5ea70d
 #undef INIT
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/include/named/log.h.dbus	2005-04-29 02:15:35.000000000 +0200
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/include/named/log.h	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -36,6 +36,7 @@
Adam Tkac 5ea70d
 #define NS_LOGCATEGORY_QUERIES		(&ns_g_categories[4])
Adam Tkac 5ea70d
 #define NS_LOGCATEGORY_UNMATCHED	(&ns_g_categories[5])
Adam Tkac 5ea70d
 #define NS_LOGCATEGORY_UPDATE_SECURITY	(&ns_g_categories[6])
Adam Tkac 5ea70d
+#define NS_LOGCATEGORY_DBUS      	(&ns_g_categories[7])
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 /*
Adam Tkac 5ea70d
  * Backwards compatibility.
Adam Tkac 5ea70d
@@ -53,6 +54,7 @@
Adam Tkac 5ea70d
 #define NS_LOGMODULE_NOTIFY		(&ns_g_modules[8])
Adam Tkac 5ea70d
 #define NS_LOGMODULE_CONTROL		(&ns_g_modules[9])
Adam Tkac 5ea70d
 #define NS_LOGMODULE_LWRESD		(&ns_g_modules[10])
Adam Tkac 5ea70d
+#define NS_LOGMODULE_DBUS		(&ns_g_modules[11])
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 isc_result_t
Adam Tkac 5ea70d
 ns_log_init(isc_boolean_t safe);
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/server.c.dbus	2006-12-07 06:24:19.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/server.c	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -167,6 +167,8 @@
Adam Tkac 5ea70d
 	ISC_LINK(struct zonelistentry)	link;
Adam Tkac 5ea70d
 };
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+#include <named/dbus_mgr.h>
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 /*
Adam Tkac 5ea70d
  * These zones should not leak onto the Internet.
Adam Tkac 5ea70d
  */
Adam Tkac 5ea70d
@@ -1985,12 +1987,12 @@
Adam Tkac 5ea70d
 	if (result != ISC_R_SUCCESS) {
Adam Tkac 5ea70d
 		char namebuf[DNS_NAME_FORMATSIZE];
Adam Tkac 5ea70d
 		dns_name_format(origin, namebuf, sizeof(namebuf));
Adam Tkac 5ea70d
-		cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_WARNING,
Adam Tkac 5ea70d
-			    "could not set up forwarding for domain '%s': %s",
Adam Tkac 5ea70d
+		cfg_obj_log(forwarders, ns_g_lctx, ISC_LOG_NOTICE,
Adam Tkac 5ea70d
+			    "setting up forwarding failed for domain '%s': %s",
Adam Tkac 5ea70d
 			    namebuf, isc_result_totext(result));
Adam Tkac 5ea70d
 		goto cleanup;
Adam Tkac 5ea70d
 	}
Martin Stransky a3155a
-
Adam Tkac 5ea70d
+		
Adam Tkac 5ea70d
 	result = ISC_R_SUCCESS;
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
  cleanup:
Adam Tkac 5ea70d
@@ -3418,6 +3420,20 @@
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 	CHECKFATAL(load_zones(server, ISC_FALSE), "loading zones");
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+	server->dbus_mgr = 0L;
Adam Tkac 5ea70d
+	if( ns_g_dbus )	
Adam Tkac 5ea70d
+	    if( dbus_mgr_create
Adam Tkac 5ea70d
+	        (  ns_g_mctx, ns_g_taskmgr, ns_g_socketmgr, ns_g_timermgr,
Adam Tkac 5ea70d
+		   &server->dbus_mgr
Adam Tkac 5ea70d
+		) != ISC_R_SUCCESS
Adam Tkac 5ea70d
+	      )
Adam Tkac 5ea70d
+	    {
Adam Tkac 5ea70d
+		isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
Adam Tkac 5ea70d
+			      NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
Adam Tkac 5ea70d
+			      "dbus_mgr initialization failed. D-BUS service is disabled."
Adam Tkac 5ea70d
+		             );
Adam Tkac 5ea70d
+	    }
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 	ns_os_started();
Adam Tkac 5ea70d
 	isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER,
Adam Tkac 5ea70d
 		      ISC_LOG_NOTICE, "running");
Adam Tkac 5ea70d
@@ -3481,6 +3497,9 @@
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 	dns_db_detach(&server->in_roothints);
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
+	if( server->dbus_mgr != 0L )
Adam Tkac 5ea70d
+	    dbus_mgr_shutdown(server->dbus_mgr);
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 	isc_task_endexclusive(server->task);
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 	isc_task_detach(&server->task);
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/Makefile.in.dbus	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/Makefile.in	2007-03-06 14:08:10.000000000 +0100
Adam Tkac 5ea70d
@@ -43,6 +43,9 @@
Adam Tkac 5ea70d
 		${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \
Adam Tkac 5ea70d
 		${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES}
Adam Tkac 5ea70d
 
Martin Stransky a3155a
+DBUS_INCLUDES = \
Adam Tkac 5ea70d
+        -I/usr/lib/dbus-1.0/include -I/usr/include/dbus-1.0
Adam Tkac 5ea70d
+
Adam Tkac 5ea70d
 CDEFINES =      @USE_DLZ@
Martin Stransky a3155a
 
Adam Tkac 5ea70d
 CWARNINGS =
Adam Tkac 5ea70d
@@ -60,6 +63,7 @@
Martin Stransky a3155a
 ISCDEPLIBS =	../../lib/isc/libisc.@A@
Martin Stransky a3155a
 LWRESDEPLIBS =	../../lib/lwres/liblwres.@A@
Martin Stransky a3155a
 BIND9DEPLIBS =	../../lib/bind9/libbind9.@A@
Martin Stransky a3155a
+DBUSLIBS=       -ldbus-1
Martin Stransky a3155a
 
Martin Stransky a3155a
 DEPLIBS =	${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
Martin Stransky a3155a
 		${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS}
Adam Tkac 5ea70d
@@ -80,6 +84,7 @@
Martin Stransky a3155a
 		zoneconf.o \
Martin Stransky a3155a
 		lwaddr.o lwresd.o lwdclient.o lwderror.o lwdgabn.o \
Adam Tkac 5ea70d
 		lwdgnba.o lwdgrbn.o lwdnoop.o lwsearch.o \
Martin Stransky a3155a
+		dbus_service.o dbus_mgr.o \
Adam Tkac 5ea70d
 		${DLZDRIVER_OBJS} ${DBDRIVER_OBJS}
Martin Stransky a3155a
 
Martin Stransky a3155a
 UOBJS =		unix/os.o
Adam Tkac 5ea70d
@@ -92,6 +97,7 @@
Martin Stransky a3155a
 		zoneconf.c \
Martin Stransky a3155a
 		lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
Martin Stransky a3155a
 		lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
Adam Tkac 5ea70d
+		dbus_service.c dbus_mgr.c \
Adam Tkac 5ea70d
 		${DLZDRIVER_SRCS} ${DBDRIVER_SRCS}
Martin Stransky a3155a
 
Martin Stransky a3155a
 MANPAGES =	named.8 lwresd.8 named.conf.5
Adam Tkac 5ea70d
@@ -120,9 +126,14 @@
Martin Stransky a3155a
 		-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
Martin Stransky a3155a
 		-c ${srcdir}/config.c
Martin Stransky a3155a
 
Martin Stransky a3155a
+dbus_service.o: dbus_service.c
Martin Stransky a3155a
+	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
Martin Stransky a3155a
+	        ${DBUS_INCLUDES} \
Martin Stransky a3155a
+		-c ${srcdir}/dbus_service.c
Martin Stransky a3155a
+
Martin Stransky a3155a
 named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
Martin Stransky a3155a
 	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \
Martin Stransky a3155a
-	${OBJS} ${UOBJS} ${LIBS}
Martin Stransky a3155a
+	${OBJS} ${UOBJS} ${LIBS} ${DBUSLIBS}
Martin Stransky a3155a
 
Martin Stransky a3155a
 lwresd@EXEEXT@: named@EXEEXT@
Martin Stransky a3155a
 	rm -f lwresd@EXEEXT@
Adam Tkac 5ea70d
--- bind-9.4.0/bin/named/named.8.dbus	2007-01-30 01:23:44.000000000 +0100
Adam Tkac 5ea70d
+++ bind-9.4.0/bin/named/named.8	2007-03-06 13:45:26.000000000 +0100
Adam Tkac 5ea70d
@@ -33,7 +33,7 @@
Martin Stransky a3155a
 named \- Internet domain name server
Martin Stransky a3155a
 .SH "SYNOPSIS"
Martin Stransky a3155a
 .HP 6
Martin Stransky a3155a
-\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR]
Martin Stransky a3155a
+\fBnamed\fR [\fB\-4\fR] [\fB\-6\fR] [\fB\-c\ \fR\fB\fIconfig\-file\fR\fR] [\fB\-d\ \fR\fB\fIdebug\-level\fR\fR] [\fB\-f\fR] [\fB\-g\fR] [\fB\-n\ \fR\fB\fI#cpus\fR\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-s\fR] [\fB\-t\ \fR\fB\fIdirectory\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-x\ \fR\fB\fIcache\-file\fR\fR] [\fB\-D\fR]
Martin Stransky a3155a
 .SH "DESCRIPTION"
Martin Stransky a3155a
 .PP
Martin Stransky a3155a
 \fBnamed\fR
Adam Tkac 5ea70d
@@ -172,6 +172,13 @@
Martin Stransky a3155a
 This option must not be used. It is only of interest to BIND 9 developers and may be removed or changed in a future release.
Martin Stransky a3155a
 .RE
Adam Tkac 5ea70d
 .RE
Martin Stransky a3155a
+.sp
Martin Stransky a3155a
+.TP
Martin Stransky a3155a
+\fB\-D\fR
Martin Stransky a3155a
+Enable dynamic management of the forwarding table with D-BUS
Martin Stransky a3155a
+messages. This option is required for Red Hat NetworkManager
Martin Stransky a3155a
+support. See doc/README.DBUS .
Martin Stransky a3155a
+.sp
Martin Stransky a3155a
 .SH "SIGNALS"
Martin Stransky a3155a
 .PP
Martin Stransky a3155a
 In routine operation, signals should not be used to control the nameserver;