head	1.2;
access;
symbols
	RELENG_7_4_0_RELEASE:1.1.40.1
	RELENG_7_4:1.1.0.40
	RELENG_7_4_BP:1.1
	RELENG_7_3_0_RELEASE:1.1.38.1
	RELENG_7_3:1.1.0.38
	RELENG_7_3_BP:1.1
	RELENG_7_2_0_RELEASE:1.1.36.1
	RELENG_7_2:1.1.0.36
	RELENG_7_2_BP:1.1
	RELENG_7_1_0_RELEASE:1.1.34.1
	RELENG_6_4_0_RELEASE:1.1.32.1
	RELENG_7_1:1.1.0.34
	RELENG_7_1_BP:1.1
	RELENG_6_4:1.1.0.32
	RELENG_6_4_BP:1.1
	RELENG_7_0_0_RELEASE:1.1
	RELENG_6_3_0_RELEASE:1.1
	RELENG_7_0:1.1.0.30
	RELENG_7_0_BP:1.1
	RELENG_6_3:1.1.0.28
	RELENG_6_3_BP:1.1
	RELENG_7:1.1.0.26
	RELENG_7_BP:1.1
	RELENG_6_2_0_RELEASE:1.1
	RELENG_6_2:1.1.0.24
	RELENG_6_2_BP:1.1
	RELENG_5_5_0_RELEASE:1.1
	RELENG_5_5:1.1.0.22
	RELENG_5_5_BP:1.1
	RELENG_6_1_0_RELEASE:1.1
	RELENG_6_1:1.1.0.20
	RELENG_6_1_BP:1.1
	RELENG_6_0_0_RELEASE:1.1
	RELENG_6_0:1.1.0.18
	RELENG_6_0_BP:1.1
	RELENG_6:1.1.0.16
	RELENG_6_BP:1.1
	RELENG_5_4_0_RELEASE:1.1
	RELENG_5_4:1.1.0.14
	RELENG_5_4_BP:1.1
	RELENG_4_11_0_RELEASE:1.1.2.1
	RELENG_4_11:1.1.2.1.0.16
	RELENG_4_11_BP:1.1.2.1
	RELENG_5_3_0_RELEASE:1.1
	RELENG_5_3:1.1.0.12
	RELENG_5_3_BP:1.1
	RELENG_5:1.1.0.10
	RELENG_5_BP:1.1
	RELENG_4_10_0_RELEASE:1.1.2.1
	RELENG_4_10:1.1.2.1.0.14
	RELENG_4_10_BP:1.1.2.1
	RELENG_5_2_1_RELEASE:1.1
	RELENG_5_2_0_RELEASE:1.1
	RELENG_5_2:1.1.0.8
	RELENG_5_2_BP:1.1
	RELENG_4_9_0_RELEASE:1.1.2.1
	RELENG_4_9:1.1.2.1.0.12
	RELENG_4_9_BP:1.1.2.1
	RELENG_5_1_0_RELEASE:1.1
	RELENG_5_1:1.1.0.6
	RELENG_5_1_BP:1.1
	RELENG_4_8_0_RELEASE:1.1.2.1
	RELENG_4_8:1.1.2.1.0.10
	RELENG_4_8_BP:1.1.2.1
	RELENG_5_0_0_RELEASE:1.1
	RELENG_5_0:1.1.0.4
	RELENG_5_0_BP:1.1
	RELENG_4_7_0_RELEASE:1.1.2.1
	RELENG_4_7:1.1.2.1.0.8
	RELENG_4_7_BP:1.1.2.1
	RELENG_4_6_2_RELEASE:1.1.2.1
	RELENG_4_6_1_RELEASE:1.1.2.1
	RELENG_4_6_0_RELEASE:1.1.2.1
	RELENG_4_6:1.1.2.1.0.6
	RELENG_4_6_BP:1.1.2.1
	RELENG_4_5_0_RELEASE:1.1.2.1
	RELENG_4_5:1.1.2.1.0.4
	RELENG_4_5_BP:1.1.2.1
	RELENG_4_4_0_RELEASE:1.1.2.1
	RELENG_4_4:1.1.2.1.0.2
	RELENG_4_4_BP:1.1.2.1
	RELENG_4:1.1.0.2;
locks; strict;
comment	@# @;


1.2
date	2008.05.26.10.39.49;	author bz;	state dead;
branches;
next	1.1;

1.1
date	2001.05.25.13.25.59;	author hm;	state Exp;
branches
	1.1.2.1
	1.1.16.1
	1.1.26.1
	1.1.32.1
	1.1.34.1
	1.1.36.1
	1.1.38.1
	1.1.40.1;
next	;

1.1.2.1
date	2001.08.10.14.59.48;	author obrien;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2012.11.17.07.24.45;	author svnexp;	state Exp;
branches;
next	;

1.1.16.1
date	2012.11.17.07.41.33;	author svnexp;	state Exp;
branches;
next	;

1.1.26.1
date	2012.11.17.08.03.53;	author svnexp;	state Exp;
branches;
next	;

1.1.32.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.1.34.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.1.36.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.1.38.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.1.40.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.1.40.2;

1.1.40.2
date	2012.11.17.08.16.56;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Remove ISDN4BSD (I4B) from HEAD as it is not MPSAFE and
parts relied on the now removed NET_NEEDS_GIANT.
Most of I4B has been disconnected from the build
since July 2007 in HEAD/RELENG_7.

This is what was removed:
- configuration in /etc/isdn
- examples
- man pages
- kernel configuration
- sys/i4b (drivers, layers, include files)
- user space tools
- i4b support from ppp
- further documentation

Discussed with: rwatson, re
@
text
@#!/usr/bin/perl
#---------------------------------------------------------------------------
#
# Copyright (c) 1996, 1998 Hellmuth Michaelis. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.

# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
#---------------------------------------------------------------------------
#
#	accounting report script for the isdnd daemon accounting info
#	-------------------------------------------------------------
#
#	last edit-date: [Fri May 25 15:28:20 2001]
#
# $FreeBSD: src/share/examples/isdn/contrib/isdnd_acct,v 1.1 2001/05/25 13:25:59 hm Exp $
#
#---------------------------------------------------------------------------

# where the isdnd accounting file resides
$ACCT_FILE = "/var/log/isdnd.acct";

# the charge for a unit, currently 0,12 DM
$UNIT_PRICE = 0.12;

# open accounting file
open(IN, $ACCT_FILE) ||
	die "ERROR, cannot open $ACCT_FILE !\n";

# set first thru flag
$first = 1;

# process file line by line
while (<IN>)
{
	# remove ( and ) from length and bytecounts
	tr/()//d;

	# split line into pieces
	($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
		= split(/ /, $_);

	# get starting date
	if($first)
	{
		$from = "$from_d $from_h";
		$first = 0;
	}
		
	# split bytecount
	($inb, $outb) = split(/\//, $byte);

	# process fields
	$a_secs{$name} += $secs;
	$a_calls{$name}++;
	$a_units{$name} += $units;
	$a_charge{$name} += $units * $UNIT_PRICE;
	$a_inbytes{$name} += $inb;
	$a_outbytes{$name} += $outb;
	$a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
}

# close accouting file
close(IN);

# write header
print "\n";
print "     ISDN Accounting Report   ($from -> $to_d $to_h)\n";
print "     =====================================================================\n";

#write the sum for each interface/name
foreach $name (sort(keys %a_secs))
{
	$o_secs = $a_secs{$name};
	$gt_secs += $o_secs;
	$o_calls = $a_calls{$name};
	$gt_calls += $o_calls;
	$o_units = $a_units{$name};
	$gt_units += $o_units;
	$o_charge = $a_charge{$name};
	$gt_charge += $o_charge;
	$o_inbytes = $a_inbytes{$name};
	$gt_inbytes += $o_inbytes;
	$o_outbytes = $a_outbytes{$name};
	$gt_outbytes += $o_outbytes;
	$o_bytes = $a_bytes{$name};
	$gt_bytes += $o_bytes;
	write;
}

$o_secs = $gt_secs;
$o_calls = $gt_calls;
$o_units = $gt_units;
$o_charge = $gt_charge;
$o_inbytes = $gt_inbytes;
$o_outbytes = $gt_outbytes;
$o_bytes = $gt_bytes;
$name = "Total";

print "======= ====== ===== ===== ======== ============ ============ ============\n";
write;

print "\n\n";
exit;

# top of page header
format top =

Name    charge units calls     secs      inbytes     outbytes        bytes
------- ------ ----- ----- -------- ------------ ------------ ------------
.

# record template
format STDOUT =
@@<<<<<< @@##.## @@#### @@#### @@####### @@########### @@########### @@###########
$name,  $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
.

# EOF
@


1.1
log
@Add the contributed directory from the i4b tarball and the files from it
which would be nice to have.
Move isdnd_acct and isdnctl to the contrib directory where they belong to.
@
text
@d34 1
a34 1
# $FreeBSD$
@


1.1.26.1
log
@Switch importer
@
text
@d34 1
a34 1
# $FreeBSD: stable/7/share/examples/isdn/contrib/isdnd_acct 77177 2001-05-25 13:25:59Z hm $
@


1.1.16.1
log
@Switch importer
@
text
@d34 1
a34 1
# $FreeBSD: stable/6/share/examples/isdn/contrib/isdnd_acct 77177 2001-05-25 13:25:59Z hm $
@


1.1.40.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.1.40.2
log
@Switch importer
@
text
@d34 1
a34 1
# $FreeBSD: releng/7.4/share/examples/isdn/contrib/isdnd_acct 77177 2001-05-25 13:25:59Z hm $
@


1.1.38.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.1.36.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.1.34.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.1.32.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.1.2.1
log
@MFC: version 1.01

Approved by:	jkh
@
text
@d34 1
a34 1
# $FreeBSD: src/share/examples/isdn/contrib/isdnd_acct,v 1.1 2001/05/25 13:25:59 hm Exp $
@


1.1.2.2
log
@Switch importer
@
text
@d34 1
a34 1
# $FreeBSD: stable/4/share/examples/isdn/contrib/isdnd_acct 81456 2001-08-10 14:59:48Z obrien $
@


