head	1.1;
access;
symbols
	RELENG_8_4:1.1.0.18
	RELENG_9_1_0_RELEASE:1.1
	RELENG_9_1:1.1.0.16
	RELENG_9_1_BP:1.1
	RELENG_8_3_0_RELEASE:1.1
	RELENG_8_3:1.1.0.14
	RELENG_8_3_BP:1.1
	RELENG_9_0_0_RELEASE:1.1
	RELENG_9_0:1.1.0.12
	RELENG_9_0_BP:1.1
	RELENG_9:1.1.0.10
	RELENG_9_BP:1.1
	RELENG_8_2_0_RELEASE:1.1
	RELENG_8_2:1.1.0.8
	RELENG_8_2_BP:1.1
	RELENG_8_1_0_RELEASE:1.1
	RELENG_8_1:1.1.0.6
	RELENG_8_1_BP:1.1
	RELENG_8_0_0_RELEASE:1.1
	RELENG_8_0:1.1.0.4
	RELENG_8_0_BP:1.1
	RELENG_8:1.1.0.2
	RELENG_8_BP:1.1;
locks; strict;
comment	@# @;


1.1
date	2009.03.02.02.23.47;	author sam;	state Exp;
branches
	1.1.18.1;
next	;

1.1.18.1
date	2009.03.02.02.23.47;	author svnexp;	state dead;
branches;
next	1.1.18.2;

1.1.18.2
date	2013.03.28.13.02.10;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@SVN rev 189261 on 2009-03-02 02:23:47Z by sam

connect vendor wpa area to contrib
@
text
@#!/usr/bin/perl -w
#
# Logwatch script for hostapd
#
# Copyright 2005 Henrik Brix Andersen <brix@@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
# Alternatively, this file may be distributed under the terms of the BSD License

use strict;

my $debug = $ENV{'LOGWATCH_DEBUG'} || 0;
my $detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
my $debugcounter = 1;

my %hostapd;
my @@unmatched;

if ($debug >= 5) {
	print STDERR "\n\nDEBUG: Inside HOSTAPD Filter\n\n";
}

while (defined(my $line = <STDIN>)) {
	if ($debug >= 5) {
		print STDERR "DEBUG($debugcounter): $line";
		$debugcounter++;
	}
    chomp($line);

	if (my ($iface,$mac,$layer,$details) = ($line =~ /(.*?): STA (.*?) (.*?): (.*?)$/i)) {
		unless ($detail == 10) {
			# collapse association events
			$details =~ s/^(associated) .*$/$1/i;
		}
		$hostapd{$iface}->{$mac}->{$layer}->{$details}++;
	} else {
		push @@unmatched, "$line\n";
	}
}

if (keys %hostapd) {
	foreach my $iface (sort keys %hostapd) {
		print "Interface $iface:\n";
		foreach my $mac (sort keys %{$hostapd{$iface}}) {
			print "  Client MAC Address $mac:\n";
			foreach my $layer (sort keys %{$hostapd{$iface}->{$mac}}) {
				print "    $layer:\n";
				foreach my $details (sort keys %{$hostapd{$iface}->{$mac}->{$layer}}) {
					print "      $details";
					my $count = $hostapd{$iface}->{$mac}->{$layer}->{$details};
					if ($count > 1) {
						print ": " . $count . " Times";
					}
					print "\n";
				}
			}
		}
	}
}

if ($#unmatched >= 0) {
    print "\n**Unmatched Entries**\n";
    print @@unmatched;
}

exit(0);
@


1.1.18.1
log
@file hostapd was added on branch RELENG_8_4 on 2013-03-28 13:02:10 +0000
@
text
@d1 65
@


1.1.18.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 65
#!/usr/bin/perl -w
#
# Logwatch script for hostapd
#
# Copyright 2005 Henrik Brix Andersen <brix@@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
# Alternatively, this file may be distributed under the terms of the BSD License

use strict;

my $debug = $ENV{'LOGWATCH_DEBUG'} || 0;
my $detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
my $debugcounter = 1;

my %hostapd;
my @@unmatched;

if ($debug >= 5) {
	print STDERR "\n\nDEBUG: Inside HOSTAPD Filter\n\n";
}

while (defined(my $line = <STDIN>)) {
	if ($debug >= 5) {
		print STDERR "DEBUG($debugcounter): $line";
		$debugcounter++;
	}
    chomp($line);

	if (my ($iface,$mac,$layer,$details) = ($line =~ /(.*?): STA (.*?) (.*?): (.*?)$/i)) {
		unless ($detail == 10) {
			# collapse association events
			$details =~ s/^(associated) .*$/$1/i;
		}
		$hostapd{$iface}->{$mac}->{$layer}->{$details}++;
	} else {
		push @@unmatched, "$line\n";
	}
}

if (keys %hostapd) {
	foreach my $iface (sort keys %hostapd) {
		print "Interface $iface:\n";
		foreach my $mac (sort keys %{$hostapd{$iface}}) {
			print "  Client MAC Address $mac:\n";
			foreach my $layer (sort keys %{$hostapd{$iface}->{$mac}}) {
				print "    $layer:\n";
				foreach my $details (sort keys %{$hostapd{$iface}->{$mac}->{$layer}}) {
					print "      $details";
					my $count = $hostapd{$iface}->{$mac}->{$layer}->{$details};
					if ($count > 1) {
						print ": " . $count . " Times";
					}
					print "\n";
				}
			}
		}
	}
}

if ($#unmatched >= 0) {
    print "\n**Unmatched Entries**\n";
    print @@unmatched;
}

exit(0);
@


