Adam Tkac 066ea9
--- bind-9.5.0a5/lib/isc/include/isc/socket.h.dbus	2007-02-13 03:49:08.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/isc/include/isc/socket.h	2007-06-19 11:06:55.000000000 +0200
Adam Tkac 066ea9
@@ -136,6 +136,10 @@ struct isc_socket_connev {
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 066ea9
@@ -147,6 +151,7 @@ typedef enum {
Adam Tkac 5ea70d
 	isc_sockettype_tcp = 2,
Adam Tkac 066ea9
 	isc_sockettype_unix = 3,
Adam Tkac 066ea9
 	isc_sockettype_fdwatch = 4,
Adam Tkac 5ea70d
+	isc_sockettype_fd = 8
Adam Tkac 5ea70d
 } isc_sockettype_t;
Adam Tkac 5ea70d
 
Adam Tkac 5ea70d
 /*@{*/
Adam Tkac 066ea9
@@ -823,6 +828,54 @@ isc_socketmgr_renderxml(isc_socketmgr_t 
Adam Tkac 066ea9
 
Adam Tkac 066ea9
 #endif /* HAVE_LIBXML2 */
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 066ea9
--- bind-9.5.0a5/lib/isc/unix/socket.c.dbus	2007-05-21 03:55:10.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/isc/unix/socket.c	2007-06-19 11:14:48.000000000 +0200
Adam Tkac 066ea9
@@ -176,6 +176,11 @@ struct isc_socket {
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 066ea9
@@ -340,7 +345,7 @@ socket_log(isc_socket_t *sock, isc_socka
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 066ea9
@@ -1341,6 +1346,9 @@ allocate_socket(isc_socketmgr_t *manager
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 066ea9
@@ -1499,6 +1507,8 @@ isc_socket_create(isc_socketmgr_t *manag
Adam Tkac 066ea9
 	case isc_sockettype_fdwatch:
Adam Tkac 066ea9
 		INSIST(type != isc_sockettype_fdwatch);
Martin Stransky a3155a
 		break;
Martin Stransky a3155a
+	case isc_sockettype_fd:
Adam Tkac 066ea9
+		sock->fd = pf;
Martin Stransky a3155a
 	}
Adam Tkac 066ea9
 	if (sock->fd == -1 && errno == EINTR && try++ < 42)
Adam Tkac 066ea9
 		goto again;
Adam Tkac 066ea9
@@ -1507,7 +1517,7 @@ isc_socket_create(isc_socketmgr_t *manag
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) {
Adam Tkac 066ea9
+	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 066ea9
@@ -1561,7 +1571,7 @@ isc_socket_create(isc_socketmgr_t *manag
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 066ea9
@@ -1933,6 +1943,38 @@ dispatch_connect(isc_socket_t *sock) {
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 066ea9
@@ -2420,6 +2462,7 @@ process_fds(isc_socketmgr_t *manager, in
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 066ea9
@@ -2456,11 +2499,15 @@ process_fds(isc_socketmgr_t *manager, in
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 066ea9
@@ -2474,16 +2521,24 @@ process_fds(isc_socketmgr_t *manager, in
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 066ea9
@@ -2502,7 +2557,7 @@ watcher(void *uap) {
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 066ea9
@@ -4165,3 +4220,56 @@ isc_socketmgr_renderxml(isc_socketmgr_t 
Adam Tkac 066ea9
 	UNLOCK(&mgr->lock);
Martin Stransky a3155a
 }
Adam Tkac 066ea9
 #endif /* HAVE_LIBXML2 */
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
+    {
Adam Tkac 066ea9
+       sock->references=1;
Adam Tkac 066ea9
+       sock->read_ready_event = dev;
Adam Tkac 066ea9
+       select_poke(sock->manager, sock->fd, SELECT_POKE_READ);
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Adam Tkac 066ea9
+       dev = sock->read_ready_event ;
Adam Tkac 066ea9
+       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
+    {
Adam Tkac 066ea9
+       sock->references=1;
Adam Tkac 066ea9
+       sock->write_ready_event = dev;
Adam Tkac 066ea9
+       select_poke(sock->manager, sock->fd, SELECT_POKE_WRITE);    
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Adam Tkac 066ea9
+       dev = sock->write_ready_event;
Adam Tkac 066ea9
+       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
+    {
Adam Tkac 066ea9
+       sock->references=1;
Adam Tkac 066ea9
+       sock->selected_event = dev;
Martin Stransky a3155a
+    }else
Martin Stransky a3155a
+    {
Adam Tkac 066ea9
+       dev = sock->selected_event;
Adam Tkac 066ea9
+       sock->selected_event = 0L;
Adam Tkac 066ea9
+       sock->references=0;
Adam Tkac 066ea9
+       destroy(&sock);
Martin Stransky a3155a
+    }
Martin Stransky a3155a
+    return dev;
Martin Stransky a3155a
+}
Adam Tkac 066ea9
+
Adam Tkac 066ea9
--- bind-9.5.0a5/lib/dns/forward.c.dbus	2005-07-12 03:00:15.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/dns/forward.c	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -197,3 +197,89 @@ auto_detach(void *data, void *arg) {
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 066ea9
--- bind-9.5.0a5/lib/dns/rbt.c.dbus	2005-10-13 03:19:12.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/dns/rbt.c	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -2175,6 +2175,47 @@ dns_rbt_printall(dns_rbt_t *rbt) {
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 066ea9
--- bind-9.5.0a5/lib/dns/include/dns/rbt.h.dbus	2006-12-22 02:59:43.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/dns/include/dns/rbt.h	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -911,6 +911,17 @@ dns_rbtnodechain_next(dns_rbtnodechain_t
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 066ea9
--- bind-9.5.0a5/lib/dns/include/dns/forward.h.dbus	2006-12-22 02:59:43.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/lib/dns/include/dns/forward.h	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -113,6 +113,37 @@ dns_fwdtable_destroy(dns_fwdtable_t **fw
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 066ea9
--- bind-9.5.0a5/bin/named/main.c.dbus	2007-05-21 05:46:41.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/main.c	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -248,7 +248,8 @@ usage(void) {
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 066ea9
@@ -356,7 +357,7 @@ parse_command_line(int argc, char *argv[
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 066ea9
@@ -445,6 +446,9 @@ parse_command_line(int argc, char *argv[
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 066ea9
 			if (isc_commandline_option == '?')
Adam Tkac 066ea9
--- bind-9.5.0a5/bin/named/log.c.dbus	2006-12-22 02:44:59.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/log.c	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -44,6 +44,7 @@ static isc_logcategory_t categories[] = 
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 066ea9
@@ -63,6 +64,7 @@ static isc_logmodule_t modules[] = {
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 066ea9
--- bind-9.5.0a5/bin/named/include/named/server.h.dbus	2006-12-21 07:02:30.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/include/named/server.h	2007-06-19 11:16:03.000000000 +0200
Adam Tkac 066ea9
@@ -102,6 +102,8 @@ struct ns_server {
Adam Tkac 5ea70d
 
Adam Tkac 066ea9
 	isc_httpdmgr_t		*httpd;
Adam Tkac 066ea9
 	isc_sockaddr_t		httpd_sockaddr;
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 066ea9
--- bind-9.5.0a5/bin/named/include/named/types.h.dbus	2006-12-22 02:59:43.000000000 +0100
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/include/named/types.h	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -42,4 +42,6 @@ typedef struct ns_controls		ns_controls_
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 066ea9
--- bind-9.5.0a5/bin/named/include/named/globals.h.dbus	2007-06-19 11:04:16.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/include/named/globals.h	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -115,6 +115,8 @@ EXTERN const char *		ns_g_username		INIT
Adam Tkac 5ea70d
 EXTERN int			ns_g_listen		INIT(3);
Adam Tkac 066ea9
 EXTERN isc_time_t		ns_g_boottime;
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 066ea9
--- bind-9.5.0a5/bin/named/include/named/log.h.dbus	2005-04-29 02:22:30.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/include/named/log.h	2007-06-19 11:04:17.000000000 +0200
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 066ea9
--- bind-9.5.0a5/bin/named/server.c.dbus	2007-05-15 04:38:34.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/server.c	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -171,6 +171,8 @@ struct zonelistentry {
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 066ea9
@@ -2103,12 +2105,12 @@ configure_forward(const cfg_obj_t *confi
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 066ea9
@@ -3586,6 +3588,20 @@ run_server(isc_task_t *task, isc_event_t
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 066ea9
@@ -3654,6 +3670,9 @@ shutdown_server(isc_task_t *task, isc_ev
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 066ea9
--- bind-9.5.0a5/bin/named/Makefile.in.dbus	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/Makefile.in	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
@@ -43,6 +43,9 @@ CINCLUDES =	-I${srcdir}/include -I${srcd
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 066ea9
@@ -60,6 +63,7 @@ ISCCCDEPLIBS =	../../lib/isccc/libisccc.
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 066ea9
@@ -80,6 +84,7 @@ OBJS =		builtin.o client.o config.o cont
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 066ea9
@@ -94,6 +99,7 @@ SRCS =		builtin.c client.c config.c cont
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 066ea9
@@ -122,9 +128,14 @@ config.o: config.c
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 066ea9
--- bind-9.5.0a5/bin/named/named.8.dbus	2007-06-19 11:04:17.000000000 +0200
Adam Tkac 066ea9
+++ bind-9.5.0a5/bin/named/named.8	2007-06-19 11:20:15.000000000 +0200
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
Adam Tkac 066ea9
-\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\-m\ \fR\fB\fIflag\fR\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]
Adam Tkac 066ea9
+\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\-m\ \fR\fB\fIflag\fR\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 066ea9
@@ -181,6 +181,13 @@ into the cache of the default view.
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;