darkstat
5 years agoUpdate portability notes.
Emil Mikulic [Sat, 27 Dec 2014 15:35:17 +0000 (02:35 +1100)]
Update portability notes.

5 years agoFix the build on Debian GNU/Hurd.
Emil Mikulic [Sat, 27 Dec 2014 15:27:13 +0000 (02:27 +1100)]
Fix the build on Debian GNU/Hurd.

5 years agoconfigure: give better zlib advice for Debian.
Emil Mikulic [Sat, 27 Dec 2014 15:20:03 +0000 (02:20 +1100)]
configure: give better zlib advice for Debian.

5 years agoCall setgroups() before setgid() to drop supplementary groups.
Emil Mikulic [Sat, 27 Dec 2014 13:58:00 +0000 (00:58 +1100)]
Call setgroups() before setgid() to drop supplementary groups.

Pointed out to me by: Pavel Alexeev
Caught by rpmlint

See also: https://www.securecoding.cert.org/confluence/display/seccode/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges

5 years agoRebuild deps.
Emil Mikulic [Sat, 27 Dec 2014 13:20:40 +0000 (00:20 +1100)]
Rebuild deps.

5 years agoUpdate ChangeLog for 3.0.719.
Emil Mikulic [Sat, 27 Dec 2014 13:18:43 +0000 (00:18 +1100)]
Update ChangeLog for 3.0.719.

5 years agoOCD: add space to bottom of host detail page.
Emil Mikulic [Sat, 27 Dec 2014 13:06:15 +0000 (00:06 +1100)]
OCD: add space to bottom of host detail page.

5 years agoImplement tracking of remote ports.
Emil Mikulic [Sat, 27 Dec 2014 13:04:52 +0000 (00:04 +1100)]
Implement tracking of remote ports.

5 years agoPretty sure show-dep isn't needed, also add vim modeline.
Emil Mikulic [Sat, 27 Dec 2014 11:53:07 +0000 (22:53 +1100)]
Pretty sure show-dep isn't needed, also add vim modeline.

5 years ago-D__OPTIMIZE__ comes from -O anyway.
Emil Mikulic [Sat, 27 Dec 2014 11:50:02 +0000 (22:50 +1100)]
-D__OPTIMIZE__ comes from -O anyway.

5 years agotest_headers.sh: handle the "#define restrict" bit in config.h
Emil Mikulic [Sat, 27 Dec 2014 11:48:06 +0000 (22:48 +1100)]
test_headers.sh: handle the "#define restrict" bit in config.h

5 years agoChange the default ports_max to twice ports_keep.
Emil Mikulic [Sat, 27 Dec 2014 09:44:40 +0000 (20:44 +1100)]
Change the default ports_max to twice ports_keep.

5 years agoStop using inline, get restrict from autoconf.
Emil Mikulic [Sat, 27 Dec 2014 09:38:59 +0000 (20:38 +1100)]
Stop using inline, get restrict from autoconf.

5 years agoFree lists of cmdline args in the DNS child.
Emil Mikulic [Sat, 27 Dec 2014 09:27:54 +0000 (20:27 +1100)]
Free lists of cmdline args in the DNS child.

This is a tiny amount of memory but it brings us closer to being valgrind clean.

5 years agoAdd sanitizer and valgrind hints for development.
Emil Mikulic [Sat, 27 Dec 2014 09:19:41 +0000 (20:19 +1100)]
Add sanitizer and valgrind hints for development.

5 years agoAccount for all IP protocols.
Emil Mikulic [Sat, 27 Dec 2014 09:04:31 +0000 (20:04 +1100)]
Account for all IP protocols.

5 years agoMake SIGUSR1 reset reported time and counters.
Emil Mikulic [Sat, 27 Dec 2014 08:47:00 +0000 (19:47 +1100)]
Make SIGUSR1 reset reported time and counters.

5 years agoUse labs(long).
Emil Mikulic [Sat, 27 Dec 2014 08:19:18 +0000 (19:19 +1100)]
Use labs(long).

5 years agoFix use-after-free in http_stop().
Emil Mikulic [Sun, 7 Dec 2014 09:56:43 +0000 (20:56 +1100)]
Fix use-after-free in http_stop().

5 years agoCorrectly show "last seen: never" on the host details page.
Emil Mikulic [Sun, 7 Dec 2014 09:51:24 +0000 (20:51 +1100)]
Correctly show "last seen: never" on the host details page.

5 years agoFix "clock error" due to machine reboot.
Emil Mikulic [Sun, 7 Dec 2014 06:37:38 +0000 (17:37 +1100)]
Fix "clock error" due to machine reboot.

Treat per-host last_seen_mono as a signed integer which can go negative
if the host was last seen before reboot (or whatever corresponds to t=0
on the monotonic clock)

5 years agoIndent, no functional change.
Emil Mikulic [Sun, 7 Dec 2014 06:19:03 +0000 (17:19 +1100)]
Indent, no functional change.

5 years agoUpdate export-format.txt to match hosts_db.c
Emil Mikulic [Sun, 7 Dec 2014 05:59:09 +0000 (16:59 +1100)]
Update export-format.txt to match hosts_db.c

last_seen is stored before the MAC address.

Pointed out by: Trond Endrestol

5 years agoWebsite URL: http -> https
Emil Mikulic [Sun, 7 Dec 2014 05:41:27 +0000 (16:41 +1100)]
Website URL: http -> https

5 years agoAdd README.git notes.
Emil Mikulic [Sun, 7 Dec 2014 05:40:27 +0000 (16:40 +1100)]
Add README.git notes.

5 years agoTurn two unreachable statements into errx().
Emil Mikulic [Sun, 7 Dec 2014 05:36:01 +0000 (16:36 +1100)]
Turn two unreachable statements into errx().

5 years agoExit (instead of busy-loop) when the interface goes down.
Emil Mikulic [Sun, 7 Dec 2014 05:12:15 +0000 (16:12 +1100)]
Exit (instead of busy-loop) when the interface goes down.

6 years agoUpdate COPYING.GPL
Emil Mikulic [Fri, 14 Mar 2014 10:56:38 +0000 (21:56 +1100)]
Update COPYING.GPL

The new one is taken from http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
and has an updated street address for the Free Software Foundation, Inc.

www.gnu.org says: Last-Modified: Tue, 23 Mar 2010 23:34:05 GMT

Reported by: Pavel Alexeev <pahan@hubbitus.info>
Found with: rpmlint

6 years agoUpdate ChangeLog for 3.0.718. 3.0.718
Emil Mikulic [Sat, 25 Jan 2014 11:30:56 +0000 (22:30 +1100)]
Update ChangeLog for 3.0.718.

6 years agoBump copyright years.
Emil Mikulic [Sat, 25 Jan 2014 11:13:39 +0000 (22:13 +1100)]
Bump copyright years.

6 years agocontrib/darkstat_export converts the binary export (.db file) into .csv format.
Jürgen Kahrs MediaMobil [Sat, 25 Jan 2014 10:55:40 +0000 (21:55 +1100)]
contrib/darkstat_export converts the binary export (.db file) into .csv format.

6 years agoDon't chroot() by default.
Emil Mikulic [Sat, 25 Jan 2014 10:51:42 +0000 (21:51 +1100)]
Don't chroot() by default.

Don't detect default chroot dir in the configure script.

The motivation behind this is to no longer fail to configure when /var/empty
doesn't exist, which is the case on most distros.

6 years agoHint on how to view the manpage.
Emil Mikulic [Sat, 25 Jan 2014 10:34:51 +0000 (21:34 +1100)]
Hint on how to view the manpage.

6 years agoMake base url optional.
Emil Mikulic [Sat, 25 Jan 2014 10:25:01 +0000 (21:25 +1100)]
Make base url optional.

