Malte S. Stretz [Tue, 14 Jun 2011 09:00:43 +0000 (11:00 +0200)]
Enable link-time optimization.
Results in a 15% smaller (and probably quicker) binary.
Malte S. Stretz [Tue, 31 May 2011 23:45:26 +0000 (01:45 +0200)]
Suppress a printf warning by using the proper format.
Malte S. Stretz [Thu, 9 Jun 2011 14:42:41 +0000 (16:42 +0200)]
Mark MIN and MAX as macros as they have side effects.
Emil Mikulic [Mon, 20 Jun 2011 10:50:17 +0000 (20:50 +1000)]
s6_addr32 compatibility for OpenSolaris
Submitted by: Mats Erik Andersson
Reminded by: Bernd Schemmer
Emil Mikulic [Thu, 9 Jun 2011 12:21:10 +0000 (22:21 +1000)]
Use strtol instead of strtonum.
Emil Mikulic [Thu, 9 Jun 2011 12:10:35 +0000 (22:10 +1000)]
Explain Linux workaround for binding to all addresses.
Requested by: Malte S. Stretz
Emil Mikulic [Thu, 9 Jun 2011 11:55:22 +0000 (21:55 +1000)]
Don't use AI_ADDRCONFIG.
Malte says without this:
It fails with "Address family for hostname not supported: Device or
resource busy" if IPv6 is requested (eg. if no bind address was
specified under Linux) but no interface has IPv6 configured (::1/128
and fe80::/64 do not count).
Malte S. Stretz [Wed, 8 Jun 2011 12:33:59 +0000 (14:33 +0200)]
Add license blurb to darkproxy.php.
Feel free to do whatever you like with this trivial code.
Malte S. Stretz [Tue, 31 May 2011 10:26:05 +0000 (12:26 +0200)]
Clean up Makefile.in to simplify future patching.
* Add STATICHS macro.
* Split clean rule.
* Mark phony targets.
Malte S. Stretz [Fri, 3 Sep 2010 09:07:31 +0000 (11:07 +0200)]
Ignore release files.
Malte S. Stretz [Fri, 3 Sep 2010 09:37:31 +0000 (11:37 +0200)]
Fix file name in comment.
Emil Mikulic [Thu, 9 Jun 2011 11:34:07 +0000 (21:34 +1000)]
Max domain name length is 255, not MAXHOSTNAMELEN
This should fix a build failure on Hurd (!)
Thanks to: Rene Mayorga and the Debian project.
Emil Mikulic [Mon, 6 Jun 2011 10:47:56 +0000 (20:47 +1000)]
Whoops, I included sys/types in the wrong file.
Suggested by: Chris Kuethe
Emil Mikulic [Sat, 4 Jun 2011 14:17:52 +0000 (00:17 +1000)]
Update ChangeLog.
Emil Mikulic [Sun, 15 May 2011 12:44:44 +0000 (22:44 +1000)]
make depend
Emil Mikulic [Sat, 4 Jun 2011 13:58:37 +0000 (23:58 +1000)]
Automate release more - run test, make depend.
Also, use "tar chof" to get ustar format.
Malte S. Stretz [Wed, 1 Jun 2011 11:31:53 +0000 (13:31 +0200)]
Update date in manpage.
Emil Mikulic [Sat, 4 Jun 2011 13:29:32 +0000 (23:29 +1000)]
Bump copyright years.
Emil Mikulic [Sat, 4 Jun 2011 13:18:05 +0000 (23:18 +1000)]
Homepage is moving to a sillier domain.
Emil Mikulic [Sat, 4 Jun 2011 12:58:23 +0000 (22:58 +1000)]
Factor and add checks for cdefs.h
Emil Mikulic [Sat, 4 Jun 2011 12:58:29 +0000 (22:58 +1000)]
Remove includes of darkstat.h, add cdefs.h where needed.
Emil Mikulic [Sat, 4 Jun 2011 13:00:37 +0000 (23:00 +1000)]
cp darkstat.h cdefs.h
Emil Mikulic [Sat, 4 Jun 2011 12:40:35 +0000 (22:40 +1000)]
Fix warnings.
Emil Mikulic [Sat, 4 Jun 2011 10:21:56 +0000 (20:21 +1000)]
Use multiple listening sockets, allow multiple bindaddrs.
Emil Mikulic [Sat, 4 Jun 2011 11:31:40 +0000 (21:31 +1000)]
Be explicit that per-host pages are directories.
Browsers get confused by double colons in v6 addresses.
Malte S. Stretz [Wed, 1 Jun 2011 15:44:57 +0000 (17:44 +0200)]
Add missing opt.h to release script.
Emil Mikulic [Sat, 4 Jun 2011 08:21:43 +0000 (18:21 +1000)]
Remove unnecessary header sentinel.
Malte S. Stretz [Wed, 1 Jun 2011 11:30:13 +0000 (13:30 +0200)]
Replace the --base code with relative paths.
Most of the functionality turned out to be overkill since
relative paths work fine, too. The only broken thing is
lighttpd 1.4 which doesn't support proxying of stuff like
/darkstat/ -> http://localhost:667/
But this will be fixed properly in mod_proxy_core in 1.5
once (if ever) it is released.
Malte S. Stretz [Tue, 31 May 2011 23:01:10 +0000 (01:01 +0200)]
Avoid linking against nsl and resolv unless required.
Malte S. Stretz [Tue, 31 May 2011 22:08:40 +0000 (00:08 +0200)]
libbsd provides (a stub for) setproctitle, too.
Emil Mikulic [Sat, 4 Jun 2011 07:59:33 +0000 (17:59 +1000)]
Check for missing and extraneous config.h includes.
Emil Mikulic [Sat, 4 Jun 2011 07:52:59 +0000 (17:52 +1000)]
Make test_headers more automatic.
Also make the output prettier.
Emil Mikulic [Sat, 4 Jun 2011 06:21:47 +0000 (16:21 +1000)]
Include config.h explicitly.
Emil Mikulic [Sat, 4 Jun 2011 06:06:20 +0000 (16:06 +1000)]
Include opt.h explicitly.
Malte S. Stretz [Tue, 31 May 2011 13:27:18 +0000 (15:27 +0200)]
Drop interface from html_open, use global opt_interface.
Malte S. Stretz [Tue, 31 May 2011 13:22:49 +0000 (15:22 +0200)]
Prefix all global variables to aid debugging.
* Also move all options which are set in darkstat.c to a new
header opt.h and prefix options with opt_.
* Declare all opt_* stuff in darkstat.c.
* Prefix globals from acct.c with acct_.
* Prefix globals from cap.c with cap_.
* Prefix globals from hosts_db.c with hosts_db_.
* Prefix globals from http.c with http_.
Malte S. Stretz [Thu, 2 Sep 2010 21:52:58 +0000 (23:52 +0200)]
Rename str_append2() to str_appendn().
Clearifies the difference to str_append (ie. append n bytes), mnemonic:
str_appendn is to str_append what strncat is to strcat.
Emil Mikulic [Mon, 30 May 2011 11:44:32 +0000 (21:44 +1000)]
Change example to discourage use of hyphen (-rc1)
Ports doesn't like hyphens there.
Emil Mikulic [Mon, 30 May 2011 11:38:10 +0000 (21:38 +1000)]
Use PACKAGE_URL.
- Use PACKAGE_strings directly instead of through %s indirection.
- Reduce duplication by removing URL from AUTHORS and README.
Malte S. Stretz [Fri, 3 Sep 2010 09:06:23 +0000 (11:06 +0200)]
Add homepage URL to AC_INIT.
This sets PACKAGE_URL in config.h.
Malte S. Stretz [Fri, 3 Sep 2010 09:05:25 +0000 (11:05 +0200)]
Use sed to set the version number.
Malte S. Stretz [Fri, 3 Sep 2010 09:04:31 +0000 (11:04 +0200)]
Use separate output function, fix eval.
Emil Mikulic [Mon, 30 May 2011 11:29:22 +0000 (21:29 +1000)]
Add sys/types.h includes for OpenBSD.
Suggested by: Chris Kuethe
Emil Mikulic [Sun, 29 May 2011 05:15:59 +0000 (15:15 +1000)]
Simplify how the http socket is bound.
- Use dual-stack socket for wildcard.
- Sadly, AI_V4MAPPED doesn't work on FreeBSD 8.2
Emil Mikulic [Tue, 24 May 2011 12:29:38 +0000 (22:29 +1000)]
Retire DARKSTAT_USES_HOSTENT conditional code.
Emil Mikulic [Mon, 23 May 2011 13:50:07 +0000 (23:50 +1000)]
Show base_url in "listening on" output.
Emil Mikulic [Mon, 23 May 2011 13:44:52 +0000 (23:44 +1000)]
Put fewer slashes into the slashed_url.
Emil Mikulic [Sun, 15 May 2011 14:16:28 +0000 (00:16 +1000)]
Add addr module and autogenerated files to release tarball.
Emil Mikulic [Sun, 15 May 2011 14:00:59 +0000 (00:00 +1000)]
reply_sent is zero in poll_send_header_and_reply
Found by: Clang Static Analyzer
Emil Mikulic [Sun, 15 May 2011 13:38:34 +0000 (23:38 +1000)]
Format string fixes, problem caught by _printflike_
Emil Mikulic [Sun, 15 May 2011 13:04:39 +0000 (23:04 +1000)]
Fix warnings, bring in restrict keyword, modernize strl{cpy,cat}
Emil Mikulic [Sun, 15 May 2011 12:32:10 +0000 (22:32 +1000)]
Handle getnameinfo() failing in timeout code.
Emil Mikulic [Sun, 15 May 2011 12:12:08 +0000 (22:12 +1000)]
Portability fixes for FreeBSD - include the right headers.
Emil Mikulic [Sun, 15 May 2011 12:40:01 +0000 (22:40 +1000)]
Clean up un-needed date variables, include str.
Emil Mikulic [Sun, 15 May 2011 10:25:55 +0000 (20:25 +1000)]
Don't leak base_url memory.
Emil Mikulic [Sun, 15 May 2011 10:15:36 +0000 (20:15 +1000)]
Fixes for non-default base_url.
* use relative path to graphs.xml
* use correct absolute path for hosts
(relative paths are confused by colons in IPv6 addresses)
Emil Mikulic [Sun, 15 May 2011 10:01:38 +0000 (20:01 +1000)]
Remove headers callback and tidy up html module a bit.
Emil Mikulic [Sun, 15 May 2011 09:47:18 +0000 (19:47 +1000)]
Add Dirk and Mats to AUTHORS.
Emil Mikulic [Sun, 15 May 2011 09:43:35 +0000 (19:43 +1000)]
Drop XHTML.
We never served it with the right content-type anyway.
Emil Mikulic [Sun, 15 May 2011 09:34:28 +0000 (19:34 +1000)]
Fix up includes in html.c
Malte S. Stretz [Wed, 1 Sep 2010 11:48:28 +0000 (13:48 +0200)]
Avoid indexing of darkstat pages.
The data displayed by darkstat is probably not something which you want
to appear on Google and friends. Just have a try:
http://www.google.com/search?q=intitle:darkstat+inurl:666
http://www.google.com/search?q=intitle:darkstat+inurl:667
Malte S. Stretz [Wed, 1 Sep 2010 11:43:05 +0000 (13:43 +0200)]
Fix a memory leak triggered by 404s.
Malte S. Stretz [Wed, 1 Sep 2010 11:40:15 +0000 (13:40 +0200)]
Consolidate HTTP header generation.
Always sending a Content-Encoding (with the value "identity" if
uncompressed) and a Vary doesn't really hurt but allows for cleaner
header generation code (and less duplication).
All we lose is the date on the error messages since I wanted to avoid to
format the date twice.
Malte S. Stretz [Wed, 1 Sep 2010 11:31:06 +0000 (13:31 +0200)]
Introducing the --base switch to modify the base URL.
The --base option (defaulting to "/") essentially configures the
base_url in http.c which was introduced previously. Now darkstat works
without too much magic behind a reverse proxy.
My mod_proxy config changed from
ProxyPass /darkstat http://localhost:666
<Location /darkstat/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /darkstat/
RequestHeader unset Accept-Encoding
</Location>
Redirect permanent /graphs.xml /darkstat/graphs.xml
to the simpler
ProxyPass /darkstat/ http://localhost:666/darkstat/
ProxyPassReverse /darkstat/ http://localhost:666/darkstat/
(the ProxyPassReverse isn't even needed since darkstat doesn't generate
any Location headers).
Malte S. Stretz [Wed, 1 Sep 2010 11:19:05 +0000 (13:19 +0200)]
Make HTML template more flexible.
Preparation for URI base feature. It is a little bit more overhead than
just appending constant strings, but I doubt it is measurable. Also, it
unifies the appearance a bit more since the <title> etc. is now also
generated by html_open() instead differently in each page generator.
Emil Mikulic [Sun, 15 May 2011 09:09:47 +0000 (19:09 +1000)]
Implement export/import of struct addr.
Emil Mikulic [Sun, 15 May 2011 08:39:37 +0000 (18:39 +1000)]
Check libbsd for strtonum.
Emil Mikulic [Sun, 15 May 2011 08:25:04 +0000 (18:25 +1000)]
Remove verbose output I'm comfortable removing.
Emil Mikulic [Sun, 15 May 2011 07:54:11 +0000 (17:54 +1000)]
Make host_get() not invalidate old records.
Emil Mikulic [Sun, 15 May 2011 07:50:54 +0000 (17:50 +1000)]
Factor out decode_ip_payload()
This code was duplicated for v4 and v6. Additionally, don't do
accounting if we couldn't decode the TCP/UDP header.
Emil Mikulic [Sun, 15 May 2011 07:42:16 +0000 (17:42 +1000)]
Implement SIGUSR2 to save the DB without resetting it.
This has been requested a few times.
Emil Mikulic [Tue, 10 May 2011 14:43:52 +0000 (00:43 +1000)]
Be less noisy when building.
Emil Mikulic [Tue, 10 May 2011 12:01:25 +0000 (22:01 +1000)]
Use struct addr - big cleanup.
Emil Mikulic [Tue, 10 May 2011 13:28:21 +0000 (23:28 +1000)]
Implement addr_mask and addr_inside and tests.
Emil Mikulic [Tue, 10 May 2011 12:51:49 +0000 (22:51 +1000)]
Implement str_to_addr() and unit test.
Emil Mikulic [Tue, 10 May 2011 11:53:25 +0000 (21:53 +1000)]
Create addr module.
Emil Mikulic [Wed, 12 Aug 2009 12:45:34 +0000 (22:45 +1000)]
Warn if pcap_dispatch looks like it's blocking.
Malte S. Stretz [Fri, 3 Sep 2010 14:15:59 +0000 (16:15 +0200)]
Add --disable-debug to switch on NDEBUG and -g0.
Malte S. Stretz [Fri, 3 Sep 2010 13:57:02 +0000 (15:57 +0200)]
Replace --with-mad-warnings with --enable-mad-warnings.
Emil Mikulic [Mon, 9 May 2011 13:42:44 +0000 (23:42 +1000)]
Make headers self-sufficient.
Emil Mikulic [Wed, 4 May 2011 15:00:43 +0000 (01:00 +1000)]
Script to test if headers are self-sufficient.
Emil Mikulic [Mon, 9 May 2011 13:25:12 +0000 (23:25 +1000)]
Don't hide that linkhdr_t is a struct.
Emil Mikulic [Wed, 4 May 2011 12:54:38 +0000 (22:54 +1000)]
Be explicit about missing case.
Emil Mikulic [Mon, 9 May 2011 13:13:39 +0000 (23:13 +1000)]
Enable more GCC warnings.
Malte S. Stretz [Fri, 3 Sep 2010 15:01:40 +0000 (17:01 +0200)]
Load strl* from libbsd if available.
Malte S. Stretz [Thu, 2 Sep 2010 21:52:33 +0000 (23:52 +0200)]
Ignore vim swap files.
Malte S. Stretz [Wed, 1 Sep 2010 12:59:52 +0000 (14:59 +0200)]
Add myself to AUTHORS.
Emil Mikulic [Mon, 9 May 2011 13:01:12 +0000 (23:01 +1000)]
Don't duplicate bindaddr.
Malte S. Stretz [Tue, 31 Aug 2010 18:46:15 +0000 (20:46 +0200)]
Ignore generated man page.
Emil Mikulic [Sat, 9 Apr 2011 13:03:09 +0000 (23:03 +1000)]
Pick nits.
Emil Mikulic [Sat, 9 Apr 2011 12:47:58 +0000 (22:47 +1000)]
CSS tweaks.
Add text-shadow to menu bar, don't wrap rates.
Emil Mikulic [Sat, 9 Apr 2011 12:36:41 +0000 (22:36 +1000)]
These days, tcpdump snaplen default is 96 bytes.
Emil Mikulic [Thu, 7 Apr 2011 11:52:30 +0000 (21:52 +1000)]
build-essential is not plural.
Dirk Koopman [Tue, 21 Sep 2010 11:27:47 +0000 (12:27 +0100)]
allow sort on "last seen"
This is very useful for those "who was doing that just now" moments
Mats Erik Andersson [Thu, 14 Oct 2010 13:11:59 +0000 (15:11 +0200)]
Activate accounting for IPv6 hosts.
The already implemented host table functions are put
to work also for IPv6 hosts. In addition, IPPROTO_AH,
IPPROTO_ESP, and IPPROTO_OSPF now prevent complaints
about these protocols being unknown.
A complete URI is augmented for hostreporting, since
the dubble colon can be confused for a protocol switch.
Mats Erik Andersson [Thu, 14 Oct 2010 10:49:54 +0000 (12:49 +0200)]
Implement full netmasking for IPv4 and IPv6.
A helper function "strtonum()" is implemented for platforms
where it is missing. This is detected in "configure.ac".
Netmasks with prefix length is implemented for IPv4, whereas
netmasks with explicit masks or with prefixes as built for IPv6.
Mats Erik Andersson [Wed, 13 Oct 2010 19:28:45 +0000 (21:28 +0200)]
Migration from 'in_addr_t' to 'struct addr46'.
In order to achieve a uniform handling of IPv4
and IPv6, a new structure 'struct addr46' encloses
both address families in a space efficient manner.
This commit completes the migration, and achieves
functionality for IPv4 accounting and IPv4 DNS lookup.
Mats Erik Andersson [Wed, 29 Sep 2010 21:46:11 +0000 (23:46 +0200)]
Small IPv6 corrections and an IPv6 hash function.
Mats Erik Andersson [Wed, 29 Sep 2010 20:46:20 +0000 (22:46 +0200)]
Conditional replacement of ETHERTYPE_IPV6.
Autoconf test for <net/if_ether.h> needed for GNU/kfreebsd.
If possible, define ETHERTYPE_IPV6 as ETH_P_IPV6.
Mats Erik Andersson [Wed, 29 Sep 2010 14:36:54 +0000 (16:36 +0200)]
Fine tuning for OpenBSD and GNU/kfreebsd.
GNU/Linux and FreeBSD are also fine with these.