Файловый менеджер - Редактировать - /home/jogoso94/public_html/static/img/logo/NetAddr-IP-4.079-0.tar
�азад
pm_to_blib 0000644 00000000000 15043770025 0006566 0 ustar 00 Changes 0000644 00000044523 15043770025 0006052 0 ustar 00 Revision history for Perl extension NetAddr::IP 4.079 Fri Mar 25 16:18:26 PDT 2016 correct non-suppression of leading zeros in certain instances of new_no use. Thanks to "Mike Bartman (mbartman)" <mbartman@cisco.com> for spotting the bug. put in missing code to propagate NetAddr::IP::Lite :nofqdn to IP.pm 4.078 Mon Aug 17 15:35:28 PDT 2015 fix typo in Util.pm 1.53 MakefilePL that cause compiler to not be found at all 4.077 Fri Aug 14 01:17:23 PDT 2015 re-numbered because of CPAN upload issue 4.076 Thu Aug 13 22:44:48 PDT 2015 added method is_local() to Lite.pm inspired by Xan Charbonne fix Util Makefile.PL to accomodate bug in Android's sh add method full6m() inspired by abraxxa@cpan.org fix Util/Makefile.PL issue with clang compiler, bug 86831 4.075 Wed Jun 11 11:41:17 PDT 2014 make CPAN happy with new rev number 4.074 Wed Jun 11 09:36:10 PDT 2014 In Lite.pm v1.54, change input filter for resolvable hostnames to allow the underscore character Thanks to grankio [...] gmail.com for the heads up on this issue. 4.073 Sat Apr 5 09:32:11 PDT 2014 add documentation about FQDN conversion and an option to disable 4.072 Mon Jan 27 11:59:58 PST 2014 modify Makefile.PL to bypass missing 'pod2text' 4.071 Mon Sep 30 13:41:03 PDT 2013 add method "canon" by request from <tom.jones@bccx.com> 4.070 Thu Sep 12 12:54:22 PDT 2013 nth documention error fixed. thanks to Anton tobez@tobez.org Lite v1.51, add new6FFFF, RFC4291 compliant ipv4->ipV6 new 4.069 Sat May 25 15:10:45 PDT 2013 IN Lite.pm v1.50, add =encoding UTF-8 In Util.pm v1.50 changed Makefile.PL to check for config.h when building for XS with 'gcc', try building with 'cc', and check again. If config.h is not found, force Pure Perl mode. Kill XS in winduhs and Darwin, both of which misbehave when compiling XS code 4.068 Wed Apr 3 10:52:24 PDT 2013 update Makefile.PL in Util.pm v 1.49 to better detect 'winduhs' 4.067 Sat Mar 30 12:57:20 PDT 2013 Improved diagnostic message for "die" with bad mask for hostenum, hostenumref, split, splitref, rsplit, rsplitref Thanks to GENSYM@cpan.org for pointing out the need. 4.066 Mon Oct 29 13:30:14 PDT 2012 update Lite.pm v1.47 to support bracketed IPv6 URI notation as described in RFC-3986 Thanks to Quanah Gibson-Mount mishikal@yahoo.com 4.065 Tue Oct 2 12:36:11 PDT 2012 correct format for IPv6 embedded IPv4 addresses in InetBase v0.8 4.064 Tue Sep 25 13:54:47 PDT 2012 added support for rfc3021 /31 networks to hostenum 4.063 Fri Aug 10 11:46:18 PDT 2012 Updated GPL v2.0 text and address in all modules 4.062 Wed Jun 6 12:34:48 PDT 2012 documentation updates courtesy of Ben Bullock <benkasminbullock@gmail.com> Thank you Ben. 4.061 Tue May 8 16:24:03 PDT 2012 fixed bug in Lite v1.44 that returned $ip->num() = 2^128 for 0.0.0.0/0 Thanks to Sebastian <debug@test1.org> for spotting it. 4.060 Fri Apr 6 16:00:02 PDT 2012 In Lite.pm v1.43, fix bug #75976, change in behavior introduced in v4.050 where an empty string supplied to "new" previously returned 'undef' and now returns 'default' for ipV4 or ipV6 4.059 Wed Mar 7 12:50:04 PST 2012 add is_rfc1918 to Lite.pm v1.42 documentation updates 4.058 Fri Nov 11 19:23:11 PST 2011 up rev for documentation update update documentation in InetBase v0.06 4.057 Fri Nov 11 15:04:20 PST 2011 Lite.pm v1.40 add call to InetBase::fillIPv4 to all uses of gethostbyname break out the code in InetBase v0.05 that expands short IPv4 addresses into dotquad format to account for broken BSD implementations of inet_aton and gethostbyname that do not recognize the short format. EXPORT this as sub 'fillIPv4' in Util.pm v1.45, add 'fillIPv4' to calls to gethostbyname to work around broken inet_aton and gethostbyname implementations in certain BSD implementations 4.056 Wed Nov 2 19:15:31 PDT 2011 bump rev to incorporate improved inet_aton in InetBase v0.04 to overcome broken gethostbyname found in NetBSD and OpenBSD 4.055 Fri Oct 28 11:41:22 PDT 2011 in Lite.pm v1.38 patch for bug 71869, issues with Math::BigInt varients 4.054 Thu Oct 27 12:48:55 PDT 2011 In Lite.pm v1.37, remove Calc.pm add detection of early Math::Bigint object structure fix bug 71869 - a failed test routine 4.053 Wed Oct 26 08:52:34 PDT 2011 In Lite.pm v1.36 fix bug #71925. A a sub-varient of #62521 that showed up only for short notation for IPv4. i.e. 127/n, 127.0/n, 127.0.0/n but not 127.0.0.0/n 4.052 Tue Oct 25 16:18:38 PDT 2011 add test in Lite.pm v1.35 for api-version of Math::BigInt to support versions earlier than 1.70, circa Dec 2003. Thanks to Paul Howarth <paul@city-fan.org> for spotting that bug. 4.051 Mon Oct 24 14:44:53 PDT 2011 fix bug 71869 in Lite.pm v1.34 use Math::BigInt::Calc for creating BigInt values and fall back to NetAddr::IP::Calc if Math::BigInt is not present. remove reference to Config{osname} in InetBase.pm v0.03 (Util 1.43) 4.050 Sat Oct 22 01:58:57 PDT 2011 In Lite/Util/lib/NetAddr/IP/Lite/Util/InetBase.pm v0.02 Socket6 prior to version 0.23 does not have AF_INET6 in the EXPORT_OK array, modify InetBase.pm v0.2 to work around this. Add support for Math::BigInt to NetAddr::IP::Lite v1.33 4.049 Sat Oct 15 22:15:10 PDT 2011 Updates to Lite.pm, Util.pm, new module InetBase.pm In Lite v1.32 bug68723, add capability to parse input of the form ->new6(12345,1). This should have been there but was missing. Thanks to Andrei Benea for spotting this. In Util v1.41 add inet_pton, inet_ntop, AF_INET, AF_INET6 modify inet_n2dx and inet_n2ad to recognize the new 128 bit IPv4 format ::FFFF:FFFF:0:0 replace isIPv4 with a pure perl version for portablity split the following into NetAddr::IP::InetBase v0.01 to provide better long term support for IPv6 inet_aton inet_ntoa ipv6_aton ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_ntop inet_pton packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 4.048 Sat Oct 8 01:33:44 PDT 2011 remove debug print statement from Util v1.40 4.047 Thu Oct 6 23:41:42 PDT 2011 really correct missing reference in Util v1.39 doc update only in Lite.pm v1.30 4.046 Thu Oct 6 20:20:33 PDT 2011 DEPRECATED corrected missing reference to inet_4map6 in Util v1.38 4.045 Thu Oct 6 18:23:04 PDT 2011 DEPRECATED updated NetAddr::IP::Util 1.37 addid isAnyIPv4, isNewIPv4, inet_4map6 revised naip_gethostbyname to conform to Perl's gethostbyname output 4.044 Wed May 18 14:47:34 PDT 2011 added missing support for ->compactref(\@list) which is described in the documentation but not implemented. Thanks to Rusty Bourland codebard@gmail.com for spotting this and providing both a patch and test code 4.043 Wed Apr 6 11:31:19 PDT 2011 Update documentation on the use of "adding constants to an IP address". 4.042 Tue Mar 22 15:26:02 PDT 2011 Update Lite.pm v1.27 to encompass treatment of /31 and /127 point-to-point networks as described in RFC 3021 NOTE: for /31's and /127's this changes the behavior of the following methods: first returns the "network" address last returns the "broadcast" address nth index 0 returns "network" addr instead of undef nth index 1 returns "broadcast" addr instead of undef num returns 2 instead of 0 (zero) "old_nth" behavior is unchanged Thanks to Todd Caine todd.caine@gmail.com for pointing this out. 4.041 Tue Mar 8 15:18:16 PST 2011 Updated Lite.pm v1.26, "sub num" to support usable IP ranges greater than 2**32 Thanks to Jan Ploski jan@plosquare.com for finding this bug 4.040 Sat Feb 19 10:04:00 PST 2011 correction to use of Util.pm package lexicals thanks to mishikal@yahoo.com for spotting the bug and to Mark Martinec mark.martinec+ama...@ijs.si for the solution. 4.039 Wed Feb 16 15:48:03 PST 2011 Correct documentation for 'split' methods 4.038 Fri Dec 17 17:47:47 PST 2010 Modify subs "new" and "new6" in Lite.pm to accomodate Cisco mask syntax that uses space instead of "/" for a separator This eliminates the need for "new_cis" and "newcis6" which are now deprecated. Modify LIte/t/v4-cnew.t and add Lite/t/v6-cnew.t to test the above 4.037 Fri Nov 19 10:48:01 PST 2010 add :upper and :lower to Lite.pm v1.23 add comments about rfc5952 requirement for lowercase ipV6 notation in Lite.pm v1.23 and IP.pm add test for :lower in Lite.pm v1.23 4.036 Tue Nov 16 16:28:37 PST 2010 In Util.pm v1.35, naip_gethostbyname modified to return undef instead of 0 (zero) on failure thanks to Terry Cassidy enaudishaylee@tc17.com for the bug report In Util.pm v1.35, move sub's ipv6_n2d and ipv6_n2x to non-autosplit portion of module to eliminate warnings during autosplit of "our" variables thanks to Nicholas Bamber <nicholas@periapt.co.uk> Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517361 In Lite.pm v1.22, update new6 to properly classify short ipv4 notation i.e. 127/8 with test for ":" rather than match for \d.\d.\d.\d thanks to Steve Huff (SHUFF) * shuff@cpan.org for spotting that bug. In Lite.pm v1.22, update t/v4-new.t for deprecated array syntax in perl 5.13 was: qw(...stuff...) is: (qw(...stuff...)) thanks to Todd Rinaldo <toddr@cpan.org> for reporting this 4.035 Thu Oct 28 14:26:19 PDT 2010 fix bug in Lite v1.21 where new6 improperly assigns the mask value for and ipv4 address in 32 bit space instead of 128 bit space Thanks to Mark Martinec and Steve Huff (SHUFF) * shuff@cpan.org for spotting and replicating that bug added new_cis and new_cis6 to Lite.pm v1.21 to accomodate Cisco syntax that has IP and MASK separated by a space. Updated typo in documentation that left out example print new6 stuff 4.034 Mon Oct 25 16:22:01 PDT 2010 Updated Lite::_xnew v1.20 to properly handle ipV6 notation of the form xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, DDD Thanks to Dusty Mabe <Dusty.Mabe@tekelec.com> for spotting this bug 4.033 Wed Sep 29 10:32:50 PDT 2010 Conditionalize import of AF_INET6 in Util.pm NetAddr::IP::UtilPolluted 4.032 Wed Sep 22 13:39:08 PDT 2010 Added overload => 'ne' and '!=' to Lite.pm v1.18 4.031 Tue Sep 21 19:21:04 PDT 2010 Pull Socket6 stuff out of Lite 1.17 and put into NetAddr::IP::Util.pm 1.33 in its own namespace 4.030 Tue Jul 20 15:32:23 PDT 2010 Resolve named hosts in Lite.pm using gethostbyname, followed by gethostbyname6 to determine whether to set ipV6 flag Thanks to Dusty Mabe <Dusty.Mabe@tekelec.com> for spotting this bug 4.029 Thu Jul 8 18:17:38 PDT 2010 In NetAddr::IP::Lite, added support for the sub "new" to resolve host6 names if the OPTIONAL perl Socket6 module is available Thanks to "Mabe, Dusty" <Dusty.Mabe@tekelec.com> for spotting this and suggesting a fix. 4.028 Wed May 12 14:18:20 PDT 2010 In /Lite/Util/Util.xs v1.32, changed netswap() to postincrement *a++ = to *a and added increment after save to mollify some picky compilers that return possible undefined behavior. changed type of _128x10 to 'void' Thanks to David Bolt <dbolt@davjam.org> for the above two patches 4.027 Tue Jun 9 10:31:11 PDT 2009 In NetAddr::IP::Util v1.31, ferret out shell value for Makefile.PL when calling ./configure for systems where the 'x' bit gets lost due to bug in Archive::Tar 4.026 Sat Mar 7 16:35:33 PST 2009 make the compiler test check the environment for CC before using Perl's default compiler 4.025 Sat Mar 7 16:15:18 PST 2009 revised compiler test in Makefile.PL for Util v1.29 to accomodate picky Solaris "cc" 4.024 Mon Jan 26 00:27:32 PST 2009 documentation update 4.023 Fri Jan 16 14:30:40 PST 2009 added the capability to set the CASE of ipV6 text return values to either upper or lower. Thanks to Rob Riepel <riepel@networking.Stanford.EDU> for developing this improvement and providing a comprehensive patch 4.022 Sat Dec 20 13:05:01 PST 2008 In Util.xs 1.28 set uninitialized "carry" in XS bin2bcd to zero This insidious bug only showed up on 64 bit hosts running perl 5.6.2 Thanks to Oliver Paukstadt <pstadt@sourcentral.org> for taking the time to do the testing for me on his s390 system. 4.021 Wed Dec 10 11:09:36 PST 2008 Removed test code that produces a warning about all perl versions, OOPS!! instead of just the buggy 5.8.0 - 5.8.5 versions. Thanks to paul@city-fan.org for reporting this. 4.020 Tue Dec 9 16:25:46 PST 2008 cleaned up various typo's with good patch from Rob Riepel <riepel@networking.Stanford.EDU> thanks Rob. revised UtilPP v1.7 to work around perl 5.8.4 failures with certain @_ operations of goto &sub... see perl bug [ 23429]. Unfortunately, perl-5.8.4 is the distribution of choice for many solaris boxes 4.019 Sat Nov 29 15:15:30 PST 2008 in Lite/Util, add pure perl testing to XS build 4.018 Fri Nov 28 23:19:01 PST 2008 revised XS code to be full re-entrant, thread safe in Util.xs v1.26 removed all traces of mutex locks in Util.xs v1.26 removed function 'threads' here an in UtilPP v1.6 4.017 Sun Nov 23 19:32:59 PST 2008 Extended the capability of 'splitref' to allow splitting of objects into multiple pieces with differing CIDR masks. Returned object list can be split from bottom to top or from top to bottom depending on which method is called split, rsplit, splitref, rsplitref Thanks to kashmish <kashmish@gmail.com> for the idea on improving functionality of 'split'. Thanks to Rob Riepel <riepel@networking.Stanford.EDU> for a faster and more accurate _compV6 function. in UtitPP v1.5 correct documentation error add threads reporting (empty string) in Util v1.25 add threads reporting that returns a comma separated string of build headers. added what is hopefully thread safe operation via serialization. Must be invoked by "--with-threads" in Lite v1.12 corrected missing Zeros subroutine Zeros and Zero both will work in Lite v1.12 added minus (-) overloading to allow the subtraction of two NetAddr::IP objects to get the difference between the object->{addr}'s as a numeric value Thanks to Rob Riepel <riepel@networking.Stanford.EDU> for the initial code and inspiration for this enhancement 4.016 Wed Nov 5 18:13:20 PST 2008 in Util/ version 1.24 Clean up Makefile.PL to check actual required link libraries against the perl build for consistency 4.015 Sun Nov 2 10:10:38 PST 2008 in Util v1.23 add missing headers in configure and localconf.h for Solaris inet_xton thanks to Karl Bunch <karl@digilink.net> for spotting the bug. 4.014 Sat Nov 1 15:13:48 PST 2008 in Lite.pm v1.11, add test for characters not allowed by rfc952 before the call to gethostbyname in sub new() for those people that insist on using deprecated functionality :aton and OS's that fail to notice calls to gethostbyname with binary arguments. 4.013 Wed Oct 22 15:04:49 PDT 2008 In Lite.pm v1.10, add new no octal method for improperly formatted ipV4 addresses In Util.pm v1.22, eliminated dependence on PL_sawampersand thanks to Mark Martinec <Mark.Martinec@ijs.si> for spotting this and submitting a patch. In Util.pm v1.22, force -noxs mode for Win32 In Util.pm v1.22, use autoconf to configure 'C' build 4.012 Thu Oct 16 19:35:33 PDT 2008 clear build bug for Win32 in Util.pm v 1.21 4.011 released Oct 6 13:10 4.010 Sat Sep 27 17:00:28 PDT 2008 in NetAddr::IP::Util v0.19 updated test for ENDIANess in siteconf add test in inet_aton to detect overange IP dot quad values missed by some broken Socket implementations i.e. 256.1.1.1 would fail to return undef NOTE: Versions 4.008 and 4.009 had limited release to tester only and were not uploaded to CPAN. All of the v4.008, 4.009 changes are incorporated in v4.010 4.009 Tue Sep 2 19:09:57 PDT 2008 In NetAddr::IP::Lite v1.07, in the off chance that NetAddr::IP::Lite objects are created and the caller later loads NetAddr::IP and expects to use those objects, let the AUTOLOAD routine find and redirect NetAddr::IP::Lite method and subroutine calls to NetAddr::IP. updated Lite/t/v4-wnew.t so that non-existent domains are "really" not there 4.008 Sat Jun 7 14:01:55 PDT 2008 inherit method "new_from_aton" from NetAddr::IP::Lite add related documentation Inherited methods from Lite.pm updated as follows: comparisons of the form <, >, <=, >= 10.0.0.0/24 {operator} 10.0.0.0/16 return now return the comparison of the cidr value when the address portion is equal. NOTE: this comparison returns the comparison of the NUMERIC value of the CIDR. This produces the counter intuitive result that /24 > /16. There is logic to this, really! For proper operation of commands like "Compact" and "Coalesce", lists of netaddr objects must sort in ascending order. However, this conflicts with the requirement for larger netblocks to sort FIRST so as to include smaller ones. This logic extends to any requirement for a sort of netaddr objects. It should be further noted that the mixing of netaddr objects with varying IP addresses and CIDR allocations can lead to unexpected results since the comparisons done first on the IP portion and then on the CIDR portion. The documentation has been updated appropriately. Thanks to Peter DeVries for spotting this discrepancy 4.007 Wed Jun 6 16:41:11 VET 2007 Update copyright dates 4.006 Wed Jun 6 15:58:04 VET 2007 A patch from Michael got rid of $& and $` as reported by Daryl O'Shea and documented at http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5312 4.004 Wed Aug 16 16:01:54 PDT 2006 update to include/exclude files in corrupted distro 4.003 Sun Aug 6 10:48:25 PDT 2006 correct SYNOPSIS documentation add :old_nth update Lite.pm documentation update Util.pm documentation Imported into distribution CVS tree - Some revision number mismatches are to be expected Latin-1 is back Fixed some angle brackets so that they show up in the docs 4.002 Fri Aug 4 14:14:16 PDT 2006 remove unused global variable $isV6 update Lite.pm to v1.02 $isV6 global converted to a lexical variable within sub "_xnew" $Class global removed and replaced by calls to UNIVERSAL::isa Thanks to julian@mehnle.net for spotting problems related to using the Lite.pm with mod_perl 4.001 Thu Jul 6 14:09:01 PDT 2006 various bug fixes courtesy of Luis Munoz: changes to Lite.pm v1.01, Util.pm v0.17 see Changes in those distros. update t/v6-re.t, addconst called as a scalar, should be called to return the address value ()[1] 4.000 Mon Jun 19 21:51:10 PDT 2006 initial release of version 4.000 which includes full support of ipV6 addresses and drops the requirement for Math::BigInt and will run on older versions of Perl at least back to 5.005_03 MANIFEST.SKIP 0000644 00000000454 15043770025 0006450 0 ustar 00 ^Build$ ^_build/ ^blib/ ^blibdirs Makefile$ Makefile\.[a-z]+$ pm_to_blib CVS/.* \.cvs ,v$ ^tmp/ \.old$ \.bak$ \.tmp$ \.xsc$ ~$ ^# \.shar$ \.tar$ \.tgz$ \.tar\.gz$ \.zip$ _uu$ Util_IS\.pm$ Util\.(bs|[co])$ localStuff\.h$ config\.log$ config\.h$ config\.status localperl\.h Lite/bug2742981.pl META.yml Lite/pm_to_blib 0000644 00000000000 15043770025 0007463 0 ustar 00 Lite/Changes 0000644 00000034240 15043770025 0006742 0 ustar 00 Revision history for Perl extension NetAddr::IP::Lite 1.57 Fri Mar 25 16:18:26 PDT 2016 correct non-suppression of leading zeros in certain instances of new_no use. Thanks to "Mike Bartman (mbartman)" <mbartman@cisco.com> for spotting the bug. 1.56 Mon Aug 17 15:35:28 PDT 2015 fix typo in Util.pm 1.53 MakefilePL that cause compiler to not be found at all 1.55 Thu Aug 13 22:44:48 PDT 2015 added method is_local() inspired by request from Xan Charbonne fix Util Makefile.PL to accomodate bug in Android's sh fix Util/Makefile.PL issue with clang compiler, bug 86831 1.54 Wed Jun 11 09:36:10 PDT 2014 change input filter for resolvable hostnames to allow the underscore character Thanks to grankio [...] gmail.com for the heads up on this issue. 1.53 Sat Apr 5 09:32:11 PDT 2014 add documentation about FQDN conversion and an option to disable 1.52 Mon Jan 27 11:59:58 PST 2014 modify Makefile.PL to bypass missing 'pod2text' 1.51 Thu Sep 12 12:54:22 PDT 2013 add new6FFFF, RFC4291 compliant ipv4->ipV6 new 1.50 Sat May 25 15:10:45 PDT 2013 add =encoding UTF-8 1.49 Tue Apr 9 12:02:34 PDT 2013 In Util.pm v1.50 changed Makefile.PL to check for config.h when building for XS with 'gcc', try building with 'cc', and check again. If config.h is not found, force Pure Perl mode. Kill XS in winduhs and Darwin, both of which misbehave when compiling XS code 1.48 Wed Apr 3 10:52:24 PDT 2013 Update Util.pm v1.49 to better detect 'winduhs' 1.47 Mon Oct 29 13:30:14 PDT 2012 update Lite.pm v1.47 to support bracketed IPv6 URI notation as described in RFC-3986 Thanks to Quanah Gibson-Mount mishikal@yahoo.com 1.46 Tue Oct 2 12:36:11 PDT 2012 correct incorrect format for IPv6 embedded IPv4 addresses in InetBase v0.8 1.45 Fri Aug 10 11:46:18 PDT 2012 --- 1.44 Tue May 8 16:24:03 PDT 2012 fixed bug that return $ip->num() = 2^128 for 0.0.0.0/0 Thanks to Sebastian <debug@test1.org> for spotting it. 1.43 Fri Apr 6 13:19:48 PDT 2012 fix bug #75976, change in behavior introduced in v4.050 where an empty string supplied to "new" previously returned 'undef' and now returns 'default' for ipV4 or ipV6 1.42 Wed Mar 7 12:50:04 PST 2012 add "is_rfc1918" and tests correct typos in documentation 1.41 Fri Nov 11 19:23:11 PST 2011 up rev for documentation update update documentation in InetBase v0.06 1.40 Fri Nov 11 13:20:32 PST 2011 add call to InetBase::fillIPv4 to all uses of gethostbyname break out the code in InetBase v0.05 that expands short IPv4 addresses into dotquad format to account for broken BSD implementations of inet_aton and gethostbyname that do not recognize the short format. EXPORT this as sub 'fillIPv4' in Util.pm v1.45, add 'fillIPv4' to calls to gethostbyname to work around broken inet_aton and gethostbyname implementations in certain BSD implementations 1.39 Wed Nov 2 19:15:31 PDT 2011 bump rev to incorporate improved inet_aton in InetBase v0.04 to overcome broken gethostbyname found in NetBSD and OpenBSD 1.38 Fri Oct 28 11:41:22 PDT 2011 patch for bug 71869, issues with Math::BigInt varients 1.37 Thu Oct 27 12:48:55 PDT 2011 add detection of early Math::Bigint 0.01 object structures circa perl 5.6.1 remove Calc.pm as part of above fix bug 71869 - a failed test routine 1.36 Wed Oct 26 08:52:34 PDT 2011 fix bug #71925. A a sub-varient of #62521 that showed up only for short notation for IPv4. i.e. 127/n, 127.0/n, 127.0.0/n but not 127.0.0.0/n 1.35 Tue Oct 25 16:18:38 PDT 2011 add test for api-version of Math::BigInt to support versions earlier than 1.70, circa Dec 2003. Thanks to Paul Howarth <paul@city-fan.org> for spotting that bug. 1.34 Mon Oct 24 14:38:16 PDT 2011 use Math::BigInt::Calc for creating BigInt values and fall back to NetAddr::IP::Calc if Math::BigInt is not present. Thanks to Paul Howarth <paul@city-fan.org> for spotting that bug. remove reference to Config{osname} in InetBase.pm v0.03 (Util 1.43) 1.33 Sat Oct 22 01:47:42 PDT 2011 In Lite/Util/lib/NetAddr/IP/Lite/Util/InetBase.pm v0.02 Socket6 prior to version 0.23 does not have AF_INET6 in the EXPORT_OK array, modify InetBase.pm v0.2 to work around this. Add support for Math::BigInt objects 1.32 Sat Oct 15 22:05:23 PDT 2011 bug68723, add capability to parse input of the form ->new6(12345,1). This should have been there but was missing. Thanks to Andrei Benea for spotting this. In Util v1.41 add inet_pton, inet_ntop, AF_INET, AF_INET6 modify inet_n2dx and inet_n2ad to recognize the new 128 bit IPv4 format ::FFFF:FFFF:0:0 replace isIPv4 with a pure perl version for portablity split the following into NetAddr::IP::InetBase v0.01 to provide better long term support for IPv6 inet_aton inet_ntoa ipv6_aton ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_ntop inet_pton packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 1.31 Sat Oct 8 01:33:44 PDT 2011 remove debug print statement from Util.pm v1.40 1.30 Thu Oct 6 23:41:42 PDT 2011 correct internal variable reference in Util.pm 1.39 1.29 Thu Oct 6 20:20:33 PDT 2011 updated to UTIL 1.38 1.28 Wed Apr 6 11:31:19 PDT 2011 Update documentation on the use of "adding constants to an IP address". 1.27 Tue Mar 22 15:26:02 PDT 2011 Update Lite.pm to encompass treatment of /31 and /127 point-to-point networks as described in RFC 3021 NOTE: for /31's and /127's this changes the behavior of the following methods: first returns the "network" address last returns the "broadcast" address nth index 0 returns "network" addr instead of undef nth index 1 returns "broadcast" addr instead of undef num returns 2 instead of 0 (zero) "old_nth" behavior is unchanged Thanks to Todd Caine todd.caine@gmail.com for pointing this out. 1.26 Tue Mar 8 15:18:16 PST 2011 Updated "sub num" to support usable IP ranges greater than 2**32 Thanks to Jan Ploski jan@plosquare.com for finding this bug 1.25 Sat Feb 19 10:04:00 PST 2011 correction to use of Util.pm package lexicals thanks to mishikal@yahoo.com for spotting the bug and to Mark Martinec mark.martinec+ama...@ijs.si for the solution. 1.24 Fri Dec 17 17:47:47 PST 2010 Modify subs "new" and "new6" to accomodate Cisco mask syntax that uses space instead of "/" for a separator This eliminates the need for "new_cis" and "newcis6" which are now deprecated. Modify t/v4-cnew.t and add t/v6-cnew.t to test the above 1.23 Fri Nov 19 10:48:01 PST 2010 add :upper and :lower to Lite.pm v1.23 add comments about rfc5952 requirement for lowercase ipV6 notation add test for :lower 1.22 Tue Nov 16 16:28:37 PST 2010 update new6 to properly classify short ipv4 notation i.e. 127/8 with test for ":" rather than match for \d.\d.\d.\d thanks to Steve Huff (SHUFF) * shuff@cpan.org for spotting that bug. update t/v4-new.t for deprecated array syntax in perl 5.13 was: qw(...stuff...) is: (qw(...stuff...)) thanks to Todd Rinaldo <toddr@cpan.org> for reporting this 1.21 Thu Oct 28 14:26:19 PDT 2010 fix bug where new6 improperly assigns the mask value for and ipv4 address in 32 bit space instead of 128 bit space Thanks to Mark Martinec and Steve Huff (SHUFF) * shuff@cpan.org for spotting and replicating that bug added new_cis and new_cis6 to Lite.pm v1.21 to accomodate Cisco syntax that has IP and MASK separated by a space. Updated typo in documentation that left out example print new6 stuff 1.20 Mon Oct 25 16:22:01 PDT 2010 Updated _xnew to properly handle ipV6 notation of the form xxxx:xxxx:xxxx:xxxx:xxxx:xxxx, DDD Thanks to Dusty Mabe <Dusty.Mabe@tekelec.com> for spotting this bug 1.19 Wed Sep 29 10:32:50 PDT 2010 Conditionalize import of AF_INET6 in Util.pm NetAddr::IP::UtilPolluted 1.18 Wed Sep 22 13:39:08 PDT 2010 Added overload => 'ne' and '!=' to Lite.pm 1.17 Tue Sep 21 17:50:50 PDT 2010 Pull Socket6 stuff out of Lite and put into NetAddr::IP::Util.pm in its own namespace 1.16 Wed Aug 11 12:45:49 PDT 2010 When using Socket6, pull in missing symbol PF_INET6, which may or may not be present, from Socket. 1.15 Tue Jul 20 15:32:23 PDT 2010 Resolve named hosts using gethostbyname, followed by gethostbyname6 to determine whether to set ipV6 flag Thanks to Dusty Mabe <Dusty.Mabe@tekelec.com> for spotting this bug 1.14 Thu Jul 8 18:17:38 PDT 2010 added support for the sub "new" to resolve host6 names if the OPTIONAL perl Socket6 module is available 1.13 Tue Dec 9 16:00:35 PST 2008 added missing regexp to classify arguments as BCD numbers, apparently this has been missing from NetAddr::IP::Lite since the first release. Thanks to Carlos Vicente cvicente@cpan.org for reporting this bug. revised UtilPP v1.7 to work around perl 5.8.4 failures with certain @_ operations of goto &sub... see perl bug [ 23429]. Unfortunately, perl-5.8.4 is the distribution of choice for many solaris boxes 1.12 Sun Nov 23 19:32:59 PST 2008 repaired missing sub Zeros added minus (-) overloading to allow the subtraction of two NetAddr::IP objects to get the difference between the object->{addr}'s as a numeric value Thanks to Rob Riepel <riepel@networking.Stanford.EDU> for the initial code and inspiration for this enhancement 1.11 Sat Nov 1 15:13:48 PST 2008 add test for characters not allowed by rfc952 before the call to gethostbyname in sub new() for those people that insist on using deprecated functionality :aton and OS's that fail to notice calls to gethostbyname with binary arguments 1.10 Wed Oct 22 14:54:12 PDT 2008 add new no octal method for improperly formatted ipV4 addresses In Util.pm v1.22, eliminated dependence on PL_sawampersand thanks to Mark Martinec <Mark.Martinec@ijs.si> for spotting this and submitting a patch. In Util.pm v1.22, force -noxs mode for Win32 In Util.pm v1.22, use autoconf to configure 'C' build 1.09 Thu Oct 16 19:35:33 PDT 2008 again... clear build bug for Win32 in Util.pm v 1.21 1.08 Sat Sep 27 12:27:28 PDT 2008 in Util v0.19 updated test for ENDIANess in siteconf add test in inet_aton to detect overange IP dot quad values missed by some broken Socket implementations i.e. 256.1.1.1 1.07 Tue Sep 2 19:09:57 PDT 2008 in the off chance that NetAddr::IP::Lite objects are created and the caller later loads NetAddr::IP and expects to use those objects, let the AUTOLOAD routine find and redirect NetAddr::IP::Lite method and subroutine calls to NetAddr::IP. updated t/v4-wnew.t so that non-existent domains are "really" not there 1.06 Sat Jun 7 12:57:18 PDT 2008 add method "new_from_aton" and related documentation comparisons of the form <, >, <=, >= 10.0.0.0/24 {operator} 10.0.0.0/16 return now return the comparison of the cidr value when the address portion is equal. NOTE: this comparison returns the comparison of the NUMERIC value of the CIDR. This produces the counter intuitive result that /24 > /16. There is logic to this, really! For proper operation of commands like "Compact" and "Coalesce", lists of netaddr objects must sort in ascending order. However, this conflicts with the requirement for larger netblocks to sort FIRST so as to include smaller ones. This logic extends to any requirement for a sort of netaddr objects. It should be further noted that the mixing of netaddr objects with varying IP addresses and CIDR allocations can lead to unexpected results since the comparisons done first on the IP portion and then on the CIDR portion. The documentation has been updated appropriately. Thanks to Peter DeVries for spotting this discrepancy 1.05 undocumented 1.04 undocumented 1.03 Sun Aug 6 10:48:25 PDT 2006 update Util.pm v0.18 documentation 1.02 Fri Aug 4 14:14:16 PDT 2006 $isV6 global converted to a lexical variable within sub "_xnew" $Class global removed and replaced by calls to UNIVERSAL::isa Thanks to julian@mehnle.net for spotting problems related to using the Lite.pm with mod_perl 1.01 Thu Jul 6 10:46:48 PDT 2006 update v4-wnew.t to warn user of possible long wait update Util.pm v0.17 -- see Changes in that distro 1.00 Mon Jun 26 13:34:00 PDT 2006 changed behavior of ->nth and ->num to 'exactly' conform to the documentation add :old_nth tag to preserve old behavior and update tests to check both 0.12 Sun Jun 25 16:13:00 PDT 2006 imported missing 'bcd2bin' fixed Util->new() issues with long digit strings ->new('::fffff') and non hex digits ->new('::foo'). Thanks to Radoslaw Zielinski <radek42@gmail.com> for spotting these 3 bugs 0.11 Wed Jun 14 14:53:21 PDT 2006 add 'sub new6' and related functionality to methods that print or return v4/6 information or text. add $self->{isv6} flag for hint to ipV6 status corrected bug in sub num that miscalculated the number of IP's in a net for /31 /32 0.10 Tue Jun 13 14:07:46 PDT 2006 bring 'sub new' into full compliance with NetAddr::IP, correct compatibility with for ==,>,<,=>,>=,<=>,cmp and update documentation to reflect actual implementation add 'copy' function that return a completely new object export (Zero Ones V4mask V4net) update Util.pm v0.15 so shiftleft returns original argument when the shift count is zero or undefined 0.09 Tue Jun 6 08:37:01 PDT 2006 update Util/Makefile.PM to check for link libraries that ExtUtils::MakeMaker does not find properly remove 'use warnings' from Lite.pm for backwards compatibility with older perl versions 0.08 Tue Jun 6 08:33:11 PDT 2006 update Util.xs for build on windoze 0.07 Tue Jun 6 08:21:12 PDT 2006 update NetAddr::IP::Util to v0.12 0.06 Mon Jun 5 21:34:28 PDT 2006 fix Sparc problems in Util v0.11 1) add workaround for OS's that do not have inet_aton 2) add workaround for compilers that do not understand #if MACRO1 == MACRO2 0.05 Sun May 7 18:06:43 PDT 2006 updated UtilPP.pm v0.06 to remove unnecessary pack(unpack) sequences to speed up ipv6->4, ipv4->6 conversions 0.04 Fri Apr 28 17:36:28 PDT 2006 left Util/Makefile.pl out of the top level distro 0.03 Fri Apr 28 17:26:51 PDT 2006 oops! left prerequisite Util 0.08 in the Makefile when it is include in this distro 0.02 Fri Apr 28 16:11:00 PDT 2006 update Lite.pm to accept ->new('addr/mask') where addr and mask are both in IP address format add test for above t/netaddr.t 0.01 Wed Apr 26 19:03:18 PDT 2006 initial release Lite/Lite.pm 0000644 00000125630 15043770025 0006706 0 ustar 00 #!/usr/bin/perl package NetAddr::IP::Lite; use Carp; use strict; #use diagnostics; #use warnings; use NetAddr::IP::InetBase qw( inet_any2n isIPv4 inet_n2dx inet_aton ipv6_aton ipv6_n2x fillIPv4 ); use NetAddr::IP::Util qw( addconst sub128 ipv6to4 notcontiguous shiftleft hasbits bin2bcd bcd2bin mask4to6 ipv4to6 naip_gethostbyname havegethostbyname2 ); use vars qw(@ISA @EXPORT_OK $VERSION $Accept_Binary_IP $Old_nth $NoFQDN $AUTOLOAD *Zero); $VERSION = do { my @r = (q$Revision: 1.57 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw(Zeros Zero Ones V4mask V4net); # Set to true, to enable recognizing of ipV4 && ipV6 binary notation IP # addresses. Thanks to Steve Snodgrass for reporting. This can be done # at the time of use-ing the module. See docs for details. $Accept_Binary_IP = 0; $Old_nth = 0; *Zero = \&Zeros; =pod =encoding UTF-8 =head1 NAME NetAddr::IP::Lite - Manages IPv4 and IPv6 addresses and subnets =head1 SYNOPSIS use NetAddr::IP::Lite qw( Zeros Ones V4mask V4net :aton DEPRECATED ! :old_nth :upper :lower :nofqdn ); my $ip = new NetAddr::IP::Lite '127.0.0.1'; or if your prefer my $ip = NetAddr::IP::Lite->new('127.0.0.1); or from a packed IPv4 address my $ip = new_from_aton NetAddr::IP::Lite (inet_aton('127.0.0.1')); or from an octal filtered IPv4 address my $ip = new_no NetAddr::IP::Lite '127.012.0.0'; print "The address is ", $ip->addr, " with mask ", $ip->mask, "\n" ; if ($ip->within(new NetAddr::IP::Lite "127.0.0.0", "255.0.0.0")) { print "Is a loopback address\n"; } # This prints 127.0.0.1/32 print "You can also say $ip...\n"; The following four functions return ipV6 representations of: :: = Zeros(); FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF = Ones(); FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:: = V4mask(); ::FFFF:FFFF = V4net(); Will also return an ipV4 or ipV6 representation of a resolvable Fully Qualified Domanin Name (FQDN). =head1 INSTALLATION Un-tar the distribution in an appropriate directory and type: perl Makefile.PL make make test make install B<NetAddr::IP::Lite> depends on B<NetAddr::IP::Util> which installs by default with its primary functions compiled using Perl's XS extensions to build a 'C' library. If you do not have a 'C' complier available or would like the slower Pure Perl version for some other reason, then type: perl Makefile.PL -noxs make make test make install =head1 DESCRIPTION This module provides an object-oriented abstraction on top of IP addresses or IP subnets, that allows for easy manipulations. Most of the operations of NetAddr::IP are supported. This module will work with older versions of Perl and is compatible with Math::BigInt. * By default B<NetAddr::IP> functions and methods return string IPv6 addresses in uppercase. To change that to lowercase: NOTE: the AUGUST 2010 RFC5952 states: 4.3. Lowercase The characters "a", "b", "c", "d", "e", and "f" in an IPv6 address MUST be represented in lowercase. It is recommended that all NEW applications using NetAddr::IP::Lite be invoked as shown on the next line. use NetAddr::IP::Lite qw(:lower); * To ensure the current IPv6 string case behavior even if the default changes: use NetAddr::IP::Lite qw(:upper); The internal representation of all IP objects is in 128 bit IPv6 notation. IPv4 and IPv6 objects may be freely mixed. The supported operations are described below: =cut # in the off chance that NetAddr::IP::Lite objects are created # and the caller later loads NetAddr::IP and expects to use # those objects, let the AUTOLOAD routine find and redirect # NetAddr::IP::Lite method and subroutine calls to NetAddr::IP. # my $parent = 'NetAddr::IP'; # test function # # input: subroutine name in NetAddr::IP # output: t/f if sub name exists in NetAddr::IP namespace # #sub sub_exists { # my $other = $parent .'::'; # return exists ${$other}{$_[0]}; #} sub DESTROY {}; sub AUTOLOAD { no strict; my ($pkg,$func) = ($AUTOLOAD =~ /(.*)::([^:]+)$/); my $other = $parent .'::'; if ($pkg =~ /^$other/o && exists ${$other}{$func}) { $other .= $func; goto &{$other}; } my @stack = caller(0); if ( $pkg eq ref $_[0] ) { $other = qq|Can't locate object method "$func" via|; } else { $other = qq|Undefined subroutine \&$AUTOLOAD not found in|; } die $other . qq| package "$parent" or "$pkg" (did you forgot to load a module?) at $stack[1] line $stack[2].\n|; } =head2 Overloaded Operators =cut # these really should be packed in Network Long order but since they are # symmetrical, that extra internal processing can be skipped my $_v4zero = pack('L',0); my $_zero = pack('L4',0,0,0,0); my $_ones = ~$_zero; my $_v4mask = pack('L4',0xffffffff,0xffffffff,0xffffffff,0); my $_v4net = ~ $_v4mask; my $_ipv4FFFF = pack('N4',0,0,0xffff,0); sub Zeros() { return $_zero; } sub Ones() { return $_ones; } sub V4mask() { return $_v4mask; } sub V4net() { return $_v4net; } ############################################# # These are the overload methods, placed here # for convenience. ############################################# use overload '+' => \&plus, '-' => \&minus, '++' => \&plusplus, '--' => \&minusminus, "=" => \©, '""' => sub { $_[0]->cidr(); }, 'eq' => sub { my $a = (UNIVERSAL::isa($_[0],__PACKAGE__)) ? $_[0]->cidr : $_[0]; my $b = (UNIVERSAL::isa($_[1],__PACKAGE__)) ? $_[1]->cidr : $_[1]; $a eq $b; }, 'ne' => sub { my $a = (UNIVERSAL::isa($_[0],__PACKAGE__)) ? $_[0]->cidr : $_[0]; my $b = (UNIVERSAL::isa($_[1],__PACKAGE__)) ? $_[1]->cidr : $_[1]; $a ne $b; }, '==' => sub { return 0 unless UNIVERSAL::isa($_[0],__PACKAGE__) && UNIVERSAL::isa($_[1],__PACKAGE__); $_[0]->cidr eq $_[1]->cidr; }, '!=' => sub { return 1 unless UNIVERSAL::isa($_[0],__PACKAGE__) && UNIVERSAL::isa($_[1],__PACKAGE__); $_[0]->cidr ne $_[1]->cidr; }, '>' => sub { return &comp_addr_mask > 0 ? 1 : 0; }, '<' => sub { return &comp_addr_mask < 0 ? 1 : 0; }, '>=' => sub { return &comp_addr_mask < 0 ? 0 : 1; }, '<=' => sub { return &comp_addr_mask > 0 ? 0 : 1; }, '<=>' => \&comp_addr_mask, 'cmp' => \&comp_addr_mask; sub comp_addr_mask { my($c,$rv) = sub128($_[0]->{addr},$_[1]->{addr}); return -1 unless $c; return 1 if hasbits($rv); ($c,$rv) = sub128($_[0]->{mask},$_[1]->{mask}); return -1 unless $c; return hasbits($rv) ? 1 : 0; } #sub comp_addr { # my($c,$rv) = sub128($_[0]->{addr},$_[1]->{addr}); # return -1 unless $c; # return hasbits($rv) ? 1 : 0; #} =pod =over =item B<Assignment (C<=>)> Has been optimized to copy one NetAddr::IP::Lite object to another very quickly. =item B<C<-E<gt>copy()>> The B<assignment (C<=>)> operation is only put in to operation when the copied object is further mutated by another overloaded operation. See L<overload> B<SPECIAL SYMBOLS FOR "use overload"> for details. B<C<-E<gt>copy()>> actually creates a new object when called. =cut sub copy { return _new($_[0],$_[0]->{addr}, $_[0]->{mask}); } =item B<Stringification> An object can be used just as a string. For instance, the following code my $ip = new NetAddr::IP::Lite '192.168.1.123'; print "$ip\n"; Will print the string 192.168.1.123/32. my $ip = new6 NetAddr::IP::Lite '192.168.1.123'; print "$ip\n"; Will print the string 0:0:0:0:0:0:C0A8:17B/128 =item B<Equality> You can test for equality with either C<eq>, C<ne>, C<==> or C<!=>. C<eq>, C<ne> allows the comparison with arbitrary strings as well as NetAddr::IP::Lite objects. The following example: if (NetAddr::IP::Lite->new('127.0.0.1','255.0.0.0') eq '127.0.0.1/8') { print "Yes\n"; } Will print out "Yes". Comparison with C<==> and C<!=> requires both operands to be NetAddr::IP::Lite objects. =item B<Comparison via E<gt>, E<lt>, E<gt>=, E<lt>=, E<lt>=E<gt> and C<cmp>> Internally, all network objects are represented in 128 bit format. The numeric representation of the network is compared through the corresponding operation. Comparisons are tried first on the address portion of the object and if that is equal then the NUMERIC cidr portion of the masks are compared. This leads to the counterintuitive result that /24 > /16 Comparison should not be done on netaddr objects with different CIDR as this may produce indeterminate - unexpected results, rather the determination of which netblock is larger or smaller should be done by comparing $ip1->masklen <=> $ip2->masklen =item B<Addition of a constant (C<+>)> Add a 32 bit signed constant to the address part of a NetAddr object. This operation changes the address part to point so many hosts above the current objects start address. For instance, this code: print NetAddr::IP::Lite->new('127.0.0.1/8') + 5; will output 127.0.0.6/8. The address will wrap around at the broadcast back to the network address. This code: print NetAddr::IP::Lite->new('10.0.0.1/24') + 255; outputs 10.0.0.0/24. Returns the the unchanged object when the constant is missing or out of range. 2147483647 <= constant >= -2147483648 =cut sub plus { my $ip = shift; my $const = shift; return $ip unless $const && $const < 2147483648 && $const > -2147483649; my $a = $ip->{addr}; my $m = $ip->{mask}; my $lo = $a & ~$m; my $hi = $a & $m; my $new = ((addconst($lo,$const))[1] & ~$m) | $hi; return _new($ip,$new,$m); } =item B<Subtraction of a constant (C<->)> The complement of the addition of a constant. =item B<Difference (C<->)> Returns the difference between the address parts of two NetAddr::IP::Lite objects address parts as a 32 bit signed number. Returns B<undef> if the difference is out of range. =cut my $_smsk = pack('L3N',0xffffffff,0xffffffff,0xffffffff,0x80000000); sub minus { my $ip = shift; my $arg = shift; unless (ref $arg) { return plus($ip, -$arg); } my($carry,$dif) = sub128($ip->{addr},$arg->{addr}); if ($carry) { # value is positive return undef if hasbits($dif & $_smsk); # all sign bits should be 0's return (unpack('L3N',$dif))[3]; } else { return undef if hasbits(($dif & $_smsk) ^ $_smsk); # sign is 1's return (unpack('L3N',$dif))[3] - 4294967296; } } # Auto-increment an object =item B<Auto-increment> Auto-incrementing a NetAddr::IP::Lite object causes the address part to be adjusted to the next host address within the subnet. It will wrap at the broadcast address and start again from the network address. =cut sub plusplus { my $ip = shift; my $a = $ip->{addr}; my $m = $ip->{mask}; my $lo = $a & ~ $m; my $hi = $a & $m; $ip->{addr} = ((addconst($lo,1))[1] & ~ $m) | $hi; return $ip; } =item B<Auto-decrement> Auto-decrementing a NetAddr::IP::Lite object performs exactly the opposite of auto-incrementing it, as you would expect. =cut sub minusminus { my $ip = shift; my $a = $ip->{addr}; my $m = $ip->{mask}; my $lo = $a & ~$m; my $hi = $a & $m; $ip->{addr} = ((addconst($lo,-1))[1] & ~$m) | $hi; return $ip; } ############################################# # End of the overload methods. ############################################# # Preloaded methods go here. # This is a variant to ->new() that # creates and blesses a new object # without the fancy parsing of # IP formats and shorthands. # return a blessed IP object without parsing # input: prototype, naddr, nmask # returns: blessed IP object # sub _new ($$$) { my $proto = shift; my $class = ref($proto) || die "reference required"; $proto = $proto->{isv6}; my $self = { addr => $_[0], mask => $_[1], isv6 => $proto, }; return bless $self, $class; } =pod =back =head2 Methods =over =item C<-E<gt>new([$addr, [ $mask|IPv6 ]])> =item C<-E<gt>new6([$addr, [ $mask]])> =item C<-E<gt>new6FFFF([$addr, [ $mask]])> =item C<-E<gt>new_no([$addr, [ $mask]])> =item C<-E<gt>new_from_aton($netaddr)> =item new_cis and new_cis6 are DEPRECATED =item C<-E<gt>new_cis("$addr $mask)> =item C<-E<gt>new_cis6("$addr $mask)> The first three methods create a new address with the supplied address in C<$addr> and an optional netmask C<$mask>, which can be omitted to get a /32 or /128 netmask for IPv4 / IPv6 addresses respectively. new6FFFF specifically returns an IPv4 address in IPv6 format according to RFC4291 new6 ::xxxx:xxxx new6FFFF ::FFFF:xxxx:xxxx The third method C<new_no> is exclusively for IPv4 addresses and filters improperly formatted dot quad strings for leading 0's that would normally be interpreted as octal format by NetAddr per the specifications for inet_aton. B<new_from_aton> takes a packed IPv4 address and assumes a /32 mask. This function replaces the DEPRECATED :aton functionality which is fundamentally broken. The last two methods B<new_cis> and B<new_cis6> differ from B<new> and B<new6> only in that they except the common Cisco address notation for address/mask pairs with a B<space> as a separator instead of a slash (/) These methods are DEPRECATED because the functionality is now included in the other "new" methods i.e. ->new_cis('1.2.3.0 24') or ->new_cis6('::1.2.3.0 120') C<-E<gt>new6> and C<-E<gt>new_cis6> mark the address as being in ipV6 address space even if the format would suggest otherwise. i.e. ->new6('1.2.3.4') will result in ::102:304 addresses submitted to ->new in ipV6 notation will remain in that notation permanently. i.e. ->new('::1.2.3.4') will result in ::102:304 whereas new('1.2.3.4') would print out as 1.2.3.4 See "STRINGIFICATION" below. C<$addr> can be almost anything that can be resolved to an IP address in all the notations I have seen over time. It can optionally contain the mask in CIDR notation. If the OPTIONAL perl module Socket6 is available in the local library it will autoload and ipV6 host6 names will be resolved as well as ipV4 hostnames. B<prefix> notation is understood, with the limitation that the range specified by the prefix must match with a valid subnet. Addresses in the same format returned by C<inet_aton> or C<gethostbyname> can also be understood, although no mask can be specified for them. The default is to not attempt to recognize this format, as it seems to be seldom used. ###### DEPRECATED, will be remove in version 5 ############ To accept addresses in that format, invoke the module as in use NetAddr::IP::Lite ':aton' ###### USE new_from_aton instead ########################## If called with no arguments, 'default' is assumed. If called with an empty string as the argument, returns 'undef' C<$addr> can be any of the following and possibly more... n.n n.n/mm n.n mm n.n.n n.n.n/mm n.n.n mm n.n.n.n n.n.n.n/mm 32 bit cidr notation n.n.n.n mm n.n.n.n/m.m.m.m n.n.n.n m.m.m.m loopback, localhost, broadcast, any, default x.x.x.x/host 0xABCDEF, 0b111111000101011110, (or a bcd number) a netaddr as returned by 'inet_aton' Any RFC1884 notation ::n.n.n.n ::n.n.n.n/mmm 128 bit cidr notation ::n.n.n.n/::m.m.m.m ::x:x ::x:x/mmm x:x:x:x:x:x:x:x x:x:x:x:x:x:x:x/mmm x:x:x:x:x:x:x:x/m:m:m:m:m:m:m:m any RFC1884 notation loopback, localhost, unspecified, any, default ::x:x/host 0xABCDEF, 0b111111000101011110 within the limits of perl's number resolution 123456789012 a 'big' bcd number (bigger than perl likes) and Math::BigInt A Fully Qualified Domain Name which returns an ipV4 address or an ipV6 address, embodied in that order. This previously undocumented feature may be disabled with: use NetAddr::IP::Lite ':nofqdn'; If called with no arguments, 'default' is assumed. If called with and empty string as the argument, 'undef' is returned; =cut my $lbmask = inet_aton('255.0.0.0'); my $_p4broad = inet_any2n('255.255.255.255'); my $_p4loop = inet_any2n('127.0.0.1'); my $_p4mloop = inet_aton('255.0.0.0'); $_p4mloop = mask4to6($_p4mloop); my $_p6loop = inet_any2n('::1'); my %fip4 = ( default => Zeros, any => Zeros, broadcast => $_p4broad, loopback => $_p4loop, unspecified => undef, ); my %fip4m = ( default => Zeros, any => Zeros, broadcast => Ones, loopback => $_p4mloop, unspecified => undef, # not applicable for ipV4 host => Ones, ); my %fip6 = ( default => Zeros, any => Zeros, broadcast => undef, # not applicable for ipV6 loopback => $_p6loop, unspecified => Zeros, ); my %fip6m = ( default => Zeros, any => Zeros, broadcast => undef, # not applicable for ipV6 loopback => Ones, unspecified => Ones, host => Ones, ); my $ff000000 = pack('L3N',0xffffffff,0xffffffff,0xffffffff,0xFF000000); my $ffff0000 = pack('L3N',0xffffffff,0xffffffff,0xffffffff,0xFFFF0000); my $ffffff00 = pack('L3N',0xffffffff,0xffffffff,0xffffffff,0xFFFFFF00); sub _obits ($$) { my($lo,$hi) = @_; return 0xFF if $lo == $hi; return (~ ($hi ^ $lo)) & 0xFF; } sub new_no($;$$) { unshift @_, -1; goto &_xnew; } sub new($;$$) { unshift @_, 0; goto &_xnew; } sub new_from_aton($$) { my $proto = shift; my $class = ref $proto || $proto || __PACKAGE__; my $ip = shift; return undef unless defined $ip; my $addrlen = length($ip); return undef unless $addrlen == 4; my $self = { addr => ipv4to6($ip), mask => &Ones, isv6 => 0, }; return bless $self, $class; } sub new6($;$$) { unshift @_, 1; goto &_xnew; } sub new6FFFF($;$$) { my $ip = _xnew(1,@_); $ip->{addr} |= $_ipv4FFFF; return $ip; } sub new_cis($;$$) { my @in = @_; if ( $in[1] && $in[1] =~ m!^(.+)\s+(.+)$! ) { $in[1] = $1 .'/'. $2; } @_ = (0,@in); goto &_xnew; } sub new_cis6($;$$) { my @in = @_; if ( $in[1] && $in[1] =~ m!^(.+)\s+(.+)$! ) { $in[1] = $1 .'/'. $2; } @_ = (1,@in); goto &_xnew; } sub _no_octal { # $_[0] =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/; # return sprintf("%d.%d.%d.%d",$1,$2,$3,$4); (my $rv = $_[0]) =~ s#\b0*([1-9]\d*/?|0/?)#$1#g; # suppress leading zeros $rv; } sub _xnew($$;$$) { my $noctal = 0; my $isV6 = shift; if ($isV6 < 0) { # flag for no octal? $isV6 = 0; $noctal = 1; } my $proto = shift; my $class = ref $proto || $proto || __PACKAGE__; my $ip = shift; if ($ip && $noctal && $ip !~ m|(?:[^\s0123456789/. -])|) { # octal suppression required if not an IPv4 address $ip = _no_octal($ip); } # fix for bug #75976 return undef if defined $ip && $ip eq ''; $ip = 'default' unless defined $ip; $ip = _retMBIstring($ip) # treat as big bcd string if ref $ip && ref $ip eq 'Math::BigInt'; # can /CIDR notation my $hasmask = 1; my($mask,$tmp); # IP to lower case AFTER ref test for Math::BigInt. 'lc' strips blessing $ip = lc $ip; while (1) { # process IP's with no CIDR or that have the CIDR as part of the IP argument string unless (@_) { # if ($ip =~ m!^(.+)/(.+)$!) { if ($ip !~ /\D/) { # binary number notation $ip = bcd2bin($ip); $mask = Ones; last; } elsif ($ip =~ m!^([a-z0-9.:-]+)(?:/|\s+)([a-z0-9.:-]+)$! || $ip =~ m!^[\[]{1}([a-z0-9.:-]+)(?:/|\s+)([a-z0-9.:-]+)[\]]{1}$!) { $ip = $1; $mask = $2; } elsif (grep($ip eq $_,(qw(default any broadcast loopback unspecified)))) { $isV6 = 1 if $ip eq 'unspecified'; if ($isV6) { $mask = $fip6m{$ip}; return undef unless defined ($ip = $fip6{$ip}); } else { $mask = $fip4m{$ip}; return undef unless defined ($ip = $fip4{$ip}); } last; } } # process "ipv6" token and default IP's elsif (defined $_[0]) { if ($_[0] =~ /ipv6/i || $isV6) { if (grep($ip eq $_,(qw(default any loopback unspecified)))) { $mask = $fip6m{$ip}; $ip = $fip6{$ip}; last; } else { return undef unless $isV6; # add for ipv6 notation "12345, 1" } # $mask = lc $_[0]; # } else { # $mask = lc $_[0]; } # extract mask $mask = $_[0]; } ### ### process mask unless (defined $mask) { $hasmask = 0; $mask = 'host'; } # two kinds of IP's can turn on the isV6 flag # 1) big digits that are over the IPv4 boundry # 2) IPv6 IP syntax # # check these conditions and set isV6 as appropriate # my $try; $isV6 = 1 if # check big bcd and IPv6 rfc1884 ( $ip !~ /\D/ && # ip is all decimal (length($ip) > 3 || $ip > 255) && # exclude a single digit in the range of zero to 255, could be funny IPv4 ($try = bcd2bin($ip)) && ! isIPv4($try)) || # precedence so $try is not corrupted (index($ip,':') >= 0 && ($try = ipv6_aton($ip))); # fails if not an rfc1884 address # if either of the above conditions is true, $try contains the NetAddr 128 bit address # checkfor Math::BigInt mask $mask = _retMBIstring($mask) # treat as big bcd string if ref $mask && ref $mask eq 'Math::BigInt'; # MASK to lower case AFTER ref test for Math::BigInt, 'lc' strips blessing $mask = lc $mask; if ($mask !~ /\D/) { # bcd or CIDR notation my $isCIDR = length($mask) < 4 && $mask < 129; if ($isV6) { if ($isCIDR) { my($dq1,$dq2,$dq3,$dq4); if ($ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ && do {$dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1; } && $dq1 >= 0 && $dq1 < 256 && $dq2 >= 0 && $dq2 < 256 && $dq3 >= 0 && $dq3 < 256 && $dq4 >= 0 && $dq4 < 256 ) { # corner condition of IPv4 with isV6 $ip = join('.',$dq1,$dq2,$dq3,$dq4); $try = ipv4to6(inet_aton($ip)); if ($mask < 32) { $mask = shiftleft(Ones,32 -$mask); } elsif ($mask == 32) { $mask = Ones; } else { return undef; # undoubtably an error } } elsif ($mask < 128) { $mask = shiftleft(Ones,128 -$mask); # small cidr } else { $mask = Ones(); } } else { $mask = bcd2bin($mask); } } elsif ($isCIDR && $mask < 33) { # is V4 # if ($ip && $noctal && $ip !~ m|(?:[^\s0123456789.])|) { # octal suppression required if not an IPv4 address # $mask = _no_octal($mask); # } if ($mask < 32) { $mask = shiftleft(Ones,32 -$mask); } elsif ( $mask == 32) { $mask = Ones; } else { $mask = bcd2bin($mask); $mask |= $_v4mask; # v4 always } } else { # also V4 $mask = bcd2bin($mask); $mask |= $_v4mask; } if ($try) { # is a big number $ip = $try; last; } } elsif ($mask =~ m/^\d+\.\d+\.\d+\.\d+$/) { # ipv4 form of mask $mask = _no_octal($mask) if $noctal; # filter for octal return undef unless defined ($mask = inet_aton($mask)); $mask = mask4to6($mask); } elsif (grep($mask eq $_,qw(default any broadcast loopback unspecified host))) { if (index($ip,':') < 0 && ! $isV6) { return undef unless defined ($mask = $fip4m{$mask}); } else { return undef unless defined ($mask = $fip6m{$mask}); } } else { return undef unless defined ($mask = ipv6_aton($mask)); # try ipv6 form of mask } # process remaining IP's if (index($ip,':') < 0) { # ipv4 address if ($ip =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { ; # the common case } elsif (grep($ip eq $_,(qw(default any broadcast loopback)))) { return undef unless defined ($ip = $fip4{$ip}); last; } elsif ($ip =~ m/^(\d+)\.(\d+)$/) { $ip = ($hasmask) ? "${1}.${2}.0.0" : "${1}.0.0.${2}"; } elsif ($ip =~ m/^(\d+)\.(\d+)\.(\d+)$/) { $ip = ($hasmask) ? "${1}.${2}.${3}.0" : "${1}.${2}.0.${3}"; } elsif ($ip =~ /^(\d+)$/ && $hasmask && $1 >= 0 and $1 < 256) { # pure numeric $ip = sprintf("%d.0.0.0",$1); } # elsif ($ip =~ /^\d+$/ && !$hasmask) { # a big integer elsif ($ip =~ /^\d+$/ ) { # a big integer $ip = bcd2bin($ip); last; } # these next three might be broken??? but they have been in the code a long time and no one has complained elsif ($ip =~ /^0[xb]\d+$/ && $hasmask && (($tmp = eval "$ip") || 1) && $tmp >= 0 && $tmp < 256) { $ip = sprintf("%d.0.0.0",$tmp); } elsif ($ip =~ /^-?\d+$/) { $ip += 2 ** 32 if $ip < 0; $ip = pack('L3N',0,0,0,$ip); last; } elsif ($ip =~ /^-?0[xb]\d+$/) { $ip = eval "$ip"; $ip = pack('L3N',0,0,0,$ip); last; } # notations below include an implicit mask specification elsif ($ip =~ m/^(\d+)\.$/) { $ip = "${1}.0.0.0"; $mask = $ff000000; } elsif ($ip =~ m/^(\d+)\.(\d+)-(\d+)\.?$/ && $2 <= $3 && $3 < 256) { $ip = "${1}.${2}.0.0"; $mask = pack('L3C4',0xffffffff,0xffffffff,0xffffffff,255,_obits($2,$3),0,0); } elsif ($ip =~ m/^(\d+)-(\d+)\.?$/ and $1 <= $2 && $2 < 256) { $ip = "${1}.0.0.0"; $mask = pack('L3C4',0xffffffff,0xffffffff,0xffffffff,_obits($1,$2),0,0,0) } elsif ($ip =~ m/^(\d+)\.(\d+)\.$/) { $ip = "${1}.${2}.0.0"; $mask = $ffff0000; } elsif ($ip =~ m/^(\d+)\.(\d+)\.(\d+)-(\d+)\.?$/ && $3 <= $4 && $4 < 256) { $ip = "${1}.${2}.${3}.0"; $mask = pack('L3C4',0xffffffff,0xffffffff,0xffffffff,255,255,_obits($3,$4),0); } elsif ($ip =~ m/^(\d+)\.(\d+)\.(\d+)\.$/) { $ip = "${1}.${2}.${3}.0"; $mask = $ffffff00; } elsif ($ip =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)-(\d+)$/ && $4 <= $5 && $5 < 256) { $ip = "${1}.${2}.${3}.${4}"; $mask = pack('L3C4',0xffffffff,0xffffffff,0xffffffff,255,255,255,_obits($4,$5)); } elsif ($ip =~ m/^(\d+\.\d+\.\d+\.\d+) \s*-\s*(\d+\.\d+\.\d+\.\d+)$/x) { # if ($noctal) { # return undef unless ($ip = inet_aton(_no_octal($1))); # return undef unless ($tmp = inet_aton(_no_octal($2))); # } else { return undef unless ($ip = inet_aton($1)); return undef unless ($tmp = inet_aton($2)); # } # check for left side greater than right side # save numeric difference in $mask return undef if ($tmp = unpack('N',$tmp) - unpack('N',$ip)) < 0; $ip = ipv4to6($ip); $tmp = pack('L3N',0,0,0,$tmp); $mask = ~$tmp; return undef if notcontiguous($mask); # check for non-aligned left side return undef if hasbits($ip & $tmp); last; } # check for resolvable IPv4 hosts elsif (! $NoFQDN && $ip !~ /[^a-zA-Z0-9\._-]/ && ($tmp = gethostbyname(fillIPv4($ip))) && $tmp ne $_v4zero && $tmp ne $_zero ) { $ip = ipv4to6($tmp); last; } # check for resolvable IPv6 hosts elsif (! $NoFQDN && $ip !~ /[^a-zA-Z0-9\._-]/ && havegethostbyname2() && ($tmp = naip_gethostbyname($ip))) { $ip = $tmp; $isV6 = 1; last; } elsif ($Accept_Binary_IP && ! $hasmask) { if (length($ip) == 4) { $ip = ipv4to6($ip); } elsif (length($ip) == 16) { $isV6 = 1; } else { return undef; } last; } else { return undef; } return undef unless defined ($ip = inet_aton($ip)); $ip = ipv4to6($ip); last; } ########## continuing else { # ipv6 address $isV6 = 1; $ip = $1 if $ip =~ /\[([^\]]+)\]/; # transform URI notation if (defined ($tmp = ipv6_aton($ip))) { $ip = $tmp; last; } last if grep($ip eq $_,(qw(default any loopback unspecified))) && defined ($ip = $fip6{$ip}); return undef; } } # end while (1) return undef if notcontiguous($mask); # invalid if not contiguous my $self = { addr => $ip, mask => $mask, isv6 => $isV6, }; return bless $self, $class; } =item C<-E<gt>broadcast()> Returns a new object referring to the broadcast address of a given subnet. The broadcast address has all ones in all the bit positions where the netmask has zero bits. This is normally used to address all the hosts in a given subnet. =cut sub broadcast ($) { my $ip = _new($_[0],$_[0]->{addr} | ~$_[0]->{mask},$_[0]->{mask}); $ip->{addr} &= V4net unless $ip->{isv6}; return $ip; } =item C<-E<gt>network()> Returns a new object referring to the network address of a given subnet. A network address has all zero bits where the bits of the netmask are zero. Normally this is used to refer to a subnet. =cut sub network ($) { return _new($_[0],$_[0]->{addr} & $_[0]->{mask},$_[0]->{mask}); } =item C<-E<gt>addr()> Returns a scalar with the address part of the object as an IPv4 or IPv6 text string as appropriate. This is useful for printing or for passing the address part of the NetAddr::IP::Lite object to other components that expect an IP address. If the object is an ipV6 address or was created using ->new6($ip) it will be reported in ipV6 hex format otherwise it will be reported in dot quad format only if it resides in ipV4 address space. =cut sub addr ($) { return ($_[0]->{isv6}) ? ipv6_n2x($_[0]->{addr}) : inet_n2dx($_[0]->{addr}); } =item C<-E<gt>mask()> Returns a scalar with the mask as an IPv4 or IPv6 text string as described above. =cut sub mask ($) { return ipv6_n2x($_[0]->{mask}) if $_[0]->{isv6}; my $mask = isIPv4($_[0]->{addr}) ? $_[0]->{mask} & V4net : $_[0]->{mask}; return inet_n2dx($mask); } =item C<-E<gt>masklen()> Returns a scalar the number of one bits in the mask. =cut sub masklen ($) { my $len = (notcontiguous($_[0]->{mask}))[1]; return 0 unless $len; return $len if $_[0]->{isv6}; return isIPv4($_[0]->{addr}) ? $len -96 : $len; } =item C<-E<gt>bits()> Returns the width of the address in bits. Normally 32 for v4 and 128 for v6. =cut sub bits { return $_[0]->{isv6} ? 128 : 32; } =item C<-E<gt>version()> Returns the version of the address or subnet. Currently this can be either 4 or 6. =cut sub version { my $self = shift; return $self->{isv6} ? 6 : 4; } =item C<-E<gt>cidr()> Returns a scalar with the address and mask in CIDR notation. A NetAddr::IP::Lite object I<stringifies> to the result of this function. (see comments about ->new6() and ->addr() for output formats) =cut sub cidr ($) { return $_[0]->addr . '/' . $_[0]->masklen; } =item C<-E<gt>aton()> Returns the address part of the NetAddr::IP::Lite object in the same format as the C<inet_aton()> or C<ipv6_aton> function respectively. If the object was created using ->new6($ip), the address returned will always be in ipV6 format, even for addresses in ipV4 address space. =cut sub aton { return $_[0]->{addr} if $_[0]->{isv6}; return isIPv4($_[0]->{addr}) ? ipv6to4($_[0]->{addr}) : $_[0]->{addr}; } =item C<-E<gt>range()> Returns a scalar with the base address and the broadcast address separated by a dash and spaces. This is called range notation. =cut sub range ($) { return $_[0]->network->addr . ' - ' . $_[0]->broadcast->addr; } =item C<-E<gt>numeric()> When called in a scalar context, will return a numeric representation of the address part of the IP address. When called in an array context, it returns a list of two elements. The first element is as described, the second element is the numeric representation of the netmask. This method is essential for serializing the representation of a subnet. =cut sub numeric ($) { if (wantarray) { if (! $_[0]->{isv6} && isIPv4($_[0]->{addr})) { return ( sprintf("%u",unpack('N',ipv6to4($_[0]->{addr}))), sprintf("%u",unpack('N',ipv6to4($_[0]->{mask})))); } else { return ( bin2bcd($_[0]->{addr}), bin2bcd($_[0]->{mask})); } } return (! $_[0]->{isv6} && isIPv4($_[0]->{addr})) ? sprintf("%u",unpack('N',ipv6to4($_[0]->{addr}))) : bin2bcd($_[0]->{addr}); } =item C<-E<gt>bigint()> When called in a scalar context, will return a Math::BigInt representation of the address part of the IP address. When called in an array contest, it returns a list of two elements. The first element is as described, the second element is the Math::BigInt representation of the netmask. =cut my $biloaded; my $bi2strng; my $no_mbi_emu = 1; # function to force into test development mode # sub _force_bi_emu { undef $biloaded; undef $bi2strng; $no_mbi_emu = 0; print STDERR "\n\n\tWARNING: test development mode, this \tmessage SHOULD NEVER BE SEEN IN PRODUCTION! set my \$no_mbi_emu = 1 in t/bigint.t to remove this warning\n\n"; } # function to stringify various flavors of Math::BigInt objects # tests to see if the object is a hash or a signed scalar sub _bi_stfy { "$_[0]" =~ /(\d+)/; # stringify and remove '+' if present $1; } sub _fakebi2strg { ${$_[0]} =~ /(\d+)/; $1; } # fake new from bi string Math::BigInt 0.01 # sub _bi_fake { bless \('+'. $_[1]), 'Math::BigInt'; } # as of this writing there are three known flavors of Math::BigInt # v0.01 MBI::new returns a scalar ref # v1.?? - 1.69 CALC::_new takes a reference to a scalar, returns an array, MBI returns a hash ref # v1.70 and up CALC::_new takes a scalar, returns and array, MBI returns a hash ref sub _loadMBI { # load Math::BigInt on demand if (eval {$no_mbi_emu && require Math::BigInt}) { # any version should work, three known import Math::BigInt; $biloaded = \&Math::BigInt::new; $bi2strng = \&_bi_stfy; } else { $biloaded = \&_bi_fake; $bi2strng = \&_fakebi2strg; } } sub _retMBIstring { _loadMBI unless $biloaded; # load Math::BigInt on demand $bi2strng->(@_); } sub _biRef { _loadMBI unless $biloaded; # load Math::BigInt on demand $biloaded->('Math::BigInt',$_[0]); } sub bigint($) { my($addr,$mask); if (wantarray) { if (! $_[0]->{isv6} && isIPv4($_[0]->{addr})) { $addr = $_[0]->{addr} ? sprintf("%u",unpack('N',ipv6to4($_[0]->{addr}))) : 0; $mask = $_[0]->{mask} ? sprintf("%u",unpack('N',ipv6to4($_[0]->{mask}))) : 0; } else { $addr = $_[0]->{addr} ? bin2bcd($_[0]->{addr}) : 0; $mask = $_[0]->{mask} ? bin2bcd($_[0]->{mask}) : 0; } (_biRef($addr),_biRef($mask)); } else { # not wantarray if (! $_[0]->{isv6} && isIPv4($_[0]->{addr})) { $addr = $_[0]->{addr} ? sprintf("%u",unpack('N',ipv6to4($_[0]->{addr}))) : 0; } else { $addr = $_[0]->{addr} ? bin2bcd($_[0]->{addr}) : 0; } _biRef($addr); } } =item C<$me-E<gt>contains($other)> Returns true when C<$me> completely contains C<$other>. False is returned otherwise and C<undef> is returned if C<$me> and C<$other> are not both C<NetAddr::IP::Lite> objects. =cut sub contains ($$) { return within(@_[1,0]); } =item C<$me-E<gt>within($other)> The complement of C<-E<gt>contains()>. Returns true when C<$me> is completely contained within C<$other>, undef if C<$me> and C<$other> are not both C<NetAddr::IP::Lite> objects. =cut sub within ($$) { return 1 unless hasbits($_[1]->{mask}); # 0x0 contains everything my $netme = $_[0]->{addr} & $_[0]->{mask}; my $brdme = $_[0]->{addr} | ~ $_[0]->{mask}; my $neto = $_[1]->{addr} & $_[1]->{mask}; my $brdo = $_[1]->{addr} | ~ $_[1]->{mask}; return (sub128($netme,$neto) && sub128($brdo,$brdme)) ? 1 : 0; } =item C-E<gt>is_rfc1918()> Returns true when C<$me> is an RFC 1918 address. 10.0.0.0 - 10.255.255.255 (10/8 prefix) 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) =cut my $ip_10 = NetAddr::IP::Lite->new('10.0.0.0/8'); my $ip_10n = $ip_10->{addr}; # already the right value my $ip_10b = $ip_10n | ~ $ip_10->{mask}; my $ip_172 = NetAddr::IP::Lite->new('172.16.0.0/12'); my $ip_172n = $ip_172->{addr}; # already the right value my $ip_172b = $ip_172n | ~ $ip_172->{mask}; my $ip_192 = NetAddr::IP::Lite->new('192.168.0.0/16'); my $ip_192n = $ip_192->{addr}; # already the right value my $ip_192b = $ip_192n | ~ $ip_192->{mask}; sub is_rfc1918 ($) { my $netme = $_[0]->{addr} & $_[0]->{mask}; my $brdme = $_[0]->{addr} | ~ $_[0]->{mask}; return 1 if (sub128($netme,$ip_10n) && sub128($ip_10b,$brdme)); return 1 if (sub128($netme,$ip_192n) && sub128($ip_192b,$brdme)); return (sub128($netme,$ip_172n) && sub128($ip_172b,$brdme)) ? 1 : 0; } =item C<-E<gt>is_local()> Returns true when C<$me> is a local network address. i.e. ipV4 127.0.0.0 - 127.255.255.255 or ipV6 === ::1 =cut my $_lclhost6 = NetAddr::IP::Lite->new('::1'); my $_lclnet = NetAddr::IP::Lite->new('127/8'); sub is_local ($) { return ($_[0]->{isv6}) ? $_[0] == $_lclhost6 : $_[0]->within($_lclnet); } =item C<-E<gt>first()> Returns a new object representing the first usable IP address within the subnet (ie, the first host address). =cut my $_cidr127 = pack('N4',0xffffffff,0xffffffff,0xffffffff,0xfffffffe); sub first ($) { if (hasbits($_[0]->{mask} ^ $_cidr127)) { return $_[0]->network + 1; } else { return $_[0]->network; } # return $_[0]->network + 1; } =item C<-E<gt>last()> Returns a new object representing the last usable IP address within the subnet (ie, one less than the broadcast address). =cut sub last ($) { if (hasbits($_[0]->{mask} ^ $_cidr127)) { return $_[0]->broadcast - 1; } else { return $_[0]->broadcast; } # return $_[0]->broadcast - 1; } =item C<-E<gt>nth($index)> Returns a new object representing the I<n>-th usable IP address within the subnet (ie, the I<n>-th host address). If no address is available (for example, when the network is too small for C<$index> hosts), C<undef> is returned. Version 4.00 of NetAddr::IP and version 1.00 of NetAddr::IP::Lite implements C<-E<gt>nth($index)> and C<-E<gt>num()> exactly as the documentation states. Previous versions behaved slightly differently and not in a consistent manner. To use the old behavior for C<-E<gt>nth($index)> and C<-E<gt>num()>: use NetAddr::IP::Lite qw(:old_nth); old behavior: NetAddr::IP->new('10/32')->nth(0) == undef NetAddr::IP->new('10/32')->nth(1) == undef NetAddr::IP->new('10/31')->nth(0) == undef NetAddr::IP->new('10/31')->nth(1) == 10.0.0.1/31 NetAddr::IP->new('10/30')->nth(0) == undef NetAddr::IP->new('10/30')->nth(1) == 10.0.0.1/30 NetAddr::IP->new('10/30')->nth(2) == 10.0.0.2/30 NetAddr::IP->new('10/30')->nth(3) == 10.0.0.3/30 Note that in each case, the broadcast address is represented in the output set and that the 'zero'th index is alway undef except for a point-to-point /31 or /127 network where there are exactly two addresses in the network. new behavior: NetAddr::IP->new('10/32')->nth(0) == 10.0.0.0/32 NetAddr::IP->new('10.1/32'->nth(0) == 10.0.0.1/32 NetAddr::IP->new('10/31')->nth(0) == 10.0.0.0/32 NetAddr::IP->new('10/31')->nth(1) == 10.0.0.1/32 NetAddr::IP->new('10/30')->nth(0) == 10.0.0.1/30 NetAddr::IP->new('10/30')->nth(1) == 10.0.0.2/30 NetAddr::IP->new('10/30')->nth(2) == undef Note that a /32 net always has 1 usable address while a /31 has exactly two usable addresses for point-to-point addressing. The first index (0) returns the address immediately following the network address except for a /31 or /127 when it return the network address. =cut sub nth ($$) { my $self = shift; my $count = shift; my $slash31 = ! hasbits($self->{mask} ^ $_cidr127); if ($Old_nth) { return undef if $slash31 && $count != 1; return undef if ($count < 1 or $count > $self->num ()); } elsif ($slash31) { return undef if ($count && $count != 1); # only index 0, 1 allowed for /31 } else { ++$count; return undef if ($count < 1 or $count > $self->num ()); } return $self->network + $count; } =item C<-E<gt>num()> As of version 4.42 of NetAddr::IP and version 1.27 of NetAddr::IP::Lite a /31 and /127 with return a net B<num> value of 2 instead of 0 (zero) for point-to-point networks. Version 4.00 of NetAddr::IP and version 1.00 of NetAddr::IP::Lite return the number of usable IP addresses within the subnet, not counting the broadcast or network address. Previous versions worked only for ipV4 addresses, returned a maximum span of 2**32 and returned the number of IP addresses not counting the broadcast address. (one greater than the new behavior) To use the old behavior for C<-E<gt>nth($index)> and C<-E<gt>num()>: use NetAddr::IP::Lite qw(:old_nth); WARNING: NetAddr::IP will calculate and return a numeric string for network ranges as large as 2**128. These values are TEXT strings and perl can treat them as integers for numeric calculations. Perl on 32 bit platforms only handles integer numbers up to 2**32 and on 64 bit platforms to 2**64. If you wish to manipulate numeric strings returned by NetAddr::IP that are larger than 2**32 or 2**64, respectively, you must load additional modules such as Math::BigInt, bignum or some similar package to do the integer math. =cut sub num ($) { if ($Old_nth) { my @net = unpack('L3N',$_[0]->{mask} ^ Ones); # number of ip's less broadcast return 0xfffffffe if $net[0] || $net[1] || $net[2]; # 2**32 -1 return $net[3] if $net[3]; } else { # returns 1 for /32 /128, 2 for /31 /127 else n-2 up to 2**32 (undef, my $net) = addconst($_[0]->{mask},1); return 1 unless hasbits($net); # ipV4/32 or ipV6/128 $net = $net ^ Ones; return 2 unless hasbits($net); # ipV4/31 or ipV6/127 $net &= $_v4net unless $_[0]->{isv6}; return bin2bcd($net); } } # deprecated #sub num ($) { # my @net = unpack('L3N',$_[0]->{mask} ^ Ones); # if ($Old_nth) { ## number of ip's less broadcast # return 0xfffffffe if $net[0] || $net[1] || $net[2]; # 2**32 -1 # return $net[3] if $net[3]; # } else { # returns 1 for /32 /128, 0 for /31 /127 else n-2 up to 2**32 ## number of usable IP's === number of ip's less broadcast & network addys # return 0xfffffffd if $net[0] || $net[1] || $net[2]; # 2**32 -2 # return 1 unless $net[3]; # $net[3]--; # } # return $net[3]; #} =pod =back =cut sub import { if (grep { $_ eq ':aton' } @_) { $Accept_Binary_IP = 1; @_ = grep { $_ ne ':aton' } @_; } if (grep { $_ eq ':old_nth' } @_) { $Old_nth = 1; @_ = grep { $_ ne ':old_nth' } @_; } if (grep { $_ eq ':lower' } @_) { NetAddr::IP::Util::lower(); @_ = grep { $_ ne ':lower' } @_; } if (grep { $_ eq ':upper' } @_) { NetAddr::IP::Util::upper(); @_ = grep { $_ ne ':upper' } @_; } if (grep { $_ eq ':nofqdn' } @_) { $NoFQDN = 1; @_ = grep { $_ ne ':nofqdn' } @_; } NetAddr::IP::Lite->export_to_level(1, @_); } =head1 EXPORT_OK Zeros Ones V4mask V4net :aton DEPRECATED :old_nth :upper :lower :nofqdn =head1 AUTHORS Luis E. Muñoz E<lt>luismunoz@cpan.orgE<gt>, Michael Robinton E<lt>michael@bizsystems.comE<gt> =head1 WARRANTY This software comes with the same warranty as perl itself (ie, none), so by using it you accept any and all the liability. =head1 COPYRIGHT This software is (c) Luis E. Muñoz, 1999 - 2005 and (c) Michael Robinton, 2006 - 2014. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the "Artistic License" which comes with this distribution. 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 either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this distribution, in the file named "Artistic". If not, I'll be glad to provide one. You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =head1 SEE ALSO NetAddr::IP(3), NetAddr::IP::Util(3), NetAddr::IP::InetBase(3) =cut 1; Lite/MANIFEST.SKIP 0000644 00000000431 15043770025 0007340 0 ustar 00 ^Build$ ^_build/ ^blib/ ^blibdirs Makefile$ Makefile\.[a-z]+$ pm_to_blib CVS/.* \.cvs ,v$ ^tmp/ \.old$ \.bak$ \.tmp$ \.xsc$ ~$ ^# \.shar$ \.tar$ \.tgz$ \.tar\.gz$ \.zip$ _uu$ Util_IS\.pm$ Util\.(bs|[co])$ localStuff\.h$ config\.log$ config\.h$ config\.status localperl\.h META.yml Lite/Makefile 0000644 00000061015 15043770025 0007107 0 ustar 00 # This Makefile is for the NetAddr::IP::Lite extension to perl. # # It was generated automatically by MakeMaker version # 7.60 (Revision: 76000) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # BUILD_REQUIRES => { } # CONFIGURE_REQUIRES => { } # NAME => q[NetAddr::IP::Lite] # PREREQ_PM => { Test::More=>q[0] } # TEST_REQUIRES => { } # VERSION_FROM => q[Lite.pm] # clean => { FILES=>q[*~ tmp* META.yml] } # dist => { COMPRESS=>q[gzip], SUFFIX=>q[gz] } # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /usr/lib64/perl5/Config.pm). # They may have been overridden via Makefile.PL or on the command line. AR = ar CC = gcc CCCDLFLAGS = -fPIC CCDLFLAGS = -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 DLEXT = so DLSRC = dl_dlopen.xs EXE_EXT = FULL_AR = /usr/bin/ar LD = gcc LDDLFLAGS = -lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -L/usr/local/lib -fstack-protector-strong LDFLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fstack-protector-strong -L/usr/local/lib LIBC = /lib/../lib64/libc.so.6 LIB_EXT = .a OBJ_EXT = .o OSNAME = linux OSVERS = 4.18.0-513.18.1.el8_9.x86_64 RANLIB = : SITELIBEXP = /usr/local/share/perl5/5.32 SITEARCHEXP = /usr/local/lib64/perl5/5.32 SO = so VENDORARCHEXP = /usr/lib64/perl5/vendor_perl VENDORLIBEXP = /usr/share/perl5/vendor_perl # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = / DFSEP = $(DIRFILESEP) NAME = NetAddr::IP::Lite NAME_SYM = NetAddr_IP_Lite VERSION = 1.57 VERSION_MACRO = VERSION VERSION_SYM = 1_57 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 1.57 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = ../blib/arch INST_SCRIPT = ../blib/script INST_BIN = ../blib/bin INST_LIB = ../blib/lib INST_MAN1DIR = ../blib/man1 INST_MAN3DIR = ../blib/man3 MAN1EXT = 1 MAN3EXT = 3pm MAN1SECTION = 1 MAN3SECTION = 3 INSTALLDIRS = site DESTDIR = PREFIX = $(SITEPREFIX) PERLPREFIX = /usr SITEPREFIX = /usr/local VENDORPREFIX = /usr INSTALLPRIVLIB = /usr/share/perl5 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /usr/local/share/perl5/5.32 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /usr/share/perl5/vendor_perl DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /usr/lib64/perl5 DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /usr/local/lib64/perl5/5.32 DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /usr/lib64/perl5/vendor_perl DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/local/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLSITESCRIPT = /usr/local/bin DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) INSTALLVENDORSCRIPT = /usr/bin DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/local/share/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/local/share/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = /usr/share/perl5 PERL_ARCHLIB = /usr/lib64/perl5 PERL_ARCHLIBDEP = /usr/lib64/perl5 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKEFILE_OLD = Makefile.old MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /usr/lib64/perl5/CORE PERL_INCDEP = /usr/lib64/perl5/CORE PERL = "/usr/bin/perl" FULLPERL = "/usr/bin/perl" ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" PERL_CORE = 0 PERM_DIR = 755 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm MM_VERSION = 7.60 MM_REVISION = 76000 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. MAKE = make FULLEXT = NetAddr/IP/Lite BASEEXT = Lite PARENT_NAME = NetAddr::IP DLBASE = $(BASEEXT) VERSION_FROM = Lite.pm OBJECT = LDFROM = $(OBJECT) LINKTYPE = dynamic BOOTDEP = # Handy lists of source code files: XS_FILES = C_FILES = O_FILES = H_FILES = MAN1PODS = MAN3PODS = Lite.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIBDEP)$(DFSEP)Config.pm $(PERL_INCDEP)$(DFSEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)/NetAddr/IP INST_ARCHLIBDIR = $(INST_ARCHLIB)/NetAddr/IP INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = INST_DYNAMIC = INST_BOOT = # Extra linker info EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVEDEP = PERL_ARCHIVE_AFTER = TO_INST_PM = Lite.pm # --- MakeMaker platform_constants section: MM_Unix_VERSION = 7.60 PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$$$ARGV[0], $$$$ARGV[1], 0, 1, 1)' -- # --- MakeMaker tool_xsubpp section: XSUBPPDIR = /usr/share/perl5/vendor_perl/ExtUtils XSUBPP = "$(XSUBPPDIR)$(DFSEP)xsubpp" XSUBPPRUN = $(PERLRUN) $(XSUBPP) XSPROTOARG = XSUBPPDEPS = /usr/share/perl5/ExtUtils/typemap /usr/share/perl5/vendor_perl/ExtUtils$(DFSEP)xsubpp XSUBPPARGS = -typemap '/usr/share/perl5/ExtUtils/typemap' XSUBPP_EXTRA_ARGS = # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp MV = mv NOOP = $(TRUE) NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- FALSE = false TRUE = true ECHO = echo ECHO_N = echo -n UNINST = 0 VERBINST = 0 MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- MACROSTART = MACROEND = USEMAKEFILE = -f FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- CP_NONEMPTY = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'cp_nonempty' -- # --- MakeMaker makemakerdflt section: makemakerdflt : all $(NOECHO) $(NOOP) # --- MakeMaker dist section skipped. # --- MakeMaker macro section: # --- MakeMaker depend section: # --- MakeMaker cflags section: CCFLAGS = -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 OPTIMIZE = -g PERLTYPE = MPOLLUTE = # --- MakeMaker const_loadlibs section: # NetAddr::IP::Lite might depend on some other libraries: # See ExtUtils::Liblist for details # # --- MakeMaker const_cccmd section: CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) # --- MakeMaker post_constants section: MY_POD2TEXT = /usr/bin/pod2text # --- MakeMaker pasthru section: PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ OPTIMIZE="$(OPTIMIZE)"\ PREFIX="$(PREFIX)"\ PASTHRU_DEFINE='$(DEFINE) $(PASTHRU_DEFINE)'\ PASTHRU_INC='$(INC) $(PASTHRU_INC)' # --- MakeMaker special_targets section: .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir pure_all subdirs clean_subdirs makemakerdflt manifypods realclean_subdirs subdirs_dynamic subdirs_pure_nolink subdirs_static subdirs-test_dynamic subdirs-test_static test_dynamic test_static # --- MakeMaker c_o section: .c.i: gcc -E -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i .c.s : $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .c$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .cpp$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp .cxx$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx .cc$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc .C$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C # --- MakeMaker xs_c section: .xs.c: $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc $(MV) $*.xsc $*.c # --- MakeMaker xs_o section: .xs$(OBJ_EXT) : $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc $(MV) $*.xsc $*.c $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c # --- MakeMaker top_targets section: all :: pure_all manifypods $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext README $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs $(NOECHO) $(NOOP) help : perldoc ExtUtils::MakeMaker # --- MakeMaker blibdirs section: blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists $(NOECHO) $(NOOP) # Backwards compat with 6.18 through 6.25 blibdirs.ts : blibdirs $(NOECHO) $(NOOP) $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHLIB) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_BIN) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_SCRIPT) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN1DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists # --- MakeMaker linkext section: linkext :: dynamic $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic_bs section: BOOTSTRAP = # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) config $(INST_BOOT) $(INST_DYNAMIC) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_lib section: # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all config \ Lite.pm $(NOECHO) $(POD2MAN) --section=$(MAN3SECTION) --perm_rw=$(PERM_RW) -u \ Lite.pm $(INST_MAN3DIR)/NetAddr::IP::Lite.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # The default clean, realclean and test targets in this Makefile # have automatically been given entries for each subdir. subdirs :: $(NOECHO) cd Util && $(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU) # --- MakeMaker clean_subdirs section: clean_subdirs : $(ABSPERLRUN) -e 'exit 0 unless chdir '\''Util'\''; system '\''$(MAKE) clean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';' -- # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs - $(RM_F) \ $(BASEEXT).bso $(BASEEXT).def \ $(BASEEXT).exp $(BASEEXT).x \ $(BOOTSTRAP) $(INST_ARCHAUTODIR)/extralibs.all \ $(INST_ARCHAUTODIR)/extralibs.ld $(MAKE_APERL_FILE) \ *$(LIB_EXT) *$(OBJ_EXT) \ *perl.core MYMETA.json \ MYMETA.yml blibdirs.ts \ core core.*perl.*.? \ core.[0-9] core.[0-9][0-9] \ core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] \ core.[0-9][0-9][0-9][0-9][0-9] lib$(BASEEXT).def \ mon.out perl \ perl$(EXE_EXT) perl.exe \ perlmain.c pm_to_blib \ pm_to_blib.ts so_locations \ tmon.out - $(RM_RF) \ *~ META.yml \ blib tmp* $(NOECHO) $(RM_F) $(MAKEFILE_OLD) - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) # --- MakeMaker realclean_subdirs section: # so clean is forced to complete before realclean_subdirs runs realclean_subdirs : clean - $(ABSPERLRUN) -e 'chdir '\''Util'\''; system '\''$(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) realclean'\'' if -f '\''$(MAKEFILE_OLD)'\'';' -- - $(ABSPERLRUN) -e 'chdir '\''Util'\''; system '\''$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) realclean'\'' if -f '\''$(FIRST_MAKEFILE)'\'';' -- # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete dist files realclean purge :: realclean_subdirs - $(RM_F) \ $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(RM_RF) \ $(DISTVNAME) # --- MakeMaker metafile section: metafile : create_distdir $(NOECHO) $(ECHO) Generating META.yml $(NOECHO) $(ECHO) '---' > META_new.yml $(NOECHO) $(ECHO) 'abstract: unknown' >> META_new.yml $(NOECHO) $(ECHO) 'author:' >> META_new.yml $(NOECHO) $(ECHO) ' - unknown' >> META_new.yml $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'dynamic_config: 1' >> META_new.yml $(NOECHO) $(ECHO) 'generated_by: '\''ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010'\''' >> META_new.yml $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml $(NOECHO) $(ECHO) ' version: '\''1.4'\''' >> META_new.yml $(NOECHO) $(ECHO) 'name: NetAddr-IP-Lite' >> META_new.yml $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml $(NOECHO) $(ECHO) ' directory:' >> META_new.yml $(NOECHO) $(ECHO) ' - t' >> META_new.yml $(NOECHO) $(ECHO) ' - inc' >> META_new.yml $(NOECHO) $(ECHO) 'requires:' >> META_new.yml $(NOECHO) $(ECHO) ' Test::More: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'version: '\''1.57'\''' >> META_new.yml $(NOECHO) $(ECHO) 'x_serialization_backend: '\''CPAN::Meta::YAML version 0.018'\''' >> META_new.yml -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml $(NOECHO) $(ECHO) Generating META.json $(NOECHO) $(ECHO) '{' > META_new.json $(NOECHO) $(ECHO) ' "abstract" : "unknown",' >> META_new.json $(NOECHO) $(ECHO) ' "author" : [' >> META_new.json $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "dynamic_config" : 1,' >> META_new.json $(NOECHO) $(ECHO) ' "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010",' >> META_new.json $(NOECHO) $(ECHO) ' "license" : [' >> META_new.json $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "meta-spec" : {' >> META_new.json $(NOECHO) $(ECHO) ' "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : 2' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "name" : "NetAddr-IP-Lite",' >> META_new.json $(NOECHO) $(ECHO) ' "no_index" : {' >> META_new.json $(NOECHO) $(ECHO) ' "directory" : [' >> META_new.json $(NOECHO) $(ECHO) ' "t",' >> META_new.json $(NOECHO) $(ECHO) ' "inc"' >> META_new.json $(NOECHO) $(ECHO) ' ]' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "prereqs" : {' >> META_new.json $(NOECHO) $(ECHO) ' "build" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "configure" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "runtime" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "Test::More" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : "1.57",' >> META_new.json $(NOECHO) $(ECHO) ' "x_serialization_backend" : "JSON::PP version 4.06"' >> META_new.json $(NOECHO) $(ECHO) '}' >> META_new.json -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json # --- MakeMaker signature section: signature : cpansign -s # --- MakeMaker dist_basics section skipped. # --- MakeMaker dist_core section skipped. # --- MakeMaker distdir section skipped. # --- MakeMaker dist_test section skipped. # --- MakeMaker dist_ci section skipped. # --- MakeMaker distmeta section: distmeta : create_distdir metafile $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.yml to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.json to MANIFEST: $${'\''@'\''}"' -- # --- MakeMaker distsignature section: distsignature : distmeta $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }' \ -e ' or die "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE cd $(DISTVNAME) && cpansign -s # --- MakeMaker install section skipped. # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE : $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: # --- MakeMaker makefile section: # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" $(FALSE) # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = ../perl FULLPERL = "/usr/bin/perl" MAP_PERLINC = "-I../blib/arch" "-I../blib/lib" "-I/usr/lib64/perl5" "-I/usr/share/perl5" # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t/*.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) $(NOECHO) $(NOOP) test :: $(TEST_TYPE) $(NOECHO) $(NOOP) # Occasionally we may face this degenerate target: test_ : test_dynamic $(NOECHO) $(NOOP) subdirs-test_dynamic :: dynamic pure_all $(NOECHO) cd Util && $(MAKE) test_dynamic $(PASTHRU) test_dynamic :: subdirs-test_dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: dynamic pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) subdirs-test_static :: static pure_all $(NOECHO) cd Util && $(MAKE) test_static $(PASTHRU) test_static :: subdirs-test_static $(MAP_TARGET) PERL_DL_NONLAZY=1 "/home/.cpan/build/NetAddr-IP-4.079-0/Lite/$(MAP_TARGET)" $(MAP_PERLINC) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_static :: static pure_all $(MAP_TARGET) PERL_DL_NONLAZY=1 "/home/.cpan/build/NetAddr-IP-4.079-0/Lite/$(MAP_TARGET)" $(MAP_PERLINC) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : $(NOECHO) $(ECHO) '<SOFTPKG NAME="NetAddr-IP-Lite" VERSION="1.57">' > NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <AUTHOR></AUTHOR>' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <REQUIRE NAME="Test::More" />' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="x86_64-linux-thread-multi-5.32" />' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> NetAddr-IP-Lite.ppd $(NOECHO) $(ECHO) '</SOFTPKG>' >> NetAddr-IP-Lite.ppd # --- MakeMaker pm_to_blib section: pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ 'Lite.pm' '$(INST_LIB)/NetAddr/IP/Lite.pm' $(NOECHO) $(TOUCH) pm_to_blib # --- MakeMaker selfdocument section: # here so even if top_targets is overridden, these will still be defined # gmake will silently still work if any are .PHONY-ed but nmake won't static :: $(NOECHO) $(NOOP) dynamic :: $(NOECHO) $(NOOP) config :: $(NOECHO) $(NOOP) # --- MakeMaker postamble section: README : Lite.pm @$(MY_POD2TEXT) Lite.pm > README # End. Lite/t/aton.t 0000644 00000001037 15043770025 0007036 0 ustar 00 #use diagnostics; use NetAddr::IP::Util qw( inet_n2dx ); use NetAddr::IP::Lite; $| = 1; print "1..2\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::4/120'); ## test aton my $exp = 'FF00:0:0:0:0:0:0:4'; my $txt = inet_n2dx($hiip->aton); print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; $exp = '1.2.3.4'; $txt = inet_n2dx($loip->aton); print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; Lite/t/new-nth.t 0000644 00000001271 15043770025 0007455 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip4 = NetAddr::IP::Lite->new('1.2.3.11/29'); my @try = qw( 0 1.2.3.9 1 1.2.3.10 2 1.2.3.11 3 1.2.3.12 4 1.2.3.13 5 1.2.3.14 6 undef ); print '1..', (@try/2) +2, "\n"; $test = 1; for (my $i=0;$i<@try;$i+=2) { my $rv = $ip4->nth($try[$i]); $rv = defined $rv ? $rv->addr : 'undef'; print "got: $rv, exp: $try[$i+1]\nnot " unless $rv eq $try[$i+1]; &ok; } print "got: $_, exp: 1\nnot " unless ($_ = NetAddr::IP::Lite->new('1.2.3.4/32')->num()) && $_ == 1; &ok; print "got: $_, exp: 0\nnot " unless defined ($_ = NetAddr::IP::Lite->new('1.2.3.4/31')->num()) && $_ == 2; &ok; Lite/t/contains.t 0000644 00000001145 15043770025 0007713 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..12\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $net4 = NetAddr::IP::Lite->new('1.2.3.5/30'); my $net6 = NetAddr::IP::Lite->new('FF::85/126'); my @try = qw( 1.2.3.3 0 1.2.3.4 1 1.2.3.5 1 1.2.3.6 1 1.2.3.7 1 1.2.3.8 0 FF::83 0 FF::84 1 FF::85 1 FF::86 1 FF::87 1 FF::88 0 ); for (my $i=0;$i<@try;$i+=2) { my $ip = NetAddr::IP::Lite->new($try[$i]); my $rv = ($try[$i] =~ /:/) ? $net6->contains($ip) : $net4->contains($ip); print "got: $rv, exp: $try[$i+1]\nnot " unless $rv == $try[$i+1]; &ok; } Lite/t/v6-cnew-uri.t 0000644 00000000671 15043770025 0010162 0 ustar 00 use NetAddr::IP::Lite; my @subnets = ( [ '[dead:beef:1234::/16]', 'DEAD:BEEF:1234:0:0:0:0:0/16' ], [ '[::1234:BEEF:DEAD/24]', '0:0:0:0:0:1234:BEEF:DEAD/24' ], ); $| = 1; print '1..', (scalar @subnets) , "\n"; my $count = 1; for my $n (@subnets) { my $ip = new NetAddr::IP::Lite $n->[0]; if ($ip eq $n->[1]) { print "ok $count\n"; } else { print $ip, "\nnot ok $count\n"; } ++ $count; } Lite/t/bug75976.t 0000644 00000001371 15043770025 0007275 0 ustar 00 BEGIN { $| = 1; print "1..7\n"; } END {print "not ok 1\n" unless $loaded;} $loaded = 1; print "ok 1\n"; #use diagnostics; use NetAddr::IP::Lite; $| = 1; my $test = 2; sub ok() { print 'ok ',$test++,"\n"; } my $ud = undef; my @bugtest = ( 0 => '0.0.0.0/32', '0:0:0:0:0:0:0:0/128', $ud => '0.0.0.0/0', '0:0:0:0:0:0:0:0/0', "" => 'undef', 'undef', ); for (my $i=0;$i <= $#bugtest;$i+=3) { my $ip6 = sprintf("%s", NetAddr::IP::Lite->new6($bugtest[$i]) || 'undef'); my $ip = sprintf ("%s", NetAddr::IP::Lite->new($bugtest[$i]) || 'undef'); my $expip = $bugtest[$i+1]; my $expip6 = $bugtest[$i+2]; print "got: $ip\nexp: $expip\nnot " unless $ip eq $expip; &ok; print "got: $ip6\nexp: $expip6\nnot " unless $ip6 eq $expip6; &ok; } Lite/t/v6-contains.t 0000644 00000003362 15043770025 0010247 0 ustar 00 use NetAddr::IP::Lite; use Test::More; my @yes_pairs = ( [ '::/0', '2001:620:0:4:a00:20ff:fe9c:7e4a' ], [ '3ffe:2000:0:4::/64', '3ffe:2000:0:4:a00:20ff:fe9c:7e4a' ], [ '3ffe:2000:0:4::/64', '3ffe:2000:0:4:a00:20ff:fe9c:7e4a/65' ], [ '2001:620:0:4::/64', '2001:620:0:4:a00:20ff:fe9c:7e4a' ], [ '2001:620:0:4::/64', '2001:620:0:4:a00:20ff:fe9c:7e4a/65' ], [ '2001:620:0:4::/64', '2001:620:0:4::1' ], [ '2001:620:0:4::/64', '2001:620:0:4:0:0:0:1' ], [ 'deaf:beef::/32', 'deaf:beef::1' ], [ 'deaf:beef::/32', 'deaf:beef::1:1' ], [ 'deaf:beef::/32', 'deaf:beef::1:0:1' ], [ 'deaf:beef::/32', 'deaf:beef::1:0:0:1' ], [ 'deaf:beef::/32', 'deaf:beef::1:0:0:0:1' ], ); my @no_pairs = ( [ '3ffe:2000:0:4::/64', '3ffe:2000:0:4:a00:20ff:fe9c:7e4a/63' ], [ '2001:620:0:4::/64', '2001:620:0:4:a00:20ff:fe9c:7e4a/63' ], [ 'deaf:beef::/32', 'dead:cafe::1' ], [ 'deaf:beef::/32', 'dead:cafe::1:1' ], [ 'deaf:beef::/32', 'dead:cafe::1:0:1' ], [ 'deaf:beef::/32', 'dead:cafe::1:0:0:1' ], [ 'deaf:beef::/32', 'dead:cafe::1:0:0:0:1' ], ); my $tests = 6 * @yes_pairs + 1; plan tests => $tests; ok(NetAddr::IP::Lite->new('::')->contains(NetAddr::IP::Lite->new('::')), ":: contains itself"); for my $p (@yes_pairs) { my $a = new NetAddr::IP::Lite $p->[0]; my $b = new NetAddr::IP::Lite $p->[1]; isa_ok($a, 'NetAddr::IP::Lite', "$p->[0]"); isa_ok($b, 'NetAddr::IP::Lite', "$p->[1]"); SKIP: { ok($a->contains($b), "->contains $p->[0], $p->[1] is true"); ok($b->within($a), "->within $p->[1], $p->[0] is true"); ok(!$b->contains($a), "->contains $p->[1], $p->[0] is false"); ok(!$a->within($b), "->within $p->[0], $p->[1] is false"); } } Lite/t/netaddr.t 0000644 00000013110 15043770025 0007511 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..35\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use Data::Dumper; use NetAddr::IP::Lite; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): =pod $rv=list2NetAddr(\@inlist,\@NAobject); Build of NetAddr object structure from a list of IPv4 addresses or address ranges. This object is passed to B<matchNetAddr> to check if a given IP address is contained in the list. input: array reference pointer to a list of addresses i.e. 11.22.33.44 11.22.33.0/24 11.22.33.0/255.255.255.0 11.22.33.20-11.22.33.46 11.22.33.20 - 11.22.33.46 output: Number of objects created or undef on error The NAobject array is filled with NetAddr::IP::Lite object references. =cut sub list2NetAddr { my($inref,$outref) = @_; return undef unless ref $inref eq 'ARRAY' && ref $outref eq 'ARRAY'; unless ($SKIP_NetAddrIP) { require NetAddr::IP::Lite; $SKIP_NetAddrIP = 1; } @$outref = (); my $IP; no strict; foreach $IP (@$inref) { $IP =~ s/\s//g; # 11.22.33.44 if ($IP =~ /^\d+\.\d+\.\d+\.\d+$/o) { push @$outref, NetAddr::IP::Lite->new($IP), 0; } # 11.22.33.44 - 11.22.33.49 elsif ($IP =~ /^(\d+\.\d+\.\d+\.\d+)\s*\-\s*(\d+\.\d+\.\d+\.\d+)$/o) { push @$outref, NetAddr::IP::Lite->new($1), NetAddr::IP::Lite->new($2); } # 11.22.33.44/63 elsif ($IP =~ m|^\d+\.\d+\.\d+\.\d+/\d+$|) { push @$outref, NetAddr::IP::Lite->new($IP), 0; } # 11.22.33.44/255.255.255.224 elsif ($IP =~ m|^\d+\.\d+\.\d+\.\d+/\d+\.\d+\.\d+\.\d+$|o) { push @$outref, NetAddr::IP::Lite->new($IP), 0; } # ignore un-matched IP patterns } return (scalar @$outref)/2; } =pod $rv = matchNetAddr($ip,\@NAobject); Check if an IP address appears in a list of NetAddr objects. input: dot quad IP address, reference to NetAddr objects output: true if match else false =cut sub matchNetAddr { my($ip,$naref) = @_; return 0 unless $ip && $ip =~ /\d+\.\d+\.\d+\.\d+/; $ip =~ s/\s//g; $ip = new NetAddr::IP::Lite($ip); my $i; for($i=0; $i <= $#{$naref}; $i += 2) { my $beg = $naref->[$i]; my $end = $naref->[$i+1]; if ($end) { return 1 if $ip >= $beg && $ip <= $end; } else { return 1 if $ip->within($beg); } } return 0; } $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 instantiate netaddr array # # A multi-formated array of IP address that will never be tarpitted. # # WARNING: if you are using a private network, then you should include the # address description for the net/subnets that you are using or you might # find your DMZ or internal mail servers blocked since many DNSBLS list the # private network addresses as BLACKLISTED # # 127./8, 10./8, 172.16/12, 192.168/16 # # class A xxx.0.0.0/8 # class B xxx.xxx.0.0/16 # class C xxx.xxx.xxx.0/24 0 # 128 subnet xxx.xxx.xxx.xxx/25 128 # 64 subnet xxx.xxx.xxx.xxx/26 192 # 32 subnet xxx.xxx.xxx.xxx/27 224 # 16 subnet xxx.xxx.xxx.xxx/28 240 # 8 subnet xxx.xxx.xxx.xxx/29 248 # 4 subnet xxx.xxx.xxx.xxx/30 252 # 2 subnet xxx.xxx.xxx.xxx/31 254 # single address xxx.xxx.xxx.xxx/32 255 # @tstrng = ( # a single address '11.22.33.44', # a range of ip's, ONLY VALID WITHIN THE SAME CLASS 'C' '22.33.44.55 - 22.33.44.65', '45.67.89.10-45.67.89.32', # a CIDR range '5.6.7.16/28', # a range specified with a netmask '7.8.9.128/255.255.255.240', # this should ALWAYS be here '127.0.0.0/8', # ignore all test entries and localhost ); my @NAobject; my $rv = list2NetAddr(\@tstrng,\@NAobject); print "wrong number of NA objects\ngot: $rv, exp: 6\nnot " unless $rv == 6; &ok; ## test 3 check disallowed terms print "accepted null parameter\nnot " if matchNetAddr(); &ok; ## test 4 check disallowed parm print "accepted non-numeric parameter\nnot " if matchNetAddr('junk'); &ok; ##test 5 check non-ip short print "accepted short ip segment\nnot " if matchNetAddr('1.2.3'); &ok; # yeah, it will accept a long one, but that's tough! ## test 6-35 bracket NA objects # my @chkary = # 5 x 6 tests # out left in left middle in right out right qw( 11.22.33.43 11.22.33.44 11.22.33.44 11.22.33.44 11.22.33.45 22.33.44.54 22.33.44.55 22.33.44.60 22.33.44.65 22.33.44.66 45.67.89.9 45.67.89.10 45.67.89.20 45.67.89.32 45.67.89.33 5.6.7.15 5.6.7.16 5.6.7.20 5.6.7.31 5.6.7.32 7.8.9.127 7.8.9.128 7.8.9.138 7.8.9.143 7.8.9.144 126.255.255.255 127.0.0.0 127.128.128.128 127.255.255.255 128.0.0.0 ); for(my $i=0;$i <= $#chkary; $i+=5) { print "accepted outside left bound $chkary[$i]\nnot " if matchNetAddr($chkary[$i],\@NAobject); &ok; print "rejected inside left bound $chkary[$i+1]\nnot " unless matchNetAddr($chkary[$i+1],\@NAobject); &ok; print "rejected inside middle bound $chkary[$i+2]\nnot " unless matchNetAddr($chkary[$i+2],\@NAobject); &ok; print "rejected inside right bound $chkary[$i+3]\nnot " unless matchNetAddr($chkary[$i+3],\@NAobject); &ok; print "accepted outside right bound $chkary[$i+4]\nnot " if matchNetAddr($chkary[$i+4],\@NAobject); &ok; } Lite/t/v4-old-first.t 0000644 00000001502 15043770025 0010324 0 ustar 00 use NetAddr::IP::Lite qw(:old_nth); my $nets = { '10.0.0.16' => [ 24, '10.0.0.1', '10.0.0.254', '10.0.0.10'], '10.0.0.5' => [ 30, '10.0.0.5', '10.0.0.6', 'undef' ], '10.128.0.1' => [ 8, '10.0.0.1', '10.255.255.254', '10.0.0.10'], '10.128.0.1' => [ 24, '10.128.0.1', '10.128.0.254', '10.128.0.10'], }; $| = 1; print "1..", (3 * scalar keys %$nets), "\n"; my $count = 1; for my $a (keys %$nets) { my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0]; print '', (($ip->first->addr ne $nets->{$a}->[1] ? 'not ' : ''), "ok ", $count++, "\n"); print '', (($ip->last->addr ne $nets->{$a}->[2] ? 'not ' : ''), "ok ", $count++, "\n"); my $new = $ip->nth(10); print '', (((defined $new ? $new->addr : 'undef') ne $nets->{$a}->[3] ? 'not ' : ''), "ok ", $count++, "\n"); } Lite/t/cidr.t 0000644 00000001214 15043770025 0007013 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..3\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::4/120'); my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); ## test cidr my $exp = 'FF00:0:0:0:0:0:0:4/120'; my $txt = $hiip->cidr; print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; $exp = '0:0:0:0:0:0:102:304/120'; $txt = $loip->cidr; print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; $exp = '1.2.3.4/24'; $txt = $dqip->cidr; print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; Lite/t/v6-num.t 0000644 00000003104 15043770025 0007222 0 ustar 00 use NetAddr::IP::Lite; my $nets = { 'F0::' => [ 128, '1' ], 'F1::' => [ 127, '2' ], 'F2::' => [ 126, '2' ], 'F3::' => [ 125, '6' ], 'F4::' => [ 124, '14' ], 'F5::' => [ 123, '30' ], 'F6::' => [ 122, '62' ], 'F7::' => [ 100, '268435454' ], 'F8::' => [ 99, '536870910' ], 'F9::' => [ 98, '1073741822' ], 'FA::' => [ 97, '2147483646' ], 'FB::' => [ 96, '4294967294' ], 'FC::' => [ 95, '8589934590' ], 'FD::' => [ 94, '17179869182' ], 'FE::' => [ 93, '34359738366' ], 'FF::' => [ 92, '68719476734' ], 'F10::' => [ 64, '18446744073709551614' ], 'F20::' => [ 32, '79228162514264337593543950334' ], 'F30::' => [ 16, '5192296858534827628530496329220094' ], 'F40::' => [ 8, '1329227995784915872903807060280344574' ], 'F50::' => [ 4, '21267647932558653966460912964485513214' ], 'F60::' => [ 2, '85070591730234615865843651857942052862' ], 'F70::' => [ 1, '170141183460469231731687303715884105726' ], 'F80::' => [ 0, '340282366920938463463374607431768211454' ], '0.0.0.1' => [ 31, '2' ], '0.0.0.2' => [ 30, '2' ], '0.0.0.3' => [ 2, '1073741822' ], '0.0.0.4' => [ 1, '2147483646' ], '0.0.0.5' => [ 0, '4294967294' ], '0.0.0.6' => [ 32, '1' ], }; $| = 1; $test = keys %$nets; print "1..", $test, "\n"; $test = 1; sub tst { foreach my $a (sort keys %$nets) { my $nc = $nets->{$a}->[1]; # net count my $ip = new NetAddr::IP::Lite($a, $nets->{$a}->[0]); print "/$nets->{$a}->[0] got: $_, exp: $nc\nnot " unless ($_ = $ip->num) eq $nc; print "ok ", $test++, "\n"; } } tst(); Lite/t/v4-new_from_aton.t 0000644 00000001307 15043770025 0011261 0 ustar 00 use NetAddr::IP::Util qw( inet_aton ipv6_n2x ); use NetAddr::IP::Lite; use Test::More; #use diagnostics; plan tests => 12 + 3; ok(! defined NetAddr::IP::Lite->new_from_aton(''), "blank netaddr returns undef"); ok(! defined NetAddr::IP::Lite->new_from_aton(undef), "undefined netaddr returns undef"); ok(! defined NetAddr::IP::Lite->new_from_aton('1.2.3.4'), "Dot Quad IP returns undef"); foreach (qw( 0.0.0.0 127.0.0.1 255.255.255.255 )) { my $naddr = inet_aton($_); my $ip = new_from_aton NetAddr::IP::Lite($naddr); ok(defined $ip, "$_ is defined"); ok($ip->bits == 32, "$_ is 32 bits wide"); ok($ip->mask eq '255.255.255.255', "mask is all ones"); ok($ip->version == 4, "version is IPv4"); } Lite/t/ipv4FFFF.t 0000644 00000000424 15043770025 0007406 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..1\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip = new6FFFF NetAddr::IP::Lite('127.0.0.1'); my $exp = '0:0:0:0:0:FFFF:7F00:1/128'; print "got: $ip\nexp: $exp\nnot " unless "$ip" eq $exp; &ok; Lite/t/bignums.t 0000644 00000007210 15043770025 0007540 0 ustar 00 use strict; use Test::More; use NetAddr::IP::Lite; #use NetAddr::IP::Util qw( # bcd2bin # ipv6_n2x # bin2bcd #); #use Data::Dumper; my @num = qw( 2001:468:D01:3C:0:0:80DF:3C1B/128 42540577535367674011024906890208295963 73.150.6.197/32 1234568901 128.0.0.0/32 2147483648 0:0:0:0:0:1:0:0/128 4294967296 0:0:0:0:0:2:0:0/128 8589934592 0:0:0:0:0:2:540B:E400/128 10000000000 0:0:0:0:0:4:0:0/128 17179869184 0:0:0:0:0:8:0:0/128 34359738368 0:0:0:0:0:10:0:0/128 68719476736 0:0:0:0:0:20:0:0/128 137438953472 0:0:0:0:0:40:0:0/128 274877906944 0:0:0:0:0:80:0:0/128 549755813888 0:0:0:0:0:100:0:0/128 1099511627776 0:0:0:0:0:200:0:0/128 2199023255552 0:0:0:0:0:400:0:0/128 4398046511104 0:0:0:0:0:800:0:0/128 8796093022208 0:0:0:0:0:1000:0:0/128 17592186044416 0:0:0:0:0:2000:0:0/128 35184372088832 0:0:0:0:0:4000:0:0/128 70368744177664 0:0:0:0:0:8000:0:0/128 140737488355328 0:0:0:0:8000:0:0:0/128 9223372036854775808 0:0:0:8000:0:0:0:0/128 604462909807314587353088 0:0:8000:0:0:0:0:0/128 39614081257132168796771975168 0:8000:0:0:0:0:0:0/128 2596148429267413814265248164610048 8000:0:0:0:0:0:0:0/128 170141183460469231731687303715884105728 255.255.255.255/32 4294967295 1.2.3.4/32 16909060 10.253.230.9/32 184411657 ); plan tests => scalar @num; #diag ("\ntesting SCALARS\n\n"); for(my $i = 0;$i <= $#num;$i += 2) { my $n = $num[$i +1]; my $ip = new NetAddr::IP::Lite($n); ok($ip eq $num[$i],"$n\t=> got: $ip\texp: ". $num[$i]); } #diag ("\ntesting Math::BigInt's\n\n"); for(my $i = 0;$i <= $#num;$i += 2) { my $n = new Math::BigInt($num[$i +1]); my $ip = new NetAddr::IP::Lite($num[$i +1]); ok($ip eq $num[$i],"$n\t=> got: $ip\texp: ". $num[$i]); } # simulate the use of Math::BigInt package Math::BigInt; use strict; use overload '""' => sub { $_[0]->_str(); }; sub BASE_LEN () { 7 }; sub _str { # adapted from Math::BigInt::Calc::_str # (ref to BINT) return num_str # Convert number from internal base 100000 format to string format. # internal format is always normalized (no leading zeros, "-0" => "+0") my $ar = $_[0]->{value}; my $l = scalar @$ar; # number of parts my $ret = ""; # handle first one different to strip leading zeros from it (there are no # leading zero parts in internal representation) $l --; $ret .= int($ar->[$l]); $l--; # Interestingly, the pre-padd method uses more time # the old grep variant takes longer (14 vs. 10 sec) my $z = '0' x (BASE_LEN -1); while ($l >= 0) { $ret .= substr($z.$ar->[$l],- BASE_LEN); # fastest way I could think of $l--; } $ret; } sub new { # adapted from Math::BigInt::new my ($class,$wanted) = @_; my $self = bless {}, $class; die "oops, not a good Math::BigInt number" unless ((!ref $wanted) && ($wanted =~ /^([+-]?)[1-9][0-9]*\z/)); $self->{sign} = $1 || '+'; if ($wanted =~ /^[+-]/) { # remove sign without touching wanted to make it work with constants my $t = $wanted; $t =~ s/^[+-]//; $self->{value} = _new($t); } else { $self->{value} = _new($wanted); } return $self; } sub _new { # adapted from Math::BigInt::Calc::_new my $wanted = $_[0]; # (ref to string) return ref to num_array # Convert a number from string format (without sign) to internal base # 1ex format. Assumes normalized value as input. my $il = length($wanted)-1; # < BASE_LEN due len-1 above return [ int($wanted) ] if $il < BASE_LEN; # shortcut for short numbers my $base_len = BASE_LEN; # this leaves '00000' instead of int 0 and will be corrected after any op [ reverse(unpack("a" . ($il % BASE_LEN +1) . ("a$base_len" x ($il / BASE_LEN)), $wanted)) ]; } Lite/t/v4-no_octal.t 0000644 00000003247 15043770025 0010227 0 ustar 00 use NetAddr::IP::Lite; *_no_octal = \&NetAddr::IP::Lite::_no_octal; use Test::More; my @ranges = ( [ '10.0.0.0/8', '10.0.0.0', '10.255.255.255' ], [ '192.68.0.0/16', '192.068.0.0', '192.068.255.255' ], ); my @weird = ( [ '128.111.12.0', '128.111.12.129' ], ); plan tests => 6 * @ranges + 2 * @weird + 28; for my $r (@ranges) { my $r1 = new_no NetAddr::IP::Lite $r->[1] . '-' . $r->[2]; isa_ok($r1, 'NetAddr::IP::Lite'); is($r1, $r->[0], "Correct interpretation (with space)"); $r1 = new_no NetAddr::IP::Lite $r->[1] . ' - ' . $r->[2]; isa_ok($r1, 'NetAddr::IP::Lite'); is($r1, $r->[0], "Correct interpretation (w/o space)"); $r1 = new_no NetAddr::IP::Lite $r->[0]; isa_ok($r1, 'NetAddr::IP::Lite'); my @rev = (undef,_no_octal($r->[1]),_no_octal($r->[2])); is($r1->range, $rev[1] . ' - ' . $rev[2], "Correct reverse"); } for my $r (@weird) { my $r1 = new_no NetAddr::IP::Lite $r->[0] . '-' . $r->[1]; ok(! defined $r1, "Weird range w/o space produces undef"); $r1 = new_no NetAddr::IP::Lite $r->[0] . ' - ' . $r->[1]; ok(! defined $r1, "Weird range with space produces undef"); } for my $o (254, 252, 248, 240, 224, 192, 128) { my $r1 = new_no NetAddr::IP::Lite '0.0.0.0 - ' . $o . '.0.0.0'; ok(! defined $r1, "Weird $o range, first octet"); $r1 = new_no NetAddr::IP::Lite '0.0.0.0 - 0.' . $o . '.0.0'; ok(! defined $r1, "Weird $o range, second octet"); $r1 = new_no NetAddr::IP::Lite '0.0.0.0 - 0.0.' . $o . '.0'; ok(! defined $r1, "Weird $o range, third octet"); $r1 = new_no NetAddr::IP::Lite '0.0.0.0 - 0.0.0.' . $o; ok(! defined $r1, "Weird $o range, fourth octet"); } Lite/t/network.t 0000644 00000001565 15043770025 0007574 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..4\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); ## test '""' just for the heck of it my $exp = 'FF00:0:0:0:0:0:1:4/120'; my $txt = sprintf("%s",$hiip); print 'got: ',$txt," exp: $exp\nnot " unless $txt eq $exp; &ok; ## test network dq $exp = '1.2.3.0/24'; my $net = $dqip->network; print 'got: ',$net, " exp: $exp\nnot " unless $net eq $exp; &ok; ## test network hi $exp = 'FF00:0:0:0:0:0:1:0/120'; $net = $hiip->network; print 'got: ',$net, " exp: $exp\nnot " unless $net eq $exp; &ok; ## test network lo $exp = '0:0:0:0:0:0:102:300/120'; $net = $loip->network; print 'got: ',$net, " exp: $exp\nnot " unless $net eq $exp; &ok; Lite/t/v6-new-base.t 0000644 00000004447 15043770025 0010137 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['::', 3, '0:0:0:0:0:0:0:0/128',myfail], ['::1', 3, '0:0:0:0:0:0:0:1/128',myfail], ['F34::123/40', 2, 'F34:0:0:0:0:0:0:3/40',mypass], ['DEAD:BEEF::1/40', 2, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['1000::2/40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['1000::2000/40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['DEAD::CAFE/40', 0, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['DEAD:BEEF::1/40', 3, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['DEAD:BEEF::1/40', 4, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['DEAD:BEEF::1/40', 5, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['DEAD:BEEF::1/40', 6, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['DEAD:BEEF::1/40', 7, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['DEAD:BEEF::1/40', 8, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['DEAD:BEEF::1/40', 254, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['DEAD:BEEF::1/40', 255, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['DEAD:BEEF::1/40', 256, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['DEAD:BEEF::1/40', 65535, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['DEAD:BEEF::1/40', 65536, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['2001:620:0:4::/64', 0, '2001:620:0:4:0:0:0:1/64',mypass], ['3FFE:2000:0:4::/64', 0, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['2001:620:600::1', 0, '2001:620:600:0:0:0:0:1/128',mypass], ['2001:620:600:0:1::1', 0,'2001:620:600:0:1:0:0:1/128',mypass], ); use NetAddr::IP::Lite; use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new NetAddr::IP::Lite 'f35::1/40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/v4-base.t 0000644 00000000667 15043770025 0007346 0 ustar 00 use NetAddr::IP::Lite; my @addr = (qw( 127.0.0.1 10.0.0.1 )); my @mask = (qw( 255.0.0.0 255.255.0.0 255.255.255.0 255.255.255.255 )); $| = 1; print "1..", (2 * scalar @addr * scalar @mask), "\n"; my $count = 1; for my $a (@addr) { for my $m (@mask) { my $ip = new NetAddr::IP::Lite $a, $m; print (($ip->addr ne $a ? 'not ' : ''), "ok ", $count++, "\n"); print (($ip->mask ne $m ? 'not ' : ''), "ok ", $count++, "\n"); } } Lite/t/within.t 0000644 00000001141 15043770025 0007373 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..12\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $net4 = NetAddr::IP::Lite->new('1.2.3.5/30'); my $net6 = NetAddr::IP::Lite->new('FF::85/126'); my @try = qw( 1.2.3.3 0 1.2.3.4 1 1.2.3.5 1 1.2.3.6 1 1.2.3.7 1 1.2.3.8 0 FF::83 0 FF::84 1 FF::85 1 FF::86 1 FF::87 1 FF::88 0 ); for (my $i=0;$i<@try;$i+=2) { my $ip = NetAddr::IP::Lite->new($try[$i]); my $rv = ($try[$i] =~ /:/) ? $ip->within($net6) : $ip->within($net4); print "got: $rv, exp: $try[$i+1]\nnot " unless $rv == $try[$i+1]; &ok; } Lite/t/v6-numeric.t 0000644 00000005313 15043770025 0010071 0 ustar 00 use NetAddr::IP::Lite; use Test::More; my @pairs = ( [ '::/0', '0', '0' ], [ '::/128', '0', '340282366920938463463374607431768211455' ], [ 'cafe:cafe::/64', '269827015721314068804783158349174669312', '340282366920938463444927863358058659840' ], [ 'cafe:cafe::1/64', '269827015721314068804783158349174669313', '340282366920938463444927863358058659840' ], [ 'dead:beef::/100', '295990755014133383690938178081940045824', '340282366920938463463374607431499776000' ], [ 'dead:beef::1/100', '295990755014133383690938178081940045825', '340282366920938463463374607431499776000' ], ); my @scale = qw( 0000:0000:0000:0000:0000:0000:0000:0000 0000:0000:0000:0000:0000:0000:0000:0001 0000:0000:0000:0000:0000:0000:0000:0010 0000:0000:0000:0000:0000:0000:0000:0100 0000:0000:0000:0000:0000:0000:0000:1000 0000:0000:0000:0000:0000:0000:0001:0000 0000:0000:0000:0000:0000:0001:0000:0000 0000:0000:0000:0000:0000:0010:0000:0000 0000:0000:0000:0000:0000:0100:0000:0000 0000:0000:0000:0000:0000:1000:0000:0000 0000:0000:0000:0000:0001:0000:0000:0000 0000:0000:0000:0001:0000:0000:0000:0000 0000:0000:0000:0010:0000:0000:0000:0000 0000:0000:0000:0100:0000:0000:0000:0000 0000:0000:0000:1000:0000:0000:0000:0000 0000:0000:0001:0000:0000:0000:0000:0000 0000:0001:0000:0000:0000:0000:0000:0000 0000:0010:0000:0000:0000:0000:0000:0000 0000:0100:0000:0000:0000:0000:0000:0000 0000:1000:0000:0000:0000:0000:0000:0000 0001:0000:0000:0000:0000:0000:0000:0000 0010:0000:0000:0000:0000:0000:0000:0000 0100:0000:0000:0000:0000:0000:0000:0000 1000:0000:0000:0000:0000:0000:0000:0000 ); my $tests = 4 * @pairs + @scale ** 2; plan tests => $tests; for my $p (@pairs) { my $a = new NetAddr::IP::Lite $p->[0]; isa_ok($a, 'NetAddr::IP::Lite', "$p->[0]"); is($a->numeric, $p->[1], "$p->[0] Scalar numeric ok"); is(($a->numeric)[0], $p->[1], "$p->[0] Array numeric ok for network"); is(($a->numeric)[1], $p->[2], "$p->[0] Array numeric ok for mask"); } @ip_scale = map { new NetAddr::IP::Lite $_ } @scale; isa_ok($_, 'NetAddr::IP::Lite', $_->addr) for @ip_scale; for my $i (0 .. $#ip_scale) { for my $l (0 .. $i - 1) { next if $l >= $i; unless (ok($ip_scale[$i]->numeric > $ip_scale[$l]->numeric, "[$i, $l] $scale[$i] > $scale[$l]")) { diag "assertion [$i]: " . $ip_scale[$i]->numeric . " > " . $ip_scale[$l]->numeric; } } next if $i == $#ip_scale; for my $l ($i + 1 .. $#ip_scale) { next if $l <= $i; unless (ok($ip_scale[$i]->numeric < $ip_scale[$l]->numeric, "[$i, $l] $scale[$i] < $scale[$l]")) { diag "assertion [$i]: " . $ip_scale[$i]->numeric . " < " . $ip_scale[$l]->numeric; } } } Lite/t/over_math.t 0000644 00000001751 15043770025 0010064 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..7\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip = new NetAddr::IP::Lite('0.0.0.4/24'); ## test '+' my $exp = '0.0.0.132/24'; my $nip = $ip + 128; print 'got: ',$nip," exp: $exp\nnot " unless $nip eq $exp; &ok; ## test '+' wrap around $nip = $ip + 257; $exp = '0.0.0.5/24'; print 'got: ',$nip," exp: $exp\nnot " unless $nip eq $exp; &ok; ## test '-' and wrap $nip = $ip - 10; $exp = '0.0.0.250/24'; print 'got: ',$nip," exp: $exp\nnot " unless $nip eq $exp; &ok; ## test '++' post $nip++; $exp = '0.0.0.251/24'; print 'got: ',$nip," exp: $exp\nnot " unless $nip eq $exp; &ok; ## test '++' pre ++$nip; $exp = '0.0.0.252/24'; print 'got: ',$nip," exp: $exp\nnot " unless $nip eq $exp; &ok; ## test '--' post $ip--; $exp = '0.0.0.3/24'; print 'got: ',$ip," exp: $exp\nnot " unless $ip eq $exp; &ok; ## test '--' pre --$ip; $exp = '0.0.0.2/24'; print 'got: ',$ip," exp: $exp\nnot " unless $ip eq $exp; &ok; Lite/t/copy.t 0000644 00000001630 15043770025 0007046 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite 0.10; *Ones = \&NetAddr::IP::Lite::Ones; use NetAddr::IP::Util qw( ipv6_aton shiftleft ); $| = 1; print "1..4\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip24 = '1.2.3.4/24'; my $o = new NetAddr::IP::Lite($ip24); my $c = $o->copy; ## test 1 validate original my $txto = sprintf("%s",$o); my $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip24\nnot " unless $txto eq $ip24; &ok; ## test 2 print "copy... got: $txtc, exp: $ip24\nnot " unless $txtc eq $ip24; &ok; my $ip28 = '1.2.3.4/28'; my $mask = shiftleft(Ones(),32 - 28); $c->{mask} = $mask; $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); ## test 3 validate original $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip24\nnot " unless $txto eq $ip24; &ok; ## test 4 print "copy... got: $txtc, exp: $ip28\nnot " unless $txtc eq $ip28; &ok; Lite/t/v4-wnew.t 0000644 00000001166 15043770025 0007407 0 ustar 00 use Test::More tests => 12; use NetAddr::IP::Lite; my @good = (qw(default any broadcast loopback)); my @bad = map { ("$_.neveranydomainlikethis.in-addr.arpa", "nohostlikethis.${_}.in-addr.arpa") } @good; my $bad = scalar @bad; diag <<EOF; \tThe following $bad tests involve resolving (hopefully) \tnon-existant names. This may take a while. EOF SKIP: { skip "defective or missing resolver", 12, if defined NetAddr::IP::Lite->new('not.defined.in-addr.arpa'); ok(!defined NetAddr::IP::Lite->new($_), "not defined ->new($_)") for @bad; ok(defined NetAddr::IP::Lite->new($_), "defined ->new($_)") for @good; }; Lite/t/pathological.t 0000644 00000000577 15043770025 0010553 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; END {print "1..1\nnot ok 1\n" unless $test}; $| = 1; $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my @addrs = # pathological cases should fail qw( ::foo ::f00/129 ::f00/150 ); print '1..',(scalar @addrs),"\n"; my $ip; foreach(@addrs) { print "expected undef, got: $ip\nnot " if ($ip = new NetAddr::IP::Lite($_)); &ok; } Lite/t/masklen.t 0000644 00000001256 15043770025 0007532 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..3\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); ## test masklen lo $exp = 120; my $masklen = $loip->masklen; print "got: $masklen, exp: $exp\nnot " unless $masklen == $exp; &ok; ## test masklen hi $exp = 120; $masklen = $hiip->masklen; print "got: $masklen, exp: $exp\nnot " unless $masklen == $exp; &ok; ## test masklen dq $exp = 24; $masklen = $dqip->masklen; print "got: $masklen, exp: $exp\nnot " unless $masklen == $exp; &ok; Lite/t/over_copy.t 0000644 00000003167 15043770025 0010110 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite 0.10; *Ones = \&NetAddr::IP::Lite::Ones; use NetAddr::IP::Util qw( ipv6_aton shiftleft ); $| = 1; print "1..8\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip24 = '1.2.3.4/24'; my $o = new NetAddr::IP::Lite($ip24); my $c = $o; ## test 1 validate original my $txto = sprintf("%s",$o); my $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip24\nnot " unless $txto eq $ip24; &ok; ## test 2 print "copy... got: $txtc, exp: $ip24\nnot " unless $txtc eq $ip24; &ok; my $ip28 = '1.2.3.4/28'; my $mask = shiftleft(Ones(),32 - 28); $c->{mask} = $mask; $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); ## overload does not unlink originals in this case ## test 3 validate original $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip28\nnot " unless $txto eq $ip28; &ok; ## test 4 print "copy... got: $txtc, exp: $ip28\nnot " unless $txtc eq $ip28; &ok; my $ip265 = '1.2.3.5/26'; my $ip285 = '1.2.3.5/28'; $mask = shiftleft(Ones(),32 - 26); ## test 5 overload seperates variables $c++; ## validate original $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip28\nnot " unless $txto eq $ip28; &ok; ## test 6 check mutated copy print "copy... got: $txtc, exp: $ip285\nnot " unless $txtc eq $ip285; &ok; ## test 7 check seperation $c->{mask} = $mask; ## validate original $txto = sprintf("%s",$o); $txtc = sprintf("%s",$c); print "orig... got: $txto, exp: $ip28\nnot " unless $txto eq $ip28; &ok; ## test 8 check mutated copy print "copy... got: $txtc, exp: $ip265\nnot " unless $txtc eq $ip265; &ok; Lite/t/rfc_1918.t 0000644 00000001175 15043770025 0007334 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..12\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my @ips = qw( 9.255.255.255 0 10.0.0.0 1 10.255.255.255 1 11.0.0.0 0 172.15.255.255 0 172.16.0.0 1 172.31.255.255 1 172.32.0.0 0 192.167.255.255 0 192.168.0.0 1 192.168.255.255 1 192.169.0.0 0 ); for (my $i=0;$i<=$#ips;$i+=2) { my $ip = new NetAddr::IP::Lite($ips[$i]); my $got = $ip->is_rfc1918(); my $exp = $ips[$i+1]; print $ip," got: $got, exp: $exp\nnot " unless $got == $exp; &ok; } Lite/t/v6-inc.t 0000644 00000002062 15043770025 0007176 0 ustar 00 use Test::More; use NetAddr::IP::Lite; # Test ++ in IPv6 addresses (Bug rt.cpan.org #7070 by a guest) @ip = (NetAddr::IP::Lite->new('2001:468:ff:fffe::2/64'), NetAddr::IP::Lite->new('2001:468:ff:fffe::2/64'), NetAddr::IP::Lite->new('2001:468:ff:fffe::2/64')); $ip[1] ++; $ip[2] ++; $ip[2] ++; plan tests => 11; # Test correct v6 creation isa_ok($_, 'NetAddr::IP::Lite') for @ip; # Test that we did actually do something diag "$ip[0] -- $ip[1]" unless ok($ip[0] != $ip[1], "Auto incremented once differ"); diag "$ip[0] -- $ip[2]" unless ok($ip[0] != $ip[2], "Auto incremented twice differ"); diag "$ip[1] -- $ip[2]" unless ok($ip[1] != $ip[2], "Auto incremented two times differ"); # Test that what we did is correct is($ip[1], $ip[0] + 1, "Test of first auto-increment"); is($ip[2], $ip[0] + 2, "Test of second auto-increment"); # Now test auto-decrement $ip[1] --; $ip[2] --; $ip[2] --; is($ip[0], $ip[1], "Decrement of decrement once is ok"); is($ip[0], $ip[2], "Decrement of decrement twice is ok"); is($ip[1], $ip[2], "Third case"); Lite/t/addr.t 0000644 00000001313 15043770025 0007004 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..3\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); ## test '""' just for the heck of it my $exp = 'FF00:0:0:0:0:0:1:4/120'; my $txt = sprintf("%s",$hiip); print 'got: ',$txt," exp: $exp\nnot " unless $txt eq $exp; &ok; ## test addr lo $exp = '0:0:0:0:0:0:102:304'; my $addr = $loip->addr; print "got: $addr, exp: $exp\nnot " unless $addr eq $exp && ! ref $addr; &ok; ## test addr hi $exp = 'FF00:0:0:0:0:0:1:4'; $addr = $hiip->addr; print "got: $addr, exp: $exp\nnot " unless $addr eq $exp && ! ref $addr; &ok; Lite/t/bits.t 0000644 00000001215 15043770025 0007034 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..3\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); ## test bits lo $exp = 128; my $bits = $loip->bits; print "got: $bits, exp: $exp\nnot " unless $bits == $exp; &ok; ## test bits hi $exp = 128; $bits = $hiip->bits; print "got: $bits, exp: $exp\nnot " unless $bits == $exp; &ok; ## test dotquad bits $exp = 32; $bits = $dqip->bits; print "got: $bits, exp: $exp\nnot " unless $bits == $exp; &ok; Lite/t/v4-new-first.t 0000644 00000001465 15043770025 0010347 0 ustar 00 use NetAddr::IP::Lite; my $nets = { '10.0.0.16' => [ 24, '10.0.0.1', '10.0.0.254', '10.0.0.11'], '10.0.0.5' => [ 30, '10.0.0.5', '10.0.0.6', 'undef' ], '10.128.0.1' => [ 8, '10.0.0.1', '10.255.255.254', '10.0.0.11'], '10.128.0.1' => [ 24, '10.128.0.1', '10.128.0.254', '10.128.0.11'], }; $| = 1; print "1..", (3 * scalar keys %$nets), "\n"; my $count = 1; for my $a (keys %$nets) { my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0]; print '', (($ip->first->addr ne $nets->{$a}->[1] ? 'not ' : ''), "ok ", $count++, "\n"); print '', (($ip->last->addr ne $nets->{$a}->[2] ? 'not ' : ''), "ok ", $count++, "\n"); my $new = $ip->nth(10); print '', (((defined $new ? $new->addr : 'undef') ne $nets->{$a}->[3] ? 'not ' : ''), "ok ", $count++, "\n"); } Lite/t/numeric.t 0000644 00000001415 15043770025 0007537 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..6\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my @tval = qw # IP bcd mask bcd ( 8000:0:0:0:0:0:0:1/112 170141183460469231731687303715884105729 340282366920938463463374607431768145920 1.2.3.4/24 16909060 4294967040 ); for (my $i=0;$i < @tval;$i+=3) { my $nip = NetAddr::IP::Lite->new($tval[$i]); ## test scalar return my $sclr = $nip->numeric; print "got: $sclr\nexp: $tval[$i+1]\nnot " unless $sclr .'x' eq $tval[$i+1] .'x'; &ok; ## test array return my($addr,$mask) = $nip->numeric; print "got: $addr\nexp: $tval[$i+1]\nnot " unless $addr .'x' eq $tval[$i+1] .'x'; &ok; print "got: $mask\nexp: $tval[$i+2]\nnot " unless $mask .'x' eq $tval[$i+2] .'x'; &ok; } Lite/t/over_equal.t 0000644 00000004247 15043770025 0010245 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..14\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $four = new NetAddr::IP::Lite('0.0.0.4'); # same as 0.0.0.4/32 my $four120 = new NetAddr::IP::Lite('::4/120'); # same as 0.0.0.4/24 my $t432 = '0.0.0.4/32'; my $t4120 = '0:0:0:0:0:0:0:4/120'; my $five = new NetAddr::IP::Lite('0.0.0.5'); my $t532 = '0.0.0.5/32'; # 1 ## test '""' overload my $txt = sprintf ("%s",$four120); print "got: $txt, exp: $t4120\nnot " unless $txt eq $t4120; &ok; # 2 ## test '""' again $txt = sprintf ("%s",$four); print "got: $txt, exp: $t432\nnot " unless $txt eq $t432; &ok; # 3 ## test 'eq' to scalar print 'failed ',$four," eq $t432\nnot " unless $four eq $t432; &ok; # 4 ## test scalar 'eq' to print "failed $t432 eq ",$four,"\nnot " unless $t432 eq $four; &ok; # 5 ## test 'eq' to self print 'failed ',$four,' eq ', $four,"\nnot " unless $four eq $four; &ok; # 6 ## test 'eq' cidr != print 'failed ',$four,' should not eq ',$four120,"\nnot " if $four eq $four120; &ok; # 7 ## test '==' not for scalars print "failed scalar $t432 should not == ",$four,"\nnot " if $t432 == $four; &ok; # 8 ## test '== not for scalar, reversed args print 'failed scalar ',$four," should not == $t432\nnot " if $four == $t432; &ok; # ========================================== # # test "ne" and "!=" # # 9 ## test 'ne' to scalar print 'failed ',$four120," ne $t432\nnot " unless $four120 ne $t432; &ok; # 10 ## test scalar 'ne' to print "failed $t432 ne ",$four120,"\nnot " unless $t432 ne $four120; &ok; # 11 ## test 'ne' to cidr print 'failed ',$four,' ne ', $four120,"\nnot " unless $four ne $four120; &ok; # 12 ## test '!=' not for scalar, reversed args $rv = $five != $four ? 1 : 0; #print "rv=$rv\n"; print "failed scalar $five != $four\nnot " unless $rv; &ok; # unblessed scalars not welcome undef local $^W; # 13 ## test '!=' not for scalars my $rv = $t432 != $five ? 1 : 0; #print "rv=$rv\n"; print "failed scalar $t432 != ",$five,"\nnot " unless $rv; &ok; # 14 # since both of these are string scalars, the != should fail $rv = $t532 != $t432 ? 1 : 0; #print "rv = $rv\n"; print "failed scalar $t532 != $t432\nnot " if $rv; &ok; Lite/t/v4-new.t 0000644 00000003202 15043770025 0007211 0 ustar 00 use NetAddr::IP::Lite; use Test::More; my $binword; { local $SIG{__WARN__} = sub {}; $binword = eval "0b11111111111111110000000000000000"; } if ($@) { $binword = 0xffff0000; print STDERR "\t\tskipped! 0b11111111111111110000000000000000\n\t\tbinary bit strings unsupported in Perl version $]\n"; } @a = ( [ 'localhost', '127.0.0.1' ], [ 0x01010101, '1.1.1.1' ], [ 1, '1.0.0.0' ], # Because it will have a mask. 0.0.0.1 ow [ 'default', '0.0.0.0' ], [ 'any', '0.0.0.0' ], [-809041407, '207.199.2.1'], [3485925889, '207.199.2.1'], ); @m = ( [ 0, '0.0.0.0' ], [ 1, '128.0.0.0' ], [ 2, '192.0.0.0' ], [ 4, '240.0.0.0' ], [ 8, '255.0.0.0' ], [ 16, '255.255.0.0' ], [ 17, '255.255.128.0' ], [ 24, '255.255.255.0' ], [ 'default', '0.0.0.0' ], [ 32, '255.255.255.255' ], [ 'host', '255.255.255.255' ], [ 0xffffff00, '255.255.255.0' ], [ '255.255.255.240', '255.255.255.240' ], [ '255.255.128.0', '255.255.128.0' ], [ $binword, '255.255.0.0' ], ); plan tests => (4 * scalar @a * scalar @m) + 4; foreach my $invalid (qw( 256.1.1.1 256.256.1.1 256.256.256.1 256.256.256.256 )) { ok (! defined NetAddr::IP::Lite->new($invalid), "Invalid IP $invalid returns undef"); } for my $a (@a) { for my $m (@m) { my $ip = new NetAddr::IP::Lite $a->[0], $m->[0]; SKIP: { skip "Failed to make an object for $a->[0]/$m->[0]", 4 unless defined $ip; is($ip->addr, $a->[1], "$a->[0] / $m->[0] is $a->[1]"); is($ip->mask, $m->[1], "$a->[0] / $m->[0] is $m->[1]"); is($ip->bits, 32, "$a->[0] / $m->[0] is 32 bits wide"); is($ip->version, 4, "$a->[0] / $m->[0] is version 4"); }; } } Lite/t/v6-old-base.t 0000644 00000004464 15043770025 0010123 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['::', 3, '0:0:0:0:0:0:0:0/128',myfail], ['::1', 3, '0:0:0:0:0:0:0:1/128',myfail], ['F34::123/40', 3, 'F34:0:0:0:0:0:0:3/40',mypass], ['DEAD:BEEF::1/40', 3, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['1000::2/40', 1, '1000:0:0:0:0:0:0:1/40',mypass], ['1000::2000/40', 1, '1000:0:0:0:0:0:0:1/40',mypass], ['DEAD::CAFE/40', 1, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['DEAD:BEEF::1/40', 4, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['DEAD:BEEF::1/40', 5, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['DEAD:BEEF::1/40', 6, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['DEAD:BEEF::1/40', 7, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['DEAD:BEEF::1/40', 8, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['DEAD:BEEF::1/40', 9, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['DEAD:BEEF::1/40', 255, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['DEAD:BEEF::1/40', 256, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['DEAD:BEEF::1/40', 257, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['DEAD:BEEF::1/40', 65536, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['DEAD:BEEF::1/40', 65537, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['2001:620:0:4::/64', 1, '2001:620:0:4:0:0:0:1/64',mypass], ['3FFE:2000:0:4::/64', 1, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['2001:620:600::1', 1, '2001:620:600:0:0:0:0:1/128',myfail], ['2001:620:600:0:1::1', 1,'2001:620:600:0:1:0:0:1/128',myfail], ); use NetAddr::IP::Lite qw(:old_nth); use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new NetAddr::IP::Lite 'f35::1/40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/v4-cnew.t 0000644 00000001223 15043770025 0007355 0 ustar 00 use NetAddr::IP::Lite; my @subnets = ( [ '127.1', '127.0.0.1/32' ], [ '127.1/16', '127.1.0.0/16' ], [ '10.10.10', '10.10.0.10/32' ], [ '10.10.10/24', '10.10.10.0/24' ], # include test for cisco syntax using space instead of '/' [ '127.1 16', '127.1.0.0/16' ], [ '10.10.10 24', '10.10.10.0/24' ], [ '10.10.10 255.255.255.0', '10.10.10.0/24' ], ); $| = 1; print '1..', (scalar @subnets) , "\n"; my $count = 1; for my $n (@subnets) { my $ip = new NetAddr::IP::Lite $n->[0]; if ($ip eq $n->[1]) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; } Lite/t/v4-range.t 0000644 00000003043 15043770025 0007517 0 ustar 00 use NetAddr::IP::Lite; use Test::More; my @ranges = ( [ '10.0.0.0/8', '10.0.0.0', '10.255.255.255' ], [ '192.168.0.0/16', '192.168.0.0', '192.168.255.255' ], ); my @weird = ( [ '128.111.12.0', '128.111.12.129' ], ); plan tests => 6 * @ranges + 2 * @weird + 28; for my $r (@ranges) { my $r1 = new NetAddr::IP::Lite $r->[1] . '-' . $r->[2]; isa_ok($r1, 'NetAddr::IP::Lite'); is($r1, $r->[0], "Correct interpretation (with space)"); $r1 = new NetAddr::IP::Lite $r->[1] . ' - ' . $r->[2]; isa_ok($r1, 'NetAddr::IP::Lite'); is($r1, $r->[0], "Correct interpretation (w/o space)"); $r1 = new NetAddr::IP::Lite $r->[0]; isa_ok($r1, 'NetAddr::IP::Lite'); is($r1->range, $r->[1] . ' - ' . $r->[2], "Correct reverse"); } for my $r (@weird) { my $r1 = new NetAddr::IP::Lite $r->[0] . '-' . $r->[1]; ok(! defined $r1, "Weird range w/o space produces undef"); $r1 = new NetAddr::IP::Lite $r->[0] . ' - ' . $r->[1]; ok(! defined $r1, "Weird range with space produces undef"); } for my $o (254, 252, 248, 240, 224, 192, 128) { my $r1 = new NetAddr::IP::Lite '0.0.0.0 - ' . $o . '.0.0.0'; ok(! defined $r1, "Weird $o range, first octet"); $r1 = new NetAddr::IP::Lite '0.0.0.0 - 0.' . $o . '.0.0'; ok(! defined $r1, "Weird $o range, second octet"); $r1 = new NetAddr::IP::Lite '0.0.0.0 - 0.0.' . $o . '.0'; ok(! defined $r1, "Weird $o range, third octet"); $r1 = new NetAddr::IP::Lite '0.0.0.0 - 0.0.0.' . $o; ok(! defined $r1, "Weird $o range, fourth octet"); } Lite/t/constants.t 0000644 00000000763 15043770025 0010116 0 ustar 00 #use diagnostics; use Test::More tests => 15; use NetAddr::IP::Lite qw(Zeros Zero Ones V4mask V4net); my %const = ( '0::' => Zeros, '::' => Zero, 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF' => Ones, 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF::' => V4mask, '::FFFF:FFFF' => V4net, ); my($ip,$rv); foreach (sort keys %const) { ok(($ip = new NetAddr::IP::Lite($_)),"netaddr $_"); ok($ip->{addr} eq $const{$_},"match $_"); ok(($rv = length($const{$_})) == 16, "length $_ is $rv"); } Lite/t/v4_new_cis.t 0000644 00000003231 15043770025 0010133 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; use Test::More; my $binword; { local $SIG{__WARN__} = sub {}; $binword = eval "0b11111111111111110000000000000000"; } if ($@) { $binword = 0xffff0000; print STDERR "\t\tskipped! 0b11111111111111110000000000000000\n\t\tbinary bit strings unsupported in Perl version $]\n"; } @a = ( [ 'localhost', '127.0.0.1' ], [ 0x01010101, '1.1.1.1' ], [ 1, '1.0.0.0' ], # Because it will have a mask. 0.0.0.1 ow [ 'default', '0.0.0.0' ], [ 'any', '0.0.0.0' ], [-809041407, '207.199.2.1'], [3485925889, '207.199.2.1'], ); @m = ( [ 0, '0.0.0.0' ], [ 1, '128.0.0.0' ], [ 2, '192.0.0.0' ], [ 4, '240.0.0.0' ], [ 8, '255.0.0.0' ], [ 16, '255.255.0.0' ], [ 17, '255.255.128.0' ], [ 24, '255.255.255.0' ], [ 'default', '0.0.0.0' ], [ 32, '255.255.255.255' ], [ 'host', '255.255.255.255' ], [ 0xffffff00, '255.255.255.0' ], [ '255.255.255.240', '255.255.255.240' ], [ '255.255.128.0', '255.255.128.0' ], [ $binword, '255.255.0.0' ], ); plan tests => (4 * scalar @a * scalar @m) + 4; foreach my $invalid (qw( 256.1.1.1 256.256.1.1 256.256.256.1 256.256.256.256 )) { ok (! defined NetAddr::IP::Lite->new($invalid), "Invalid IP $invalid returns undef"); } for my $a (@a) { for my $m (@m) { my $ip = new_cis NetAddr::IP::Lite "$a->[0] $m->[0]"; SKIP: { skip "Failed to make an object for $a->[0]/$m->[0]", 4 unless defined $ip; is($ip->addr, $a->[1], "$a->[0] / $m->[0] is $a->[1]"); is($ip->mask, $m->[1], "$a->[0] / $m->[0] is $m->[1]"); is($ip->bits, 32, "$a->[0] / $m->[0] is 32 bits wide"); is($ip->version, 4, "$a->[0] / $m->[0] is version 4"); }; } } Lite/t/old-nth.t 0000644 00000000754 15043770025 0007447 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite qw(:old_nth); $| = 1; print "1..9\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip4 = NetAddr::IP::Lite->new('1.2.3.11/29'); my @try = qw( 0 undef 1 1.2.3.9 2 1.2.3.10 3 1.2.3.11 4 1.2.3.12 5 1.2.3.13 6 1.2.3.14 7 1.2.3.15 8 undef ); for (my $i=0;$i<@try;$i+=2) { my $rv = $ip4->nth($try[$i]); $rv = defined $rv ? $rv->addr : 'undef'; print "got: $rv, exp: $try[$i+1]\nnot " unless $rv eq $try[$i+1]; &ok; } Lite/t/v4-contains.t 0000644 00000003567 15043770025 0010254 0 ustar 00 use NetAddr::IP::Lite; my @yes_pairs = ( [ [ '127.0.0.0', '255.0.0.0' ], [ '127.0.0.1', '255.255.255.255'] ], [ [ '10.0.0.0', '255.255.255.0' ], [ '10.0.0.128', '255.255.255.128' ] ], [ [ '10.0.0.0', '255.0.0.0' ], [ '10.0.0.0', '255.0.0.0' ]], [ [ '10.0.0.0', '255.0.0.0' ], [ '10.0.0.1', '255.0.0.0' ]], [ [ '10.0.0.0', '255.255.255.254' ], [ '10.0.0.1', '255.255.255.254' ]], [ [ '10.0.0.0', '255.255.255.254' ], [ '10.0.0.1', '255.255.255.255' ]], [ [ '10.0.0.1', '255.0.0.0' ], [ '10.0.0.1', '255.255.255.255' ]], [ [ 'default', 'default' ], [ '10.0.0.1', '255.255.255.254' ]], [ [ 'default', 'default' ], [ 'broadcast', undef ]], [ [ 'loopback', '255.0.0.0' ], [ '127.0.0.0', '255.0.0.0' ] ], ); my @no_pairs = ( [ [ '127.0.0.1', '255.255.255.255' ], [ '127.0.0.0', '255.0.0.0' ] ], [ [ '10.0.0.0', '255.0.0.0' ], [ '11.0.0.0', '255.0.0.0' ] ], [ [ '10.0.1.0', '255.255.255.0' ], [ '10.0.2.0', '255.255.255.0' ] ], [ [ '10.0.0.1', '255.255.255.254' ], [ 'default', '0' ] ], ); $| = 1; print "1..", 2 * (scalar @yes_pairs + scalar @no_pairs), "\n"; my $count = 1; for my $p (@yes_pairs) { my $ip_a = new NetAddr::IP::Lite $p->[0]->[0], $p->[0]->[1]; my $ip_b = new NetAddr::IP::Lite $p->[1]->[0], $p->[1]->[1]; print (($ip_a->contains($ip_b) ? '' : 'not '), 'ok ', $count++, "\n"); print (($ip_b->within($ip_a) ? '' : 'not '), 'ok ', $count++, "\n"); # print "a = ", $ip_a->addr, "/", $ip_a->mask, "\n"; # print "b = ", $ip_b->addr, "/", $ip_b->mask, "\n"; } for my $p (@no_pairs) { my $ip_a = new NetAddr::IP::Lite $p->[0]->[0], $p->[0]->[1]; my $ip_b = new NetAddr::IP::Lite $p->[1]->[0], $p->[1]->[1]; print (($ip_a->contains($ip_b) ? 'not ' : ''), 'ok ', $count++, "\n"); print (($ip_b->within($ip_a) ? 'not ' : ''), 'ok ', $count++, "\n"); } Lite/t/old-num.t 0000644 00000000677 15043770025 0007461 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite qw(:old_nth); $| = 1; sub ok() { print 'ok ',$test++,"\n"; } my @try = qw( 10/32 0 10/31 1 10/30 3 ::1/128 0 ::1/127 1 ::1/126 3 1.2.3.11/29 7 FF::8B/125 7 ); print '1..',(@try/2),"\n"; $test = 1; foreach(my $i = 0;$i <=$#try;$i+= 2) { my $ip = NetAddr::IP::Lite->new($try[$i]); my $exp = $try[$i +1]; print "got: $_, exp: $exp\nnot " unless ($_ = $ip->num) == $exp; &ok; } Lite/t/v4-numeric.t 0000644 00000001467 15043770025 0010075 0 ustar 00 use NetAddr::IP::Lite; my $nets = { '10.0.0.0/20' => [ 167772160, 4294963200 ], '10.0.15.0/24' => [ 167776000, 4294967040 ], '192.168.0.0/24' => [ 3232235520, 4294967040], 'broadcast' => [ 4294967295, 4294967295], 'default' => [ 0, 0 ], }; $| = 1; print "1..", 4 * (scalar keys %$nets), "\n"; my $count = 1; for my $a (keys %$nets) { my $ip = new NetAddr::IP::Lite $a; my ($addr, $mask) = $ip->numeric; my $nip = new NetAddr::IP::Lite $addr, $mask; print '', ($nip ? '' : 'not '), 'ok ', $count++, "\n"; print '', ($nip and $nip->cidr eq $ip->cidr) ? '' : 'not ', 'ok ', $count ++, "\n"; print '', (($addr != $nets->{$a}->[0] ? 'not ' : ''), "ok ", $count++, "\n"); print '', (($mask != $nets->{$a}->[1] ? 'not ' : ''), "ok ", $count++, "\n"); } Lite/t/over_comp.t 0000644 00000002756 15043770025 0010077 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..21\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $four = new NetAddr::IP::Lite('::4'); $four->{val} = 4; my $five = new NetAddr::IP::Lite('::5'); $five->{val} = 5; my @t = ( # arg1 arg2 < <= == >= > <=> cmp $four, $four, 0, 1, 1, 1, 0, 0, 0, $four, $five, 1, 1, 0, 0, 0, -1, -1, $five, $four, 0, 0, 0, 1, 1, 1, 1, ); for (my $i = 0; $i< @t; $i+=9) { ## test '=' overloaded here my $arg1 = $t[$i]; my $arg2 = $t[$i+1]; my ($lt,$le,$eq,$ge,$gt,$nc,$cmp) = @t[$i+2,$i+3,$i+4,$i+5,$i+6,$i+7,$i+8]; ## test '<' print "failed $arg1->{val} < $arg2->{val}, got: $_, exp: $lt\nnot " unless ($_ = ($arg1 < $arg2)) == $lt; &ok; ## test '<=' print "failed $arg1->{val} <= $arg2->{val}, got: $_, exp: $le\nnot " unless ($_ = ($arg1 <= $arg2)) == $le; &ok; ## test '==' print "failed $arg1->{val} == $arg2->{val}, got: $_, exp: $eq\nnot " unless ($_ = ($arg1 == $arg2)) == $eq; &ok; ## test '>=' print "failed $arg1->{val} >= $arg2->{val}, got: $_, exp: $ge\nnot " unless ($_ = ($arg1 >= $arg2)) == $ge; &ok; ## test '>' print "failed $arg1->{val} > $arg2->{val}, got: $_, exp: $gt\nnot " unless ($_ = ($arg1 > $arg2)) == $gt; &ok; ## test '<=>' print "failed $arg1->{val} <=> $arg2->{val}, got: $_, exp: $nc\nnot " unless ($_ = ($arg1 <=> $arg2)) == $nc; &ok; ## test 'cmp' print "failed $arg1->{val} cmp $arg2->{val}, got: $_, exp: $cmp\nnot " unless ($_ = ($arg1 cmp $arg2)) == $cmp; &ok; } Lite/t/version.t 0000644 00000000741 15043770025 0007563 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..2\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('1.2.3.4/24'); my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); ## test version lo $exp = 4; my $version = $loip->version; print "got: $version, exp: $exp\nnot " unless $version == $exp; &ok; ## test version hi $exp = 6; $version = $hiip->version; print "got: $version, exp: $exp\nnot " unless $version == $exp; &ok; Lite/t/new-num.t 0000644 00000000662 15043770025 0007466 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; sub ok() { print 'ok ',$test++,"\n"; } my @try = qw( 10/32 1 10/31 2 10/30 2 ::1/128 1 ::1/127 2 ::1/126 2 1.2.3.11/29 6 FF::8B/125 6 ); print '1..',(@try/2),"\n"; $test = 1; foreach(my $i = 0;$i <=$#try;$i+= 2) { my $ip = NetAddr::IP::Lite->new($try[$i]); my $exp = $try[$i +1]; print "got: $_, exp: $exp\nnot " unless ($_ = $ip->num) == $exp; &ok; } Lite/t/broadcast.t 0000644 00000001327 15043770025 0010041 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..3\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::4/120'); ## test '""' just for the heck of it my $exp = 'FF00:0:0:0:0:0:0:4/120'; my $txt = sprintf("%s",$hiip); print 'got: ',$txt," exp: $exp\nnot " unless $txt eq $exp; &ok; ## test broadcast lo $exp = '0:0:0:0:0:0:102:3FF/120'; my $broad = $loip->broadcast; print 'got: ',$broad, " exp: $exp\nnot " unless $broad eq $exp; &ok; ## test broadcast hi $exp = 'FF00:0:0:0:0:0:0:FF/120'; $broad = $hiip->broadcast; print 'got: ',$broad, " exp: $exp\nnot " unless $broad eq $exp; &ok; Lite/t/v4-aton.t 0000644 00000003051 15043770025 0007363 0 ustar 00 use Test::More tests => 19; my @addr = ( [ 'localhost', '127.0.0.1' ], [ 'broadcast', '255.255.255.255' ], [ '254.254.0.1', '254.254.0.1' ], [ 'default', '0.0.0.0' ], [ '10.0.0.1', '10.0.0.1' ], ); my %addr = ( localhost => pack('N',0x7f000001), broadcast => pack('N',0xffffffff), '254.254.0.1' => pack('N',0xfefe0001), default => pack('N',0), '10.0.0.1' => pack('N',0x0a000001), '127.0.0.1' => pack('N',0x7f000001), '255.255.255.255' => pack('N',0xffffffff), '0.0.0.0' => pack('N',0), ); # local inet_aton, don't use perl's Socket sub l_inet_aton { my $rv = (exists $addr{$_[0]}) ? $addr{$_[0]} : undef; } # Verify that Accept_Binary_IP works... my $x; SKIP: { skip "Failed to load NetAddr::IP::Lite", 17 unless use_ok('NetAddr::IP::Lite'); ok(! defined NetAddr::IP::Lite->new("\1\1\1\1"), "binary unrecognized by default ". ($x ? $x->addr :'')); # This mimicks the actual use with :aton NetAddr::IP::Lite::import(':aton'); ok(defined ($x = NetAddr::IP::Lite->new("\1\1\1\1")), "...but can be recognized ". $x->addr); ok(!defined ($x = NetAddr::IP::Lite->new('bad rfc-952 characters')), "bad rfc-952 characters ". ($x ? $x->addr :'')); is(NetAddr::IP::Lite->new($_->[0])->aton, l_inet_aton($_->[1]), "->aton($_->[0])") for @addr; ok(defined NetAddr::IP::Lite->new(l_inet_aton($_->[1])), "->new aton($_->[1])") for @addr; is(NetAddr::IP::Lite->new(l_inet_aton($_->[1]))->addr, $_->[1], "->new aton($_->[1])") for @addr; }; Lite/t/lemasklen.t 0000644 00000000453 15043770025 0010051 0 ustar 00 use NetAddr::IP::Lite; my @masks = 0 .. 32; $| = 1; print '1..', scalar @masks, "\n"; my $count = 1; for my $m (@masks) { my $ip = new NetAddr::IP::Lite '10.0.0.1', $m; if ($ip->masklen == $m) { print "ok ", $count ++, "\n"; } else { print "not ok ", $count ++, "\n"; } } Lite/t/v6-new_cis6_base.t 0000644 00000004465 15043770025 0011145 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['::', 3, '0:0:0:0:0:0:0:0/128',myfail], ['::1', 3, '0:0:0:0:0:0:0:1/128',myfail], ['F34::123 40', 2, 'F34:0:0:0:0:0:0:3/40',mypass], ['DEAD:BEEF::1 40', 2, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['1000::2 40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['1000::2000 40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['DEAD::CAFE 40', 0, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['DEAD:BEEF::1 40', 3, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['DEAD:BEEF::1 40', 4, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['DEAD:BEEF::1 40', 5, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['DEAD:BEEF::1 40', 6, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['DEAD:BEEF::1 40', 7, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['DEAD:BEEF::1 40', 8, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['DEAD:BEEF::1 40', 254, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['DEAD:BEEF::1 40', 255, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['DEAD:BEEF::1 40', 256, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['DEAD:BEEF::1 40', 65535, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['DEAD:BEEF::1 40', 65536, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['2001:620:0:4::/64', 0, '2001:620:0:4:0:0:0:1/64',mypass], ['3FFE:2000:0:4::/64', 0, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['2001:620:600::1', 0, '2001:620:600:0:0:0:0:1/128',mypass], ['2001:620:600:0:1::1', 0,'2001:620:600:0:1:0:0:1/128',mypass], ); use NetAddr::IP::Lite; use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new_cis6 NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new_cis6 NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new_cis6 NetAddr::IP::Lite 'f35::1 40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/loops.t 0000644 00000001343 15043770025 0007231 0 ustar 00 use NetAddr::IP::Lite; $| = 1; my @deltas = (0, 1, 2, 3, 255); print "1..", 15 + @deltas, "\n"; my $count = 1; for (my $ip = new NetAddr::IP::Lite '10.0.0.1/28'; $ip < $ip->broadcast; $ip ++) { my $o = $ip->addr; $o =~ s/^.+\.(\d+)$/$1/; if ($o == $count) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; } my $ip = new NetAddr::IP::Lite '10.0.0.255/24'; $ip ++; if ($ip eq '10.0.0.0/24') { print "ok $count\n"; } else { print "not ok $count\n"; } ++$count; $ip = new NetAddr::IP::Lite '10.0.0.0/24'; for my $v (@deltas) { if ($ip + $v eq '10.0.0.' . $v . '/24') { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; } Lite/t/v4-last.t 0000644 00000001252 15043770025 0007366 0 ustar 00 use NetAddr::IP::Lite; my %w = ('default' => [ '255.255.255.254', '0.0.0.0' ], 'loopback' => [ '127.255.255.254', '255.0.0.0' ], '127.0.0.1/8' => [ '127.255.255.254', '255.0.0.0' ], '10.' => [ '10.255.255.254', '255.0.0.0' ], '10.10.10/24' => [ '10.10.10.254', '255.255.255.0' ], ); $| = 1; print '1..', (2 * scalar keys %w), "\n"; my $count = 1; for my $a (keys %w) { my $ip = NetAddr::IP::Lite->new($a)->last; if ($ip->addr eq $w{$a}->[0]) { print "ok ", $count++, "\n"; } else { print "not ok ", $count++, "\n"; } if ($ip->mask eq $w{$a}->[1]) { print "ok ", $count++, "\n"; } else { print "not ok ", $count++, "\n"; } } Lite/t/bug62521.t 0000644 00000000727 15043770025 0007257 0 ustar 00 BEGIN { $| = 1; print "1..3\n"; } END {print "not ok 1\n" unless $loaded;} $loaded = 1; print "ok 1\n"; #use diagnostics; use NetAddr::IP::Lite; $| = 1; my $test = 2; sub ok() { print 'ok ',$test++,"\n"; } $exp = '0:0:0:0:0:0:7F00:0/104'; my $ip = new6 NetAddr::IP::Lite('127.0.0.0/8'); print "exp $exp\ngot ", $ip, "\nnot " unless $ip eq $exp; &ok; $ip = new6 NetAddr::IP::Lite('127/8'); print "exp $exp\ngot ", $ip, "\nnot " unless $ip eq $exp; &ok; Lite/t/v4-cidr.t 0000644 00000000747 15043770025 0007354 0 ustar 00 use NetAddr::IP::Lite; $| = 1; my @addr = (qw( 0.0.0.0/0 1.0.0.0/1 2.0.0.0/2 10.0.0.0/8 10.0.120.0/24 161.196.66.0/25 255.255.255.255/32 )); print '1..', scalar @addr, "\n"; my $count = 1; for my $a (@addr) { my $ip = new NetAddr::IP::Lite $a; if ($ip->cidr eq $a) { print "ok ", $count ++, "\n"; } else { print "not ok ", $count ++, "\n"; print "$a -> ", $ip->cidr, " [", $ip->mask, "]\n"; } } Lite/t/v4-basem.t 0000644 00000001112 15043770025 0007505 0 ustar 00 use NetAddr::IP::Lite; my $nets = { '10.0.0.16' => [ 24, '10.0.0.255', '10.0.0.0' ], '127.0.0.1' => [ 8, '127.255.255.255', '127.0.0.0' ], '192.168.0.10' => [ 17, '192.168.127.255', '192.168.0.0' ], }; $| = 1; print "1..", (2 * scalar keys %$nets), "\n"; my $count = 1; for my $a (keys %$nets) { my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0]; print '', (($ip->broadcast->addr ne $nets->{$a}->[1] ? 'not ' : ''), "ok ", $count++, "\n"); print '', (($ip->network->addr ne $nets->{$a}->[2] ? 'not ' : ''), "ok ", $count++, "\n"); } Lite/t/v4-snew.t 0000644 00000002052 15043770025 0007376 0 ustar 00 use Test::More; use NetAddr::IP::Lite; my %w = ('broadcast' => [ '255.255.255.255', '255.255.255.255' ], 'default' => [ '0.0.0.0', '0.0.0.0' ], 'loopback' => [ '127.0.0.1', '255.0.0.0' ], '10.' => [ '10.0.0.0', '255.0.0.0' ], '10/8' => [ '10.0.0.0', '255.0.0.0' ], '127/8' => [ '127.0.0.0', '255.0.0.0' ], '11.11.' => [ '11.11.0.0', '255.255.0.0' ], '12.12.12.' => [ '12.12.12.0', '255.255.255.0' ], '13.13.13.13' => [ '13.13.13.13', '255.255.255.255' ], '0-127' => [ '0.0.0.0', '128.0.0.0' ], '128-255' => [ '128.0.0.0', '128.0.0.0' ], '0-63' => [ '0.0.0.0', '192.0.0.0' ], '128-191' => [ '128.0.0.0', '192.0.0.0' ], '10.128.0-127' => [ '10.128.0.0', '255.255.128.0' ], '10.10.10/24' => [ '10.10.10.0', '255.255.255.0' ], '10.10/16' => [ '10.10.0.0', '255.255.0.0' ], '10.10.10' => [ '10.10.0.10', '255.255.255.255' ], ); plan tests => 2 * scalar keys %w; for my $a (keys %w) { my $ip = new NetAddr::IP::Lite $a; is($ip->addr, $w{$a}->[0], "Matching ->addr()"); is($ip->mask, $w{$a}->[1], "Matching ->mask()"); } Lite/t/bin_ips.t 0000644 00000003727 15043770025 0007530 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; sub ok() { print 'ok ',$test++,"\n"; } print "1..10\n"; $test = 1; ############## test new6 my $exp = '0:0:0:0:0:0:0:3039/1'; my $ip = NetAddr::IP::Lite->new6(12345,1); my $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $ip = NetAddr::IP::Lite->new6('12345',1); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $ip = NetAddr::IP::Lite->new6('12345/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; # 2^127 170141183460469231731687303715884105728 $exp = '8000:0:0:0:0:0:0:0/1'; $ip = NetAddr::IP::Lite->new6('170141183460469231731687303715884105728/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; # 2^128 340282366920938463463374607431768211456 # minus one $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/1'; $ip = NetAddr::IP::Lite->new6('340282366920938463463374607431768211455/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; ############# test new $exp = '0.0.48.57/1'; $ip = NetAddr::IP::Lite->new(12345,1); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $ip = NetAddr::IP::Lite->new('12345',1); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $ip = NetAddr::IP::Lite->new('12345/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; # 2^127 170141183460469231731687303715884105728 $exp = '8000:0:0:0:0:0:0:0/1'; $ip = NetAddr::IP::Lite->new('170141183460469231731687303715884105728/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; # 2^128 340282366920938463463374607431768211456 # minus one $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/1'; $ip = NetAddr::IP::Lite->new('340282366920938463463374607431768211455/1'); $got = $ip->cidr(); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; Lite/t/firstlast.t 0000644 00000002247 15043770025 0010114 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..8\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip4 = NetAddr::IP::Lite->new('1.2.3.11/29'); my $ip6 = NetAddr::IP::Lite->new('FF::8B/125'); my $exp = '1.2.3.9'; my $rv = $ip4->first->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = '1.2.3.14'; $rv = $ip4->last->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = 'FF:0:0:0:0:0:0:89'; $rv = $ip6->first->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = 'FF:0:0:0:0:0:0:8E'; $rv = $ip6->last->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $ip4 = NetAddr::IP::Lite->new('1.2.3.11/31'); $ip6 = NetAddr::IP::Lite->new('FF::8B/127'); $exp = '1.2.3.10'; $rv = $ip4->first->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = '1.2.3.11'; $rv = $ip4->last->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = 'FF:0:0:0:0:0:0:8A'; $rv = $ip6->first->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; $exp = 'FF:0:0:0:0:0:0:8B'; $rv = $ip6->last->addr; print "got: $rv, exp: $exp\nnot " unless $rv eq $exp; &ok; Lite/t/v6-old-base-uri.t 0000644 00000004540 15043770025 0010713 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['[::]', 3, '0:0:0:0:0:0:0:0/128',myfail], ['[::1]', 3, '0:0:0:0:0:0:0:1/128',myfail], ['[F34::123/40]', 3, 'F34:0:0:0:0:0:0:3/40',mypass], ['[DEAD:BEEF::1/40]', 3, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['[1000::2/40]', 1, '1000:0:0:0:0:0:0:1/40',mypass], ['[1000::2000/40]', 1, '1000:0:0:0:0:0:0:1/40',mypass], ['[DEAD::CAFE/40]', 1, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['[DEAD:BEEF::1/40]', 4, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['[DEAD:BEEF::1/40]', 5, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['[DEAD:BEEF::1/40]', 6, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['[DEAD:BEEF::1/40]', 7, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['[DEAD:BEEF::1/40]', 8, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['[DEAD:BEEF::1/40]', 9, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['[DEAD:BEEF::1/40]', 255, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['[DEAD:BEEF::1/40]', 256, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['[DEAD:BEEF::1/40]', 257, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['[DEAD:BEEF::1/40]', 65536, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['[DEAD:BEEF::1/40]', 65537, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['[2001:620:0:4::/64]', 1, '2001:620:0:4:0:0:0:1/64',mypass], ['[3FFE:2000:0:4::/64]', 1, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['[2001:620:600::1]', 1, '2001:620:600:0:0:0:0:1/128',myfail], ['[2001:620:600:0:1::1]', 1,'2001:620:600:0:1:0:0:1/128',myfail], ); use NetAddr::IP::Lite qw(:old_nth); use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new NetAddr::IP::Lite 'f35::1/40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/v6-new_cis_base.t 0000644 00000004462 15043770025 0011054 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['::', 3, '0:0:0:0:0:0:0:0/128',myfail], ['::1', 3, '0:0:0:0:0:0:0:1/128',myfail], ['F34::123 40', 2, 'F34:0:0:0:0:0:0:3/40',mypass], ['DEAD:BEEF::1 40', 2, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['1000::2 40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['1000::2000 40', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['DEAD::CAFE 40', 0, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['DEAD:BEEF::1 40', 3, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['DEAD:BEEF::1 40', 4, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['DEAD:BEEF::1 40', 5, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['DEAD:BEEF::1 40', 6, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['DEAD:BEEF::1 40', 7, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['DEAD:BEEF::1 40', 8, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['DEAD:BEEF::1 40', 254, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['DEAD:BEEF::1 40', 255, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['DEAD:BEEF::1 40', 256, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['DEAD:BEEF::1 40', 65535, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['DEAD:BEEF::1 40', 65536, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['2001:620:0:4::/64', 0, '2001:620:0:4:0:0:0:1/64',mypass], ['3FFE:2000:0:4::/64', 0, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['2001:620:600::1', 0, '2001:620:600:0:0:0:0:1/128',mypass], ['2001:620:600:0:1::1', 0,'2001:620:600:0:1:0:0:1/128',mypass], ); use NetAddr::IP::Lite; use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new_cis NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new_cis NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new_cis NetAddr::IP::Lite 'f35::1 40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/bigint.t 0000644 00000016015 15043770025 0007353 0 ustar 00 use strict; #use diagnostics; use Test::More; use NetAddr::IP::Lite; use NetAddr::IP::Util qw( bcd2bin bin2bcd addconst shiftleft ); use Data::Dumper; sub badd { # function to add a small int to bignum string my($n,$i) = @_; my $v = bcd2bin($n); (undef,$v) = addconst($v,$i); bin2bcd($v); } sub xpo2 { # function to do a n^2 multiplication my($n,$x) = @_; my $v = bcd2bin($n); my $c = 0; while ($x >>= 1) {$c++} $v = shiftleft($v,$c); bin2bcd($v); } my $no_mbi_emu = 1; # set this to "1" for normal, "0" for development unless (eval{ $no_mbi_emu && require Math::BigInt }) { if ($no_mbi_emu) { print "1..1\nok 1 # skipped all, Math::BigInt not found\n"; exit; } &NetAddr::IP::Lite::_force_bi_emu; package Math::BigInt; my $badd = \&main::badd; require overload; import overload '""' => sub { ${$_[0]} =~ /(\d+)/; return $1; }, '+' => sub { ${$_[0]} =~ /(\d+)/; $b = '+'. main::badd($1,$_[1]); bless \$b; }; *new = \&NetAddr::IP::Lite::_bi_fake; } my @exp = (qw( 255.255.255.253/32 4294967293 4294967295 255.255.255.254/32 4294967294 4294967295 255.255.255.255/32 4294967295 4294967295 0:0:0:0:0:1:0:0/128 4294967296 4294967295 0:0:0:0:0:1:0:1/128 4294967297 4294967295 0:0:0:0:0:1:0:2/128 4294967298 4294967295 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFD/128 340282366920938463463374607431768211453 340282366920938463463374607431768211455 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE/128 340282366920938463463374607431768211454 340282366920938463463374607431768211455 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF/128 340282366920938463463374607431768211455 340282366920938463463374607431768211455 0.0.0.0/32 0 4294967295 0.0.0.1/32 1 4294967295 0.0.0.2/32 2 4294967295 123.45.67.89/32 2066563929 4294967295 123.45.67.89/28 2066563929 4294967280 123.45.67.89/24 2066563929 4294967040 123.45.67.89/20 2066563929 4294963200 123.45.67.89/16 2066563929 4294901760 123.45.67.89/12 2066563929 4293918720 123.45.67.89/8 2066563929 4278190080 123.45.67.89/4 2066563929 4026531840 123.45.67.89/0 2066563929 0 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/128 170145699920964442595609400891477785294 340282366920938463463374607431768211455 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/124 170145699920964442595609400891477785294 340282366920938463463374607431768211440 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/120 170145699920964442595609400891477785294 340282366920938463463374607431768211200 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/116 170145699920964442595609400891477785294 340282366920938463463374607431768207360 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/112 170145699920964442595609400891477785294 340282366920938463463374607431768145920 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/108 170145699920964442595609400891477785294 340282366920938463463374607431767162880 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/104 170145699920964442595609400891477785294 340282366920938463463374607431751434240 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/100 170145699920964442595609400891477785294 340282366920938463463374607431499776000 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/96 170145699920964442595609400891477785294 340282366920938463463374607427473244160 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/92 170145699920964442595609400891477785294 340282366920938463463374607363048734720 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/88 170145699920964442595609400891477785294 340282366920938463463374606332256583680 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/84 170145699920964442595609400891477785294 340282366920938463463374589839582167040 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/80 170145699920964442595609400891477785294 340282366920938463463374325956791500800 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/76 170145699920964442595609400891477785294 340282366920938463463370103832140840960 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/72 170145699920964442595609400891477785294 340282366920938463463302549837730283520 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/68 170145699920964442595609400891477785294 340282366920938463462221685927161364480 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/64 170145699920964442595609400891477785294 340282366920938463444927863358058659840 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/60 170145699920964442595609400891477785294 340282366920938463168226702252415385600 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/56 170145699920964442595609400891477785294 340282366920938458741008124562122997760 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/52 170145699920964442595609400891477785294 340282366920938387905510881517444792320 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/48 170145699920964442595609400891477785294 340282366920937254537554992802593505280 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/44 170145699920964442595609400891477785294 340282366920919120650260773364972912640 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/40 170145699920964442595609400891477785294 340282366920628978453553262363043430400 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/36 170145699920964442595609400891477785294 340282366915986703306233086332171714560 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/32 170145699920964442595609400891477785294 340282366841710300949110269838224261120 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/28 170145699920964442595609400891477785294 340282365653287863235145205935065006080 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/24 170145699920964442595609400891477785294 340282346638528859811704183484516925440 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/20 170145699920964442595609400891477785294 340282042402384805036647824275747635200 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/16 170145699920964442595609400891477785294 340277174624079928635746076935438991360 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/12 170145699920964442595609400891477785294 340199290171201906221318119490500689920 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/8 170145699920964442595609400891477785294 338953138925153547590470800371487866880 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/4 170145699920964442595609400891477785294 319014718988379809496913694467282698240 8000:DEAD:BEEF:4:CAFE:BAD:2:FACE/0 170145699920964442595609400891477785294 0 )); my $ptr = 0; my $max = @exp -11; plan tests => $max || 1; sub run { foreach(1..5) { my $ip = new NetAddr::IP::Lite($exp[$ptr]); my $mbi = $ip->bigint(); $mbi = $mbi + 1; #print $ip,"\n"; #print Dumper $mbi; #print $exp[$ptr+1],"\n"; like($mbi, qr/(?:0|$exp[$ptr+4])/); $ip = new NetAddr::IP::Lite($mbi); is($ip, $exp[$ptr+3]); pass(); # ignore mask for these tests $ptr += 3; } } run(); $ptr += 3; run(); $ptr += 3; sub mrun { my $n = shift; foreach(1..$n) { my $ip = new NetAddr::IP::Lite($exp[$ptr]); my ($mbia,$mbim) = $ip->bigint(); my($ary,$msk,$eip) = @exp[$ptr+1,$ptr+2,$ptr+3]; $ptr += 3; #print $msk,"\n"; #print Dumper $mbia; #print Dumper $mbim; like($mbia, qr/$ary/); like($mbim, qr/$msk/); my $len = $ip->masklen(); last unless $len; last if $ptr > $max + 200; # loop stop, just in case #print Dumper $mbim; $mbim = new Math::BigInt($exp[$ptr+2]); #print Dumper $mbim; #print Dumper $mbia; $ip = new NetAddr::IP::Lite($mbia,$mbim); is($ip, $eip); #print '|',$ip,"|\n"; } } mrun(9); $ptr += 3; mrun(32); Lite/t/lower.t 0000644 00000000350 15043770025 0007222 0 ustar 00 #use diagnostics; use Test::More tests => 2; use_ok ('NetAddr::IP::Lite', qw(:lower)); my $exp = 'ff:0:0:0:0:0:0:eeaa/128'; my $ip = new NetAddr::IP::Lite('FF::eeAA'); my $got = sprintf $ip; ok ($got eq $exp,"lower case $got"); Lite/t/v6-cnew.t 0000644 00000001277 15043770025 0007370 0 ustar 00 use NetAddr::IP::Lite; my @subnets = ( [ 'dead:beef:1234::/16', 'DEAD:BEEF:1234:0:0:0:0:0/16' ], [ '::1234:BEEF:DEAD/24', '0:0:0:0:0:1234:BEEF:DEAD/24' ], # include test for cisco syntax using space instead of '/' [ 'dead:beef:1234:: 16', 'DEAD:BEEF:1234:0:0:0:0:0/16' ], [ '::1234:BEEF:DEAD 24', '0:0:0:0:0:1234:BEEF:DEAD/24' ], [ '::1234:BEEF:DEAD FFFF:FF00::', '0:0:0:0:0:1234:BEEF:DEAD/24' ], ); $| = 1; print '1..', (scalar @subnets) , "\n"; my $count = 1; for my $n (@subnets) { my $ip = new NetAddr::IP::Lite $n->[0]; if ($ip eq $n->[1]) { print "ok $count\n"; } else { print $ip, "\nnot ok $count\n"; } ++ $count; } Lite/t/mask.t 0000644 00000001674 15043770025 0007037 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..4\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); ## test '""' just for the heck of it my $exp = 'FF00:0:0:0:0:0:1:4/120'; my $txt = sprintf("%s",$hiip); print 'got: ',$txt," exp: $exp\nnot " unless $txt eq $exp; &ok; ## test lo ip $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00'; my $mask = $loip->mask; print "got: $mask, exp: $exp\nnot " unless $mask eq $exp && ! ref $mask; &ok; ## test mask hi $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00'; $mask = $hiip->mask; print "got: $mask, exp: $exp\nnot " unless $mask eq $exp && ! ref $mask; &ok; ## test mask dot quad $exp = '255.255.255.0'; $mask = $dqip->mask; print "got: $mask, exp: $exp\nnot " unless $mask eq $exp && ! ref $mask; &ok; Lite/t/v4-num.t 0000644 00000001426 15043770025 0007225 0 ustar 00 use NetAddr::IP::Lite; my $nets = { '10.1.2.3' => [ 32, 0 ], '10.2.3.4' => [ 31, 1 ], '10.0.0.16' => [ 24, 255 ], '10.128.0.1' => [ 8, 2 ** 24 - 1 ], '10.0.0.5' => [ 30, 3 ], '0.0.0.0' => [ 0, 2 ** 32 -1 ], }; my $new = 1; # flag for old vs new numeric returns $| = 1; $test = keys %$nets; $test *= 2; print "1..", $test, "\n"; $test = 1; sub tst { for my $a (keys %$nets) { my $nc = $nets->{$a}->[1] - $new; # net count $nc = 1 if $nc < 0; $nc = 2 if $new && $nets->{$a}->[0] == 31; # special case for /31, /127 my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0]; print "got: $_, exp: $nc\nnot " unless ($_ = $ip->num) == $nc; print "ok ", $test++, "\n"; } } tst(); import NetAddr::IP::Lite qw(:old_nth); $new = 0; tst(); Lite/t/over-qq.t 0000644 00000001362 15043770025 0007470 0 ustar 00 use NetAddr::IP::Lite; my @addr = ('10.0.0.0/8', '192.168.0.0/16', '127.0.0.1/32'); $| = 1; print "1..", 5 * scalar @addr, "\n"; my $count = 1; for my $a (@addr) { my $ip = new NetAddr::IP::Lite $a; if ($a eq "$ip") { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; if ($a eq $ip) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; if ($ip eq $a) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; if ($ip eq $ip) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; if ($ip == $ip) { print "ok $count\n"; } else { print "not ok $count\n"; } ++ $count; } Lite/t/relops.t 0000644 00000003044 15043770025 0007401 0 ustar 00 use NetAddr::IP::Lite; BEGIN { @gt = ( [ '255.255.255.255/32', '0.0.0.0/0' ], [ 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', '::/0' ], [ '10.0.1.0/16', '10.0.0.1/24' ], [ '10.0.0.1/24', '10.0.0.0/24' ], [ 'deaf:beef::1/64', 'dead:beef::/64' ], ); @ngt = ( [ '0.0.0.0/0', '255.255.255.255/32' ], [ '::/0', 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' ], [ '10.0.0.0/24', '10.0.0.0/24' ], [ 'dead:beef::/60', 'dead:beef::/60' ], ); @cmp = ( [ '0.0.0.0/0', '255.255.255.255/32', -1 ], [ '::/0', 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', -1 ], [ '10.0.0.0/16', '10.0.0.0/8', 1 ], [ 'dead:beef::/60', 'dead:beef::/40', 1 ], [ '10.0.0.0/24', '10.0.0.0/8', 1 ], [ '255.255.255.255/32', '0.0.0.0/0', 1 ], [ 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', '::/0', 1 ], [ '142.52.5.87', '142.52.2.88', 1 ], [ '10.0.0.0/24', '10.0.0.0/24', 0 ], [ 'default', 'default', 0 ], [ 'broadcast', 'broadcast', 0], [ 'loopback', 'loopback', 0], ); }; use Test::More tests => @gt + @ngt + (2 * @cmp); for my $a (@gt) { $a_ip = new NetAddr::IP::Lite $a->[0]; $b_ip = new NetAddr::IP::Lite $a->[1]; ok($a_ip > $b_ip, "$a_ip > $b_ip"); } for my $a (@ngt) { $a_ip = new NetAddr::IP::Lite $a->[0]; $b_ip = new NetAddr::IP::Lite $a->[1]; ok(!($a_ip > $b_ip), "$a_ip !> $b_ip"); } for $a (@cmp) { $a_ip = new NetAddr::IP::Lite $a->[0]; $b_ip = new NetAddr::IP::Lite $a->[1]; is($a_ip <=> $b_ip, $a->[2], "$a_ip <=> $b_ip is $a->[2]"); is($a_ip cmp $b_ip, $a->[2], "$a_ip cmp $b_ip is $a->[2]"); } Lite/t/is_local.t 0000644 00000000724 15043770025 0007664 0 ustar 00 #use diagnostics; use NetAddr::IP::Lite; $| = 1; print "1..9\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my @ips = qw( 126.255.255.255 0 127.0.0.0 1 127.0.0.1 1 127.255.255.254 1 127.255.255.255 1 128.0.0.0 0 ::0 0 ::1 1 ::2 0 ); for (my $i=0;$i<=$#ips;$i+=2) { my $ip = new NetAddr::IP::Lite($ips[$i]); my $got = $ip->is_local(); my $exp = $ips[$i+1]; print $ip," got: $got, exp: $exp\nnot " unless $got == $exp; &ok; } Lite/t/v4-badnm.t 0000644 00000001756 15043770025 0007515 0 ustar 00 # I know this does not look like -*- perl -*-, but I swear it is... use strict; use Test::More; $| = 1; my @badnets = ( '10.10.10.10/255.255.0.255', '10.10.10.10/255.0.255.255', '10.10.10.10/0.255.255.255', '10.10.10.10/128.255.0.255', '10.10.10.10/255.128.0.255', '10.10.10.10/255.255.255.129', '10.10.10.10/255.255.129.0', '10.10.10.10/255.255.255.130', '10.10.10.10/255.255.130.0', '10.10.10.10/255.0.0.1', '10.10.10.10/255.129.0.1', '10.10.10.10/0.255.0.255', '58.26.0.0-58.27.127.255', # Taken from APNIC's WHOIS case ); my @goodnets = (); push @goodnets, "10.0.0.1/$_" for (0 .. 32); push @goodnets, "10.0.0.1/255.255.255.255"; plan tests => 1 + @badnets + @goodnets; die "# Cannot continue without NetAddr::IP::Lite\n" unless use_ok('NetAddr::IP::Lite'); my $count = 1; ok(! defined NetAddr::IP::Lite->new($_), "new $_ should fail") for @badnets; ok(defined NetAddr::IP::Lite->new($_), "new $_ should work") for @goodnets; Lite/t/v6-new-base-uri.t 0000644 00000004523 15043770025 0010727 0 ustar 00 # This -*- perl -*- code excercises the basic v6 functionality sub mypass() {1} sub myfail() {0} @addr = ( ['[::]', 3, '0:0:0:0:0:0:0:0/128',myfail], ['[::1]', 3, '0:0:0:0:0:0:0:1/128',myfail], ['[F34::123/40]', 2, 'F34:0:0:0:0:0:0:3/40',mypass], ['[DEAD:BEEF::1/40]', 2, 'DEAD:BEEF:0:0:0:0:0:3/40',mypass], ['[1000::2/40]', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['[1000::2000/40]', 0, '1000:0:0:0:0:0:0:1/40',mypass], ['[DEAD::CAFE/40]', 0, 'DEAD:0:0:0:0:0:0:1/40',mypass], ['[DEAD:BEEF::1/40]', 3, 'DEAD:BEEF:0:0:0:0:0:4/40',mypass], ['[DEAD:BEEF::1/40]', 4, 'DEAD:BEEF:0:0:0:0:0:5/40',mypass], ['[DEAD:BEEF::1/40]', 5, 'DEAD:BEEF:0:0:0:0:0:6/40',mypass], ['[DEAD:BEEF::1/40]', 6, 'DEAD:BEEF:0:0:0:0:0:7/40',mypass], ['[DEAD:BEEF::1/40]', 7, 'DEAD:BEEF:0:0:0:0:0:8/40',mypass], ['[DEAD:BEEF::1/40]', 8, 'DEAD:BEEF:0:0:0:0:0:9/40',mypass], ['[DEAD:BEEF::1/40]', 254, 'DEAD:BEEF:0:0:0:0:0:FF/40',mypass], ['[DEAD:BEEF::1/40]', 255, 'DEAD:BEEF:0:0:0:0:0:100/40',mypass], ['[DEAD:BEEF::1/40]', 256, 'DEAD:BEEF:0:0:0:0:0:101/40',mypass], ['[DEAD:BEEF::1/40]', 65535, 'DEAD:BEEF:0:0:0:0:1:0/40',mypass], ['[DEAD:BEEF::1/40]', 65536, 'DEAD:BEEF:0:0:0:0:1:1/40',mypass], ['[2001:620:0:4::/64]', 0, '2001:620:0:4:0:0:0:1/64',mypass], ['[3FFE:2000:0:4::/64]', 0, '3FFE:2000:0:4:0:0:0:1/64',mypass], ['[2001:620:600::1]', 0, '2001:620:600:0:0:0:0:1/128',mypass], ['[2001:620:600:0:1::1]', 0,'2001:620:600:0:1:0:0:1/128',mypass], ); use NetAddr::IP::Lite; use Test::More; my($a, $ip, $test); $test = 4 * @addr + 4; plan tests => $test; $test = 1; sub tst { for $a (@addr) { $ip = new NetAddr::IP::Lite $a->[0]; $a->[0] =~ s,/\d+,,; isa_ok($ip, 'NetAddr::IP::Lite', "$a->[0] "); # requires full NetAddr::IP # is(uc $ip->short, $a->[0], "short returns $a->[0]"); is($ip->bits, 128, "bits == 128"); is($ip->version, 6, "version == 6"); my $index = $a->[1]; if ($a->[3]) { is(uc $ip->nth($index), $a->[2], "nth $a->[0], $index"); } else { ok(!$ip->nth($index),"nth $a->[0], undef"); } } } tst(); $test = new NetAddr::IP::Lite 'f34::1'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); $test = new NetAddr::IP::Lite 'f35::1/40'; isa_ok($test, 'NetAddr::IP::Lite'); ok($test->network->contains($test), "->contains"); Lite/t/range.t 0000644 00000001037 15043770025 0007171 0 ustar 00 #use diagnostics; use NetAddr::IP::Util qw( inet_ntoa ipv6_n2x ); use NetAddr::IP::Lite; $| = 1; print "1..2\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $loip = new NetAddr::IP::Lite('1.2.3.4/24'); my $hiip = new NetAddr::IP::Lite('FF00::4/120'); ## test range my $exp = 'FF00:0:0:0:0:0:0:0 - FF00:0:0:0:0:0:0:FF'; my $txt = $hiip->range; print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; $exp = '1.2.3.0 - 1.2.3.255'; $txt = $loip->range; print "got: $txt, exp: $exp\nnot " unless $txt eq $exp; &ok; Lite/t/nofqdn.t 0000644 00000000706 15043770025 0007364 0 ustar 00 use NetAddr::IP::Lite $| = 1; print "1..2\n"; my $test = 1; sub ok() { print 'ok ',$test++,"\n"; } my $ip = new NetAddr::IP::Lite('arin.net'); if (defined $ip) { print "ok $test # Skipped, resolved $ip\n"; $test++; } else { print "ok $test # Skipped, resolver not working\n"; $test++; } import NetAddr::IP::Lite qw(:nofqdn); $ip = new NetAddr::IP::Lite('arin.net'); print "unexpected response with :nofqdn\nnot " if defined $ip; &ok; Lite/t/v6-numeric-uri.t 0000644 00000005327 15043770025 0010673 0 ustar 00 use NetAddr::IP::Lite; use Test::More; my @pairs = ( [ '[::/0]', '0', '0' ], [ '[::/128]', '0', '340282366920938463463374607431768211455' ], [ '[cafe:cafe::/64]', '269827015721314068804783158349174669312', '340282366920938463444927863358058659840' ], [ '[cafe:cafe::1/64]', '269827015721314068804783158349174669313', '340282366920938463444927863358058659840' ], [ '[dead:beef::/100]', '295990755014133383690938178081940045824', '340282366920938463463374607431499776000' ], [ '[dead:beef::1/100]', '295990755014133383690938178081940045825', '340282366920938463463374607431499776000' ], ); my @scale = qw( 0000:0000:0000:0000:0000:0000:0000:0000 0000:0000:0000:0000:0000:0000:0000:0001 0000:0000:0000:0000:0000:0000:0000:0010 0000:0000:0000:0000:0000:0000:0000:0100 0000:0000:0000:0000:0000:0000:0000:1000 0000:0000:0000:0000:0000:0000:0001:0000 0000:0000:0000:0000:0000:0001:0000:0000 0000:0000:0000:0000:0000:0010:0000:0000 0000:0000:0000:0000:0000:0100:0000:0000 0000:0000:0000:0000:0000:1000:0000:0000 0000:0000:0000:0000:0001:0000:0000:0000 0000:0000:0000:0001:0000:0000:0000:0000 0000:0000:0000:0010:0000:0000:0000:0000 0000:0000:0000:0100:0000:0000:0000:0000 0000:0000:0000:1000:0000:0000:0000:0000 0000:0000:0001:0000:0000:0000:0000:0000 0000:0001:0000:0000:0000:0000:0000:0000 0000:0010:0000:0000:0000:0000:0000:0000 0000:0100:0000:0000:0000:0000:0000:0000 0000:1000:0000:0000:0000:0000:0000:0000 0001:0000:0000:0000:0000:0000:0000:0000 0010:0000:0000:0000:0000:0000:0000:0000 0100:0000:0000:0000:0000:0000:0000:0000 1000:0000:0000:0000:0000:0000:0000:0000 ); my $tests = 4 * @pairs + @scale ** 2; plan tests => $tests; for my $p (@pairs) { my $a = new NetAddr::IP::Lite $p->[0]; isa_ok($a, 'NetAddr::IP::Lite', "$p->[0]"); is($a->numeric, $p->[1], "$p->[0] Scalar numeric ok"); is(($a->numeric)[0], $p->[1], "$p->[0] Array numeric ok for network"); is(($a->numeric)[1], $p->[2], "$p->[0] Array numeric ok for mask"); } @ip_scale = map { new NetAddr::IP::Lite $_ } @scale; isa_ok($_, 'NetAddr::IP::Lite', $_->addr) for @ip_scale; for my $i (0 .. $#ip_scale) { for my $l (0 .. $i - 1) { next if $l >= $i; unless (ok($ip_scale[$i]->numeric > $ip_scale[$l]->numeric, "[$i, $l] $scale[$i] > $scale[$l]")) { diag "assertion [$i]: " . $ip_scale[$i]->numeric . " > " . $ip_scale[$l]->numeric; } } next if $i == $#ip_scale; for my $l ($i + 1 .. $#ip_scale) { next if $l <= $i; unless (ok($ip_scale[$i]->numeric < $ip_scale[$l]->numeric, "[$i, $l] $scale[$i] < $scale[$l]")) { diag "assertion [$i]: " . $ip_scale[$i]->numeric . " < " . $ip_scale[$l]->numeric; } } } Lite/t/overminus.t 0000644 00000003113 15043770025 0010121 0 ustar 00 #use diagnostics; use Test::More tests => 32; use NetAddr::IP::Lite; my $ip80 = new NetAddr::IP::Lite('::1:8000:0/80'); my $ip7f = $ip80 - 1; my $maxplus = 2147483647; my $maxminus = 2147483648; my $rv; my $ipmax = $ip80 + $maxplus; ok(($rv = sprintf("%s",$ipmax)) eq '0:0:0:0:0:1:FFFF:FFFF/80',"ip80 maxplus eq $rv eq 0:0:0:0:0:1:FFFF:FFFF/80"); my $ipmin = $ip80 - $maxminus; ok(($rv = sprintf("%s",$ipmin)) eq '0:0:0:0:0:1:0:0/80',"ip80 maxminus� eq $rv eq 0:0:0:0:0:1:0:0/80"); my $over = $maxplus +1; ok(($rv = sprintf("%s",$ip80 + $over)) eq '0:0:0:0:0:1:8000:0/80',"ip80 +overange unchanged, $rv"); $over = $maxminus +1; ok(($rv = sprintf("%s",$ip80 - $over)) eq '0:0:0:0:0:1:8000:0/80',"ip80 -overange unchanged, $rv"); ok(($rv = sprintf("%s",$ip80)) eq '0:0:0:0:0:1:8000:0/80',"ip80 eq $rv eq 0:0:0:0:0:1:8000:0/80"); ok(($rv = sprintf("%s",$ip7f)) eq '0:0:0:0:0:1:7FFF:FFFF/80',"ip7f eq $rv eq 0:0:0:0:0:1:7FFF:FFFF/80"); ok(($rv = $ip80 - $ip7f) == 1,"ip80 - ip7f = $rv"); ok(($rv = $ip7f - $ip80) == -1,"ip7f - ip80 = $rv"); ok(($rv = $ipmax - $ip80) == $maxplus,"ipmax - ip80 = $rv should be $maxplus"); ok(($rv = $ipmin - $ip80) == -$maxminus,"ipmin - ip80 = $rv should be \-$maxminus"); ++$ipmax; --$ipmin; ok(! defined($ipmax - $ip80),'undefined $ipmax - $ip80 is overange'); ok(! defined($ipmin - $ip80),'undefined $ipmin - $ip80 is -overange'); my $ipx = $ip80->copy + 256; foreach (1..10) { ok(($rv = $ipx - $ip80) == $_ * 256,"$ipx - $ip80 = ". $_*256 ." should be $rv"); ok(($rv = $ip80 - $ipx) == - $_ * 256,"$ip80 - $ipx = ". -$_*256 ." should be $rv"); $ipx += 256; } Lite/Makefile.PL 0000644 00000002036 15043770025 0007417 0 ustar 00 use ExtUtils::MakeMaker; use Config; my $pkg = 'NetAddr::IP::Lite'; $pkg =~ /[^:]+$/; my $module = $& .'.pm'; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. my %makeparms = ( 'NAME' => $pkg, 'VERSION_FROM' => $module, # finds $VERSION 'PREREQ_PM' => {Test::More => 0, }, 'clean' => { FILES => "*~ tmp* META.yml"}, 'dist' => {COMPRESS=>'gzip', SUFFIX=>'gz'} ); sub MY::top_targets { package MY; my $inherited = shift->SUPER::top_targets(@_); $inherited =~ s/(pure_all\s+::.+)/$1 README/; $inherited; } sub MY::post_constants { my $post_constants = $Config{scriptdirexp} .'/pod2text'; if (-e $post_constants) { $post_constants = q| MY_POD2TEXT = |. $post_constants .q| |; } else { $post_constants = q| MY_POD2TEXT = echo "perl distro missing 'pod2text' to convert " |; } } sub MY::postamble { package MY; my $postamble = q| README : |. $module .q| @$(MY_POD2TEXT) |. $module .q| > README |; } WriteMakefile(%makeparms); Lite/MYMETA.yml 0000644 00000001000 15043770025 0007152 0 ustar 00 --- abstract: unknown author: - unknown build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: NetAddr-IP-Lite no_index: directory: - t - inc requires: Test::More: '0' version: '1.57' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Lite/Util/localconf.h 0000644 00000002503 15043770025 0010472 0 ustar 00 /* * localconf.h * */ #include "config.h" #ifdef WORDS_BIGENDIAN #define host_is_BIG_ENDIAN 1 #else #define host_is_LITTLE_ENDIAN 1 #endif #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif #ifdef HAVE_NET_INET_H # include <netinet/in.h> #endif #ifdef HAVE_ARPA_INET_H # include <arpa/inet.h> #endif #ifdef HAVE_NETDB_H # include <netdb.h> #endif #if SIZEOF_U_INT8_T == 0 #undef SIZEOF_U_INT8_T #define SIZEOF_U_INT8_T SIZEOF_UINT8_T typedef uint8_t u_int8_t; #endif #if SIZEOF_U_INT16_T == 0 #undef SIZEOF_U_INT16_T #define SIZEOF_U_INT16_T SIZEOF_UINT16_T typedef uint16_t u_int16_t; #endif #if SIZEOF_U_INT32_T == 0 #undef SIZEOF_U_INT32_T #define SIZEOF_U_INT32_T SIZEOF_UINT32_T typedef uint32_t u_int32_t; #endif #include "localperl.h" Lite/Util/pm_to_blib 0000644 00000000000 15043770025 0010400 0 ustar 00 Lite/Util/Changes 0000644 00000021403 15043770025 0007654 0 ustar 00 1.53 Mon Aug 17 15:35:28 PDT 2015 fix typo in MakefilePL that cause compiler to not be found at all 1.52 Thu Aug 13 22:44:48 PDT 2015 fix Makefile.PL to accomodate bug in Android's sh fix Makefile.PL issue with clang compiler, bug 86831 1.51 Mon Jan 27 11:59:58 PST 2014 modify Makefile.PL to bypass missing 'pod2text' 1.50 Tue Apr 9 12:02:34 PDT 2013 changed Makefile.PL to check for config.h when building for XS with 'gcc', try building with 'cc', and check again. If config.h is not found, force Pure Perl mode. Kill XS in winduhs and Darwin, both of which misbehave when compiling XS code 1.49 Wed Apr 3 10:52:24 PDT 2013 modify Makefile.PL to better detect 'winduhs' 1.48 Tue Oct 2 12:36:11 PDT 2012 correct incorrect format for IPv6 embedded IPv4 addresses in InetBase v0.8 1.47 Fri Aug 10 11:46:18 PDT 2012 correct typo in documentation POD Thanks to Gregor Herrmann, Debian Perl Group Updated GPL text and address 1.46 Fri Nov 11 19:23:11 PST 2011 update documentation in InetBase v0.06 1.45 Fri Nov 11 13:20:32 PST 2011 break out the code in InetBase v0.05 that expands short IPv4 addresses into dotquad format to account for broken BSD implementations of inet_aton and gethostbyname that do not recognize the short format. EXPORT this as sub 'fillIPv4' in Util.pm, add 'fillIPv4' to calls to gethostbyname to work around broken inet_aton and gethostbyname implementations in certain BSD implementations 1.44 Wed Nov 2 19:15:31 PDT 2011 improve inet_aton in InetBase v0.04 to overcome broken gethostbyname found in NetBSD and OpenBSD 1.43 Mon Oct 24 13:25:09 PDT 2011 remove reference to Config{osname} in InetBase.pm v0.03 1.42 Fri Oct 21 10:34:46 PDT 2011 Socket6 prior to version 0.23 does not have AF_INET6 in the EXPORT_OK array, modify InetBase.pm v0.02 to work around this. 1.41 Sat Oct 15 17:26:21 PDT 2011 add inet_pton, inet_ntop, AF_INET, AF_INET6 modify inet_n2dx and inet_n2ad to recognize the new 128 bit IPv4 format ::FFFF:FFFF:0:0 replace isIPv4 with a pure perl version for portablity split the following into NetAddr::IP::InetBase v0.01 to provide better long term support for IPv6 inet_aton inet_ntoa ipv6_aton ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_ntop inet_pton packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 1.40 Sat Oct 8 01:33:44 PDT 2011 remove debug print statement from Util.pm 1.39 Thu Oct 6 23:41:42 PDT 2011 really correct missing internal reference 1.38 Thu Oct 6 20:20:33 PDT 2011 corrected missing internal reference to inet_4map6 1.37 Thu Oct 6 18:23:04 PDT 2011 addid isAnyIPv4, isNewIPv4, inet_4map6 revised naip_gethostbyname to conform to Perl's gethostbyname output 1.36 Sat Feb 19 10:04:00 PST 2011 correction to use of package lexicals thanks to mishikal@yahoo.com for spotting the bug and to Mark Martinec mark.martinec+ama...@ijs.si for the solution. 1.35 Tue Nov 16 16:28:37 PST 2010 naip_gethostbyname modified to return undef instead of 0 (zero) on failure thanks to Terry Cassidy enaudishaylee@tc17.com for the bug report move sub's ipv6_n2d and ipv6_n2x to non-autosplit portion of module to eliminate warnings during autosplit of "our" variables thanks to Nicholas Bamber <nicholas@periapt.co.uk> Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517361 1.34 Wed Sep 29 10:32:50 PDT 2010 Conditionalize import of AF_INET6 in Util.pm NetAddr::IP::UtilPolluted 1.33 Tue Sep 21 17:50:50 PDT 2010 Add UtilPolluted namespace to contain name space pollution created by "use Socket" when invoking Socket6. 1.32 Wed May 12 14:18:20 PDT 2010 In Util.xs, changed netswap() to postincrement *a++ = to *a and added increment after save to mollify some picky compilers that return possible undefined behavior. changed type of _128x10 to 'void' 1.31 Tue Jun 9 10:31:11 PDT 2009 ferret out shell value for Makefile.PL when calling ./configure for systems where the 'x' bit gets lost due to bug in Archive::Tar 1.30 Sat Mar 7 16:35:33 PST 2009 make the compiler test check the environment for CC before using Perl's default compiler 1.29 Sat Mar 7 16:15:18 PST 2009 revised compiler test in Makefile.PL for Util v1.29 to accomodate picky Solaris "cc" 1.28 Wed Dec 17 14:14:06 PST 2008 set uninitialized "carry" in XS bin2bcd to zero 1.27 Tue Dec 9 12:00:08 PST 2008 revised UtilPP v1.7 to work around perl 5.8.4 failures with certain @_ operations of goto &sub... see perl bug [ 23429]. Unfortunately, perl-5.8.4 is the distribution of choice for many solaris boxes 1.26 Fri Nov 28 23:19:01 PST 2008 revised XS code to be full re-entrant... thread safe. removed all traces of mutex locks removed function 'threads' here an in UtilPP v1.6 1.25 Tue Nov 18 19:08:56 PST 2008 correct documentation error in Util_PP v1.5 add threads reporting to Util.xs and UtilPP added what is hopefully thread safe operation via serialization. Must be invoked by "--with-threads" 1.24 Wed Nov 5 18:13:20 PST 2008 Clean up Makefile.PL to check actual required link libraries against the perl build for consistency 1.23 Sun Nov 2 10:10:38 PST 2008 add missing headers in configure and localconf.h for Solaris inet_xton thanks to Karl Bunch <karl@digilink.net> for spotting the bug. 1.22 Wed Oct 22 14:54:12 PDT 2008 eliminated dependence on PL_sawampersand thanks to Mark Martinec <Mark.Martinec@ijs.si> for spotting this and submitting a patch. force -noxs mode for Win32 use autoconf to configure 'C' build 1.21 Thu Oct 16 19:35:33 PDT 2008 again... clear build bug for Win32 and lets get the version number right since it appears that it was up-rev'd at some point to 1.xx 0.20 Mon Oct 6 13:07:34 PDT 2008 clear build bug for Win32 0.19 Sat Sep 27 13:36:58 PDT 2008 updated test for ENDIANess in siteconf add test in inet_aton to detect overange IP dot quad values missed by some broken Socket implementations i.e. 256.1.1.1 0.18 Sun Aug 6 10:48:25 PDT 2006 correct shiftleft documentation correct mask4to6 documentation 0.17 Thu Jul 6 10:46:48 PDT 2006 update 'siteconf line 1608' to fix empty variable in inet_aton test update 'siteconf line 1636' to fix empty variable in inet_pton test add missing colon at t/notcontiguous.t line 66 0.16 Sun Jun 25 16:13:00 PDT 2006 fixed ->new() issues with long digit strings ->new('::fffff') and non hex digits ->new('::foo'). Thanks to Radoslaw Zielinski <radek42@gmail.com> for spotting those bugs 0.15 Tue Jun 13 14:42:34 PDT 2006 UtilPP.pm v0.07 & Util.xs 'shiftleft' so that the original argument is returned when the shift count is '0' or missing 0.14 Tue Jun 6 08:37:01 PDT 2006 add logic to check LIBS => [-lfiles] individually. ExtUtils::xxx does a bad job and leaves libs that do not exist in the list which causes 'siteconf' to blow up on missing libs on perl 5.053 (and probably others) 0.13 Tue Jun 6 08:33:11 PDT 2006 added to xs file, 'hopefully' to allow build on windoze platforms 0.12 Tue Jun 6 08:21:12 PDT 2006 add logic to makefile so 'siteconfig' and C libs are not used in PurePerl mode 0.11 Mon Jun 5 14:45:09 PDT 2006 fix Sparc problems 1) add workaround for OS's that do not have inet_aton 2) add workaround for compilers that do not understand #if MACRO1 == MACRO2 0.10 Sat Jun 3 19:07:51 PDT 2006 add site configuration to supply u_intxx_t vars for Sun OS and others that don't have them 0.09 Sun May 7 18:06:43 PDT 2006 UtilPP.pm v0.06, removed unnecessary pack(unpack) sequences to speed up ipv4->6, ipv6->4 conversions 0.08 Wed Apr 26 18:33:12 PDT 2006 correct documentation error add ipv6to4 0.07 Sun Apr 23 16:11:56 PDT 2006 correct reporting error in UtilPP v0.04 for incorrect argument length in ipv4 -> 6 conversions add conditional netaddr conversion functions ipanyto6, maskanyto6 to Util.xs and UtilPP v0.05 0.06 Tue Apr 18 16:50:53 PDT 2006 add ipv4to6, mask4to6 to Util.pm and UtilPP.pm v0.03 0.05 Sat Apr 15 15:48:17 PDT 2006 Fixed some typo's in Makefile.PL that failed to update README during build 0.04 Wed Apr 12 15:43:33 PDT 2006 add Util_IS.pm to guarantee that the XS lib is not loaded if a previous incarnation of the same version has previously been installed on the system and the module is built with -noxs 0.03 Tue Apr 4 21:55:35 PDT 2006 update minisocket to perl-5.9.3, add header file for backwards compatibility add function 'notcontiguous' to return cidr size and check for spurious bits in the network mask 0.02 Fri Mar 31 12:44:15 PST 2006 added test for illegal characters to ipv6_aton added UtilPP for Pure Perl functionality for the WinTel folks that don't have gcc on their systems 0.01 Tue Mar 28 16:42:44 PST 2006 initial release Lite/Util/configure.ac 0000644 00000002735 15043770025 0010656 0 ustar 00 # Process this file with autoconf to produce a configure script. AC_INIT() AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CC # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h netdb.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_INT32_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T # Checks for library functions. AC_PROG_GCC_TRADITIONAL AH_TEMPLATE([LIBS],[Extra libraries needed for this build]) AH_TEMPLATE([HAVE_LIBNSL],[Define if library library 'nsl' is present]) AH_TEMPLATE([HAVE_GETHOSTBYNAME],[Define to 1 if function 'gethostbyname' is present]) AC_SEARCH_LIBS([gethostbyname],[nsl],[ AC_DEFINE([HAVE_GETHOSTBYNAME])]) AH_TEMPLATE([HAVE_INET_ATON],[Define to 1 if function 'inet_aton' is present]) AC_SEARCH_LIBS([inet_aton],[socket],[ AC_DEFINE([HAVE_INET_ATON])]) AH_TEMPLATE([HAVE_INET_PTON],[Define to 1 if function 'inet_pton' is present]) AC_SEARCH_LIBS([inet_pton],[socket],[ AC_DEFINE([HAVE_INET_PTON])]) AH_TEMPLATE([HAVE_INET_ADDR],[Define to 1 if function 'inet_addr' is present]) AC_SEARCH_LIBS([inet_addr],[socket],[ AC_DEFINE([HAVE_INET_ADDR])]) AC_C_BIGENDIAN AC_CHECK_SIZEOF([uint8_t]) AC_CHECK_SIZEOF([uint16_t]) AC_CHECK_SIZEOF([uint32_t]) AC_CHECK_SIZEOF([u_int8_t]) AC_CHECK_SIZEOF([u_int16_t]) AC_CHECK_SIZEOF([u_int32_t]) AC_CONFIG_COMMANDS_PRE([ if test "$LIBS" != ""; then AC_DEFINE_UNQUOTED([LIBS],[$LIBS],[Extra libraries]) fi ]) AC_OUTPUT Lite/Util/configure.cc 0000644 00000454734 15043770025 0010672 0 ustar 00 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 </dev/null exec 6>&1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='LTLIBOBJS LIBOBJS EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 <conftest.val; ac_retval=0 else ac_retval=1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext rm -f conftest.val fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/socket.h netinet/in.h arpa/inet.h netdb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sgtty.h> Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <termio.h> Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 $as_echo_n "checking for library containing gethostbyname... " >&6; } if ${ac_cv_search_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_gethostbyname=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gethostbyname+:} false; then : break fi done if ${ac_cv_search_gethostbyname+:} false; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 $as_echo "$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5 $as_echo_n "checking for library containing inet_aton... " >&6; } if ${ac_cv_search_inet_aton+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_aton=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_aton+:} false; then : break fi done if ${ac_cv_search_inet_aton+:} false; then : else ac_cv_search_inet_aton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5 $as_echo "$ac_cv_search_inet_aton" >&6; } ac_res=$ac_cv_search_inet_aton if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_INET_ATON 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 $as_echo_n "checking for library containing inet_pton... " >&6; } if ${ac_cv_search_inet_pton+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_pton (); int main () { return inet_pton (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_pton=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_pton+:} false; then : break fi done if ${ac_cv_search_inet_pton+:} false; then : else ac_cv_search_inet_pton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 $as_echo "$ac_cv_search_inet_pton" >&6; } ac_res=$ac_cv_search_inet_pton if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 $as_echo_n "checking for library containing inet_addr... " >&6; } if ${ac_cv_search_inet_addr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_addr (); int main () { return inet_addr (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_inet_addr=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_inet_addr+:} false; then : break fi done if ${ac_cv_search_inet_addr+:} false; then : else ac_cv_search_inet_addr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 $as_echo "$ac_cv_search_inet_addr" >&6; } ac_res=$ac_cv_search_inet_addr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_INET_ADDR 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint8_t" >&5 $as_echo_n "checking size of uint8_t... " >&6; } if ${ac_cv_sizeof_uint8_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint8_t))" "ac_cv_sizeof_uint8_t" "$ac_includes_default"; then : else if test "$ac_cv_type_uint8_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uint8_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint8_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uint8_t" >&5 $as_echo "$ac_cv_sizeof_uint8_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT8_T $ac_cv_sizeof_uint8_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint16_t" >&5 $as_echo_n "checking size of uint16_t... " >&6; } if ${ac_cv_sizeof_uint16_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint16_t))" "ac_cv_sizeof_uint16_t" "$ac_includes_default"; then : else if test "$ac_cv_type_uint16_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uint16_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint16_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uint16_t" >&5 $as_echo "$ac_cv_sizeof_uint16_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT16_T $ac_cv_sizeof_uint16_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uint32_t" >&5 $as_echo_n "checking size of uint32_t... " >&6; } if ${ac_cv_sizeof_uint32_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint32_t))" "ac_cv_sizeof_uint32_t" "$ac_includes_default"; then : else if test "$ac_cv_type_uint32_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uint32_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_uint32_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uint32_t" >&5 $as_echo "$ac_cv_sizeof_uint32_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT32_T $ac_cv_sizeof_uint32_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of u_int8_t" >&5 $as_echo_n "checking size of u_int8_t... " >&6; } if ${ac_cv_sizeof_u_int8_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (u_int8_t))" "ac_cv_sizeof_u_int8_t" "$ac_includes_default"; then : else if test "$ac_cv_type_u_int8_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (u_int8_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_u_int8_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_u_int8_t" >&5 $as_echo "$ac_cv_sizeof_u_int8_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT8_T $ac_cv_sizeof_u_int8_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of u_int16_t" >&5 $as_echo_n "checking size of u_int16_t... " >&6; } if ${ac_cv_sizeof_u_int16_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (u_int16_t))" "ac_cv_sizeof_u_int16_t" "$ac_includes_default"; then : else if test "$ac_cv_type_u_int16_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (u_int16_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_u_int16_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_u_int16_t" >&5 $as_echo "$ac_cv_sizeof_u_int16_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT16_T $ac_cv_sizeof_u_int16_t _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of u_int32_t" >&5 $as_echo_n "checking size of u_int32_t... " >&6; } if ${ac_cv_sizeof_u_int32_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (u_int32_t))" "ac_cv_sizeof_u_int32_t" "$ac_includes_default"; then : else if test "$ac_cv_type_u_int32_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (u_int32_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_u_int32_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_u_int32_t" >&5 $as_echo "$ac_cv_sizeof_u_int32_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT32_T $ac_cv_sizeof_u_int32_t _ACEOF cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test "$LIBS" != ""; then cat >>confdefs.h <<_ACEOF #define LIBS $LIBS _ACEOF fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' <confdefs.h | sed ' s/'"$ac_delim"'/"\\\ "/g' >>$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi Lite/Util/MANIFEST.SKIP 0000644 00000000462 15043770025 0010261 0 ustar 00 ^Build$ ^_build/ ^blib/ ^blibdirs Makefile$ Makefile\.[a-z]+$ pm_to_blib CVS/.* \.cvs ,v$ ^tmp/ \.old$ \.bak$ \.tmp$ \.xsc$ ~$ ^# \.shar$ \.tar$ \.tgz$ \.tar\.gz$ \.zip$ _uu$ Util\.(bs|[co])$ localStuff\.h$ config\.log$ config\.h$ config\.status localperl\.h tlib/NetAddr/IP/Util_IS.pm Util_IS.pm META.yml Lite/Util/Util.xs 0000644 00000040703 15043770025 0007656 0 ustar 00 /* * Copyright 2006 - 2012, Michael Robinton <michael@bizsystems.com> * * 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. */ #ifdef __cplusplus extern "C" { #endif #ifdef _CYGWIN #include <windows.h> #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" /* needed for testing with 'printf' #include <stdio.h> */ #ifdef _CYGWIN #include <Win32-Extensions.h> #endif #include "localconf.h" #ifdef __cplusplus } #endif /* workaround for OS's without inet_aton */ /* #include "xs_include/inet_aton.c" removed 10-12-11 */ typedef union { u_int32_t u[4]; unsigned char c[16]; } n128; char * is_ipv6to4 = "ipv6to4", * is_shiftleft = "shiftleft", * is_comp128 = "comp128"; char * is_sub128 = "sub128", * is_add128 = "add128"; char * is_hasbits = "hasbits"; /* , * is_isIPv4 = "isIPv4"; */ char * is_bcd2bin = "bcd2bin", * is_simple_pack = "simple_pack", * is_bcdn2bin = "bcdn2bin"; char * is_mask4to6 = "mask4to6", * is_ipv4to6 = "ipv4to6"; char * is_maskanyto6 = "maskanyto6", * is_ipanyto6 = "ipanyto6"; typedef struct bcdstuff { /* character array of 40 bytes */ char txt[21]; /* 20 bytes + string terminator */ u_int32_t bcd[5]; /* 20 bytes, 40 digits */ } BCD; #define zero ('0' & 0x7f) /* useful for debug, prints the 128 bits of 8, 16 bit registers */ void printb128(char * b) { int c; for(c=0;c<16;c++) { if (b[c] &0x80) printf("1"); else printf("0"); if (b[c] &0x40) printf("1"); else printf("0"); if (b[c] &0x20) printf("1"); else printf("0"); if (b[c] &0x10) printf("1"); else printf("0"); if (b[c] &0x8) printf("1"); else printf("0"); if (b[c] &0x4) printf("1"); else printf("0"); if (b[c] &0x2) printf("1"); else printf("0"); if (b[c] &0x1) printf("1"); else printf("0"); if (c == 3 || c == 7 || c == 11) printf("\n"); } printf("\n\n"); } void extendipv4(void * aa, void * ux) { register u_int32_t * a = ux; *a++ = 0; *a++ = 0; *a++ = 0; *a = *((u_int32_t *)aa); } void extendmask4(void * aa, void * ux) { register u_int32_t * a = ux; *a++ = 0xffffffff; *a++ = 0xffffffff; *a++ = 0xffffffff; *a = *((u_int32_t *)aa); } void fastcomp128(void * aa) { register u_int32_t * a = aa; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; } /* add two 128 bit numbers return the carry */ int adder128(void * aa, void * bb, n128 * ap128, int carry) { int i; register u_int32_t a, b, r; for (i=3; i >= 0; i--) { a = *((u_int32_t *)aa + i); b = *((u_int32_t *)bb + i); r = a + b; a = 0; /* ripple carry forward */ if ( r < a || r < b) /* if overflow */ a = 1; b = r + carry; /* carry propagate in */ if (b < r) /* ripple carry forward */ carry = 1; /* if overflow */ else carry = a; *((u_int32_t *)(ap128->u) + i) = b; } return carry; } int addercon(void * aa, u_int32_t * bb, n128 * ap128, int32_t con) { register u_int32_t tmp = 0x80000000; if (con & tmp) tmp = 0xffffffff; else tmp = 0; bb[0] = tmp; bb[1] = tmp; bb[2] = tmp; bb[3] = (u_int32_t)con; return adder128(aa,bb,ap128,0); } int have128(void * bp) { register u_int32_t * p = bp; if (*p++ || *p++ || *p++ || *p++) return 1; return 0; } int _isipv4(void * bp) { register u_int32_t * p = bp; if (*p++ || *p++ || *p++) return 0; return 1; } /* network byte swap and copy */ void netswap_copy(void * dest, void * src, int len) { register u_int32_t * d = dest, * s = src; for (/* -- */;len>0;len--) { #ifdef host_is_LITTLE_ENDIAN *d++ = (((*s & 0xff000000) >> 24) | ((*s & 0x00ff0000) >> 8) | \ ((*s & 0x0000ff00) << 8) | ((*s & 0x000000ff) << 24)); #else # ifdef host_is_BIG_ENDIAN *d++ = *s; # else # error ENDIANness not defined # endif #endif s++; } } /* do ntohl / htonl changes as necessary for this OS */ void netswap(void * ap, int len) { #ifdef host_is_LITTLE_ENDIAN register u_int32_t * a = ap; for (/* -- */;len >0;len--) { *a = (((*a & 0xff000000) >> 24) | ((*a & 0x00ff0000) >> 8) | \ ((*a & 0x0000ff00) << 8) | ((*a & 0x000000ff) << 24)); a++; } #endif } /* shift right to purge '0's, return mask bit count and remainder value, left fill with ones */ unsigned char _countbits(void *ap) { register u_int32_t * p0 = (u_int32_t *)ap, * p1 = p0 +1, * p2 = p1 +1, * p3 = p2 +1; unsigned char count = 128; fastcomp128(ap); do { if (!(*p3 & 1)) break; count--; *p3 >>= 1; if (*p2 & 1) *p3 |= 0x80000000; *p2 >>= 1; if (*p1 & 1) *p2 |= 0x80000000; *p1 >>= 1; if (*p0 & 1) *p1 |= 0x80000000; *p0 >>= 1; } while (count > 0); return count; } /* multiply 128 bit number x 2 */ void _128x2(u_int32_t * ap) { register u_int32_t * p = ap +3, tmpc, carry = 0; do { tmpc = *p & 0x80000000; /* propagate hi bit to next word */ *p <<= 1; if (carry) *p += 1; carry = tmpc; } while (p-- > ap); /* printf("2o %04X:%04X:%04X:%04X\n",*(ap),*(ap +1),*(ap +2),*(ap +3)); */ } /* multiply 128 bit number X10 */ void _128x10(n128 * ap128, n128 * tp128) { register u_int32_t * ap = ap128->u, * tp = tp128->u; _128x2(ap); /* multiply by two */ *tp = *ap; /* temp save */ *(tp +1) = *(ap +1); *(tp +2) = *(ap +2); *(tp +3) = *(ap +3); _128x2(ap); _128x2(ap); /* times 8 */ (void) adder128(ap,tp,ap128,0); /* printf("x %04X:%04X:%04X:%04X\n",*((u_int32_t *)ap),*((u_int32_t *)ap +1),*((u_int32_t *)ap +2),*((u_int32_t *)ap +3)); */ } /* multiply 128 bit number by 10, add bcd digit to result */ void _128x10plusbcd(n128 * ap128, n128 * tp128, char digit) { register u_int32_t * ap = ap128->u, * tp = tp128->u; /* printf("digit %X + %X = ",digit,*(ap +3)); */ _128x10(ap128,tp128); *tp = 0; *(tp + 1) = 0; *(tp + 2) = 0; *(tp + 3) = digit; (void) adder128(ap,tp,ap128,0); /* printf("%d %04X:%04X:%04X:%04X\n",digit,*((u_int32_t *)ap),*((u_int32_t *)ap +1),*((u_int32_t *)ap +2),*((u_int32_t *)ap +3)); */ } char _simple_pack(void * str,int len, BCD * n) { int i = len -1, j=19, lo=1; register unsigned char c, * bcdn = (unsigned char *)(n->bcd), * sp = (unsigned char *) str; if (len > 40) return '*'; /* error, input string too long */ memset (bcdn, 0, 20); do { c = *(sp + i) & 0x7f; if (c < zero || c > (zero + 9)) return c; /* error, out of range */ if (lo) { /* lo byte ? */ *(bcdn + j) = c & 0xF; lo = 0; } else { c <<= 4; *(bcdn + j) |= c; lo = 1; /* lo byte next */ j--; } } while (i-- > 0); return 0; } /* convert a packed bcd string to 128 bit binary string */ void _bcdn2bin(void * bp, n128 * ap128, n128 * cp128, int len) { int i = 0, hasdigits = 0, lo; register unsigned char c, * cp = (unsigned char *)bp; memset(ap128->c, 0, 16); memset(cp128->c, 0, 16); while (i < len ) { c = *cp++; for (lo=0;lo<2;lo+=1) { if (lo) { if (hasdigits) /* suppress leading zero multiplications */ _128x10plusbcd(ap128, cp128, c & 0xF); else { if (c & 0xF) { hasdigits = 1; ap128->u[3] = c & 0xF; } } } else { if (hasdigits) /* suppress leading zero multiplications */ _128x10plusbcd(ap128, cp128, c >> 4); else { if (c & 0XF0) { hasdigits = 1; ap128->u[3] = c >> 4; } } } i++; if (i >= len) break; } } } /* convert a 128 bit number string to a bcd number string returns the length of the bcd string === 20 */ int _bin2bcd (unsigned char * binary, BCD * n) { register u_int32_t tmp, add3, msk8, bcd8, carry = 0; u_int32_t word; unsigned char binmsk = 0; int c = 0,i, j, p; memset (n->bcd, 0, 20); for (p=0;p<128;p++) { /* bit pointer */ if (! binmsk) { word = *((unsigned char *)binary + c); binmsk = 0x80; c++; } carry = word & binmsk; /* bit to convert */ binmsk >>= 1; for (i=4;i>=0;i--) { bcd8 = n->bcd[i]; if (carry | bcd8) { /* if something to do */ add3 = 3; msk8 = 8; for (j=0;j<8;j++) { /* prep bcd digits for X2 */ tmp = bcd8 + add3; if (tmp & msk8) bcd8 = tmp; add3 <<= 4; msk8 <<= 4; } tmp = bcd8 & 0x80000000; /* propagated carry */ bcd8 <<= 1; /* x 2 */ if (carry) bcd8 += 1; n->bcd[i] = bcd8; carry = tmp; } } } netswap(n->bcd,5); return 20; } /* convert a bcd number string to a bcd text string returns the number of digits */ int _bcd2txt(unsigned char * bcd2p, BCD * n) { register unsigned char bcd, dchar; int i, j = 0; for (i=0;i<20;i++) { dchar = *(bcd2p + i); bcd = dchar >> 4; if (j || bcd) { n->txt[j] = bcd + zero; j++; } bcd = dchar & 0xF; if (j || bcd || i == 19) { /* must be at least one digit */ n->txt[j] = bcd + zero; j++; } } n->txt[j] = 0; /* string terminator */ return j; } /* INCLUDE: xs_include/miniSocket.inc removed 10-12-11 */ MODULE = NetAddr::IP::Util PACKAGE = NetAddr::IP::Util PROTOTYPES: ENABLE void comp128(s,...) SV * s ALIAS: NetAddr::IP::Util::ipv6to4 = 2 NetAddr::IP::Util::shiftleft = 1 PREINIT: unsigned char * ap; char * subname; u_int32_t wa[4]; STRLEN len; int i; PPCODE: ap = (unsigned char *) SvPV(s,len); if (len != 16) { if (ix == 2) subname = is_ipv6to4; else if (ix == 1) subname = is_shiftleft; else subname = is_comp128; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } if (ix == 2) { XPUSHs(sv_2mortal(newSVpvn((char *)(ap +12),4))); XSRETURN(1); } else if (ix == 1) { if (items < 2) { memcpy(wa,ap,16); } else if ((i = SvIV(ST(1))) == 0) { memcpy(wa,ap,16); } else if (i < 0 || i > 128) { croak("Bad arg value for %s, is %d, should be 0 thru 128", "NetAddr::IP::Util::shiftleft",i); } else { netswap_copy(wa,ap,4); do { _128x2(wa); i--; } while (i > 0); netswap(wa,4); } } else { memcpy(wa,ap,16); fastcomp128(wa); } XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); void add128(as,bs) SV * as SV * bs ALIAS: NetAddr::IP::Util::sub128 = 1 PREINIT: unsigned char * ap, *bp; char * subname; u_int32_t wa[4], wb[4]; n128 a128; STRLEN len; PPCODE: ap = (unsigned char *) SvPV(as,len); if (len != 16) { Bail: if (ix == 1) subname = is_sub128; else subname = is_add128; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } bp = (unsigned char *) SvPV(bs,len); if (len != 16) { goto Bail; } netswap_copy(wa,ap,4); netswap_copy(wb,bp,4); if (ix == 1) { fastcomp128(wb); XPUSHs(sv_2mortal(newSViv((I32)adder128(wa,wb,&a128,1)))); } else { XPUSHs(sv_2mortal(newSViv((I32)adder128(wa,wb,&a128,0)))); } if (GIMME_V == G_ARRAY) { netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); void addconst(s,cnst) SV * s I32 cnst PREINIT: n128 a128; unsigned char * ap; u_int32_t wa[4], wb[4]; STRLEN len; PPCODE: ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::addconst",len *8,128); } netswap_copy(wa,ap,4); XPUSHs(sv_2mortal(newSViv((I32)addercon(wa,wb,&a128,cnst)))); if (GIMME_V == G_ARRAY) { netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); int hasbits(s) SV * s PREINIT: unsigned char * bp; char * subname; STRLEN len; CODE: bp = (unsigned char *) SvPV(s,len); if (len != 16) { subname = is_hasbits; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } RETVAL = have128(bp); OUTPUT: RETVAL void bin2bcd(s) SV * s ALIAS: NetAddr::IP::Util::bcdn2txt = 2 NetAddr::IP::Util::bin2bcdn = 1 PREINIT: BCD n; unsigned char * cp; STRLEN len; PPCODE: cp = (unsigned char *) SvPV(s,len); if (ix == 0) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcd",len *8,128); } (void) _bin2bcd(cp,&n); XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt((unsigned char *)n.bcd,&n)))); } else if (ix == 1) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcdn",len *8,128); } XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,_bin2bcd(cp,&n)))); } else { if (len > 20) { croak("Bad arg length for %s, length is %d, should %d digits or less", "NetAddr::IP::Util::bcdn2txt",len *2,40); } XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt(cp,&n)))); } XSRETURN(1); #* #* the second argument 'len' is the number of bcd digits for #* the bcdn2bin conversion. Pack looses track of the number #* digits so this is needed to do the "right thing". #* NOTE: that simple_pack always returns 40 digits #* void bcd2bin(s,...) SV * s ALIAS: NetAddr::IP::Util::bcdn2bin = 2 NetAddr::IP::Util::simple_pack = 1 PREINIT: BCD n; n128 c128, a128; unsigned char * cp, badc; char * subname; STRLEN len; PPCODE: cp = (unsigned char *) SvPV(s,len); if (len > 40) { if (ix == 0) subname = is_bcd2bin; else if (ix ==1) subname = is_simple_pack; Badigits: croak("Bad arg length for %s%s, length is %d, should be %d digits or less", "NetAddr::IP::Util::",subname,len,40); } if (ix == 2) { if (len > 20) { len <<= 1; /* times 2 */ subname = is_bcdn2bin; goto Badigits; } if (items < 2) { croak("Bad usage, should have %s('packedbcd,length)", "NetAddr::IP::Util::bcdn2bin"); } len = SvIV(ST(1)); _bcdn2bin(cp,&a128,&c128,(int)len); netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(1); } badc = _simple_pack(cp,(int)len, &n); if (badc) { if (ix == 1) subname = is_simple_pack; else subname = is_bcd2bin; croak("Bad char in string for %s%s, character is '%c', allowed are 0-9", "NetAddr::IP::Util::",subname,badc); } if (ix == 0) { _bcdn2bin((void *)n.bcd,&a128,&c128,40); netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); } else { /* ix == 1 */ XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,20))); } XSRETURN(1); void notcontiguous(s) SV * s PREINIT: unsigned char * ap, count; u_int32_t wa[4]; STRLEN len; PPCODE: ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::countbits",len *8,128); } netswap_copy(wa,ap,4); count = _countbits(wa); XPUSHs(sv_2mortal(newSViv((I32)have128(wa)))); if (GIMME_V == G_ARRAY) { XPUSHs(sv_2mortal(newSViv((I32)count))); XSRETURN(2); } XSRETURN(1); void ipv4to6(s) SV * s ALIAS: NetAddr::IP::Util::mask4to6 = 1 PREINIT: unsigned char * ip; char * subname; u_int32_t wa[4]; STRLEN len; PPCODE: ip = (unsigned char *) SvPV(s,len); if (len != 4) { if (ix == 1) subname = is_mask4to6; else subname = is_ipv4to6; croak("Bad arg length for %s%s, length is %d, should be 32", "NetAddr::IP::Util::",subname,len *8); } if (ix == 0) extendipv4(ip, wa); else extendmask4(ip, wa); XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); void ipanyto6(s) SV * s ALIAS: NetAddr::IP::Util::maskanyto6 = 1 PREINIT: unsigned char * ip; char * subname; u_int32_t wa[4]; STRLEN len; PPCODE: ip = (unsigned char *) SvPV(s,len); if (len == 16) /* if already 128 bits, return input */ XPUSHs(sv_2mortal(newSVpvn((char *)ip,16))); else if (len == 4) { if (ix == 0) extendipv4(ip, wa); else extendmask4(ip, wa); XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); } else { if (ix == 1) subname = is_maskanyto6; else subname = is_ipanyto6; croak("Bad arg length for %s%s, length is %d, should be 32 or 128", "NetAddr::IP::Util::",subname,len *8); } XSRETURN(1); Lite/Util/configure.gcc 0000644 00000626340 15043770025 0011033 0 ustar 00 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 </dev/null 6>&1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> #ifdef HAVE_SYS_TYPES_H # include <sys/types.h> #endif #ifdef HAVE_SYS_STAT_H # include <sys/stat.h> #endif #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> #else # ifdef HAVE_STDLIB_H # include <stdlib.h> # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #endif #ifdef HAVE_STRINGS_H # include <strings.h> #endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GREP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include <limits.h> #else # include <assert.h> #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <string.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <stdlib.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <ctype.h> #include <stdlib.h> #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/socket.h netinet/in.h arpa/inet.h netdb.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for int32_t" >&5 echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; } if test "${ac_cv_c_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int32_t=no for ac_type in 'int32_t' 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in int32_t) ac_cv_c_int32_t=yes ;; *) ac_cv_c_int32_t=$ac_type ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_int32_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 echo "${ECHO_T}$ac_cv_c_int32_t" >&6; } case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac { echo "$as_me:$LINENO: checking for uint16_t" >&5 echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint16_t=no for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint16_t) ac_cv_c_uint16_t=yes ;; *) ac_cv_c_uint16_t=$ac_type ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint16_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5 echo "${ECHO_T}$ac_cv_c_uint16_t" >&6; } case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac { echo "$as_me:$LINENO: checking for uint32_t" >&5 echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint32_t) ac_cv_c_uint32_t=yes ;; *) ac_cv_c_uint32_t=$ac_type ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint32_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT32_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { echo "$as_me:$LINENO: checking for uint8_t" >&5 echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint8_t=no for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint8_t) ac_cv_c_uint8_t=yes ;; *) ac_cv_c_uint8_t=$ac_type ;; esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint8_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 echo "${ECHO_T}$ac_cv_c_uint8_t" >&6; } case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT8_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. if test $ac_cv_c_compiler_gnu = yes; then { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sgtty.h> Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <termio.h> Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_search_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF for ac_lib in '' nsl; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_gethostbyname=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_gethostbyname+set}" = set; then break fi done if test "${ac_cv_search_gethostbyname+set}" = set; then : else ac_cv_search_gethostbyname=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } ac_res=$ac_cv_search_gethostbyname if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for library containing inet_aton" >&5 echo $ECHO_N "checking for library containing inet_aton... $ECHO_C" >&6; } if test "${ac_cv_search_inet_aton+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_aton (); int main () { return inet_aton (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_inet_aton=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_inet_aton+set}" = set; then break fi done if test "${ac_cv_search_inet_aton+set}" = set; then : else ac_cv_search_inet_aton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_inet_aton" >&5 echo "${ECHO_T}$ac_cv_search_inet_aton" >&6; } ac_res=$ac_cv_search_inet_aton if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF fi { echo "$as_me:$LINENO: checking for library containing inet_pton" >&5 echo $ECHO_N "checking for library containing inet_pton... $ECHO_C" >&6; } if test "${ac_cv_search_inet_pton+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_pton (); int main () { return inet_pton (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_inet_pton=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_inet_pton+set}" = set; then break fi done if test "${ac_cv_search_inet_pton+set}" = set; then : else ac_cv_search_inet_pton=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_inet_pton" >&5 echo "${ECHO_T}$ac_cv_search_inet_pton" >&6; } ac_res=$ac_cv_search_inet_pton if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_INET_PTON 1 _ACEOF fi { echo "$as_me:$LINENO: checking for library containing inet_addr" >&5 echo $ECHO_N "checking for library containing inet_addr... $ECHO_C" >&6; } if test "${ac_cv_search_inet_addr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char inet_addr (); int main () { return inet_addr (); ; return 0; } _ACEOF for ac_lib in '' socket; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_inet_addr=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_inet_addr+set}" = set; then break fi done if test "${ac_cv_search_inet_addr+set}" = set; then : else ac_cv_search_inet_addr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_inet_addr" >&5 echo "${ECHO_T}$ac_cv_search_inet_addr" >&6; } ac_res=$ac_cv_search_inet_addr if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ADDR 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: checking for uint8_t" >&5 echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_uint8_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 echo "${ECHO_T}$ac_cv_type_uint8_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of uint8_t" >&5 echo $ECHO_N "checking size of uint8_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_uint8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_uint8_t=$ac_lo;; '') if test "$ac_cv_type_uint8_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint8_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint8_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint8_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint8_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uint8_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uint8_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint8_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint8_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint8_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint8_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_uint8_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT8_T $ac_cv_sizeof_uint8_t _ACEOF { echo "$as_me:$LINENO: checking for uint16_t" >&5 echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_uint16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 echo "${ECHO_T}$ac_cv_type_uint16_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of uint16_t" >&5 echo $ECHO_N "checking size of uint16_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_uint16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_uint16_t=$ac_lo;; '') if test "$ac_cv_type_uint16_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint16_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint16_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint16_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint16_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uint16_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uint16_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint16_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint16_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint16_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint16_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_uint16_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT16_T $ac_cv_sizeof_uint16_t _ACEOF { echo "$as_me:$LINENO: checking for uint32_t" >&5 echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_uint32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 echo "${ECHO_T}$ac_cv_type_uint32_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of uint32_t" >&5 echo $ECHO_N "checking size of uint32_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_uint32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_uint32_t=$ac_lo;; '') if test "$ac_cv_type_uint32_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint32_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint32_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint32_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef uint32_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uint32_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uint32_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint32_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint32_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint32_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_uint32_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_uint32_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT32_T $ac_cv_sizeof_uint32_t _ACEOF { echo "$as_me:$LINENO: checking for u_int8_t" >&5 echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_u_int8_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int8_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of u_int8_t" >&5 echo $ECHO_N "checking size of u_int8_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_u_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_u_int8_t=$ac_lo;; '') if test "$ac_cv_type_u_int8_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int8_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int8_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int8_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int8_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_u_int8_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_u_int8_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int8_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int8_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int8_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int8_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_u_int8_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT8_T $ac_cv_sizeof_u_int8_t _ACEOF { echo "$as_me:$LINENO: checking for u_int16_t" >&5 echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_u_int16_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int16_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of u_int16_t" >&5 echo $ECHO_N "checking size of u_int16_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_u_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_u_int16_t=$ac_lo;; '') if test "$ac_cv_type_u_int16_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int16_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int16_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int16_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int16_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_u_int16_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_u_int16_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int16_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int16_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int16_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int16_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_u_int16_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT16_T $ac_cv_sizeof_u_int16_t _ACEOF { echo "$as_me:$LINENO: checking for u_int32_t" >&5 echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_u_int32_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int32_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { echo "$as_me:$LINENO: checking size of u_int32_t" >&5 echo $ECHO_N "checking size of u_int32_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_u_int32_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; int main () { static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_u_int32_t=$ac_lo;; '') if test "$ac_cv_type_u_int32_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int32_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int32_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int32_t=0 fi ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef u_int32_t ac__type_sizeof_; static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include <stdio.h> #include <stdlib.h> int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; fprintf (f, "%lu\n", i); } return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_u_int32_t=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_u_int32_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int32_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int32_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int32_t=0 fi fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi { echo "$as_me:$LINENO: result: $ac_cv_sizeof_u_int32_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_u_int32_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT32_T $ac_cv_sizeof_u_int32_t _ACEOF cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test "$LIBS" != ""; then cat >>confdefs.h <<_ACEOF #define LIBS $LIBS _ACEOF fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration headers: $config_headers Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } for ac_tag in :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi Lite/Util/Makefile 0000644 00000073614 15043770025 0010034 0 ustar 00 # This Makefile is for the NetAddr::IP::Util extension to perl. # # It was generated automatically by MakeMaker version # 7.60 (Revision: 76000) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! # # MakeMaker ARGV: () # # MakeMaker Parameters: # BUILD_REQUIRES => { } # CONFIGURE_REQUIRES => { } # LIBS => [q[]] # NAME => q[NetAddr::IP::Util] # PREREQ_PM => { } # TEST_REQUIRES => { } # VERSION_FROM => q[Util.pm] # clean => { FILES=>q[*.bs *.o *.c *~ tmp* Util_IS.pm localperl.h auto*] } # depend => { Util.c=>q[ localconf.h config.h localperl.h ] } # dist => { COMPRESS=>q[gzip], SUFFIX=>q[gz] } # realclean => { FILES=>q[config.h config.log config.status] } # --- MakeMaker post_initialize section: # --- MakeMaker const_config section: # These definitions are from config.sh (via /usr/lib64/perl5/Config.pm). # They may have been overridden via Makefile.PL or on the command line. AR = ar CC = gcc CCCDLFLAGS = -fPIC CCDLFLAGS = -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 DLEXT = so DLSRC = dl_dlopen.xs EXE_EXT = FULL_AR = /usr/bin/ar LD = gcc LDDLFLAGS = -lpthread -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -L/usr/local/lib -fstack-protector-strong LDFLAGS = -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fstack-protector-strong -L/usr/local/lib LIBC = /lib/../lib64/libc.so.6 LIB_EXT = .a OBJ_EXT = .o OSNAME = linux OSVERS = 4.18.0-513.18.1.el8_9.x86_64 RANLIB = : SITELIBEXP = /usr/local/share/perl5/5.32 SITEARCHEXP = /usr/local/lib64/perl5/5.32 SO = so VENDORARCHEXP = /usr/lib64/perl5/vendor_perl VENDORLIBEXP = /usr/share/perl5/vendor_perl # --- MakeMaker constants section: AR_STATIC_ARGS = cr DIRFILESEP = / DFSEP = $(DIRFILESEP) NAME = NetAddr::IP::Util NAME_SYM = NetAddr_IP_Util VERSION = 1.53 VERSION_MACRO = VERSION VERSION_SYM = 1_53 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 1.53 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = ../../blib/arch INST_SCRIPT = ../../blib/script INST_BIN = ../../blib/bin INST_LIB = ../../blib/lib INST_MAN1DIR = ../../blib/man1 INST_MAN3DIR = ../../blib/man3 MAN1EXT = 1 MAN3EXT = 3pm MAN1SECTION = 1 MAN3SECTION = 3 INSTALLDIRS = site DESTDIR = PREFIX = $(SITEPREFIX) PERLPREFIX = /usr SITEPREFIX = /usr/local VENDORPREFIX = /usr INSTALLPRIVLIB = /usr/share/perl5 DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) INSTALLSITELIB = /usr/local/share/perl5/5.32 DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = /usr/share/perl5/vendor_perl DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) INSTALLARCHLIB = /usr/lib64/perl5 DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) INSTALLSITEARCH = /usr/local/lib64/perl5/5.32 DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = /usr/lib64/perl5/vendor_perl DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) INSTALLBIN = /usr/bin DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = /usr/local/bin DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = /usr/bin DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) INSTALLSCRIPT = /usr/bin DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) INSTALLSITESCRIPT = /usr/local/bin DESTINSTALLSITESCRIPT = $(DESTDIR)$(INSTALLSITESCRIPT) INSTALLVENDORSCRIPT = /usr/bin DESTINSTALLVENDORSCRIPT = $(DESTDIR)$(INSTALLVENDORSCRIPT) INSTALLMAN1DIR = /usr/share/man/man1 DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) INSTALLSITEMAN1DIR = /usr/local/share/man/man1 DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) INSTALLVENDORMAN1DIR = /usr/share/man/man1 DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) INSTALLMAN3DIR = /usr/share/man/man3 DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) INSTALLSITEMAN3DIR = /usr/local/share/man/man3 DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) INSTALLVENDORMAN3DIR = /usr/share/man/man3 DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) PERL_LIB = /usr/share/perl5 PERL_ARCHLIB = /usr/lib64/perl5 PERL_ARCHLIBDEP = /usr/lib64/perl5 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile MAKEFILE_OLD = Makefile.old MAKE_APERL_FILE = Makefile.aperl PERLMAINCC = $(CC) PERL_INC = /usr/lib64/perl5/CORE PERL_INCDEP = /usr/lib64/perl5/CORE PERL = "/usr/bin/perl" FULLPERL = "/usr/bin/perl" ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" PERL_CORE = 0 PERM_DIR = 755 PERM_RW = 644 PERM_RWX = 755 MAKEMAKER = /usr/share/perl5/vendor_perl/ExtUtils/MakeMaker.pm MM_VERSION = 7.60 MM_REVISION = 76000 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) # PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar) # DLBASE = Basename part of dynamic library. May be just equal BASEEXT. MAKE = make FULLEXT = NetAddr/IP/Util BASEEXT = Util PARENT_NAME = NetAddr::IP DLBASE = $(BASEEXT) VERSION_FROM = Util.pm OBJECT = $(BASEEXT)$(OBJ_EXT) LDFROM = $(OBJECT) LINKTYPE = dynamic BOOTDEP = # Handy lists of source code files: XS_FILES = Util.xs C_FILES = Util.c \ configure.cc O_FILES = Util.o \ configure.o H_FILES = config.h \ localconf.h \ localperl.h MAN1PODS = MAN3PODS = Util.pm \ lib/NetAddr/IP/InetBase.pm \ lib/NetAddr/IP/UtilPP.pm # Where is the Config information that we are using/depend on CONFIGDEP = $(PERL_ARCHLIBDEP)$(DFSEP)Config.pm $(PERL_INCDEP)$(DFSEP)config.h # Where to build things INST_LIBDIR = $(INST_LIB)/NetAddr/IP INST_ARCHLIBDIR = $(INST_ARCHLIB)/NetAddr/IP INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT) INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT) INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs # Extra linker info EXPORT_LIST = PERL_ARCHIVE = PERL_ARCHIVEDEP = PERL_ARCHIVE_AFTER = TO_INST_PM = Util.pm \ Util_IS.pm \ lib/NetAddr/IP/InetBase.pm \ lib/NetAddr/IP/UtilPP.pm # --- MakeMaker platform_constants section: MM_Unix_VERSION = 7.60 PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto AUTOSPLITFILE = $(ABSPERLRUN) -e 'use AutoSplit; autosplit($$$$ARGV[0], $$$$ARGV[1], 0, 1, 1)' -- # --- MakeMaker tool_xsubpp section: XSUBPPDIR = /usr/share/perl5/vendor_perl/ExtUtils XSUBPP = "$(XSUBPPDIR)$(DFSEP)xsubpp" XSUBPPRUN = $(PERLRUN) $(XSUBPP) XSPROTOARG = XSUBPPDEPS = /usr/share/perl5/ExtUtils/typemap typemap /usr/share/perl5/vendor_perl/ExtUtils$(DFSEP)xsubpp XSUBPPARGS = -typemap '/usr/share/perl5/ExtUtils/typemap' -typemap '/home/.cpan/build/NetAddr-IP-4.079-0/Lite/Util/typemap' XSUBPP_EXTRA_ARGS = # --- MakeMaker tools_other section: SHELL = /bin/sh CHMOD = chmod CP = cp MV = mv NOOP = $(TRUE) NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 MKPATH = $(ABSPERLRUN) -MExtUtils::Command -e 'mkpath' -- EQUALIZE_TIMESTAMP = $(ABSPERLRUN) -MExtUtils::Command -e 'eqtime' -- FALSE = false TRUE = true ECHO = echo ECHO_N = echo -n UNINST = 0 VERBINST = 0 MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- DOC_INSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'perllocal_install' -- UNINSTALL = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'uninstall' -- WARN_IF_OLD_PACKLIST = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'warn_if_old_packlist' -- MACROSTART = MACROEND = USEMAKEFILE = -f FIXIN = $(ABSPERLRUN) -MExtUtils::MY -e 'MY->fixin(shift)' -- CP_NONEMPTY = $(ABSPERLRUN) -MExtUtils::Command::MM -e 'cp_nonempty' -- # --- MakeMaker makemakerdflt section: makemakerdflt : all $(NOECHO) $(NOOP) # --- MakeMaker dist section skipped. # --- MakeMaker macro section: # --- MakeMaker depend section: Util.c : localconf.h config.h localperl.h # --- MakeMaker cflags section: CCFLAGS = -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 OPTIMIZE = -g PERLTYPE = MPOLLUTE = # --- MakeMaker const_loadlibs section: # NetAddr::IP::Util might depend on some other libraries: # See ExtUtils::Liblist for details # # --- MakeMaker const_cccmd section: CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) # --- MakeMaker post_constants section: MY_POD2TEXT = /usr/bin/pod2text # --- MakeMaker pasthru section: PASTHRU = LIBPERL_A="$(LIBPERL_A)"\ LINKTYPE="$(LINKTYPE)"\ OPTIMIZE="$(OPTIMIZE)"\ PREFIX="$(PREFIX)"\ PASTHRU_DEFINE='$(DEFINE) $(PASTHRU_DEFINE)'\ PASTHRU_INC='$(INC) $(PASTHRU_INC)' # --- MakeMaker special_targets section: .SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) .PHONY: all config static dynamic test linkext manifest blibdirs clean realclean disttest distdir pure_all subdirs clean_subdirs makemakerdflt manifypods realclean_subdirs subdirs_dynamic subdirs_pure_nolink subdirs_static subdirs-test_dynamic subdirs-test_static test_dynamic test_static # --- MakeMaker c_o section: .c.i: gcc -E -c $(PASTHRU_INC) $(INC) \ $(CCFLAGS) $(OPTIMIZE) \ $(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \ $(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i .c.s : $(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .c$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c .cpp$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp .cxx$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx .cc$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc .C$(OBJ_EXT) : $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C # --- MakeMaker xs_c section: .xs.c: $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc $(MV) $*.xsc $*.c # --- MakeMaker xs_o section: .xs$(OBJ_EXT) : $(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc $(MV) $*.xsc $*.c $(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c # --- MakeMaker top_targets section: config :: config.h @$(NOOP) config.h : $(SHELL) configure all :: pure_all manifypods $(NOECHO) $(NOOP) pure_all :: config pm_to_blib subdirs linkext README $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) $(NOECHO) $(NOOP) config :: $(FIRST_MAKEFILE) blibdirs $(NOECHO) $(NOOP) $(O_FILES) : $(H_FILES) help : perldoc ExtUtils::MakeMaker # --- MakeMaker blibdirs section: blibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists $(NOECHO) $(NOOP) # Backwards compat with 6.18 through 6.25 blibdirs.ts : blibdirs $(NOECHO) $(NOOP) $(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_LIBDIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_LIBDIR) $(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHLIB) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHLIB) $(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists $(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_AUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_AUTODIR) $(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_ARCHAUTODIR) $(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_BIN) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_BIN) $(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_SCRIPT) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_SCRIPT) $(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists $(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN1DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN1DIR) $(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL $(NOECHO) $(MKPATH) $(INST_MAN3DIR) $(NOECHO) $(CHMOD) $(PERM_DIR) $(INST_MAN3DIR) $(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists # --- MakeMaker linkext section: linkext :: dynamic $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: # --- MakeMaker dynamic_bs section: BOOTSTRAP = $(BASEEXT).bs # As Mkbootstrap might not write a file (if none is required) # we use touch to prevent make continually trying to remake it. # The DynaLoader only reads a non-empty file. $(BASEEXT).bs : $(FIRST_MAKEFILE) $(BOOTDEP) $(NOECHO) $(ECHO) "Running Mkbootstrap for $(BASEEXT) ($(BSLOADLIBS))" $(NOECHO) $(PERLRUN) \ "-MExtUtils::Mkbootstrap" \ -e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');" $(NOECHO) $(TOUCH) "$(BASEEXT).bs" $(CHMOD) $(PERM_RW) "$(BASEEXT).bs" $(INST_ARCHAUTODIR)/$(BASEEXT).bs : $(BASEEXT).bs $(INST_ARCHAUTODIR)$(DFSEP).exists $(NOECHO) $(RM_RF) $(INST_ARCHAUTODIR)/$(BASEEXT).bs - $(CP_NONEMPTY) $(BASEEXT).bs $(INST_ARCHAUTODIR)/$(BASEEXT).bs $(PERM_RW) # --- MakeMaker dynamic section: dynamic :: $(FIRST_MAKEFILE) config $(INST_BOOT) $(INST_DYNAMIC) $(NOECHO) $(NOOP) # --- MakeMaker dynamic_lib section: # This section creates the dynamically loadable objects from relevant # objects and possibly $(MYEXTLIB). ARMAYBE = : OTHERLDFLAGS = INST_DYNAMIC_DEP = INST_DYNAMIC_FIX = $(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) $(RM_F) $@ $(LD) $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \ $(PERL_ARCHIVE) $(LDLOADLIBS) -lperl $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \ $(INST_DYNAMIC_FIX) $(CHMOD) $(PERM_RWX) $@ # --- MakeMaker static section: ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" static :: $(FIRST_MAKEFILE) $(INST_STATIC) $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: $(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(RM_F) "$@" $(FULL_AR) $(AR_STATIC_ARGS) "$@" $(OBJECT) $(RANLIB) "$@" $(CHMOD) $(PERM_RWX) $@ $(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)$(DFSEP)extralibs.ld # --- MakeMaker manifypods section: POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" POD2MAN = $(POD2MAN_EXE) manifypods : pure_all config \ Util.pm \ lib/NetAddr/IP/InetBase.pm \ lib/NetAddr/IP/UtilPP.pm $(NOECHO) $(POD2MAN) --section=$(MAN3SECTION) --perm_rw=$(PERM_RW) -u \ Util.pm $(INST_MAN3DIR)/NetAddr::IP::Util.$(MAN3EXT) \ lib/NetAddr/IP/InetBase.pm $(INST_MAN3DIR)/NetAddr::IP::InetBase.$(MAN3EXT) \ lib/NetAddr/IP/UtilPP.pm $(INST_MAN3DIR)/NetAddr::IP::UtilPP.$(MAN3EXT) # --- MakeMaker processPL section: # --- MakeMaker installbin section: # --- MakeMaker subdirs section: # none # --- MakeMaker clean_subdirs section: clean_subdirs : $(NOECHO) $(NOOP) # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. clean :: clean_subdirs - $(RM_F) \ $(BASEEXT).bso $(BASEEXT).def \ $(BASEEXT).exp $(BASEEXT).x \ $(BOOTSTRAP) $(INST_ARCHAUTODIR)/extralibs.all \ $(INST_ARCHAUTODIR)/extralibs.ld $(MAKE_APERL_FILE) \ *$(LIB_EXT) *$(OBJ_EXT) \ *perl.core MYMETA.json \ MYMETA.yml Util.base \ Util.bs Util.bso \ Util.c Util.def \ Util.exp Util.o \ Util_def.old blibdirs.ts \ core core.*perl.*.? \ core.[0-9] core.[0-9][0-9] \ core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] \ core.[0-9][0-9][0-9][0-9][0-9] lib$(BASEEXT).def \ mon.out perl \ perl$(EXE_EXT) perl.exe \ perlmain.c pm_to_blib \ pm_to_blib.ts so_locations \ tmon.out - $(RM_RF) \ *.bs *.c \ *.o *~ \ Util_IS.pm auto* \ blib localperl.h \ tmp* $(NOECHO) $(RM_F) $(MAKEFILE_OLD) - $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) # --- MakeMaker realclean_subdirs section: # so clean is forced to complete before realclean_subdirs runs realclean_subdirs : clean $(NOECHO) $(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete dist files realclean purge :: realclean_subdirs - $(RM_F) \ $(FIRST_MAKEFILE) $(MAKEFILE_OLD) \ $(OBJECT) - $(RM_RF) \ $(DISTVNAME) config.h \ config.log config.status # --- MakeMaker metafile section: metafile : create_distdir $(NOECHO) $(ECHO) Generating META.yml $(NOECHO) $(ECHO) '---' > META_new.yml $(NOECHO) $(ECHO) 'abstract: unknown' >> META_new.yml $(NOECHO) $(ECHO) 'author:' >> META_new.yml $(NOECHO) $(ECHO) ' - unknown' >> META_new.yml $(NOECHO) $(ECHO) 'build_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'configure_requires:' >> META_new.yml $(NOECHO) $(ECHO) ' ExtUtils::MakeMaker: '\''0'\''' >> META_new.yml $(NOECHO) $(ECHO) 'dynamic_config: 1' >> META_new.yml $(NOECHO) $(ECHO) 'generated_by: '\''ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010'\''' >> META_new.yml $(NOECHO) $(ECHO) 'license: unknown' >> META_new.yml $(NOECHO) $(ECHO) 'meta-spec:' >> META_new.yml $(NOECHO) $(ECHO) ' url: http://module-build.sourceforge.net/META-spec-v1.4.html' >> META_new.yml $(NOECHO) $(ECHO) ' version: '\''1.4'\''' >> META_new.yml $(NOECHO) $(ECHO) 'name: NetAddr-IP-Util' >> META_new.yml $(NOECHO) $(ECHO) 'no_index:' >> META_new.yml $(NOECHO) $(ECHO) ' directory:' >> META_new.yml $(NOECHO) $(ECHO) ' - t' >> META_new.yml $(NOECHO) $(ECHO) ' - inc' >> META_new.yml $(NOECHO) $(ECHO) 'version: '\''1.53'\''' >> META_new.yml $(NOECHO) $(ECHO) 'x_serialization_backend: '\''CPAN::Meta::YAML version 0.018'\''' >> META_new.yml -$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml $(NOECHO) $(ECHO) Generating META.json $(NOECHO) $(ECHO) '{' > META_new.json $(NOECHO) $(ECHO) ' "abstract" : "unknown",' >> META_new.json $(NOECHO) $(ECHO) ' "author" : [' >> META_new.json $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "dynamic_config" : 1,' >> META_new.json $(NOECHO) $(ECHO) ' "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010",' >> META_new.json $(NOECHO) $(ECHO) ' "license" : [' >> META_new.json $(NOECHO) $(ECHO) ' "unknown"' >> META_new.json $(NOECHO) $(ECHO) ' ],' >> META_new.json $(NOECHO) $(ECHO) ' "meta-spec" : {' >> META_new.json $(NOECHO) $(ECHO) ' "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : 2' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "name" : "NetAddr-IP-Util",' >> META_new.json $(NOECHO) $(ECHO) ' "no_index" : {' >> META_new.json $(NOECHO) $(ECHO) ' "directory" : [' >> META_new.json $(NOECHO) $(ECHO) ' "t",' >> META_new.json $(NOECHO) $(ECHO) ' "inc"' >> META_new.json $(NOECHO) $(ECHO) ' ]' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "prereqs" : {' >> META_new.json $(NOECHO) $(ECHO) ' "build" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "configure" : {' >> META_new.json $(NOECHO) $(ECHO) ' "requires" : {' >> META_new.json $(NOECHO) $(ECHO) ' "ExtUtils::MakeMaker" : "0"' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' }' >> META_new.json $(NOECHO) $(ECHO) ' },' >> META_new.json $(NOECHO) $(ECHO) ' "release_status" : "stable",' >> META_new.json $(NOECHO) $(ECHO) ' "version" : "1.53",' >> META_new.json $(NOECHO) $(ECHO) ' "x_serialization_backend" : "JSON::PP version 4.06"' >> META_new.json $(NOECHO) $(ECHO) '}' >> META_new.json -$(NOECHO) $(MV) META_new.json $(DISTVNAME)/META.json # --- MakeMaker signature section: signature : cpansign -s # --- MakeMaker dist_basics section skipped. # --- MakeMaker dist_core section skipped. # --- MakeMaker distdir section skipped. # --- MakeMaker dist_test section skipped. # --- MakeMaker dist_ci section skipped. # --- MakeMaker distmeta section: distmeta : create_distdir metafile $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -e q{META.yml};' \ -e 'eval { maniadd({q{META.yml} => q{Module YAML meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.yml to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'exit unless -f q{META.json};' \ -e 'eval { maniadd({q{META.json} => q{Module JSON meta-data (added by MakeMaker)}}) }' \ -e ' or die "Could not add META.json to MANIFEST: $${'\''@'\''}"' -- # --- MakeMaker distsignature section: distsignature : distmeta $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }' \ -e ' or die "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}"' -- $(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE cd $(DISTVNAME) && cpansign -s # --- MakeMaker install section skipped. # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE : $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: PERL_HDRS = \ $(PERL_INCDEP)/EXTERN.h \ $(PERL_INCDEP)/INTERN.h \ $(PERL_INCDEP)/XSUB.h \ $(PERL_INCDEP)/av.h \ $(PERL_INCDEP)/bitcount.h \ $(PERL_INCDEP)/charclass_invlists.h \ $(PERL_INCDEP)/config.h \ $(PERL_INCDEP)/cop.h \ $(PERL_INCDEP)/cv.h \ $(PERL_INCDEP)/dosish.h \ $(PERL_INCDEP)/ebcdic_tables.h \ $(PERL_INCDEP)/embed.h \ $(PERL_INCDEP)/embedvar.h \ $(PERL_INCDEP)/fakesdio.h \ $(PERL_INCDEP)/feature.h \ $(PERL_INCDEP)/form.h \ $(PERL_INCDEP)/git_version.h \ $(PERL_INCDEP)/gv.h \ $(PERL_INCDEP)/handy.h \ $(PERL_INCDEP)/hv.h \ $(PERL_INCDEP)/hv_func.h \ $(PERL_INCDEP)/hv_macro.h \ $(PERL_INCDEP)/inline.h \ $(PERL_INCDEP)/intrpvar.h \ $(PERL_INCDEP)/invlist_inline.h \ $(PERL_INCDEP)/iperlsys.h \ $(PERL_INCDEP)/keywords.h \ $(PERL_INCDEP)/l1_char_class_tab.h \ $(PERL_INCDEP)/malloc_ctl.h \ $(PERL_INCDEP)/metaconfig.h \ $(PERL_INCDEP)/mg.h \ $(PERL_INCDEP)/mg_data.h \ $(PERL_INCDEP)/mg_raw.h \ $(PERL_INCDEP)/mg_vtable.h \ $(PERL_INCDEP)/mydtrace.h \ $(PERL_INCDEP)/nostdio.h \ $(PERL_INCDEP)/op.h \ $(PERL_INCDEP)/op_reg_common.h \ $(PERL_INCDEP)/opcode.h \ $(PERL_INCDEP)/opnames.h \ $(PERL_INCDEP)/overload.h \ $(PERL_INCDEP)/pad.h \ $(PERL_INCDEP)/parser.h \ $(PERL_INCDEP)/patchlevel.h \ $(PERL_INCDEP)/perl.h \ $(PERL_INCDEP)/perl_inc_macro.h \ $(PERL_INCDEP)/perl_langinfo.h \ $(PERL_INCDEP)/perlapi.h \ $(PERL_INCDEP)/perldtrace.h \ $(PERL_INCDEP)/perlio.h \ $(PERL_INCDEP)/perliol.h \ $(PERL_INCDEP)/perlsdio.h \ $(PERL_INCDEP)/perlvars.h \ $(PERL_INCDEP)/perly.h \ $(PERL_INCDEP)/pp.h \ $(PERL_INCDEP)/pp_proto.h \ $(PERL_INCDEP)/proto.h \ $(PERL_INCDEP)/reentr.h \ $(PERL_INCDEP)/regcharclass.h \ $(PERL_INCDEP)/regcomp.h \ $(PERL_INCDEP)/regexp.h \ $(PERL_INCDEP)/regnodes.h \ $(PERL_INCDEP)/sbox32_hash.h \ $(PERL_INCDEP)/scope.h \ $(PERL_INCDEP)/stadtx_hash.h \ $(PERL_INCDEP)/sv.h \ $(PERL_INCDEP)/thread.h \ $(PERL_INCDEP)/time64.h \ $(PERL_INCDEP)/time64_config.h \ $(PERL_INCDEP)/uconfig.h \ $(PERL_INCDEP)/uni_keywords.h \ $(PERL_INCDEP)/unicode_constants.h \ $(PERL_INCDEP)/unixish.h \ $(PERL_INCDEP)/utf8.h \ $(PERL_INCDEP)/utfebcdic.h \ $(PERL_INCDEP)/util.h \ $(PERL_INCDEP)/uudmap.h \ $(PERL_INCDEP)/vutil.h \ $(PERL_INCDEP)/warnings.h \ $(PERL_INCDEP)/zaphod32_hash.h $(OBJECT) : $(PERL_HDRS) Util.c : $(XSUBPPDEPS) # --- MakeMaker makefile section: $(OBJECT) : $(FIRST_MAKEFILE) # We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." -$(NOECHO) $(RM_F) $(MAKEFILE_OLD) -$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) - $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL) $(PERLRUN) Makefile.PL $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" $(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <==" $(FALSE) # --- MakeMaker staticmake section: # --- MakeMaker makeaperl section --- MAP_TARGET = ../../perl FULLPERL = "/usr/bin/perl" MAP_PERLINC = "-I../../blib/arch" "-I../../blib/lib" "-I/usr/lib64/perl5" "-I/usr/share/perl5" # --- MakeMaker test section: TEST_VERBOSE=0 TEST_TYPE=test_$(LINKTYPE) TEST_FILE = test.pl TEST_FILES = t/*.t TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) $(NOECHO) $(NOOP) test :: $(TEST_TYPE) $(NOECHO) $(NOOP) # Occasionally we may face this degenerate target: test_ : test_dynamic $(NOECHO) $(NOOP) subdirs-test_dynamic :: dynamic pure_all test_dynamic :: subdirs-test_dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: dynamic pure_all PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) subdirs-test_static :: static pure_all test_static :: subdirs-test_static $(MAP_TARGET) PERL_DL_NONLAZY=1 "/home/.cpan/build/NetAddr-IP-4.079-0/Lite/Util/$(MAP_TARGET)" $(MAP_PERLINC) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_static :: static pure_all $(MAP_TARGET) PERL_DL_NONLAZY=1 "/home/.cpan/build/NetAddr-IP-4.079-0/Lite/Util/$(MAP_TARGET)" $(MAP_PERLINC) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : $(NOECHO) $(ECHO) '<SOFTPKG NAME="NetAddr-IP-Util" VERSION="1.53">' > NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' <AUTHOR></AUTHOR>' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="x86_64-linux-thread-multi-5.32" />' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> NetAddr-IP-Util.ppd $(NOECHO) $(ECHO) '</SOFTPKG>' >> NetAddr-IP-Util.ppd # --- MakeMaker pm_to_blib section: pm_to_blib : $(FIRST_MAKEFILE) $(TO_INST_PM) $(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', q[$(PM_FILTER)], '\''$(PERM_DIR)'\'')' -- \ 'Util.pm' '$(INST_LIB)/NetAddr/IP/Util.pm' \ 'Util_IS.pm' '$(INST_LIB)/NetAddr/IP/Util_IS.pm' \ 'lib/NetAddr/IP/InetBase.pm' '../../blib/lib/NetAddr/IP/InetBase.pm' \ 'lib/NetAddr/IP/UtilPP.pm' '../../blib/lib/NetAddr/IP/UtilPP.pm' $(NOECHO) $(TOUCH) pm_to_blib # --- MakeMaker selfdocument section: # here so even if top_targets is overridden, these will still be defined # gmake will silently still work if any are .PHONY-ed but nmake won't static :: $(NOECHO) $(NOOP) dynamic :: $(NOECHO) $(NOOP) config :: $(NOECHO) $(NOOP) # --- MakeMaker postamble section: README : Util.pm @$(MY_POD2TEXT) Util.pm > README # End. Lite/Util/Util.pm 0000644 00000053776 15043770025 0007656 0 ustar 00 #!/usr/bin/perl package NetAddr::IP::Util; use strict; #use diagnostics; #use lib qw(blib/lib); use vars qw($VERSION @EXPORT_OK @ISA %EXPORT_TAGS $Mode); use AutoLoader qw(AUTOLOAD); use NetAddr::IP::Util_IS; use NetAddr::IP::InetBase qw( :upper :all ); *NetAddr::IP::Util::upper = \&NetAddr::IP::InetBase::upper; *NetAddr::IP::Util::lower = \&NetAddr::IP::InetBase::lower; require DynaLoader; require Exporter; @ISA = qw(Exporter DynaLoader); $VERSION = do { my @r = (q$Revision: 1.53 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; @EXPORT_OK = qw( inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n hasbits isIPv4 isNewIPv4 isAnyIPv4 inet_n2dx inet_n2ad inet_pton inet_ntop inet_4map6 shiftleft addconst add128 sub128 notcontiguous bin2bcd bcd2bin mode ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 bin2bcdn bcdn2txt bcdn2bin simple_pack comp128 packzeros AF_INET AF_INET6 naip_gethostbyname havegethostbyname2 ); %EXPORT_TAGS = ( all => [@EXPORT_OK], inet => [qw( inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_pton inet_ntop inet_4map6 ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 packzeros naip_gethostbyname )], math => [qw( shiftleft hasbits isIPv4 isNewIPv4 isAnyIPv4 addconst add128 sub128 notcontiguous bin2bcd bcd2bin )], ipv4 => [qw( inet_aton inet_ntoa )], ipv6 => [qw( ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_pton inet_ntop inet_4map6 ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 packzeros naip_gethostbyname )], ); if (NetAddr::IP::Util_IS->not_pure) { eval { ## attempt to load 'C' version of utilities bootstrap NetAddr::IP::Util $VERSION; }; } if (NetAddr::IP::Util_IS->pure || $@) { ## load the pure perl version if 'C' lib missing require NetAddr::IP::UtilPP; import NetAddr::IP::UtilPP qw( :all ); # require Socket; # import Socket qw(inet_ntoa); # *yinet_aton = \&Socket::inet_aton; $Mode = 'Pure Perl'; } else { $Mode = 'CC XS'; } # if Socket lib is broken in some way, check for overange values # #my $overange = yinet_aton('256.1') ? 1:0; #my $overange = gethostbyname('256.1') ? 1:0; sub mode() { $Mode }; my $_newV4compat = pack('N4',0,0,0xffff,0); sub inet_4map6 { my $naddr = shift; if (length($naddr) == 4) { $naddr = ipv4to6($naddr); } elsif (length($naddr) == 16) { ; # is OK return undef unless isAnyIPv4($naddr); } else { return undef; } $naddr |= $_newV4compat; return $naddr; } sub DESTROY {}; my $havegethostbyname2 = 0; my $mygethostbyname; my $_Sock6ok = 1; # for testing gethostbyname sub havegethostbyname2 { return $_Sock6ok ? $havegethostbyname2 : 0; } sub import { if (grep { $_ eq ':noSock6' } @_) { $_Sock6ok = 0; @_ = grep { $_ ne ':noSock6' } @_; } NetAddr::IP::Util->export_to_level(1,@_); } package NetAddr::IP::UtilPolluted; # Socket pollutes the name space with all of its symbols. Since # we don't want them all, confine them to this name space. use strict; use Socket; my $_v4zero = pack('L',0); my $_zero = pack('L4',0,0,0,0); # invoke replacement subroutine for Perl's "gethostbyname" # if Socket6 is available. # # NOTE: in certain BSD implementations, Perl's gethostbyname is broken # we will use our own InetBase::inet_aton instead sub _end_gethostbyname { # my ($name,$aliases,$addrtype,$length,@addrs) = @_; my @rv = @_; # first ip address = rv[4] my $tip = $rv[4]; unless ($tip && $tip ne $_v4zero && $tip ne $_zero) { @rv = (); } # length = rv[3] elsif ($rv[3] && $rv[3] == 4) { foreach (4..$#rv) { $rv[$_] = NetAddr::IP::Util::inet_4map6(NetAddr::IP::Util::ipv4to6($rv[$_])); } $rv[3] = 16; # unconditionally set length to 16 } elsif ($rv[3] == 16) { ; # is ok } else { @rv = (); } return @rv; } unless ( eval { require Socket6 }) { $mygethostbyname = sub { # SEE NOTE above about broken BSD my @tip = gethostbyname(NetAddr::IP::InetBase::fillIPv4($_[0])); return &_end_gethostbyname(@tip); }; } else { import Socket6 qw( gethostbyname2 getipnodebyname ); my $try = eval { my @try = gethostbyname2('127.0.0.1',NetAddr::IP::Util::AF_INET()); $try[4] }; if (! $@ && $try && $try eq INADDR_LOOPBACK()) { *_ghbn2 = \&Socket6::gethostbyname2; $havegethostbyname2 = 1; } else { *_ghbn2 = sub { return () }; # use failure branch below } $mygethostbyname = sub { my @tip; unless ($_Sock6ok && (@tip = _ghbn2($_[0],NetAddr::IP::Util::AF_INET6())) && @tip > 1) { # SEE NOTE above about broken BSD @tip = gethostbyname(NetAddr::IP::InetBase::fillIPv4($_[0])); } return &_end_gethostbyname(@tip); }; } package NetAddr::IP::Util; sub naip_gethostbyname { # turn off complaint from Socket6 about missing numeric argument undef local $^W; my @rv = &$mygethostbyname($_[0]); return wantarray ? @rv : $rv[4]; } 1; __END__ =head1 NAME NetAddr::IP::Util -- IPv4/6 and 128 bit number utilities =head1 SYNOPSIS use NetAddr::IP::Util qw( inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n hasbits isIPv4 isNewIPv4 isAnyIPv4 inet_n2dx inet_n2ad inet_pton inet_ntop inet_4map6 ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 packzeros shiftleft addconst add128 sub128 notcontiguous bin2bcd bcd2bin mode AF_INET AF_INET6 naip_gethostbyname ); use NetAddr::IP::Util qw(:all :inet :ipv4 :ipv6 :math) :inet => inet_aton, inet_ntoa, ipv6_aton ipv6_ntoa, ipv6_n2x, ipv6_n2d, inet_any2n, inet_n2dx, inet_n2ad, inet_pton, inet_ntop, inet_4map6, ipv4to6, mask4to6, ipanyto6, packzeros maskanyto6, ipv6to4, naip_gethostbyname :ipv4 => inet_aton, inet_ntoa :ipv6 => ipv6_aton, ipv6_ntoa, ipv6_n2x, ipv6_n2d, inet_any2n, inet_n2dx, inet_n2ad, inet_pton, inet_ntop, inet_4map6, ipv4to6, mask4to6, ipanyto6, maskanyto6, ipv6to4, packzeros, naip_gethostbyname :math => hasbits, isIPv4, isNewIPv4, isAnyIPv4, addconst, add128, sub128, notcontiguous, bin2bcd, bcd2bin, shiftleft $dotquad = inet_ntoa($netaddr); $netaddr = inet_aton($dotquad); $ipv6naddr = ipv6_aton($ipv6_text); $ipv6_text = ipvt_ntoa($ipv6naddr); $hex_text = ipv6_n2x($ipv6naddr); $dec_text = ipv6_n2d($ipv6naddr); $hex_text = packzeros($hex_text); $ipv6naddr = inet_any2n($dotquad or $ipv6_text); $ipv6naddr = inet_4map6($netaddr or $ipv6naddr); $rv = hasbits($bits128); $rv = isIPv4($bits128); $rv = isNewIPv4($bits128); $rv = isAnyIPv4($bits128); $dotquad or $hex_text = inet_n2dx($ipv6naddr); $dotquad or $dec_text = inet_n2ad($ipv6naddr); $netaddr = inet_pton($AF_family,$hex_text); $hex_text = inet_ntop($AF_family,$netaddr); $ipv6naddr = ipv4to6($netaddr); $ipv6naddr = mask4to6($netaddr); $ipv6naddr = ipanyto6($netaddr); $ipv6naddr = maskanyto6($netaddr); $netaddr = ipv6to4($pv6naddr); $bitsX2 = shiftleft($bits128,$n); $carry = addconst($ipv6naddr,$signed_32con); ($carry,$ipv6naddr)=addconst($ipv6naddr,$signed_32con); $carry = add128($ipv6naddr1,$ipv6naddr2); ($carry,$ipv6naddr)=add128($ipv6naddr1,$ipv6naddr2); $carry = sub128($ipv6naddr1,$ipv6naddr2); ($carry,$ipv6naddr)=sub128($ipv6naddr1,$ipv6naddr2); ($spurious,$cidr) = notcontiguous($mask128); $bcdtext = bin2bcd($bits128); $bits128 = bcd2bin($bcdtxt); $modetext = mode; ($name,$aliases,$addrtype,$length,@addrs)=naip_gethostbyname(NAME); $trueif = havegethostbyname2(); NetAddr::IP::Util::lower(); NetAddr::IP::Util::upper(); =head1 INSTALLATION Un-tar the distribution in an appropriate directory and type: perl Makefile.PL make make test make install B<NetAddr::IP::Util> installs by default with its primary functions compiled using Perl's XS extensions to build a 'C' library. If you do not have a 'C' complier available or would like the slower Pure Perl version for some other reason, then type: perl Makefile.PL -noxs make make test make install =head1 DESCRIPTION B<NetAddr::IP::Util> provides a suite of tools for manipulating and converting IPv4 and IPv6 addresses into 128 bit string context and back to text. The strings can be manipulated with Perl's logical operators: and & or | xor ^ ~ compliment in the same manner as 'vec' strings. The IPv6 functions support all rfc1884 formats. i.e. x:x:x:x:x:x:x:x:x x:x:x:x:x:x:x:d.d.d.d ::x:x:x ::x:d.d.d.d and so on... =over 4 =item * $dotquad = inet_ntoa($netaddr); Convert a packed IPv4 network address to a dot-quad IP address. input: packed network address returns: IP address i.e. 10.4.12.123 =item * $netaddr = inet_aton($dotquad); Convert a dot-quad IP address into an IPv4 packed network address. input: IP address i.e. 192.5.16.32 returns: packed network address =item * $ipv6addr = ipv6_aton($ipv6_text); Takes an IPv6 address of the form described in rfc1884 and returns a 128 bit binary RDATA string. input: ipv6 text returns: 128 bit RDATA string =item * $ipv6_text = ipv6_ntoa($ipv6naddr); Convert a 128 bit binary IPv6 address to compressed rfc 1884 text representation. input: 128 bit RDATA string returns: ipv6 text =item * $hex_text = ipv6_n2x($ipv6addr); Takes an IPv6 RDATA string and returns an 8 segment IPv6 hex address input: 128 bit RDATA string returns: x:x:x:x:x:x:x:x =item * $dec_text = ipv6_n2d($ipv6addr); Takes an IPv6 RDATA string and returns a mixed hex - decimal IPv6 address with the 6 uppermost chunks in hex and the lower 32 bits in dot-quad representation. input: 128 bit RDATA string returns: x:x:x:x:x:x:d.d.d.d =item * $ipv6naddr = inet_any2n($dotquad or $ipv6_text); This function converts a text IPv4 or IPv6 address in text format in any standard notation into a 128 bit IPv6 string address. It prefixes any dot-quad address (if found) with '::' and passes it to B<ipv6_aton>. input: dot-quad or rfc1844 address returns: 128 bit IPv6 string =item * $rv = hasbits($bits128); This function returns true if there are one's present in the 128 bit string and false if all the bits are zero. i.e. if (hasbits($bits128)) { &do_something; } or if (hasbits($bits128 & $mask128) { &do_something; } This allows the implementation of logical functions of the form of: if ($bits128 & $mask128) { ... input: 128 bit IPv6 string returns: true if any bits are present =item * $ipv6naddr = inet_4map6($netaddr or $ipv6naddr This function returns an ipV6 network address with the first 80 bits set to zero and the next 16 bits set to one, while the last 32 bits are filled with the ipV4 address. input: ipV4 netaddr or ipV6 netaddr returns: ipV6 netaddr returns: undef on error An ipV6 network address must be in one of the two compatible ipV4 mapped address spaces. i.e. ::ffff::d.d.d.d or ::d.d.d.d =item * $rv = isIPv4($bits128); This function returns true if there are no on bits present in the IPv6 portion of the 128 bit string and false otherwise. i.e. the address must be of the form - ::d.d.d.d Note: this is an old and deprecated ipV4 compatible ipV6 address =item * $rv = isNewIPv4($bits128); This function return true if the IPv6 128 bit string is of the form ::ffff::d.d.d.d =item * $rv = isAnyIPv4($bits128); This function return true if the IPv6 bit string is of the form ::d.d.d.d or ::ffff::d.d.d.d =item * $dotquad or $hex_text = inet_n2dx($ipv6naddr); This function B<does the right thing> and returns the text for either a dot-quad IPv4 or a hex notation IPv6 address. input: 128 bit IPv6 string returns: ddd.ddd.ddd.ddd or x:x:x:x:x:x:x:x =item * $dotquad or $dec_text = inet_n2ad($ipv6naddr); This function B<does the right thing> and returns the text for either a dot-quad IPv4 or a hex::decimal notation IPv6 address. input: 128 bit IPv6 string returns: ddd.ddd.ddd.ddd or x:x:x:x:x:x:ddd.ddd.ddd.dd =item * $netaddr = inet_pton($AF_family,$hex_text); This function takes an IP address in IPv4 or IPv6 text format and converts it into binary format. The type of IP address conversion is controlled by the FAMILY argument. =item * $hex_text = inet_ntop($AF_family,$netaddr); This function takes and IP address in binary format and converts it into text format. The type of IP address conversion is controlled by the FAMILY argument. NOTE: inet_ntop ALWAYS returns lowercase characters. =item * $hex_text = packzeros($hex_text); This function optimizes and rfc 1884 IPv6 hex address to reduce the number of long strings of zero bits as specified in rfc 1884, 2.2 (2) by substituting B<::> for the first occurence of the longest string of zeros in the address. =item * $ipv6naddr = ipv4to6($netaddr); Convert an ipv4 network address into an IPv6 network address. input: 32 bit network address returns: 128 bit network address =item * $ipv6naddr = mask4to6($netaddr); Convert an ipv4 network address/mask into an ipv6 network mask. input: 32 bit network/mask address returns: 128 bit network/mask address NOTE: returns the high 96 bits as one's =item * $ipv6naddr = ipanyto6($netaddr); Similar to ipv4to6 except that this function takes either an IPv4 or IPv6 input and always returns a 128 bit IPv6 network address. input: 32 or 128 bit network address returns: 128 bit network address =item * $ipv6naddr = maskanyto6($netaddr); Similar to mask4to6 except that this function takes either an IPv4 or IPv6 netmask and always returns a 128 bit IPv6 netmask. input: 32 or 128 bit network mask returns: 128 bit network mask =item * $netaddr = ipv6to4($pv6naddr); Truncate the upper 96 bits of a 128 bit address and return the lower 32 bits. Returns an IPv4 address as returned by inet_aton. input: 128 bit network address returns: 32 bit inet_aton network address =item * $bitsXn = shiftleft($bits128,$n); input: 128 bit string variable, number of shifts [optional] returns: bits X n shifts NOTE: a single shift is performed if $n is not specified =item * addconst($ipv6naddr,$signed_32con); Add a signed constant to a 128 bit string variable. input: 128 bit IPv6 string, signed 32 bit integer returns: scalar carry array (carry, result) =item * add128($ipv6naddr1,$ipv6naddr2); Add two 128 bit string variables. input: 128 bit string var1, 128 bit string var2 returns: scalar carry array (carry, result) =item * sub128($ipv6naddr1,$ipv6naddr2); Subtract two 128 bit string variables. input: 128 bit string var1, 128 bit string var2 returns: scalar carry array (carry, result) Note: The carry from this operation is the result of adding the one's complement of ARG2 +1 to the ARG1. It is logically B<NOT borrow>. i.e. if ARG1 >= ARG2 then carry = 1 or if ARG1 < ARG2 then carry = 0 =item * ($spurious,$cidr) = notcontiguous($mask128); This function counts the bit positions remaining in the mask when the rightmost '0's are removed. input: 128 bit netmask returns true if there are spurious zero bits remaining in the mask, false if the mask is contiguous one's, 128 bit cidr number =item * $bcdtext = bin2bcd($bits128); Convert a 128 bit binary string into binary coded decimal text digits. input: 128 bit string variable returns: string of bcd text digits =item * $bits128 = bcd2bin($bcdtxt); Convert a bcd text string to 128 bit string variable input: string of bcd text digits returns: 128 bit string variable =cut #=item * $onescomp=NetAddr::IP::Util::comp128($ipv6addr); # #This function is not exported because it is more efficient to use perl " ~ " #on the bit string directly. This interface to the B<C> routine is published for #module testing purposes because it is used internally in the B<sub128> routine. The #function is very fast, but calling if from perl directly is very slow. It is almost #33% faster to use B<sub128> than to do a 1's comp with perl and then call #B<add128>. # #=item * $bcdpacked = NetAddr::IP::Util::bin2bcdn($bits128); # #Convert a 128 bit binary string into binary coded decimal digits. #This function is not exported. # # input: 128 bit string variable # returns: string of packed decimal digits # # i.e. text = unpack("H*", $bcd); # #=item * $bcdtext = NetAddr::IP::Util::bcdn2txt($bcdpacked); # #Convert a packed bcd string into text digits, suppress the leading zeros. #This function is not exported. # # input: string of packed decimal digits # returns: hexadecimal digits # #Similar to unpack("H*", $bcd); # #=item * $bcdpacked = NetAddr::IP::Util::simple_pack($bcdtext); # #Convert a numeric string into a packed bcd string, left fill with zeros # # input: string of decimal digits # returns: string of packed decimal digits # #Similar to pack("H*", $bcdtext); =item * $modetext = mode; Returns the operating mode of this module. input: none returns: "Pure Perl" or "CC XS" =item * ($name,$aliases,$addrtype,$length,@addrs)=naip_gethostbyname(NAME); Replacement for Perl's gethostbyname if Socket6 is available In ARRAY context, returns a list of five elements, the hostname or NAME, a space separated list of C_NAMES, AF family, length of the address structure, and an array of one or more netaddr's In SCALAR context, returns the first netaddr. This function ALWAYS returns an IPv6 address, even on IPv4 only systems. IPv4 addresses are mapped into IPv6 space in the form: ::FFFF:FFFF:d.d.d.d This is NOT the expected result from Perl's gethostbyname2. It is instead equivalent to: On an IPv4 only system: $ipv6naddr = ipv4to6 scalar ( gethostbyname( name )); On a system with Socket6 and a working gethostbyname2: $ipv6naddr = gethostbyname2( name, AF_INET6 ); and if that fails, the IPv4 conversion above. For a gethostbyname2 emulator that behave like Socket6, see: L<Net::DNS::Dig> =item * $trueif = havegethostbyname2(); This function returns TRUE if Socket6 has a functioning B<gethostbyname2>, otherwise it returns FALSE. See the comments above about the behavior of B<naip_gethostbyname>. =item * NetAddr::IP::Util::lower(); Return IPv6 strings in lowercase. =item * NetAddr::IP::Util::upper(); Return IPv6 strings in uppercase. This is the default. =back =head1 EXAMPLES # convert any textual IP address into a 128 bit vector # sub text2vec { my($anyIP,$anyMask) = @_; # not IPv4 bit mask my $notiv4 = ipv6_aton('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF::'); my $vecip = inet_any2n($anyIP); my $mask = inet_any2n($anyMask); # extend mask bits for IPv4 my $bits = 128; # default unless (hasbits($mask & $notiv4)) { $mask |= $notiv4; $bits = 32; } return ($vecip, $mask, $bits); } ... alternate implementation, a little faster sub text2vec { my($anyIP,$anyMask) = @_; # not IPv4 bit mask my $notiv4 = ipv6_aton('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF::'); my $vecip = inet_any2n($anyIP); my $mask = inet_any2n($anyMask); # extend mask bits for IPv4 my $bits = 128; # default if (isIPv4($mask)) { $mask |= $notiv4; $bits = 32; } return ($vecip, $mask, $bits); } ... elsewhere $nip = { addr => $vecip, mask => $mask, bits => $bits, }; # return network and broadcast addresses from IP and Mask # sub netbroad { my($nip) = shift; my $notmask = ~ $nip->{mask}; my $bcast = $nip->{addr} | $notmask; my $network = $nip->{addr} & $nip->{mask}; return ($network, $broadcast); } # check if address is within a network # sub within { my($nip,$net) = @_; my $addr = $nip->{addr} my($nw,$bc) = netbroad($net); # arg1 >= arg2, sub128 returns true return (sub128($addr,$nw) && sub128($bc,$addr)) ? 1 : 0; } # truely hard way to do $ip++ # add a constant, wrapping at netblock boundaries # to subtract the constant, negate it before calling # 'addwrap' since 'addconst' will extend the sign bits # sub addwrap { my($nip,$const) = @_; my $addr = $nip->{addr}; my $mask = $nip->{mask}; my $bits = $nip->{bits}; my $notmask = ~ $mask; my $hibits = $addr & $mask; $addr = addconst($addr,$const); my $wraponly = $addr & $notmask; my $newip = { addr => $hibits | $wraponly, mask => $mask, bits => $bits, }; # bless $newip as appropriate return $newip; } # something more useful # increment a /24 net to the NEXT net at the boundry my $nextnet = 256; # for /24 LOOP: while (...continuing) { your code.... ... my $lastip = $ip-copy(); $ip++; if ($ip < $lastip) { # host part wrapped? # discard carry (undef, $ip->{addr} = addconst($ip->{addr}, $nextnet); } next LOOP; } =head1 EXPORT_OK inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n hasbits isIPv4 isNewIPv4 isAnyIPv4 inet_n2dx inet_n2ad inet_pton inet_ntop inet_4map6 ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 packzeros shiftleft addconst add128 sub128 notcontiguous bin2bcd bcd2bin mode naip_gethostbyname havegethostbyname2 =head1 AUTHOR Michael Robinton <michael@bizsystems.com> =head1 COPYRIGHT Copyright 2003 - 2014, Michael Robinton E<lt>michael@bizsystems.comE<gt> All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the "Artistic License" which comes with this distribution. 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 either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this distribution, in the file named "Artistic". If not, I'll be glad to provide one. You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA. or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =head1 AUTHOR Michael Robinton <michael@bizsystems.com> =head1 SEE ALSO NetAddr::IP(3), NetAddr::IP::Lite(3), NetAddr::IP::InetBase(3) =cut 1; Lite/Util/t/bin.t 0000644 00000005103 15043770025 0007560 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..25\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton bin2bcd bin2bcdn bcdn2txt ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } # input: array ref, value ref, number ref # sub val { my $bcd = shift; my $rv = unpack("H*",$bcd); $rv =~ s/^0+(\d)/$1/g; return $rv; } sub numnum { my($ar,$i) = @_; return sprintf("%.0f",$ar->[$i +1]); } sub numstr { my($ar,$i) = @_; return $ar->[$i+1]; } sub dotest { my($ar,$vr,$nr) = @_; for(my $i=0;$i<@$ar;$i+=2) { my $bstr = ipv6_aton($ar->[$i]); my $bcd = bin2bcdn($bstr); my $val = $vr->($bcd); my $exp = $nr->($ar,$i); print "\t\t$val\n"; print "got: $val\nexp: $exp\nnot " unless $val eq $exp; &ok; } } # setup only, can't depend on float to do it right on all systems #my @num1 = # input expected #( # '::' => 0, # '::8000:0' => 2**(15+16), # '::8000:0:0' => 2**(15+(16*2)), # '::8000:0:0:0' => 2**(15+(16*3)), # '::8000:0:0:0:0' => 2**(15+(16*4)), # '::8000:0:0:0:0:0' => 2**(15+(16*5)), # '::8000:0:0:0:0:0:0' => 2**(15+(16*6)), # '8000:0:0:0:0:0:0:0' => 2**(15+(16*7)), #); my @num2 = qw( :: 0 ::8000:0 2147483648 ::8000:0:0 140737488355328 ::8000:0:0:0 9223372036854775808 ::8000:0:0:0:0 604462909807314587353088 ::8000:0:0:0:0:0 39614081257132168796771975168 ::8000:0:0:0:0:0:0 2596148429267413814265248164610048 8000:0:0:0:0:0:0:0 170141183460469231731687303715884105728 ); ## tests 2 - 9 bin2bcdn numeric unpack #dotest(\@num1,\&val,\&numnum); ## tests 10 - 17 bin2bcdn string unpack TEST 2 - 9 dotest(\@num2,\&val,\&numstr); ## tests 18 - 25 bin2bcdn numeric bcdn2txt #dotest(\@num1,\&bcdn2txt,\&numnum); ## tests 26 - 33 bin2bcdn string bcdn2txt TEST 10 - 17 dotest(\@num2,\&bcdn2txt,\&numstr); ## tests 34 - 41 bin2bcd TEST 18 - 25 for(my $i=0;$i<@num2;$i+=2) { my $bstr = ipv6_aton($num2[$i]); my $bcd = bin2bcd($bstr); my $exp = $num2[$i +1]; print "\t\t$bcd\n"; print "got: $bcd\nexp: $exp\nnot " unless $bcd eq $exp; &ok; } Lite/Util/t/isIPv4.t 0000644 00000005602 15043770025 0010132 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..421\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x isIPv4 isNewIPv4 isAnyIPv4 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input ( :: 8000:: 4000:: 2000:: 1000:: 800:: 400:: 200:: 100:: 80:: 40:: 20:: 10:: 1:: 0:8000:: 0:4000:: 0:2000:: 0:1000:: 0:800:: 0:400:: 0:200:: 0:100:: 0:80:: 0:40:: 0:20:: 0:10:: 0:1:: 0:0:8000:: 0:0:4000:: 0:0:2000:: 0:0:1000:: 0:0:800:: 0:0:400:: 0:0:200:: 0:0:100:: 0:0:80:: 0:0:40:: 0:0:20:: 0:0:10:: 0:0:1:: 0:0:0:8000:: 0:0:0:4000:: 0:0:0:2000:: 0:0:0:1000:: 0:0:0:800:: 0:0:0:400:: 0:0:0:200:: 0:0:0:100:: 0:0:0:80:: 0:0:0:40:: 0:0:0:20:: 0:0:0:10:: 0:0:0:1:: 0:0:0:0:8000:: 0:0:0:0:4000:: 0:0:0:0:2000:: 0:0:0:0:1000:: 0:0:0:0:800:: 0:0:0:0:400:: 0:0:0:0:200:: 0:0:0:0:100:: 0:0:0:0:80:: 0:0:0:0:40:: 0:0:0:0:20:: 0:0:0:0:10:: 0:0:0:0:1:: 0:0:0:0:0:8000:: 0:0:0:0:0:4000:: 0:0:0:0:0:2000:: 0:0:0:0:0:1000:: 0:0:0:0:0:800:: 0:0:0:0:0:400:: 0:0:0:0:0:200:: 0:0:0:0:0:100:: 0:0:0:0:0:80:: 0:0:0:0:0:40:: 0:0:0:0:0:20:: 0:0:0:0:0:10:: 0:0:0:0:0:1:: ::8000:0 ::4000:0 ::2000:0 ::1000:0 ::800:0 ::400:0 ::200:0 ::100:0 ::80:0 ::40:0 ::20:0 ::10:0 ::1:0 ::8000 ::4000 ::2000 ::1000 ::800 ::400 ::200 ::100 ::80 ::40 ::20 ::10 ::1 ); # check isIPv4 foreach (@num) { my $bstr = ipv6_aton($_); my $rv = isIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } # check isAnyIPv4 foreach (@num) { my $bstr = ipv6_aton($_); my $rv = isAnyIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } my $compat = ipv6_aton('::FFFF:0:0'); # check isAnyIPv4 with compatible high bits foreach (@num) { my $bstr = ipv6_aton($_); $bstr ^= $compat; my $rv = isAnyIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } # check isNewIPv4 with compatible high bits foreach (@num) { my $bstr = ipv6_aton($_); $bstr ^= $compat; my $rv = isNewIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/no6_naip_gethostbyname.t 0000644 00000002533 15043770025 0013456 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..3\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::Util qw( :noSock6 naip_gethostbyname havegethostbyname2 ipv6_n2x inet_aton ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my $exp = '0:0:0:0:0:FFFF:7F00:1'; my $host = '127.1'; my $got = ipv6_n2x( scalar naip_gethostbyname($host)); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $exp = '0:0:0:0:0:0:0:1'; $host = $exp; if (havegethostbyname2()) { $got = ipv6_n2x(scalar naip_gethostbyname($host)); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; } else { $got = scalar naip_gethostbyname($host); if ($got) { $got = eval{ inet_ntoa($got) } || eval{ ipv6_n2x($got) }; } print "unexpected return value got: $got\nnot " if $got; } &ok; Lite/Util/t/4to6.t 0000644 00000003037 15043770025 0007610 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..5\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( inet_aton ipv6_n2d ipv6_aton ipv4to6 mask4to6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my $nip = inet_aton('1.2.3.4'); my $exp = '0:0:0:0:0:0:1.2.3.4'; ## test 2 check 4->6 conversion my $nipv6 = ipv4to6($nip); my $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; ## test 3 check mask4->6 extension $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:1.2.3.4'; $nipv6 = mask4to6($nip); $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; ## test 4 check bad length $nip = pack("H9",0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09); eval { ipv4to6($nip); }; print "ipv4to6 accepted bad argument length\nnot " unless $@ && $@ =~ /Bad arg.+ipv4to6/; &ok; ## test 5 check bad length eval { mask4to6($nip); }; print "mask4to6 accepted bad argument length\nnot " unless $@ && $@ =~ /Bad arg.+mask4to6/; &ok; Lite/Util/t/hasbits.t 0000644 00000003736 15043770025 0010457 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) $| = 1; END {print "1..1\nnot ok 1\n" unless $test;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x hasbits ); $test = 1; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input ( :: 8000:: 4000:: 2000:: 1000:: 800:: 400:: 200:: 100:: 80:: 40:: 20:: 10:: 1:: 0:8000:: 0:4000:: 0:2000:: 0:1000:: 0:800:: 0:400:: 0:200:: 0:100:: 0:80:: 0:40:: 0:20:: 0:10:: 0:1:: 0:0:8000:: 0:0:4000:: 0:0:2000:: 0:0:1000:: 0:0:800:: 0:0:400:: 0:0:200:: 0:0:100:: 0:0:80:: 0:0:40:: 0:0:20:: 0:0:10:: 0:0:1:: 0:0:0:8000:: 0:0:0:4000:: 0:0:0:2000:: 0:0:0:1000:: 0:0:0:800:: 0:0:0:400:: 0:0:0:200:: 0:0:0:100:: 0:0:0:80:: 0:0:0:40:: 0:0:0:20:: 0:0:0:10:: 0:0:0:1:: ::8000:0:0:0 ::4000:0:0:0 ::2000:0:0:0 ::1000:0:0:0 ::800:0:0:0 ::400:0:0:0 ::200:0:0:0 ::100:0:0:0 ::80:0:0:0 ::40:0:0:0 ::20:0:0:0 ::10:0:0:0 ::1:0:0:0 ::8000:0:0 ::4000:0:0 ::2000:0:0 ::1000:0:0 ::800:0:0 ::400:0:0 ::200:0:0 ::100:0:0 ::80:0:0 ::40:0:0 ::20:0:0 ::10:0:0 ::1:0:0 ::8000:0 ::4000:0 ::2000:0 ::1000:0 ::800:0 ::400:0 ::200:0 ::100:0 ::80:0 ::40:0 ::20:0 ::10:0 ::1:0 ::8000 ::4000 ::2000 ::1000 ::800 ::400 ::200 ::100 ::80 ::40 ::20 ::10 ::1 ::8000:0:0:0:0 ::8000:0:0:0:0:0 ::8000:0:0:0:0:0:0 8000:0:0:0:0:0:0:0 ); # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): print '1..',(scalar @num), "\n"; foreach (@num) { my $bstr = ipv6_aton($_); my $rv = hasbits($bstr); my $exp = ($_ eq '::') ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/simple_pack.t 0000644 00000002270 15043770025 0011301 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..9\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( simple_pack ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num2 = qw( 0 2147483648 140737488355328 9223372036854775808 604462909807314587353088 39614081257132168796771975168 2596148429267413814265248164610048 170141183460469231731687303715884105728 ); ## tests 2 - 9 check pack correct for (my $i=0;$i<@num2;$i++) { my $len = length($num2[$i]); my $pkd = simple_pack($num2[$i]); my $rv = unpack("H40",$pkd); $rv =~ s/^0+(\d)/$1/g; print "got: $rv\nexp: $num2[$i]\nnot " unless $rv eq $num2[$i]; &ok; } Lite/Util/t/inet_n2ad.t 0000644 00000002253 15043770025 0010656 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x inet_any2n inet_n2ad ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:42.27.59.76 1.2.3.4 1.2.3.4 190A::102:304 190A:0:0:0:0:0:1.2.3.4 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = inet_n2ad($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/bisIPv4.t 0000644 00000005615 15043770025 0010300 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..421\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( :upper ipv6_aton ipv6_n2x isIPv4 isNewIPv4 isAnyIPv4 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input ( :: 8000:: 4000:: 2000:: 1000:: 800:: 400:: 200:: 100:: 80:: 40:: 20:: 10:: 1:: 0:8000:: 0:4000:: 0:2000:: 0:1000:: 0:800:: 0:400:: 0:200:: 0:100:: 0:80:: 0:40:: 0:20:: 0:10:: 0:1:: 0:0:8000:: 0:0:4000:: 0:0:2000:: 0:0:1000:: 0:0:800:: 0:0:400:: 0:0:200:: 0:0:100:: 0:0:80:: 0:0:40:: 0:0:20:: 0:0:10:: 0:0:1:: 0:0:0:8000:: 0:0:0:4000:: 0:0:0:2000:: 0:0:0:1000:: 0:0:0:800:: 0:0:0:400:: 0:0:0:200:: 0:0:0:100:: 0:0:0:80:: 0:0:0:40:: 0:0:0:20:: 0:0:0:10:: 0:0:0:1:: 0:0:0:0:8000:: 0:0:0:0:4000:: 0:0:0:0:2000:: 0:0:0:0:1000:: 0:0:0:0:800:: 0:0:0:0:400:: 0:0:0:0:200:: 0:0:0:0:100:: 0:0:0:0:80:: 0:0:0:0:40:: 0:0:0:0:20:: 0:0:0:0:10:: 0:0:0:0:1:: 0:0:0:0:0:8000:: 0:0:0:0:0:4000:: 0:0:0:0:0:2000:: 0:0:0:0:0:1000:: 0:0:0:0:0:800:: 0:0:0:0:0:400:: 0:0:0:0:0:200:: 0:0:0:0:0:100:: 0:0:0:0:0:80:: 0:0:0:0:0:40:: 0:0:0:0:0:20:: 0:0:0:0:0:10:: 0:0:0:0:0:1:: ::8000:0 ::4000:0 ::2000:0 ::1000:0 ::800:0 ::400:0 ::200:0 ::100:0 ::80:0 ::40:0 ::20:0 ::10:0 ::1:0 ::8000 ::4000 ::2000 ::1000 ::800 ::400 ::200 ::100 ::80 ::40 ::20 ::10 ::1 ); # check isIPv4 foreach (@num) { my $bstr = ipv6_aton($_); my $rv = isIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } # check isAnyIPv4 foreach (@num) { my $bstr = ipv6_aton($_); my $rv = isAnyIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } my $compat = ipv6_aton('::FFFF:0:0'); # check isAnyIPv4 with compatible high bits foreach (@num) { my $bstr = ipv6_aton($_); $bstr ^= $compat; my $rv = isAnyIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } # check isNewIPv4 with compatible high bits foreach (@num) { my $bstr = ipv6_aton($_); $bstr ^= $compat; my $rv = isNewIPv4($bstr); my $exp = ($_ =~ /\d::$/) ? 0:1; print "got: $rv, exp: $exp for ", ipv6_n2x($bstr), "\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/binet_pton.t 0000644 00000004127 15043770025 0011156 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..32\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::InetBase qw( :upper :ipv6 AF_INET AF_INET6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 - 13 add stuff to buffer my @num = # addr qw( 0.0.0.0 255.255.255.255 1.2.3.4 10.253.230.9 ); foreach (@num) { my @digs = split(/\./,$_); my $pkd = pack('C4',@digs); my $naddr = inet_pton(AF_INET(),$_); my $addr = join('.',unpack('C4',$naddr)); my $num = inet_ntop(AF_INET(),$pkd); print "bits do not match\nnot " unless $naddr eq $pkd; &ok; print "inet_pton: $addr, exp: $_\nnot " unless $addr eq $_; &ok; print "inet_ntop: $num, exp: $_\nnot " unless $num eq $_; &ok; } ## test 14 - 31 @num = # in exphex qw( :: :: 43:: 43:: ::21 ::21 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1::8 1::8 FF00::FFFF ff00::ffff FFFF::FFFF:FFFF ffff::ffff:ffff A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 a1b2:c3d4:e5d6:f7e8:8f9:190a:102:304 ); for (my $i=0;$i<@num;$i+=2) { my $bits = inet_pton(AF_INET6(),$num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = inet_ntop(AF_INET6(),$bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; } ## test 32 check bad length ntop my $try = '1234'; my $notempty = eval { inet_ntop(AF_INET6(),$try); }; print "failed bad argument length test for inet_ntop\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/addconst.t 0000644 00000004326 15043770025 0010615 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..20\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x inet_any2n addconst ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( :: 0:0:0:0:0:0:0:0 :: 0:0:0:0:0:0:0:2 ::FFFF 0:0:0:0:0:0:1:3 ::FFFF:FFFF 0:0:0:0:0:1:0:5 ::FFFF:FFFF:FFFF 0:0:0:0:1:0:0:7 ::FFFF:FFFF:FFFF:ffff 0:0:0:1:0:0:0:9 ::FFFF:FFFF:FFFF:ffff:ffff 0:0:1:0:0:0:0:B ::FFFF:FFFF:FFFF:ffff:ffff:ffff 0:1:0:0:0:0:0:D 0:FFFF:FFFF:FFFF:ffff:ffff:ffff:ffff 1:0:0:0:0:0:0:F FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0:0:0:0:0:0:0:11 ); for (my $i=0; $i <@num; $i+=2) { my $bnum = ipv6_aton($num[$i]); my($carry,$rv) = addconst($bnum,$i); $rv = ipv6_n2x($rv); print "got: $rv\nexp: $num[$i +1]\nnot " unless $rv eq $num[$i +1]; &ok; } @num = qw # input expected ( FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF :: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE FFFF:: FFFE:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC FFFF:FFFF:: FFFF:FFFE:FFFF:FFFF:FFFF:FFFF:FFFF:FFFA FFFF:FFFF:FFFF:: FFFF:FFFF:FFFE:FFFF:FFFF:FFFF:FFFF:FFF8 ffff:ffff:ffff:ffff:: FFFF:FFFF:FFFF:FFFE:FFFF:FFFF:FFFF:FFF6 ffff:ffff:ffff:ffff:ffff:: FFFF:FFFF:FFFF:FFFF:FFFE:FFFF:FFFF:FFF4 ffff:ffff:ffff:ffff:ffff:ffff:: FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:FFFF:FFF2 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:FFF0 ); for (my $i=0; $i <@num; $i+=2) { my $bnum = ipv6_aton($num[$i]); my($carry,$rv) = addconst($bnum,-$i); $rv = ipv6_n2x($rv); print "got: $rv\nexp: $num[$i +1]\nnot " unless $rv eq $num[$i +1]; &ok; } Lite/Util/t/leftshift.t 0000644 00000002470 15043770025 0011004 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..9\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x shiftleft ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # input shift expected qw( 1::1 none 1:0:0:0:0:0:0:1 1::1 0 1:0:0:0:0:0:0:1 1::1 1 2:0:0:0:0:0:0:2 1::1 2 4:0:0:0:0:0:0:4 1::1 3 8:0:0:0:0:0:0:8 1::1 15 8000:0:0:0:0:0:0:8000 1::1 16 0:0:0:0:0:0:1:0 1::1 128 0:0:0:0:0:0:0:0 ); for (my $i=0;$i < @num;$i+=3) { my $bstr = ipv6_aton($num[$i]); my $rv; if ($num[$i +1] =~ /\D/) { $rv = shiftleft($bstr); } else { $rv = shiftleft($bstr,$num[$i +1]); } my $exp = $num[$i+2]; my $got = ipv6_n2x($rv); print "got: $got, exp: $exp\nnot " unless $got eq $exp; &ok; } Lite/Util/t/ipv6_any2n.t 0000644 00000002312 15043770025 0011002 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x inet_any2n ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:2A1B:3B4C 1.2.3.4 0:0:0:0:0:0:102:304 A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 A1B2:C3D4:E5D6:F7E8:8F9:190A:102:304 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = ipv6_n2x($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/croak.t 0000644 00000007032 15043770025 0010112 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..31\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( bcd2bin bin2bcd hasbits isIPv4 add128 sub128 shiftleft comp128 bcdn2txt bin2bcdn bcdn2bin simple_pack ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## tests 2 - 9 simple_pack foreach( '1234/', '1234:', 'a1234', '&1234', ) { my $rv; eval { $rv = simple_pack($_) }; if (defined $rv) { $rv = unpack("H40",$rv); print "got: $rv, exp: 'die'\nnot "; } &ok; print "expected a die from bad character input\nnot " unless $@ && $@ =~ /Bad/; &ok; } ## tests 10 - 17 bcd2bin foreach( '1234/', '1234:', 'a1234', '&1234', ) { my $rv; eval { $rv = bcd2bin($_) }; if (defined $rv) { $rv = unpack("H40",$rv); print "got: $rv, exp: 'die'\nnot "; } &ok; print "expected a die from bad character input\nnot " unless $@ && $@ =~ /Bad/; &ok; } ## test 18 bcdn2bin eval { bcdn2bin('123456789012345678901') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 19 bcdn2bin eval { bcdn2bin('12345678901234567890') }; print "expected a die from missing length specifier\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 20 bin2bcd eval { bin2bcd('123') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 21 bin2bcdn eval { bin2bcdn('123') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 22 bcdn2txt eval { bcdn2txt('123456789012345678901') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 23 bcdn2txt my $rv; my $exp = '3132333435363738393031323334353637383930'; $rv = bcdn2txt('12345678901234567890'); print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; ## test 24 hasbits eval { hasbits('123') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 25 isIPv4 eval { isIPv4('12345678901234567') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 26 add128 eval { add128('123','1234567890123456') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 27 sub128 eval { sub128('1234567890123456','12345678901234567') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 28 comp128 eval { comp128('123') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 29 shiftleft eval { shiftleft ('12345678901234567') }; print "expected a die from bad vector string length\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 30 shiftleft eval { shiftleft ('1234567890123456',-1) }; print "expected a die from bad shift count specifier\nnot " unless $@ && $@ =~ /Bad/; &ok; ## test 31 shiftleft eval { shiftleft ('1234567890123456',129) }; print "expected a die from bad shift count specifier\nnot " unless $@ && $@ =~ /Bad/; &ok; Lite/Util/t/anyto6.t 0000644 00000003742 15043770025 0010237 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..7\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( inet_aton ipv6_n2d ipv6_aton ipanyto6 maskanyto6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my $nip = inet_aton('1.2.3.4'); my $exp = '0:0:0:0:0:0:1.2.3.4'; ## test 2 check 4->6 conversion my $nipv6 = ipanyto6($nip); my $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; ## test 3 check mask4->6 extension $exp = 'FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:1.2.3.4'; $nipv6 = maskanyto6($nip); $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp && &ok; ## test 4 check bad length $nip = pack("H9",0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09); eval { ipanyto6($nip); }; print "ipanyto6 accepted bad argument length\nnot " unless $@ && $@ =~ /Bad arg.+ipanyto6/; &ok; ## test 5 check bad length eval { maskanyto6($nip); }; print "maskanyto6 accepted bad argument length\nnot " unless $@ && $@ =~ /Bad arg.+maskanyto6/; &ok; ## test 6 check pass of ipv6 addrs $nip = ipv6_aton('::1:2.3.4.5'); $exp = '0:0:0:0:0:1:2.3.4.5'; $nipv6 = ipanyto6($nip); $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; ## test 7 check pass of ipv6 addrs $nip = ipv6_aton('FFF::1:2.3.4.5'); $exp = 'FFF:0:0:0:0:1:2.3.4.5'; $nipv6 = maskanyto6($nip); $ipv6 = ipv6_n2d($nipv6); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; Lite/Util/t/bipv6_any2n.t 0000644 00000002326 15043770025 0011151 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( :upper ipv6_aton ipv6_n2x inet_any2n ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:2A1B:3B4C 1.2.3.4 0:0:0:0:0:0:102:304 A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 A1B2:C3D4:E5D6:F7E8:8F9:190A:102:304 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = ipv6_n2x($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/notcontiguous.t 0000644 00000004253 15043770025 0011735 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..49\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( inet_any2n notcontiguous ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # input expected spur qw( FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 128 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE 127 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC 126 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8 125 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0 124 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0 123 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0 122 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80 121 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00 120 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0 112 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0:0 108 0 FFeF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 128 1 FFFF:FFeF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE 127 1 FFFF:FFFF:FeFF:FFFF:FFFF:FFFF:FFFF:FFFC 126 1 FFFF:FFFF:FFFF:eFFF:FFFF:FFFF:FFFF:FFF8 125 1 FFFF:FFFF:FFFF:FFFF:FFFe:FFFF:FFFF:FFF0 124 1 FFFF:FFFF:FFF:FFFF:FFFF:FFFF:FFFF:FFE0 123 1 FFFF:FFFF:FFFF:FFFF:FFFF:FFeF:FFFF:FFC0 122 1 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FeFF:FF80 121 1 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:eF00 120 1 eFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0 112 1 FFFF:FeFF:FFFF:FFFF:FFFF:FFFF:FFF0:0 108 1 F000:: 4 0 A000:: 3 1 ); for (my $i=0;$i < @num;$i+=3) { my $bstr = inet_any2n($num[$i]); my $rv; my $xcidr = $num[$i+1]; my $xspur = $num[$i+2]; my($spur,$cidr) = notcontiguous($bstr); print "cidr: $cidr, exp: $xcidr\nnot " unless $cidr == $xcidr; &ok; $spur = 1 if $spur; print "spur: $spur, exp: $xspur\nnot " unless $spur == $xspur; &ok; } Lite/Util/t/inet_n2dx.t 0000644 00000002376 15043770025 0010713 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..6\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x inet_any2n inet_n2dx ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:2A1B:3B4C 1.2.3.4 1.2.3.4 A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 A1B2:C3D4:E5D6:F7E8:8F9:190A:102:304 ::1.2.3.4 1.2.3.4 ::FFFF:1.2.3.4 1.2.3.4 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = inet_n2dx($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/add128.t 0000644 00000006042 15043770025 0007776 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..57\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( add128 sub128 ipv6_aton ipv6_n2x comp128 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # number plus carry exp qw( FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::1 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ::1 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ::2 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE 1 0:0:0:0:0:0:0:0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::2 1 0:0:0:0:0:0:0:0 FFFF:FFFF:FFFF:FFFF:FFFF:8FFF:FFFF:FFFE ::7000:0:2 1 0:0:0:0:0:0:0:0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::3 1 0:0:0:0:0:0:0:1 ::1 ::2 0 0:0:0:0:0:0:0:3 ::FFFF ::FFFF 0 0:0:0:0:0:0:1:FFFE ::FFFF:FFFF ::FFFF:FFFF 0 0:0:0:0:0:1:FFFF:FFFE ::FFFF:FFFF:FFFF ::FFFF:FFFF:FFFF 0 0:0:0:0:1:FFFF:FFFF:FFFE ::FFFF:FFFF:FFFF:FFFF ::FFFF:FFFF:FFFF:FFFF 0 0:0:0:1:FFFF:FFFF:FFFF:FFFE ::FFFF:FFFF:FFFF:FFFF:FFFF ::FFFF:FFFF:FFFF:FFFF:FFFF 0 0:0:1:FFFF:FFFF:FFFF:FFFF:FFFE ::FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ::FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0 0:1:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ::FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0 1:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ); ## test 2 - 15 check carry for (my $i=0; $i<@num; $i+=4) { my $num = ipv6_aton($num[$i]); my $plus = ipv6_aton($num[$i +1]); my $rv = add128($num,$plus); print "got: $rv, exp: $num[$i +2]\nnot " unless $rv == $num[$i +2]; &ok; } ## test 16 - 43 check carry + result for (my $i=0; $i<@num; $i+=4) { my $num = ipv6_aton($num[$i]); my $plus = ipv6_aton($num[$i +1]); my($rv,$result) = add128($num,$plus); print "got: $rv, exp: $num[$i +2]\nnot " unless $rv == $num[$i +2]; &ok; $result = ipv6_n2x($result); print "got: $result\nexp: $num[$i +3]\nnot " unless $result eq $num[$i +3]; &ok; } ## test 44 - 57 the subtraction of the comp of the 'plus' category ## should invert the carry and add 1 to 'exp' ## start test at first 'number' that starts with '::FFFF' for (my $i=0; $i<@num; $i+=4) { next unless $num[$i] =~ /^::FFFF/; my $num = ipv6_aton($num[$i]); my $plus = ipv6_aton($num[$i +1]); my $minus = comp128($plus); my($rv,$result) = sub128($num,$minus); print "got: $rv, exp: $num[$i +2]\nnot " unless $rv == $num[$i +2]; &ok; $num[$i +3] =~ s/FFFE$/FFFF/; $result = ipv6_n2x($result); print "got: $result\nexp: $num[$i +3]\nnot " unless $result eq $num[$i +3]; &ok; } Lite/Util/t/af_inet6.t 0000644 00000002272 15043770025 0010507 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..3\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use Config; use NetAddr::IP::InetBase qw( AF_INET AF_INET6 fake_AF_INET6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 - 13 add stuff to buffer my $af; print "AF_INET = 2 not found in the Socket library\nnot " unless ($af = AF_INET()) && $af == 2; &ok; my $fake = fake_AF_INET6(); my $af_inet6 = AF_INET6(); my $txt = $fake ? "\n\tSocket does not have AF_INET6, Socket6 not present\n\tguessed AF_INET6 for '$Config{osname}' = $fake\n" : "\n\tAF_INET6 = $af_inet6 derived from Socket or Socket6\n"; print STDERR $txt; &ok; Lite/Util/t/inet_4map6.t 0000644 00000003020 15043770025 0010752 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) $| = 1; END {print "1..1\nnot ok 1\n" unless $test;} #use diagnostics; use NetAddr::IP::Util qw( ipv6_n2d inet_aton ipv6_aton inet_4map6 ); $test = 1; sub ok { print "ok $test\n"; ++$test; } # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): print "1..6\n"; my @stuff = qw( 192.168.1.1 1.2.3.4 ::3.4.5.6 ::FFFF:4.5.6.7 ::1:5.4.3.2 ::FEFF:4.3.2.1 ); my $p4 = '0:0:0:0:0:FFFF:'; my $p6 = '0:0:0:0:0:'; foreach(0..$#stuff) { my $pass = 1; my $result; my $bstr; $pass = 0 if $_ > 3; if ($stuff[$_] =~ /\:/) { $bstr = ipv6_aton($stuff[$_]); my $prefix = ($stuff[$_] =~ /^\:\:F/) ? $p6 : $p4; ($result = $stuff[$_]) =~ s/\:\:/$prefix/; } else { $bstr = inet_aton($stuff[$_]); $result = $p4 . $stuff[$_]; } my $rv = inet_4map6($bstr); if ($pass && ! $rv) { print "failed to return valid address\nnot "; } elsif ($pass) { $rv = ipv6_n2d($rv); print "got: $rv, exp: $result\nnot " unless $rv eq $result; } else { print 'unknown return ', ipv6_n2d($rv), "\nnot " if $rv; } &ok; } Lite/Util/t/mode.t 0000644 00000001367 15043770025 0007744 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..2\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( mode ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): my $mode = mode(); my $txt = "\tmode $mode"; print STDERR $txt,"\n"; print "ok 2\n"; Lite/Util/t/ipv6_ntoa.t 0000644 00000003115 15043770025 0010716 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..20\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::Util qw( ipv6_ntoa inet_pton AF_INET6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 - 19 add stuff to buffer my @num = # in exphex qw( :: :: 43:: 43:: ::21 ::21 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1::8 1::8 FF00::FFFF ff00::ffff FFFF::FFFF:FFFF ffff::ffff:ffff A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 a1b2:c3d4:e5d6:f7e8:8f9:190a:102:304 ); for (my $i=0;$i<@num;$i+=2) { my $bits = inet_pton(AF_INET6(),$num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = ipv6_ntoa($bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; } ## test 32 check bad length ntop my $try = '1234'; my $notempty = eval { ipv6_ntoa($try); }; print "failed bad argument length test for ipv6_ntoa\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/bcd2bin.t 0000644 00000003631 15043770025 0010317 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..25\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( bcd2bin ipv6_n2x ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # input expected qw( 0 0:0:0:0:0:0:0:0 2147483648 0:0:0:0:0:0:8000:0 4294967296 0:0:0:0:0:1:0:0 8589934592 0:0:0:0:0:2:0:0 10000000000 0:0:0:0:0:2:540B:E400 17179869184 0:0:0:0:0:4:0:0 34359738368 0:0:0:0:0:8:0:0 68719476736 0:0:0:0:0:10:0:0 137438953472 0:0:0:0:0:20:0:0 274877906944 0:0:0:0:0:40:0:0 549755813888 0:0:0:0:0:80:0:0 1099511627776 0:0:0:0:0:100:0:0 2199023255552 0:0:0:0:0:200:0:0 4398046511104 0:0:0:0:0:400:0:0 8796093022208 0:0:0:0:0:800:0:0 17592186044416 0:0:0:0:0:1000:0:0 35184372088832 0:0:0:0:0:2000:0:0 70368744177664 0:0:0:0:0:4000:0:0 140737488355328 0:0:0:0:0:8000:0:0 9223372036854775808 0:0:0:0:8000:0:0:0 604462909807314587353088 0:0:0:8000:0:0:0:0 39614081257132168796771975168 0:0:8000:0:0:0:0:0 2596148429267413814265248164610048 0:8000:0:0:0:0:0:0 170141183460469231731687303715884105728 8000:0:0:0:0:0:0:0 ); ## tests 2 - 9 check pack correct for (my $i=0;$i<@num;$i+=2) { print $num[$i],"\n"; my $bits = bcd2bin($num[$i]); my $ip = ipv6_n2x($bits); print "got: $ip\nexp: $num[$i +1]\nnot " unless $ip eq $num[$i +1]; &ok; } Lite/Util/t/bipv6func.t 0000644 00000003747 15043770025 0010726 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..27\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( :upper ipv6_aton ipv6_n2x ipv6_n2d ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # in exphex expd qw( :: 0:0:0:0:0:0:0:0 0:0:0:0:0:0:0.0.0.0 43:: 43:0:0:0:0:0:0:0 43:0:0:0:0:0:0.0.0.0 ::21 0:0:0:0:0:0:0:21 0:0:0:0:0:0:0.0.0.33 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 0:1:2:3:4:5:0.6.0.7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1:2:3:4:5:6:0.7.0.0 1::8 1:0:0:0:0:0:0:8 1:0:0:0:0:0:0.0.0.8 FF00::FFFF FF00:0:0:0:0:0:0:FFFF FF00:0:0:0:0:0:0.0.255.255 FFFF::FFFF:FFFF FFFF:0:0:0:0:0:FFFF:FFFF FFFF:0:0:0:0:0:255.255.255.255 ); for (my $i=0;$i<@num;$i+=3) { my $bits = ipv6_aton($num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = ipv6_n2x($bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; my $ipv6d = ipv6_n2d($bits); print "got: $ipv6d\nexp: $num[$i +2]\nnot " unless $ipv6d eq $num[$i +2]; &ok; } ## test 26 check bad length n2x my $try = '1234'; my $notempty = eval { ipv6_n2x($try); }; print "failed bad argument length test for ipv6_n2x\nnot " unless $@ && $@ =~ /Bad arg/; &ok; ## test 27 check bad length n2d $notempty = eval { ipv6_n2d($try); }; print "failed bad argument length test for ipv6_n2d\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/binet_n2ad.t 0000644 00000002267 15043770025 0011025 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( :upper ipv6_aton ipv6_n2x inet_any2n inet_n2ad ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:42.27.59.76 1.2.3.4 1.2.3.4 190A::102:304 190A:0:0:0:0:0:1.2.3.4 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = inet_n2ad($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/naip_gethostbyname.t 0000644 00000002647 15043770025 0012702 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..3\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::Util qw( naip_gethostbyname havegethostbyname2 ipv6_n2x inet_aton ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my $exp = '0:0:0:0:0:FFFF:7F00:1'; my $host = '127.1'; my $got = ipv6_n2x( scalar naip_gethostbyname($host)); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; &ok; $exp = '0:0:0:0:0:0:0:1'; $host = $exp; if (havegethostbyname2()) { $got = ipv6_n2x(scalar naip_gethostbyname($host)); print "got: $got\nexp: $exp\nnot " unless $got eq $exp; } else { print STDERR "\n\tgethostbyname2 missing from Socket6\n" if eval{ require Socket6 }; $got = scalar naip_gethostbyname($host); if ($got) { $got = eval{ inet_ntoa($got) } || eval{ ipv6_n2x($got) }; } print "unexpected return value got: $got\nnot " if $got; } &ok; Lite/Util/t/inet_pton.t 0000644 00000004132 15043770025 0011010 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..32\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::Util qw( inet_ntop inet_pton AF_INET AF_INET6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 - 13 add stuff to buffer my @num = # addr qw( 0.0.0.0 255.255.255.255 1.2.3.4 10.253.230.9 ); foreach (@num) { my @digs = split(/\./,$_); my $pkd = pack('C4',@digs); my $naddr = inet_pton(AF_INET(),$_); my $addr = join('.',unpack('C4',$naddr)); my $num = inet_ntop(AF_INET(),$pkd); print "bits do not match\nnot " unless $naddr eq $pkd; &ok; print "inet_pton: $addr, exp: $_\nnot " unless $addr eq $_; &ok; print "inet_ntop: $num, exp: $_\nnot " unless $num eq $_; &ok; } ## test 14 - 31 @num = # in exphex qw( :: :: 43:: 43:: ::21 ::21 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1::8 1::8 FF00::FFFF ff00::ffff FFFF::FFFF:FFFF ffff::ffff:ffff A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 a1b2:c3d4:e5d6:f7e8:8f9:190a:102:304 ); for (my $i=0;$i<@num;$i+=2) { my $bits = inet_pton(AF_INET6(),$num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = inet_ntop(AF_INET6(),$bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; } ## test 32 check bad length ntop my $try = '1234'; my $notempty = eval { inet_ntop(AF_INET6(),$try); }; print "failed bad argument length test for inet_ntop\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/bcdn2bin.t 0000644 00000004002 15043770025 0010466 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..25\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_n2x bcdn2bin ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # input expected qw( 0 0:0:0:0:0:0:0:0 2147483648 0:0:0:0:0:0:8000:0 4294967296 0:0:0:0:0:1:0:0 8589934592 0:0:0:0:0:2:0:0 10000000000 0:0:0:0:0:2:540B:E400 17179869184 0:0:0:0:0:4:0:0 34359738368 0:0:0:0:0:8:0:0 68719476736 0:0:0:0:0:10:0:0 137438953472 0:0:0:0:0:20:0:0 274877906944 0:0:0:0:0:40:0:0 549755813888 0:0:0:0:0:80:0:0 1099511627776 0:0:0:0:0:100:0:0 2199023255552 0:0:0:0:0:200:0:0 4398046511104 0:0:0:0:0:400:0:0 8796093022208 0:0:0:0:0:800:0:0 17592186044416 0:0:0:0:0:1000:0:0 35184372088832 0:0:0:0:0:2000:0:0 70368744177664 0:0:0:0:0:4000:0:0 140737488355328 0:0:0:0:0:8000:0:0 9223372036854775808 0:0:0:0:8000:0:0:0 604462909807314587353088 0:0:0:8000:0:0:0:0 39614081257132168796771975168 0:0:8000:0:0:0:0:0 2596148429267413814265248164610048 0:8000:0:0:0:0:0:0 170141183460469231731687303715884105728 8000:0:0:0:0:0:0:0 ); ## tests 2 - 9 check pack correct #use Devel::Peek 'Dump'; for (my $i=0;$i<@num;$i+=2) { print $num[$i],"\n"; my $pkd = pack("H*",$num[$i]); my $len = length($num[$i]); #Dump($pkd); my $bits = bcdn2bin($pkd,$len); my $ip = ipv6_n2x($bits); print "got: $ip\nexp: $num[$i +1]\nnot " unless $ip eq $num[$i +1]; &ok; } Lite/Util/t/ipv6func.t 0000644 00000003733 15043770025 0010557 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..27\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x ipv6_n2d ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # in exphex expd qw( :: 0:0:0:0:0:0:0:0 0:0:0:0:0:0:0.0.0.0 43:: 43:0:0:0:0:0:0:0 43:0:0:0:0:0:0.0.0.0 ::21 0:0:0:0:0:0:0:21 0:0:0:0:0:0:0.0.0.33 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 0:1:2:3:4:5:0.6.0.7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1:2:3:4:5:6:0.7.0.0 1::8 1:0:0:0:0:0:0:8 1:0:0:0:0:0:0.0.0.8 FF00::FFFF FF00:0:0:0:0:0:0:FFFF FF00:0:0:0:0:0:0.0.255.255 FFFF::FFFF:FFFF FFFF:0:0:0:0:0:FFFF:FFFF FFFF:0:0:0:0:0:255.255.255.255 ); for (my $i=0;$i<@num;$i+=3) { my $bits = ipv6_aton($num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = ipv6_n2x($bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; my $ipv6d = ipv6_n2d($bits); print "got: $ipv6d\nexp: $num[$i +2]\nnot " unless $ipv6d eq $num[$i +2]; &ok; } ## test 26 check bad length n2x my $try = '1234'; my $notempty = eval { ipv6_n2x($try); }; print "failed bad argument length test for ipv6_n2x\nnot " unless $@ && $@ =~ /Bad arg/; &ok; ## test 27 check bad length n2d $notempty = eval { ipv6_n2d($try); }; print "failed bad argument length test for ipv6_n2d\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/badd.t 0000644 00000003141 15043770025 0007702 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) $| = 1; END {print "1..1\nnot ok 1\n" unless $test;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x ); $test = 1; sub ok { print "ok $test\n"; ++$test; } my @addr = qw( :: 0:0:0:0:0:0:0:0 ::: undef foo undef ::foo undef foo:: undef abc::def::9 undef abcd1:: undef abcd:: abcd:0:0:0:0:0:0:0 ::abcde undef :a:b:c:d:1:2:3:4 undef :a:b:c:d undef a:b:c:d:1:2:3:4: undef a:b:c:d:1:2:3:4:: undef ::a:b:c:d:1:2:3:4 undef ::a:b:c:d:1:2:3 0:a:b:c:d:1:2:3 ::a:b:c:d:1:2:3: undef :a:b:c:d:1:2:3:: undef a:b:c:d:1:2:3:: a:b:c:d:1:2:3:0 ); my $x = @addr/2; # notify TEST about number of tests # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): print '1..',$x,"\n"; for ($x = 0;$x <= $#addr; $x+=2) { my $bstr = ipv6_aton($addr[$x]); if ($addr[$x +1] =~ /undef/) { print "unexpected return value for $addr[$x]: $_\nnot " if ($_ = ipv6_aton && (ipv6_n2x($_) || 'not defined')); } else { my $rv = ipv6_aton($addr[$x]); unless ($rv) { print "got undefined value for $addr[$x]\nnot "; } else { $rv = ipv6_n2x($rv) || 'not defined'; print "got: $rv, exp: $addr[$x +1]\nnot " unless $rv eq uc $addr[$x +1]; } } &ok; } Lite/Util/t/ipv4_inet.t 0000644 00000002350 15043770025 0010712 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..13\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::Util qw( inet_ntoa inet_aton ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 add stuff to buffer my @num = # addr qw( 0.0.0.0 255.255.255.255 1.2.3.4 10.253.230.9 ); foreach (@num) { my @digs = split(/\./,$_); my $pkd = pack('C4',@digs); my $naddr = inet_aton($_); my $addr = join('.',unpack('C4',$naddr)); my $num = inet_ntoa($pkd); print "bits do not match\nnot " unless $naddr eq $pkd; &ok; print "inet_aton: $addr, exp: $_\nnot " unless $addr eq $_; &ok; print "inet_ntoa: $num, exp: $_\nnot " unless $num eq $_; &ok; } Lite/Util/t/sub128.t 0000644 00000003752 15043770025 0010044 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..34\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( sub128 ipv6_aton ipv6_n2x ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = # number minus carry (not borrow) exp qw( ::f712:fff:fffe ::f712:fff:fffc 1 0:0:0:0:0:0:0:2 ::712:fff:fffe ::712:fff:fffc 1 0:0:0:0:0:0:0:2 ::712:ffff:fffe ::712:ffff:fffc 1 0:0:0:0:0:0:0:2 ::f712:ffff:fffa ::f712:ffff:fffc 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::f712:fff:fffa ::f712:fff:fffc 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::712:fff:fffa ::712:fff:fffc 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::712:ffff:fffa ::712:ffff:fffc 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::2 ::1 1 0:0:0:0:0:0:0:1 ::f712:ffff:fffe ::f712:ffff:fffc 1 0:0:0:0:0:0:0:2 ::1 ::3 0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE ::1234 ::1234 1 0:0:0:0:0:0:0:0 ); ## test 2 check comp of zero for (my $i=0; $i<@num; $i+=4) { my $num = ipv6_aton($num[$i]); my $minus = ipv6_aton($num[$i +1]); my $rv = sub128($num,$minus); print "got: $rv, exp: $num[$i +2]\nnot " unless $rv == $num[$i +2]; &ok; } for (my $i=0; $i<@num; $i+=4) { my $num = ipv6_aton($num[$i]); my $minus = ipv6_aton($num[$i +1]); my($rv,$dif) = sub128($num,$minus); print "got: $rv, exp: $num[$i +2]\nnot " unless $rv == $num[$i +2]; &ok; $dif = ipv6_n2x($dif); print "got: $dif\nexp: $num[$i +3]\nnot " unless $dif eq $num[$i +3]; &ok; } Lite/Util/t/comp128.t 0000644 00000002341 15043770025 0010202 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( ipv6_aton ipv6_n2x comp128 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( :: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0:0:0:0:0:0:0:0 A1B2:C3D4:E5D6:F7E8:08F9:190A:2A1B:3B4C 5E4D:3C2B:1A29:817:F706:E6F5:D5E4:C4B3 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = ipv6_aton($num); my $cnum = comp128($bstr); my $rv = ipv6_n2x($cnum); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/bipv4_inet.t 0000644 00000002354 15043770025 0011060 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..13\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::InetBase qw( inet_ntoa inet_aton ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 add stuff to buffer my @num = # addr qw( 0.0.0.0 255.255.255.255 1.2.3.4 10.253.230.9 ); foreach (@num) { my @digs = split(/\./,$_); my $pkd = pack('C4',@digs); my $naddr = inet_aton($_); my $addr = join('.',unpack('C4',$naddr)); my $num = inet_ntoa($pkd); print "bits do not match\nnot " unless $naddr eq $pkd; &ok; print "inet_aton: $addr, exp: $_\nnot " unless $addr eq $_; &ok; print "inet_ntoa: $num, exp: $_\nnot " unless $num eq $_; &ok; } Lite/Util/t/binet_n2dx.t 0000644 00000002377 15043770025 0011056 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..6\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( :upper ipv6_aton inet_any2n inet_n2dx ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @num = qw # input expected ( a1b2:c3d4:e5d6:f7e8:08f9:190a:2a1b:3b4c A1B2:C3D4:E5D6:F7E8:8F9:190A:2A1B:3B4C 1.2.3.4 1.2.3.4 A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 A1B2:C3D4:E5D6:F7E8:8F9:190A:102:304 ::1.2.3.4 1.2.3.4 ::FFFF:1.2.3.4 1.2.3.4 ); my $ff = ipv6_aton($num[1]); for(my $i=0;$i<@num;$i+=2) { my $num = $num[$i]; my $bstr = inet_any2n($num); my $rv = inet_n2dx($bstr); my $exp = $num[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/binet_ntoa.t 0000644 00000003121 15043770025 0011130 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..20\n"; } END {print "not ok 1\n" unless $loaded;} #use diagnostics; use NetAddr::IP::InetBase qw( ipv6_ntoa inet_pton AF_INET6 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } ## test 2 - 19 add stuff to buffer my @num = # in exphex qw( :: :: 43:: 43:: ::21 ::21 ::1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:0 1::8 1::8 FF00::FFFF ff00::ffff FFFF::FFFF:FFFF ffff::ffff:ffff A1B2:C3D4:E5D6:F7E8:08F9:190A:1.2.3.4 a1b2:c3d4:e5d6:f7e8:8f9:190a:102:304 ); for (my $i=0;$i<@num;$i+=2) { my $bits = inet_pton(AF_INET6(),$num[$i]); my $len = length($bits); print "bad len = $len, exp: 16\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = ipv6_ntoa($bits); print "got: $ipv6x\nexp: $num[$i +1]\nnot " unless $ipv6x eq $num[$i +1]; &ok; } ## test 32 check bad length ntop my $try = '1234'; my $notempty = eval { ipv6_ntoa($try); }; print "failed bad argument length test for ipv6_ntoa\nnot " unless $@ && $@ =~ /Bad arg/; &ok; Lite/Util/t/ipv6to4.t 0000644 00000002460 15043770025 0010326 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..4\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( inet_ntoa inet_any2n ipv6_n2d ipv6to4 ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my $nip = inet_any2n('1.2.3.4'); my $exp = '0:0:0:0:0:0:1.2.3.4'; ## test 2 check that we have an ipv6 netaddr my $ipv6 = ipv6_n2d($nip); print "got: $ipv6\nexp: $exp\nnot " unless $ipv6 eq $exp; &ok; ## test 3 check conversion back to ipv4 $exp = '1.2.3.4'; print "got: $_, exp: $exp\nnot " unless inet_ntoa(ipv6to4($nip)) eq $exp; &ok; ## test 4 check bad length $nip = pack("H9",0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09); eval { ipv6to4($nip); }; print "ipv6to4 accepted bad argument length\nnot " unless $@ && $@ =~ /Bad arg.+ipv6to4/; &ok; Lite/Util/t/bpackzeros.t 0000644 00000002555 15043770025 0011163 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..13\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::InetBase qw( packzeros ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @addr = qw # input expected ( D0:00:0000:0000:000:b00:0000:000 d0::b00:0:0 0d0:00:0000:0000:000:0b00:: d0::b00:0:0 ::c3D4:E5d6:0:0:0:0 0:0:c3d4:e5d6:: 0:0000:c3D4:e5d6:0:0:0:0 0:0:c3d4:e5d6:: 0:0:0:0:0:0:0:0 :: 0:0:: :: ::0:000:0 :: 0:0::1.2.3.4 ::1.2.3.4 ::1.2.3.4 ::1.2.3.4 ::01b2:c3D4:0:0:0:1.2.3.4 0:1b2:c3d4::1.2.3.4 0:0:0:0:a1B2:c3d4:: ::a1b2:c3d4:0:0 12:0:0:0:34:0:00:000 12::34:0:0:0 ); for(my $i=0;$i<@addr;$i+=2) { my $addr = $addr[$i]; my $rv = packzeros($addr); my $exp = $addr[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/t/packzeros.t 0000644 00000002556 15043770025 0011022 0 ustar 00 # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN { $| = 1; print "1..13\n"; } END {print "not ok 1\n" unless $loaded;} use NetAddr::IP::Util qw( packzeros ); $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): $test = 2; sub ok { print "ok $test\n"; ++$test; } my @addr = qw # input expected ( D0:00:0000:0000:000:b00:0000:000 d0::b00:0:0 0d0:00:0000:0000:000:0B00:: d0::b00:0:0 ::c3D4:e5d6:0:0:0:0 0:0:c3d4:e5d6:: 0:0000:c3D4:e5d6:0:0:0:0 0:0:c3d4:e5d6:: 0:0:0:0:0:0:0:0 :: 0:0:: :: ::0:000:0 :: 0:0::1.2.3.4 ::1.2.3.4 ::1.2.3.4 ::1.2.3.4 ::01b2:C3d4:0:0:0:1.2.3.4 0:1b2:c3d4::1.2.3.4 0:0:0:0:a1b2:c3D4:: ::a1b2:c3d4:0:0 12:0:0:0:34:0:00:000 12::34:0:0:0 ); for(my $i=0;$i<@addr;$i+=2) { my $addr = $addr[$i]; my $rv = packzeros($addr); my $exp = lc $addr[$i +1]; print "got: $rv\nexp: $exp\nnot " unless $rv eq $exp; &ok; } Lite/Util/Util.c 0000644 00000065156 15043770025 0007457 0 ustar 00 /* * This file was generated automatically by ExtUtils::ParseXS version 3.40 from the * contents of Util.xs. Do not edit this file, edit Util.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "Util.xs" /* * Copyright 2006 - 2012, Michael Robinton <michael@bizsystems.com> * * 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. */ #ifdef __cplusplus extern "C" { #endif #ifdef _CYGWIN #include <windows.h> #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" /* needed for testing with 'printf' #include <stdio.h> */ #ifdef _CYGWIN #include <Win32-Extensions.h> #endif #include "localconf.h" #ifdef __cplusplus } #endif /* workaround for OS's without inet_aton */ /* #include "xs_include/inet_aton.c" removed 10-12-11 */ typedef union { u_int32_t u[4]; unsigned char c[16]; } n128; char * is_ipv6to4 = "ipv6to4", * is_shiftleft = "shiftleft", * is_comp128 = "comp128"; char * is_sub128 = "sub128", * is_add128 = "add128"; char * is_hasbits = "hasbits"; /* , * is_isIPv4 = "isIPv4"; */ char * is_bcd2bin = "bcd2bin", * is_simple_pack = "simple_pack", * is_bcdn2bin = "bcdn2bin"; char * is_mask4to6 = "mask4to6", * is_ipv4to6 = "ipv4to6"; char * is_maskanyto6 = "maskanyto6", * is_ipanyto6 = "ipanyto6"; typedef struct bcdstuff { /* character array of 40 bytes */ char txt[21]; /* 20 bytes + string terminator */ u_int32_t bcd[5]; /* 20 bytes, 40 digits */ } BCD; #define zero ('0' & 0x7f) /* useful for debug, prints the 128 bits of 8, 16 bit registers */ void printb128(char * b) { int c; for(c=0;c<16;c++) { if (b[c] &0x80) printf("1"); else printf("0"); if (b[c] &0x40) printf("1"); else printf("0"); if (b[c] &0x20) printf("1"); else printf("0"); if (b[c] &0x10) printf("1"); else printf("0"); if (b[c] &0x8) printf("1"); else printf("0"); if (b[c] &0x4) printf("1"); else printf("0"); if (b[c] &0x2) printf("1"); else printf("0"); if (b[c] &0x1) printf("1"); else printf("0"); if (c == 3 || c == 7 || c == 11) printf("\n"); } printf("\n\n"); } void extendipv4(void * aa, void * ux) { register u_int32_t * a = ux; *a++ = 0; *a++ = 0; *a++ = 0; *a = *((u_int32_t *)aa); } void extendmask4(void * aa, void * ux) { register u_int32_t * a = ux; *a++ = 0xffffffff; *a++ = 0xffffffff; *a++ = 0xffffffff; *a = *((u_int32_t *)aa); } void fastcomp128(void * aa) { register u_int32_t * a = aa; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; *a++ ^= 0xffffffff; } /* add two 128 bit numbers return the carry */ int adder128(void * aa, void * bb, n128 * ap128, int carry) { int i; register u_int32_t a, b, r; for (i=3; i >= 0; i--) { a = *((u_int32_t *)aa + i); b = *((u_int32_t *)bb + i); r = a + b; a = 0; /* ripple carry forward */ if ( r < a || r < b) /* if overflow */ a = 1; b = r + carry; /* carry propagate in */ if (b < r) /* ripple carry forward */ carry = 1; /* if overflow */ else carry = a; *((u_int32_t *)(ap128->u) + i) = b; } return carry; } int addercon(void * aa, u_int32_t * bb, n128 * ap128, int32_t con) { register u_int32_t tmp = 0x80000000; if (con & tmp) tmp = 0xffffffff; else tmp = 0; bb[0] = tmp; bb[1] = tmp; bb[2] = tmp; bb[3] = (u_int32_t)con; return adder128(aa,bb,ap128,0); } int have128(void * bp) { register u_int32_t * p = bp; if (*p++ || *p++ || *p++ || *p++) return 1; return 0; } int _isipv4(void * bp) { register u_int32_t * p = bp; if (*p++ || *p++ || *p++) return 0; return 1; } /* network byte swap and copy */ void netswap_copy(void * dest, void * src, int len) { register u_int32_t * d = dest, * s = src; for (/* -- */;len>0;len--) { #ifdef host_is_LITTLE_ENDIAN *d++ = (((*s & 0xff000000) >> 24) | ((*s & 0x00ff0000) >> 8) | \ ((*s & 0x0000ff00) << 8) | ((*s & 0x000000ff) << 24)); #else # ifdef host_is_BIG_ENDIAN *d++ = *s; # else # error ENDIANness not defined # endif #endif s++; } } /* do ntohl / htonl changes as necessary for this OS */ void netswap(void * ap, int len) { #ifdef host_is_LITTLE_ENDIAN register u_int32_t * a = ap; for (/* -- */;len >0;len--) { *a = (((*a & 0xff000000) >> 24) | ((*a & 0x00ff0000) >> 8) | \ ((*a & 0x0000ff00) << 8) | ((*a & 0x000000ff) << 24)); a++; } #endif } /* shift right to purge '0's, return mask bit count and remainder value, left fill with ones */ unsigned char _countbits(void *ap) { register u_int32_t * p0 = (u_int32_t *)ap, * p1 = p0 +1, * p2 = p1 +1, * p3 = p2 +1; unsigned char count = 128; fastcomp128(ap); do { if (!(*p3 & 1)) break; count--; *p3 >>= 1; if (*p2 & 1) *p3 |= 0x80000000; *p2 >>= 1; if (*p1 & 1) *p2 |= 0x80000000; *p1 >>= 1; if (*p0 & 1) *p1 |= 0x80000000; *p0 >>= 1; } while (count > 0); return count; } /* multiply 128 bit number x 2 */ void _128x2(u_int32_t * ap) { register u_int32_t * p = ap +3, tmpc, carry = 0; do { tmpc = *p & 0x80000000; /* propagate hi bit to next word */ *p <<= 1; if (carry) *p += 1; carry = tmpc; } while (p-- > ap); /* printf("2o %04X:%04X:%04X:%04X\n",*(ap),*(ap +1),*(ap +2),*(ap +3)); */ } /* multiply 128 bit number X10 */ void _128x10(n128 * ap128, n128 * tp128) { register u_int32_t * ap = ap128->u, * tp = tp128->u; _128x2(ap); /* multiply by two */ *tp = *ap; /* temp save */ *(tp +1) = *(ap +1); *(tp +2) = *(ap +2); *(tp +3) = *(ap +3); _128x2(ap); _128x2(ap); /* times 8 */ (void) adder128(ap,tp,ap128,0); /* printf("x %04X:%04X:%04X:%04X\n",*((u_int32_t *)ap),*((u_int32_t *)ap +1),*((u_int32_t *)ap +2),*((u_int32_t *)ap +3)); */ } /* multiply 128 bit number by 10, add bcd digit to result */ void _128x10plusbcd(n128 * ap128, n128 * tp128, char digit) { register u_int32_t * ap = ap128->u, * tp = tp128->u; /* printf("digit %X + %X = ",digit,*(ap +3)); */ _128x10(ap128,tp128); *tp = 0; *(tp + 1) = 0; *(tp + 2) = 0; *(tp + 3) = digit; (void) adder128(ap,tp,ap128,0); /* printf("%d %04X:%04X:%04X:%04X\n",digit,*((u_int32_t *)ap),*((u_int32_t *)ap +1),*((u_int32_t *)ap +2),*((u_int32_t *)ap +3)); */ } char _simple_pack(void * str,int len, BCD * n) { int i = len -1, j=19, lo=1; register unsigned char c, * bcdn = (unsigned char *)(n->bcd), * sp = (unsigned char *) str; if (len > 40) return '*'; /* error, input string too long */ memset (bcdn, 0, 20); do { c = *(sp + i) & 0x7f; if (c < zero || c > (zero + 9)) return c; /* error, out of range */ if (lo) { /* lo byte ? */ *(bcdn + j) = c & 0xF; lo = 0; } else { c <<= 4; *(bcdn + j) |= c; lo = 1; /* lo byte next */ j--; } } while (i-- > 0); return 0; } /* convert a packed bcd string to 128 bit binary string */ void _bcdn2bin(void * bp, n128 * ap128, n128 * cp128, int len) { int i = 0, hasdigits = 0, lo; register unsigned char c, * cp = (unsigned char *)bp; memset(ap128->c, 0, 16); memset(cp128->c, 0, 16); while (i < len ) { c = *cp++; for (lo=0;lo<2;lo+=1) { if (lo) { if (hasdigits) /* suppress leading zero multiplications */ _128x10plusbcd(ap128, cp128, c & 0xF); else { if (c & 0xF) { hasdigits = 1; ap128->u[3] = c & 0xF; } } } else { if (hasdigits) /* suppress leading zero multiplications */ _128x10plusbcd(ap128, cp128, c >> 4); else { if (c & 0XF0) { hasdigits = 1; ap128->u[3] = c >> 4; } } } i++; if (i >= len) break; } } } /* convert a 128 bit number string to a bcd number string returns the length of the bcd string === 20 */ int _bin2bcd (unsigned char * binary, BCD * n) { register u_int32_t tmp, add3, msk8, bcd8, carry = 0; u_int32_t word; unsigned char binmsk = 0; int c = 0,i, j, p; memset (n->bcd, 0, 20); for (p=0;p<128;p++) { /* bit pointer */ if (! binmsk) { word = *((unsigned char *)binary + c); binmsk = 0x80; c++; } carry = word & binmsk; /* bit to convert */ binmsk >>= 1; for (i=4;i>=0;i--) { bcd8 = n->bcd[i]; if (carry | bcd8) { /* if something to do */ add3 = 3; msk8 = 8; for (j=0;j<8;j++) { /* prep bcd digits for X2 */ tmp = bcd8 + add3; if (tmp & msk8) bcd8 = tmp; add3 <<= 4; msk8 <<= 4; } tmp = bcd8 & 0x80000000; /* propagated carry */ bcd8 <<= 1; /* x 2 */ if (carry) bcd8 += 1; n->bcd[i] = bcd8; carry = tmp; } } } netswap(n->bcd,5); return 20; } /* convert a bcd number string to a bcd text string returns the number of digits */ int _bcd2txt(unsigned char * bcd2p, BCD * n) { register unsigned char bcd, dchar; int i, j = 0; for (i=0;i<20;i++) { dchar = *(bcd2p + i); bcd = dchar >> 4; if (j || bcd) { n->txt[j] = bcd + zero; j++; } bcd = dchar & 0xF; if (j || bcd || i == 19) { /* must be at least one digit */ n->txt[j] = bcd + zero; j++; } } n->txt[j] = 0; /* string terminator */ return j; } /* INCLUDE: xs_include/miniSocket.inc removed 10-12-11 */ #line 486 "Util.c" #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #ifndef dVAR # define dVAR dNOOP #endif /* This stuff is not part of the API! You have been warned. */ #ifndef PERL_VERSION_DECIMAL # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s) #endif #ifndef PERL_DECIMAL_VERSION # define PERL_DECIMAL_VERSION \ PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION) #endif #ifndef PERL_VERSION_GE # define PERL_VERSION_GE(r,v,s) \ (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s)) #endif #ifndef PERL_VERSION_LE # define PERL_VERSION_LE(r,v,s) \ (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s)) #endif /* XS_INTERNAL is the explicit static-linkage variant of the default * XS macro. * * XS_EXTERNAL is the same as XS_INTERNAL except it does not include * "STATIC", ie. it exports XSUB symbols. You probably don't want that * for anything but the BOOT XSUB. * * See XSUB.h in core! */ /* TODO: This might be compatible further back than 5.10.0. */ #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1) # undef XS_EXTERNAL # undef XS_INTERNAL # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name) # define XS_INTERNAL(name) STATIC XSPROTO(name) # endif # if defined(__SYMBIAN32__) # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name) # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name) # endif # ifndef XS_EXTERNAL # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus) # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__) # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__) # else # ifdef __cplusplus # define XS_EXTERNAL(name) extern "C" XSPROTO(name) # define XS_INTERNAL(name) static XSPROTO(name) # else # define XS_EXTERNAL(name) XSPROTO(name) # define XS_INTERNAL(name) STATIC XSPROTO(name) # endif # endif # endif #endif /* perl >= 5.10.0 && perl <= 5.15.1 */ /* The XS_EXTERNAL macro is used for functions that must not be static * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL * macro defined, the best we can do is assume XS is the same. * Dito for XS_INTERNAL. */ #ifndef XS_EXTERNAL # define XS_EXTERNAL(name) XS(name) #endif #ifndef XS_INTERNAL # define XS_INTERNAL(name) XS(name) #endif /* Now, finally, after all this mess, we want an ExtUtils::ParseXS * internal macro that we're free to redefine for varying linkage due * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to! */ #undef XS_EUPXS #if defined(PERL_EUPXS_ALWAYS_EXPORT) # define XS_EUPXS(name) XS_EXTERNAL(name) #else /* default to internal */ # define XS_EUPXS(name) XS_INTERNAL(name) #endif #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) /* prototype to pass -Wmissing-prototypes */ STATIC void S_croak_xs_usage(const CV *const cv, const char *const params); STATIC void S_croak_xs_usage(const CV *const cv, const char *const params) { const GV *const gv = CvGV(cv); PERL_ARGS_ASSERT_CROAK_XS_USAGE; if (gv) { const char *const gvname = GvNAME(gv); const HV *const stash = GvSTASH(gv); const char *const hvname = stash ? HvNAME(stash) : NULL; if (hvname) Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params); else Perl_croak_nocontext("Usage: %s(%s)", gvname, params); } else { /* Pants. I don't think that it should be possible to get here. */ Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params); } } #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE #define croak_xs_usage S_croak_xs_usage #endif /* NOTE: the prototype of newXSproto() is different in versions of perls, * so we define a portable version of newXSproto() */ #ifdef newXS_flags #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) #else #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) #endif /* !defined(newXS_flags) */ #if PERL_VERSION_LE(5, 21, 5) # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file) #else # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b) #endif #line 630 "Util.c" XS_EUPXS(XS_NetAddr__IP__Util_comp128); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_comp128) { dVAR; dXSARGS; dXSI32; if (items < 1) croak_xs_usage(cv, "s, ..."); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 487 "Util.xs" unsigned char * ap; char * subname; u_int32_t wa[4]; STRLEN len; int i; #line 650 "Util.c" #line 493 "Util.xs" ap = (unsigned char *) SvPV(s,len); if (len != 16) { if (ix == 2) subname = is_ipv6to4; else if (ix == 1) subname = is_shiftleft; else subname = is_comp128; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } if (ix == 2) { XPUSHs(sv_2mortal(newSVpvn((char *)(ap +12),4))); XSRETURN(1); } else if (ix == 1) { if (items < 2) { memcpy(wa,ap,16); } else if ((i = SvIV(ST(1))) == 0) { memcpy(wa,ap,16); } else if (i < 0 || i > 128) { croak("Bad arg value for %s, is %d, should be 0 thru 128", "NetAddr::IP::Util::shiftleft",i); } else { netswap_copy(wa,ap,4); do { _128x2(wa); i--; } while (i > 0); netswap(wa,4); } } else { memcpy(wa,ap,16); fastcomp128(wa); } XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); #line 693 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_add128); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_add128) { dVAR; dXSARGS; dXSI32; if (items != 2) croak_xs_usage(cv, "as, bs"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * as = ST(0) ; SV * bs = ST(1) ; #line 542 "Util.xs" unsigned char * ap, *bp; char * subname; u_int32_t wa[4], wb[4]; n128 a128; STRLEN len; #line 720 "Util.c" #line 548 "Util.xs" ap = (unsigned char *) SvPV(as,len); if (len != 16) { Bail: if (ix == 1) subname = is_sub128; else subname = is_add128; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } bp = (unsigned char *) SvPV(bs,len); if (len != 16) { goto Bail; } netswap_copy(wa,ap,4); netswap_copy(wb,bp,4); if (ix == 1) { fastcomp128(wb); XPUSHs(sv_2mortal(newSViv((I32)adder128(wa,wb,&a128,1)))); } else { XPUSHs(sv_2mortal(newSViv((I32)adder128(wa,wb,&a128,0)))); } if (GIMME_V == G_ARRAY) { netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); #line 752 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_addconst); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_addconst) { dVAR; dXSARGS; if (items != 2) croak_xs_usage(cv, "s, cnst"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; I32 cnst = (I32)SvIV(ST(1)) ; #line 584 "Util.xs" n128 a128; unsigned char * ap; u_int32_t wa[4], wb[4]; STRLEN len; #line 777 "Util.c" #line 589 "Util.xs" ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::addconst",len *8,128); } netswap_copy(wa,ap,4); XPUSHs(sv_2mortal(newSViv((I32)addercon(wa,wb,&a128,cnst)))); if (GIMME_V == G_ARRAY) { netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(2); } XSRETURN(1); #line 792 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_hasbits); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_hasbits) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "s"); { SV * s = ST(0) ; #line 608 "Util.xs" unsigned char * bp; char * subname; STRLEN len; #line 812 "Util.c" int RETVAL; dXSTARG; #line 612 "Util.xs" bp = (unsigned char *) SvPV(s,len); if (len != 16) { subname = is_hasbits; croak("Bad arg length for %s%s, length is %d, should be %d", "NetAddr::IP::Util::",subname,len *8,128); } RETVAL = have128(bp); #line 823 "Util.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS_EUPXS(XS_NetAddr__IP__Util_bin2bcd); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_bin2bcd) { dVAR; dXSARGS; dXSI32; if (items != 1) croak_xs_usage(cv, "s"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 629 "Util.xs" BCD n; unsigned char * cp; STRLEN len; #line 846 "Util.c" #line 633 "Util.xs" cp = (unsigned char *) SvPV(s,len); if (ix == 0) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcd",len *8,128); } (void) _bin2bcd(cp,&n); XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt((unsigned char *)n.bcd,&n)))); } else if (ix == 1) { if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::bin2bcdn",len *8,128); } XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,_bin2bcd(cp,&n)))); } else { if (len > 20) { croak("Bad arg length for %s, length is %d, should %d digits or less", "NetAddr::IP::Util::bcdn2txt",len *2,40); } XPUSHs(sv_2mortal(newSVpvn((char *)n.txt,_bcd2txt(cp,&n)))); } XSRETURN(1); #line 872 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_bcd2bin); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_bcd2bin) { dVAR; dXSARGS; dXSI32; if (items < 1) croak_xs_usage(cv, "s, ..."); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 671 "Util.xs" BCD n; n128 c128, a128; unsigned char * cp, badc; char * subname; STRLEN len; #line 897 "Util.c" #line 677 "Util.xs" cp = (unsigned char *) SvPV(s,len); if (len > 40) { if (ix == 0) subname = is_bcd2bin; else if (ix ==1) subname = is_simple_pack; Badigits: croak("Bad arg length for %s%s, length is %d, should be %d digits or less", "NetAddr::IP::Util::",subname,len,40); } if (ix == 2) { if (len > 20) { len <<= 1; /* times 2 */ subname = is_bcdn2bin; goto Badigits; } if (items < 2) { croak("Bad usage, should have %s('packedbcd,length)", "NetAddr::IP::Util::bcdn2bin"); } len = SvIV(ST(1)); _bcdn2bin(cp,&a128,&c128,(int)len); netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); XSRETURN(1); } badc = _simple_pack(cp,(int)len, &n); if (badc) { if (ix == 1) subname = is_simple_pack; else subname = is_bcd2bin; croak("Bad char in string for %s%s, character is '%c', allowed are 0-9", "NetAddr::IP::Util::",subname,badc); } if (ix == 0) { _bcdn2bin((void *)n.bcd,&a128,&c128,40); netswap(a128.u,4); XPUSHs(sv_2mortal(newSVpvn((char *)a128.c,16))); } else { /* ix == 1 */ XPUSHs(sv_2mortal(newSVpvn((char *)n.bcd,20))); } XSRETURN(1); #line 943 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_notcontiguous); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_notcontiguous) { dVAR; dXSARGS; if (items != 1) croak_xs_usage(cv, "s"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 726 "Util.xs" unsigned char * ap, count; u_int32_t wa[4]; STRLEN len; #line 965 "Util.c" #line 730 "Util.xs" ap = (unsigned char *) SvPV(s,len); if (len != 16) { croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::countbits",len *8,128); } netswap_copy(wa,ap,4); count = _countbits(wa); XPUSHs(sv_2mortal(newSViv((I32)have128(wa)))); if (GIMME_V == G_ARRAY) { XPUSHs(sv_2mortal(newSViv((I32)count))); XSRETURN(2); } XSRETURN(1); #line 980 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_ipv4to6); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_ipv4to6) { dVAR; dXSARGS; dXSI32; if (items != 1) croak_xs_usage(cv, "s"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 750 "Util.xs" unsigned char * ip; char * subname; u_int32_t wa[4]; STRLEN len; #line 1004 "Util.c" #line 755 "Util.xs" ip = (unsigned char *) SvPV(s,len); if (len != 4) { if (ix == 1) subname = is_mask4to6; else subname = is_ipv4to6; croak("Bad arg length for %s%s, length is %d, should be 32", "NetAddr::IP::Util::",subname,len *8); } if (ix == 0) extendipv4(ip, wa); else extendmask4(ip, wa); XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); XSRETURN(1); #line 1021 "Util.c" PUTBACK; return; } } XS_EUPXS(XS_NetAddr__IP__Util_ipanyto6); /* prototype to pass -Wmissing-prototypes */ XS_EUPXS(XS_NetAddr__IP__Util_ipanyto6) { dVAR; dXSARGS; dXSI32; if (items != 1) croak_xs_usage(cv, "s"); PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { SV * s = ST(0) ; #line 777 "Util.xs" unsigned char * ip; char * subname; u_int32_t wa[4]; STRLEN len; #line 1045 "Util.c" #line 782 "Util.xs" ip = (unsigned char *) SvPV(s,len); if (len == 16) /* if already 128 bits, return input */ XPUSHs(sv_2mortal(newSVpvn((char *)ip,16))); else if (len == 4) { if (ix == 0) extendipv4(ip, wa); else extendmask4(ip, wa); XPUSHs(sv_2mortal(newSVpvn((char *)wa,16))); } else { if (ix == 1) subname = is_maskanyto6; else subname = is_ipanyto6; croak("Bad arg length for %s%s, length is %d, should be 32 or 128", "NetAddr::IP::Util::",subname,len *8); } XSRETURN(1); #line 1066 "Util.c" PUTBACK; return; } } #ifdef __cplusplus extern "C" #endif XS_EXTERNAL(boot_NetAddr__IP__Util); /* prototype to pass -Wmissing-prototypes */ XS_EXTERNAL(boot_NetAddr__IP__Util) { #if PERL_VERSION_LE(5, 21, 5) dVAR; dXSARGS; #else dVAR; dXSBOOTARGSXSAPIVERCHK; #endif #if (PERL_REVISION == 5 && PERL_VERSION < 9) char* file = __FILE__; #else const char* file = __FILE__; #endif PERL_UNUSED_VAR(file); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ #if PERL_VERSION_LE(5, 21, 5) XS_VERSION_BOOTCHECK; # ifdef XS_APIVERSION_BOOTCHECK XS_APIVERSION_BOOTCHECK; # endif #endif { CV * cv; cv = newXSproto_portable("NetAddr::IP::Util::comp128", XS_NetAddr__IP__Util_comp128, file, "$;@"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::ipv6to4", XS_NetAddr__IP__Util_comp128, file, "$;@"); XSANY.any_i32 = 2; cv = newXSproto_portable("NetAddr::IP::Util::shiftleft", XS_NetAddr__IP__Util_comp128, file, "$;@"); XSANY.any_i32 = 1; cv = newXSproto_portable("NetAddr::IP::Util::add128", XS_NetAddr__IP__Util_add128, file, "$$"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::sub128", XS_NetAddr__IP__Util_add128, file, "$$"); XSANY.any_i32 = 1; (void)newXSproto_portable("NetAddr::IP::Util::addconst", XS_NetAddr__IP__Util_addconst, file, "$$"); (void)newXSproto_portable("NetAddr::IP::Util::hasbits", XS_NetAddr__IP__Util_hasbits, file, "$"); cv = newXSproto_portable("NetAddr::IP::Util::bcdn2txt", XS_NetAddr__IP__Util_bin2bcd, file, "$"); XSANY.any_i32 = 2; cv = newXSproto_portable("NetAddr::IP::Util::bin2bcd", XS_NetAddr__IP__Util_bin2bcd, file, "$"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::bin2bcdn", XS_NetAddr__IP__Util_bin2bcd, file, "$"); XSANY.any_i32 = 1; cv = newXSproto_portable("NetAddr::IP::Util::bcd2bin", XS_NetAddr__IP__Util_bcd2bin, file, "$;@"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::bcdn2bin", XS_NetAddr__IP__Util_bcd2bin, file, "$;@"); XSANY.any_i32 = 2; cv = newXSproto_portable("NetAddr::IP::Util::simple_pack", XS_NetAddr__IP__Util_bcd2bin, file, "$;@"); XSANY.any_i32 = 1; (void)newXSproto_portable("NetAddr::IP::Util::notcontiguous", XS_NetAddr__IP__Util_notcontiguous, file, "$"); cv = newXSproto_portable("NetAddr::IP::Util::ipv4to6", XS_NetAddr__IP__Util_ipv4to6, file, "$"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::mask4to6", XS_NetAddr__IP__Util_ipv4to6, file, "$"); XSANY.any_i32 = 1; cv = newXSproto_portable("NetAddr::IP::Util::ipanyto6", XS_NetAddr__IP__Util_ipanyto6, file, "$"); XSANY.any_i32 = 0; cv = newXSproto_portable("NetAddr::IP::Util::maskanyto6", XS_NetAddr__IP__Util_ipanyto6, file, "$"); XSANY.any_i32 = 1; } #if PERL_VERSION_LE(5, 21, 5) # if PERL_VERSION_GE(5, 9, 0) if (PL_unitcheckav) call_list(PL_scopestack_ix, PL_unitcheckav); # endif XSRETURN_YES; #else Perl_xs_boot_epilog(aTHX_ ax); #endif } Lite/Util/Util_IS.pm 0000644 00000001330 15043770025 0010224 0 ustar 00 #!/usr/bin/perl # # DO NOT ALTER THIS FILE # IT IS WRITTEN BY Makefile.PL # EDIT THAT INSTEAD # package NetAddr::IP::Util_IS; use vars qw($VERSION); $VERSION = 1.00; sub pure { return 0; } sub not_pure { return 1; } 1; __END__ =head1 NAME NetAddr::IP::Util_IS - Tell about Pure Perl =head1 SYNOPSIS use NetAddr::IP::Util_IS; $rv = NetAddr::IP::Util_IS->pure; $rv = NetAddr::IP::Util_IS->not_pure; =head1 DESCRIPTION Util_IS indicates whether or not B<NetAddr::IP::Util> was compiled in Pure Perl mode. =over 4 =item * $rv = NetAddr::IP::Util_IS->pure; Returns true if PurePerl mode, else false. =item * $rv = NetAddr::IP::Util_IS->not_pure; Returns true if NOT PurePerl mode, else false =back =cut 1; Lite/Util/localperl.h 0000644 00000000134 15043770025 0010505 0 ustar 00 /* Written by Makefile.PL * * Do not modify this file, modify Makefile.PL instead * */ Lite/Util/Makefile.PL 0000644 00000012304 15043770025 0010333 0 ustar 00 use ExtUtils::MakeMaker qw( WriteMakefile prompt ); use Config; use Cwd; # fix for bug in Android's sh use File::Spec; use Getopt::Long qw( GetOptions ); my $pwd = getcwd(); unlink 'Makefile'; # remove Makefile to stabilize CC test # # get any command line arguments # my($useXS); GetOptions( 'xs!' => \$useXS, 'pm' => sub { warn "\n\t".'WARNING: Use of "--pm" is deprecated, use "-noxs" instead'."\n\n"; $useXS = 0; }, ); print STDERR "building for $^O\n"; #if ($Config{osname} =~ /MSWin32/i || $Config{osname} eq 'dos') { # kill windows and Darwin, both of which misbahave when building XS code if ($Config{osname} =~ /win/i || $Config{osname} eq 'dos') { $useXS = 0; # force NOXS mode for windows } my $pkg = 'NetAddr::IP::Util'; $pkg =~ /[^:]+$/; my $module = $& .'.pm'; my $cfile = $& .'.c'; my %makeparms = ( NAME => $pkg, VERSION_FROM => $module, # finds $VERSION # depend => {$cfile => q[xs_include/miniSocket.inc localconf.h config.h localperl.h], depend => {$cfile => q[ localconf.h config.h localperl.h ], }, # PREREQ_PM => { Socket6 => 0.23, can't do this # }, LIBS => [], XS => {}, C => [], clean => { FILES => "*.bs *.o *.c *~ tmp* Util_IS.pm localperl.h auto*"}, realclean => { FILES => "config.h config.log config.status"}, dist => {COMPRESS=>'gzip', SUFFIX=>'gz'} ); # # Check if we have a C compiler unless (defined $useXS) { my $compiler = test_cc(); if ($compiler) { $ENV{CC} = $compiler; print "You have a working compiler.\n"; $useXS = 1; # $makeparms{'MYEXTLIB'} = 'netdns$(LIB_EXT)', } else { $useXS = 0; print <<END; I cannot determine if you have a C compiler. I will install the perl-only implementation. You can force installation of the XS version with: perl Makefile.PL --xs END # $makeparms{'MYEXTLIB'} = '', } } my $begin = ''; while ($useXS) { # turn the XS bits on. delete $makeparms{'XS'}; delete $makeparms{'C'}; # fix bug in Andorid's sh local $ENV{TMPDIR} = File::Spec->tmpdir() if $^O eq 'android'; unless (-e './config.h') { system $Config{sh}, 'configure.gcc'; } my @LIBS; unless (open(F,'config.h')) { warn "Cannot read config.h built by 'gcc', trying 'cc'.\n"; # try to build with cc system $Config(sh), 'configure.cc'; unless (open(F,'config.h')) { warn "Cannot read config.h built by 'cc', using 'pure Perl'.\n"; $useXS = 0; last; } } foreach(<F>) { if ($_ =~ /^#define LIBS([ a-zA-Z-]+)/) { @LIBS = ($1 =~ /[a-zA-Z0-9-]+/g); $makeparms{LIBS} = [$1]; last; } } close F; my $link = ''; foreach(@libs) { if ($Config{libs} =~ /$_\b/) { $link .= $_ .' '; } } chop $link; $makeparms{LIBS} = [$link]; open(F,'>localperl.h') or die "could not open localperl.h for write\n"; print F q| /* Written by Makefile.PL * * Do not modify this file, modify Makefile.PL instead * */ |; close F; $begin = q| config :: config.h @$(NOOP) config.h : $(SHELL) configure |; last; } open(F,'>Util_IS.pm'); print F q|#!/usr/bin/perl # # DO NOT ALTER THIS FILE # IT IS WRITTEN BY Makefile.PL # EDIT THAT INSTEAD # package NetAddr::IP::Util_IS; use vars qw($VERSION); $VERSION = 1.00; sub pure { return |, (($useXS) ? 0 : 1), q|; } sub not_pure { return |, (($useXS) ? 1 : 0), q|; } 1; __END__ =head1 NAME NetAddr::IP::Util_IS - Tell about Pure Perl =head1 SYNOPSIS use NetAddr::IP::Util_IS; $rv = NetAddr::IP::Util_IS->pure; $rv = NetAddr::IP::Util_IS->not_pure; =head1 DESCRIPTION Util_IS indicates whether or not B<NetAddr::IP::Util> was compiled in Pure Perl mode. =over 4 =item * $rv = NetAddr::IP::Util_IS->pure; Returns true if PurePerl mode, else false. =item * $rv = NetAddr::IP::Util_IS->not_pure; Returns true if NOT PurePerl mode, else false =back =cut 1; |; sub test_cc { # # The perl/C check borrowed and modified from # Graham Barr's Scalar-List-Utils distribution. # print "Testing if you have a C compiler and the needed header files....\n"; unless (open(F, ">compile.c")) { warn "Cannot write compile.c, skipping test compilation and installing pure Perl version.\n"; return 0; } my $CC; foreach $CC (($ENV{CC},$Config{cc},$Config{ccname})) { next unless $CC; my $command = qq|$CC compile.c -o compile.output|; print F <<'EOF'; int main() { return 0; } EOF close(F) or return 0; print STDERR $command,"\n"; my $rv = system($command); foreach my $file (glob('compile*')) { unlink($file) || warn "Could not delete $file: $!\n"; } if ($rv == 0) { return $CC; } } return undef; } sub MY::top_targets { package MY; my $inherited = shift->SUPER::top_targets(@_); $inherited =~ s/(pure_all\s+::.+)/$1 README/; $begin . $inherited; } sub MY::post_constants { my $post_constants = $Config{scriptdirexp} .'/pod2text'; if (-e $post_constants) { $post_constants = q| MY_POD2TEXT = |. $post_constants .q| |; } else { $post_constants = q| MY_POD2TEXT = echo "perl distro missing 'pod2text' to convert " |; } } sub MY::postamble { package MY; my $postamble = q| README : |. $module .q| @$(MY_POD2TEXT) |. $module .q| > README |; } WriteMakefile(%makeparms); Lite/Util/tlib/NetAddr/IP/Util_IS.pm 0000644 00000001330 15043770025 0013007 0 ustar 00 #!/usr/bin/perl # # DO NOT ALTER THIS FILE # IT IS WRITTEN BY Makefile.PL # EDIT THAT INSTEAD # package NetAddr::IP::Util_IS; use vars qw($VERSION); $VERSION = 1.00; sub pure { return 1; } sub not_pure { return 0; } 1; __END__ =head1 NAME NetAddr::IP::Util_IS - Tell about Pure Perl =head1 SYNOPSIS use NetAddr::IP::Util_IS; $rv = NetAddr::IP::Util_IS->pure; $rv = NetAddr::IP::Util_IS->not_pure; =head1 DESCRIPTION Util_IS indicates whether or not B<NetAddr::IP::Util> was compiled in Pure Perl mode. =over 4 =item * $rv = NetAddr::IP::Util_IS->pure; Returns true if PurePerl mode, else false. =item * $rv = NetAddr::IP::Util_IS->not_pure; Returns true if NOT PurePerl mode, else false =back =cut 1; Lite/Util/config.log 0000644 00000047145 15043770025 0010344 0 ustar 00 This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by configure.gcc, which was generated by GNU Autoconf 2.61. Invocation command line was $ configure.gcc ## --------- ## ## Platform. ## ## --------- ## hostname = 10-0-2-15.cprapid.com uname -m = x86_64 uname -r = 5.14.0-427.31.1.el9_4.x86_64 uname -s = Linux uname -v = #1 SMP PREEMPT_DYNAMIC Thu Aug 15 14:47:52 EDT 2024 /usr/bin/uname -p = x86_64 /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /root/.local/bin PATH: /root/bin PATH: /usr/local/cpanel/3rdparty/lib/path-bin PATH: /usr/share/Modules/bin PATH: /usr/local/cpanel/3rdparty/lib/path-bin PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /usr/sbin PATH: /usr/bin PATH: /opt/cpanel/composer/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure.gcc:1723: checking for gcc configure.gcc:1750: result: gcc configure.gcc:1988: checking for C compiler version configure.gcc:1995: gcc --version >&5 gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3) Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure.gcc:1998: $? = 0 configure.gcc:2005: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-host-pie --enable-host-bind-now --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugs.almalinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --enable-initfini-array --without-isl --enable-multilib --with-linker-hash-style=gnu --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_64=x86-64-v2 --with-arch_32=x86-64 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.4.1 20231218 (Red Hat 11.4.1-3) (GCC) configure.gcc:2008: $? = 0 configure.gcc:2015: gcc -V >&5 gcc: error: unrecognized command-line option '-V' gcc: fatal error: no input files compilation terminated. configure.gcc:2018: $? = 1 configure.gcc:2041: checking for C compiler default output file name configure.gcc:2068: gcc conftest.c >&5 configure.gcc:2071: $? = 0 configure.gcc:2109: result: a.out configure.gcc:2126: checking whether the C compiler works configure.gcc:2136: ./a.out configure.gcc:2139: $? = 0 configure.gcc:2156: result: yes configure.gcc:2163: checking whether we are cross compiling configure.gcc:2165: result: no configure.gcc:2168: checking for suffix of executables configure.gcc:2175: gcc -o conftest conftest.c >&5 configure.gcc:2178: $? = 0 configure.gcc:2202: result: configure.gcc:2208: checking for suffix of object files configure.gcc:2234: gcc -c conftest.c >&5 configure.gcc:2237: $? = 0 configure.gcc:2260: result: o configure.gcc:2264: checking whether we are using the GNU C compiler configure.gcc:2293: gcc -c conftest.c >&5 configure.gcc:2299: $? = 0 configure.gcc:2316: result: yes configure.gcc:2321: checking whether gcc accepts -g configure.gcc:2351: gcc -c -g conftest.c >&5 configure.gcc:2357: $? = 0 configure.gcc:2456: result: yes configure.gcc:2473: checking for gcc option to accept ISO C89 configure.gcc:2547: gcc -c -g -O2 conftest.c >&5 configure.gcc:2553: $? = 0 configure.gcc:2576: result: none needed configure.gcc:2602: checking how to run the C preprocessor configure.gcc:2642: gcc -E conftest.c configure.gcc:2648: $? = 0 configure.gcc:2679: gcc -E conftest.c conftest.c:8:10: fatal error: ac_nonexistent.h: No such file or directory 8 | #include <ac_nonexistent.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure.gcc:2685: $? = 1 configure.gcc: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure.gcc:2718: result: gcc -E configure.gcc:2747: gcc -E conftest.c configure.gcc:2753: $? = 0 configure.gcc:2784: gcc -E conftest.c conftest.c:8:10: fatal error: ac_nonexistent.h: No such file or directory 8 | #include <ac_nonexistent.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure.gcc:2790: $? = 1 configure.gcc: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure.gcc:2828: checking for grep that handles long lines and -e configure.gcc:2902: result: /usr/bin/grep configure.gcc:2907: checking for egrep configure.gcc:2985: result: /usr/bin/grep -E configure.gcc:2990: checking for ANSI C header files configure.gcc:3020: gcc -c -g -O2 conftest.c >&5 configure.gcc:3026: $? = 0 configure.gcc:3125: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:3128: $? = 0 configure.gcc:3134: ./conftest configure.gcc:3137: $? = 0 configure.gcc:3154: result: yes configure.gcc:3178: checking for sys/types.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for sys/stat.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for stdlib.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for string.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for memory.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for strings.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for inttypes.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for stdint.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3178: checking for unistd.h configure.gcc:3199: gcc -c -g -O2 conftest.c >&5 configure.gcc:3205: $? = 0 configure.gcc:3221: result: yes configure.gcc:3251: checking sys/socket.h usability configure.gcc:3268: gcc -c -g -O2 conftest.c >&5 configure.gcc:3274: $? = 0 configure.gcc:3288: result: yes configure.gcc:3292: checking sys/socket.h presence configure.gcc:3307: gcc -E conftest.c configure.gcc:3313: $? = 0 configure.gcc:3327: result: yes configure.gcc:3355: checking for sys/socket.h configure.gcc:3363: result: yes configure.gcc:3251: checking netinet/in.h usability configure.gcc:3268: gcc -c -g -O2 conftest.c >&5 configure.gcc:3274: $? = 0 configure.gcc:3288: result: yes configure.gcc:3292: checking netinet/in.h presence configure.gcc:3307: gcc -E conftest.c configure.gcc:3313: $? = 0 configure.gcc:3327: result: yes configure.gcc:3355: checking for netinet/in.h configure.gcc:3363: result: yes configure.gcc:3251: checking arpa/inet.h usability configure.gcc:3268: gcc -c -g -O2 conftest.c >&5 configure.gcc:3274: $? = 0 configure.gcc:3288: result: yes configure.gcc:3292: checking arpa/inet.h presence configure.gcc:3307: gcc -E conftest.c configure.gcc:3313: $? = 0 configure.gcc:3327: result: yes configure.gcc:3355: checking for arpa/inet.h configure.gcc:3363: result: yes configure.gcc:3251: checking netdb.h usability configure.gcc:3268: gcc -c -g -O2 conftest.c >&5 configure.gcc:3274: $? = 0 configure.gcc:3288: result: yes configure.gcc:3292: checking netdb.h presence configure.gcc:3307: gcc -E conftest.c configure.gcc:3313: $? = 0 configure.gcc:3327: result: yes configure.gcc:3355: checking for netdb.h configure.gcc:3363: result: yes configure.gcc:3378: checking for an ANSI C-conforming const configure.gcc:3453: gcc -c -g -O2 conftest.c >&5 configure.gcc:3459: $? = 0 configure.gcc:3474: result: yes configure.gcc:3485: checking for int32_t configure.gcc:3516: gcc -c -g -O2 conftest.c >&5 configure.gcc:3522: $? = 0 configure.gcc:3551: gcc -c -g -O2 conftest.c >&5 conftest.c: In function 'main': conftest.c:59:67: warning: integer overflow in expression of type 'int' results in '-2147483648' [-Woverflow] 59 | < (int32_t) ((((int32_t) 1 << (32 - 2)) - 1) * 2 + 2))]; | ^ conftest.c:58:12: error: storage size of 'test_array' isn't constant 58 | static int test_array [1 - 2 * !((int32_t) ((((int32_t) 1 << (32 - 2)) - 1) * 2 + 1) | ^~~~~~~~~~ configure.gcc:3557: $? = 1 configure.gcc: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_SYS_SOCKET_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_ARPA_INET_H 1 | #define HAVE_NETDB_H 1 | /* end confdefs.h. */ | #include <stdio.h> | #ifdef HAVE_SYS_TYPES_H | # include <sys/types.h> | #endif | #ifdef HAVE_SYS_STAT_H | # include <sys/stat.h> | #endif | #ifdef STDC_HEADERS | # include <stdlib.h> | # include <stddef.h> | #else | # ifdef HAVE_STDLIB_H | # include <stdlib.h> | # endif | #endif | #ifdef HAVE_STRING_H | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H | # include <memory.h> | # endif | # include <string.h> | #endif | #ifdef HAVE_STRINGS_H | # include <strings.h> | #endif | #ifdef HAVE_INTTYPES_H | # include <inttypes.h> | #endif | #ifdef HAVE_STDINT_H | # include <stdint.h> | #endif | #ifdef HAVE_UNISTD_H | # include <unistd.h> | #endif | int | main () | { | static int test_array [1 - 2 * !((int32_t) ((((int32_t) 1 << (32 - 2)) - 1) * 2 + 1) | < (int32_t) ((((int32_t) 1 << (32 - 2)) - 1) * 2 + 2))]; | test_array [0] = 0 | | ; | return 0; | } configure.gcc:3586: result: yes configure.gcc:3599: checking for uint16_t configure.gcc:3630: gcc -c -g -O2 conftest.c >&5 configure.gcc:3636: $? = 0 configure.gcc:3657: result: yes configure.gcc:3671: checking for uint32_t configure.gcc:3702: gcc -c -g -O2 conftest.c >&5 configure.gcc:3708: $? = 0 configure.gcc:3729: result: yes configure.gcc:3747: checking for uint8_t configure.gcc:3778: gcc -c -g -O2 conftest.c >&5 configure.gcc:3784: $? = 0 configure.gcc:3805: result: yes configure.gcc:3825: checking whether gcc needs -traditional configure.gcc:3867: result: no configure.gcc:3881: checking for library containing gethostbyname configure.gcc:3922: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:3928: $? = 0 configure.gcc:3956: result: none required configure.gcc:3971: checking for library containing inet_aton configure.gcc:4012: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:4018: $? = 0 configure.gcc:4046: result: none required configure.gcc:4061: checking for library containing inet_pton configure.gcc:4102: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:4108: $? = 0 configure.gcc:4136: result: none required configure.gcc:4151: checking for library containing inet_addr configure.gcc:4192: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:4198: $? = 0 configure.gcc:4226: result: none required configure.gcc:4239: checking whether byte ordering is bigendian configure.gcc:4272: gcc -c -g -O2 conftest.c >&5 configure.gcc:4278: $? = 0 configure.gcc:4310: gcc -c -g -O2 conftest.c >&5 conftest.c: In function 'main': conftest.c:33:2: error: unknown type name 'not'; did you mean 'ino_t'? 33 | not big endian | ^~~ | ino_t conftest.c:33:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'endian' 33 | not big endian | ^~~~~~ configure.gcc:4316: $? = 1 configure.gcc: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_SYS_SOCKET_H 1 | #define HAVE_NETINET_IN_H 1 | #define HAVE_ARPA_INET_H 1 | #define HAVE_NETDB_H 1 | #define HAVE_GETHOSTBYNAME 1 | #define HAVE_INET_ATON 1 | #define HAVE_INET_PTON 1 | #define HAVE_INET_ADDR 1 | /* end confdefs.h. */ | #include <sys/types.h> | #include <sys/param.h> | | int | main () | { | #if BYTE_ORDER != BIG_ENDIAN | not big endian | #endif | | ; | return 0; | } configure.gcc:4456: result: no configure.gcc:4475: checking for uint8_t configure.gcc:4505: gcc -c -g -O2 conftest.c >&5 configure.gcc:4511: $? = 0 configure.gcc:4526: result: yes configure.gcc:4533: checking size of uint8_t configure.gcc:4835: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:4838: $? = 0 configure.gcc:4844: ./conftest configure.gcc:4847: $? = 0 configure.gcc:4870: result: 1 configure.gcc:4880: checking for uint16_t configure.gcc:4910: gcc -c -g -O2 conftest.c >&5 configure.gcc:4916: $? = 0 configure.gcc:4931: result: yes configure.gcc:4938: checking size of uint16_t configure.gcc:5240: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:5243: $? = 0 configure.gcc:5249: ./conftest configure.gcc:5252: $? = 0 configure.gcc:5275: result: 2 configure.gcc:5285: checking for uint32_t configure.gcc:5315: gcc -c -g -O2 conftest.c >&5 configure.gcc:5321: $? = 0 configure.gcc:5336: result: yes configure.gcc:5343: checking size of uint32_t configure.gcc:5645: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:5648: $? = 0 configure.gcc:5654: ./conftest configure.gcc:5657: $? = 0 configure.gcc:5680: result: 4 configure.gcc:5690: checking for u_int8_t configure.gcc:5720: gcc -c -g -O2 conftest.c >&5 configure.gcc:5726: $? = 0 configure.gcc:5741: result: yes configure.gcc:5748: checking size of u_int8_t configure.gcc:6050: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:6053: $? = 0 configure.gcc:6059: ./conftest configure.gcc:6062: $? = 0 configure.gcc:6085: result: 1 configure.gcc:6095: checking for u_int16_t configure.gcc:6125: gcc -c -g -O2 conftest.c >&5 configure.gcc:6131: $? = 0 configure.gcc:6146: result: yes configure.gcc:6153: checking size of u_int16_t configure.gcc:6455: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:6458: $? = 0 configure.gcc:6464: ./conftest configure.gcc:6467: $? = 0 configure.gcc:6490: result: 2 configure.gcc:6500: checking for u_int32_t configure.gcc:6530: gcc -c -g -O2 conftest.c >&5 configure.gcc:6536: $? = 0 configure.gcc:6551: result: yes configure.gcc:6558: checking size of u_int32_t configure.gcc:6860: gcc -o conftest -g -O2 conftest.c >&5 configure.gcc:6863: $? = 0 configure.gcc:6869: ./conftest configure.gcc:6872: $? = 0 configure.gcc:6895: result: 4 configure.gcc:7009: creating ./config.status ## ---------------------- ## ## Running config.status. ## ## ---------------------- ## This file was extended by config.status, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status on 10-0-2-15.cprapid.com config.status:515: creating config.h ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_c_bigendian=no ac_cv_c_compiler_gnu=yes ac_cv_c_const=yes ac_cv_c_int32_t=yes ac_cv_c_uint16_t=yes ac_cv_c_uint32_t=yes ac_cv_c_uint8_t=yes ac_cv_env_CC_set=set ac_cv_env_CC_value=gcc ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_header_arpa_inet_h=yes ac_cv_header_inttypes_h=yes ac_cv_header_memory_h=yes ac_cv_header_netdb_h=yes ac_cv_header_netinet_in_h=yes ac_cv_header_stdc=yes ac_cv_header_stdint_h=yes ac_cv_header_stdlib_h=yes ac_cv_header_string_h=yes ac_cv_header_strings_h=yes ac_cv_header_sys_socket_h=yes ac_cv_header_sys_stat_h=yes ac_cv_header_sys_types_h=yes ac_cv_header_unistd_h=yes ac_cv_objext=o ac_cv_path_EGREP='/usr/bin/grep -E' ac_cv_path_GREP=/usr/bin/grep ac_cv_prog_CPP='gcc -E' ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_prog_gcc_traditional=no ac_cv_search_gethostbyname='none required' ac_cv_search_inet_addr='none required' ac_cv_search_inet_aton='none required' ac_cv_search_inet_pton='none required' ac_cv_sizeof_u_int16_t=2 ac_cv_sizeof_u_int32_t=4 ac_cv_sizeof_u_int8_t=1 ac_cv_sizeof_uint16_t=2 ac_cv_sizeof_uint32_t=4 ac_cv_sizeof_uint8_t=1 ac_cv_type_u_int16_t=yes ac_cv_type_u_int32_t=yes ac_cv_type_u_int8_t=yes ac_cv_type_uint16_t=yes ac_cv_type_uint32_t=yes ac_cv_type_uint8_t=yes ## ----------------- ## ## Output variables. ## ## ----------------- ## CC='gcc' CFLAGS='-g -O2' CPP='gcc -E' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/usr/bin/grep -E' EXEEXT='' GREP='/usr/bin/grep' LDFLAGS='' LIBOBJS='' LIBS='' LTLIBOBJS='' OBJEXT='o' PACKAGE_BUGREPORT='' PACKAGE_NAME='' PACKAGE_STRING='' PACKAGE_TARNAME='' PACKAGE_VERSION='' PATH_SEPARATOR=':' SHELL='/bin/sh' ac_ct_CC='gcc' bindir='${exec_prefix}/bin' build_alias='' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE}' dvidir='${docdir}' exec_prefix='${prefix}' host_alias='' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/usr/local' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## #define PACKAGE_NAME "" #define PACKAGE_TARNAME "" #define PACKAGE_VERSION "" #define PACKAGE_STRING "" #define PACKAGE_BUGREPORT "" #define STDC_HEADERS 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_MEMORY_H 1 #define HAVE_STRINGS_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_UNISTD_H 1 #define HAVE_SYS_SOCKET_H 1 #define HAVE_NETINET_IN_H 1 #define HAVE_ARPA_INET_H 1 #define HAVE_NETDB_H 1 #define HAVE_GETHOSTBYNAME 1 #define HAVE_INET_ATON 1 #define HAVE_INET_PTON 1 #define HAVE_INET_ADDR 1 #define SIZEOF_UINT8_T 1 #define SIZEOF_UINT16_T 2 #define SIZEOF_UINT32_T 4 #define SIZEOF_U_INT8_T 1 #define SIZEOF_U_INT16_T 2 #define SIZEOF_U_INT32_T 4 configure.gcc: exit 0 Lite/Util/MYMETA.yml 0000644 00000000744 15043770025 0010105 0 ustar 00 --- abstract: unknown author: - unknown build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: NetAddr-IP-Util no_index: directory: - t - inc version: '1.53' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Lite/Util/config.status 0000755 00000045617 15043770025 0011113 0 ustar 00 #! /bin/sh # Generated by configure.gcc. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=${CONFIG_SHELL-/bin/sh} ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " # Files that config.status was made for. config_headers=" config.h" ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration headers: $config_headers Report bugs to <bug-autoconf@gnu.org>." ac_cs_version="\ config.status configured by configure.gcc, generated by GNU Autoconf 2.61, with options \"'CC=gcc'\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='/home/.cpan/build/NetAddr-IP-4.079-0/Lite/Util' srcdir='.' # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi if $ac_cs_recheck; then echo "running CONFIG_SHELL=/bin/sh /bin/sh configure.gcc " 'CC=gcc' $ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=/bin/sh export CONFIG_SHELL exec /bin/sh "configure.gcc" 'CC=gcc' $ac_configure_extra_args --no-create --no-recursion fi exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } for ac_tag in :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :H) # # CONFIG_HEADER # # First, check the format of the line: cat >"$tmp/defines.sed" <<\CEOF /^[ ]*#[ ]*undef[ ][ ]*[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*[ ]*$/b def /^[ ]*#[ ]*define[ ][ ]*[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*[( ]/b def b :def s/$/ / s,^\([ #]*\)[^ ]*\([ ]*PACKAGE_NAME\)[ (].*,\1define\2 "" , s,^\([ #]*\)[^ ]*\([ ]*PACKAGE_TARNAME\)[ (].*,\1define\2 "" , s,^\([ #]*\)[^ ]*\([ ]*PACKAGE_VERSION\)[ (].*,\1define\2 "" , s,^\([ #]*\)[^ ]*\([ ]*PACKAGE_STRING\)[ (].*,\1define\2 "" , s,^\([ #]*\)[^ ]*\([ ]*PACKAGE_BUGREPORT\)[ (].*,\1define\2 "" , s,^\([ #]*\)[^ ]*\([ ]*STDC_HEADERS\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_SYS_TYPES_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_SYS_STAT_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_STDLIB_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_STRING_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_MEMORY_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_STRINGS_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_INTTYPES_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_STDINT_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_UNISTD_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_SYS_SOCKET_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_NETINET_IN_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_ARPA_INET_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_NETDB_H\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_GETHOSTBYNAME\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_INET_ATON\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_INET_PTON\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*HAVE_INET_ADDR\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_UINT8_T\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_UINT16_T\)[ (].*,\1define\2 2 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_UINT32_T\)[ (].*,\1define\2 4 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_U_INT8_T\)[ (].*,\1define\2 1 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_U_INT16_T\)[ (].*,\1define\2 2 , s,^\([ #]*\)[^ ]*\([ ]*SIZEOF_U_INT32_T\)[ (].*,\1define\2 4 , s/ $// s,^[ #]*u.*,/* & */, CEOF sed -f "$tmp/defines.sed" $ac_file_inputs >"$tmp/out1" ac_result="$tmp/out1" if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; esac done # for ac_tag { (exit 0); exit 0; } Lite/Util/typemap 0000644 00000000542 15043770025 0007764 0 ustar 00 # # Map C types to Perl types # struct in_addr * T_PTROBJ # # Input conversions # INPUT T_PTROBJ if (sv_derived_from($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); $var = ($type) tmp; } else croak(\"$var is not of type ${ntype}\") # # Output conversions # OUTPUT T_PTROBJ sv_setref_pv($arg, \"${ntype}\", (void*)$var); Lite/Util/config.h 0000644 00000007677 15043770025 0010020 0 ustar 00 /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the <arpa/inet.h> header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if function 'gethostbyname' is present */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if function 'inet_addr' is present */ #define HAVE_INET_ADDR 1 /* Define to 1 if function 'inet_aton' is present */ #define HAVE_INET_ATON 1 /* Define to 1 if function 'inet_pton' is present */ #define HAVE_INET_PTON 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define if library library 'nsl' is present */ /* #undef HAVE_LIBNSL */ /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the <netdb.h> header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the <netinet/in.h> header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Extra libraries */ /* #undef LIBS */ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ #define PACKAGE_NAME "" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "" /* Define to the version of this package. */ #define PACKAGE_VERSION "" /* The size of `uint16_t', as computed by sizeof. */ #define SIZEOF_UINT16_T 2 /* The size of `uint32_t', as computed by sizeof. */ #define SIZEOF_UINT32_T 4 /* The size of `uint8_t', as computed by sizeof. */ #define SIZEOF_UINT8_T 1 /* The size of `u_int16_t', as computed by sizeof. */ #define SIZEOF_U_INT16_T 2 /* The size of `u_int32_t', as computed by sizeof. */ #define SIZEOF_U_INT32_T 4 /* The size of `u_int8_t', as computed by sizeof. */ #define SIZEOF_U_INT8_T 1 /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the #define below would cause a syntax error. */ /* #undef _UINT32_T */ /* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the #define below would cause a syntax error. */ /* #undef _UINT8_T */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ /* #undef int32_t */ /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ /* #undef uint16_t */ /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ /* #undef uint32_t */ /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ /* #undef uint8_t */ Lite/Util/MANIFEST 0000644 00000001350 15043770025 0007511 0 ustar 00 Changes MANIFEST This list of files MANIFEST.SKIP Makefile.PL README Util.pm Util.xs config.h.in configure.cc configure.gcc configure.ac lib/NetAddr/IP/InetBase.pm lib/NetAddr/IP/UtilPP.pm localconf.h t/4to6.t t/add128.t t/addconst.t t/af_inet6.t t/anyto6.t t/badd.t t/bcd2bin.t t/bcdn2bin.t t/bin.t t/binet_n2ad.t t/binet_n2dx.t t/binet_pton.t t/bipv4_inet.t t/binet_ntoa.t t/bipv6_any2n.t t/bipv6func.t t/bisIPv4.t t/bpackzeros.t t/comp128.t t/croak.t t/hasbits.t t/inet_4map6.t t/inet_n2ad.t t/inet_n2dx.t t/inet_pton.t t/ipv4_inet.t t/ipv6_ntoa.t t/ipv6_any2n.t t/ipv6func.t t/ipv6to4.t t/isIPv4.t t/leftshift.t t/mode.t t/notcontiguous.t t/packzeros.t t/simple_pack.t t/sub128.t t/naip_gethostbyname.t t/no6_naip_gethostbyname.t typemap Lite/Util/Util.bs 0000644 00000000000 15043770025 0007612 0 ustar 00 Lite/Util/lib/NetAddr/IP/UtilPP.pm 0000644 00000036551 15043770025 0012505 0 ustar 00 #!/usr/bin/perl package NetAddr::IP::UtilPP; use strict; #use diagnostics; #use lib qw(blib lib); use AutoLoader qw(AUTOLOAD); use vars qw($VERSION @EXPORT_OK @ISA %EXPORT_TAGS); require Exporter; @ISA = qw(Exporter); $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; @EXPORT_OK = qw( hasbits shiftleft addconst add128 sub128 notcontiguous ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 bin2bcd bcd2bin comp128 bin2bcdn bcdn2txt bcdn2bin simple_pack ); %EXPORT_TAGS = ( all => [@EXPORT_OK], ); sub DESTROY {}; 1; __END__ =head1 NAME NetAddr::IP::UtilPP -- pure Perl functions for NetAddr::IP::Util =head1 SYNOPSIS use NetAddr::IP::UtilPP qw( hasbits shiftleft addconst add128 sub128 notcontiguous ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 bin2bcd bcd2bin ); use NetAddr::IP::UtilPP qw(:all) $rv = hasbits($bits128); $bitsX2 = shiftleft($bits128,$n); $carry = addconst($ipv6naddr,$signed_32con); ($carry,$ipv6naddr)=addconst($ipv6naddr,$signed_32con); $carry = add128($ipv6naddr1,$ipv6naddr2); ($carry,$ipv6naddr)=add128($ipv6naddr1,$ipv6naddr2); $carry = sub128($ipv6naddr1,$ipv6naddr2); ($spurious,$cidr) = notcontiguous($mask128); ($carry,$ipv6naddr)=sub128($ipv6naddr1,$ipv6naddr2); $ipv6naddr = ipv4to6($netaddr); $ipv6naddr = mask4to6($netaddr); $ipv6naddr = ipanyto6($netaddr); $ipv6naddr = maskanyto6($netaddr); $netaddr = ipv6to4($pv6naddr); $bcdtext = bin2bcd($bits128); $bits128 = bcd2bin($bcdtxt); =head1 DESCRIPTION B<NetAddr::IP::UtilPP> provides pure Perl functions for B<NetAddr::IP::Util> =over 4 =item * $rv = hasbits($bits128); This function returns true if there are one's present in the 128 bit string and false if all the bits are zero. i.e. if (hasbits($bits128)) { &do_something; } or if (hasbits($bits128 & $mask128) { &do_something; } This allows the implementation of logical functions of the form of: if ($bits128 & $mask128) { ... input: 128 bit IPv6 string returns: true if any bits are present =cut sub _deadlen { my($len,$should) = @_; $len *= 8; $should = 128 unless $should; my $sub = (caller(1))[3]; die "Bad argument length for $sub, is $len, should be $should"; } sub hasbits { _deadlen(length($_[0])) if length($_[0]) != 16; return 1 if vec($_[0],0,32); return 1 if vec($_[0],1,32); return 1 if vec($_[0],2,32); return 1 if vec($_[0],3,32); return 0; } #=item * $rv = isIPv4($bits128); # #This function returns true if there are no on bits present in the IPv6 #portion of the 128 bit string and false otherwise. # #=cut # #sub xisIPv4 { # _deadlen(length($_[0])) # if length($_[0]) != 16; # return 0 if vec($_[0],0,32); # return 0 if vec($_[0],1,32); # return 0 if vec($_[0],2,32); # return 1; #} =item * $bitsXn = shiftleft($bits128,$n); input: 128 bit string variable, number of shifts [optional] returns: bits X n shifts NOTE: input bits are returned if $n is not specified =cut # multiply x 2 # sub _128x2 { my $inp = shift; $$inp[0] = ($$inp[0] << 1 & 0xffffffff) + (($$inp[1] & 0x80000000) ? 1:0); $$inp[1] = ($$inp[1] << 1 & 0xffffffff) + (($$inp[2] & 0x80000000) ? 1:0); $$inp[2] = ($$inp[2] << 1 & 0xffffffff) + (($$inp[3] & 0x80000000) ? 1:0); $$inp[3] = $$inp[3] << 1 & 0xffffffff; } # multiply x 10 # sub _128x10 { my($a128p) = @_; _128x2($a128p); # x2 my @x2 = @$a128p; # save the x2 value _128x2($a128p); _128x2($a128p); # x8 _sa128($a128p,\@x2,0); # add for x10 } sub shiftleft { _deadlen(length($_[0])) if length($_[0]) != 16; my($bits,$shifts) = @_; return $bits unless $shifts; die "Bad arg value for ".__PACKAGE__.":shiftleft, length should be 0 thru 128" if $shifts < 0 || $shifts > 128; my @uint32t = unpack('N4',$bits); do { $bits = _128x2(\@uint32t); $shifts-- } while $shifts > 0; pack('N4',@uint32t); } sub slowadd128 { my @ua = unpack('N4',$_[0]); my @ub = unpack('N4',$_[1]); my $carry = _sa128(\@ua,\@ub,$_[2]); return ($carry,pack('N4',@ua)) if wantarray; return $carry; } sub _sa128 { my($uap,$ubp,$carry) = @_; if (($$uap[3] += $$ubp[3] + $carry) > 0xffffffff) { $$uap[3] -= 4294967296; # 0x1_00000000 $carry = 1; } else { $carry = 0; } if (($$uap[2] += $$ubp[2] + $carry) > 0xffffffff) { $$uap[2] -= 4294967296; $carry = 1; } else { $carry = 0; } if (($$uap[1] += $$ubp[1] + $carry) > 0xffffffff) { $$uap[1] -= 4294967296; $carry = 1; } else { $carry = 0; } if (($$uap[0] += $$ubp[0] + $carry) > 0xffffffff) { $$uap[0] -= 4294967296; $carry = 1; } else { $carry = 0; } $carry; } =item * addconst($ipv6naddr,$signed_32con); Add a signed constant to a 128 bit string variable. input: 128 bit IPv6 string, signed 32 bit integer returns: scalar carry array (carry, result) =cut sub addconst { my($a128,$const) = @_; _deadlen(length($a128)) if length($a128) != 16; unless ($const) { return (wantarray) ? ($const,$a128) : $const; } my $sign = ($const < 0) ? 0xffffffff : 0; my $b128 = pack('N4',$sign,$sign,$sign,$const); @_ = ($a128,$b128,0); # perl 5.8.4 fails with this operation. see perl bug [ 23429] # goto &slowadd128; slowadd128(@_); } =item * add128($ipv6naddr1,$ipv6naddr2); Add two 128 bit string variables. input: 128 bit string var1, 128 bit string var2 returns: scalar carry array (carry, result) =cut sub add128 { my($a128,$b128) = @_; _deadlen(length($a128)) if length($a128) != 16; _deadlen(length($b128)) if length($b128) != 16; @_ = ($a128,$b128,0); # perl 5.8.4 fails with this operation. see perl bug [ 23429] # goto &slowadd128; slowadd128(@_); } =item * sub128($ipv6naddr1,$ipv6naddr2); Subtract two 128 bit string variables. input: 128 bit string var1, 128 bit string var2 returns: scalar carry array (carry, result) Note: The carry from this operation is the result of adding the one's complement of ARG2 +1 to the ARG1. It is logically B<NOT borrow>. i.e. if ARG1 >= ARG2 then carry = 1 or if ARG1 < ARG2 then carry = 0 =cut sub sub128 { _deadlen(length($_[0])) if length($_[0]) != 16; _deadlen(length($_[1])) if length($_[1]) != 16; my $a128 = $_[0]; my $b128 = ~$_[1]; @_ = ($a128,$b128,1); # perl 5.8.4 fails with this operation. see perl bug [ 23429] # goto &slowadd128; slowadd128(@_); } =item * ($spurious,$cidr) = notcontiguous($mask128); This function counts the bit positions remaining in the mask when the rightmost '0's are removed. input: 128 bit netmask returns true if there are spurious zero bits remaining in the mask, false if the mask is contiguous one's, 128 bit cidr =cut sub notcontiguous { _deadlen(length($_[0])) if length($_[0]) != 16; my @ua = unpack('N4', ~$_[0]); my $count; for ($count = 128;$count > 0; $count--) { last unless $ua[3] & 1; $ua[3] >>= 1; $ua[3] |= 0x80000000 if $ua[2] & 1; $ua[2] >>= 1; $ua[2] |= 0x80000000 if $ua[1] & 1; $ua[1] >>= 1; $ua[1] |= 0x80000000 if $ua[0] & 1; $ua[0] >>= 1; } my $spurious = $ua[0] | $ua[1] | $ua[2] | $ua[3]; return $spurious unless wantarray; return ($spurious,$count); } =item * $ipv6naddr = ipv4to6($netaddr); Convert an ipv4 network address into an ipv6 network address. input: 32 bit network address returns: 128 bit network address =cut sub ipv4to6 { _deadlen(length($_[0]),32) if length($_[0]) != 4; # return pack('L3H8',0,0,0,unpack('H8',$_[0])); return pack('L3a4',0,0,0,$_[0]); } =item * $ipv6naddr = mask4to6($netaddr); Convert an ipv4 netowrk address into an ipv6 network mask. input: 32 bit network/mask address returns: 128 bit network/mask address NOTE: returns the high 96 bits as one's =cut sub mask4to6 { _deadlen(length($_[0]),32) if length($_[0]) != 4; # return pack('L3H8',0xffffffff,0xffffffff,0xffffffff,unpack('H8',$_[0])); return pack('L3a4',0xffffffff,0xffffffff,0xffffffff,$_[0]); } =item * $ipv6naddr = ipanyto6($netaddr); Similar to ipv4to6 except that this function takes either an IPv4 or IPv6 input and always returns a 128 bit IPv6 network address. input: 32 or 128 bit network address returns: 128 bit network address =cut sub ipanyto6 { my $naddr = shift; my $len = length($naddr); return $naddr if $len == 16; # return pack('L3H8',0,0,0,unpack('H8',$naddr)) return pack('L3a4',0,0,0,$naddr) if $len == 4; _deadlen($len,'32 or 128'); } =item * $ipv6naddr = maskanyto6($netaddr); Similar to mask4to6 except that this function takes either an IPv4 or IPv6 netmask and always returns a 128 bit IPv6 netmask. input: 32 or 128 bit network mask returns: 128 bit network mask =cut sub maskanyto6 { my $naddr = shift; my $len = length($naddr); return $naddr if $len == 16; # return pack('L3H8',0xffffffff,0xffffffff,0xffffffff,unpack('H8',$naddr)) return pack('L3a4',0xffffffff,0xffffffff,0xffffffff,$naddr) if $len == 4; _deadlen($len,'32 or 128'); } =item * $netaddr = ipv6to4($pv6naddr); Truncate the upper 96 bits of a 128 bit address and return the lower 32 bits. Returns an IPv4 address as returned by inet_aton. input: 128 bit network address returns: 32 bit inet_aton network address =cut sub ipv6to4 { my $naddr = shift; _deadlen(length($naddr)) if length($naddr) != 16; @_ = unpack('L3H8',$naddr); return pack('H8',@{_}[3..10]); } =item * $bcdtext = bin2bcd($bits128); Convert a 128 bit binary string into binary coded decimal text digits. input: 128 bit string variable returns: string of bcd text digits =cut sub bin2bcd { _deadlen(length($_[0])) if length($_[0]) != 16; unpack("H40",&_bin2bcdn) =~ /^0*(.+)/; $1; } =item * $bits128 = bcd2bin($bcdtxt); Convert a bcd text string to 128 bit string variable input: string of bcd text digits returns: 128 bit string variable =cut sub bcd2bin { &_bcdcheck; # perl 5.8.4 fails with this operation. see perl bug [ 23429] # goto &_bcd2bin; &_bcd2bin; } =pod =back =cut #=item * $onescomp = comp128($ipv6addr); # #This function is for testing, it is more efficient to use perl " ~ " #on the bit string directly. This interface to the B<C> routine is published for #module testing purposes because it is used internally in the B<sub128> routine. The #function is very fast, but calling if from perl directly is very slow. It is almost #33% faster to use B<sub128> than to do a 1's comp with perl and then call #B<add128>. In the PurePerl version, it is a call to # # sub {return ~ $_[0]}; # #=cut sub comp128 { _deadlen(length($_[0])) if length($_[0]) != 16; return ~ $_[0]; } #=item * $bcdpacked = bin2bcdn($bits128); # #Convert a 128 bit binary string into binary coded decimal digits. #This function is for testing only. # # input: 128 bit string variable # returns: string of packed decimal digits # # i.e. text = unpack("H*", $bcd); # #=cut sub bin2bcdn { _deadlen(length($_[0])) if length($_[0]) != 16; # perl 5.8.4 fails with this operation. see perl bug [ 23429] # goto &_bin2bcdn; &_bin2bcdn; } sub _bin2bcdn { my($b128) = @_; my @binary = unpack('N4',$b128); my @nbcd = (0,0,0,0,0); # 5 - 32 bit registers my ($add3, $msk8, $bcd8, $carry, $tmp); my $j = 0; my $k = -1; my $binmsk = 0; foreach(0..127) { unless ($binmsk) { $binmsk = 0x80000000; $k++; } $carry = $binary[$k] & $binmsk; $binmsk >>= 1; next unless $carry || $j; # skip leading zeros foreach(4,3,2,1,0) { $bcd8 = $nbcd[$_]; $add3 = 3; $msk8 = 8; $j = 0; while ($j < 8) { $tmp = $bcd8 + $add3; if ($tmp & $msk8) { $bcd8 = $tmp; } $add3 <<= 4; $msk8 <<= 4; $j++; } $tmp = $bcd8 & 0x80000000; # propagate carry $bcd8 <<= 1; # x2 if ($carry) { $bcd8 += 1; } $nbcd[$_] = $bcd8; $carry = $tmp; } } pack('N5',@nbcd); } #=item * $bcdtext = bcdn2txt($bcdpacked); # #Convert a packed bcd string into text digits, suppress the leading zeros. #This function is for testing only. # # input: string of packed decimal digits # consisting of exactly 40 digits # returns: hexdecimal digits # #Similar to unpack("H*", $bcd); # #=cut sub bcdn2txt { die "Bad argument length for ".__PACKAGE__.":bcdn2txt, is ".(2 * length($_[0])).", should be exactly 40 digits" if length($_[0]) != 20; (unpack('H40',$_[0])) =~ /^0*(.+)/; $1; } #=item * $bits128 = bcdn2bin($bcdpacked,$ndigits); # # Convert a packed bcd string into a 128 bit string variable # # input: packed bcd string # number of digits in string # returns: 128 bit string variable # sub bcdn2bin { my($bcd,$dc) = @_; $dc = 0 unless $dc; die "Bad argument length for ".__PACKAGE__.":bcdn2txt, is ".(2 * length($bcd)).", should be 1 to 40 digits" if length($bcd) > 20; die "Bad digit count for ".__PACKAGE__.":bcdn2bin, is $dc, should be 1 to 40 digits" if $dc < 1 || $dc > 40; return _bcd2bin(unpack("H$dc",$bcd)); } sub _bcd2bin { my @bcd = split('',$_[0]); my @hbits = (0,0,0,0); my @digit = (0,0,0,0); my $found = 0; foreach(@bcd) { my $bcd = $_ & 0xf; # just the nibble unless ($found) { next unless $bcd; # skip leading zeros $found = 1; $hbits[3] = $bcd; # set the first digit, no x10 necessary next; } _128x10(\@hbits); $digit[3] = $bcd; _sa128(\@hbits,\@digit,0); } return pack('N4',@hbits); } #=item * $bcdpacked = simple_pack($bcdtext); # #Convert a numeric string into a packed bcd string, left fill with zeros #This function is for testing only. # # input: string of decimal digits # returns: string of packed decimal digits # #Similar to pack("H*", $bcdtext); # sub _bcdcheck { my($bcd) = @_;; my $sub = (caller(1))[3]; my $len = length($bcd); die "Bad bcd number length $_ ".__PACKAGE__.":simple_pack, should be 1 to 40 digits" if $len > 40 || $len < 1; die "Bad character in decimal input string '$1' for ".__PACKAGE__.":simple_pack" if $bcd =~ /(\D)/; } sub simple_pack { &_bcdcheck; my($bcd) = @_; while (length($bcd) < 40) { $bcd = '0'. $bcd; } return pack('H40',$bcd); } =head1 EXPORT_OK hasbits shiftleft addconst add128 sub128 notcontiguous ipv4to6 mask4to6 ipanyto6 maskanyto6 ipv6to4 bin2bcd bcd2bin comp128 bin2bcdn bcdn2txt bcdn2bin simple_pack threads =head1 AUTHOR Michael Robinton E<lt>michael@bizsystems.comE<gt> =head1 COPYRIGHT Copyright 2003 - 2012, Michael Robinton E<lt>michael@bizsystems.comE<gt> All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the "Artistic License" which comes with this distribution. 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 either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this distribution, in the file named "Artistic". If not, I'll be glad to provide one. You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =head1 AUTHOR Michael Robinton <michael@bizsystems.com> =cut 1; Lite/Util/lib/NetAddr/IP/InetBase.pm 0000644 00000045421 15043770025 0013016 0 ustar 00 #!/usr/bin/perl package NetAddr::IP::InetBase; use strict; #use diagnostics; #use lib qw(blib lib); use vars qw($VERSION @EXPORT_OK @ISA %EXPORT_TAGS $Mode); use AutoLoader qw(AUTOLOAD); require Exporter; @ISA = qw(Exporter); $VERSION = do { my @r = (q$Revision: 0.08 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; @EXPORT_OK = qw( inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_ntop inet_pton packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 fake_AF_INET6 fillIPv4 ); %EXPORT_TAGS = ( all => [@EXPORT_OK], ipv4 => [qw( inet_aton inet_ntoa fillIPv4 )], ipv6 => [qw( ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_pton inet_ntop packzeros )], ); # prototypes sub inet_ntoa; sub ipv6_aton; sub ipv6_ntoa; sub inet_any2n($); sub inet_n2dx($); sub inet_n2ad($); sub _inet_ntop; sub _inet_pton; my $emulateAF_INET6 = 0; { no warnings 'once'; *packzeros = \&_packzeros; ## dynamic configuraton for IPv6 require Socket; *AF_INET = \&Socket::AF_INET; if (eval { AF_INET6() } ) { *AF_INET6 = \&Socket::AF_INET6; $emulateAF_INET6 = -1; # have it, remind below } if (eval{ require Socket6 } ) { import Socket6 qw( inet_pton inet_ntop ); unless ($emulateAF_INET6) { *AF_INET6 = \&Socket6::AF_INET6; } $emulateAF_INET6 = 0; # clear, have it from elsewhere or here } else { unless ($emulateAF_INET6) { # unlikely at this point if ($^O =~ /(?:free|dragon.+)bsd/i) { # FreeBSD, DragonFlyBSD $emulateAF_INET6 = 28; } elsif ($^O =~ /bsd/i) { # other BSD flavors like NetBDS, OpenBSD, BSD $emulateAF_INET6 = 24; } elsif ($^O =~ /(?:darwin|mac)/i) { # Mac OS X $emulateAF_INET6 = 30; } elsif ($^O =~ /win/i) { # Windows $emulateAF_INET6 = 23; } elsif ($^O =~ /(?:solaris|sun)/i) { # Sun box $emulateAF_INET6 = 26; } else { # use linux default $emulateAF_INET6 = 10; } *AF_INET6 = sub { $emulateAF_INET6; }; } else { $emulateAF_INET6 = 0; # clear, have it from elsewhere } *inet_pton = \&_inet_pton; *inet_ntop = \&_inet_ntop; } } # end no warnings 'once' sub fake_AF_INET6 { return $emulateAF_INET6; } # allow user to choose upper or lower case BEGIN { use vars qw($n2x_format $n2d_format); $n2x_format = "%x:%x:%x:%x:%x:%x:%x:%x"; $n2d_format = "%x:%x:%x:%x:%x:%x:%d.%d.%d.%d"; } my $case = 0; # default lower case sub upper { $n2x_format = uc($n2x_format); $n2d_format = uc($n2d_format); $case = 1; } sub lower { $n2x_format = lc($n2x_format); $n2d_format = lc($n2d_format); $case = 0; } sub ipv6_n2x { die "Bad arg length for 'ipv6_n2x', length is ". length($_[0]) ." should be 16" unless length($_[0]) == 16; return sprintf($n2x_format,unpack("n8",$_[0])); } sub ipv6_n2d { die "Bad arg length for 'ipv6_n2d', length is ". length($_[0]) ." should be 16" unless length($_[0]) == 16; my @hex = (unpack("n8",$_[0])); $hex[9] = $hex[7] & 0xff; $hex[8] = $hex[7] >> 8; $hex[7] = $hex[6] & 0xff; $hex[6] >>= 8; return sprintf($n2d_format,@hex); } # if Socket lib is broken in some way, check for overange values # #my $overange = yinet_aton('256.1') ? 1:0; #my $overange = gethostbyname('256.1') ? 1:0; #sub inet_aton { # unless (! $overange || $_[0] =~ /[^0-9\.]/) { # hostname # my @dq = split(/\./,$_[0]); # foreach (@dq) { # return undef if $_ > 255; # } # } # scalar gethostbyname($_[0]); #} sub fillIPv4 { my $host = $_[0]; return undef unless defined $host; if ($host =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/) { if (defined $4) { return undef unless $1 >= 0 && $1 < 256 && $2 >= 0 && $2 < 256 && $3 >= 0 && $3 < 256 && $4 >= 0 && $4 < 256; $host = $1.'.'.$2.'.'.$3.'.'.$4; # return pack('C4',$1,$2,$3,$4); # $host = ($1 << 24) + ($2 << 16) + ($3 << 8) + $4; } elsif (defined $3) { return undef unless $1 >= 0 && $1 < 256 && $2 >= 0 && $2 < 256 && $3 >= 0 && $3 < 256; $host = $1.'.'.$2.'.0.'.$3 # return pack('C4',$1,$2,0,$3); # $host = ($1 << 24) + ($2 << 16) + $3; } elsif (defined $2) { return undef unless $1 >= 0 && $1 < 256 && $2 >= 0 && $2 < 256; $host = $1.'.0.0.'.$2; # return pack('C4',$1,0,0,$2); # $host = ($1 << 24) + $2; } else { $host = '0.0.0.'.$1; # return pack('C4',0,0,0,$1); # $host = $1; } # return pack('N',$host); } $host; } sub inet_aton { my $host = fillIPv4($_[0]); return $host ? scalar gethostbyname($host) : undef; } #sub inet_aton { # my $host = $_[0]; # return undef unless defined $host; # if ($host =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/) { # if (defined $4) { # return undef unless # $1 >= 0 && $1 < 256 && # $2 >= 0 && $2 < 256 && # $3 >= 0 && $3 < 256 && # $4 >= 0 && $4 < 256; # return pack('C4',$1,$2,$3,$4); ## $host = ($1 << 24) + ($2 << 16) + ($3 << 8) + $4; # } elsif (defined $3) { # return undef unless # $1 >= 0 && $1 < 256 && # $2 >= 0 && $2 < 256 && # $3 >= 0 && $3 < 256; # return pack('C4',$1,$2,0,$3); ## $host = ($1 << 24) + ($2 << 16) + $3; # } elsif (defined $2) { # return undef unless # $1 >= 0 && $1 < 256 && # $2 >= 0 && $2 < 256; # return pack('C4',$1,0,0,$2); ## $host = ($1 << 24) + $2; # } else { # return pack('C4',0,0,0,$1); ## $host = $1; # } ## return pack('N',$host); # } # scalar gethostbyname($host); #} my $_zero = pack('L4',0,0,0,0); my $_ipv4mask = pack('L4',0xffffffff,0xffffffff,0xffffffff,0); sub isIPv4 { if (length($_[0]) != 16) { my $sub = (caller(1))[3] || (caller(0))[3]; die "Bad arg length for $sub, length is ". (length($_[0]) *8) .", should be 128"; } return ($_[0] & $_ipv4mask) eq $_zero ? 1 : 0; } my $_newV4compat = pack('N4',0,0,0xffff,0); sub isNewIPv4 { my $naddr = $_[0] ^ $_newV4compat; return isIPv4($naddr); } sub isAnyIPv4 { my $naddr = $_[0]; my $rv = isIPv4($_[0]); return $rv if $rv; return isNewIPv4($naddr); } sub DESTROY {}; sub import { if (grep { $_ eq ':upper' } @_) { upper(); @_ = grep { $_ ne ':upper' } @_; } NetAddr::IP::InetBase->export_to_level(1,@_); } 1; __END__ =head1 NAME NetAddr::IP::InetBase -- IPv4 and IPV6 utilities =head1 SYNOPSIS use NetAddr::IP::Base qw( :upper inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_pton inet_ntop packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 fake_AF_INET6 fillIPv4 ); use NetAddr::IP::Util qw(:all :inet :ipv4 :ipv6 :math) :ipv4 => inet_aton, inet_ntoa, fillIPv4 :ipv6 => ipv6_aton, ipv6_ntoa,ipv6_n2x, ipv6_n2d, inet_any2n, inet_n2dx, inet_n2ad inet_pton, inet_ntop, packzeros $dotquad = inet_ntoa($netaddr); $netaddr = inet_aton($dotquad); $ipv6naddr = ipv6_aton($ipv6_text); $ipv6_text = ipv6_ntoa($ipv6naddr); $hex_text = ipv6_n2x($ipv6naddr); $dec_text = ipv6_n2d($ipv6naddr); $ipv6naddr = inet_any2n($dotquad or $ipv6_text); $dotquad or $hex_text = inet_n2dx($ipv6naddr); $dotquad or $dec_text = inet_n2ad($ipv6naddr); $netaddr = inet_pton($AF_family,$text_addr); $text_addr = inet_ntop($AF_family,$netaddr); $hex_text = packzeros($hex_text); $rv = isIPv4($bits128); $rv = isNewIPv4($bits128); $rv = isAnyIPv4($bits128); $constant = AF_INET(); $constant = AF_INET6(); $trueif = fake_AF_INET6(); $ip_filled = fillIPv4($shortIP); NetAddr::IP::InetBase::lower(); NetAddr::IP::InetBase::upper(); =head1 INSTALLATION Un-tar the distribution in an appropriate directory and type: perl Makefile.PL make make test make install =head1 DESCRIPTION B<NetAddr::IP::InetBase> provides a suite network of conversion functions written in pure Perl for converting both IPv4 and IPv6 addresses to and from network address format and text format. The IPv6 functions support all rfc1884 formats. i.e. x:x:x:x:x:x:x:x:x x:x:x:x:x:x:x:d.d.d.d ::x:x:x ::x:d.d.d.d and so on... =over 4 =item * $dotquad = inet_ntoa($netaddr); Convert a packed IPv4 network address to a dot-quad IP address. input: packed network address returns: IP address i.e. 10.4.12.123 =cut sub inet_ntoa { die 'Bad arg length for '. __PACKAGE__ ."::inet_ntoa, length is ". length($_[0]) ." should be 4" unless length($_[0]) == 4; my @hex = (unpack("n2",$_[0])); $hex[3] = $hex[1] & 0xff; $hex[2] = $hex[1] >> 8; $hex[1] = $hex[0] & 0xff; $hex[0] >>= 8; return sprintf("%d.%d.%d.%d",@hex); } =item * $netaddr = inet_aton($dotquad); Convert a dot-quad IP address into an IPv4 packed network address. input: IP address i.e. 192.5.16.32 returns: packed network address =item * $ipv6addr = ipv6_aton($ipv6_text); Takes an IPv6 address of the form described in rfc1884 and returns a 128 bit binary RDATA string. input: ipv6 text returns: 128 bit RDATA string =cut sub ipv6_aton { my($ipv6) = @_; return undef unless $ipv6; local($1,$2,$3,$4,$5); if ($ipv6 =~ /^(.*:)(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { # mixed hex, dot-quad return undef if $2 > 255 || $3 > 255 || $4 > 255 || $5 > 255; $ipv6 = sprintf("%s%X%02X:%X%02X",$1,$2,$3,$4,$5); # convert to pure hex } my $c; return undef if $ipv6 =~ /[^:0-9a-fA-F]/ || # non-hex character (($c = $ipv6) =~ s/::/x/ && $c =~ /(?:x|:):/) || # double :: ::? $ipv6 =~ /[0-9a-fA-F]{5,}/; # more than 4 digits $c = $ipv6 =~ tr/:/:/; # count the colons return undef if $c < 7 && $ipv6 !~ /::/; if ($c > 7) { # strip leading or trailing :: return undef unless $ipv6 =~ s/^::/:/ || $ipv6 =~ s/::$/:/; return undef if --$c > 7; } while ($c++ < 7) { # expand compressed fields $ipv6 =~ s/::/:::/; } $ipv6 .= 0 if $ipv6 =~ /:$/; my @hex = split(/:/,$ipv6); foreach(0..$#hex) { $hex[$_] = hex($hex[$_] || 0); } pack("n8",@hex); } =item * $ipv6text = ipv6_ntoa($ipv6naddr); Convert a 128 bit binary IPv6 address to compressed rfc 1884 text representation. input: 128 bit RDATA string returns: ipv6 text =cut sub ipv6_ntoa { return inet_ntop(AF_INET6(),$_[0]); } =item * $hex_text = ipv6_n2x($ipv6addr); Takes an IPv6 RDATA string and returns an 8 segment IPv6 hex address input: 128 bit RDATA string returns: x:x:x:x:x:x:x:x Note: this function does NOT compress adjacent strings of 0:0:0:0 into the :: format =item * $dec_text = ipv6_n2d($ipv6addr); Takes an IPv6 RDATA string and returns a mixed hex - decimal IPv6 address with the 6 uppermost chunks in hex and the lower 32 bits in dot-quad representation. input: 128 bit RDATA string returns: x:x:x:x:x:x:d.d.d.d Note: this function does NOT compress adjacent strings of 0:0:0:0 into the :: format =item * $ipv6naddr = inet_any2n($dotquad or $ipv6_text); This function converts a text IPv4 or IPv6 address in text format in any standard notation into a 128 bit IPv6 string address. It prefixes any dot-quad address (if found) with '::' and passes it to B<ipv6_aton>. input: dot-quad or rfc1844 address returns: 128 bit IPv6 string =cut sub inet_any2n($) { my($addr) = @_; $addr = '' unless $addr; $addr = '::' . $addr unless $addr =~ /:/; return ipv6_aton($addr); } =item * $dotquad or $hex_text = inet_n2dx($ipv6naddr); This function B<does the right thing> and returns the text for either a dot-quad IPv4 or a hex notation IPv6 address. input: 128 bit IPv6 string returns: ddd.ddd.ddd.ddd or x:x:x:x:x:x:x:x Note: this function does NOT compress adjacent strings of 0:0:0:0 into the :: format =cut sub inet_n2dx($) { my($nadr) = @_; if (isAnyIPv4($nadr)) { local $1; ipv6_n2d($nadr) =~ /([^:]+)$/; return $1; } return ipv6_n2x($nadr); } =item * $dotquad or $dec_text = inet_n2ad($ipv6naddr); This function B<does the right thing> and returns the text for either a dot-quad IPv4 or a hex::decimal notation IPv6 address. input: 128 bit IPv6 string returns: ddd.ddd.ddd.ddd or x:x:x:x:x:x:ddd.ddd.ddd.dd Note: this function does NOT compress adjacent strings of 0:0:0:0 into the :: format =cut sub inet_n2ad($) { my($nadr) = @_; my $addr = ipv6_n2d($nadr); return $addr unless isAnyIPv4($nadr); local $1; $addr =~ /([^:]+)$/; return $1; } =item * $netaddr = inet_pton($AF_family,$text_addr); This function takes an IP address in IPv4 or IPv6 text format and converts it into binary format. The type of IP address conversion is controlled by the FAMILY argument. NOTE: inet_pton, inet_ntop and AF_INET6 come from the Socket6 library if it is present on this host. =cut sub _inet_pton { my($af,$ip) = @_; die 'Bad address family for '. __PACKAGE__ ."::inet_pton, got $af" unless $af == AF_INET6() || $af == AF_INET(); if ($af == AF_INET()) { inet_aton($ip); } else { ipv6_aton($ip); } } =item * $text_addr = inet_ntop($AF_family,$netaddr); This function takes and IP address in binary format and converts it into text format. The type of IP address conversion is controlled by the FAMILY argument. NOTE: inet_ntop ALWAYS returns lowercase characters. NOTE: inet_pton, inet_ntop and AF_INET6 come from the Socket6 library if it is present on this host. =cut sub _inet_ntop { my($af,$naddr) = @_; die 'Unsupported address family for '. __PACKAGE__ ."::inet_ntop, af is $af" unless $af == AF_INET6() || $af == AF_INET(); if ($af == AF_INET()) { inet_ntoa($naddr); } else { return ($case) ? lc packzeros(ipv6_n2x($naddr)) : _packzeros(ipv6_n2x($naddr)); } } =item * $hex_text = packzeros($hex_text); This function optimizes and rfc 1884 IPv6 hex address to reduce the number of long strings of zero bits as specified in rfc 1884, 2.2 (2) by substituting B<::> for the first occurence of the longest string of zeros in the address. =cut sub _packzeros { my $x6 = shift; if ($x6 =~ /\:\:/) { # already contains :: # then re-optimize $x6 = ($x6 =~ /\:\d+\.\d+\.\d+\.\d+/) # ipv4 notation ? ? ipv6_n2d(ipv6_aton($x6)) : ipv6_n2x(ipv6_aton($x6)); } $x6 = ':'. lc $x6; # prefix : & always lower case my $d = ''; if ($x6 =~ /(.+\:)(\d+\.\d+\.\d+\.\d+)/) { # if contains dot quad $x6 = $1; # save hex piece $d = $2; # and dot quad piece } $x6 .= ':'; # suffix : $x6 =~ s/\:0+/\:0/g; # compress strings of 0's to single '0' $x6 =~ s/\:0([1-9a-f]+)/\:$1/g; # eliminate leading 0's in hex strings my @x = $x6 =~ /(?:\:0)*/g; # split only strings of :0:0..." my $m = 0; my $i = 0; for (0..$#x) { # find next longest pattern :0:0:0... my $len = length($x[$_]); next unless $len > $m; $m = $len; $i = $_; # index to first longest pattern } if ($m > 2) { # there was a string of 2 or more zeros $x6 =~ s/$x[$i]/\:/; # replace first longest :0:0:0... with "::" unless ($i) { # if it is the first match, $i = 0 $x6 = substr($x6,0,-1); # keep the leading ::, remove trailing ':' } else { $x6 = substr($x6,1,-1); # else remove leading & trailing ':' } $x6 .= ':' unless $x6 =~ /\:\:/; # restore ':' if match and we can't see it, implies trailing '::' } else { # there was no match $x6 = substr($x6,1,-1); # remove leading & trailing ':' } $x6 .= $d; # append digits if any return $case ? uc $x6 : $x6; } =item * $ipv6naddr = ipv4to6($netaddr); Convert an ipv4 network address into an ipv6 network address. input: 32 bit network address returns: 128 bit network address =item * $rv = isIPv4($bits128); This function returns true if there are no on bits present in the IPv6 portion of the 128 bit string and false otherwise. i.e. the address must be of the form - ::d.d.d.d Note: this is an old and deprecated ipV4 compatible ipV6 address =item * $rv = isNewIPv4($bits128); This function return true if the IPv6 128 bit string is of the form ::ffff:d.d.d.d =item * $rv = isAnyIPv4($bits128); This function return true if the IPv6 bit string is of the form ::d.d.d.d or ::ffff:d.d.d.d =item * NetAddr::IP::InetBase::lower(); Return IPv6 strings in lowercase. This is the default. =item * NetAddr::IP::InetBase::upper(); Return IPv6 strings in uppercase. The default may be set to uppercase when the module is loaded by invoking the TAG :upper. i.e. use NetAddr::IP::InetBase qw( :upper ); =item * $constant = AF_INET; This function returns the system value for AF_INET. =item * $constant = AF_INET6; AF_INET6 is sometimes present in the Socket library and always present in the Socket6 library. When the Socket library does not contain AF_INET6 and when Socket6 is not present, a place holder value is C<guessed> based on the underlying host operating system. See B<fake_AF_INET6> below. NOTE: inet_pton, inet_ntop and AF_INET6 come from the Socket6 library if it is present on this host. =item * $trueif = fake_AF_INET6; This function return FALSE if AF_INET6 is provided by Socket or Socket6. Otherwise, it returns the best guess value based on name of the host operating system. =item * $ip_filled = fillIPv4($shortIP); This function converts IPv4 addresses of the form 127.1 to the long form 127.0.0.1 If the function is passed an argument that does not match the form of an IP address, the original argument is returned. i.e. pass it a hostname or a short IP and it will return a hostname or a filled IP. =back =head1 EXPORT_OK :upper inet_aton inet_ntoa ipv6_aton ipv6_ntoa ipv6_n2x ipv6_n2d inet_any2n inet_n2dx inet_n2ad inet_pton inet_ntop packzeros isIPv4 isNewIPv4 isAnyIPv4 AF_INET AF_INET6 fake_AF_INET6 fillIPv4 =head1 %EXPORT_TAGS :all :ipv4 :ipv6 :upper =head1 AUTHOR Michael Robinton <michael@bizsystems.com> =head1 COPYRIGHT Copyright 2003 - 2012, Michael Robinton E<lt>michael@bizsystems.comE<gt> All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version, or b) the "Artistic License" which comes with this distribution. 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 either the GNU General Public License or the Artistic License for more details. You should have received a copy of the Artistic License with this distribution, in the file named "Artistic". If not, I'll be glad to provide one. You should also have received a copy of the GNU General Public License along with this program in the file named "Copying". If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =head1 AUTHOR Michael Robinton <michael@bizsystems.com> =head1 SEE ALSO NetAddr::IP(3), NetAddr::IP::Lite(3), NetAddr::IP::Util(3) =cut 1; Lite/Util/MYMETA.json 0000644 00000001431 15043770025 0010247 0 ustar 00 { "abstract" : "unknown", "author" : [ "unknown" ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.150010", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "NetAddr-IP-Util", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } } }, "release_status" : "stable", "version" : "1.53", "x_serialization_backend" : "JSON::PP version 4.06" } Lite/Util/Util.o 0000644 00001301230 15043770025 0007456 0 ustar 00 ELF >