Requested by: Lonnie Abelbeck

6 years agoBring back the --base functionality.
Emil Mikulic [Sat, 25 Jan 2014 10:04:25 +0000 (21:04 +1100)]
Bring back the --base functionality.

This is mostly a rollback of "Replace the --base code with relative paths."
except we keep the relative paths.

Requested by: Lonnie Abelbeck

6 years agoUse llu.
Emil Mikulic [Sat, 25 Jan 2014 09:36:32 +0000 (20:36 +1100)]
Use llu.

6 years agoAdd explicit warning about blank graphs due to no localips.
Emil Mikulic [Sat, 25 Jan 2014 09:35:38 +0000 (20:35 +1100)]
Add explicit warning about blank graphs due to no localips.

6 years agoxasprintf() size_t as %qu with cast.
Emil Mikulic [Sat, 25 Jan 2014 09:24:11 +0000 (20:24 +1100)]
xasprintf() size_t as %qu with cast.

6 years agoDon't die from assert() in timer_stop() if time goes backwards.
Emil Mikulic [Sat, 25 Jan 2014 09:18:46 +0000 (20:18 +1100)]
Don't die from assert() in timer_stop() if time goes backwards.

6 years agoMake timer around pcap_dispatch() tighter.
Emil Mikulic [Sat, 25 Jan 2014 09:11:41 +0000 (20:11 +1100)]
Make timer around pcap_dispatch() tighter.

6 years agomake depend
Emil Mikulic [Sat, 25 Jan 2014 09:09:23 +0000 (20:09 +1100)]
make depend

6 years agoFix more clang warnings.
Emil Mikulic [Sat, 25 Jan 2014 09:08:21 +0000 (20:08 +1100)]
Fix more clang warnings.

6 years agoAdd assert() to soothe Clang static analyzer.
Emil Mikulic [Sat, 25 Jan 2014 09:02:29 +0000 (20:02 +1100)]
Add assert() to soothe Clang static analyzer.

6 years agoFix memory leak.
Emil Mikulic [Sat, 25 Jan 2014 09:01:14 +0000 (20:01 +1100)]
Fix memory leak.

Found with Clang static analyzer.

6 years agoAdd assert()s to tree.h to soothe Clang static analyzer.
Emil Mikulic [Sat, 25 Jan 2014 08:43:32 +0000 (19:43 +1100)]
Add assert()s to tree.h to soothe Clang static analyzer.

6 years agoFix some clang warnings.
Emil Mikulic [Sat, 25 Jan 2014 08:30:34 +0000 (19:30 +1100)]
Fix some clang warnings.

6 years agoAdd header sentinel to str.h
Emil Mikulic [Sat, 25 Jan 2014 08:21:18 +0000 (19:21 +1100)]
Add header sentinel to str.h

6 years agoQuiet format string warnings in graph_db.
Emil Mikulic [Sat, 25 Jan 2014 08:18:50 +0000 (19:18 +1100)]
Quiet format string warnings in graph_db.

6 years agoFix type errors in format strings in hosts_db and use time_t instead of long.
Emil Mikulic [Sat, 25 Jan 2014 08:05:40 +0000 (19:05 +1100)]
Fix type errors in format strings in hosts_db and use time_t instead of long.

6 years agoDefine qu and llu in str.h and _Static_assert that they're 64 bits.
Emil Mikulic [Sat, 25 Jan 2014 08:02:18 +0000 (19:02 +1100)]
Define qu and llu in str.h and _Static_assert that they're 64 bits.

6 years agoExplicitly initialize last_real time.
Emil Mikulic [Sat, 25 Jan 2014 07:51:16 +0000 (18:51 +1100)]
Explicitly initialize last_real time.

6 years agoFix type errors in daylog.c format strings, and use time_t instead of long.
Emil Mikulic [Sat, 25 Jan 2014 07:45:57 +0000 (18:45 +1100)]
Fix type errors in daylog.c format strings, and use time_t instead of long.

6 years agoMark _printflike_ things so we get format warnings.
Emil Mikulic [Sat, 25 Jan 2014 07:31:10 +0000 (18:31 +1100)]
Mark _printflike_ things so we get format warnings.

6 years agoRename daylog_fn to opt_daylog_fn when parsing options.
Emil Mikulic [Sat, 25 Jan 2014 07:05:03 +0000 (18:05 +1100)]
Rename daylog_fn to opt_daylog_fn when parsing options.

This avoids using the same name as a different daylog_fn
in the daylog.c module.

6 years agoUse time_t instead of long.
Emil Mikulic [Sat, 25 Jan 2014 09:37:11 +0000 (20:37 +1100)]
Use time_t instead of long.

6 years agoAn attempt at trying to fix the time_t related issues with darkstat.
Remi Locherer [Sat, 25 Jan 2014 07:00:48 +0000 (18:00 +1100)]
An attempt at trying to fix the time_t related issues with darkstat.
Replace some longs with time_t. Fixes darkstat on 32-bit archs.

6 years agoDeveloper helper scripts for compiler warnings and clang analyzer.
Emil Mikulic [Sat, 25 Jan 2014 07:19:56 +0000 (18:19 +1100)]
Developer helper scripts for compiler warnings and clang analyzer.

7 years agoAdd release checklist.
Emil Mikulic [Wed, 14 Aug 2013 09:56:18 +0000 (19:56 +1000)]
Add release checklist.

7 years agoUpdate ChangeLog for 3.0.717. 3.0.717
Emil Mikulic [Wed, 14 Aug 2013 09:15:39 +0000 (19:15 +1000)]
Update ChangeLog for 3.0.717.

7 years agoOrder NEWS by version.
Emil Mikulic [Wed, 14 Aug 2013 09:13:23 +0000 (19:13 +1000)]
Order NEWS by version.

7 years agoFix crash due to str_appendf() not understanding %ld
Emil Mikulic [Wed, 14 Aug 2013 09:07:38 +0000 (19:07 +1000)]
Fix crash due to str_appendf() not understanding %ld

Thanks to James Lay and Tim Bradshaw for reporting this.

7 years agoFake up clock_gettime() on OS X.
Emil Mikulic [Sun, 11 Aug 2013 13:11:09 +0000 (23:11 +1000)]
Fake up clock_gettime() on OS X.

Thanks to Tim Bradshaw for reporting this and testing patches.

7 years agoUpdate ChangeLog for 3.0.716. 3.0.716
Emil Mikulic [Thu, 8 Aug 2013 10:30:38 +0000 (20:30 +1000)]
Update ChangeLog for 3.0.716.

7 years agoWe need at least autoconf 2.64 for PACKAGE_URL.
Emil Mikulic [Tue, 6 Aug 2013 09:58:45 +0000 (19:58 +1000)]
We need at least autoconf 2.64 for PACKAGE_URL.

7 years agoAdd instructions for building darkstat from git.
Emil Mikulic [Tue, 6 Aug 2013 09:23:18 +0000 (19:23 +1000)]
Add instructions for building darkstat from git.

7 years agoCheck for getifaddrs() in libc before ifaddrs.h
Emil Mikulic [Tue, 6 Aug 2013 09:03:00 +0000 (19:03 +1000)]
Check for getifaddrs() in libc before ifaddrs.h

Reported by: Andrej Kralj

He found a platform where the header exists but the library code doesn't.

7 years agoMake configure --enable-warnings use {all,extra}-warnings with GCC.
Emil Mikulic [Tue, 6 Aug 2013 08:40:36 +0000 (18:40 +1000)]
Make configure --enable-warnings use {all,extra}-warnings with GCC.

And -Weverything with clang.

7 years agoImprove the configure script's libpcap instructions.
Emil Mikulic [Sun, 24 Feb 2013 04:26:07 +0000 (15:26 +1100)]
Improve the configure script's libpcap instructions.

Explicitly name the Debian package.

7 years agoUse time_t instead of long in graph_db.c
Emil Mikulic [Mon, 12 Nov 2012 08:01:00 +0000 (19:01 +1100)]
Use time_t instead of long in graph_db.c

7 years agoRun pcap_dispatch() even if the pcap fd isn't in the read set.
Emil Mikulic [Sun, 8 Jul 2012 12:15:37 +0000 (22:15 +1000)]
Run pcap_dispatch() even if the pcap fd isn't in the read set.

Without this, use of the web interface can delay packet capture.

7 years agoChange listen() backlog from -1 to 128.
Emil Mikulic [Sun, 8 Jul 2012 11:45:22 +0000 (21:45 +1000)]
Change listen() backlog from -1 to 128.

Without this change, I get occasional second-long pauses (TCP SYN
retransmit delay) when the darkstat http server is running on
NetBSD 5.1.2, because it interprets -1 as 1 and ignores simultaneous
connection attempts.

7 years agoSet the listening socket non-blocking before we accept() on it.
Emil Mikulic [Sun, 8 Jul 2012 11:41:10 +0000 (21:41 +1000)]
Set the listening socket non-blocking before we accept() on it.

This has not come up as a problem before, but it's a good idea.

7 years agoRemove extraneous include.
Emil Mikulic [Sun, 8 Jul 2012 11:38:59 +0000 (21:38 +1000)]
Remove extraneous include.

7 years agoOnly time the processing part of the event loop.
Emil Mikulic [Sun, 8 Jul 2012 10:11:44 +0000 (20:11 +1000)]
Only time the processing part of the event loop.

It's fine for select() to take a long time if there's no traffic.

8 years agolocalip: don't complain about unknown sa_family.
Emil Mikulic [Sun, 8 Jul 2012 09:45:47 +0000 (19:45 +1000)]
localip: don't complain about unknown sa_family.

There are many possible families and we care about
precisely two of them (IPv4 and IPv6)

8 years agoFreeBSD build warning fixes.
Emil Mikulic [Sun, 8 Jul 2012 09:38:11 +0000 (19:38 +1000)]
FreeBSD build warning fixes.

8 years agoImplement support for multiple capture interfaces.
Emil Mikulic [Sun, 8 Jul 2012 09:24:42 +0000 (19:24 +1000)]
Implement support for multiple capture interfaces.

8 years agoWarn if the event loop or pcap_dispatch are too slow.
Emil Mikulic [Sun, 8 Jul 2012 07:06:11 +0000 (17:06 +1000)]
Warn if the event loop or pcap_dispatch are too slow.

8 years agoUse a monotonic clock where appropriate.
Emil Mikulic [Sun, 8 Jul 2012 06:56:29 +0000 (16:56 +1000)]
Use a monotonic clock where appropriate.

- Host last seen time (although we have to launder it to/from real time
  when dealing with export files)

- Time since localip_update (this fixes a long-standing FIXME)

- HTTP timeouts.

8 years agoSimplify daylog code.
Emil Mikulic [Sat, 7 Jul 2012 09:26:20 +0000 (19:26 +1000)]
Simplify daylog code.

8 years agotest_headers: show progress.
Emil Mikulic [Sat, 7 Jul 2012 08:42:20 +0000 (18:42 +1000)]
test_headers: show progress.

8 years agoRetire pktsummary.time - it isn't used.
Emil Mikulic [Sat, 7 Jul 2012 06:41:50 +0000 (16:41 +1000)]
Retire pktsummary.time - it isn't used.

8 years agoClean up decode module.
Emil Mikulic [Sat, 7 Jul 2012 06:33:47 +0000 (16:33 +1000)]
Clean up decode module.

- cap calls into decode, then acct.
- Decode functions can return 0 on failure.

