1Net::Config(3) User Contributed Perl Documentation Net::Config(3)
2
3
4
6 Net::Config - Local configuration data for libnet
7
9 use Net::Config qw(%NetConfig);
10
12 "Net::Config" holds configuration data for the modules in the libnet
13 distribution. During installation you will be asked for these values.
14
15 The configuration data is held globally in a file in the perl
16 installation tree, but a user may override any of these values by
17 providing their own. This can be done by having a ".libnetrc" file in
18 their home directory. This file should return a reference to a HASH
19 containing the keys described below. For example
20
21 # .libnetrc
22 {
23 nntp_hosts => [ "my_preferred_host" ],
24 ph_hosts => [ "my_ph_server" ],
25 }
26 __END__
27
28 Class Methods
29 "Net::Config" defines the following methods. They are methods as they
30 are invoked as class methods. This is because "Net::Config" inherits
31 from "Net::LocalCfg" so you can override these methods if you want.
32
33 requires_firewall($host)
34 Attempts to determine if a given host is outside your firewall.
35 Possible return values are.
36
37 -1 Cannot lookup hostname
38 0 Host is inside firewall (or there is no ftp_firewall entry)
39 1 Host is outside the firewall
40
41 This is done by using hostname lookup and the "local_netmask" entry
42 in the configuration data.
43
44 NetConfig Values
45 nntp_hosts
46 snpp_hosts
47 pop3_hosts
48 smtp_hosts
49 ph_hosts
50 daytime_hosts
51 time_hosts
52 Each is a reference to an array of hostnames (in order of
53 preference), which should be used for the given protocol
54
55 inet_domain
56 Your internet domain name
57
58 ftp_firewall
59 If you have an FTP proxy firewall (NOT an HTTP or SOCKS firewall)
60 then this value should be set to the firewall hostname. If your
61 firewall does not listen to port 21, then this value should be set
62 to "hostname:port" (eg "hostname:99")
63
64 ftp_firewall_type
65 There are many different ftp firewall products available. But
66 unfortunately there is no standard for how to traverse a firewall.
67 The list below shows the sequence of commands that Net::FTP will
68 use
69
70 user Username for remote host
71 pass Password for remote host
72 fwuser Username for firewall
73 fwpass Password for firewall
74 remote.host The hostname of the remote ftp server
75
76 0 There is no firewall
77
78 1
79 USER user@remote.host
80 PASS pass
81
82 2
83 USER fwuser
84 PASS fwpass
85 USER user@remote.host
86 PASS pass
87
88 3
89 USER fwuser
90 PASS fwpass
91 SITE remote.site
92 USER user
93 PASS pass
94
95 4
96 USER fwuser
97 PASS fwpass
98 OPEN remote.site
99 USER user
100 PASS pass
101
102 5
103 USER user@fwuser@remote.site
104 PASS pass@fwpass
105
106 6
107 USER fwuser@remote.site
108 PASS fwpass
109 USER user
110 PASS pass
111
112 7
113 USER user@remote.host
114 PASS pass
115 AUTH fwuser
116 RESP fwpass
117
118 ftp_ext_passive
119 ftp_int_passive
120 FTP servers can work in passive or active mode. Active mode is when
121 you want to transfer data you have to tell the server the address
122 and port to connect to. Passive mode is when the server provide
123 the address and port and you establish the connection.
124
125 With some firewalls active mode does not work as the server cannot
126 connect to your machine (because you are behind a firewall) and the
127 firewall does not re-write the command. In this case you should set
128 "ftp_ext_passive" to a true value.
129
130 Some servers are configured to only work in passive mode. If you
131 have one of these you can force "Net::FTP" to always transfer in
132 passive mode; when not going via a firewall, by setting
133 "ftp_int_passive" to a true value.
134
135 local_netmask
136 A reference to a list of netmask strings in the form
137 "134.99.4.0/24". These are used by the "requires_firewall"
138 function to determine if a given host is inside or outside your
139 firewall.
140
141 The following entries are used during installation & testing on the
142 libnet package
143
144 test_hosts
145 If true then "make test" may attempt to connect to hosts given in
146 the configuration.
147
148 test_exists
149 If true then "Configure" will check each hostname given that it
150 exists
151
153 The following symbols are, or can be, exported by this module:
154
155 Default Exports
156 %NetConfig.
157
158 Optional Exports
159 None.
160
161 Export Tags
162 None.
163
165 None.
166
168 Graham Barr <gbarr@pobox.com <mailto:gbarr@pobox.com>>.
169
170 Steve Hay <shay@cpan.org <mailto:shay@cpan.org>> is now maintaining
171 libnet as of version 1.22_02.
172
174 Copyright (C) 2000 Graham Barr. All rights reserved.
175
176 Copyright (C) 2013-2014, 2016, 2020 Steve Hay. All rights reserved.
177
179 This module is free software; you can redistribute it and/or modify it
180 under the same terms as Perl itself, i.e. under the terms of either the
181 GNU General Public License or the Artistic License, as specified in the
182 LICENCE file.
183
185 Version 3.15
186
188 20 March 2023
189
191 See the Changes file.
192
193
194
195perl v5.36.0 2023-03-21 Net::Config(3)