this patch adds the sniffed interface name to the title and page
header. useful if you have multiple darkstats running...

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/darkstat/Makefile,v
retrieving revision 1.8
diff -u -p -u -r1.8 Makefile
--- Makefile    30 Sep 2007 22:08:54 -0000      1.8
+++ Makefile    16 May 2008 20:49:41 -0000
@@ -3,6 +3,7 @@
 COMMENT=               network statistics gatherer with graphs

 DISTNAME=              darkstat-3.0.707
+PKGNAME=               ${DISTNAME}p0
 CATEGORIES=            net www

 HOMEPAGE=              http://dmr.ath.cx/net/darkstat/
Index: patches/patch-graph_db_c
===================================================================
RCS file: patches/patch-graph_db_c
diff -N patches/patch-graph_db_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-graph_db_c    16 May 2008 20:49:41 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+--- graph_db.c.orig    Fri May 16 13:23:14 2008
++++ graph_db.c Fri May 16 13:41:43 2008
+@@ -27,6 +27,8 @@
+ #define GRAPH_WIDTH "320"
+ #define GRAPH_HEIGHT "200"
+
++extern const char *interface;
++
+ struct graph {
+    uint64_t *in, *out;
+    unsigned int offset; /* i.e. seconds start at 0, days start at 1 */
+@@ -348,11 +350,12 @@ html_front_page(void)
+
+    buf = str_make();
+    str_append(buf, html_header_1);
+-   str_append(buf, "<title>" PACKAGE_STRING " : graphs</title>\n");
++   str_appendf(buf, "<title>" PACKAGE_STRING " : graphs (%s)</title>\n",
++               interface);
+    str_append(buf, "<script src=\"graph.js\" type=\"text/javascript\">"
+                    "</script>\n");
+    str_append(buf, html_header_2);
+-   str_append(buf, "<h2 class=\"pageheader\">Graphs</h2>\n");
++   str_appendf(buf, "<h2 class=\"pageheader\">Graphs (%s)</h2>\n", interface);
+
+    str_append(buf, "<p>\n");
+
Index: patches/patch-hosts_db_c
===================================================================
RCS file: patches/patch-hosts_db_c
diff -N patches/patch-hosts_db_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-hosts_db_c    16 May 2008 20:49:41 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+--- hosts_db.c.orig    Fri May 16 13:23:50 2008
++++ hosts_db.c Fri May 16 13:36:21 2008
+@@ -26,6 +26,7 @@
+ #include <unistd.h>
+
+ int show_mac_addrs = 0;
++extern const char *interface;
+
+ /* FIXME: specify somewhere more sane/tunable */
+ #define MAX_ENTRIES 30 /* in an HTML table rendered from a hashtable */
+@@ -887,9 +888,9 @@ html_hosts_main(const char *qs)
+ #define FULL "full table"
+
+    str_append(buf, html_header_1);
+-   str_append(buf, "<title>darkstat3: Hosts</title>\n");
++   str_appendf(buf, "<title>darkstat3: Hosts (%s)</title>\n", interface);
+    str_append(buf, html_header_2);
+-   str_append(buf, "<h2 class=\"pageheader\">Hosts</h2>\n");
++   str_appendf(buf, "<h2 class=\"pageheader\">Hosts (%s)</h2>\n", interface);
+    format_table(buf, hosts_db, start, sort, full);
+
+    /* <prev | full | stats | next> */

-- 
GDB has a 'break' feature; why doesn't it have 'fix' too?

Reply via email to