8 years agoDon't do accounting if decode_ip[v6] fails.
Emil Mikulic [Mon, 2 Jul 2012 16:09:08 +0000 (02:09 +1000)]
Don't do accounting if decode_ip[v6] fails.

Otherwise we get a crash later due to a bogus address family.

Reported by: Mate Juros

8 years agoIgnore IPv6 packets with extension headers.
Emil Mikulic [Sun, 1 Jul 2012 15:11:37 +0000 (01:11 +1000)]
Ignore IPv6 packets with extension headers.

Previously we would emit "unknown proto" warnings.

8 years agoSupport multiple local IPs on an interface.
Emil Mikulic [Sun, 1 Jul 2012 14:26:18 +0000 (00:26 +1000)]
Support multiple local IPs on an interface.

8 years agoDon't inline swap64(), to fix a warning.
Emil Mikulic [Tue, 19 Jun 2012 15:35:03 +0000 (01:35 +1000)]
Don't inline swap64(), to fix a warning.

8 years agoAdd ifdefs around decode_linux_sll implementation.
Emil Mikulic [Mon, 11 Jun 2012 10:19:28 +0000 (20:19 +1000)]
Add ifdefs around decode_linux_sll implementation.

Noticed on OpenBSD 5.1

8 years agoFix "assuming signed overflow does not occur" warning.
Emil Mikulic [Mon, 11 Jun 2012 09:48:55 +0000 (19:48 +1000)]
Fix "assuming signed overflow does not occur" warning.

8 years agoDefine ETHERTYPE_IPV6 ourselves.
Emil Mikulic [Mon, 11 Jun 2012 09:35:00 +0000 (19:35 +1000)]
Define ETHERTYPE_IPV6 ourselves.

Instead of trying to get it through <net/if_ether.h>.
Remove the autoconf check for this header.

8 years agoCompatibility fixes for NetBSD 5.1.2
Emil Mikulic [Mon, 11 Jun 2012 09:33:41 +0000 (19:33 +1000)]
Compatibility fixes for NetBSD 5.1.2

8 years agoFix format warning.
Emil Mikulic [Thu, 3 May 2012 15:03:13 +0000 (01:03 +1000)]
Fix format warning.

8 years agoDon't err() if we can't create one socket for http.
Emil Mikulic [Thu, 3 May 2012 14:49:25 +0000 (00:49 +1000)]
Don't err() if we can't create one socket for http.

We try to create several, and error out later if we don't succeed in
creating any.

8 years agoCosmetic: capitalize. work 3.0.715
Emil Mikulic [Thu, 1 Mar 2012 09:59:12 +0000 (20:59 +1100)]
Cosmetic: capitalize.

8 years agoImprove error message when binding http port.
Emil Mikulic [Thu, 1 Mar 2012 09:58:58 +0000 (20:58 +1100)]
Improve error message when binding http port.

8 years agoWe don't use inet_aton anymore, drop the <arpa/inet.h> includes.
Emil Mikulic [Thu, 1 Mar 2012 09:33:22 +0000 (20:33 +1100)]
We don't use inet_aton anymore, drop the <arpa/inet.h> includes.

8 years agoLook for hstrerror in -lresolv.
Emil Mikulic [Thu, 1 Mar 2012 09:32:24 +0000 (20:32 +1100)]
Look for hstrerror in -lresolv.

Suggested by: Bernd Schemmer, for Solaris 10

8 years agoDrop -Wlong-long
Emil Mikulic [Thu, 1 Mar 2012 09:24:12 +0000 (20:24 +1100)]
Drop -Wlong-long

8 years agoTurn a switch() with no default case into an explicit if+assert.
Emil Mikulic [Thu, 1 Mar 2012 09:20:06 +0000 (20:20 +1100)]
Turn a switch() with no default case into an explicit if+assert.

8 years agoInclude bsd/{string,unistd}.h if present.
Emil Mikulic [Thu, 1 Mar 2012 09:19:49 +0000 (20:19 +1100)]
Include bsd/{string,unistd}.h if present.