Your message dated Fri, 14 Nov 2008 21:17:07 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#499007: fixed in dnsmasq 2.46-1
has caused the Debian Bug report #499007,
regarding dnsmasq: please consider announcing DHCP packets on the DBUS interface
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [EMAIL PROTECTED]
immediately.)


-- 
499007: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499007
Debian Bug Tracking System
Contact [EMAIL PROTECTED] with problems
--- Begin Message ---
Package: dnsmasq
Version: 2.45-1
Severity: wishlist
Tags: patch

As dnsmasq already includes support for DBUS, it would be neat if
incoming/outgoing DHCP packets were reported via the DBUS interface. 
The application I am thinking of at the moment is a GUI which notifies
you of the progress of clients getting/releasing their leases from the
DHCP server.

Attached is a patch which tacks on to log_packet() and reports the
information over DBUS. I have updated the DBUS interface documentation
accordingly. One thing you might want to look as is whether you want
the IP to be reported as a string (attached implementation) or as a
UINT32.

Cheers and thanks again for dnsmasq!

Jeremy

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dnsmasq depends on:
ii  adduser                       3.110      add and remove users and groups
ii  dnsmasq-base                  2.45-1     A small caching DNS proxy and DHCP
ii  netbase                       4.34       Basic TCP/IP networking system

dnsmasq recommends no packages.

Versions of packages dnsmasq suggests:
pn  resolvconf                    <none>     (no description available)

-- no debconf information
diff -urN dnsmasq-2.45.orig/dbus/DBus-interface dnsmasq-2.45/dbus/DBus-interface
--- dnsmasq-2.45.orig/dbus/DBus-interface	2008-07-20 21:18:16.000000000 +0200
+++ dnsmasq-2.45/dbus/DBus-interface	2008-09-15 11:55:22.000000000 +0200
@@ -91,4 +91,18 @@
 specified by via the DBus, but it leaves any servers specified via the
 command line or /etc/dnsmasq.conf or /etc/resolv.conf alone.
 
+Available signals are:
+
+DhcpPacket
+----------
+
+This signal is emitted whenever a DHCP packet is received or sent.
+
+Example:
+
+STRING "DHCPREQUEST"
+STRING "eth0"
+STRING "192.168.1.115"
+STRING "01:23:45:67:89:ab"
+STRING "message"
 
diff -urN dnsmasq-2.45.orig/src/dbus.c dnsmasq-2.45/src/dbus.c
--- dnsmasq-2.45.orig/src/dbus.c	2008-07-20 21:18:16.000000000 +0200
+++ dnsmasq-2.45/src/dbus.c	2008-09-15 11:58:03.000000000 +0200
@@ -352,4 +352,47 @@
     }
 }
 
+void emit_dbus_dhcp_packet(char *type, void *addr, unsigned char *ext_mac, 
+			   int mac_len, char *interface, char *string)
+{
+  struct in_addr a;
+  DBusConnection *connection = (DBusConnection *)daemon->dbus;
+  DBusMessage* message;
+  DBusMessageIter args;
+  char messagetype[16];
+  const char *value;
+
+  if (!connection)
+    return;
+
+  if (!(message = dbus_message_new_signal(DNSMASQ_PATH, DNSMASQ_SERVICE, "DhcpPacket")))
+    return;
+
+  /* addr may be misaligned */
+  if (addr)
+    memcpy(&a, addr, sizeof(a));
+ 
+  dbus_message_iter_init_append(message, &args);
+
+  snprintf(messagetype, sizeof(messagetype), "%s%s",
+	   type ? "DHCP" : "BOOTP",
+	   type ? type : "");
+  value = messagetype;
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &value);
+
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &interface);
+
+  value = addr ? inet_ntoa(a) : "";
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &value);
+
+  value = print_mac(daemon->namebuff, ext_mac, mac_len);
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &value);
+
+  value = string ? string : "";
+  dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &value);
+
+  dbus_connection_send(connection, message, NULL);
+  dbus_message_unref(message);
+}
+
 #endif
