Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
opentrafficshaper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuriy
opentrafficshaper
Commits
5cbb32f0
Commit
5cbb32f0
authored
11 years ago
by
Nigel Kukard
Browse files
Options
Downloads
Patches
Plain Diff
Set expiry period properly from config
parent
dcc07c67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
opentrafficshaper/plugins/radius/radius.pm
+13
-3
13 additions, 3 deletions
opentrafficshaper/plugins/radius/radius.pm
with
13 additions
and
3 deletions
opentrafficshaper/plugins/radius/radius.pm
+
13
−
3
View file @
5cbb32f0
...
...
@@ -44,7 +44,7 @@ our (@ISA,@EXPORT,@EXPORT_OK);
use
constant
{
VERSION
=>
'
0.0.1
',
DATAGRAM_MAXLEN
=>
8192
,
DEFAULT_E
NTRY_EXPIRES
=>
86400
,
DEFAULT_E
XPIRY_PERIOD
=>
86400
,
};
...
...
@@ -65,7 +65,10 @@ our $pluginInfo = {
my
$globals
;
my
$logger
;
# Our own data storage
my
$config
;
my
$config
=
{
'
expiry_period
'
=>
DEFAULT_EXPIRY_PERIOD
};
my
$dictionary
;
...
...
@@ -109,6 +112,12 @@ sub plugin_init
# Store the dictionary
$dictionary
=
$dict
;
# Check if we must override the expiry time
if
(
defined
(
my
$expiry
=
$globals
->
{'
file.config
'}
->
{'
plugin.radius
'}
->
{'
expiry_period
'}))
{
$logger
->
log
(
LOG_INFO
,"
[RADIUS] Set expiry_period to '
$expiry
'
");
$config
->
{'
expiry_period
'}
=
$expiry
;
}
# Radius listener
POE::
Session
->
create
(
inline_states
=>
{
...
...
@@ -251,7 +260,8 @@ sub server_read {
'
TrafficLimitRx
'
=>
$trafficLimitRx
,
'
TrafficLimitTxBurst
'
=>
$trafficLimitTxBurst
,
'
TrafficLimitRxBurst
'
=>
$trafficLimitRxBurst
,
'
Expires
'
=>
$now
+
(
defined
(
$globals
->
{'
file.config
'}
->
{'
plugin.radius
'}
->
{'
expire_entries
'})
?
$globals
->
{'
file.config
'}
->
{'
plugin.radius
'}
->
{'
expire_entries
'}
:
DEFAULT_ENTRY_EXPIRES
),
'
Expires
'
=>
$now
+
(
defined
(
$globals
->
{'
file.config
'}
->
{'
plugin.radius
'}
->
{'
expire_entries
'})
?
$globals
->
{'
file.config
'}
->
{'
plugin.radius
'}
->
{'
expire_entries
'}
:
$config
->
{'
expiry_period
'}),
'
Status
'
=>
getStatus
(
$pkt
->
rawattr
('
Acct-Status-Type
')),
'
Source
'
=>
"
plugin.radius
",
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment