darkstat.git
8 years agoRemove unnecessary header sentinel.
Emil Mikulic [Sat, 4 Jun 2011 08:21:43 +0000]
Remove unnecessary header sentinel.

8 years agoReplace the --base code with relative paths.
Malte S. Stretz [Wed, 1 Jun 2011 11:30:13 +0000]
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.

8 years agoAvoid linking against nsl and resolv unless required.
Malte S. Stretz [Tue, 31 May 2011 23:01:10 +0000]
Avoid linking against nsl and resolv unless required.

8 years agolibbsd provides (a stub for) setproctitle, too.
Malte S. Stretz [Tue, 31 May 2011 22:08:40 +0000]
libbsd provides (a stub for) setproctitle, too.

8 years agoCheck for missing and extraneous config.h includes.
Emil Mikulic [Sat, 4 Jun 2011 07:59:33 +0000]
Check for missing and extraneous config.h includes.

8 years agoMake test_headers more automatic.
Emil Mikulic [Sat, 4 Jun 2011 07:52:59 +0000]
Make test_headers more automatic.

Also make the output prettier.

8 years agoInclude config.h explicitly.
Emil Mikulic [Sat, 4 Jun 2011 06:21:47 +0000]
Include config.h explicitly.

8 years agoInclude opt.h explicitly.
Emil Mikulic [Sat, 4 Jun 2011 06:06:20 +0000]
Include opt.h explicitly.

8 years agoDrop interface from html_open, use global opt_interface.
Malte S. Stretz [Tue, 31 May 2011 13:27:18 +0000]
Drop interface from html_open, use global opt_interface.

8 years agoPrefix all global variables to aid debugging.
Malte S. Stretz [Tue, 31 May 2011 13:22:49 +0000]
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_.

8 years agoRename str_append2() to str_appendn().
Malte S. Stretz [Thu, 2 Sep 2010 21:52:58 +0000]
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.

8 years agoChange example to discourage use of hyphen (-rc1)
Emil Mikulic [Mon, 30 May 2011 11:44:32 +0000]
Change example to discourage use of hyphen (-rc1)

Ports doesn't like hyphens there.

8 years agoUse PACKAGE_URL.
Emil Mikulic [Mon, 30 May 2011 11:38:10 +0000]
Use PACKAGE_URL.

- Use PACKAGE_strings directly instead of through %s indirection.
- Reduce duplication by removing URL from AUTHORS and README.

8 years agoAdd homepage URL to AC_INIT.
Malte S. Stretz [Fri, 3 Sep 2010 09:06:23 +0000]
Add homepage URL to AC_INIT.

This sets PACKAGE_URL in config.h.

8 years agoUse sed to set the version number.
Malte S. Stretz [Fri, 3 Sep 2010 09:05:25 +0000]
Use sed to set the version number.

8 years agoUse separate output function, fix eval.
Malte S. Stretz [Fri, 3 Sep 2010 09:04:31 +0000]
Use separate output function, fix eval.

8 years agoAdd sys/types.h includes for OpenBSD.
Emil Mikulic [Mon, 30 May 2011 11:29:22 +0000]
Add sys/types.h includes for OpenBSD.

Suggested by: Chris Kuethe

8 years agoSimplify how the http socket is bound.
Emil Mikulic [Sun, 29 May 2011 05:15:59 +0000]
Simplify how the http socket is bound.

- Use dual-stack socket for wildcard.
- Sadly, AI_V4MAPPED doesn't work on FreeBSD 8.2

8 years agoRetire DARKSTAT_USES_HOSTENT conditional code.
Emil Mikulic [Tue, 24 May 2011 12:29:38 +0000]
Retire DARKSTAT_USES_HOSTENT conditional code.

8 years agoShow base_url in "listening on" output.
Emil Mikulic [Mon, 23 May 2011 13:50:07 +0000]
Show base_url in "listening on" output.

8 years agoPut fewer slashes into the slashed_url.
Emil Mikulic [Mon, 23 May 2011 13:44:52 +0000]
Put fewer slashes into the slashed_url.

8 years agoAdd addr module and autogenerated files to release tarball.
Emil Mikulic [Sun, 15 May 2011 14:16:28 +0000]
Add addr module and autogenerated files to release tarball.

8 years agoreply_sent is zero in poll_send_header_and_reply
Emil Mikulic [Sun, 15 May 2011 14:00:59 +0000]
reply_sent is zero in poll_send_header_and_reply

Found by: Clang Static Analyzer

8 years agoFormat string fixes, problem caught by _printflike_
Emil Mikulic [Sun, 15 May 2011 13:38:34 +0000]
Format string fixes, problem caught by _printflike_