diff -urN dnsmasq-2.45.orig/src/dnsmasq.h dnsmasq-2.45/src/dnsmasq.h
--- dnsmasq-2.45.orig/src/dnsmasq.h	2008-07-20 21:18:16.000000000 +0200
+++ dnsmasq-2.45/src/dnsmasq.h	2008-09-15 11:32:36.000000000 +0200
@@ -827,6 +827,8 @@
 char *dbus_init(void);
 void check_dbus_listeners(fd_set *rset, fd_set *wset, fd_set *eset);
 void set_dbus_listeners(int *maxfdp, fd_set *rset, fd_set *wset, fd_set *eset);
+void emit_dbus_dhcp_packet(char *type, void *addr, unsigned char *ext_mac, 
+			   int mac_len, char *interface, char *string);
 #endif
 
 /* helper.c */
diff -urN dnsmasq-2.45.orig/src/rfc2131.c dnsmasq-2.45/src/rfc2131.c
--- dnsmasq-2.45.orig/src/rfc2131.c	2008-07-20 21:18:16.000000000 +0200
+++ dnsmasq-2.45/src/rfc2131.c	2008-09-15 11:33:06.000000000 +0200
@@ -1172,6 +1172,10 @@
 	    addr ? " " : "",
 	    print_mac(daemon->namebuff, ext_mac, mac_len),
 	    string ? string : "");
+
+#ifdef HAVE_DBUS
+  emit_dbus_dhcp_packet(type, addr, ext_mac, mac_len, interface, string);
+#endif
 }
 
 static void log_options(unsigned char *start)

--- End Message ---
--- Begin Message ---
Source: dnsmasq
Source-Version: 2.46-1

We believe that the bug you reported is fixed in the latest version of
dnsmasq, which is due to be installed in the Debian FTP archive:

dnsmasq-base_2.46-1_i386.deb
  to pool/main/d/dnsmasq/dnsmasq-base_2.46-1_i386.deb
dnsmasq_2.46-1.diff.gz
  to pool/main/d/dnsmasq/dnsmasq_2.46-1.diff.gz
dnsmasq_2.46-1.dsc
  to pool/main/d/dnsmasq/dnsmasq_2.46-1.dsc
dnsmasq_2.46-1_all.deb
  to pool/main/d/dnsmasq/dnsmasq_2.46-1_all.deb
dnsmasq_2.46.orig.tar.gz
  to pool/main/d/dnsmasq/dnsmasq_2.46.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Simon Kelley <[EMAIL PROTECTED]> (supplier of updated dnsmasq package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Thu, 13 Nov 2008 20:15:31 +0000
Source: dnsmasq
Binary: dnsmasq dnsmasq-base
Architecture: source all i386
Version: 2.46-1
Distribution: unstable
Urgency: low
Maintainer: Simon Kelley <[EMAIL PROTECTED]>
Changed-By: Simon Kelley <[EMAIL PROTECTED]>
Description: 
 dnsmasq    - A small caching DNS proxy and DHCP/TFTP server
 dnsmasq-base - A small caching DNS proxy and DHCP/TFTP server
Closes: 499007 499162 505522 505523
Changes: 
 dnsmasq (2.46-1) unstable; urgency=low
 .
    * New upstream. (closes: #499162) (closes: #499007)
    * Remove from init script start-stop-daemon call to kill
      child processes. This is not needed since dnsmasq is
      carefully written to kill child processes, and it interacts
      badly with "private" instances of dnsmasq. (closes: #505523)
    * Provide /etc/dnsmasq.d and alter the installed /etc/default/dnsmasq
      so that /etc/dnsmasq.d is read. This provides a drop-directory where
      libvirt can add options to make the system dnsmasq automatically
      play nice with libvirt's private instances. (closes: #505522)
Files: 
 7ae9b3d5cc16f4dd3731d10e8101e241 596 net optional dnsmasq_2.46-1.dsc
 511c9e6e892de18337b2665398b9bceb 382567 net optional dnsmasq_2.46.orig.tar.gz
 097e7dc53b165eefa194d60fb26c05a7 13991 net optional dnsmasq_2.46-1.diff.gz
 9f23a41f16646f5687f981e4f6c785d0 254666 net optional 
dnsmasq-base_2.46-1_i386.deb
 30b86e953572c7394689ec00635ae174 12370 net optional dnsmasq_2.46-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFJHdmnKPyGmiibgrcRAvJqAKClFyJosk1B0l1msba+Y3N22QqZmwCaA6TS
mhnYqHqgGpx4w0TZPyGHb6o=
=PDRf
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to