line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! /usr/bin/perl |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# $Id: Simple.pm 75 2009-08-12 22:08:28Z lem $ |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Radius::Server::Set::Simple; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1927
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
9
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
10
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
93
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = do { sprintf "%0.3f", 1+(q$Revision: 75 $ =~ /\d+/g)[0]/1000 }; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use Net::Radius::Server::Base qw/:set/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
15
|
1
|
|
|
1
|
|
25
|
use base qw/Net::Radius::Server::Set/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
123
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/auto attr code result vsattr/); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_auto |
19
|
|
|
|
|
|
|
{ |
20
|
|
|
|
|
|
|
my $self = shift; |
21
|
|
|
|
|
|
|
my $r_data = shift; |
22
|
|
|
|
|
|
|
return unless $self->auto; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $req = $r_data->{request}; |
25
|
|
|
|
|
|
|
my $rep = $r_data->{response}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$self->log(4, "Copy autheticator and id"); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$rep->set_authenticator($req->authenticator); |
30
|
|
|
|
|
|
|
$rep->set_identifier($req->identifier); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub set_attr |
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
my $self = shift; |
36
|
|
|
|
|
|
|
my $r_data = shift; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my $rep = $r_data->{response}; |
39
|
|
|
|
|
|
|
foreach (@{$self->attr}) |
40
|
|
|
|
|
|
|
{ |
41
|
|
|
|
|
|
|
$self->log(4, "set_attr " . join(' ', @$_)); |
42
|
|
|
|
|
|
|
$rep->set_attr(@$_); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub set_code |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
my $self = shift; |
49
|
|
|
|
|
|
|
my $r_data = shift; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
my $rep = $r_data->{response}; |
52
|
|
|
|
|
|
|
my $code = $self->code; |
53
|
|
|
|
|
|
|
$self->log(4, "set_code $code"); |
54
|
|
|
|
|
|
|
$rep->set_code($code); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub set_vsattr |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
my $self = shift; |
60
|
|
|
|
|
|
|
my $r_data = shift; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $rep = $r_data->{response}; |
63
|
|
|
|
|
|
|
foreach (@{$self->vsattr}) |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
$self->log(4, "set_vsattr " . join(' ', @$_)); |
66
|
|
|
|
|
|
|
$rep->set_vsattr(@$_); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
42; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |