line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Net::TacacsPlus::Constants - Tacacs+ packet constants |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Net::TacacsPlus::Constants; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This module will import tacacs+ packet constants defined in tac-rfc.1.78.txt + TAC_PLUS_HEADER_SIZE. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
TAC_PLUS_MAJOR_VER => 0xc, |
14
|
|
|
|
|
|
|
TAC_PLUS_MINOR_VER_DEFAULT => 0x0, |
15
|
|
|
|
|
|
|
TAC_PLUS_MINOR_VER_ONE => 0x1, |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN => 0x01, #(Authentication) |
18
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR => 0x02, #(Authorization) |
19
|
|
|
|
|
|
|
TAC_PLUS_ACCT => 0x03, #(Accounting) |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
TAC_PLUS_UNENCRYPTED_FLAG => 0x01, |
22
|
|
|
|
|
|
|
TAC_PLUS_SINGLE_CONNECT_FLAG => 0x04, |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_LOGIN => 0x01, |
25
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_CHPASS => 0x02, |
26
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SENDPASS => 0x03, #(deprecated) |
27
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SENDAUTH => 0x04, |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_MAX => 0x0f, |
30
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_ROOT => 0x0f, |
31
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_USER => 0x01, |
32
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_MIN => 0x00, |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_ASCII => 0x01, |
35
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_PAP => 0x02, |
36
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_CHAP => 0x03, |
37
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_ARAP => 0x04, |
38
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_MSCHAP => 0x05, |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_NONE => 0x00, |
41
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_LOGIN => 0x01, |
42
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_ENABLE => 0x02, |
43
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_PPP => 0x03, |
44
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_ARAP => 0x04, |
45
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_PT => 0x05, |
46
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_RCMD => 0x06, |
47
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_X25 => 0x07, |
48
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_NASI => 0x08, |
49
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_FWPROXY => 0x09, |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_PASS => 0x01, |
52
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_FAIL => 0x02, |
53
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETDATA => 0x03, |
54
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETUSER => 0x04, |
55
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETPASS => 0x05, |
56
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_RESTART => 0x06, |
57
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_ERROR => 0x07, |
58
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_FOLLOW => 0x21, |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_NOT_SET => 0x00, |
61
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_NONE => 0x01, |
62
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_KRB5 => 0x02, |
63
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_LINE => 0x03, |
64
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_ENABLE => 0x04, |
65
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_LOCAL => 0x05, |
66
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_TACACSPLUS => 0x06, |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_GUEST => 0x08, |
69
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_RADIUS => 0x10, |
70
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_KRB4 => 0x11, |
71
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_RCMD => 0x20, |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_PASS_ADD => 0x01, |
74
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_PASS_REPL => 0x02, |
75
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_FAIL => 0x10, |
76
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_ERROR => 0x11, |
77
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_FOLLOW => 0x21, |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_MORE => 0x01, # deprecated |
80
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_START => 0x02, |
81
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_STOP => 0x04, |
82
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_WATCHDOG => 0x08, |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_SUCCESS => 0x01, |
85
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_ERROR => 0x02, |
86
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_FOLLOW => 0x21, |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
TAC_PLUS_HEADER_SIZE => 12, |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHOR |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Jozef Kutej Ejkutej@cpan.orgE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Authorization and Accounting contributed by Rubio Vaughan Erubio@passim.netE |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 VERSION |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1.03 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 SEE ALSO |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
tac-rfc.1.78.txt, Net::TacacsPlus::Client |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
package Net::TacacsPlus::Constants; |
108
|
|
|
|
|
|
|
|
109
|
11
|
|
|
11
|
|
79383
|
use strict; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
475
|
|
110
|
11
|
|
|
11
|
|
57
|
use warnings; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
3114
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
our $VERSION = '1.10'; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
# constants from tac-rfc-1.78.txt + TAC_PLUS_HEADER_SIZE |
115
|
|
|
|
|
|
|
my %tac_plus_const = ( |
116
|
|
|
|
|
|
|
TAC_PLUS_MAJOR_VER => 0xc, |
117
|
|
|
|
|
|
|
TAC_PLUS_MINOR_VER_DEFAULT => 0x0, |
118
|
|
|
|
|
|
|
TAC_PLUS_MINOR_VER_ONE => 0x1, |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN => 0x01, #(Authentication) |
121
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR => 0x02, #(Authorization) |
122
|
|
|
|
|
|
|
TAC_PLUS_ACCT => 0x03, #(Accounting) |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
TAC_PLUS_UNENCRYPTED_FLAG => 0x01, |
125
|
|
|
|
|
|
|
TAC_PLUS_SINGLE_CONNECT_FLAG => 0x04, |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_LOGIN => 0x01, |
128
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_CHPASS => 0x02, |
129
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SENDPASS => 0x03, #(deprecated) |
130
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SENDAUTH => 0x04, |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_MAX => 0x0f, |
133
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_ROOT => 0x0f, |
134
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_USER => 0x01, |
135
|
|
|
|
|
|
|
TAC_PLUS_PRIV_LVL_MIN => 0x00, |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_ASCII => 0x01, |
138
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_PAP => 0x02, |
139
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_CHAP => 0x03, |
140
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_ARAP => 0x04, |
141
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_TYPE_MSCHAP => 0x05, |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_NONE => 0x00, |
144
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_LOGIN => 0x01, |
145
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_ENABLE => 0x02, |
146
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_PPP => 0x03, |
147
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_ARAP => 0x04, |
148
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_PT => 0x05, |
149
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_RCMD => 0x06, |
150
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_X25 => 0x07, |
151
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_NASI => 0x08, |
152
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_SVC_FWPROXY => 0x09, |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_PASS => 0x01, |
155
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_FAIL => 0x02, |
156
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETDATA => 0x03, |
157
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETUSER => 0x04, |
158
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_GETPASS => 0x05, |
159
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_RESTART => 0x06, |
160
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_ERROR => 0x07, |
161
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_STATUS_FOLLOW => 0x21, |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_NOT_SET => 0x00, |
164
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_NONE => 0x01, |
165
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_KRB5 => 0x02, |
166
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_LINE => 0x03, |
167
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_ENABLE => 0x04, |
168
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_LOCAL => 0x05, |
169
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_TACACSPLUS => 0x06, |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_GUEST => 0x08, |
172
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_RADIUS => 0x10, |
173
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_KRB4 => 0x11, |
174
|
|
|
|
|
|
|
TAC_PLUS_AUTHEN_METH_RCMD => 0x20, |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_PASS_ADD => 0x01, |
177
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_PASS_REPL => 0x02, |
178
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_FAIL => 0x10, |
179
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_ERROR => 0x11, |
180
|
|
|
|
|
|
|
TAC_PLUS_AUTHOR_STATUS_FOLLOW => 0x21, |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_MORE => 0x01, # deprecated |
183
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_START => 0x02, |
184
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_STOP => 0x04, |
185
|
|
|
|
|
|
|
TAC_PLUS_ACCT_FLAG_WATCHDOG => 0x08, |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_SUCCESS => 0x01, |
188
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_ERROR => 0x02, |
189
|
|
|
|
|
|
|
TAC_PLUS_ACCT_STATUS_FOLLOW => 0x21, |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
TAC_PLUS_HEADER_SIZE => 12, |
192
|
|
|
|
|
|
|
); |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
for my $name (keys %tac_plus_const) |
195
|
|
|
|
|
|
|
{ |
196
|
|
|
|
|
|
|
my $scalar = $tac_plus_const{$name}; |
197
|
|
|
|
|
|
|
$tac_plus_const{$name} = sub () { $scalar }; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head1 METHODS |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=over 4 |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item import() |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
This sub is called automaticaly. I loads the constants to caller namespace. I took idea for it from "use constant". |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=cut |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
sub import { |
211
|
103
|
|
|
103
|
|
24329
|
my $pkg = caller; |
212
|
|
|
|
|
|
|
|
213
|
103
|
|
|
|
|
2192
|
foreach my $name (keys %tac_plus_const) |
214
|
|
|
|
|
|
|
{ |
215
|
6489
|
|
|
|
|
14596
|
my $fullname="${pkg}::$name"; |
216
|
|
|
|
|
|
|
|
217
|
6489
|
|
|
|
|
6794
|
do { |
218
|
11
|
|
|
11
|
|
70
|
no strict 'refs'; |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
840
|
|
219
|
6489
|
|
|
|
|
78206
|
*$fullname = $tac_plus_const{$name}; |
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
1; |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=back |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
Copyright (C) 2006 by Jozef Kutej |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
233
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.4 or, |
234
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=cut |
237
|
|
|
|
|
|
|
|