line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Faker::Internet; |
2
|
2
|
|
|
2
|
|
12786
|
use vars qw($VERSION); $VERSION = '0.10_04'; |
|
2
|
|
|
2
|
|
2
|
|
|
2
|
|
|
1
|
|
115
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
85
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
38
|
|
3
|
2
|
|
|
2
|
|
8
|
use base 'Data::Faker'; |
|
2
|
|
|
2
|
|
2
|
|
|
2
|
|
|
1
|
|
380
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
56
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
4
|
2
|
|
|
2
|
|
738
|
use Data::Faker::Company; |
|
2
|
|
|
2
|
|
4
|
|
|
2
|
|
|
1
|
|
11
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
5
|
2
|
|
|
2
|
|
10
|
use Data::Faker::Name; |
|
2
|
|
|
2
|
|
2
|
|
|
2
|
|
|
1
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
3
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Data::Faker::Internet - Data::Faker plugin |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS AND USAGE |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
See L |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DATA PROVIDERS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=over 4 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=item email |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Return a fake email address. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
26
|
|
|
|
|
|
|
'email' => [qw($username@$domain_name)], |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item username |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Return a fake username. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=cut |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
36
|
|
|
|
|
|
|
'username' => sub { |
37
|
|
|
|
|
|
|
my $self = shift; |
38
|
|
|
|
|
|
|
my $name = lc($self->first_name); |
39
|
|
|
|
|
|
|
$name =~ s/\W//g; |
40
|
|
|
|
|
|
|
return $name; |
41
|
|
|
|
|
|
|
}, |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=item hostname |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Return a fake computer hostname. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
51
|
|
|
|
|
|
|
'hostname' => [qw($domain_word.$domain_name)], |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item server_name |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Return a fake server name (some service name such as mail, dns, etc, prepended |
57
|
|
|
|
|
|
|
to a fake domain name.) |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
62
|
|
|
|
|
|
|
'server_name' => [ |
63
|
|
|
|
|
|
|
'$network_service.$domain_name', |
64
|
|
|
|
|
|
|
'$network_service-###.$domain_name', |
65
|
|
|
|
|
|
|
], |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item network_service |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Return a random network service name. Only fairly common services are included. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
75
|
|
|
|
|
|
|
network_service => [qw( |
76
|
|
|
|
|
|
|
ftp ssh telnet shell smtp mail time ns dns tacacs bootp dhcp www |
77
|
|
|
|
|
|
|
kerberos pop pop2 pop3 imap nfs ntp imap imap2 snmp irc imap3 https |
78
|
|
|
|
|
|
|
snpp isakmp ipp printer fileserver logs log loghost syslog news |
79
|
|
|
|
|
|
|
nntp ldap ldaps socks vpn sql db radius cvs svn xmpp x11 backup |
80
|
|
|
|
|
|
|
)], |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item domain_name |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Return a fake domain_name. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
90
|
|
|
|
|
|
|
'domain_name' => [qw($domain_word.$domain_suffix)], |
91
|
|
|
|
|
|
|
); |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item domain_word |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Return a random word that meets the requirements for being part of a domain |
96
|
|
|
|
|
|
|
name. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
101
|
|
|
|
|
|
|
'domain_word' => sub { |
102
|
|
|
|
|
|
|
my $self = shift; |
103
|
|
|
|
|
|
|
my $company = lc($self->company); |
104
|
|
|
|
|
|
|
$company =~ s/'//g; |
105
|
|
|
|
|
|
|
$company =~ s/\W+/-/g; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
return $company; |
108
|
|
|
|
|
|
|
}, |
109
|
|
|
|
|
|
|
); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item domain_suffix |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Return a random domain suffix (.com, .net, .co.uk. etc) |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
118
|
|
|
|
|
|
|
'domain_suffix' => [qw( |
119
|
|
|
|
|
|
|
ac ac.uk ad ae af ag ai al am an ao aq ar as at au aw az ba bb bd be |
120
|
|
|
|
|
|
|
bf bg bh bi bj bm bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck |
121
|
|
|
|
|
|
|
cl cm cn co co.uk com cr cs cu cv cx cy cz de dj dk dm do dz ec edu ee |
122
|
|
|
|
|
|
|
eg eh er es et fi fj fk fm fo fr ga gd ge gf gg gh gi gl gm gn gov gp |
123
|
|
|
|
|
|
|
gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il im in int io iq ir is |
124
|
|
|
|
|
|
|
it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc li lk lr ls |
125
|
|
|
|
|
|
|
lt lu lv ly ma mc md mg mh mil mk ml mm mn mo mp mq mr ms mt mu mv mw |
126
|
|
|
|
|
|
|
mx my mz na nc ne net nf ng ni nl no np nr nt nu nz om org pa pe pf pg |
127
|
|
|
|
|
|
|
ph pk pl pm pn pr ps pt pw py qa re ro ru rw sa sb sc sd se sg sh si sj |
128
|
|
|
|
|
|
|
sk sl sm sn so sr sv st sy sz tc td tf tg th tj tk tm tn to tp tr tt tv |
129
|
|
|
|
|
|
|
tw tz ua ug uk um us uy uz va vc ve vg vi vn vu wf ws ye yt yu za zm zw |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
aero biz coop info museum name pro |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
al.us ak.us az.us ar.us ca.us co.us ct.us de.us dc.us fl.us ga.us hi.us |
134
|
|
|
|
|
|
|
id.us il.us in.us ia.us ks.us ky.us la.us me.us md.us ma.us mi.us mn.us |
135
|
|
|
|
|
|
|
ms.us mo.us mt.us ne.us nv.us nh.us nj.us nm.us ny.us nc.us nd.us oh.us |
136
|
|
|
|
|
|
|
ok.us or.us pa.us ri.us sc.us sd.us tn.us tx.us ut.us vt.us va.us wa.us |
137
|
|
|
|
|
|
|
wv.us wi.us wy.us |
138
|
|
|
|
|
|
|
)], |
139
|
|
|
|
|
|
|
); |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=item ip_address |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Return a random IP Address. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
__PACKAGE__->register_plugin( |
148
|
|
|
|
|
|
|
'ip_address' => sub { |
149
|
|
|
|
|
|
|
my @n = (1 .. 254); |
150
|
|
|
|
|
|
|
return join('.',@n[rand(@n),rand(@n),rand(@n),rand(@n)]); |
151
|
|
|
|
|
|
|
}, |
152
|
|
|
|
|
|
|
); |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=back |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 SEE ALSO |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
L |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 AUTHOR |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Jason Kohles, Eemail@jasonkohles.comE |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Copyright 2004-2005 by Jason Kohles |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
169
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=cut |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
1; |