Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nigel Kukard
smradius
Commits
62683b71
Commit
62683b71
authored
Sep 12, 2016
by
Nigel Kukard
Browse files
Fixed radius class names
parent
a7b6aa73
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/smradius/client.pm
View file @
62683b71
...
...
@@ -28,7 +28,7 @@ use IO::Select;
use
IO::
Socket
;
use
smradius::
version
;
use
Radius::
Packet
;
use
smradius::
Radius::
Packet
;
# Check Config::IniFiles is instaslled
if
(
!
eval
{
require
Config::
IniFiles
;
1
;})
{
...
...
@@ -114,7 +114,7 @@ sub run
# Time to start loading the dictionary
print
(
STDERR
"
Loading dictionaries...
");
my
$raddb
=
Radius::
Dictionary
->
new
();
my
$raddb
=
smradius::
Radius::
Dictionary
->
new
();
# Look for files in the dir
opendir
(
my
$DIR
,
$cmdline
->
{'
raddb
'})
...
...
@@ -150,7 +150,7 @@ sub run
print
(
STDERR
"
\n
Request:
\n
");
print
(
STDERR
"
> Secret => '
$secret
'
\n
");
# Build packet
my
$pkt
=
Radius::
Packet
->
new
(
$raddb
);
my
$pkt
=
smradius::
Radius::
Packet
->
new
(
$raddb
);
$pkt
->
set_code
(
$pkt_code
);
# Generate identifier
my
$ident
=
int
(
rand
(
32768
));
...
...
@@ -228,7 +228,7 @@ sub run
}
# Parse packet
$pkt
=
Radius::
Packet
->
new
(
$raddb
,
$udp_packet
);
$pkt
=
smradius::
Radius::
Packet
->
new
(
$raddb
,
$udp_packet
);
print
(
STDERR
"
> Authenticated:
"
.
(
defined
(
auth_req_verify
(
$udp_packet
,
$secret
,
$authen
))
?
"
yes
"
:
"
no
")
.
"
\n
");
print
(
STDERR
$pkt
->
str_dump
());
...
...
lib/smradius/daemon.pm
View file @
62683b71
...
...
@@ -64,8 +64,8 @@ use Time::HiRes qw( gettimeofday tv_interval );
use
AWITPT::DB::
DBILayer
;
use
AWITPT::
Util
qw( booleanize )
;
use
Radius::
Packet
;
use
smradius::Radius::
Packet
;
use
smradius::
version
;
use
smradius::
constants
;
use
smradius::daemon::
request
;
...
...
@@ -352,7 +352,7 @@ sub post_configure_hook {
# Load dictionaries
$self
->
log
(
LOG_INFO
,"
[SMRADIUS] Initializing dictionaries...
");
my
$dict
=
Radius::
Dictionary
->
new
();
my
$dict
=
smradius::
Radius::
Dictionary
->
new
();
foreach
my
$df
(
@
{
$config
->
{'
dictionary_list
'}})
{
# Load dictionary
if
(
!
$dict
->
readfile
(
$df
))
{
...
...
@@ -769,7 +769,7 @@ sub process_request {
}
# Tell the NAS we got its packet
my
$resp
=
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
my
$resp
=
smradius::
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
$resp
->
set_code
('
Accounting-Response
');
$resp
->
set_identifier
(
$pkt
->
identifier
);
$resp
->
set_authenticator
(
$pkt
->
authenticator
);
...
...
@@ -832,7 +832,7 @@ sub process_request {
if
(
$PODUser
)
{
$self
->
log
(
LOG_DEBUG
,"
[SMRADIUS] POST-ACCT: Trying to disconnect user...
");
my
$resp
=
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
my
$resp
=
smradius::
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
$resp
->
set_code
('
Disconnect-Request
');
my
$id
=
$$
&
0xff
;
...
...
@@ -1073,7 +1073,7 @@ sub process_request {
$self
->
log
(
LOG_DEBUG
,"
[SMRADIUS] Authenticated and authorized
");
$logReason
=
"
User Authorized
";
my
$resp
=
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
my
$resp
=
smradius::
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
$resp
->
set_code
('
Access-Accept
');
$resp
->
set_identifier
(
$pkt
->
identifier
);
$resp
->
set_authenticator
(
$pkt
->
authenticator
);
...
...
@@ -1218,7 +1218,7 @@ CHECK_RESULT:
$self
->
log
(
LOG_DEBUG
,"
[SMRADIUS] Authentication or authorization failure
");
$logReason
=
"
User NOT Authenticated or Authorized
";
my
$resp
=
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
my
$resp
=
smradius::
Radius::
Packet
->
new
(
$self
->
{'
radius
'}
->
{'
dictionary
'});
$resp
->
set_code
('
Access-Reject
');
$resp
->
set_identifier
(
$pkt
->
identifier
);
$resp
->
set_authenticator
(
$pkt
->
authenticator
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment