Sys-HostIP-2.000/0000775000175000017500000000000013066201576013053 5ustar sawyersawyerSys-HostIP-2.000/t/0000775000175000017500000000000013066201576013316 5ustar sawyersawyerSys-HostIP-2.000/t/ipconfig.t0000644000175000017500000000473113066201576015304 0ustar sawyersawyeruse strict; use warnings; use Test::More tests => 2 * 10; use File::Spec; use Sys::HostIP; my $hostip = Sys::HostIP->new; sub mock_run_ipconfig { my $filename = shift; my $file = File::Spec->catfile( 't', 'data', $filename ); open my $fh, '<', $file or die "Error opening $file: $!\n"; my @output = <$fh>; close $fh or die "Error closing $file: $!\n"; return @output; } sub mock_and_test { my ( $file, $expected_results, $test_name ) = @_; no warnings qw/redefine once/; *Sys::HostIP::_run_ipconfig = sub { my $self = shift; isa_ok( $self, 'Sys::HostIP' ); return mock_run_ipconfig($file); }; is_deeply( $hostip->_get_win32_interface_info, $expected_results, $test_name, ); } mock_and_test( 'ipconfig-2k.txt', { 'Local Area Connection' => '169.254.109.232' }, 'Correct Win2K interface', ); mock_and_test( 'ipconfig-xp.txt', { 'Local Area Connection' => '0.0.0.0' }, 'Correct WinXP interface', ); mock_and_test( 'ipconfig-win7.txt', { 'Local Area Connection' => '192.168.0.10', 'Local Area Connection 2' => '192.168.1.20', }, 'Correct Win7 interface', ); mock_and_test( 'ipconfig-win7-empty-name.txt', { '' => '192.168.1.101', }, 'Win7 interface, empty name', ); mock_and_test( 'ipconfig-win10.txt', { 'Ethernet' => '192.168.1.100', }, 'Correct Win10 interface', ); mock_and_test( 'ipconfig-win2008-sv_SE.txt', { 'Anslutning till lokalt n�tverk' => '192.168.40.241', }, 'Correct Windows Server 2008 interface in Swedish locale', ); mock_and_test( 'ipconfig-win7-de_DE.txt', { 'LAN-Verbindung' => '10.0.2.15', }, 'Correct Windows 7 interface in German locale', ); mock_and_test( 'ipconfig-win7-fr_FR.txt', { 'LAN-Verbindung' => '192.168.2.118', 'VirtualBox Host-Only Network' => '192.168.56.1', }, 'Correct Windows 7 interface in French locale', ); mock_and_test( 'ipconfig-win7-it_IT.txt', { 'LAN-Verbindung' => '192.168.2.118', 'VirtualBox Host-Only Network' => '192.168.56.1', }, 'Correct Windows 7 interface in Italian locale', ); mock_and_test( 'ipconfig-win7-fi_FI.txt', { 'LAN-Verbindung' => '192.168.2.118', 'VirtualBox Host-Only Network' => '192.168.56.1', }, 'Correct Windows 7 interface in Finnish locale', ); Sys-HostIP-2.000/t/00-compile.t0000644000175000017500000000263213066201576015351 0ustar sawyersawyeruse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Sys/HostIP.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Sys-HostIP-2.000/t/author-pod-syntax.t0000644000175000017500000000045413066201576017112 0ustar sawyersawyer#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Sys-HostIP-2.000/t/base.t0000644000175000017500000000150313066201576014412 0ustar sawyersawyer#!perl use strict; use warnings; use Test::More tests => 6; use Sys::HostIP qw/ip ips ifconfig interfaces/; use Data::Dumper; my $hostip = Sys::HostIP->new; # -- ip() -- my $sub_ip = ip(); my $class_ip = $hostip->ip; diag("Class IP: $class_ip"); ok( $class_ip =~ /^ \d+ (?: \. \d+ ){3} $/x, 'IP by class looks ok' ); is( $class_ip, $sub_ip, 'IP by class matches IP by sub' ); # -- ips() -- my $class_ips = $hostip->ips; isa_ok( $class_ips, 'ARRAY', 'scalar context ips() gets arrayref' ); ok( 1 == grep( /^$class_ip$/, @{$class_ips} ), 'Found IP in IPs by class' ); # -- interfaces() -- my $interfaces = $hostip->interfaces; isa_ok( $interfaces, 'HASH', 'scalar context interfaces gets hashref' ); cmp_ok( scalar keys ( %{$interfaces} ), '==', scalar @{$class_ips}, 'Matching number of interfaces and ips', ); Sys-HostIP-2.000/t/ifconfig.t0000644000175000017500000000124413066201576015266 0ustar sawyersawyeruse strict; use warnings; use Test::More; use Sys::HostIP; plan tests => $^O =~ qr/(MSWin32|cygwin)/ ? 5 : 7; { no warnings 'redefine'; *Sys::HostIP::_get_ifconfig_binary = sub { my $object = shift; isa_ok( $object, 'Sys::HostIP' ); cmp_ok( @_, '==', 0, 'Got no parameters' ); return 'test'; }; *Sys::HostIP::_get_interface_info = sub {}; } is( Sys::HostIP->ifconfig, 'test', 'ifconfig without object' ); my $object = Sys::HostIP->new; is( $object->ifconfig('my_path'), 'my_path', 'ifconfig with object and param' ); $object->{'ifconfig'} = 'my_ifconfig'; is( $object->ifconfig, 'my_ifconfig', 'ifconfig without path'); Sys-HostIP-2.000/t/release-distmeta.t0000644000175000017500000000040113066201576016724 0ustar sawyersawyer#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { print qq{1..0 # SKIP these tests are for release candidate testing\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Sys-HostIP-2.000/t/data/0000775000175000017500000000000013066201576014227 5ustar sawyersawyerSys-HostIP-2.000/t/data/ipconfig-win7-fi_FI.txt0000755000175000017500000000273013066201576020425 0ustar sawyersawyer Windows IP-määritykset Ethernet-sovitin LAN-Verbindung: Yhteyskohtainen DNS-liite . . . . : S_W_3V_1_3_0 IPv6-osoite . . . . . . . . . . . : 2003:e7:93ce:2801:71f4:f151:8100:f395 Tilapäinen IPv6-osoite. . . . . . : 2003:e7:93ce:2801:2d03:317f:1567:19ee Linkin paikallinen IPv6-osoite. . : fe80::71f4:f151:8100:f395%11 IPv4-osoite . . . . . . . . . . . : 192.168.2.118 Aliverkon peite . . . . . . . . . : 255.255.255.0 Oletusyhdyskäytävä. . . . . . . . : fe80::1%11 192.168.2.1 Ethernet-sovitin VirtualBox Host-Only Network: Yhteyskohtainen DNS-liite . . . . : Linkin paikallinen IPv6-osoite. . : fe80::a8fa:b31b:672b:b415%14 IPv4-osoite . . . . . . . . . . . : 192.168.56.1 Aliverkon peite . . . . . . . . . : 255.255.255.0 Oletusyhdyskäytävä. . . . . . . . : Tunnelisovitin isatap.S_W_3V_1_3_0: Laitteen tila . . . . . . . . . . : Ei kytketty Yhteyskohtainen DNS-liite . . . . : S_W_3V_1_3_0 Tunnelisovitin LAN-Verbindung* 3: Yhteyskohtainen DNS-liite . . . . : IPv6-osoite . . . . . . . . . . . : 2001:0:9d38:78cf:c02:3711:a4ee:a12d Linkin paikallinen IPv6-osoite. . : fe80::c02:3711:a4ee:a12d%13 Oletusyhdyskäytävä. . . . . . . . : Tunnelisovitin isatap.{2F276BC5-ADC1-4179-BFB7-161CEA6B8A27}: Laitteen tila . . . . . . . . . . : Ei kytketty Yhteyskohtainen DNS-liite . . . . : Sys-HostIP-2.000/t/data/ipconfig-2k.txt0000644000175000017500000000041413066201576017075 0ustar sawyersawyer Windows 2000 IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Autoconfiguration IP Address. . . : 169.254.109.232 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : Sys-HostIP-2.000/t/data/ipconfig-xp.txt0000644000175000017500000000043313066201576017211 0ustar sawyersawyer Windows IP Configuration Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 0.0.0.0 Subnet Mask . . . . . . . . . . . : 0.0.0.0 Default Gateway . . . . . . . . . : Sys-HostIP-2.000/t/data/ipconfig-win10.txt0000644000175000017500000000073113066201576017521 0ustar sawyersawyer Windows IP Configuration Ethernet adapter Ethernet 2: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Ethernet adapter Ethernet: Connection-specific DNS Suffix . : example.org Link-local IPv6 Address . . . . . : fe80::2927:d4e6:18b4:432%2 IPv4 Address. . . . . . . . . . . : 192.168.1.100 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : 192.168.1.1 Sys-HostIP-2.000/t/data/ipconfig-win7-empty-name.txt0000644000175000017500000000161213066201576021520 0ustar sawyersawyer Windows IP Configuration Ethernet adapter Local Area Connection 3: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::1d6c:95:b3d7:8b4c%20 Default Gateway . . . . . . . . . : Ethernet adapter : Connection-specific DNS Suffix . : example.org Link-local IPv6 Address . . . . . : fe80::9437:94dc:5211:414c%16 IPv4 Address. . . . . . . . . . . : 192.168.1.101 Subnet Mask . . . . . . . . . . . : 255.255.0.0 Default Gateway . . . . . . . . . : 192.168.1.1 Tunnel adapter isatap.{1212A406-F319-4841-B7DC-7B919C7BE3D9}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.example.org: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : example.org Sys-HostIP-2.000/t/data/ipconfig-win7.txt0000644000175000017500000000172713066201576017455 0ustar sawyersawyer Windows IP Configuration Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::2cd0:c94d:1cc9:4b3d%13 IPv4 Address. . . . . . . . . . . : 192.168.1.20 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::c18b:8f1d:2e1c:6d2a%11 IPv4 Address. . . . . . . . . . . : 192.168.0.10 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : Tunnel adapter isatap.{91888E9E-F0EA-4089-AF7D-AC0D2589F38B}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{81903339-BEA3-459E-BC3D-F426BF766FCE}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Sys-HostIP-2.000/t/data/ipconfig-win7-fr_FR.txt0000644000175000017500000000301113066201576020435 0ustar sawyersawyer Configuration IP de Windows Carte Ethernet LAN-Verbindung : Suffixe DNS propre à la connexion. . . : S_W_23V_1_3_0 Adresse IPv6. . . . . . . . . . . . . .: 2003:e7:93ce:2801:71f4:f151:8100:f395 Adresse IPv6 temporaire . . . . . . . .: 2003:e7:93ce:2801:8dd:1829:d3ce:9915 Adresse IPv6 de liaison locale. . . . .: fe80::71f4:f151:8100:f395%11 Adresse IPv4. . . . . . . . . . . . . .: 192.168.2.118 Masque de sous-réseau. . . . . . . . . : 255.255.255.0 Passerelle par défaut. . . . . . . . . : fe80::1%11 192.168.2.1 Carte Ethernet VirtualBox Host-Only Network : Suffixe DNS propre à la connexion. . . : Adresse IPv6 de liaison locale. . . . .: fe80::a8fa:b31b:672b:b415%14 Adresse IPv4. . . . . . . . . . . . . .: 192.168.56.1 Masque de sous-réseau. . . . . . . . . : 255.255.255.0 Passerelle par défaut. . . . . . . . . : Carte Tunnel isatap.S_W_23V_1_3_0 : Statut du média. . . . . . . . . . . . : Média déconnecté Suffixe DNS propre à la connexion. . . : S_W_23V_1_3_0 Carte Tunnel LAN-Verbindung* 3 : Suffixe DNS propre à la connexion. . . : Adresse IPv6. . . . . . . . . . . . . .: 2001:0:9d38:78cf:c02:3711:a4ee:a12d Adresse IPv6 de liaison locale. . . . .: fe80::c02:3711:a4ee:a12d%13 Passerelle par défaut. . . . . . . . . : Carte Tunnel isatap.{2F276BC5-ADC1-4179-BFB7-161CEA6B8A27} : Statut du média. . . . . . . . . . . . : Média déconnecté Suffixe DNS propre à la connexion. . . : Sys-HostIP-2.000/t/data/ipconfig-win2008-sv_SE.txt0000644000175000017500000000126113066201576020706 0ustar sawyersawyer IP-konfiguration f�r Windows Ethernet-anslutning Anslutning till lokalt n�tverk: Anslutningsspecifika DNS-suffix . : L�nklokal IPv6-adress . . . . . . : ff88::b6fa:c6e1:9a9a:9114%10 IPv4-adress . . . . . . . . . . . : 192.168.40.241 N�tmask . . . . . . . . . . . . . : 255.255.255.0 Standard-gateway. . . . . . . . . : 192.168.40.1 Tunnelanslutning: Anslutning till lokalt n�tverk*: Tillst�nd . . . . . . . . . . . . : Fr�nkopplad Anslutningsspecifika DNS-suffix . : Tunnelanslutning: Anslutning till lokalt n�tverk* 8: Tillst�nd . . . . . . . . . . . . : Fr�nkopplad Anslutningsspecifika DNS-suffix . : Sys-HostIP-2.000/t/data/ipconfig-win7-de_DE.txt0000644000175000017500000000136313066201576020407 0ustar sawyersawyer Windows-IP-Konfiguration Ethernet-Adapter LAN-Verbindung: Verbindungsspezifisches DNS-Suffix: Verbindungslokale IPv6-Adresse . : fe80::417a:e1a3:e92e:76f2%11 IPv4-Adresse . . . . . . . . . . : 10.0.2.15 Subnetzmaske . . . . . . . . . . : 255.255.255.0 Standardgateway . . . . . . . . . : 10.0.2.2 Tunneladapter isatap.{3505548F-914A-4E9F-B2A8-C05189D0D45C}: Medienstatus. . . . . . . . . . . : Medium getrennt Verbindungsspezifisches DNS-Suffix: Tunneladapter LAN-Verbindung*: Verbindungsspezifisches DNS-Suffix: IPv6-Adresse. . . . . . . . . . . : 2001:0:9d38:78cf:c3f:89fb:af44:9349 Verbindungslokale IPv6-Adresse . : fe80::c3f:89fb:af44:9349%13 Standardgateway . . . . . . . . . : :: Sys-HostIP-2.000/t/data/ipconfig-win7-it_IT.txt0000755000175000017500000000310313066201576020454 0ustar sawyersawyer Configurazione IP di Windows Scheda Ethernet LAN-Verbindung: Suffisso DNS specifico per connessione: S_W_3V_1_3_0 Indirizzo IPv6 . . . . . . . . . . . . . . . . . : 2003:e7:93ce:2801:71f4:f151:8100:f395 Indirizzo IPv6 temporaneo. . . . . . . . . . . . : 2003:e7:93ce:2801:dd3:a13a:4d7b:9b35 Indirizzo IPv6 locale rispetto al collegamento . : fe80::71f4:f151:8100:f395%11 Indirizzo IPv4. . . . . . . . . . . . : 192.168.2.118 Subnet mask . . . . . . . . . . . . . : 255.255.255.0 Gateway predefinito . . . . . . . . . : fe80::1%11 192.168.2.1 Scheda Ethernet VirtualBox Host-Only Network: Suffisso DNS specifico per connessione: Indirizzo IPv6 locale rispetto al collegamento . : fe80::a8fa:b31b:672b:b415%14 Indirizzo IPv4. . . . . . . . . . . . : 192.168.56.1 Subnet mask . . . . . . . . . . . . . : 255.255.255.0 Gateway predefinito . . . . . . . . . : Scheda Tunnel isatap.S_W_3V_1_3_0: Stato supporto. . . . . . . . . . . . : Supporto disconnesso Suffisso DNS specifico per connessione: S_W_3V_1_3_0 Scheda Tunnel LAN-Verbindung* 3: Suffisso DNS specifico per connessione: Indirizzo IPv6 . . . . . . . . . . . . . . . . . : 2001:0:9d38:78cf:c02:3711: a4ee:a12d Indirizzo IPv6 locale rispetto al collegamento . : fe80::c02:3711:a4ee:a12d%1 3 Gateway predefinito . . . . . . . . . : Scheda Tunnel isatap.{2F276BC5-ADC1-4179-BFB7-161CEA6B8A27}: Stato supporto. . . . . . . . . . . . : Supporto disconnesso Suffisso DNS specifico per connessione: Sys-HostIP-2.000/README0000644000175000017500000000057013066201576013733 0ustar sawyersawyer This archive contains the distribution Sys-HostIP, version 2.000: Try extra hard to get IP address related info This software is copyright (c) 2017 by Sawyer X. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.008. Sys-HostIP-2.000/LICENSE0000644000175000017500000004364113066201576014066 0ustar sawyersawyerThis software is copyright (c) 2017 by Sawyer X. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2017 by Sawyer X. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 1, 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2017 by Sawyer X. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Sys-HostIP-2.000/lib/0000775000175000017500000000000013066201576013621 5ustar sawyersawyerSys-HostIP-2.000/lib/Sys/0000775000175000017500000000000013066201576014377 5ustar sawyersawyerSys-HostIP-2.000/lib/Sys/HostIP.pm0000644000175000017500000002616113066201576016107 0ustar sawyersawyeruse strict; use warnings; package Sys::HostIP; # ABSTRACT: Try extra hard to get IP address related info $Sys::HostIP::VERSION = '2.000'; use Carp; use Exporter; use File::Basename 'dirname'; use vars qw( @ISA @EXPORT_OK ); @ISA = qw(Exporter); @EXPORT_OK = qw( ip ips interfaces ifconfig ); my $is_win = $^O =~ qr/(MSWin32|cygwin)/; sub new { my $class = shift || croak 'Cannot create new method in a functional way'; my %opts = @_; my $self = bless {%opts}, $class; # only get ifconfig binary if it's not a windows $self->{'ifconfig'} ||= $is_win ? '' : $self->_get_ifconfig_binary; $self->{'if_info'} ||= $self->_get_interface_info; return $self; } sub ifconfig { my $self = shift; my $path = shift; if ( ! ref $self ) { return $self->_get_ifconfig_binary; } # set path $path and $self->{'ifconfig'} = $path; return $self->{'ifconfig'}; } sub ip { my $self = shift || 'Sys::HostIP'; my $if_info; if ( ! ref $self ) { $if_info = $self->_get_interface_info; } else { $if_info = $self->if_info; } if ($is_win) { foreach my $key ( sort keys %{$if_info} ) { # should this be the default? if ( $key =~ /Local Area Connection/ ) { return ( $if_info->{$key} ); } } } else { my $lo_found; foreach my $key ( sort keys %{$if_info} ) { # we don't want the loopback if ( $if_info->{$key} eq '127.0.0.1' ) { $lo_found++; next; } # now we return the first one that comes up return ( $if_info->{$key} ); } # we get here if loopback is the only active device $lo_found and return '127.0.0.1'; return; } } sub ips { my $self = shift || 'Sys::HostIP'; if ( ! ref $self ) { return [ values %{ $self->_get_interface_info } ]; } return [ values %{ $self->if_info } ]; } sub interfaces { my $self = shift || 'Sys::HostIP'; if ( ! ref $self ) { return $self->_get_interface_info; } return $self->if_info; } sub if_info { my $self = shift; if ( ! ref $self ) { return $self->_get_ifconfig_binary; } return $self->{'if_info'}; } sub _get_ifconfig_binary { my $self = shift; my $ifconfig = '/sbin/ifconfig -a'; if ( $^O =~ /(?: linux|openbsd|freebsd|netbsd|solaris|darwin )/xi ) { $ifconfig = '/sbin/ifconfig -a'; } elsif ( $^O eq 'aix' ) { $ifconfig = '/usr/sbin/ifconfig -a'; } elsif ( $^O eq 'irix' ) { $ifconfig = '/usr/etc/ifconfig'; } elsif ( $^O eq 'dec_osf' ) { $ifconfig = '/sbin/ifconfig'; } else { carp "Unknown system ($^O), guessing ifconfig is in /sbin/ifconfig " . "(email xsawyerx\@cpan.org with the location of your ifconfig)\n"; } return $ifconfig; } sub _get_interface_info { my $self = shift; my $if_info = $is_win ? $self->_get_win32_interface_info() : $self->_get_unix_interface_info(); } sub _clean_ifconfig_env { my $self = shift; # this is an attempt to fix tainting problems # removing $BASH_ENV, which exists if /bin/sh is your bash delete $ENV{'BASH_ENV'}; # now we set the local $ENV{'PATH'} to be only the path to ifconfig my $ifconfig = $self->ifconfig; $ENV{'PATH'} = dirname $ifconfig; return $ifconfig; } sub _get_unix_interface_info { my $self = shift; # localize the environment local %ENV; # make sure nothing else has touched $/ local $/ = "\n"; my ( $ip, $interface, %if_info ); # clean environment for taint mode my $ifconfig_bin = $self->_clean_ifconfig_env(); my @ifconfig = `$ifconfig_bin`; foreach my $line (@ifconfig) { # TODO: refactor this into tests # output from 'ifconfig -a' looks something like this on every *nix i # could get my hand on except linux (this one's actually from OpenBSD): # # gershiwin:~# /sbin/ifconfig -a # lo0: flags=8009 # inet 127.0.0.1 netmask 0xff000000 # lo1: flags=8008 # xl0: flags=8843 # media: Ethernet autoselect (100baseTX full-duplex) # status: active # inet 10.0.0.2 netmask 0xfffffff0 broadcast 10.0.0.255 # sl0: flags=c010 # sl1: flags=c010 # # in linux it's a little bit different: # # [jschatz@nooky Sys-IP]$ /sbin/ifconfig # eth0 Link encap:Ethernet HWaddr 00:C0:4F:60:6F:C2 # inet addr:10.0.3.82 Bcast:10.0.255.255 Mask:255.255.0.0 # UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 # Interrupt:19 Base address:0xec00 # lo Link encap:Local Loopback # inet addr:127.0.0.1 Mask:255.0.0.0 # UP LOOPBACK RUNNING MTU:3924 Metric:1 # # so the regexen involved here have to deal with the following: 1) # there's no ':' after an interface's name in linux 2) in linux, it's # "inet addr:127.0.0.1" instead of "inet 127.0.0.1" hence the somewhat # hairy regexen /(^\w+(?:\d)?(?:\:\d)?)/ (which also handles aliased ip # addresses , ie eth0:1) and /inet(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/ # # so we parse through the list returned. if the line starts with some # letters followed (possibly) by an number and a colon, then we've got an # interface. if the line starts with a space, then it's the info from the # interface that we just found, and we stick the contents into %if_info if ( ($line =~/^\s+/) && ($interface) ) { $if_info{$interface} .= $line; } # FIXME: refactor this regex elsif (($interface) = ($line =~/(^\w+(?:\d)?(?:\.\d+)?(?:\:\d+)?)/)) { $line =~s/\w+\d(\:)?\s+//; $if_info{$interface} = $line; } } foreach my $key (keys %if_info) { # now we want to get rid of all the other crap in the ifconfig # output. we just want the ip address. perhaps a future version can # return even more useful results (netmask, etc)..... if (my ($ip) = ($if_info{$key} =~/inet (?:addr\:)?(\d+(?:\.\d+){3})/)) { $if_info{$key} = $ip; } else { # ok, no ip address here, which means this interface isn't # active. some os's (openbsd for instance) spit out ifconfig info for # inactive devices. this is pretty much worthless for us, so we # delete it from the hash delete $if_info{$key}; } } # now we do some cleanup by deleting keys that have no associated info # (some os's like openbsd list inactive interfaces when 'ifconfig -a' is # used, and we don't care about those return \%if_info; } sub _run_ipconfig { return `ipconfig`; } sub _get_win32_interface_info { my $self = shift; my %regexes = ( address => qr/ \s+ IP(?:v4)? .*? : \s+ (\d+ (?: \. \d+ ){3} ) /x, adapter => qr/ ^ (?:Ethernet(?:\s?|-)\w+|\w+\s+Ethernet) \s+ (.*) : /x, ); my @ipconfig = $self->_run_ipconfig(); my ( $interface, %if_info ); foreach my $line (@ipconfig) { chomp($line); if ( $line =~ /Windows/ ) { # ignore the header next; } elsif ( $line =~/^\s$/ ) { next; } elsif ( ( $line =~ $regexes{'address'} ) and defined $interface ) { $if_info{$interface} = $1; $interface = undef; } elsif ( $line =~ $regexes{'adapter'} ) { $interface = $1; chomp $interface; $interface =~ s/\s+$//g; # remove trailing whitespace, if any } } return \%if_info; } 1; __END__ =head1 NAME Sys::HostIP - Try extra hard to get IP address related info =head1 SYNOPSIS use Sys::HostIP; my $hostip = Sys::HostIP->new; my $ips = $hostip->ips; my $interfaces = $hostip->interfaces; =head1 DESCRIPTION Sys::HostIP does what it can to determine the ip address of your machine. All 3 methods work fine on every system that I've been able to test on. (Irix, OpenBSD, FreeBSD, NetBSD, Solaris, Linux, OSX, Win32, Cygwin). It does this by parsing ifconfig(8) (ipconfig on Win32/Cygwin) output. It has an object oriented interface and a functional one for compatibility with older versions. =head1 ATTRIBUTES =head2 ifconfig my $hostip = Sys::HostIP->new( ifconfig => '/path/to/your/ifconfig' ); You can set the location of ifconfig with this attribute if the code doesn't know where your ifconfig lives. If you use the object oriented interface, this value is cached. =head2 if_info The interface information. This is either created on new, or you can create it yourself at initialize. # get the cached if_info my $if_info = $hostip->if_info; # create custom one at initialize my $hostip = Sys::HostIP->new( if_info => {...} ); =head1 METHODS =head2 ip my $ip = $hostip->ip; Returns a scalar containing a best guess of your host machine's IP address. On *nix (Unix, BSD, GNU/Linux, OSX, etc.) systems, it will return the loopback interface (127.0.0.1) if it can't find anything else. =head2 ips my $all_ips = $hostip->ips; foreach my $ip ( @{$all_ips} ) { print "IP: $ip\n"; } Returns an array ref containing all the IP addresses of your machine. =head2 interfaces my $interfaces = $hostip->interfaces; foreach my $interface ( keys %{$interfaces} ) { my $ip = $interfaces->{$interface}; print "$interface => $ip\n"; } Returns a hash ref containing all pairs of interfaces and their corresponding IP addresses Sys::HostIP could find on your machine. =head2 EXPORT Nothing by default! To export something explicitly, use the syntax: Nothing. use HostIP qw/ip ips interfaces/; # that will get you those three subroutines, for example All of these subroutines will match the object oriented interface methods. =over 4 =item * ip my $ip = ip(); =item * ips my $ips = ips(); =item * interfaces my $interfaces = interfaces(); =back =head1 HISTORY Originally written by Jonathan Schatz . Currently maintained by Sawyer X . =head1 TODO I haven't tested the win32 code with dialup or wireless connections. Machines with output in some languages other than English fail. Neverthless, the code has been shown to work in German, Swedish, French, Italian, and Finnish locales. =head1 COPYRIGHT AND LICENSE Copyright (C) prior to 2010, Jonathan Schatz . Copyright (C) 2010-2017, Sawyer X . This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO =over 4 =item * ifconfig(8) =item * ipconfig =back Sys-HostIP-2.000/MANIFEST0000644000175000017500000000104213066201576014177 0ustar sawyersawyer# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README lib/Sys/HostIP.pm t/00-compile.t t/author-pod-syntax.t t/base.t t/data/ipconfig-2k.txt t/data/ipconfig-win10.txt t/data/ipconfig-win2008-sv_SE.txt t/data/ipconfig-win7-de_DE.txt t/data/ipconfig-win7-empty-name.txt t/data/ipconfig-win7-fi_FI.txt t/data/ipconfig-win7-fr_FR.txt t/data/ipconfig-win7-it_IT.txt t/data/ipconfig-win7.txt t/data/ipconfig-xp.txt t/ifconfig.t t/ipconfig.t t/release-distmeta.t Sys-HostIP-2.000/META.yml0000644000175000017500000000162713066201576014330 0ustar sawyersawyer--- abstract: 'Try extra hard to get IP address related info' author: - 'Sawyer X ' - 'Jonathan Schatz ' build_requires: Data::Dumper: '0' File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::CPAN::Meta: '0' Test::More: '0' Test::Pod: '0' configure_requires: ExtUtils::MakeMaker: '7.1101' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Sys-HostIP provides: Sys::HostIP: file: lib/Sys/HostIP.pm version: '2.000' requires: Carp: '0' Exporter: '0' File::Basename: '0' perl: '5.006' resources: bugtracker: https://github.com/xsawyerx/sys-hostip/issues repository: git://github.com/xsawyerx/sys-hostip.git version: '2.000' x_serialization_backend: 'YAML::Tiny version 1.69' Sys-HostIP-2.000/META.json0000644000175000017500000000332113066201576014471 0ustar sawyersawyer{ "abstract" : "Try extra hard to get IP address related info", "author" : [ "Sawyer X ", "Jonathan Schatz " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Sys-HostIP", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "7.1101" } }, "develop" : { "requires" : { "Test::CPAN::Meta" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Carp" : "0", "Exporter" : "0", "File::Basename" : "0", "perl" : "5.006" } }, "test" : { "requires" : { "Data::Dumper" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::CPAN::Meta" : "0", "Test::More" : "0", "Test::Pod" : "0" } } }, "provides" : { "Sys::HostIP" : { "file" : "lib/Sys/HostIP.pm", "version" : "2.000" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/xsawyerx/sys-hostip/issues" }, "repository" : { "type" : "git", "url" : "git://github.com/xsawyerx/sys-hostip.git", "web" : "https://github.com/xsawyerx/sys-hostip" } }, "version" : "2.000", "x_serialization_backend" : "JSON::XS version 3.03" } Sys-HostIP-2.000/Changes0000644000175000017500000001007213066201576014344 0ustar sawyersawyerRevision history for Perl extension Sys::HostIP. 2.000 2017-03-27 14:20:12+02:00 Europe/Amsterdam * Fix Windows 7 Finish, Italian, French, German. (Paul Cochrane) * Fix Swedish. (Paul Cochrane) 1.99 2017-03-22 13:52:36+01:00 Europe/Amsterdam * Restore missing NAME section. (Nick Morrott) * Add Travis-CI. (Paul Cochrane) * Cleanup whitespace. (Paul Cochrane) * Minimum Perl version (5.6). (Paul Cochrane) * Add missing build prereqs. (Paul Cochrane) * Add copyright and license info to docs and README. (Paul Cochrane) 1.98 2016-08-27 08:56:19+02:00 Europe/Amsterdam * Accept empty interfaces names on Windows. (Hilko Bengen) * Add Windows 10 test (en-US). (Hilko Bengen) 1.97 03.02.13 * Adding support for Tru64 UNIX. (Thank you, Robert Urban!) 1.96 25.10.12 * No functional changes. * RT #80399: doc typo by Peter Newman. 1.95 23.02.12 * Trying to please testers more. (I'm looking at you, Chris!) 1.94 18.02.12 * Don't return 127.0.0.1 as default device if it wasn't really found. (tests have verified some machines don't have it) 1.93 14.02.12 * GH #4: Matthew Musgrove (Mr. Muskrat) unearthed a bug in tests that would plan an incorrect number of tests by operating system. Fixed. 1.92 14.02.12 * GH #3, RT #74701: Doc fix by Mr. Muskrat. * Dump some data in tests to try and fix failing tests. 1.91 06.02.12 * Functional interface is back. * * Sys::HostIP will remain backwards compatible. * * Fix bug reported by Mr. Muskrat where ifconfig would be searched even on Windows. This failed because Windows doesn't have ifconfig. * Refactoring, cleanups. 1.90 05.02.12 * Functional interface is now deprecated. * Fix taint mode, use File::Basename for it. * Remove need for Test::TinyMocker, Test::Exception. * Other cleanups. 1.81 20.01.11 * Refactoring testing code. * Adding test to Windows 7 (Hilko Bengen). 1.8 18.01.11 * More tests, thanks to fenderson (Amir Meiry). * Fix for Windows 7 (Hilko Bengen). * Adding test data for Windows XP and Windows 2K (Hilko Bengen). * Clean ups. 1.7 15.09.10 * Refactoring, refactoring, refactoring. * If you're using object oriented style, the data is now cached! * Create if_info on edit. * Sorted version numbers 1.6 12.09.10 * ifconfig attr as documented in POD * Sorting ifconfig sub to _get_ifconfig 1.5 11.09.10 * Moved to proper object oriented interface * Cleaning up all the POD * Cleaning up code 1.4 11.09.10 * New maintainer: Sawyer X (XSAWYERX) * Fixed RT #24002 (thanks gmc@gmcx.net and MARKLE) * Fixed RT #44845 (thanks Mikhael ) * Rewrote tests, doubled them * Using clean EXPORT_OK now * Allow multiple 127.0.0.1 in tests (VPS servers may have multiple) * Moved to Dist::Zilla * Cleaned up the Changes (reversed the order, hell yes) * Cleaned up the POD a bit 1.3.1 Mon Sep 29 20:37:07 PST 2003 fixed line wrapping in documentation. 1.3.0 Mon Sep 29 00:42::55 PST 2003 finally rewrote _get_win32_interface_info from scratch. All methods seem to work now. $/ is now localized before every system call (thanks martin.thurn@ngc.com). added aix support (thanks benny@discoveringmontana.com). 1.2.2 Thu Jan 9 12:46:59 PST 2003 fixed error with || precedence on line 24 that spit out a warning for non linux systems (thanks saad@docisland.org and nipotan@k5.dion.ne.jp) changed default ifconfig command to include "-a" flag 1.2.1 Mon Jul 8 01:02:03 2002 fixed typo on line 58 1.2 Sun Apr 7 21:05:23 2002 now ip() is exported (and works as a normal sub instead of a class method) to insure compatability with old module 1.1 Sun Apr 7 17:30:15 2002 almost complete rewrite of old (1.0) version Sys-HostIP-2.000/Makefile.PL0000644000175000017500000000265613066201576015034 0ustar sawyersawyer# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 7.1101; my %WriteMakefileArgs = ( "ABSTRACT" => "Try extra hard to get IP address related info", "AUTHOR" => "Sawyer X , Jonathan Schatz ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "7.1101" }, "DISTNAME" => "Sys-HostIP", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Sys::HostIP", "PREREQ_PM" => { "Carp" => 0, "Exporter" => 0, "File::Basename" => 0 }, "TEST_REQUIRES" => { "Data::Dumper" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::CPAN::Meta" => 0, "Test::More" => 0, "Test::Pod" => 0 }, "VERSION" => "2.000", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Data::Dumper" => 0, "Exporter" => 0, "File::Basename" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::CPAN::Meta" => 0, "Test::More" => 0, "Test::Pod" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs);