09-02-2008
Quote:
Originally Posted by
Annihilannic
Yes, it's a two-dimensional array indexed by the address and an index. The indices themselves are held in a second one-timensional array, txindex[].
So to cater for your second situation, all you need to do is reset the txindex[txaddr] counter to 0 each time a new TXADDR is encountered. Similarly you can reset the rxindex[rxaddr] counter each time an RXADDR is encountered.
Thanks for your reply & valuable time .
Today morning I tried to reset the index . When I changed to
txindex= 0, it throws me error but it should be
txindex[txaddr] = 0 as you suggested & with that the programme goes smoothly..
Again Thanks a lot .. God Bless you..
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello friends,
I have a problem in printing an array..
Example if my array line contains 4 elements like following
line=0002 , line=202200, line=200002, line= 300313
Now one = sprintf line line line line will concatenate my whole array to one.
But I am not sure about the... (7 Replies)
Discussion started by: user_prady
7 Replies
2. Shell Programming and Scripting
Hello Friends,
I have a txt file like below
//*Init Start
Reg(read,12'h42E,16'h0000);
Nop(5628.5);
//*Init End
//*Main Start
Reg(read,12'h42E,16'h0000);
Nop(5628.5);
//*Main End
I want to calculate the values between //* Init Start & //* Init End
And //*Main Start & //*Main... (5 Replies)
Discussion started by: user_prady
5 Replies
3. Shell Programming and Scripting
I want to print lines that have "IND" or "ind" or nothing in field 2 or 3
file:
output needed:
Code i wrote:
nawk -F"," '{if(tolower($2||$3) ~"ind"||"")print}' file
Help is appreciated (3 Replies)
Discussion started by: pinnacle
3 Replies
4. Shell Programming and Scripting
In one data file i have values like this
a b c 1 2
e f g 2 3
i j k 3 5
I need to sum up the last 2 columns and make a data file...How i can do that.
a b c 1 2
e f g 2 3
i j k 3 5... (8 Replies)
Discussion started by: bobprabhu
8 Replies
5. UNIX for Dummies Questions & Answers
I have task to find out the min,max, average value of each service for example i searched for " StatementService "
$awk '/VST.*StatementService:/{print $3,$4,$19,$22,$25}' performance.log > smp.log
$cat smp.log
amexgtv VST: : StatementService:1860 StatementService:getCardReference:0... (3 Replies)
Discussion started by: senthil.ak
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
My file has 2 fields and millions of lines.
variableStep chrom=Uextra span=25
201 0.5952
226 0.330693
251 0.121004
276 0.0736858
301 0.0646982
326 0.0736858
401 0.2952
426 0.230693
451 0.221004
476 0.2736858
Each field either has a... (6 Replies)
Discussion started by: wyarosh
6 Replies
7. Shell Programming and Scripting
Hi friends, I am having 2 files, I just want to compare 2 files each containing 2 columns 1st column is lat, and 2nd column is long, if anyone can understand below logic please help me in writing script with awk.. here each field of file2 needs to be compared with std_file
main
counter=0... (1 Reply)
Discussion started by: Akshay Hegde
1 Replies
8. Shell Programming and Scripting
I am trying to check my logic on a long awk i'm using. I have about 30 checks that I built into an awk and I "believe" I did this right, but I could be wrong.
awk -F\| '
$9 !~ /\/*{1,}*/
$9 ~ /\(-{4}, {2,3}/
$9 ~ /\({6}, {2,3}\)/
$9 ~ /\(\+{5}, {2,3}\)/
$9 ~ /\(\+\+{4}, {2,3}\)/
$9 ~... (8 Replies)
Discussion started by: dagamier
8 Replies
LEARN ABOUT DEBIAN
rlm_counter
rlm_counter(5) FreeRADIUS Module rlm_counter(5)
NAME
rlm_counter - FreeRADIUS Module
DESCRIPTION
The rlm_counter module provides a general framework to allow access based on accumulated usage of a resource, such as total time online in
a given period, total data transferred in a given period, etc. This is very useful in a 'Prepaid Service' situation, where a user has paid
for a finite amount of usage and should not be allowed to use more than that service. Collection, monitoring, and replenishment of prepaid
services are beyond the scope of this module.
The main configuration items to be aware of are:
filename
The filename where the usage data is stored.
key An attribute which will be present in the Access-Request to be used as the 'index' value for the counter. A counter entry is tracked
for each unique key. The most likely key you will want to use is User-Name.
count-attribute
An attribute which will be used to increment the counter value. If this attribute is Acct-Session-Time or an integer value the
counter data is incremented by the Attribute value. For all other attribute types the counter is incremented by one.
reset How frequently the counter data should be set back to 0. Valid values for this variable are: hourly, daily, weekly, monthly, orn-
ever Alternatively, it can be user defined, in the form: num[hdwm]. num is a numeric value, followed by one or none of the follow-
ing letters. h: hours, d: days, w: weeks, m: months.
check-name
This defines an attribute name which will be registered by the counter module and can be used to set the maximum allowed value for
the counter after which the user is rejected. If Daily-Session-Time is set, you can use the following syntax in the Users file to
set a cap of 3600 seconds ( 8 hours ):
DEFAULT Max-Daily-Session := 3600
reply-name
This is the name of the attribute which will contain the remaining value for the counter in the reply packet when the user is suc-
cessfully authorized. The default attribute name is "Session-Timeout".
allowed-servicetype
This can be used to only apply the limitations to specific service types of sessions. For example, setting this to Framed-User will
only apply the counter module to Framed sessions, excluding other types such as Telnet or Rlogin.
cache-size
The maximum size of the cache to be used by the module. The default is 1000.
NOTES
This module registers an attribute, so it should be added to the instantiate section, to be called on server startup. When used in the
authorize section, it must come after any modules which set the 'check-name' attribute.
SECTIONS
instantiate, authorize, accounting
FILES
/etc/raddb/radiusd.conf
SEE ALSO
radiusd(8), radiusd.conf(5) rlm_sqlcounter(5)
AUTHOR
Chris Parker, cparker@segv.org
13 March 2004 rlm_counter(5)