8 years agoFix warnings, bring in restrict keyword, modernize strl{cpy,cat}
Emil Mikulic [Sun, 15 May 2011 13:04:39 +0000]
Fix warnings, bring in restrict keyword, modernize strl{cpy,cat}

8 years agoHandle getnameinfo() failing in timeout code.
Emil Mikulic [Sun, 15 May 2011 12:32:10 +0000]
Handle getnameinfo() failing in timeout code.

8 years agoPortability fixes for FreeBSD - include the right headers.
Emil Mikulic [Sun, 15 May 2011 12:12:08 +0000]
Portability fixes for FreeBSD - include the right headers.

8 years agoClean up un-needed date variables, include str.
Emil Mikulic [Sun, 15 May 2011 12:40:01 +0000]
Clean up un-needed date variables, include str.

8 years agoDon't leak base_url memory.
Emil Mikulic [Sun, 15 May 2011 10:25:55 +0000]
Don't leak base_url memory.

8 years agoFixes for non-default base_url.
Emil Mikulic [Sun, 15 May 2011 10:15:36 +0000]
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)

8 years agoRemove headers callback and tidy up html module a bit.
Emil Mikulic [Sun, 15 May 2011 10:01:38 +0000]
Remove headers callback and tidy up html module a bit.

8 years agoAdd Dirk and Mats to AUTHORS.
Emil Mikulic [Sun, 15 May 2011 09:47:18 +0000]
Add Dirk and Mats to AUTHORS.

8 years agoDrop XHTML.
Emil Mikulic [Sun, 15 May 2011 09:43:35 +0000]
Drop XHTML.

We never served it with the right content-type anyway.

8 years agoFix up includes in html.c
Emil Mikulic [Sun, 15 May 2011 09:34:28 +0000]
Fix up includes in html.c

8 years agoAvoid indexing of darkstat pages.
Malte S. Stretz [Wed, 1 Sep 2010 11:48:28 +0000]
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

8 years agoFix a memory leak triggered by 404s.
Malte S. Stretz [Wed, 1 Sep 2010 11:43:05 +0000]
Fix a memory leak triggered by 404s.

8 years agoConsolidate HTTP header generation.
Malte S. Stretz [Wed, 1 Sep 2010 11:40:15 +0000]
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.

8 years agoIntroducing the --base switch to modify the base URL.
Malte S. Stretz [Wed, 1 Sep 2010 11:31:06 +0000]
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).

8 years agoMake HTML template more flexible.
Malte S. Stretz [Wed, 1 Sep 2010 11:19:05 +0000]
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.

8 years agoImplement export/import of struct addr.
Emil Mikulic [Sun, 15 May 2011 09:09:47 +0000]
Implement export/import of struct addr.

8 years agoCheck libbsd for strtonum.
Emil Mikulic [Sun, 15 May 2011 08:39:37 +0000]
Check libbsd for strtonum.

8 years agoRemove verbose output I'm comfortable removing.
Emil Mikulic [Sun, 15 May 2011 08:25:04 +0000]
Remove verbose output I'm comfortable removing.

8 years agoMake host_get() not invalidate old records.
Emil Mikulic [Sun, 15 May 2011 07:54:11 +0000]
Make host_get() not invalidate old records.

8 years agoFactor out decode_ip_payload()
Emil Mikulic [Sun, 15 May 2011 07:50:54 +0000]
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.

8 years agoImplement SIGUSR2 to save the DB without resetting it.
Emil Mikulic [Sun, 15 May 2011 07:42:16 +0000]
Implement SIGUSR2 to save the DB without resetting it.

This has been requested a few times.

8 years agoBe less noisy when building.
Emil Mikulic [Tue, 10 May 2011 14:43:52 +0000]
Be less noisy when building.

8 years agoUse struct addr - big cleanup.
Emil Mikulic [Tue, 10 May 2011 12:01:25 +0000]
Use struct addr - big cleanup.

8 years agoImplement addr_mask and addr_inside and tests.
Emil Mikulic [Tue, 10 May 2011 13:28:21 +0000]
Implement addr_mask and addr_inside and tests.

8 years agoImplement str_to_addr() and unit test.
Emil Mikulic [Tue, 10 May 2011 12:51:49 +0000]
Implement str_to_addr() and unit test.

8 years agoCreate addr module.
Emil Mikulic [Tue, 10 May 2011 11:53:25 +0000]
Create addr module.

8 years agoWarn if pcap_dispatch looks like it's blocking.
Emil Mikulic [Wed, 12 Aug 2009 12:45:34 +0000]
Warn if pcap_dispatch looks like it's blocking.

8 years agoAdd --disable-debug to switch on NDEBUG and -g0.
Malte S. Stretz [Fri, 3 Sep 2010 14:15:59 +0000]
Add --disable-debug to switch on NDEBUG and -g0.

