This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Constant.pm
228 lines (146 loc) · 4.03 KB
/
Constant.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
package fingerbank::Constant;
=head1 NAME
fingerbank::Constant
=head1 DESCRIPTION
Constants used in the code to make it more readable.
=cut
use strict;
use warnings;
use Readonly;
BEGIN {
use Exporter ();
our ( @ISA, @EXPORT_OK );
@ISA = qw(Exporter);
@EXPORT_OK = qw(
$FALSE $TRUE
$YES $NO
$FINGERBANK_USER
$DEFAULT_BACKUP_RETENTION
$DEFAULT_SCORE
$SQLITE_DB_TYPE
$LOCAL_SCHEMA
$UPSTREAM_SCHEMA
$ALL_SCHEMAS_KW
);
}
=head1 CONSTANTS
=over
=item $VERSION
=item $FALSE
=item $TRUE
=item $YES
=item $NO
=cut
Readonly::Scalar our $VERSION => "4.3.1";
Readonly::Scalar our $FALSE => 0;
Readonly::Scalar our $TRUE => 1;
Readonly::Scalar our $YES => 'yes';
Readonly::Scalar our $NO => 'no';
=back
=head1 QUERY PARAMETERS
=over
=item $DHCP_FINGERPRINT
=item $DHCP_VENDOR
=item $USER_AGENT
=item $MAC_VENDOR
=cut
Readonly::Scalar our $DHCP_FINGERPRINT => 'DHCP_Fingerprint';
Readonly::Scalar our $DHCP_VENDOR => 'DHCP_Vendor';
Readonly::Scalar our $DHCP6_FINGERPRINT => 'DHCP6_Fingerprint';
Readonly::Scalar our $DHCP6_ENTERPRISE => 'DHCP6_Enterprise';
Readonly::Scalar our $USER_AGENT => 'User_Agent';
Readonly::Scalar our $MAC_VENDOR => 'MAC_Vendor';
=item @QUERY_PARAMETERS
An array containing all the query parameters
=cut
Readonly::Array our @QUERY_PARAMETERS => (
$DHCP_FINGERPRINT,
$DHCP_VENDOR,
$USER_AGENT,
$MAC_VENDOR,
$DHCP6_FINGERPRINT,
$DHCP6_ENTERPRISE,
);
=item %PARENT_IDS
A hash containing the parent ids for the base devices
=cut
Readonly::Hash our %PARENT_IDS => (
WINDOWS => 1,
MACOS => 2,
LINUX => 5,
ANDROID => 33453,
IOS => 33450,
WINDOWS_PHONE => 33507,
BLACKBERRY => 33471,
);
Readonly::Hash our %DEVICE_CLASS_IDS => (
%PARENT_IDS,
);
Readonly::Array our @DEVICE_CLASS_LOOKUP_ORDER => (
(grep { $_ ne "WINDOWS" } keys(%DEVICE_CLASS_IDS)),
"WINDOWS",
);
Readonly::Hash our %MOBILE_IDS => (
ANDROID => $PARENT_IDS{ANDROID},
IOS => $PARENT_IDS{IOS},
WINDOWS_PHONE => $PARENT_IDS{WINDOWS_PHONE},
BLACKBERRY => $PARENT_IDS{BLACKBERRY},
WATCHOS => 33451,
PHONE_TABLET_WEARABLE => 11,
PALMOS => 204,
WEBOS => 33481,
);
Readonly::Scalar our $HARDWARE_MANUFACTURER_ID => 16861;
=item $FINGERBANK_USER
The OS user for Fingerbank
=cut
Readonly our $FINGERBANK_USER => "fingerbank";
=item $FILE_PERMISSIONS
The octal format of file permissions
=cut
Readonly our $FILE_PERMISSIONS => 0664;
=item $PATH_PERMISSIONS
The octal format of path permissions
=cut
Readonly our $PATH_PERMISSIONS => 0775;
=item $DEFAULT_BACKUP_RETENTION
The amount of backups to keep by default in the file cleanup
=cut
Readonly our $DEFAULT_BACKUP_RETENTION => 5;
=item $DEFAULT_SCORE
The score that is given by default on any match
=cut
Readonly our $DEFAULT_SCORE => 1;
=item $SQLITE_DB_TYPE
=cut
Readonly our $SQLITE_DB_TYPE => "SQLite";
=item $LOCAL_SCHEMA
=cut
Readonly our $LOCAL_SCHEMA => "Local";
=item $UPSTREAM_SCHEMA
=cut
Readonly our $UPSTREAM_SCHEMA => "Upstream";
=item $ALL_SCHEMAS_KW
Keyword to be used as a schema name to represent all the schemas.
=cut
Readonly our $ALL_SCHEMAS_KW => 'All';
=back
=head1 AUTHOR
Inverse inc. <[email protected]>
=head1 COPYRIGHT
Copyright (C) 2005-2016 Inverse inc.
=head1 LICENSE
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
=cut
1;