8 years agoReplace --with-mad-warnings with --enable-mad-warnings.
Malte S. Stretz [Fri, 3 Sep 2010 13:57:02 +0000]
Replace --with-mad-warnings with --enable-mad-warnings.

8 years agoMake headers self-sufficient.
Emil Mikulic [Mon, 9 May 2011 13:42:44 +0000]
Make headers self-sufficient.

8 years agoScript to test if headers are self-sufficient.
Emil Mikulic [Wed, 4 May 2011 15:00:43 +0000]
Script to test if headers are self-sufficient.

8 years agoDon't hide that linkhdr_t is a struct.
Emil Mikulic [Mon, 9 May 2011 13:25:12 +0000]
Don't hide that linkhdr_t is a struct.

8 years agoBe explicit about missing case.
Emil Mikulic [Wed, 4 May 2011 12:54:38 +0000]
Be explicit about missing case.

8 years agoEnable more GCC warnings.
Emil Mikulic [Mon, 9 May 2011 13:13:39 +0000]
Enable more GCC warnings.

8 years agoLoad strl* from libbsd if available.
Malte S. Stretz [Fri, 3 Sep 2010 15:01:40 +0000]
Load strl* from libbsd if available.

8 years agoIgnore vim swap files.
Malte S. Stretz [Thu, 2 Sep 2010 21:52:33 +0000]
Ignore vim swap files.

8 years agoAdd myself to AUTHORS.
Malte S. Stretz [Wed, 1 Sep 2010 12:59:52 +0000]
Add myself to AUTHORS.

8 years agoDon't duplicate bindaddr.
Emil Mikulic [Mon, 9 May 2011 13:01:12 +0000]
Don't duplicate bindaddr.

8 years agoIgnore generated man page.
Malte S. Stretz [Tue, 31 Aug 2010 18:46:15 +0000]
Ignore generated man page.

8 years agoPick nits.
Emil Mikulic [Sat, 9 Apr 2011 13:03:09 +0000]
Pick nits.

8 years agoCSS tweaks.
Emil Mikulic [Sat, 9 Apr 2011 12:47:58 +0000]
CSS tweaks.

Add text-shadow to menu bar, don't wrap rates.

8 years agoThese days, tcpdump snaplen default is 96 bytes.
Emil Mikulic [Sat, 9 Apr 2011 12:36:41 +0000]
These days, tcpdump snaplen default is 96 bytes.

8 years agobuild-essential is not plural.
Emil Mikulic [Thu, 7 Apr 2011 11:52:30 +0000]
build-essential is not plural.

8 years agoallow sort on "last seen"
Dirk Koopman [Tue, 21 Sep 2010 11:27:47 +0000]
allow sort on "last seen"

This is very useful for those "who was doing that just now" moments

8 years agoActivate accounting for IPv6 hosts.
Mats Erik Andersson [Thu, 14 Oct 2010 13:11:59 +0000]
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.

8 years agoImplement full netmasking for IPv4 and IPv6.
Mats Erik Andersson [Thu, 14 Oct 2010 10:49:54 +0000]
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.

8 years agoMigration from 'in_addr_t' to 'struct addr46'.
Mats Erik Andersson [Wed, 13 Oct 2010 19:28:45 +0000]
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.

8 years agoSmall IPv6 corrections and an IPv6 hash function.
Mats Erik Andersson [Wed, 29 Sep 2010 21:46:11 +0000]
Small IPv6 corrections and an IPv6 hash function.

8 years agoConditional replacement of ETHERTYPE_IPV6.
Mats Erik Andersson [Wed, 29 Sep 2010 20:46:20 +0000]
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.

8 years agoFine tuning for OpenBSD and GNU/kfreebsd.
Mats Erik Andersson [Wed, 29 Sep 2010 14:36:54 +0000]
Fine tuning for OpenBSD and GNU/kfreebsd.

GNU/Linux and FreeBSD are also fine with these.

8 years agoGet this compiling again on FreeBSD
Emil Mikulic [Tue, 1 Jun 2010 10:48:44 +0000]
Get this compiling again on FreeBSD

8 years agoFirst graphical accounting of IPv6.
Mats Erik Andersson [Sat, 29 May 2010 10:06:52 +0000]
First graphical accounting of IPv6.

There are two small changes to "http.c" that corrects
the format string and that reuses the exact length of
the structure in use.

The main changes, however, deal with detection, reporting,
and accounting of IPv6 traffic over the chosen interface.

The present code is only able to match the exact
IPv6 address of the interface to the packet, be it
inbound or outbound. No possibility to set the
netmask length.

The accounting only adds sizes of the packets,
it never goes on to deal with fine grained information.
You will see a conditional in 'acct.c' with a comment
stating that IPv6 proceeds no further.

8 years agoInclude sys/socket.h for AF_UNSPEC on FreeBSD
Emil Mikulic [Thu, 27 May 2010 14:02:49 +0000]
Include sys/socket.h for AF_UNSPEC on FreeBSD

Suggested by: Mats

8 years agoMaking the webserver IPv6 capable.
Mats Erik Andersson [Wed, 26 May 2010 17:31:34 +0000]
Making the webserver IPv6 capable.

Options like

   -b 0.0.0.0   -b 127.0.0.1
   -b ::        -b ::1
   -b bug.me.local

are now usable.

9 years agomanpage: display the actual package version 3.0.713
Emil Mikulic [Fri, 5 Mar 2010 06:06:12 +0000]
manpage: display the actual package version

9 years agoUpdate ChangeLog in preparation for darkstat 3.0.713
Emil Mikulic [Mon, 18 Jan 2010 06:40:04 +0000]
Update ChangeLog in preparation for darkstat 3.0.713

9 years agoconfigure: give better --with-chroot-dir example
Emil Mikulic [Fri, 5 Mar 2010 05:09:13 +0000]
configure: give better --with-chroot-dir example

Don't allow "yes" as a chroot directory.

Also, as much as this pains me, be less jerky.
It turns out that not every Unix is as awesome as OpenBSD.

9 years agoImplement --wait
Emil Mikulic [Sun, 17 Jan 2010 14:17:11 +0000]
Implement --wait

9 years agoRemove dead stores.
Emil Mikulic [Sun, 17 Jan 2010 14:41:52 +0000]
Remove dead stores.

Found by: Clang Static Analyzer

9 years agoTweak manpage wording and formatting.
Emil Mikulic [Sun, 17 Jan 2010 14:17:51 +0000]
Tweak manpage wording and formatting.

9 years agoMerge THANKS into AUTHORS.
Emil Mikulic [Sun, 17 Jan 2010 13:52:30 +0000]
Merge THANKS into AUTHORS.

9 years agoShip the ChangeLog when rolling a release.
Emil Mikulic [Wed, 18 Nov 2009 11:59:01 +0000]
Ship the ChangeLog when rolling a release.

9 years agoAdd ChangeLog from darkstat website.
Emil Mikulic [Wed, 18 Nov 2009 11:58:10 +0000]
Add ChangeLog from darkstat website.

10 years agoImprove wording of "network internal"
Emil Mikulic [Wed, 16 Sep 2009 13:15:36 +0000]
Improve wording of "network internal"

10 years agoImprove --pppoe example and mention nas0 interface.
Emil Mikulic [Wed, 16 Sep 2009 13:11:28 +0000]
Improve --pppoe example and mention nas0 interface.

Requested by: Prof A Olowofoyeku / routertech.org

10 years agoImplement and document --syslog
Emil Mikulic [Wed, 16 Sep 2009 13:01:52 +0000]
Implement and document --syslog

10 years agoImprove the "timeout on" diagnostic message.
Emil Mikulic [Wed, 26 Aug 2009 11:59:09 +0000]
Improve the "timeout on" diagnostic message.

10 years agoHack around snaplen problem in recent Ubuntu.
Emil Mikulic [Mon, 17 Aug 2009 09:09:04 +0000]
Hack around snaplen problem in recent Ubuntu.

10 years agoImplement --snaplen
Emil Mikulic [Wed, 12 Aug 2009 12:24:29 +0000]
Implement --snaplen

10 years agoUse pcap_setnonblock() on Linux.
Emil Mikulic [Wed, 12 Aug 2009 12:48:24 +0000]
Use pcap_setnonblock() on Linux.

10 years agoImplement --no-lastseen
Emil Mikulic [Sat, 25 Apr 2009 13:57:23 +0000]
Implement --no-lastseen

10 years agoImplement --hexdump
Emil Mikulic [Sat, 25 Apr 2009 11:20:55 +0000]
Implement --hexdump

10 years agoManpage moved to section 8, adjust usage notice.
Emil Mikulic [Fri, 24 Apr 2009 11:43:44 +0000]
Manpage moved to section 8, adjust usage notice.

10 years agoAdjust {hosts,ports}-keep when they're not kept under max.
Emil Mikulic [Thu, 1 Jan 2009 12:27:48 +0000]
Adjust {hosts,ports}-keep when they're not kept under max.

Requested by: The Chief

10 years agoDon't apply ports-{max,keep} to protocols.
Emil Mikulic [Thu, 1 Jan 2009 12:27:11 +0000]
Don't apply ports-{max,keep} to protocols.

This helps us survive proto accounting when --ports-max is zero.

10 years agoSkip port accounting when --ports-max is zero.
Emil Mikulic [Thu, 1 Jan 2009 12:26:41 +0000]
Skip port accounting when --ports-max is zero.