Net-Interface-1.012/0000755000000000000000000000000011345243332012637 5ustar rootrootNet-Interface-1.012/ni_get_set.c0000644000000000000120000001043111150603013015234 0ustar rootwheel/* ******************************************************************** * * ni_get_set.c version 0.01 2-8-09 * * * * COPYRIGHT 2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "localconf.h" /* **************************************************** * * standard SIOCget functions * * * * execute supported ioctl's * * where a value is requested, return it * * otherwise it is up to the user to retrieve * * information via their pointers * * returns -1 on error, sets errno * * **************************************************** */ int32_t ni_get_any(int fd, int cmd, void * ifr) { switch (cmd) { case SIOCGIFMTU : case SIOCGIFMETRIC : case SIOCGIFFLAGS : #ifdef SIOCGIFINDEX case SIOCGIFINDEX : #endif case SIOCGIFADDR : case SIOCGIFNETMASK : case SIOCGIFBRDADDR : case SIOCGIFDSTADDR : break; default : errno = ENOSYS; return -1; } if (ioctl(fd,cmd,ifr) < 0) return -1; switch (cmd) { case SIOCGIFFLAGS : case SIOCGIFMETRIC : case SIOCGIFMTU : #ifdef SIOCGIFINDEX case SIOCGIFINDEX : #endif return ((struct nifreq *)ifr)->ni_int; } return 0; } /* **************************************************** * * standard SIOCset functions * * * * execute supported ioctl's * * returns -1 on error, sets errno * * * * struct nifreq ifr should be prepared, for * * add/modify of a Linux ipV6 address, the * * PREFIX/CIDR value should be stored at: * * * * ifr->ni_sin6.sin6_port * * * * **************************************************** */ #if defined (__ni_Linux) && defined (LOCAL_SIZEOF_SOCKADDR_IN6) struct lin6_ifreq { struct in6_addr lin6_addr; u_int32_t lin6_prfx; u_int lin6_indx; }; # endif /* This routine must have ALL possible set commands * Remember that ifr may need offset as is the case with LIFREQ * Use with care. See $if->flags in Interface.xs */ int ni_set_any(int fd, int cmd, struct nifreq * ifr) { #if defined (__ni_Linux) && defined (LOCAL_SIZEOF_SOCKADDR_IN6) struct lin6_ifreq ifr6; #endif switch (cmd) { case SIOCSIFFLAGS : #ifdef SIOCSLIFFLAGS case SIOCSLIFFLAGS : #endif case SIOCSIFMETRIC : case SIOCSIFMTU : break; case SIOCSIFADDR : case SIOCSIFDSTADDR : case SIOCSIFBRDADDR : case SIOCSIFNETMASK : #ifdef SIOCDIFADDR case SIOCDIFADDR : #endif #if defined (__ni_Linux) && defined (LOCAL_SIZEOF_SOCKADDR_IN6) if (ifr->ni_saddr.sa_family == AF_INET6) { memcpy(&ifr6.lin6_addr,&ifr->ni_sin6.sin6_addr,LOCAL_SIZEOF_SOCKADDR_IN6); ifr6.lin6_prfx = ifr->ni_sin6.sin6_port; /* temporarily stored here */ if (ioctl(fd,SIOCGIFINDEX,&ifr) < 0) return -1; ifr6.lin6_indx = ifr->ni_ushort; ifr = (struct nifreq *)&ifr6; /* lie about cast */ } #endif break; default : errno = ENOSYS; return -1; } if (ioctl(fd,cmd,ifr) < 0) return -1; return 0; } Net-Interface-1.012/install-sh0000644000000000000120000000000011145133734014754 0ustar rootwheelNet-Interface-1.012/Artistic0000444000000000000120000001373711145133734014503 0ustar rootwheel The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Net-Interface-1.012/ni_malloc.c0000644000000000000120000000430611147135321015065 0ustar rootwheel /* ******************************************************************** * * ni_malloc.c version 0.01 2-11-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "config.h" int __ni_malloc_c_silence_warning; #if HAVE_MALLOC == 0 || HAVE_REALLOC == 0 /* if this OS has buggy memory allocation, fix it */ #warning FUNCTIONS calloc, malloc, realloc, free re-defined because of buggy C lib #include #include void * ni_rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc(n); } void * ni_rpl_calloc (size_t mbsz, size_t n) { if (n == 0) n = 1; return calloc(mbsz,n); } void * ni_rpl_realloc (void * ptr, size_t n) { if (ptr == NULL) return malloc(n); return realloc(ptr,n); } void ni_rpl_free (void * ptr) { if (ptr != NULL) free(ptr); } #endif Net-Interface-1.012/MANIFEST0000644000000000000000000000176211151110420013760 0ustar rootrootArtistic Changes Copying Interface.pm Interface.xs MANIFEST MANIFEST.SKIP README Makefile.PL build_stuff/sioc_s.txt build_stuff/generate_SIOCS.pl build_stuff/make_defaults.pl build_stuff/make_ordered_list.pl build_stuff/make_config_acheck.pl build_stuff/make_smi-numbers.pl config.guess config.h.in config.sub configure configure.ac defaults.h file_definitions hints/solaris_2.pl inet_aton.c inst/netsymbols.pl install-sh miniSocketXS.c localconf.h ni_fallbackhwaddr.c ni_funct.h ni_getifaddrs.c ni_ifreq.c ni_in6_ifreq.c ni_lifreq.c ni_malloc.c ni_memcmp.c ni_memcmp.h ni_get_set.c ni_strlcpy.c ni_strlcpy.h ni_util.c ni_linuxproc.c ni_SMI-NUMBERS.c ppport.h test.pl.developer typemap ni_in6_classify.c ni_af_inetcommon.c ni_fixups.h lib/Net/Interface/Developer.pm t/badd.t t/faceinfo.t t/inet_xtox.t t/ipv4_inet.t t/ipv6compress.t t/mac_bin2hex.t t/mask2plen.t t/plen2print.t t/simplesets.t t/strlcpy.t t/symbols.t t/typescope.t META.yml Module meta-data (added by MakeMaker) Net-Interface-1.012/ni_linuxproc.c0000644000000000000120000002503011155153266015645 0ustar rootwheel /* ******************************************************************** * * ni_linuxproc.c version 0.04 3-9-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "localconf.h" #ifdef __ni_Linux #define _PATH_PROCNET_DEV "/proc/net/dev" #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" /* should be include from /linux/include/linux/rtnetlink.h */ /* ifa_flags */ #ifndef IFA_F_SECONDARY #define IFA_F_SECONDARY 0x01 #endif #ifndef IFA_F_TEMPORARY #define IFA_F_TEMPORARY IFA_F_SECONDARY #endif #ifndef IFA_F_NODAD #define IFA_F_NODAD 0x02 #endif #ifndef IFA_F_OPTIMISTIC #define IFA_F_OPTIMISTIC 0x04 #endif #ifndef IFA_F_HOMEADDRESS #define IFA_F_HOMEADDRESS 0x10 #endif #ifndef IFA_F_DEPRECATED #define IFA_F_DEPRECATED 0x20 #endif #ifndef IFA_F_TENTATIVE #define IFA_F_TENTATIVE 0x40 #endif #ifndef IFA_F_PERMANENT #define IFA_F_PERMANENT 0x80 #endif static void lx_ifa_f_flags(int flags) { if (flags & IFA_F_SECONDARY) printf("Secondory "); if (flags & IFA_F_NODAD) printf("NoDAD "); if (flags & IFA_F_OPTIMISTIC) printf("Optimistic "); if (flags & IFA_F_HOMEADDRESS) printf("Home "); if (flags & IFA_F_DEPRECATED) printf("Deprecated "); if (flags & IFA_F_TENTATIVE) printf("Tentative "); if (flags & IFA_F_PERMANENT) printf("Permanent "); } struct ni_linux_iface { char devname[20]; char chp[8][5]; #if LOCAL_SIZEOF_POINTER == 8 char _pad[4]; #endif /* align 64 bit host */ int plen; int scope; int dad; int idx; }; /* ******************************************** * * return n * the sizeof above structure * * blocks of info about /proc/net/if_net6 * * this memory must be free(d) * * ******************************************** */ /* plen idx scp flgs 00000000000000000000000000000001 01 80 10 80 lo fe8000000000000002a0ccfffe26d380 02 40 20 80 eth0 */ static struct ni_linux_iface * lx_get_addr() { FILE * fd; int n = 1; struct ni_linux_iface * net6, * origin = NULL; if ((fd = fopen(_PATH_PROCNET_IFINET6, "r")) == NULL) return NULL; if ((origin = net6 = calloc(1,sizeof(struct ni_linux_iface))) == NULL) goto lxga_error0; while (fscanf(fd, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n", net6->chp[0], net6->chp[1], net6->chp[2], net6->chp[3], net6->chp[4], net6->chp[5], net6->chp[6], net6->chp[7], &net6->idx, &net6->plen, &net6->scope, &net6->dad, net6->devname) != EOF) { n++; if ((net6 = realloc(origin, n * sizeof(struct ni_linux_iface))) == NULL) { free(origin); lxga_error0: errno = ENOMEM; return NULL; } origin = net6; net6 = origin + n -1; bzero(net6,sizeof(struct ni_linux_iface)); } fclose(fd); return origin; } /* **************************************************** * * text buffout xx::xx:xx, ary(xxxx),(xxxx) * * **************************************************** */ static void lx_hex2txt(char * txt, char (*chp)[5]) { sprintf(txt,"%s:%s:%s:%s:%s:%s:%s:%s", chp[0], chp[1], chp[2], chp[3], chp[4], chp[5], chp[6], chp[7]); } static int lx_gifaddrs_solo(struct ifaddrs **ifap) { struct ifaddrs * thisif, * lastif = NULL; struct ni_linux_iface * lxifc, * nxifc; struct sockaddr_in6 * sin6; char hostaddr[40]; if ((nxifc = lxifc = lx_get_addr()) == NULL) return -1; *ifap = NULL; while (nxifc->devname[0] != '\0') { if ((thisif = calloc(1, sizeof(struct ifaddrs))) == NULL) { error_out: ni_freeifaddrs(*ifap); free(lxifc); errno = ENOMEM; return -1; } if (lastif == NULL) *ifap = thisif; else lastif->ifa_next = thisif; if ((thisif->ifa_name = strdup(nxifc->devname)) == NULL) { error_out2: ni_freeifaddrs(thisif); goto error_out; } if ((sin6 = calloc(1, sizeof(struct sockaddr_in6))) == NULL) goto error_out; sin6->sin6_family = AF_INET6; #ifdef HAVE_SA_LEN sin6->sin6_len = LOCAL_SIZEOF_SOCKADDR_IN6; #endif lx_hex2txt(hostaddr,nxifc->chp); inet_pton(AF_INET6,hostaddr,&sin6->sin6_addr); sin6->sin6_scope_id = ni_lx_type2scope(nxifc->scope); thisif->ifa_addr = (struct sockaddr * )sin6; thisif->ifa_flags = lxifc->scope; /* what is supposed to go in here?? */ if ((sin6 = calloc(1, sizeof(struct sockaddr_in6))) == NULL) goto error_out2; sin6->sin6_family = AF_INET6; ni_plen2mask(&sin6->sin6_addr,nxifc->plen,sizeof(struct in6_addr)); thisif->ifa_netmask = (struct sockaddr *)sin6; lastif = thisif; nxifc++; } free(lxifc); return 0; } /* unlink ifap6 ifaddr records and link them into thisif */ static void lx_relink(struct ifaddrs * this6, struct ifaddrs * last6, struct ifaddrs ** ifap6, struct ifaddrs * thisif) { if (last6 == *ifap6) *ifap6 = this6->ifa_next; else last6->ifa_next = this6->ifa_next; if (thisif == NULL) /* no data ptr */ this6->ifa_next == NULL; else { this6->ifa_next = thisif->ifa_next; thisif->ifa_next = this6; /* insert record */ } } /* ******************************************** * * if we get to here there is not another * * way to ipv6 data except from the proc * * file system. that means that only ifreq * * is functional for obtaining ipv4 * * ******************************************** */ static int lx_gifaddrs_merge(struct ifaddrs **ifap, struct ni_ifconf_flavor * nifp) { struct ifaddrs * thisif, * lastif, * ifap6, * this6, *last6; struct ni_linux_iface * lxifc, * nxifc; u_int flags; char lastname[IFNAMSIZ]; struct ifreq ifr; u_char * macp; int fd, err; if ((nifp = ni_ifcf_get(NI_IFREQ)) == NULL) /* should never happen */ return -1; if (nifp->gifaddrs(ifap,nifp) < 0) /* ipv4 retrieval fail */ return -1; if (lx_gifaddrs_solo(&ifap6) < 0) { merge_fatal0: err = errno; merge_fatal: ni_freeifaddrs(*ifap); errno = err; return -1; } /* need to merge data */ if (ifap6 == NULL) return NI_IFREQ; /* there is no ipV6 data, no need to merge, return flavor */ thisif = *ifap; if (thisif == NULL) /* there was no ipV4 data */ goto wrap_up_ipv6; while (1) { if (thisif->ifa_next == NULL || strncmp(thisif->ifa_name,(thisif->ifa_next)->ifa_name,IFNAMSIZ)) { last6 = this6 = ifap6; while (this6 != NULL) { if (this6->ifa_name != NULL && strncmp(thisif->ifa_name,this6->ifa_name,IFNAMSIZ) == 0) lx_relink(this6,last6,&ifap6,thisif); last6 = this6; this6 = this6->ifa_next; } } if ((thisif->ifa_next) == NULL) break; thisif = thisif->ifa_next; } wrap_up_ipv6: if (thisif == NULL) *ifap = ifap6; else thisif->ifa_next = ifap6; return NI_LINUXPROC; } static int lx_INET6_get_addr() { struct ni_linux_iface * net6, * origin; int flags; u_int32_t xscope; struct in6_addr in6p; char hostaddr[40]; if ((origin = net6 = lx_get_addr()) == NULL) return -1; while (net6->devname[0] != '\0') { printf("%s\t",net6->devname); lx_hex2txt(hostaddr,net6->chp); printf("%s/%d",hostaddr,net6->plen); flags = net6->dad; printf("\n\tflags=%0x<",flags); lx_ifa_f_flags(flags); if (flags == 0) printf(" "); inet_pton(AF_INET6,hostaddr,&in6p); xscope = ni_in6_classify((u_char *)&in6p); printf("\b> Scope: "); /* ni_linux_scope2txt((uint32_t)(net6->scope & IPV6_ADDR_SCOPE_MASK)); */ ni_linux_scope2txt((uint32_t)(xscope)); printf("\n"); net6++; } free(origin); return 0; } static int lx_get_solo() { struct ifaddrs * ifap; if (lx_gifaddrs_solo(&ifap) != 0) return -1; ni_getifaddrs_dump(NI_LINUXPROC,ifap); ni_freeifaddrs(ifap); return 0; } int static ni_flav_linuxproc_developer(void * ifcee) { if (lx_INET6_get_addr() != 0) return -1; printf("\n"); if (lx_get_solo() != 0) return -1; return 0; } static void * returnull() { return NULL; } static struct ni_ifconf_flavor ni_flavor_linuxproc = { .ni_type = NI_LINUXPROC, .siocgifindex = SIOCGIFINDEX, .siocsifaddr = SIOCSIFADDR, .siocgifaddr = SIOCGIFADDR, #ifdef SIOCDIFADDR .siocdifaddr = SIOCDIFADDR, # else .siocdifaddr = 0, #endif #ifdef SIOCAIFADDR .siocaifaddr = SIOCAIFADDR, #else .siocaifaddr = 0, #endif .siocsifdstaddr = SIOCSIFDSTADDR, .siocgifdstaddr = SIOCGIFDSTADDR, .siocsifflags = SIOCSIFFLAGS, .siocgifflags = SIOCGIFFLAGS, .siocsifmtu = SIOCSIFMTU, .siocgifmtu = SIOCGIFMTU, .siocsifbrdaddr = SIOCSIFBRDADDR, .siocgifbrdaddr = SIOCGIFBRDADDR, .siocsifnetmask = SIOCGIFNETMASK, .siocgifnetmask = SIOCGIFNETMASK, .siocsifmetric = SIOCSIFMETRIC, .siocgifmetric = SIOCGIFMETRIC, .ifr_offset = 0, .gifaddrs = lx_gifaddrs_merge, .fifaddrs = ni_freeifaddrs, .refreshifr = NULL, .getifreqs = returnull, .developer = ni_flav_linuxproc_developer, }; void ni_linuxproc_ctor() { struct stat not_used; int error, retry = 2; /* check for 'proc' file system available */ while (retry > 0) { if ((error = stat("/proc",¬_used)) == 0) { ni_ifcf_register(&ni_flavor_linuxproc); break; } else if (error != EINTR) return; error -= 1; } } #else void ni_linuxproc_ctor() { return; } #endif /* __ni_Linux */ Net-Interface-1.012/ni_util.c0000644000000000000120000002021511151352044014566 0ustar rootwheel /* ******************************************************************** * * ni_util.c version 0.01 1-12-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "localconf.h" /* duplicate allocate memory and return pointer **** memory must be freed */ void * ni_memdup(void * memp, int size) { void * newmp; if ((newmp = malloc(size)) == NULL) { errno = ENOMEM; return NULL; } return memcpy(newmp,memp,size); } /* two functions to conditionally close and reopen an ifconf socket * * if fd is < 0 it is ignored * af is modified if required */ int ni_clos_reopn_dgrm(int fd, u_int af) { if (fd >= 0) close(fd); af == AF_UNSPEC ? AF_INET : af; return socket(af,SOCK_DGRAM,0); } /* **************************************************** * * provide _SIZEOF_ADDR_IFREQ(ifr) equivalent * * that will cover our use of in6_ifreq, lifreq * * **************************************************** */ #ifdef _SIZEOF_ADDR_IFREQ int ni_SIZEOF_ADDR_IFREQ(struct ifreq * ifrp,struct sockaddr * sa,int size) { struct ifreq ifr; memcpy(&ifr,ifrp,sizeof(struct ifreq)); return _SIZEOF_ADDR_IFREQ(ifr); } #endif /* **************************************************** * * on systems with embedded scope, get it * * and correct the bits in the addrsess * * **************************************************** */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 u_int ni_get_scopeid(struct sockaddr_in6 * sin6) { unsigned int scopeid = 0; # ifdef __KAME__ if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { scopeid = ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]); sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0; } # elif defined HAVE_SIN6_SCOPEID scopeid = sin6->sin6_scopeid; # endif return scopeid; } #endif /* **************************************************** * * generate a netmask from a prefix length * * **************************************************** */ void ni_plen2mask(void * in_addr, int plen, int sizeofaddr) { char * mask = in_addr; int ffs, rm, i; ffs = plen / 8; rm = plen % 8; if (rm != 0) { rm = 8 - rm; rm = 0xFFu << rm; } for (i = 0; i < ffs; i++) mask[i] = 0xFFu; if (rm != 0) { mask[i] = rm; i++; } for (; i < sizeofaddr; i++) mask[i] = 0; } /* **************************************************** * * calculate the length of netmask prefix * * **************************************************** */ int ni_prefix(void * ap, int sz) { unsigned char byte, * addr = (unsigned char *)ap; int bit, bp, plen = 0; for (bp = 0; bp < sz; bp++) { if (addr[bp] != 0xFFu) break; plen += 8; } if (bp == sz) return plen; byte = addr[bp]; for (bit = 0x80u; bit != 0; bit >>= 1) { /* for (bit = 7; bit != 0; bit--, plen++) */ if (byte & bit) { /* if (!(name[byte] & (1 << bit))) */ byte ^= bit; /* break; */ plen++; } else if (byte != 0) /* for (; bit != 0; bit--) */ return 0; /* if (name[byte] & (1 << bit)) */ else /* return 0; */ break; } bp++; for (; bp < sz; bp++) { if (addr[bp] != 0) return 0; } return plen; } /* **************************************************** * * constructor registration * * **************************************************** */ /* for ifreq or equivalent flavor support */ struct ni_ifconf_flavor * nifcf = NULL; void ni_ifcf_register(struct ni_ifconf_flavor * nifp) { nifp->ni_ifcf_next = nifcf; nifcf = nifp; } struct ni_ifconf_flavor * ni_ifcf_get(enum ni_FLAVOR type) { struct ni_ifconf_flavor * nifp; for (nifp = nifcf; nifp != NULL; nifp = nifp->ni_ifcf_next) if (nifp->ni_type == type) return nifp; errno = ENOSYS; return NULL; } struct ni_ifconf_flavor * ni_safe_ifcf_get(enum ni_FLAVOR type) { struct ni_ifconf_flavor * nifp; if ((nifp = ni_ifcf_get(type)) != NULL) return nifp; return ni_ifcf_get(NI_IFREQ); } /* **************************************************** * * developer support, not for production * * **************************************************** */ int ni_developer(enum ni_FLAVOR type) { void * notused = NULL; struct ni_ifconf_flavor * nifp = ni_ifcf_get(type); if (nifp == NULL) return ENOSYS; return nifp->developer(notused); } /* **************************************************** * * IPV6 support for linux like type info * * **************************************************** */ /* does not have to be ifdef'd #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 */ /* scope flags rfc-2373 * 0 reserved 1 node-local 2 link-local 3 unassigned 4 unassigned 5 site-local 6 unassigned 7 unassigned 8 organization-local 9 unassigned A unassigned B unassigned C unassigned D unassigned E global scope F reserved */ # ifdef ___NEVER_DEFINED___for_info /* 0x0000 0xe #define IPV6_ADDR_LOOPBACK 0x0010u /* 0x1 aka NODELOCAL, INTERFACELOCAL */ #define IPV6_ADDR_LINKLOCAL 0x0020u /* 0x2 */ #define IPV6_ADDR_SITELOCAL 0x0040u /* 0x5 */ #define IPV6_ADDR_COMPATv4 0x0080u /* 0x10 mapped back out of range */ # endif int ni_lx_type2scope(int lscope) { lscope &= 0xF0u; switch (lscope) { case 0 : return 0xEu; case 0x10 : return 0x1; case 0x20 : return 0x2; case 0x40 : return 0x5; case 0x80: return 0x10; /* linux compat-v4 */ } return 0; } const ni_iff_t ni_lx_type2txt[] = { { IPV6_ADDR_ANY, "addr-any" }, { IPV6_ADDR_UNICAST, "unicast" }, { IPV6_ADDR_MULTICAST, "multicast" }, { IPV6_ADDR_ANYCAST, "anycast" }, { IPV6_ADDR_LOOPBACK, "loopback" }, { IPV6_ADDR_LINKLOCAL, "link-local" }, { IPV6_ADDR_SITELOCAL, "site-local" }, { IPV6_ADDR_COMPATv4, "compat-v4" }, { IPV6_ADDR_SCOPE_MASK, "scope-mask" }, { IPV6_ADDR_MAPPED, "mapped" }, { IPV6_ADDR_RESERVED, "reserved" }, { IPV6_ADDR_ULUA, "uniq-lcl-unicast" }, { IPV6_ADDR_6TO4, "6to4" }, { IPV6_ADDR_6BONE, "6bone" }, { IPV6_ADDR_AGU, "global-unicast" }, { IPV6_ADDR_UNSPECIFIED, "unspecified" }, { IPV6_ADDR_SOLICITED_NODE, "solicited-node" }, { IPV6_ADDR_ISATAP, "ISATAP" }, { IPV6_ADDR_PRODUCTIVE, "productive" }, { IPV6_ADDR_6TO4_MICROSOFT, "6to4-ms" }, { IPV6_ADDR_TEREDO, "teredo" }, { IPV6_ADDR_ORCHID, "orchid" }, { IPV6_ADDR_NON_ROUTE_DOC, "non-routeable-doc" } }; int ni_sizeof_type2txt() { return sizeof(ni_lx_type2txt); } void ni_linux_scope2txt(uint32_t flags) { int i, n = sizeof(ni_lx_type2txt) / sizeof(ni_iff_t); for (i=0; i < n; i++) if (flags & ni_lx_type2txt[i].iff_val) printf("%s ",ni_lx_type2txt[i].iff_nam); } /* does not have to be ifdef'd #endif LOCAL_SIZEOF_SOCKADDR_IN6 */ Net-Interface-1.012/miniSocketXS.c0000644000000000000000000001177211151107674015376 0ustar rootroot # This file is excerpted from perl-5.8.0/ext/Socket/Socket.xs and # modified slightly so that it compiles on older versions of perl/gcc # # 3/28/06 version 1.78 of Socket.xs, included in perl 5.9.3 # is 100% compatible with this version # # Copyright 2003 - 2006, Michael Robinton void yinet_aton(host) char * host CODE: { struct in_addr ip_address; struct hostent * phe; int ok = (host != NULL) && (*host != '\0') && inet_aton(host, &ip_address); if (!ok && (phe = gethostbyname(host))) { Copy( phe->h_addr, &ip_address, phe->h_length, char ); ok = 1; } ST(0) = sv_newmortal(); if (ok) sv_setpvn( ST(0), (char *)&ip_address, sizeof ip_address ); } void inet_ntoa(ip_address_sv) SV * ip_address_sv CODE: { STRLEN addrlen; struct in_addr addr; char * addr_str; char * ip_address; # sigh.... these lines fail on older perl/gcc combinations # if (DO_UTF8(ip_address_sv) && !sv_utf8_downgrade(ip_address_sv, 1)) # croak("Wide character in Socket::inet_ntoa"); # ip_address = SvPVbyte(ip_address_sv, addrlen); ip_address = SvPV(ip_address_sv,addrlen); if (addrlen == sizeof(addr) || addrlen == 4) addr.s_addr = (ip_address[0] & 0xFF) << 24 | (ip_address[1] & 0xFF) << 16 | (ip_address[2] & 0xFF) << 8 | (ip_address[3] & 0xFF); else croak("Bad arg length for %s, length is %d, should be %d", "NetAddr::IP::Util::inet_ntoa", addrlen, sizeof(addr)); /* We could use inet_ntoa() but that is broken * in HP-UX + GCC + 64bitint (returns "0.0.0.0"), * so let's use this sprintf() workaround everywhere. * This is also more threadsafe than using inet_ntoa(). */ Newx(addr_str, 4 * 3 + 3 + 1, char); /* IPv6? */ sprintf(addr_str, "%d.%d.%d.%d", ((addr.s_addr >> 24) & 0xFF), ((addr.s_addr >> 16) & 0xFF), ((addr.s_addr >> 8) & 0xFF), ( addr.s_addr & 0xFF)); ST(0) = sv_2mortal(newSVpvn(addr_str, strlen(addr_str))); Safefree(addr_str); } Net-Interface-1.012/configure.ac0000644000000000000120000004474511154565665015305 0ustar rootwheel# Process this file with autoconf to produce a configure script. AC_INIT() # AX_SIZEOF_SOCKFUNC(lowercase_funcname, UPPERCASE_FUNCNAME) # --------------------------------------------------------- # checks if the function is present in the netinet/in.h file # and sets SIZEOF_SOCKFUNC if found AC_DEFUN([AX_SIZEOF_SOCKFUNC],[ AH_TEMPLATE([LOCAL_SIZEOF_$2],[Define size of $1]) AC_MSG_CHECKING([for LOCAL_SIZEOF_$2]) AC_RUN_IFELSE([ #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct $1 sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; }], ac_familysize=`cat conftest.data` AC_MSG_RESULT([is $ac_familysize]) AC_DEFINE_UNQUOTED([LOCAL_SIZEOF_$2],[$ac_familysize],[define family size]), AC_MSG_RESULT([not defined]) )]) # AX_CHECK_INCLUDE(include/file.name, INCLUDE_FILE_NAME) # --------------------------------------------------------- # checks if the include file is present # but does not check if it is usable AC_DEFUN([AX_CHECK_INCLUDE],[ AH_TEMPLATE([HAVE_$2],[Define HAVE_$2 to 1 if '<$1>' is useable.]) AC_CHECK_HEADER([$1],[ AC_DEFINE([HAVE_$2],[1],[define available include file]) ],[],[ #include "confdefs.h" #include "defaults.h" ])]) # AX_IN_STDLIB(lowercase_funcname, UPPERCASE_FUNCNAME) # --------------------------------------------------------- # checks if the function is present in the stdlib.h file # and sets SIZEOF_SOCKFUNC if found AC_DEFUN([AX_IN_STDLIB],[ AH_TEMPLATE([HAVE_$2_IN_STDLIB],[Define size of $1]) AC_MSG_CHECKING([for $2 in stdlib.h]) AC_COMPILE_IFELSE([ #include int main() { void * mem = malloc(8192); return 1; }], AC_MSG_RESULT([yes]) AC_DEFINE_UNQUOTED([HAVE_$2_IN_STDLIB],[1],[$2 in ]), AC_MSG_RESULT([not defined]) )]) AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST AC_MSG_NOTICE([Checking OS type and VERSION]) my_host_version=`uname -r` case $host_os in alpha*) AH_TEMPLATE([__ni_ALPHA],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_ALPHA],[$my_host_version],[OS name defined to version]) ;; aix*) AH_TEMPLATE([__ni_AIX],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_AIX],[$my_host_version],[OS name defined to version]) ;; beos*) AH_TEMPLATE([__ni_BEOS],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_BEOS],[$my_host_version],[OS name defined to version]) ;; *bsd*) AH_TEMPLATE([__ni_BSD],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_BSD],[$my_host_version],[OS name defined to version]) ;; cygwin*) AH_TEMPLATE([__ni_Cygwin],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Cygwin],[$my_host_version],[OS name defined to version]) ;; darwin*) AH_TEMPLATE([__ni_Darwin],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Darwin],[$my_host_version],[OS name defined to version]) ;; dgux*) AH_TEMPLATE([__ni_DGUX],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_DGUX],[$my_host_version],[OS name defined to version]) ;; dragonfly*) AH_TEMPLATE([__ni_DragonFly],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_DragonFly],[$my_host_version],[OS name defined to version]) ;; hpux*) AH_TEMPLATE([__ni_HPUX],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_HPUX],[$my_host_version],[OS name defined to version]) ;; freebsd*) AH_TEMPLATE([__ni_FreeBSD],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_FreeBSD],[$my_host_version],[OS name defined to version]) ;; interix*) AH_TEMPLATE([__ni_Interix],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Interix],[$my_host_version],[OS name defined to version]) ;; irix*) AH_TEMPLATE([__ni_IRIX],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_IRIX],[$my_host_version],[OS name defined to version]) ;; linux*) AH_TEMPLATE([__ni_Linux],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Linux],[$my_host_version],[OS name defined to version]) ;; machten*) AH_TEMPLATE([__ni_MachTen],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_MachTen],[$my_host_version],[OS name defined to version]) ;; mingw*) AH_TEMPLATE([__ni_MingW],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_MingW],[$my_host_version],[OS name defined to version]) ;; msdos* | go32* | windows*) AH_TEMPLATE([__ni_Windows],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Windows],[$my_host_version],[OS name defined to version]) ;; netbsd*) AH_TEMPLATE([__ni_NetBSD],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_NetBSD],[$my_host_version],[OS name defined to version]) ;; next2*) AH_TEMPLATE([__ni_Next2],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Next2],[$my_host_version],[OS name defined to version]) ;; nextstep*) AH_TEMPLATE([__ni_NextStep],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_NextStep],[$my_host_version],[OS name defined to version]) ;; openbsd*) AH_TEMPLATE([__ni_OpenBSD],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_OpenBSD],[$my_host_version],[OS name defined to version]) ;; osf*) AH_TEMPLATE([__ni_OSF],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_OSF],[$my_host_version],[OS name defined to version]) ;; qnx*) AH_TEMPLATE([__ni_QNX4],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_QNX4],[$my_host_version],[OS name defined to version]) ;; sco*) AH_TEMPLATE([__ni_SCO],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_SCO],[$my_host_version],[OS name defined to version]) ;; solaris*) AH_TEMPLATE([__ni_SunOS],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_SunOS],[$my_host_version],[OS name defined to version]) ;; sunos*) AH_TEMPLATE([__ni_SUNOS],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_SUNOS],[$my_host_version],[OS name defined to version]) ;; sysv4*) AH_TEMPLATE([__ni_SRV4],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_SRV4],[$my_host_version],[OS name defined to version]) ;; sysv5uw*) AH_TEMPLATE([__ni_Unixware],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Unixware],[$my_host_version],[OS name defined to version]) ;; unixware*) AC_DEFINE_UNQUOTED([__ni_Unixware],[$my_host_version],[OS name defined to version]) ;; ultrix*) AH_TEMPLATE([__ni_Ultrix],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Ultrix],[$my_host_version],[OS name defined to version]) ;; win32*) AH_TEMPLATE([__ni_Win32],[OS name defined to version]) AC_DEFINE_UNQUOTED([__ni_Win32],[$my_host_version],[OS name defined to version]) ;; *) echo "" echo "*************************************************************" echo "configure does not currently recognize your operating system," echo "therefore you must do a manual configuration of:" echo "Checking host system type... $host_os" echo "Please contact miker@cpan.org" echo "including the above 'checking host system type...' line " echo "*************************************************************" echo "" exit;; esac AC_MSG_CHECKING([Operating system of this host is]) # Checks for programs. AC_PROG_CC # Checks for library functions. AC_HEADER_STDC AX_CHECK_INCLUDE([stdio.h],[STDIO_H]) AX_CHECK_INCLUDE([sys/socket.h],[SYS_SOCKET_H]) AX_CHECK_INCLUDE([linux/rtnetlink.h],[LINUX_RTNETLINK_H]) AX_CHECK_INCLUDE([linux/netlink.h],[LINUX_NETLINK_H]) AX_CHECK_INCLUDE([netinet/ip.h],[NETINET_IP_H]) AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_REALLOC AX_IN_STDLIB([malloc],[MALLOC]); # Checks for header files. AX_CHECK_INCLUDE([asm/types.h],[ASM_TYPES_H]) AX_CHECK_INCLUDE([features.h],[FEATURES_H]) AX_CHECK_INCLUDE([sys/param.h],[SYS_PARAM_H]) AX_CHECK_INCLUDE([sys/un.h],[SYS_UN_H]) AX_CHECK_INCLUDE([neteconet/ec.h],[NETECONET_EC_H]) AX_CHECK_INCLUDE([linux/atalk.h],[LINUX_ATALK_H]) AX_CHECK_INCLUDE([netinet/if_fddi.h],[NETINET_IF_FDDI_H]) AX_CHECK_INCLUDE([linux/if_fddi.h],[LINUX_IF_FDDI_H]) AX_CHECK_INCLUDE([linux/if_tr.h],[LINUX_IF_TR_H]) AX_CHECK_INCLUDE([net/if_arp.h],[NET_IF_ARP_H]) AX_CHECK_INCLUDE([linux/if_ether.h],[LINUX_IF_ETHER_H]) AX_CHECK_INCLUDE([endian.h],[ENDIAN_H]) AX_CHECK_INCLUDE([byteswap.h],[BYTESWAP_H]) AX_CHECK_INCLUDE([alloca.h],[ALLOCA_H]) AX_CHECK_INCLUDE([sys/sockio.h],[SYS_SOCKIO_H]) AX_CHECK_INCLUDE([sys/sysctl.h],[SYS_SYSCTL_H]) AX_CHECK_INCLUDE([sys/time.h],[SYS_TIME_H]) AX_CHECK_INCLUDE([sys/module.h],[SYS_MODULE_H]) AX_CHECK_INCLUDE([sys/linker.h],[SYS_LINKER_H]) AX_CHECK_INCLUDE([sys/mac.h],[SYS_MAC_H]) AX_CHECK_INCLUDE([netax25/ax25.h],[NETAX25_AX25_H]) AX_CHECK_INCLUDE([linux/ax25.h],[LINUX_AX25_H]) AX_CHECK_INCLUDE([linux/types.h],[LINUX_TYPES_H]) AX_CHECK_INCLUDE([linux/if_strip.h],[LINUX_IF_STRIP_H]) AX_CHECK_INCLUDE([linux/x25.h],[LINUX_X25_H]) AX_CHECK_INCLUDE([linux/if_arp.h],[LINUX_IF_ARP_H]) AX_CHECK_INCLUDE([sys/ioctl.h],[SYS_IOCTL_H]) AX_CHECK_INCLUDE([libc-internal.h],[LIBC_INTERNAL_H]) AX_CHECK_INCLUDE([signal.h],[SIGNAL_H]) AX_CHECK_INCLUDE([net/if.h],[NET_IF_H]) AX_CHECK_INCLUDE([netatalk/at.h],[NETATALK_AT_H]) AX_CHECK_INCLUDE([net/pfvar.h],[NET_PFVAR_H]) AX_CHECK_INCLUDE([net/if_pfsync.h],[NET_IF_PFSYNC_H]) AX_CHECK_INCLUDE([netpacket/packet.h],[NETPACKET_PACKET_H]) AX_CHECK_INCLUDE([stdbool.h],[STDBOOL_H]) AX_CHECK_INCLUDE([time.h],[TIME_H]) AX_CHECK_INCLUDE([netinet/in.h],[NETINET_IN_H]) AX_CHECK_INCLUDE([net/if_var.h],[NET_IF_VAR_H]) AX_CHECK_INCLUDE([netinet/in_var.h],[NETINET_IN_VAR_H]) AX_CHECK_INCLUDE([netipx/ipx.h],[NETIPX_IPX_H]) AX_CHECK_INCLUDE([netipx/ipx_if.h],[NETIPX_IPX_IF_H]) AX_CHECK_INCLUDE([net/if_dl.h],[NET_IF_DL_H]) AX_CHECK_INCLUDE([net/if_types.h],[NET_IF_TYPES_H]) AX_CHECK_INCLUDE([net/route.h],[NET_ROUTE_H]) AX_CHECK_INCLUDE([netinet/ether.h],[NETINET_ETHER_H]) AX_CHECK_INCLUDE([netinet/if_ether.h],[NETINET_IF_ETHER_H]) AX_CHECK_INCLUDE([linux/if_slip.h],[LINUX_IF_SLIP_H]) AX_CHECK_INCLUDE([ctype.h],[CTYPE_H]) AX_CHECK_INCLUDE([netinet/ip_carp.h],[NETINET_IP_CARP_H]) AX_CHECK_INCLUDE([net/if_media.h],[NET_IF_MEDIA_H]) AX_CHECK_INCLUDE([net80211/ieee80211.h],[NET80211_IEEE80211_H]) AX_CHECK_INCLUDE([net80211/ieee80211_crypto.h],[NET80211_IEEE80211_CRYPTO_H]) AX_CHECK_INCLUDE([net80211/ieee80211_ioctl.h],[NET80211_IEEE80211_IOCTL_H]) AX_CHECK_INCLUDE([net/if_lagg.h],[NET_IF_LAGG_H]) AX_CHECK_INCLUDE([net/if_vlan_var.h],[NET_IF_VLAN_VAR_H]) AX_CHECK_INCLUDE([net/ethernet.h],[NET_ETHERNET_H]) AX_CHECK_INCLUDE([ifaddrs.h],[IFADDRS_H]) AX_CHECK_INCLUDE([netdb.h],[NETDB_H]) AX_CHECK_INCLUDE([netinet6/nd6.h],[NETINET6_ND6_H]) AX_CHECK_INCLUDE([stdarg.h],[STDARG_H]) AX_CHECK_INCLUDE([net80211/ieee80211_freebsd.h],[NET80211_IEEE80211_FREEBSD_H]) AX_CHECK_INCLUDE([linux/rose.h],[LINUX_ROSE_H]) AX_CHECK_INCLUDE([fcntl.h],[FCNTL_H]) AX_CHECK_INCLUDE([malloc.h],[MALLOC_H]) AX_CHECK_INCLUDE([arpa/inet.h],[ARPA_INET_H]) # additional headers AX_CHECK_INCLUDE([sys/dlpi.h],[SYS_DLPI_H]) AX_CHECK_INCLUDE([stropts.h],[STROPTS_H]) AX_CHECK_INCLUDE([net/nit_if.h],[NET_NIT_IF_H]) AX_CHECK_INCLUDE([netio.h],[NETIO_H]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_INT8_T AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_CHECK_TYPES([caddr_t]) AH_TEMPLATE([LIBS],[Extra libraries needed for this build]) AC_CHECK_FUNCS([memcmp memset memcpy bzero getpagesize memmove getnameinfo]) # my additions AC_C_BIGENDIAN AC_CHECK_SIZEOF([uint8_t]) AC_CHECK_SIZEOF([uint16_t]) AC_CHECK_SIZEOF([uint32_t]) AC_CHECK_SIZEOF([uint64_t]) AC_CHECK_SIZEOF([u_int8_t]) AC_CHECK_SIZEOF([u_int16_t]) AC_CHECK_SIZEOF([u_int32_t]) AC_CHECK_SIZEOF([u_int64_t]) AH_TEMPLATE([LOCAL_SIZEOF_POINTER],[Define size of pointer]) AC_MSG_CHECKING([for size of pointer]) AC_RUN_IFELSE([ #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; long my_pointer_size = sizeof(char *); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_pointer_size); fclose(FP); return 0; } else return 1; }], # action if true ac_pointersize=`cat conftest.data` AC_MSG_RESULT([is $ac_pointersize]) AC_DEFINE_UNQUOTED([LOCAL_SIZEOF_POINTER],[$ac_pointersize],[define pointer size]),[ AC_MSG_RESULT([not defined]) # no action if false ]) AC_MSG_CHECKING([for PAGE_SIZE]) AC_RUN_IFELSE([ /* INPUT */ #include "confdefs.h" #include "defaults.h" int main() { #ifdef PAGE_SIZE return 0; #else return 1; #endif }],[ # ACTION IF TRUE # page size is defined AC_MSG_RESULT([defined])],[ # ACTION IF FALSE # page size is not define, run test AC_MSG_NOTICE([not defined, trying equivalent...]) AC_RUN_IFELSE([ /* INPUT 2 */ # include "confdefs.h" # include "defaults.h" int main() { FILE *FP; long my_pagesize; # if defined (HAVE_UNISTD_H) && (defined(_SC_PAGESIZE) || defined(_SC_PAGE_SIZE) || defined(_SC_MMAP_PAGE_SIZE)) # if defined(_SC_PAGESIZE) my_pagesize = sysconf(_SC_PAGESIZE); # elif defined(_SC_PAGE_SIZE) my_pagesize = sysconf(_SC_PAGE_SIZE); # else my_pagesize = sysconf(_SC_MMAP_PAGE_SIZE); # endif # elif defined HAVE_GETPAGESIZE my_pagesize = getpagesize(); # elif defined(PAGESIZE) my_pagesize = PAGESIZE; # else my_pagesize = 0; # endif if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_pagesize); fclose(FP); if (my_pagesize != 0) return 0; else return 1; } return 1; } ],[ # ACTION IF TRUE 2 # managed to find page size, define it in our config file ac_pagesize=`cat conftest.data` AC_MSG_RESULT([found page size = $ac_pagesize]) if test $ac_pagesize -gt 0; then AC_MSG_RESULT([define PAGE_SIZE $ac_pagesize]) AC_DEFINE_UNQUOTED([PAGE_SIZE], [$ac_pagesize],[define PAGE_SIZE for this operating system]) else # UGH! could not find a page size definition AC_MSG_ERROR([Could not find PAGE_SIZE for this OS]) fi ],[ # ACTION IF FALSE 2 AC_MSG_ERROR([Could not determine PAGE_SIZE for this OS]) ])] ) AH_TEMPLATE([HAVE_SOCKET],[Define to 1 if function 'socket' is present]) AC_SEARCH_LIBS([socket],[socket],[ AC_DEFINE([HAVE_SOCKET])]) AH_TEMPLATE([HAVE_LINK_NTOA],[Define to 1 if function 'link_ntoa' is present]) AC_SEARCH_LIBS([link_ntoa],[socket],[ AC_DEFINE([HAVE_LINK_NTOA])],[],[-lnsl]) 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])],[],[-lnsl]) 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])],[],[-lnsl]) 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])],[],[-lnsl]) AH_TEMPLATE([HAVE_PCAP],[Define to 1 if pcap lib is present]) AC_SEARCH_LIBS([pcap_close],[pcap],[ AC_DEFINE([HAVE_PCAP])],[],[$LDDLFLAGS]) AC_CHECK_TYPES([struct ifaddrs, struct ifreq, struct if_laddrreq, struct if_data, struct in6_ifreq, struct if_data, struct ifdevea],[],[],[ #include "confdefs.h" #include "defaults.h" ]) AH_TEMPLATE([NI_LIFREQ_PAD],[Define to size of struct lifreq - struct nifreq]) AH_TEMPLATE([NI_LIFREQ_OFFSET],[Define union offset from start of lifreq]) AC_CHECK_TYPES([struct lifreq],[ AC_MSG_CHECKING([for sizeof lifreq - nifreq]) AC_RUN_IFELSE([ #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct lifreq lifr; int diffsize = sizeof(lifr.lifr_lifru) + sizeof(lifr.lifr_lifru1) + sizeof(uint_t) + LIFNAMSIZ - IFNAMSIZ; if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%d\n",diffsize); fclose(FP); return 0; } else return 1; } ], # action if true ac_lifreqpad=`cat conftest.data` AC_MSG_RESULT([is $ac_lifreqpad]) AC_DEFINE_UNQUOTED([NI_LIFREQ_PAD],[$ac_lifreqpad],[define lifreq pad size]),[ AC_MSG_RESULT([not defined]) ]) AC_MSG_CHECKING([for lifreq union offset]) AC_RUN_IFELSE([ #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct lifreq lifr; int offset = LIFNAMSIZ - IFNAMSIZ + sizeof(lifr.lifr_lifru1) + sizeof(uint_t); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%d\n",offset); fclose(FP); return 0; } else return 1; } ], # action if true ac_lifreqoffset=`cat conftest.data` AC_MSG_RESULT([is $ac_lifreqoffset]) AC_DEFINE_UNQUOTED([NI_LIFREQ_OFFSET],[$ac_lifreqoffset],[define lifreq union offset]),[ AC_MSG_RESULT([not defined]) # action if false ]) ],[ AC_DEFINE_UNQUOTED([NI_LIFREQ_OFFSET],[0],[define lifreq union offset]) ],[ #include "confdefs.h" #include "defaults.h" ]) # we do not want multiple thread libraries included as # extra LIBS so nest thread checks AC_CHECK_HEADER([pthread.h],[ AC_DEFINE([HAVE_PTHREAD_H],[1],[Define to 1 if you have .]) AC_SEARCH_LIBS([pthread_mutex_init],[pthreads],[],[]) AC_MSG_NOTICE([...have pthreads, do not check for thread.h])],[ AC_CHECK_HEADER([thread.h],[ AC_DEFINE([HAVE_THREAD_H],[1],[Define to 1 if you have .]) AC_SEARCH_LIBS([mutex_init],[thread],[],[])] ) ]) AC_SEARCH_LIBS([ioctl],[],[]) AH_TEMPLATE([HAVE_SA_LEN],[Define to 1 if sockaddr has member 'sa_len']) AC_CHECK_MEMBER([struct sockaddr.sa_len], [ AC_DEFINE([HAVE_SA_LEN])],[],[ #include "confdefs.h" #include "defaults.h" ]) AH_TEMPLATE([HAVE_SIN6_SCOPEID],[Define to 1 if sockaddr_in6 has member 'sin6_scopeid']) AC_CHECK_MEMBER([struct sockaddr_in6.sin6_scopeid], [ AC_DEFINE([HAVE_SIN6_SCOPEID])],[],[ #include "confdefs.h" #include "defaults.h" ]) # add socket families as they are identified AX_SIZEOF_SOCKFUNC([sockaddr],[SOCKADDR]) AX_SIZEOF_SOCKFUNC([sockaddr_storage],[SOCKADDR_STORAGE]) AX_SIZEOF_SOCKFUNC([sockaddr_in],[SOCKADDR_IN]) AX_SIZEOF_SOCKFUNC([sockaddr_at],[SOCKADDR_AT]) AX_SIZEOF_SOCKFUNC([sockaddr_ash],[SOCKADDR_ASH]) AX_SIZEOF_SOCKFUNC([sockaddr_ax25],[SOCKADDR_AX25]) AX_SIZEOF_SOCKFUNC([sockaddr_x25],[SOCKADDR_X25]) AX_SIZEOF_SOCKFUNC([sockaddr_ec],[SOCKADDR_EC]) AX_SIZEOF_SOCKFUNC([sockaddr_in6],[SOCKADDR_IN6]) AX_SIZEOF_SOCKFUNC([sockaddr_ipx],[SOCKADDR_IPX]) AX_SIZEOF_SOCKFUNC([sockaddr_un],[SOCKADDR_UN]) AX_SIZEOF_SOCKFUNC([sockaddr_ll],[SOCKADDR_LL]) AX_SIZEOF_SOCKFUNC([sockaddr_rose],[SOCKADDR_ROSE]) AX_SIZEOF_SOCKFUNC([sockaddr_dl],[SOCKADDR_DL]) AX_SIZEOF_SOCKFUNC([sockaddr_eon],[SOCKADDR_EON]) AX_SIZEOF_SOCKFUNC([sockaddr_inarp],[SOCKADDR_INARP]) AX_SIZEOF_SOCKFUNC([sockaddr_iso],[SOCKADDR_ISO]) AX_SIZEOF_SOCKFUNC([sockaddr_ns],[SOCKADDR_NS]) AX_SIZEOF_SOCKFUNC([sockaddr_atm],[SOCKADDR_ATM]) AX_SIZEOF_SOCKFUNC([sockaddr_dn],[SOCKADDR_DECnet]) AX_SIZEOF_SOCKFUNC([sockaddr_tp],[SOCKADDR_TP]) AX_SIZEOF_SOCKFUNC([sockaddr_ositp],[SOCKADDR_OSITP]) AC_CONFIG_COMMANDS_PRE([ if test "$LIBS" != ""; then AC_DEFINE_UNQUOTED([LIBS],[$LIBS],[Extra libraries]) fi ]) AC_OUTPUT Net-Interface-1.012/build_stuff/0000755000000000000000000000000011345243332015145 5ustar rootrootNet-Interface-1.012/build_stuff/make_ordered_list.pl0000755000000000000120000000567611143675066021334 0ustar rootwheel#!/usr/bin/perl #use diagnostics; # Copyright 2008 - 2009, Michael Robinton # # This library is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # my $debug = 0; # set to 1 for restricted debug output # set to 2 for trace print my $last = 2; # set to the number of included files to process my $usage = q| usage: create #include list files by grep'ing grep -e \#[:space:]*include *.c > ifile cat files together, edit the list and use the result as the script argument |. $0 . q| filename |; die $usage unless @ARGV; open(F,$ARGV[0]) || die $usage; my @have = qw( ); my $start = @have; my(%have,%defaults); foreach(0..$#have) { my $hf = $have[$_]; $have{$hf} = $_; # mark index in array $defaults{$hf} = 1; # mark default exclusion } my %exclude = ( # headers that we do not want at all because # they redefine stuff in PERL '' => 1, '' => 1, '' => 1, '' => 1, ); my(@f,%f); foreach() { next unless $_ =~ m|/([^/:]+):#\s*include.+\<\s*(.+\.h)\s*>|; my $hf = '<'. $2 .'>'; next if exists $exclude{$hf}; if (exists $f{$1}) { push @{$f{$1}}, $hf; } else { $f{$1} = [$hf]; push @f, $1; # save order of files processed } } close F; # samples #'netrom.c' => qw(sys/types.h sys/ioctl.h sys/socket.h net/if_arp.h netax25/ax25.h linux/ax25.h stdlib.h stdio.h ctype.h errno.h fcntl.h string.h termios.h unistd.h), #'ether_addr.c' => qw(features.h ctype.h stdio.h stdlib.h netinet/ether.h netinet/if_ether.h), # return index into have if header file exists sub havit { my($p,$hf) = @_; foreach ($p..$#have) { return $_ if $hf eq $have[$_]; } return -1; } foreach my $cf (@f) { # for each surveyed file my $bef = 0; my(@stash,%stash); foreach my $hf (@{$f{$cf}}) { print "$cf: $hf " if $debug > 1; my $have = havit($bef,$hf); if ($have < 0) { # can't find it in remaining array if (exists $have{$hf}) { # if passed it by $have = $have{$hf}; # for debug } else { print "stashing " if $debug > 1; unshift @stash, $hf; $stash{$hf} = $bef; # mark insertion point } } else { # have it $bef = $have; } print "have = $have\n" if $debug > 1; } foreach(@stash) { # always insert beyond permanent unless no perceeding permanent members my $ix = ($stash{$_} && $stash{$_} < $start) ? $start : $stash{$_}; print "revadd $_ at stsh = $stash{$_}, ix = $ix\n" if $debug > 1; ++$start unless $ix; # if the permanent list is longer, move end pointer; splice @have,$ix,0,$_; $have{$_} = $ix; } if ($debug) { --$last; last unless $last > 0; } } foreach (@have) { print "$_\n" unless 1 && exists $defaults{$_}; } Net-Interface-1.012/build_stuff/make_defaults.pl0000755000000000000120000000075411143675101020442 0ustar rootwheel#!/usr/bin/perl # Copyright 2008 - 2009, Michael Robinton # # This library is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # my $usage = q| creates: #ifdef HAVE_SOME_HEADER_H #include #endif usage: |. $0 .q| filename |; open(F,$ARGV[0]) || die $usage; foreach() { next unless $_ =~ /(\<\s*([^>\s]+)>)/; my $hf = $1; (my $hs = uc $2) =~ s|[\./-]|_|g; print qq|#ifdef HAVE_$hs #include $hf #endif |; } close F; Net-Interface-1.012/build_stuff/sioc_s.txt0000644000000000000120000003667611124324724017333 0ustar rootwheelSIOC's from various systems ############################ solaris #define SIOCGIFCONF _IOWRN('i', 20, 8) /* get if list */ #define SIOCSIFMTU _IOW('i', 21, struct ifreq) /* set if mtu */ #define SIOCGIFMTU _IOWR('i', 22, struct ifreq) /* get if mtu */ /* from 4.3BSD */ #define SIOCGIFBRDADDR _IOWR('i', 23, struct ifreq) /* get broadcast addr */ #define SIOCSIFBRDADDR _IOW('i', 24, struct ifreq) /* set broadcast addr */ #define SIOCGIFNETMASK _IOWR('i', 25, struct ifreq) /* get subnetmask */ #define SIOCSIFNETMASK _IOW('i', 26, struct ifreq) /* set subnetmask */ #define SIOCGIFMETRIC _IOWR('i', 27, struct ifreq) /* get if metric */ #define SIOCSIFMETRIC _IOW('i', 28, struct ifreq) /* set if metric */ #define SIOCSARP _IOW('i', 30, struct arpreq) /* set arp entry */ #define SIOCGARP _IOWR('i', 31, struct arpreq) /* get arp entry */ #define SIOCDARP _IOW('i', 32, struct arpreq) /* delete arp entry */ #define SIOCUPPER _IOW('i', 40, struct ifreq) /* attach upper layer */ #define SIOCLOWER _IOW('i', 41, struct ifreq) /* attach lower layer */ #define SIOCSETSYNC _IOW('i', 44, struct ifreq) /* set syncmode */ #define SIOCGETSYNC _IOWR('i', 45, struct ifreq) /* get syncmode */ #define SIOCSSDSTATS _IOWR('i', 46, struct ifreq) /* sync data stats */ #define SIOCSSESTATS _IOWR('i', 47, struct ifreq) /* sync error stats */ #define SIOCSPROMISC _IOW('i', 48, int) /* request promisc */ /* mode on/off */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* set m/c address */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* clr m/c address */ /* STREAMS based socket emulation */ #define SIOCGETNAME _IOR('s', 52, struct sockaddr) /* getsockname */ #define SIOCGETPEER _IOR('s', 53, struct sockaddr) /* getpeername */ #define IF_UNITSEL _IOW('s', 54, int) /* set unit number */ #define SIOCXPROTO _IO('s', 55) /* empty proto table */ #define SIOCIFDETACH _IOW('i', 56, struct ifreq) /* detach interface */ #define SIOCGENPSTATS _IOWR('i', 57, struct ifreq) /* get ENP stats */ #define SIOCX25XMT _IOWR('i', 59, struct ifreq) /* start a slp proc */ /* in x25if */ #define SIOCX25RCV _IOWR('i', 60, struct ifreq) /* start a slp proc */ /* in x25if */ #define SIOCX25TBL _IOWR('i', 61, struct ifreq) /* xfer lun table to */ /* kernel */ #define SIOCSLGETREQ _IOWR('i', 71, struct ifreq) /* wait for switched */ /* SLIP request */ #define SIOCSLSTAT _IOW('i', 72, struct ifreq) /* pass SLIP info to */ /* kernel */ #define SIOCSIFNAME _IOW('i', 73, struct ifreq) /* set interface name */ #define SIOCGENADDR _IOWR('i', 85, struct ifreq) /* Get ethernet addr */ #define SIOCGIFNUM _IOR('i', 87, int) /* get number of ifs */ #define SIOCGIFMUXID _IOWR('i', 88, struct ifreq) /* get if muxid */ #define SIOCSIFMUXID _IOW('i', 89, struct ifreq) /* set if muxid */ #define SIOCGIFINDEX _IOWR('i', 90, struct ifreq) /* get if index */ #define SIOCSIFINDEX _IOW('i', 91, struct ifreq) /* set if index */ /* * New interface ioctls that use the struct lifreq. Can be used for * both IPv4 and IPv6. */ #define SIOCLIFREMOVEIF _IOW('i', 110, struct lifreq) /* delete logical */ #define SIOCLIFADDIF _IOWR('i', 111, struct lifreq) /* create logical */ #define SIOCSLIFADDR _IOW('i', 112, struct lifreq) /* set if address */ #define SIOCGLIFADDR _IOWR('i', 113, struct lifreq) /* get if address */ #define SIOCSLIFDSTADDR _IOW('i', 114, struct lifreq) /* set p-p address */ #define SIOCGLIFDSTADDR _IOWR('i', 115, struct lifreq) /* get p-p address */ #define SIOCSLIFFLAGS _IOW('i', 116, struct lifreq) /* set if flags */ #define SIOCGLIFFLAGS _IOWR('i', 117, struct lifreq) /* get if flags */ /* * Needs to be defined using _IOWRN macro to make it datamodel independent. * Argument is a struct lifconf. */ #define SIOCGLIFCONF _IOWRN('i', 120, 16) /* get if list */ #define SIOCSLIFMTU _IOW('i', 121, struct lifreq) /* set if mtu */ #define SIOCGLIFMTU _IOWR('i', 122, struct lifreq) /* get if mtu */ #define SIOCGLIFBRDADDR _IOWR('i', 123, struct lifreq) /* get broadcast addr */ #define SIOCSLIFBRDADDR _IOW('i', 124, struct lifreq) /* set broadcast addr */ #define SIOCGLIFNETMASK _IOWR('i', 125, struct lifreq) /* get subnetmask */ #define SIOCSLIFNETMASK _IOW('i', 126, struct lifreq) /* set subnetmask */ #define SIOCGLIFMETRIC _IOWR('i', 127, struct lifreq) /* get if metric */ #define SIOCSLIFMETRIC _IOW('i', 128, struct lifreq) /* set if metric */ #define SIOCSLIFNAME _IOWR('i', 129, struct lifreq) /* set interface name */ #define SIOCGLIFNUM _IOWR('i', 130, struct lifnum) /* get number of ifs */ #define SIOCGLIFMUXID _IOWR('i', 131, struct lifreq) /* get if muxid */ #define SIOCSLIFMUXID _IOW('i', 132, struct lifreq) /* set if muxid */ #define SIOCGLIFINDEX _IOWR('i', 133, struct lifreq) /* get if index */ #define SIOCSLIFINDEX _IOW('i', 134, struct lifreq) /* set if index */ #define SIOCSLIFTOKEN _IOW('i', 135, struct lifreq) /* Set token for link */ #define SIOCGLIFTOKEN _IOWR('i', 136, struct lifreq) /* Get token for link */ /* local address and */ /* autoconf */ #define SIOCSLIFSUBNET _IOW('i', 137, struct lifreq) /* set subnet prefix */ #define SIOCGLIFSUBNET _IOWR('i', 138, struct lifreq) /* get subnet prefix */ #define SIOCSLIFLNKINFO _IOW('i', 139, struct lifreq) /* set link info */ #define SIOCGLIFLNKINFO _IOWR('i', 140, struct lifreq) /* get link info */ #define SIOCLIFDELND _IOW('i', 141, struct lifreq) /* Delete ND entry */ #define SIOCLIFGETND _IOWR('i', 142, struct lifreq) /* Get ND entry */ #define SIOCLIFSETND _IOW('i', 143, struct lifreq) /* Set ND entry */ ###################################### linux #define SIOCGIFNAME 0x8910 /* get iface name */ #define SIOCSIFLINK 0x8911 /* set iface channel */ #define SIOCGIFCONF 0x8912 /* get iface list */ #define SIOCGIFFLAGS 0x8913 /* get flags */ #define SIOCSIFFLAGS 0x8914 /* set flags */ #define SIOCGIFADDR 0x8915 /* get PA address */ #define SIOCSIFADDR 0x8916 /* set PA address */ #define SIOCGIFDSTADDR 0x8917 /* get remote PA address */ #define SIOCSIFDSTADDR 0x8918 /* set remote PA address */ #define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */ #define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */ #define SIOCGIFNETMASK 0x891b /* get network PA mask */ #define SIOCSIFNETMASK 0x891c /* set network PA mask */ #define SIOCGIFMETRIC 0x891d /* get metric */ #define SIOCSIFMETRIC 0x891e /* set metric */ #define SIOCGIFMEM 0x891f /* get memory address (BSD) */ #define SIOCSIFMEM 0x8920 /* set memory address (BSD) */ #define SIOCGIFMTU 0x8921 /* get MTU size */ #define SIOCSIFMTU 0x8922 /* set MTU size */ #define SIOCSIFHWADDR 0x8924 /* set hardware address */ #define SIOCGIFENCAP 0x8925 /* get/set encapsulations */ #define SIOCSIFENCAP 0x8926 #define SIOCGIFHWADDR 0x8927 /* Get hardware address */ #define SIOCGIFSLAVE 0x8929 /* Driver slaving support */ #define SIOCSIFSLAVE 0x8930 #define SIOCADDMULTI 0x8931 /* Multicast address lists */ #define SIOCDELMULTI 0x8932 #define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */ #define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */ #define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */ #define SIOCGIFPFLAGS 0x8935 #define SIOCDIFADDR 0x8936 /* delete PA address */ #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ #define SIOCGIFCOUNT 0x8938 /* get number of devices */ #define SIOCGIFBR 0x8940 /* Bridging support */ #define SIOCSIFBR 0x8941 /* Set bridging options */ #define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ #define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ /* ARP cache control calls. */ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */ #define SIOCDARP 0x8953 /* delete ARP table entry */ #define SIOCGARP 0x8954 /* get ARP table entry */ #define SIOCSARP 0x8955 /* set ARP table entry */ /* RARP cache control calls. */ #define SIOCDRARP 0x8960 /* delete RARP table entry */ #define SIOCGRARP 0x8961 /* get RARP table entry */ #define SIOCSRARP 0x8962 /* set RARP table entry */ /* Driver configuration calls */ #define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */ /* DLCI configuration calls */ #define SIOCADDDLCI 0x8980 /* Create new DLCI device */ #define SIOCDELDLCI 0x8981 /* Delete DLCI device */ ############################# freebsd #define SIOCTMYADDR _IOWR('i', 144, struct sioc_addrreq) /* My address? */ #define SIOCTONLINK _IOWR('i', 145, struct sioc_addrreq) /* Address on-link? */ #define SIOCTMYSITE _IOWR('i', 146, struct sioc_addrreq) /* In this site? */ #define SIOCGTUNPARAM _IOR('i', 147, struct iftun_req) /* get tunnel */ /* parameters */ #define SIOCSTUNPARAM _IOW('i', 148, struct iftun_req) /* set tunnel */ #define SIOCSIFADDR _IOW('i', 12, struct ifreq) /* set ifnet address */ #define OSIOCGIFADDR _IOWR('i', 13, struct ifreq) /* get ifnet address */ #define SIOCGIFADDR _IOWR('i', 33, struct ifreq) /* get ifnet address */ #define SIOCSIFDSTADDR _IOW('i', 14, struct ifreq) /* set p-p address */ #define OSIOCGIFDSTADDR _IOWR('i', 15, struct ifreq) /* get p-p address */ #define SIOCGIFDSTADDR _IOWR('i', 34, struct ifreq) /* get p-p address */ #define SIOCSIFFLAGS _IOW('i', 16, struct ifreq) /* set ifnet flags */ #define SIOCGIFFLAGS _IOWR('i', 17, struct ifreq) /* get ifnet flags */ #define OSIOCGIFBRDADDR _IOWR('i', 18, struct ifreq) /* get broadcast addr */ #define SIOCGIFBRDADDR _IOWR('i', 35, struct ifreq) /* get broadcast addr */ #define SIOCSIFBRDADDR _IOW('i', 19, struct ifreq) /* set broadcast addr */ #define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) /* get ifnet list */ #define SIOCGIFCONF _IOWR('i', 36, struct ifconf) /* get ifnet list */ #if defined (__amd64__) || defined (COMPAT_32BIT) #define SIOCGIFCONF32 _IOWR('i', 36, struct ifconf32) /* get ifnet list */ #endif #define OSIOCGIFNETMASK _IOWR('i', 21, struct ifreq) /* get net addr mask */ #define SIOCGIFNETMASK _IOWR('i', 37, struct ifreq) /* get net addr mask */ #define SIOCSIFNETMASK _IOW('i', 22, struct ifreq) /* set net addr mask */ #define SIOCGIFMETRIC _IOWR('i', 23, struct ifreq) /* get IF metric */ #define SIOCSIFMETRIC _IOW('i', 24, struct ifreq) /* set IF metric */ #define SIOCDIFADDR _IOW('i', 25, struct ifreq) /* delete IF addr */ #define SIOCAIFADDR _IOW('i', 26, struct ifaliasreq)/* add/chg IF alias */ #define SIOCALIFADDR _IOW('i', 27, struct if_laddrreq) /* add IF addr */ #define SIOCGLIFADDR _IOWR('i', 28, struct if_laddrreq) /* get IF addr */ #define SIOCDLIFADDR _IOW('i', 29, struct if_laddrreq) /* delete IF addr */ #define SIOCSIFCAP _IOW('i', 30, struct ifreq) /* set IF features */ #define SIOCGIFCAP _IOWR('i', 31, struct ifreq) /* get IF features */ #define SIOCGIFINDEX _IOWR('i', 32, struct ifreq) /* get IF index */ #define SIOCGIFMAC _IOWR('i', 38, struct ifreq) /* get IF MAC label */ #define SIOCSIFMAC _IOW('i', 39, struct ifreq) /* set IF MAC label */ #define SIOCSIFNAME _IOW('i', 40, struct ifreq) /* set IF name */ #define SIOCADDMULTI _IOW('i', 49, struct ifreq) /* add m'cast addr */ #define SIOCDELMULTI _IOW('i', 50, struct ifreq) /* del m'cast addr */ #define SIOCGIFMTU _IOWR('i', 51, struct ifreq) /* get IF mtu */ #define SIOCSIFMTU _IOW('i', 52, struct ifreq) /* set IF mtu */ #define SIOCGIFPHYS _IOWR('i', 53, struct ifreq) /* get IF wire */ #define SIOCSIFPHYS _IOW('i', 54, struct ifreq) /* set IF wire */ #define SIOCSIFMEDIA _IOWR('i', 55, struct ifreq) /* set net media */ #define SIOCGIFMEDIA _IOWR('i', 56, struct ifmediareq) /* get net media */ #define SIOCSIFGENERIC _IOW('i', 57, struct ifreq) /* generic IF set op */ #define SIOCGIFGENERIC _IOWR('i', 58, struct ifreq) /* generic IF get op */ #define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */ #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set linklevel addr */ #define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif addres */ #define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq) /* get gif psrc addr */ #define SIOCGIFPDSTADDR _IOWR('i', 72, struct ifreq) /* get gif pdst addr */ #define SIOCDIFPHYADDR _IOW('i', 73, struct ifreq) /* delete gif addrs */ #define SIOCSLIFPHYADDR _IOW('i', 74, struct if_laddrreq) /* set gif addrs */ #define SIOCGLIFPHYADDR _IOWR('i', 75, struct if_laddrreq) /* get gif addrs */ #define SIOCGPRIVATE_0 _IOWR('i', 80, struct ifreq) /* device private 0 */ #define SIOCGPRIVATE_1 _IOWR('i', 81, struct ifreq) /* device private 1 */ #define SIOCSDRVSPEC _IOW('i', 123, struct ifdrv) /* set driver-specific parameters */ #define SIOCGDRVSPEC _IOWR('i', 123, struct ifdrv) /* get driver-specific parameters */ #define SIOCIFCREATE _IOWR('i', 122, struct ifreq) /* create clone if */ #define SIOCIFCREATE2 _IOWR('i', 124, struct ifreq) /* create clone if */ #define SIOCIFDESTROY _IOW('i', 121, struct ifreq) /* destroy clone if */ #define SIOCIFGCLONERS _IOWR('i', 120, struct if_clonereq) /* get cloners */ #define SIOCAIFGROUP _IOW('i', 135, struct ifgroupreq) /* add an ifgroup */ #define SIOCGIFGROUP _IOWR('i', 136, struct ifgroupreq) /* get ifgroups */ #define SIOCDIFGROUP _IOW('i', 137, struct ifgroupreq) /* delete ifgroup */ #define SIOCGIFGMEMB _IOWR('i', 138, struct ifgroupreq) /* get members */ Net-Interface-1.012/build_stuff/generate_SIOCS.pl0000755000000000000120000000106611143675164020376 0ustar rootwheel#!/usr/bin/perl # Copyright 2008 - 2009, Michael Robinton # # This library is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # open(F,$ARGV[0]) or die "\nusage: generate_SIOCS.pl file_containing_#define_SIOC_names\n\n"; my %SIOCS; foreach() { if ($_ =~ /#.*define\s+([A-Za-z0-9_]+)/) { $SIOCS{$1} = 1; } } close F; my $str = ''; my $i = 1; foreach (sort keys %SIOCS) { $str .= $_ .','; ++$i; if ($i > 4) { $str .= "\n\t"; $i = 0; } } chop $str while ($str =~ /[\t\n,]$/); print $str,"\n"; Net-Interface-1.012/build_stuff/make_smi-numbers.pl0000755000000000000120000000137011143675047021100 0ustar rootwheel#!/usr/bin/perl # # make_smi-numbers.pl version 0.01 michael@insulin-pumpers.org # Copyright 2008 - 2009, Michael Robinton # # This library is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # open(F,'./docs/smi-numbers.txt') or die "./docs/smi-numbers.txt not found\n"; print q| /* BEGIN ni_SMI-NUMBERS.c include **************************************************************** * DO NOT ALTER THIS FILE * * it was created by build_stuff/make_smi-numbers.pl * * EDIT THAT INSTEAD * **************************************************************** */ ni_iff_t ni_smi_tab[] = { |; foreach() { next unless $_ =~ /^\s+(\d+)\s+([^\s]+)/; print qq|\t{$1,\t"$2"},\n|; } close F; print q|}; |; Net-Interface-1.012/build_stuff/make_config_acheck.pl0000755000000000000120000000075511143675130021401 0ustar rootwheel#!/usr/bin/perl # Copyright 2008 - 2009, Michael Robinton # # This library is free software; you can redistribute it # and/or modify it under the same terms as Perl itself. # my $usage = q| creates: AX_CHECK_INCLUDE([dir/header.h],[DIR_HEADER_H]) usage: |. $0 .q| in_file |; open(F,$ARGV[0]) || die $usage; foreach() { next unless $_ =~ /(\<\s*([^>\s]+)>)/; my $hf = $1; my $hs = $2; (my $uhs = uc $hs) =~ s|[\./-]|_|g; print qq|AX_CHECK_INCLUDE([$hs],[$uhs]) |; } close F; Net-Interface-1.012/Changes0000644000000000000120000001333511345242670014267 0ustar rootwheelRevision history for Perl extension Net::Interface. 1.012 Mon Mar 8 10:42:51 PST 2010 Interface.xs add test for NULL interface value to skip invalids thanks to Brian West for the fix typo update in Developer.pm 1.011 Mon Mar 23 13:55:58 PDT 2009 update inst/netsymbols.pl v0.09 to use $Config{perlpath} instead of the default '/usr/bin/perl' when building lib/Net/Interface/NetSymbols.pm This will make 'pkgsrc' happy 1.010 Mon Mar 9 01:43:59 PDT 2009 in ni_linuxproc.c, #ifdef and #define some IFA_xxx symbols that appear to be missing in some linux/rtnetlink.h headers in some? linux distros 1.009 Sat Mar 7 13:28:54 PST 2009 As a work-around for broken Solaris headers in some distributions, remove "C" initialization constructors and replace with a Perl call during load to register various "flavors" of ifreq and ifaddr routines add cppflags, ldflags, lddlflags to environment for pcap check 1.008 Sun Mar 1 15:22:06 PST 2009 Add check for improperly truncated ifaddrs entry in Interfaces.xs / getheifs 1.007 Sun Mar 1 10:47:44 PST 2009 Pause seems to think v1.006 is already there??? increment the serial number 1.006 Sun Mar 1 10:11:01 PST 2009 update inst/netsymbols.pl to only keep and process AF/PF family symbols needed for this distribution 1.005 Fri Feb 27 13:17:53 PST 2009 Remove extradef's in inst/netsymbols.pl for AF_NS AF_ATM AF_NUTSS since they are not equivalent In Interface.xs, gethifs() initialize ifap to NULL and check its return value for non-null 1.004 Wed Feb 25 15:46:20 PST 2009 Remove Makefile.pl generated "C" files from MANIFEST Rename miniSocket so it is not deleted by make clean Add configure test to check for MALLOC in stdlib so obsolete malloc.h file is not included Correct definition of SA_LEN for systems that don't have it Adjust code for changed definition. 1.003 Tue Feb 24 15:16:54 PST 2009 replace definitions missing in MAC OSX with def's from local distro header file for ni_in6_ifreq.c 1.002 Mon Feb 23 13:16:27 PST 2009 Updated documentation in Developer.pm Add array to note and ignore troublesome unused symbols in inst/netsymbols.pl v0.06 For systems that do not support SIOCGIFINDEX, extract interface index from AF_PACKET or AF_LINK record Adjust constructor syntax for picky Sunos CC on certain systems 1.001 Sat Feb 21 18:30:07 PST 2009 BETA 1 release. correct symbol typo in ni_lifreq.c add inet_aton for systems that don't have it like old Solaris fixed bad cast for "flags" in multiple files, changed from an 'int' to a 'short' add SIOCGENADDR support for Solaris removed KAME bits from 6adrs in Interface.xs af_common in Interfaces.pm, change &AF_INET to AF_INET to accomodate broken Perl 5.8.4 in Interfaces.xs, check for LOOPBACK interface and bypass MAC address processing if found add file ni_fallbackhwaddr.c with lots of ways to get the MAC address when it is not presented in a _DL or _LL record. eliminate get_hwaddr in af_inetX.c and ni_linuxproc.c corrected addr42txt call that requests array rather than scalar return value from ->address(fam,index added methods for update of flags, mtu, metric as well as refreshing the particular interface object updated inst/netsymbols.pl to accomodate value that exceed what fits in an I32 make char, u_char casting adjustments for picky Solaris 'cc' compiler added get_ifreqs and get_ifaddrs for Solaris, activated lifreq developer interface. Expanded "flags" to an NV (u_int64_t) to accomodate extended flags on Solaris. Add method to get "index" of the interface Consolidate AF_family support into ni_af_common.c and change general SIOCxxxxx use to be ifreq family specific 1.000 Sat Jan 31 14:43:16 PST 2009 updated documentation with more info about using symbols added filter to always use numeric values of symbols when doing $if->address($fam,$idx) type operations. updated faceinfo.t to use (test) above syntax updated version string to support 3 digits post decimal point 0.90 Mon Jan 26 01:16:53 PST 2009 completed initial API and implementation of most read in Interface.pm Fri Jan 23 17:32:15 PST 2009 first working version of the re-written module including ipV6 support in Interface.xs 0.15 development no release 0.14 Mon Jan 5 16:26:27 PST 2009 development no release 0.13 update config.h with autoconf 0.12 not released rework if.t again 0.11 Mon Oct 6 16:23:36 PDT 2008 incorporate code into the build process to determine underlying OS's memory PAGE_SIZE add checkfor SA_LEN include various socket address checks from perl's Socket.xs updated t/if.t to remove reference to interface 'lo and lo0' and dependence on POSIX::EPERM 0.10 Sat Sep 27 10:52:26 PDT 2008 ifreq patch in 0.09 revised to support additional platforms patchs submitted by Jens Rehsack REHSACK@cpan.org Thank you Jens 0.09 Tue Aug 26 16:10:24 PDT 2008 In MAC os 10.5.4 it was noticed that *struct ifreq* is no longer a fixed width structure Thanks to "Keith Peters" keith@blekko.com for finding this and submitting a patch to fix it up. 0.08 September 11, 2006 update mac_bin2hex to use specific length in unpack instead of H* 0.07 Wed Mar 15 19:08:36 PST 2006 correct documentation error on interface names michael@bizsysystems.com 0.06 Mon Mar 13 17:05:33 PST 2006 - added 'constants' tags - fixed array return for hardware address - added more documentation to .pm file michael@bizsystems.com 0.05 Thu Mar 9 15:10:13 PST 2006 unreleased michael@bizsystems.com - fixed typos in EXPORT_OK array - added documentation to .pm file 0.04.1 Thu Mar 16 19:45:28 2000 - hacked in a fix for MAC address jerrad@networkengines.com 0.01 Sat Nov 29 10:32:23 1997 - original version; created by h2xs 1.18 Net-Interface-1.012/ni_in6_classify.c0000644000000000000120000002763711145133734016227 0ustar rootwheel /* ******************************************************************** * * ni_in6_classify.c version 0.01 1-23-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ /* adapted from http://cvs.deepspace6.net/view/ipv6calc/lib/libipv6addr.c?rev=1.23 */ #include "localconf.h" #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 /* ************************************************************ * * http://en.wikipedia.org/wiki/IPv6 * * http://www.sabi.co.uk/Notes/swIPv6Prefixes.html * * http://en.wikipedia.org/wiki/6to4 * * http://www.iana.org/assignments/ipv6-address-space * * ************************************************************ */ u_int32_t ni_in6_classify(unsigned char * s6_bytes) { u_int32_t type = 0; #define byte0 s6_bytes[0] #define byte1 s6_bytes[1] #define byte2 s6_bytes[2] #define byte3 s6_bytes[3] #define byte4 s6_bytes[4] #define byte10 s6_bytes[10] #define byte11 s6_bytes[11] #define byte12 s6_bytes[12] #define byte13 s6_bytes[13] #define byte14 s6_bytes[14] #define byte15 s6_bytes[15] #define bytes0_1 (s6_bytes[0] | s6_bytes[1]) #define bytes2_3 (s6_bytes[2] | s6_bytes[3]) #define bytes4_5 (s6_bytes[4] | s6_bytes[5]) #define bytes6_7 (s6_bytes[6] | s6_bytes[7]) #define bytes8_9 (s6_bytes[8] | s6_bytes[9]) #define bytes10_11 (s6_bytes[10] | s6_bytes[11]) #define bytes12_13 (s6_bytes[12] | s6_bytes[13]) #define bytes14_15 (s6_bytes[14] | s6_bytes[15]) #define bytes0_3 (bytes0_1 | bytes2_3) #define bytes4_7 (bytes4_5 | bytes6_7) #define bytes8_11 (bytes8_9 | bytes10_11) #define bytes12_15 (bytes12_13 | bytes14_15) #define allbytes (bytes0_3 | bytes4_7 | bytes8_11 | bytes12_15) /* ************************************************************ * * unspecified address - all zeros * * ************************************************************ */ if (allbytes == 0) type |= IPV6_ADDR_UNSPECIFIED; /* ************************************************************ * * FC00::/7 Unique Local Unicast [RFC4193] * * ************************************************************ */ if ((byte0 & 0xFEu) == 0xFCu) type |= IPV6_ADDR_ULUA; /* ************************************************************ * * 2000::/3 Global Unicast [RFC4291] * * ************************************************************ */ if ((byte0 & 0xE0u) == 0x20u) type |= IPV6_ADDR_AGU; /* **************************************************************************** * * ftp://ftp.isi.edu/in-notes/rfc2471.txt * * IPv6 Testing Address Allocation * * The Aggregatable Global Unicast Address Allocation format defined in * * [AGGR] is as follows: * * * * | 3 | 13 | 32 | 16 | 64 bits | * * +---+-----+-----------+--------+--------------------------------+ * * |FP | TLA | NLA ID | SLA ID | Interface ID | * * | | ID | | | | * * +---+-----+-----------+--------+--------------------------------+ * * * * where: * * * * FP = 001 = Format Prefix * * * * This is the Format Prefix used to identify aggregatable * * global unicast addresses. * * * * TLA = 0x1FFE = Top-Level Aggregation Identifier * * * * This is a TLA ID assigned by the IANA for 6bone testing under * * the auspices of the IETF IPng Transition Working Group 6bone * * testbed activity. * * * * 3ffe::/16 - experimental 6bone - obsolete 6/6/2006 * * **************************************************************************** */ if (byte0 == 0x3Fu && byte1 == 0xFEu) type |= IPV6_ADDR_6BONE; /* **************************************************************************** * * http://www.ipv6day.org/action.php?n=En.GetConnected-Teredo * * Teredo Prefix has been changed from 3ffe:831f::/32 to 2001:0000::/32 * * once the Teredo specification has been published as RFC4380 * * * * http://www.ietf.org/rfc/rfc4380.txt * * 2.6. Global Teredo IPv6 Service Prefix * * An IPv6 addressing prefix whose value is 2001:0000:/32 * * **************************************************************************** * * * * **************************************************************************** * * OLD TEREDO * * if (byte0 == 0x3fu && byte1 == 0xfeu && byte2 == 0x83u && byte3 == 0x1f) { * * type |= IPV6_ADDR_TEREDO; * * **************************************************************************** */ if (byte0 == 0x20 && byte1 == 0x1u) { if (bytes2_3 == 0) type |= IPV6_ADDR_TEREDO; /* **************************************************************************** * * http://www.iana.org/assignments/ipv6-address-space * * http://tools.ietf.org/html/rfc3849 * * 2001:0DB8::/32 has been assigned as a NON-ROUTABLE for documentation * * **************************************************************************** */ if (byte2 == 0xDu && byte3 == 0xB8u) type |= IPV6_ADDR_NON_ROUTE_DOC; } /* 2001::/16 /* **************************************************************************** * * http://www.ietf.org/rfc/rfc3056.txt?number=3056 * * * * The IANA has permanently assigned one 13-bit IPv6 Top Level * * Aggregator (TLA) identifier under the IPv6 Format Prefix 001 [AARCH, * * AGGR] for the 6to4 scheme.Its numeric value is 0x0002, i.e., it is * * 2002::/16 when expressed as an IPv6 address prefix. * * * * The subscriber site is then deemed to have the following IPv6 address * * prefix, without any further assignment procedures being necessary: * * * * Prefix length: 48 bits * * Format prefix: 001 * * TLA value: 0x0002 * * NLA value: V4ADDR * * * * This is illustrated as follows: * * * * | 3 | 13 | 32 | 16 | 64 bits | * * +---+------+-----------+--------+--------------------------------+ * * |FP | TLA | V4ADDR | SLA ID | Interface ID | * * |001|0x0002| | | | * * +---+------+-----------+--------+--------------------------------+ * * * * Thus, this prefix has exactly the same format as normal /48 prefixes * * assigned according to [AGGR]. It can be abbreviated as * * 2002:V4ADDR::/48. Within the subscriber site it can be used exactly * * **************************************************************************** */ if (byte0 == 0x20 && byte1 == 0x2u) { type |= IPV6_ADDR_6TO4; /* ************************************************************************************ * * 2002::: * * http://research.microsoft.com/en-us/um/redmond/projects/msripv6/docs/6to4.htm * * ************************************************************************************ */ if (bytes2_3 == bytes12_13 && bytes4_5 == bytes14_15 && (bytes6_7 | bytes8_9 | bytes10_11) == 0) type |= IPV6_ADDR_6TO4_MICROSOFT; } /* 2002::/16 */ /* **************************************************************************** * * http://www.iana.org/assignments/ipv6-unicast-address-assignments 2008-05-13 * * **************************************************************************** */ if (!(type & ( IPV6_ADDR_6BONE | /* obsolete - remove? */ IPV6_ADDR_6TO4 | /* 2002::/16 */ IPV6_ADDR_NON_ROUTE_DOC | /* 2001:0DB8::/32 */ IPV6_ADDR_TEREDO /* 2001:0000::/32 */ )) && (byte0 & 0xE0u) == 0x20u) type |= IPV6_ADDR_PRODUCTIVE; /* ******************************************************************************************** * * http://www.tcpipguide.com/free/t_IPv6MulticastandAnycastAddressing-4.htm * * http://www.ipv6tf.org/index.php?page=meet/glossary&id_palabra=SOLICITED-NODE%20ADDRESS * * http://www.soi.wide.ad.jp/class/99007/slides/24/25.html * * Requested node address is built with FF02::1:FF00:0/104 prefix * * and latest unicast IPv6 address 24 bits. * * All solicited node addresses have their T flag set to zero and a scope ID of 2, hence they * * start with FF02. The 112 bit group ID consists of: * * 79 bits of zeros, a single 1, eight 1's, and the bottom 24bits of the unicast address * * ******************************************************************************************** */ if (byte0 == 0xFFu && byte1 == 0x2u && (bytes2_3 | bytes4_5 | bytes6_7 | bytes8_9) == 0 && byte10 == 0 && byte11 == 0x1u) type |= IPV6_ADDR_SOLICITED_NODE; /* ************************************************************ * * http://en.wikipedia.org/wiki/ISATAP * * The link-local address is determined by concatenating * * fe80:0000:0000:0000:0000:5efe: * * with the 32 bits of the host's IPv4 address * * ************************************************************ */ if (byte0 == 0xFFu && byte1 == 0x80u && (bytes2_3 | bytes4_5 | bytes6_7 | bytes8_9) == 0 && byte10 == 0x5Eu && byte11 == 0xFEu) type |= IPV6_ADDR_ISATAP; /* ************************************************************ * * if not local unicast, any address where the first * * three bits are not all 1's or all 0's is UNICAST * * ************************************************************ */ if (byte0 == 0xFCu || ((byte0 & 0xE0u) != 0 && (byte0 & 0xE0u) != 0xE0u)) { type |= IPV6_ADDR_UNICAST; return (type); } else if (byte0 == 0xFF) { type |= IPV6_ADDR_MULTICAST; switch(byte1) { case 0x1u : type |= IPV6_ADDR_LOOPBACK; break; case 0x2u : type |= IPV6_ADDR_LINKLOCAL; break; case 0x5 : type |= IPV6_ADDR_SITELOCAL; break; } return type; } /* ******************** * * local stuff * * ******************** */ if (byte0 == 0xFEu) { if ((byte1 & 0xC0u) == 0x80) { type |= IPV6_ADDR_LINKLOCAL | IPV6_ADDR_UNICAST; return type; } else if ((byte1 & 0xC0u) == 0xC0u) { type |= IPV6_ADDR_SITELOCAL | IPV6_ADDR_UNICAST; return type; } } /* ******************** * * misc * * ******************** */ if ((bytes0_3 | bytes4_7) == 0) { if (bytes8_11 == 0) { if (bytes12_15 == 0) { type |= IPV6_ADDR_ANY; return type; } else if ((bytes12_13 | byte14) == 0 && byte15 == 0x1u) { type |= IPV6_ADDR_LOOPBACK | IPV6_ADDR_UNICAST; return type; } type |= IPV6_ADDR_COMPATv4 | IPV6_ADDR_UNICAST; return type; } if (bytes8_9 == 0 && (byte10 & byte11) == 0xFFu) { type |= IPV6_ADDR_MAPPED; return type; } } type |= IPV6_ADDR_RESERVED; return type; } #endif Net-Interface-1.012/ni_fallbackhwaddr.c0000644000000000000120000001513711145133734016557 0ustar rootwheel/* ******************************************************************** * * ni_fallbackhwaddr.c version 0.01 2-3-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "localconf.h" unsigned char * ni_fallbackhwaddr(u_int af, void * vifr) { struct nifreq * ifr = (struct nifreq * )vifr; int i, n, dflgs, ppa, fd = -1; char * p; #ifdef HAVE_STRUCT_IFDEVEA struct ifdevea physaddr; #endif #ifdef HAVE_NETIO_H struct fis * ioctl_arg; #endif #ifdef HAVE_SYS_DLPI_H char name[IFNAMSIZ +5], dlpbuf[DL_MAXIMUM]; struct strbuf ctrl; union DL_primitives dlp; dl_info_ack_t * dlpi = (dl_info_ack_t *)dlpbuf; # ifdef DL_ATTACH_REQ dl_ok_ack_t * dlpa = (dl_ok_ack_t *)dlpbuf; dl_bind_ack_t * dlpb = (dl_bind_ack_t *)dlpbuf; dl_phys_addr_ack_t * dlpp = (dl_phys_addr_ack_t *)dlpbuf; # endif #endif #if defined (SIOCGIFHWADDR) || defined (SIOCGENADR) || (defined (HAVE_STRUCT_IFDEVEA) && defined (SIOCPHYSADDR)) if ((fd = ni_clos_reopn_dgrm(fd,af)) < 0) goto dgrm_failed; # ifdef SIOCGIFHWADDR if (ioctl(fd,SIOCGIFHWADDR,ifr) != -1 && NI_MAC_NOT_ZERO(&ifr->ni_saddr.sa_data)) { close(fd); return (unsigned char *)(&ifr->ni_saddr.sa_data); } # endif # ifdef SIOCGENADDR if (ioctl(fd,SIOCGENADDR,ifr) != -1 && NI_MAC_NOT_ZERO(&ifr->ni_char)) { close(fd); return (unsigned char *)&ifr->ni_char; } # endif # if defined (HAVE_STRUCT_IFDEVEA) && defined (SIOCSPHYSADDR) bzero(phys.ifr_name,sizeof(physaddr)); strlcpy(physaddr.ifr_name,ifr->ni_ifr_name,IFNAMSIZ); if (ioctl(fd,SIOCPHYSADDR,&physaddr) >= 0 && NI_MAC_NOT_ZERO(physaddr.current_pa)) { memcpy(&ifr->ni_char,&physaddr.current_pa[0]); close(fd); return (unsigned char *)&ifr->ni_char; } # endif close(fd); dgrm_failed: #endif /* all that stuff above */ /* ok, could not get the MAC address the easy way, try harder */ #ifdef HAVE_NIT_IF_H if ((fd = open("/dev/nit",0)) >= 0) { if (ioctl(fd,NIOCBIND,ifr) >= 0 && ioctl(fd,SIOCGIFADDR) >= 0) { close(fd); if (NI_MAC_NOT_ZERO(&ifr->ni_char)) return (unsigned char *)&ifr->ni_char; else close(fd); } #endif /* http://www.informatik.uni-frankfurt.de/doc/man/hpux/lan.7.html */ #ifdef HAVE_NETIO_H if ((fd = open(&ifr->ni_ifr_name,O_RDONLY)) >= 0) { bzero(&ioctl_arg,sizeof(struct fis)); ioctl_arg.reqtype = LOCAL_ADDRESS; if (ioctl(fd,NETSTAT,&ioctl_arg) >= 0) { close(fd); if (ioctl_arg.vtype == 6) { memcpy(&ifr->ni_char,&ioctl_arg.value.s[0],6); return (unsigned char *)&ifr->ni_char; } } close(fd); } #endif #ifdef HAVE_SYS_DLPI_H ppa = -1; sprintf(name,"/dev/%s",&ifr->ni_ifr_name); if ((fd = open(name,O_RDWR)) < 0) { /* try opening without the ppa number */ n = strlen(name); p = name; p += 5; for(i=5;idl_primitive != DL_INFO_ACK) goto dlpi_error; /* have hardware mac, might not be current mac */ memcpy(&ifr->ni_ifr_name,(dlpbuf + dlpi->dl_addr_offset),6); # ifdef DL_ATTACH_REQ if (ppa < 0 || dlpi->dl_provider_style != DL_STYLE2) goto dlpi_ret_hw; bzero(&ctrl,sizeof(ctrl)); dlp.attach_req.dl_primitive = DL_ATTACH_REQ; dlp.attach_req.dl_ppa = ppa; ctrl.buf = (char *)&dlp; ctrl.len = DL_ATTACH_REQ_SIZE; if (putmsg(fd,&ctrl,NULL,0) < 0) goto dlpi_ret_hw; ctrl.buf = (char *)&dlpbuf; ctrl.len = 0; ctrl.maxlen = DL_MAXIMUM; i = RS_HIPRI; /* flags */ bzero(dlpbuf,DL_OK_ACK_SIZE); if (getmsg(fd,&ctrl,NULL,&i) < 0) goto dlpi_ret_hw; if (dlpa->dl_primitive != DL_OK_ACK) goto dlpi_ret_hw; # endif /* DL_ATTACH_REQ */ bzero(&ctrl,sizeof(ctrl)); dlp.dl_primitive = DL_PHYS_ADDR_REQ; dlp.physaddr_req.dl_addr_type = DL_CURR_PHYS_ADDR; ctrl.buf = (char *)&dlp; ctrl.len = DL_PHYS_ADDR_REQ_SIZE; if (putmsg(fd,&ctrl,NULL,0) < 0) goto dlpi_ret_hw; ctrl.buf = (char *)&dlpbuf; ctrl.len = 0; ctrl.maxlen = DL_MAXIMUM; i = RS_HIPRI; /* flags */ bzero(dlpbuf,DL_MAXIMUM); if (getmsg(fd,&ctrl,NULL,&i) < 0) goto dlpi_ret_hw; if (dlpi->dl_primitive != DL_PHYS_ADDR_ACK) goto dlpi_ret_hw; /* have current MAC address, return it */ memcpy(ifr->ni_ifr_name,(dlpbuf + dlpp->dl_addr_offset),6); dlpi_ret_hw: close(fd); return (unsigned char *)&ifr->ni_ifr_name[0]; dlpi_error: close(fd); #endif /* HAVE_SYS_DLPI_H */ hwaddr_error: errno = ENOSYS; return NULL; } Net-Interface-1.012/ni_funct.h0000644000000000000120000003666511154563060014762 0ustar rootwheel /* ******************************************************************** * * ni_funct.h version 0.04 3-7-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef _NI_FUNC_H #define _NI_FUNC_H 1 #ifndef _NI_FIXUPS_H #error NEED 'ni_fixups' first #endif /* **************************************************** * * checking and printing the MAC address * * **************************************************** */ #define NI_PRINT_MAC(__macp) printf("MAC addr %02X:%02X:%02X:%02X:%02X:%02X", \ (u_char)__macp[0],(u_char)__macp[1],(u_char)__macp[2], \ (u_char)__macp[3],(u_char)__macp[4],(u_char)__macp[5]) #define NI_MAC_NOT_ZERO(__macp) (((u_int32_t *)(__macp))[0] != 0 || ((u_int16_t *)(__macp))[2] != 0) /* **************************************************** * * text table definition * * **************************************************** */ typedef struct ni_IFF_table_entry { u_int64_t iff_val; char *iff_nam; } ni_iff_t; /* **************************************************** * * print ipV6 address - full length * * **************************************************** */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 #define NI_PRINT_IPV6(__sin6_addr) \ printf("%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X", \ (__sin6_addr).s6_addr[0], \ (__sin6_addr).s6_addr[1], \ (__sin6_addr).s6_addr[2], \ (__sin6_addr).s6_addr[3], \ (__sin6_addr).s6_addr[4], \ (__sin6_addr).s6_addr[5], \ (__sin6_addr).s6_addr[6], \ (__sin6_addr).s6_addr[7], \ (__sin6_addr).s6_addr[8], \ (__sin6_addr).s6_addr[9], \ (__sin6_addr).s6_addr[10], \ (__sin6_addr).s6_addr[11], \ (__sin6_addr).s6_addr[12], \ (__sin6_addr).s6_addr[13], \ (__sin6_addr).s6_addr[14], \ (__sin6_addr).s6_addr[15]) #endif /* **************************************************** * * free the appropriate mememory for getifaddrs * * **************************************************** */ void ni_free_gifa(struct ifaddrs * ifap, int flavor); /* **************************************************** * * local multi-platform get_ifaddrs function * * **************************************************** */ int ni_getifaddrs(struct ifaddrs **ifap, int flavor); /* **************************************************** * * conditionally close and reopen socket * * **************************************************** */ int ni_clos_reopn_dgrm(int fd, u_int af); /* **************************************************** * * allocate memory for a duplicate of the * * memory chunck at 'memp' of 'size' and * * return a pointer. MUST free(newptr) * * On error returns NULL and sets ENOMEM * * **************************************************** */ void * ni_memdup(void * memp, int size); /* **************************************************** * * generate a netmask from a prefix length * * **************************************************** */ void ni_plen2mask(void * in_addr, int plen, int sizeofaddr); /* **************************************************** * * calculate the length of netmask prefix * * **************************************************** */ /* pointer to bytes, size in bytes of address */ int ni_prefix(void * ap, int sz); /* **************************************************** * * some OS lose scope on the particular device/addr * * handle when certain ioctl's are performed. this * * function refreshs the ifconf chain and positions * * the pointers in the exact same spot with fresh scope * * **************************************************** */ struct ni_ifconf_flavor; int ni_refresh_ifreq(int fd, struct ifconf * ifc, void ** ifr, void ** lifr, struct ni_ifconf_flavor * nip); /* **************************************************** * * define access to various types of fields * * in 'ifreq', 'in6_ifreq', and 'lifreq' * * structures * * **************************************************** */ /* ******************************************** * * function to return MAC address if it * * is not present in a DL or LL record * * ******************************************** */ unsigned char * ni_fallbackhwaddr(u_int af, void * ifr); /* ******************************************** * * the semi-standard version of getifaddrs * * ******************************************** */ int nifreq_gifaddrs(struct ifaddrs **ifap, struct ni_ifconf_flavor * nifp); /* a sane amount of memory for interface descriptors */ #define NI_IFREQ_MEM_MAX 1048576 struct nifreq { char ni_ifr_name[IFNAMSIZ]; union { struct sockaddr ifr_saddr; struct sockaddr_in ifr_sin; struct sockaddr_storage ifr_stor; #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 struct sockaddr_in6 ifr_sin6; #endif short ifr_short; unsigned short ifr_ushort; int ifr_int; char ifr_char[2]; /* this is really a char * */ caddr_t ifr_cadt_data; unsigned char ifr_uchar[2]; int ifr_iary[2]; unsigned int ifr_uint; u_int32_t ifr_uint32; u_int64_t ifr_uint64; u_int32_t ifr_uiary[2]; #ifdef HAVE_STRUCT_IN6_IFREQ struct in6_addrlifetime ifru_lifetime; struct in6_ifstat ifru_stat; struct icmp6_ifstat ifru_icmp6stat; #endif #ifdef HAVE_STRUCT_LIFREQ char lifreq_pad[NI_LIFREQ_PAD]; #endif } ni_ifru; /* convenience definitions */ # #define ni_saddr ni_ifru.ifr_saddr /* any sockaddr */ #define ni_sin ni_ifru.ifr_sin /* any sockaddr_in */ #define ni_stor ni_ifru.ifr_stor /* and sockaddr_storage */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 # define ni_sin6 ni_ifru.ifr_sin6 /* any sockaddr_in6 */ #endif #define ni_short ni_ifru.ifr_short /* any short */ #define ni_ushort ni_ifru.ifr_ushort /* any unsigned short */ #define ni_int ni_ifru.ifr_int /* any int */ #define ni_char ni_ifru.ifr_char /* any char array */ #define ni_data ni_ifru.ifr_cadt_data /* device specific data pointer */ #define ni_uchar ni_ifru.ifr_uchar /* any unsigned char array - hardware mac */ #define ni_iary ni_ifru.ifr_iary /* any int array */ #define ni_uint ni_ifru.ifr_uint /* any uint */ #define ni_uint32 ni_ifru.ifr_uint32 /* any uint32 */ #define ni_uint64 ni_ifru.ifr_uint64 /* any uint64 */ #define ni_uiary ni_ifru.ifr_uiary /* any uint32 array */ #ifdef HAVE_STRUCT_IN6_IFREQ # define ni_lifetime ni_ifru.ifru_lifetime # define ni_stat ni_ifru.ifru_stat # define ni_icmp6 ni_ifru.ifru_icmp6stat #endif }; /* **************************************************** * * standard SIOCget functions * * * * execute supported ioctl's * * where a value is requested, return it * * otherwise it is up to the user to retireve * * information via their pointers * * returns -1 on error, sets errno * * **************************************************** */ int32_t ni_get_any(int fd, int cmd, void * ifr); /* **************************************************** * * standard SIOCset functions * * * * execute supported ioctl's * * returns -1 on error, sets errno * * * * struct nifreq ifr should be prepared, for * * add/modify of a Linux ipV6 address, the * * PREFIX/CIDR value should be stored at: * * * * ifr->ni_sin6.sin6_port * * * * **************************************************** */ int ni_set_any(int fd, int cmd, struct nifreq * ifr); #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 /* ******************************************** * * get scope id from struct scope index * * or KAME bits, correct bits as needed * * ******************************************** */ u_int ni_get_scopeid(struct sockaddr_in6 * sin6); #endif /* ******************************************** * * IPV6_ADDR_xxxx definitions from * * linux kernel include/net/ipv6.h * * these are the bits for the byte in * * /proc/net/if_net6 * * ******************************************** * * * with credits to kernel and USAGI developer team * basic information was taken from "kernel/include/net/ipv6.h" * * Addr type * * type - unicast | multicast | anycast * scope - local | site | global * v4 - compat * v4mapped * any * loopback */ /* * make sure and include changes to this table in the * _lx_types function in Interfaces.xs */ #define IPV6_ADDR_ANY (u_int32_t) 0x0000u #define IPV6_ADDR_UNICAST (u_int32_t) 0x0001u #define IPV6_ADDR_MULTICAST (u_int32_t) 0x0002u #define IPV6_ADDR_ANYCAST (u_int32_t) 0x0004u #define IPV6_ADDR_LOOPBACK (u_int32_t) 0x0010u #define IPV6_ADDR_LINKLOCAL (u_int32_t) 0x0020u #define IPV6_ADDR_SITELOCAL (u_int32_t) 0x0040u #define IPV6_ADDR_COMPATv4 (u_int32_t) 0x0080u #define IPV6_ADDR_SCOPE_MASK (u_int32_t) 0x00f0u #define IPV6_ADDR_MAPPED (u_int32_t) 0x1000u #define IPV6_ADDR_RESERVED (u_int32_t) 0x2000u /* reserved address space */ #define IPV6_ADDR_ULUA (u_int32_t) 0x4000u /* Unique Local Unicast Address */ #define IPV6_ADDR_6TO4 (u_int32_t) 0x00010000u #define IPV6_ADDR_6BONE (u_int32_t) 0x00020000u #define IPV6_ADDR_AGU (u_int32_t) 0x00040000u #define IPV6_ADDR_UNSPECIFIED (u_int32_t) 0x00080000u #define IPV6_ADDR_SOLICITED_NODE (u_int32_t) 0x00100000u #define IPV6_ADDR_ISATAP (u_int32_t) 0x00200000u /* RFC 4214 */ #define IPV6_ADDR_PRODUCTIVE (u_int32_t) 0x00400000u #define IPV6_ADDR_6TO4_MICROSOFT (u_int32_t) 0x00800000u #define IPV6_ADDR_TEREDO (u_int32_t) 0x01000000u /* RFC 4380 */ #define IPV6_ADDR_ORCHID (u_int32_t) 0x02000000u /* RFC 4843 */ #define IPV6_ADDR_NON_ROUTE_DOC (u_int32_t) 0x08000000u /* RFC 3849 */ /* **************************************************** * * return size of format table for linux_scope2txt * * **************************************************** */ int ni_sizeof_type2txt(); /* **************************************************** * * This function maps I style scope * * bits to their RFC-2373 equivalent. * * * * scope flags rfc-2373 * * 0 reserved * * 1 node-local (aka loopback, interface-local) * * 2 link-local * * 3 unassigned * * 4 unassigned * * 5 site-local * * 6 unassigned * * 7 unassigned * * 8 organization-local * * 9 unassigned * * A unassigned * * B unassigned * * C unassigned * * D unassigned * * E global scope * * F reserved * * * * Linux rfc-2373 * * 0x0000 0xe GLOBAL * * 0x0010u 0x1 NODELOCAL, LOOPBACK, INTERFACELOCAL * * 0x0020u 0x2 LINKLOCAL * * 0x0040u 0x5 SITELOCAL * * 0x0080u is mapped out of range to 0x10 * * **************************************************** */ int ni_lx_type2scope(int lscope); /* **************************************************** * * value definitions for above * * **************************************************** */ #define RFC2373_GLOBAL 0xeu #define RFC2373_ORGLOCAL 0x8u #define RFC2373_SITELOCAL 0x5u #define RFC2373_LINKLOCAL 0x2u #define RFC2373_NODELOCAL 0x1u #define LINUX_COMPATv4 0x10u /* **************************************************** * * print statement for internal linux format flags * * **************************************************** */ void ni_linux_scope2txt(u_int32_t flags); /* **************************************************** * * returns attribute bits for extended linux scope * * **************************************************** */ u_int32_t ni_in6_classify(unsigned char * s6_bytes); /* **************************************************** * * support for variants of ifreq * * **************************************************** */ /* * IF / WHEN YOU CHANGE THIS STRUCT, * UPDATE IT IN THE SUPPORTED FLAVOR MODULES! * * Currently support flavors: */ enum ni_FLAVOR { NI_NULL, NI_IFREQ, NI_LIFREQ, NI_IN6_IFREQ, NI_LINUXPROC }; static int developer(void * ifr); struct ni_ifconf_flavor { enum ni_FLAVOR ni_type; int siocgifindex; int siocsifaddr; int siocgifaddr; int siocdifaddr; int siocaifaddr; int siocsifdstaddr; int siocgifdstaddr; int siocsifflags; int siocgifflags; int siocsifmtu; int siocgifmtu; int siocsifbrdaddr; int siocgifbrdaddr; int siocsifnetmask; int siocgifnetmask; int siocsifmetric; int siocgifmetric; int ifr_offset; int (*gifaddrs)(struct ifaddrs **ifap, struct ni_ifconf_flavor * nifp); void (*fifaddrs)(struct ifaddrs *ifa); int (*refreshifr)(int fd, struct ifconf * ifc, void ** oifr, void ** olifr, struct ni_ifconf_flavor * nip); void * (*getifreqs)(int fd, void * ifc); int (*developer)(void * whatever); struct ni_ifconf_flavor * ni_ifcf_next; }; struct ni_ifconf_flavor * ni_ifcf_get(enum ni_FLAVOR type); /* return flavor pointer for NI_IFREQ if flavor is unknown */ struct ni_ifconf_flavor * ni_safe_ifcf_get(enum ni_FLAVOR type); void ni_ifcf_register(struct ni_ifconf_flavor * nip); struct ni_af_flavor; struct ni_af_flavor { int ni_af_family; int32_t (*af_get_any)(int fd, int cmd, void * ifr); int (*af_getifaddrs)(int fd, struct ifaddrs * thisif, struct nifreq * ifr,...); struct ni_af_flavor * ni_aff_next; }; struct ni_af_flavor * ni_af_get(int af); void ni_af_register(struct ni_af_flavor * nafp); /* ************************************************************ * * Certain broken Solaris headers cause build * * errors with the syntax for constructors. * * i.e. * * void __attribute__((constructor)) * * constructor_function () * * { * * code.... * * }; * * * * line 249: syntax error before or at: ( * * line 251: warning: old-style declaration or incorrect type * * cc: acomp failed [filename.c] * * *** Error code 2 * * make: Fatal error: Command failed for target 'filename.o' * * * * The various constructors are declared here and called * * during module load as a work-around to this problem * * ************************************************************ */ void ni_ifreq_ctor(); void ni_in6_ifreq_ctor(); void ni_lifreq_ctor(); void ni_linuxproc_ctor(); /* **************************************************** * * developer support, not for production * * **************************************************** */ int ni_developer(enum ni_FLAVOR type); void ni_getifaddrs_dump(int flavor, struct ifaddrs * ifap); #endif Net-Interface-1.012/file_definitions0000644000000000000120000000425711145133734016232 0ustar rootwheel Interface.pm perl portion of module Interface.xs perlxs portion of module build_stuff/generate_SIOCS.pl generates a list of SIOCxxx's from target include file build_stuff/make_config_acheck.pl process output of make_ordered_list.pl below build_stuff/make_defaults.pl process output of make_rodered_list.pl below build_stuff/make_ordered_list.pl creat an ordered list of header files for config inclusion config.h site local configuration info generated by ./configure configure site local configuration script configure.ac autoconfig script defaults.h include decision tree for ./configure output hints/solaris_2.pl like it says... inet_aton.c inet_aton for OS's that don't have it, i.e. old Solaris inst/netsymbols.pl creates site local symbol includes for AF_xxx, etc... install-sh autoconf required file localconf.h wrapper for *.h files and a few fixups for types miniSocket.inc Perl's version of inet_aton, inet_ntoa, tuned up a bit ni_IFF_inc.c site local IFF_xxx definition table ni_XStabs_inc.c site local symbol definition tables ni_in6_classify.c extracts universal "type" information from ipV6 address ni_af_inet.c getifaddrs, get, set operations unique to AF_INET family ni_fixups.h functions missing in various OS's ni_fallbackhwaddr lots of ways to get MAC address that's not in DL or LL record ni_funct.h header info for ni_xxx files ni_getifaddrs.c getifaddrs decision tree ni_ifreq.c getifreq, getifaddrs, developer interface for flavor "ifreq" ni_in6_ifreq.c getifreq, getifaddrs, developer interface for flavor "in6_ifreq" ni_lifreq.c getifreq, getifaddrs, developer interface for flavor "lifreq" ni_linuxproc.c getifreq, getifaddrs, developer interface for flavor "linuxproc" ni_malloc.c malloc for systems with broken malloc ni_memcmp.c memcmp for systems without memcmp ni_memcmp.h header for above ni_strlcpy.c strlcpy for systems without strlcpy ni_strlcpy.h header for above ni_util.c our utilities, functions that don't fit in a family pathnames.h saved, proc file paths, may be usefule ppport.h hmmm... don't know why this is here test.pl current access to developercode typemap like it says Net-Interface-1.012/Interface.xs0000644000000000000120000006506011345242433015247 0ustar rootwheel /* ******************************************************************** * * Interface.xs version 1.05 3-8-10 * * * * COPYRIGHT 2008-2010 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "localconf.h" #ifdef __cplusplus } #endif #include "inet_aton.c" #include "ni_XStabs_inc.c" extern const ni_iff_t ni_lx_type2txt[]; const ni_iff_t ni_lx_scope_txt[] = { { RFC2373_GLOBAL, "global-scope" }, { RFC2373_ORGLOCAL, "org-local" }, { RFC2373_SITELOCAL, "site-local" }, { RFC2373_LINKLOCAL, "link-local" }, { RFC2373_NODELOCAL, "loopback" }, { LINUX_COMPATv4, "lx-compat-v4" } }; /* # make a GV from scratch and return a reference - see gv.c newGVgen # delete the GV's name from the stash so it is inaccessible # # originally written with "rv = sv_newmortal()", now caller must mortalize */ #define NI_newGV_ref(rv,gv,stash,tmpstash) \ rv = newSV(0); \ gv = gv_fetchpv(Perl_form(aTHX_ "%s::_ifa::_IF_DEV_%ld",HvNAME((HV *)stash),(long)PL_gensym++),TRUE, SVt_PVGV); \ GvSV(gv) = newSV(0); \ GvHV(gv) = newHV(); \ sv_setsv(rv, sv_bless(newRV_noinc((SV*)gv), stash)); \ tmpstash = GvSTASH(gv); \ (void)hv_delete(tmpstash, GvNAME(gv), GvNAMELEN(gv), G_DISCARD) #define niKEYsz 4 #define NI_REF_CHECK(ref) \ if (!SvROK (ref) || !SvOBJECT (SvRV(ref)) || !SvREADONLY (SvRV(ref))) \ croak ("Can't call method \"%s\" without a valid object reference", GvNAME (CvGV (cv))); /* ******************************************** * * The information for each interface (IF) is * * contained in an HV. The name slot of the * * HV holds the IF name. The args slot points * * to a hash whose key values represent the * * last interrogated state of the IF. * * * * HV { * * indx => IV * * flav => IV, * * name => interface name; * * args => { * * maci => bin string, * * mtui => IV, * * metk => IV, * * flag => NV, * * afk => { * * size => IV, * * addr => [], * * netm => [], * * dsta => [], * * }, * * afk => { * * size => IV, * * addr => [], * * netm => [], * * dsta => [], * * }, * * } * * }; * * Note: for ease of coding, all keys=4 chars * * except for 'afk' which is computed * * ******************************************** */ static u_int32_t afk_len(u_int af, char * key) { sprintf(key,"%d",af); return (u_int32_t)strlen(key); } static int af_common(HV * hface, HV * family, struct ifaddrs * ifap, int offset, int addrsz, int *fd, u_int af, int flavor) { struct nifreq ifr; char afk[16], * addrptr; const char * addr = "addr", * netmask = "netm", * dstaddr = "dsta"; const char * flags = "flag", * size = "size", * mtu = "mtui", * metric = "metk", * ifindex = "indx"; int i; AV * anyaddr; u_int64_t fgs; struct ni_ifconf_flavor * nifp = ni_ifcf_get(flavor); #ifdef HAVE_STRUCT_LIFREQ struct lifreq lifr; #endif /* is status needed or has it been saved already? if not, save flags, mtu, metric */ if (! hv_exists(hface,flags,niKEYsz)) { /* flags */ fgs = ifap->ifa_flags; #ifdef HAVE_STRUCT_LIFREQ if (flavor == NI_LIFREQ) { strlcpy(lifr.lifr_name,ifap->ifa_name,IFNAMSIZ); if ((*fd = ni_clos_reopn_dgrm(*fd,af)) < 0) goto no_xflags; if (ioctl(*fd,nifp->siocgifflags,&lifr) != -1) fgs = lifr.lifr_flags; } no_xflags: #endif hv_store(hface,flags,niKEYsz,newSVnv(fgs),0); if ((*fd = ni_clos_reopn_dgrm(*fd,AF_INET)) < 0) return -1; strlcpy(ifr.ni_ifr_name,ifap->ifa_name,IFNAMSIZ); /* save MTU */ if ((i = ni_get_any(*fd,nifp->siocgifmtu,&ifr)) < 0) i = 0; hv_store(hface,mtu,niKEYsz,newSViv(i),0); /* save METRIC */ if ((i = ni_get_any(*fd,nifp->siocgifmetric,&ifr)) < 0) i = 0; hv_store(hface,metric,niKEYsz,newSViv(i),0); /* save INDEX if defined for this platform */ if (nifp->siocgifindex != 0) { if ((i = ni_get_any(*fd,nifp->siocgifindex,&ifr)) < 0) i = -1; hv_store(hface,ifindex,niKEYsz,newSViv(i),0); } if ((*fd = ni_clos_reopn_dgrm(*fd,af)) < 0) return -1; } /* if the address arrays are populated, get pointer */ if (hv_exists(hface,afk,afk_len(af,afk))) family = (HV*)SvRV(*hv_fetch(hface,afk,afk_len(af,afk),0)); else { family = newHV(); hv_store(hface,afk,afk_len(af,afk),newRV_noinc((SV*)family),0); /* save address size for user */ hv_store(family,size,niKEYsz,newSViv(addrsz),0); /* populate the address arrays */ hv_store(family,addr,niKEYsz, newRV_noinc((SV*)newAV()),0); hv_store(family,netmask,niKEYsz,newRV_noinc((SV*)newAV()),0); hv_store(family,dstaddr,niKEYsz,newRV_noinc((SV*)newAV()),0); } /* addr */ anyaddr = (AV*)SvRV(*hv_fetch(family,addr,niKEYsz,0)); if (ifap->ifa_addr == NULL) av_push(anyaddr,newSV(0)); else { #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 if (af == AF_INET6) /* waste the scopeid if KAME */ (void) ni_get_scopeid((struct sockaddr_in6 *)(ifap->ifa_addr)); #endif addrptr = ((char *)ifap->ifa_addr) + offset; av_push(anyaddr,newSVpvn(addrptr,addrsz)); } /* netmask */ anyaddr = (AV*)SvRV(*hv_fetch(family,netmask,niKEYsz,0)); if (ifap->ifa_netmask == NULL) av_push(anyaddr,newSV(0)); else { addrptr = ((char *)ifap->ifa_netmask) + offset; av_push(anyaddr,newSVpvn(addrptr,addrsz)); } /* dstaddr */ anyaddr = (AV*)SvRV(*hv_fetch(family,dstaddr,niKEYsz,0)); if (ifap->ifa_dstaddr == NULL) av_push(anyaddr,newSV(0)); else { addrptr = ((char *)ifap->ifa_dstaddr) + offset; av_push(anyaddr,newSVpvn(addrptr,addrsz)); } return 0; } static int getheifs(SV ** sp, I32 ax, I32 items, SV * ref, HV * stash, int ix, char * keyname) { int flavor, forcflavor, i, fd = -1, n = 1, ic, need_mac_addr = 1; u_int af; struct ifaddrs * ifap = NULL, * ifapbase = NULL; const char * mac = "maci", * name = "name", * args = "args", * flags = "flag", * flav = "flav", * ifindex = "indx"; char nbuf[IFNAMSIZ], afk[16]; u_char * macp; struct nifreq ifr; struct ni_lnk_names { char niln_name[IFNAMSIZ]; int niln_len; } name_link, * nlbase = NULL, * nl; struct sockaddr_in sin; #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 struct sockaddr_in6 sin6; #endif #ifdef LOCAL_SIZEOF_SOCKADDR_DL struct sockaddr_dl * sadl; #elif defined LOCAL_SIZEOF_SOCKADDR_LL struct sockaddr_ll *sall; #endif STRLEN len; I32 klen; SV * rv; GV * gvface; AV * anyaddr; HV * ifaces, * hface, * family, * wrapr, * owrap; /* if new */ if (keyname != NULL) { /* this is a redo, not IF rqst */ klen = strlen(keyname); owrap = (HV *)SvRV(ref); } else if (ix == 1) { if (items == 1) { /* refresh of existing IF */ if (!SvROK(ref)) goto iferror1; owrap = (HV *)SvRV(ref); if (! hv_exists(owrap,name,niKEYsz)) goto iferror1; rv = *hv_fetch(owrap,name,niKEYsz,0); if (!SvPOK(rv)) goto iferror1; strlcpy(nbuf,SvPV(rv,len),len +1); keyname = nbuf; klen = len; } else if (items == 2) { /* new or update IF w/ hash ref */ if (! SvPOK(ST(1))) goto iferror1; keyname = SvPV(ST(1),len); klen = len; } else { /* new or update IF with hash */ goto iferror1; /* not yet implemented */ } } /* get the data about interfaces from the default getifaddrs */ forcflavor = flavor = ni_getifaddrs(&ifap, 0); if (flavor < 0) goto iferror1; else if (flavor == 0) forcflavor = NI_IFREQ; /* belt and suspenders test for failed fetch of ifaddrs data */ if (ifap == NULL) /* there are no addresses to check */ goto iferror1; ifapbase = ifap; /* * hash ifaces is for temporary aggregation by interface * seems that a plain hv_undef at the end leaks * mortalization stops the leak * decrementing the REFCNT instead causes a segfault, puzzling! */ ifaces = (HV*)sv_2mortal((SV*)newHV()); /* ifaces = newHV(); * SvREFCNT_dec(ifaces); * * storage conventions * * ifaces => temporary interface hash keyed by name * hface => hash for a particular interface * family => family within an hface * anyaddr => an address array within a family */ if ((nl = nlbase = (struct ni_lnk_names *)calloc(1,sizeof(struct ni_lnk_names))) == NULL) goto iferror2; while (ifap != NULL) { len = strlen(ifap->ifa_name); /* this is sub 'new', target only the 'name' */ if (ix && strncmp(ifap->ifa_name,keyname,len)) goto nextname; /* interface is known? */ if (hv_exists(ifaces,ifap->ifa_name,len)) /* fetch reference to interface ref */ hface = (HV*)SvRV(*hv_fetch(ifaces,ifap->ifa_name,len,0)); else { /* skip invalids */ if (ifap->ifa_addr == NULL) goto nextname; /* create an HV to hold this interface */ hface = newHV(); /* and insert ref into unique/tmp storage hash */ hv_store(ifaces,ifap->ifa_name,len,newRV_noinc((SV*)hface),0); /* add name to the list to preserve kernel ordering * can use memcpy here because struct is bzero'd and will have terminating null */ memcpy(nl->niln_name,ifap->ifa_name,len); nl->niln_len = len; n++; if ((nl = (struct ni_lnk_names *)realloc(nlbase,n * sizeof(struct ni_lnk_names))) == NULL) goto iferror2; nlbase = nl; nl = nlbase + n -1; bzero(nl,sizeof(struct ni_lnk_names)); } /* check for improperly truncated entry */ if (ifap->ifa_addr == NULL) goto iferror2; /* * only store 'ifa_flags' for families where we store the address since * we don't know if 'ifa_flags' is consistently populated for link/packet */ af = ((struct sockaddr *)(ifap->ifa_addr))->sa_family; /* AF_INET */ if (af == AF_INET) { if (af_common(hface,family,ifap, /* (u_char *)&((struct sockaddr_in *)ifap->ifa_addr)->sin_addr, */ ((char *)&sin.sin_addr) - (char *)&sin, sizeof(struct in_addr),&fd,af,forcflavor) != 0) { iferror3: free(ifapbase); goto iferror2; } } #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 /* AF_IFNET6 */ else if (af == AF_INET6) { if (af_common(hface,family,ifap, /* (u_char *)&((struct sockaddr_in6 *)ifap->ifa_addr)->sin6_addr, */ ((char *)&sin6.sin6_addr) - (char *)&sin6, sizeof(struct in6_addr),&fd,af,forcflavor) != 0) goto iferror3; } #endif /* SOCKADDR_IN6 */ #ifdef LOCAL_SIZEOF_SOCKADDR_DL else if (af == AF_LINK) { if (ifap->ifa_addr != NULL) { sadl = (struct sockaddr_dl *)ifap->ifa_addr; macp = (unsigned char *)(sadl->sdl_data + sadl->sdl_nlen); if (NI_MAC_NOT_ZERO(macp)) { need_mac_addr = 0; hv_store(hface,mac,niKEYsz,newSVpvn((char *)macp,6),0); } if (sadl->sdl_index != 0 && (! hv_exists(hface,ifindex,niKEYsz))) hv_store(hface,ifindex,niKEYsz,newSViv(sadl->sdl_index),0); } } #elif defined LOCAL_SIZEOF_SOCKADDR_LL else if (af == AF_PACKET) { if (ifap->ifa_addr != NULL) { sall = (struct sockaddr_ll *)ifap->ifa_addr; macp = (unsigned char *)sall->sll_addr; if (NI_MAC_NOT_ZERO(macp)) { need_mac_addr = 0; hv_store(hface,mac,niKEYsz,newSVpvn((char *)macp,6),0); } if (sall->sll_ifindex != 0 && (! hv_exists(hface,ifindex,niKEYsz))) hv_store(hface,ifindex,niKEYsz,newSViv(sall->sll_ifindex),0); } } #endif nextname: ifap = ifap->ifa_next; } close(fd); ni_free_gifa(ifapbase,flavor); nl = nlbase; if (GIMME == G_ARRAY) i = 0; else i = -1; while(nl->niln_name[0] != '\0') { if (hv_exists(ifaces,nl->niln_name,nl->niln_len)) { if (ix < 2) { /* if this is a redo skip wrapr operation */ wrapr = newHV(); hv_store(wrapr,name,niKEYsz,newSVpvn((char *)nl->niln_name,nl->niln_len),0); hv_store(wrapr,flav,niKEYsz,newSViv(flavor),0); } rv = hv_delete(ifaces,nl->niln_name,nl->niln_len,0); if (need_mac_addr) { #ifdef __ni_Linux /* do not add mac to alias's */ if (index(nl->niln_name,':') != NULL) goto no_mac; #endif /* skip this interface if it is the loopback device */ hface = (HV*)SvRV(rv); if (IFF_LOOPBACK & (u_int64_t)SvNV((SV*)(*hv_fetch(hface,flags,niKEYsz,0)))) goto no_mac; if (hv_exists(hface,afk,afk_len(AF_INET,afk))) goto mac_continue; #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 else if(hv_exists(hface,afk,afk_len(AF_INET6,afk))) goto mac_continue; #endif else goto no_mac; mac_continue: strlcpy(ifr.ni_ifr_name,nl->niln_name,IFNAMSIZ); if ((macp = ni_fallbackhwaddr(af,&ifr)) != NULL) hv_store(hface,mac,niKEYsz,newSVpvn((char *)macp,6),0); } no_mac: /* don't want the ref to be mortal, only the wrapper */ SvREFCNT_inc(rv); if (ix > 1) hv_store(owrap,args,niKEYsz,rv,0); else { hv_store(wrapr,args,niKEYsz,rv,0); XPUSHs(sv_2mortal(sv_bless(newRV_noinc((SV*)wrapr),stash))); } if (i < 0) { i = 1; break; } i++; nl++; } /* should never do the else! */ else { iferror2: free(nlbase); hv_undef(ifaces); iferror1: return -1; } } free(nlbase); hv_undef(ifaces); return i; } /* return NULL or pointer to first available address */ static SV * get_first_address(SV * ref, char * key, int sixonly) { HV * hv, * family; AV * av; SV * sv; char afk[16], * args = "args"; hv = (HV *)SvRV(ref); /* wrapper */ if (! hv_exists(hv,args,niKEYsz)) return NULL; sv = *hv_fetch(hv,args,niKEYsz,0); /* hface */ if (!SvROK(sv)) return NULL; hv = (HV *)SvRV(sv); if (! sixonly && hv_exists(hv,afk,afk_len(AF_INET,afk))) family = (HV*)SvRV(*hv_fetch(hv,afk,afk_len(AF_INET,afk),0)); #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 else if (hv_exists(hv,afk,afk_len(AF_INET6,afk))) family = (HV*)SvRV(*hv_fetch(hv,afk,afk_len(AF_INET6,afk),0)); #endif else return NULL; av = (AV*)SvRV(*hv_fetch(family,key,niKEYsz,0)); return *av_fetch(av,0,0); /* first addy */ } MODULE = Net::Interface PACKAGE = Net::Interface PREFIX = NIP_ INCLUDE: miniSocketXS.c void interfaces(ref,...) SV * ref PROTOTYPE: $;$ ALIAS: new = 1 PREINIT: HV * stash = SvROK (ref) ? SvSTASH (SvRV (ref)) : gv_stashsv (ref, 0); int rv; PPCODE: if ((rv = getheifs(sp,ax,items,ref,stash,(int)ix,NULL)) < 0) { if (GIMME == G_ARRAY) XSRETURN_EMPTY; else XSRETURN_UNDEF; } XSRETURN(rv); void dtest(ref) SV * ref PREINIT: char * myname = "my name", * one = "one", * two = "two", * array = "array"; SV * rv, *arv, *mn; GV * gv; AV * av; HV * stash, * tstash; PPCODE: stash = SvROK (ref) ? SvSTASH (SvRV (ref)) : gv_stashsv (ref, 0); NI_newGV_ref(rv,gv,stash,tstash); # mn = newSVpv(myname,0); # GvSV(gv) = mn; # hv_store(GvHV(gv),one,strlen(one),newSViv(1),0); # hv_store(GvHV(gv),two,strlen(two),newSViv(2),0); # av = newAV(); # arv = newRV_noinc((SV *)av); # av = (AV*)SvRV(*hv_store(GvHV(gv),array,strlen(array),arv,0)); # av_push(av,newSViv(55)); XPUSHs(sv_2mortal(rv)); XSRETURN(1); void dtest2(ref) SV * ref PREINIT: SV * sv, * pv; HV * hv; char * name = "Sv Name"; char * n2 = "LOGO"; char * myname = "my name", * one = "one", * two = "two", * array = "array"; PPCODE: hv = newHV(); hv_store(hv,one,strlen(one),newSViv(1),0); hv_store(hv,two,strlen(two),newSViv(2),0); sv = (SV*)newRV_noinc((SV*)hv); XPUSHs(sv_2mortal(sv)); XSRETURN(1); void __developer(ref) SV *ref ALIAS: d_ni_ifreq = NI_IFREQ d_ni_lifreq = NI_LIFREQ d_ni_in6_ifreq = NI_IN6_IFREQ d_ni_linuxproc = NI_LINUXPROC PREINIT: char * process; int er = ni_developer(ix); CODE: if (er == 0) XSRETURN_EMPTY; switch (ix) { case NI_IFREQ : process = "NI_FREQ"; break; case NI_LIFREQ : process = "NI_LIFREQ"; break; case NI_IN6_IFREQ : process = "NI_IN6_IFREQ"; break; case NI_LINUXPROC : process = "NI_LINUXPROC"; break; default : process = "UNDEFINED"; } printf("%s: %s\n",process,strerror(er)); void gifaddrs_base(ref) SV * ref ALIAS: # base = 0 gifa_ifreq = NI_IFREQ gifa_lifreq = NI_LIFREQ gifa_in6_ifreq = NI_IN6_IFREQ gifa_linuxproc = NI_LINUXPROC PREINIT: struct ifaddrs * ifap; int rv; CODE: if ((rv = ni_getifaddrs(&ifap,ix)) == -1) { printf("failed PUNT!\n"); XSRETURN_EMPTY; } ni_getifaddrs_dump(rv,ifap); ni_free_gifa(ifap,rv); void cidr2mask(prefix, size) int prefix int size PREINIT: unsigned char mask[16]; PPCODE: if (!(size == 4 || size == 16)) croak("Bad arg for %s, requested mask size is %d, should be 4 or 16", GvNAME (CvGV (cv)),size); if (prefix < 0 || prefix > (size * 8)) croak ("Bad arg for %s, mask length is %d, should be 0 to <= %d", GvNAME (CvGV (cv)),size * 8); ni_plen2mask(mask,prefix,size); XPUSHs(sv_2mortal(newSVpvn((char *)mask,size))); XSRETURN(1); int mask2cidr(ref,...) SV * ref; PROTOTYPE: $;$ PREINIT: unsigned char * mp; STRLEN len; char * netmask = "netm"; SV * sv; CODE: # called as method with argument if (items == 2) mp = (unsigned char *)SvPV(ST(1),len); # called as a function else if (! SvROK(ref)) mp = (unsigned char *)SvPV(ST(0),len); # called as method else { if ((sv = get_first_address(ref,netmask,0)) == NULL) len = 0; else mp = (unsigned char *)SvPV(sv,len); } if (!(len == 4 || len == 16)) croak("Bad arg length for %s, mask length is %d, should be 4 or 16", GvNAME (CvGV (cv)),len); RETVAL = ni_prefix(mp,len); OUTPUT: RETVAL void NIP_type(ref,...) SV * ref PROTOTYPE: $;$ ALIAS: scope = 1 PREINIT: unsigned char * s6bytes; char * addr = "addr"; UV type; STRLEN len; HV * hv; SV * sv; PPCODE: # called as method with argument if (items == 2) s6bytes = (unsigned char *)SvPV(ST(1),len); # called as a function else if (! SvROK(ref)) s6bytes = (unsigned char *)SvPV(ST(0),len); # called as method else { if ((sv = get_first_address(ref,addr,1)) == NULL) len = 0; else s6bytes = (unsigned char *)SvPV(sv,len); } if (! len == 16) croak("Bad arg length for %s, address length is %d, should be 16", GvNAME (CvGV (cv)),len); type = ni_in6_classify(s6bytes); if (ix == 0) XPUSHs(sv_2mortal(newSVuv(type))); else XPUSHs(sv_2mortal(newSViv(ni_lx_type2scope((int)type)))); XSRETURN(1); void mac_bin2hex(ref,...) SV * ref PROTOTYPE: $;$ PREINIT: unsigned char * macbin; char macbuf[18], * format, * args = "args", * mac = "maci"; STRLEN len; HV * hv; SV * sv; PPCODE: # called as method with argument if (items == 2) macbin = (unsigned char *)SvPV(ST(1),len); # called as a function else if (! SvROK(ref)) macbin = (unsigned char *)SvPV(ST(0),len); # called as method else { hv = (HV *)SvRV(ref); if (! hv_exists(hv,args,niKEYsz)) XSRETURN_UNDEF; sv = *hv_fetch(hv,args,niKEYsz,0); if (!SvROK(sv)) XSRETURN_UNDEF; hv = (HV *)SvRV(sv); if (! hv_exists(hv,mac,niKEYsz)) XSRETURN_UNDEF; sv = *hv_fetch(hv,mac,niKEYsz,0); if (! SvPOK(sv)) XSRETURN_UNDEF; macbin = (unsigned char *)SvPV(sv,len); } if (len != 6) croak("Bad arg length for %s, MAC length is %d, should be 6", GvNAME (CvGV (cv)),len); format = SvPV(get_sv("Net::Interface::mac_format", FALSE),len); sprintf(macbuf,format, macbin[0],macbin[1],macbin[2],macbin[3],macbin[4],macbin[5]); XPUSHs(sv_2mortal(newSVpv(macbuf,0))); XSRETURN(1); void full_inet_ntop(neta) SV * neta PREINIT: unsigned char * naddr; char mask[40], * format; STRLEN len; PPCODE: naddr = (unsigned char *)SvPV(neta,len); if (len != 16) croak("Bad arg length for %s, ipV6 length is %d, should be 16 bytes", GvNAME (CvGV (cv)),len); format = SvPV(get_sv("Net::Interface::full_format", FALSE),len); sprintf(mask,format, naddr[0],naddr[1],naddr[2],naddr[3], naddr[4],naddr[5],naddr[6],naddr[7], naddr[8],naddr[9],naddr[10],naddr[11], naddr[12],naddr[13],naddr[14],naddr[15]); XPUSHs(sv_2mortal(newSVpvn((char *)mask,39))); XSRETURN(1); void _lx_types() ALIAS: IPV6_ADDR_ANY = IPV6_ADDR_ANY IPV6_ADDR_UNICAST = IPV6_ADDR_UNICAST IPV6_ADDR_MULTICAST = IPV6_ADDR_MULTICAST IPV6_ADDR_ANYCAST = IPV6_ADDR_ANYCAST IPV6_ADDR_LOOPBACK = IPV6_ADDR_LOOPBACK IPV6_ADDR_LINKLOCAL = IPV6_ADDR_LINKLOCAL IPV6_ADDR_SITELOCAL = IPV6_ADDR_SITELOCAL IPV6_ADDR_COMPATv4 = IPV6_ADDR_COMPATv4 IPV6_ADDR_SCOPE_MASK = IPV6_ADDR_SCOPE_MASK IPV6_ADDR_MAPPED = IPV6_ADDR_MAPPED IPV6_ADDR_RESERVED = IPV6_ADDR_RESERVED IPV6_ADDR_ULUA = IPV6_ADDR_ULUA IPV6_ADDR_6TO4 = IPV6_ADDR_6TO4 IPV6_ADDR_6BONE = IPV6_ADDR_6BONE IPV6_ADDR_AGU = IPV6_ADDR_AGU IPV6_ADDR_UNSPECIFIED = IPV6_ADDR_UNSPECIFIED IPV6_ADDR_SOLICITED_NODE = IPV6_ADDR_SOLICITED_NODE IPV6_ADDR_ISATAP = IPV6_ADDR_ISATAP IPV6_ADDR_PRODUCTIVE = IPV6_ADDR_PRODUCTIVE IPV6_ADDR_6TO4_MICROSOFT = IPV6_ADDR_6TO4_MICROSOFT IPV6_ADDR_TEREDO = IPV6_ADDR_TEREDO IPV6_ADDR_ORCHID = IPV6_ADDR_ORCHID IPV6_ADDR_NON_ROUTE_DOC = IPV6_ADDR_NON_ROUTE_DOC PREINIT: SV * rv; int n, i; PPCODE: rv = sv_2mortal(newSViv(ix)); n = ni_sizeof_type2txt(); for (i=0; i 0) { d = New(1234,d,2 * size,char); memset(d,'X',2 * size); *(d + (2*size) -1) = 0; RETVAL = strlcpy(d,s,size); sv_setpv(ST(0),d); Safefree(d); } else RETVAL = 0; OUTPUT: RETVAL int _sets(ref,...) SV * ref ALIAS: mtu = 0 metric = 1 flags = 2 index = 3 PREINIT: int cmd, fd, rv, flavor; struct nifreq ifr, * ofifr; struct ni_ifconf_flavor * nifp; HV * hv; SV * sv; char * key, * args = "args", * name = "name", * flav = "flav"; STRLEN len; CODE: if (!SvROK (ref) || !SvOBJECT(SvRV(ref))) croak ("Can't call method \"%s\" without a valid object reference", GvNAME (CvGV (cv))); if (items > 2) { not_found: croak ("Invalid or corrupted arguments passed to \"%s\"", GvNAME (CvGV (cv))); } hv = (HV *)SvRV(ref); if (! hv_exists(hv,name,niKEYsz)) goto not_found; if (! hv_exists(hv,args,niKEYsz)) goto not_found; if (! hv_exists(hv,flav,niKEYsz)) { no_data: XSRETURN_UNDEF; } sv = *hv_fetch(hv,name,niKEYsz,0); if (!SvPOK(sv)) goto no_data; strlcpy(ifr.ni_ifr_name,SvPV(sv,len),len +1); sv = *hv_fetch(hv,flav,niKEYsz,0); if (!SvIOK(sv)) goto no_data; # flavor and offset if present flavor = SvIV(sv); nifp = ni_safe_ifcf_get(flavor); ofifr = (struct nifreq *)((char *)&ifr + nifp->ifr_offset); sv = *hv_fetch(hv,args,niKEYsz,0); if (!SvROK(sv)) goto no_data; switch (ix) { case 0 : cmd = nifp->siocsifmtu; key = "mtui"; break; case 1 : cmd = nifp->siocsifmetric; key = "metk"; break; case 2 : cmd = nifp->siocsifflags; key = "flag"; break; case 3 : cmd = 0; key = "indx"; break; default : goto not_found; } # args hash hv = (HV *)SvRV(sv); if (! hv_exists(hv,key,niKEYsz)) goto no_data; # value sv = *hv_fetch(hv,key,niKEYsz,0); if (ix == 2) { if (! SvNOK(sv)) goto no_data; RETVAL = SvNV(sv); } else { if (! SvIOK(sv)) goto no_data; RETVAL = SvIV(sv); } if (cmd && items > 1) { if (!(SvIOK(ST(1)) || SvNOK(ST(1)))) goto no_data; if (flavor == NI_LIFREQ) ofifr->ni_uint64 = (u_int64_t)SvNV(ST(1)); else ifr.ni_uint = (u_int)((u_int64_t)SvNV(ST(1)) & 0xffffu); if ((fd = ni_clos_reopn_dgrm(-1,AF_INET)) < 0) goto no_data; if ((rv = ni_set_any(fd,cmd,&ifr)) < 0) { close(fd); goto no_data; } close(fd); # items == 2 and ix == 2 for this call if (getheifs(sp,ax,2,ref,NULL,2,ifr.ni_ifr_name) < 0) goto not_found; } sets_done: OUTPUT: RETVAL # ############################################################ # # Certain broken Solaris headers cause build # # errors with the syntax for constructors. # # i.e. # # void __attribute__((constructor)) # # constructor_function () # # { # # code.... # # }; # # # # line 249: syntax error before or at: ( # # line 251: warning: old-style declaration or incorrect type # # cc: acomp failed [filename.c] # # *** Error code 2 # # make: Fatal error: Command failed for target 'filename.o' # # # # The various constructors are declared here and called # # during module load as a work-around to this problem # # ############################################################ # void conreg() CODE: ni_ifreq_ctor(); ni_in6_ifreq_ctor(); ni_lifreq_ctor(); ni_linuxproc_ctor(); void macstuff(dev) SV * dev PREINIT: struct nifreq ifr; char * name; u_char * x; STRLEN len; CODE: name = SvPV(dev,len); strlcpy(ifr.ni_ifr_name,name,IFNAMSIZ); x = ni_fallbackhwaddr(AF_INET,&ifr); if (x == NULL) printf("got NULL\n"); else { NI_PRINT_MAC(x); printf("\n"); } INCLUDE: netsymbolXS.inc Net-Interface-1.012/t/0000755000000000000000000000000011345243332013102 5ustar rootrootNet-Interface-1.012/t/ipv6compress.t0000644000000000000120000000127411140010043016037 0ustar rootwheel#!/usr/bin/perl use Test::More tests => 14; #use diagnostics; BEGIN { use_ok('Net::Interface',qw(ipV6compress :lower)); } my $loaded = 1; END { print "not ok 1\n" unless $loaded; } my @hex = qw( 0:0:0:0:f:0:0:0 ::f:0:0:0 0:0:0:f:0:0:0:0 0:0:0:f:: 0:0:0:f:0:0:0:f ::f:0:0:0:f ab00:ffff:0:f:: ab00:ffff:0:f:: :: :: 120:00:345::789 120:0:345::789 0:A:b:c:d:6:7:8 0:a:b:c:d:6:7:8 9:a:B:c:d:6:7:0 9:a:b:c:d:6:7:0 0:0:0:0:5::8 ::5:0:0:8 1::4:0:0:0:8 1:0:0:4::8 1:000f:a:b:00c:d00:0e00:9 1:f:a:b:c:d00:e00:9 1:0::0:1 1::1 1::127.0.0.1 1::7f00:1 ); for(my $i=0; $i<@hex; $i+=2) { my $got = ipV6compress($hex[$i]); ok ($got eq $hex[$i+1],"$got eq $hex[$i+1]"); } Net-Interface-1.012/t/badd.t0000644000000000000120000000421011140013122014263 0ustar rootwheel# 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 Net::Interface qw( inet_pton inet_ntop ); $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:0:0:0:0:0:0:0 abcd:: ::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 0: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:0 a:b:c:d:1:2:3:0 ); my $x = @addr; # 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"; $x /= 2; for ($x = 0;$x <= $#addr; $x+=2) { my $bstr = inet_pton($addr[$x]); if ($addr[$x +1] =~ /undef/) { print "unexpected return value for $addr[$x]: $_\nnot " if ($_ = inet_pton && (inet_ntop($_) || 'not defined')); } else { my $rv = inet_pton($addr[$x]); unless ($rv) { print "got undefined value for $addr[$x]\nnot "; } else { $rv = inet_ntop($rv) || 'not defined'; print "got: $rv, exp: $addr[$x +1]\nnot " unless $rv eq uc $addr[$x +1]; } } &ok; } Net::Interface::import qw(:lower); for ($x = 0;$x <= $#addr; $x+=2) { my $bstr = inet_pton($addr[$x]); if ($addr[$x +1] =~ /undef/) { print "unexpected return value for $addr[$x]: $_\nnot " if ($_ = inet_pton && (inet_ntop($_) || 'not defined')); } else { my $rv = inet_pton($addr[$x]); unless ($rv) { print "got undefined value for $addr[$x]\nnot "; } else { $rv = inet_ntop($rv) || 'not defined'; print "got: $rv, exp: $addr[$x +1]\nnot " unless $rv eq $addr[$x +1]; } } &ok; } Net-Interface-1.012/t/inet_xtox.t0000644000000000000120000000261111140010700015414 0ustar rootwheel# 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..17\n"; } END {print "not ok 1\n" unless $loaded;} use Net::Interface qw( inet_pton inet_ntop ); $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 = # exp phex qw( :: 0:0:0:0:0:0:0:0 43:: 43:0:0:0:0:0:0:0 ::21 0:0:0:0:0:0:0:21 0:1:2:3:4:5:6:7 0:1:2:3:4:5:6:7 1:2:3:4:5:6:7:0 1:2:3:4:5:6:7:0 1::8 1:0:0:0:0:0:0:8 FF00::FFFF Ff00:0:0:0:0:0:0:FFFF FFFF::FFFF:FFFF FffF:0:0:0:0:0:FFFF:FFFF ); for (my $i=0;$i<@num;$i+=2) { my $bits = inet_pton($num[$i+1]); my $len = length($bits); print "bad len = $len, exp: 32\nnot " unless $len == 16; # 16 bytes x 8 bits &ok; my $ipv6x = inet_ntop($bits); print "got: $ipv6x\nexp: $num[$i]\nnot " unless $ipv6x eq $num[$i]; &ok; } ## test 26 check bad length n2x my $try = '1234'; my $notempty = eval { inet_ntop($try); }; Net-Interface-1.012/t/mask2plen.t0000644000000000000120000001622311140013746015310 0ustar rootwheel# 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.) use Test::More tests => 200; #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw( mask2cidr )); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} # should fail foreach (qw( a33 b5555 c15151515151515 d1717171717171717)) { eval { mask2cidr($_); }; ok($@,"forced croak on bad address length ". length($_)); } my @results = qw( 0000:0000:0000:0000:0000:0000:0000:0000 8000:0000:0000:0000:0000:0000:0000:0000 C000:0000:0000:0000:0000:0000:0000:0000 E000:0000:0000:0000:0000:0000:0000:0000 F000:0000:0000:0000:0000:0000:0000:0000 F800:0000:0000:0000:0000:0000:0000:0000 FC00:0000:0000:0000:0000:0000:0000:0000 FE00:0000:0000:0000:0000:0000:0000:0000 FF00:0000:0000:0000:0000:0000:0000:0000 FF80:0000:0000:0000:0000:0000:0000:0000 FFC0:0000:0000:0000:0000:0000:0000:0000 FFE0:0000:0000:0000:0000:0000:0000:0000 FFF0:0000:0000:0000:0000:0000:0000:0000 FFF8:0000:0000:0000:0000:0000:0000:0000 FFFC:0000:0000:0000:0000:0000:0000:0000 FFFE:0000:0000:0000:0000:0000:0000:0000 FFFF:0000:0000:0000:0000:0000:0000:0000 FFFF:8000:0000:0000:0000:0000:0000:0000 FFFF:C000:0000:0000:0000:0000:0000:0000 FFFF:E000:0000:0000:0000:0000:0000:0000 FFFF:F000:0000:0000:0000:0000:0000:0000 FFFF:F800:0000:0000:0000:0000:0000:0000 FFFF:FC00:0000:0000:0000:0000:0000:0000 FFFF:FE00:0000:0000:0000:0000:0000:0000 FFFF:FF00:0000:0000:0000:0000:0000:0000 FFFF:FF80:0000:0000:0000:0000:0000:0000 FFFF:FFC0:0000:0000:0000:0000:0000:0000 FFFF:FFE0:0000:0000:0000:0000:0000:0000 FFFF:FFF0:0000:0000:0000:0000:0000:0000 FFFF:FFF8:0000:0000:0000:0000:0000:0000 FFFF:FFFC:0000:0000:0000:0000:0000:0000 FFFF:FFFE:0000:0000:0000:0000:0000:0000 FFFF:FFFF:0000:0000:0000:0000:0000:0000 FFFF:FFFF:8000:0000:0000:0000:0000:0000 FFFF:FFFF:C000:0000:0000:0000:0000:0000 FFFF:FFFF:E000:0000:0000:0000:0000:0000 FFFF:FFFF:F000:0000:0000:0000:0000:0000 FFFF:FFFF:F800:0000:0000:0000:0000:0000 FFFF:FFFF:FC00:0000:0000:0000:0000:0000 FFFF:FFFF:FE00:0000:0000:0000:0000:0000 FFFF:FFFF:FF00:0000:0000:0000:0000:0000 FFFF:FFFF:FF80:0000:0000:0000:0000:0000 FFFF:FFFF:FFC0:0000:0000:0000:0000:0000 FFFF:FFFF:FFE0:0000:0000:0000:0000:0000 FFFF:FFFF:FFF0:0000:0000:0000:0000:0000 FFFF:FFFF:FFF8:0000:0000:0000:0000:0000 FFFF:FFFF:FFFC:0000:0000:0000:0000:0000 FFFF:FFFF:FFFE:0000:0000:0000:0000:0000 FFFF:FFFF:FFFF:0000:0000:0000:0000:0000 FFFF:FFFF:FFFF:8000:0000:0000:0000:0000 FFFF:FFFF:FFFF:C000:0000:0000:0000:0000 FFFF:FFFF:FFFF:E000:0000:0000:0000:0000 FFFF:FFFF:FFFF:F000:0000:0000:0000:0000 FFFF:FFFF:FFFF:F800:0000:0000:0000:0000 FFFF:FFFF:FFFF:FC00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FE00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FF00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FF80:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFC0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFE0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFF0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFF8:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFC:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFE:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:8000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:C000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:E000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:F000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:F800:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FC00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FE00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FF00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FF80:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFC0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFE0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFF0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFF8:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFC:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFE:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:8000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:C000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:E000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:F000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:F800:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FC00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FE00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FF00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FF80:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFC0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFE0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFF0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFF8:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFC:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:8000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:C000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:E000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F800:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FC00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FE00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:8000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:C000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:E000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F800 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FC00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FE00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ); foreach (0..$#results) { my @hex = split(/:/,$results[$_]); foreach(0..$#hex) { $hex[$_] = hex($hex[$_] || 0); } ok(mask2cidr(pack("n8",@hex)) == $_); } @results = qw( 00000000 80000000 c0000000 e0000000 f0000000 f8000000 fc000000 fe000000 ff000000 ff800000 ffc00000 ffe00000 fff00000 fff80000 fffc0000 fffe0000 ffff0000 ffff8000 ffffc000 ffffe000 fffff000 fffff800 fffffc00 fffffe00 ffffff00 ffffff80 ffffffc0 ffffffe0 fffffff0 fffffff8 fffffffc fffffffe ffffffff ); foreach (0..$#results) { $results[$_] =~ /(\w{4})(\w{4})/; my @hex = (hex($1) || 0,hex($2) || 0); ok(mask2cidr((pack("n2",@hex))) == $_); } my $bo = _bo Net::Interface; foreach (0..$#results) { $results[$_] =~ /(\w{4})(\w{4})/; my @hex = (hex($1) || 0,hex($2) || 0); ok($bo->mask2cidr((pack("n2",@hex))) == $_); } Net-Interface-1.012/t/simplesets.t0000644000000000000120000000205411145263123015602 0ustar rootwheel# 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.) use Test::More tests => 2; #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw( :iffs )); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} my @all = Net::Interface->interfaces(); my $loopif; eval { foreach (0..$#all) { my $flags = $all[$_]->flags(); next unless defined $flags && $flags & IFF_LOOPBACK() && $flags & IFF_UP(); $loopif = $all[$_]; last; } }; my $why = "loopback interface not found, possible jailed environment"; my $mtu; SKIP: { skip $why, 1, unless $loopif && ($why = "apparently no permission") && eval { $mtu = $loopif->mtu(576); } && eval { $mtu = $loopif->mtu($mtu); } && (! $@) && $mtu == 576; ok($mtu == 576,"can update mtu on $loopif"); }; Net-Interface-1.012/t/faceinfo.t0000644000000000000120000000627411147130074015174 0ustar rootwheel# 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.) use Test::More tests => 1; use strict; #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw( :afs :iffs :iftype inet_ntoa inet_ntop mac_bin2hex )); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} #use Devel::Peek; #use Data::Dumper; my @bmsk = qw( IPV6_ADDR_ANY IPV6_ADDR_UNICAST IPV6_ADDR_MULTICAST IPV6_ADDR_ANYCAST IPV6_ADDR_LOOPBACK IPV6_ADDR_LINKLOCAL IPV6_ADDR_SITELOCAL IPV6_ADDR_COMPATv4 IPV6_ADDR_MAPPED IPV6_ADDR_RESERVED IPV6_ADDR_ULUA IPV6_ADDR_6TO4 IPV6_ADDR_6BONE IPV6_ADDR_AGU IPV6_ADDR_UNSPECIFIED IPV6_ADDR_SOLICITED_NODE IPV6_ADDR_ISATAP IPV6_ADDR_PRODUCTIVE IPV6_ADDR_6TO4_MICROSOFT IPV6_ADDR_TEREDO IPV6_ADDR_ORCHID IPV6_ADDR_NON_ROUTE_DOC ); sub typetxt { my $type = shift; local *bmsk; my $rv = ''; foreach (@bmsk) { *bmsk = $_; my $mask = 0 + &bmsk; next unless $type & $mask; $rv .= &bmsk .' '; } return $rv; } my @ifaces = interfaces Net::Interface(); my $num = @ifaces; diag("\nSummary: $num interfaces\n\t@ifaces\n"); sub getflags { my($flags) = @_; no strict; my $txt = ($flags & IFF_UP) ? '{$key}) { diag(sprintf("\t%s %d, addr size %d %s\n",$fam,$i->{$key}->{number},$i->{$key}->{size},$$mac)); $$mac = ''; my @address = $hvp->address($key); my @netmask = $hvp->netmask($key); my @broadcast = $hvp->broadcast($key); if ($key == AF_INET()) { foreach(0..$#address) { diag(sprintf("\t%s %s %s\n", addr42txt('addr',scalar $hvp->address($key,$_)), addr42txt('netmask',scalar $hvp->netmask($key,$_)), addr42txt('broadcast',scalar $hvp->broadcast($key,$_)) )); } } else { foreach(0..$#address) { diag(sprintf("\t%s/%d <%s>\n", inet_ntop($address[$_]), $hvp->mask2cidr($netmask[$_]), typetxt($hvp->type($address[$_])) ."\b" )); } } } } foreach my $hvp (@ifaces) { my $i = $hvp->info(); unless (defined $i->{flags} && $i->{flags} & IFF_UP()) { diag(sprintf("%s\t\n",$i->{name})); next; } ## Dump($i); my $flags = getflags($i->{flags}); my $mac = (defined $i->{mac}) ? "\tMAC: ". mac_bin2hex($i->{mac}) : ''; my $mtu = $i->{mtu} ? 'MTU:'. $i->{mtu} : ''; my $metric = (defined $i->{metric}) ? 'Metric:'. $i->{metric} : ''; my $af_inet6 = eval {AF_INET6} || 0; diag(sprintf("%s id %d\tflags:0x%02x%s %s %s\n",$i->{name},$i->{index},$i->{flags},$flags,$mtu,$metric)); dumpaddrs($hvp,$i,AF_INET,\$mac); dumpaddrs($hvp,$i,$af_inet6,\$mac); # print Dumper($i),"\n"; } Net-Interface-1.012/t/strlcpy.t0000644000000000000120000000260111137725072015117 0ustar rootwheel# 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.) use Test::More tests => 21; #use diagnostics; # test 1 BEGIN { use_ok('Net::Interface'); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} *strlcpy = \&Net::Interface::strlcpy; my $str = 'abcdef'; my $out; my $size; my @exp = ( '[undef]' => 0, # -1 '[undef]' => 0, # 0 '' => 1, # 1 a => 2, # 2 ab => 3, # 3 abc => 4, # 4 abcd => 5, # 5 abcde => 6, # 6 abcdef => 7, # 7 abcdef => 7, # 8 ); my $i = 0; foreach my $v (-1..8) { my($len,$show,$exp); undef $out; $size = strlcpy($out,$str,$v); if ($exp[$i] eq '') { $exps = $show = '[\0]'; $len = length($out) + 1; } elsif ($exp[$i] eq '[undef]') { $exps = $show = '[undef]'; $len = 0; } else { if (defined $out) { $len = length($out) + 1; } else { $out = '[undef]'; $len = 0; } $show = $out .'\0'; $exps = $exp[$i]; } $out = '[undef]' unless defined $out; # print "index=$v\t$out\t=> $size,\n"; ok($out eq $exp[$i++],"strlcpy $v, got: $len"); ok($len == $exp[$i++],"copied $len bytes, exp: $show"); # print "\n"; } Net-Interface-1.012/t/typescope.t0000644000000000000120000001565611140676023015443 0ustar rootwheel# 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.) use Test::More tests => 247; #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface', qw( :iftype :scope type scope inet_pton full_inet_ntop inet_ntop )) } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} my @ipv6 = ( '0000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00080000, 'global-scope', 'unspecified ', '0000:0000:0000:0000:0000:0000:0000:0001', 0x01, 0x00000011, 'loopback', 'unicast loopback ', '0000:0000:0000:0000:0000:0000:0000:0100', 0x10, 0x00000081, 'lx-compat-v4', 'unicast compat-v4 ', '0000:0000:0000:0000:0000:0000:0001:0001', 0x10, 0x00000081, 'lx-compat-v4', 'unicast compat-v4 ', '0000:0000:0000:0000:0000:0000:0100:0001', 0x10, 0x00000081, 'lx-compat-v4', 'unicast compat-v4 ', '0000:0000:0000:0000:0000:0001:0000:0000', 0x0e, 0x00002000, 'global-scope', 'reserved ', '3FFE:831F:0000:0000:0000:0000:0000:0000', 0x0e, 0x00060001, 'global-scope', 'unicast 6bone global-unicast ', 'FC00:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00004001, 'global-scope', 'unicast uniq-lcl-unicast ', 'FE00:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00002000, 'global-scope', 'reserved ', '2000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00440001, 'global-scope', 'unicast global-unicast productive ', '3000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00440001, 'global-scope', 'unicast global-unicast productive ', '3FFE:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00060001, 'global-scope', 'unicast 6bone global-unicast ', '2001:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x01040001, 'global-scope', 'unicast global-unicast teredo ', '2001:0001:0000:0000:0000:0000:0000:0000', 0x0e, 0x00440001, 'global-scope', 'unicast global-unicast productive ', '2001:0000:0001:0000:0000:0000:0000:0000', 0x0e, 0x01040001, 'global-scope', 'unicast global-unicast teredo ', '2001:0DB8:0000:0000:0000:0000:0000:0000', 0x0e, 0x08040001, 'global-scope', 'unicast global-unicast non-routeable-doc ', '2002:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00850001, 'global-scope', 'unicast 6to4 global-unicast 6to4-ms ', '2002:ABCD:EF01:0000:0000:0000:ABCD:EF01', 0x0e, 0x00850001, 'global-scope', 'unicast 6to4 global-unicast 6to4-ms ', '20FF:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00440001, 'global-scope', 'unicast global-unicast productive ', '0000:0000:0000:0000:0000:0001:FF00:0000', 0x0e, 0x00002000, 'global-scope', 'reserved ', '0000:0000:0000:0000:0000:0001:FFF0:0000', 0x0e, 0x00002000, 'global-scope', 'reserved ', 'FF02:0000:0000:0000:0000:0001:FF00:0000', 0x02, 0x00100022, 'link-local', 'multicast link-local solicited-node ', 'FF02:0000:0000:0000:0000:0001:FFF0:0000', 0x02, 0x00100022, 'link-local', 'multicast link-local solicited-node ', 'FF02:0001:0000:0000:0000:0000:0000:0000', 0x02, 0x00000022, 'link-local', 'multicast link-local ', 'FF02:0000:0001:0000:0000:0000:0000:0000', 0x02, 0x00000022, 'link-local', 'multicast link-local ', 'FF02:0000:0000:0001:0000:0000:0000:0000', 0x02, 0x00000022, 'link-local', 'multicast link-local ', 'FF01:0000:0000:0000:0000:0000:0000:0000', 0x01, 0x00000012, 'loopback', 'multicast loopback ', 'FF05:0000:0000:0000:0000:0000:0000:0000', 0x05, 0x00000042, 'site-local', 'multicast site-local ', 'FE80:0000:0000:0000:0000:FEFE:0000:0000', 0x02, 0x00000021, 'link-local', 'unicast link-local ', 'E000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00002000, 'global-scope', 'reserved ', 'C000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00000001, 'global-scope', 'unicast ', 'A000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00000001, 'global-scope', 'unicast ', '8000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00000001, 'global-scope', 'unicast ', '6000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00000001, 'global-scope', 'unicast ', '4000:0000:0000:0000:0000:0000:0000:0000', 0x0e, 0x00000001, 'global-scope', 'unicast ', 'FEF0:0000:0000:0000:0000:0000:0000:0000', 0x05, 0x00000041, 'site-local', 'unicast site-local ', 'FEE0:0000:0000:0000:0000:0000:0000:0000', 0x05, 0x00000041, 'site-local', 'unicast site-local ', 'FEC0:0000:0000:0000:0000:0000:0000:0000', 0x05, 0x00000041, 'site-local', 'unicast site-local ', 'FE80:0000:0000:0000:0000:0000:0000:0000', 0x02, 0x00000021, 'link-local', 'unicast link-local ', 'FEC0:0000:0000:0000:0000:0000:0000:0000', 0x05, 0x00000041, 'site-local', 'unicast site-local ', '0000:0000:0000:0000:0000:FFFF:0000:0000', 0x0e, 0x00001000, 'global-scope', 'mapped ', ); my @bmsk = qw( IPV6_ADDR_ANY IPV6_ADDR_UNICAST IPV6_ADDR_MULTICAST IPV6_ADDR_ANYCAST IPV6_ADDR_LOOPBACK IPV6_ADDR_LINKLOCAL IPV6_ADDR_SITELOCAL IPV6_ADDR_COMPATv4 IPV6_ADDR_MAPPED IPV6_ADDR_RESERVED IPV6_ADDR_ULUA IPV6_ADDR_6TO4 IPV6_ADDR_6BONE IPV6_ADDR_AGU IPV6_ADDR_UNSPECIFIED IPV6_ADDR_SOLICITED_NODE IPV6_ADDR_ISATAP IPV6_ADDR_PRODUCTIVE IPV6_ADDR_6TO4_MICROSOFT IPV6_ADDR_TEREDO IPV6_ADDR_ORCHID IPV6_ADDR_NON_ROUTE_DOC ); my @seql = qw( RFC2373_GLOBAL RFC2373_ORGLOCAL RFC2373_SITELOCAL RFC2373_LINKLOCAL RFC2373_NODELOCAL LINUX_COMPATv4 ); sub scopetxt { my $scope = shift; local *seql; my $rv = ''; foreach (@seql) { *seql = $_; my $rfcscp = 0 + &seql; next unless $scope eq $rfcscp; return &seql; } die "missing scope $scope"; } sub typetxt { my $type = shift; local *bmsk; my $rv = ''; foreach (@bmsk) { *bmsk = $_; my $mask = 0 + &bmsk; next unless $type & $mask; $rv .= &bmsk .' '; } return $rv; } sub develop_test { for (my $i=0;$i<@ipv6;$i+=5) { my $naddr = inet_pton($ipv6[$i]); # print "$addr\n"; print "'",full_inet_ntop($naddr),"',"; my $type = type($naddr); my $scope = scope($naddr); printf("\t0x%02x,\t0x%08x,\t'",$scope,$type); $scope = scopetxt($scope); print $scope,"',\t'"; $type = typetxt($type); print $type," "; print "',\n"; } } #develop_test(); my $bo = Net::Interface->_bo(); foreach(my $i=0;$i<@ipv6;$i+=5) { my $naddr = inet_pton($ipv6[$i]); my $addr = inet_ntop($naddr); my $type = type($naddr); ok($type == $ipv6[$i+2],sprintf("%s\tfunction type got: 0x%0x exp: 0x%0x",$addr,$type,$ipv6[$i+2])); $type = $bo->type($naddr); ok($type == $ipv6[$i+2],sprintf("%s\tmethod type got: 0x%0x exp: 0x%0x",$addr,$type,$ipv6[$i+2])); $type = typetxt($type); ok($type eq $ipv6[$i+4],sprintf("%s\ttext type got: %s exp: %s",$addr,$type,$ipv6[$i+4])); my $scope = scope($naddr); ok($scope == $ipv6[$i+1],sprintf("%s\tfunction scope got: 0x%08x exp: 0x%08x",$addr,$scope,$ipv6[$i+1])); $scope = $bo->scope($naddr); ok($scope == $ipv6[$i+1],sprintf("%s\tmethod scope got: 0x%08x exp: 0x%08x",$addr,$scope,$ipv6[$i+1])); $scope = scopetxt($scope); ok($scope eq $ipv6[$i+3],sprintf("%s\ttext scope got: %s exp: %s",$addr,$scope,$ipv6[$i+3])); } Net-Interface-1.012/t/symbols.t0000644000000000000120000000453511144451416015113 0ustar rootwheel# 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.) use Test::More qw(no_plan); #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw(:afs :pfs :ifs :scope :iftype _NI_AF_TEST)); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} require_ok( 'Net::Interface::NetSymbols'); foreach(qw(PF_UNSPEC PF_INET AF_UNSPEC AF_INET _NI_AF_TEST IFHWADDRLEN IF_NAMESIZE IFNAMSIZ)) { my $x = eval { &$_; }; my $s = (defined $x) ? 0 + $x : undef; if ($_ =~ /^_NI/) { # must fail unless ($@ && $@ =~ /architecture/) { fail($_ . " = $s exists???, got: $s"); } else { $@ =~ /(.+architecture)/; pass('expected that '. $1); } } else { # must pass if ($@) { fail($@); } else { pass($_ ." = $s found, $x"); } } } my $rv = Net::Interface::NetSymbols->NI_ENDVAL(); ok($rv, "netsymbols max value +1 = $rv"); my %unique = %{Net::Interface::NetSymbols->NI_UNIQUE()}; foreach(sort {$a <=> $b} keys %unique) { my $symbol = $unique{$_}; my $x = eval { &$symbol; }; if ($@) { fail($@); } else { my $s = 0 + $x; if ($x == $_) { pass("found $symbol\t=> $s $x"); } else { fail("$symbol = $s, should be $_"); } } } foreach(qw( IFF_UP AF_INET RFC2373_GLOBAL RFC2373_ORGLOCAL RFC2373_SITELOCAL RFC2373_LINKLOCAL RFC2373_NODELOCAL IPV6_ADDR_ANY IPV6_ADDR_UNICAST IPV6_ADDR_MULTICAST IPV6_ADDR_ANYCAST IPV6_ADDR_LOOPBACK IPV6_ADDR_LINKLOCAL IPV6_ADDR_SITELOCAL IPV6_ADDR_COMPATv4 IPV6_ADDR_SCOPE_MASK IPV6_ADDR_MAPPED IPV6_ADDR_RESERVED IPV6_ADDR_ULUA IPV6_ADDR_6TO4 IPV6_ADDR_6BONE IPV6_ADDR_AGU IPV6_ADDR_UNSPECIFIED IPV6_ADDR_SOLICITED_NODE IPV6_ADDR_ISATAP IPV6_ADDR_PRODUCTIVE IPV6_ADDR_6TO4_MICROSOFT IPV6_ADDR_TEREDO IPV6_ADDR_ORCHID IPV6_ADDR_NON_ROUTE_DOC )) { my $x = eval { &$_; }; if ($@) { fail($@); } else { pass($_ . sprintf("\t=> 0x%0x = %s",$x,$x)); } } Net-Interface-1.012/t/mac_bin2hex.t0000644000000000000120000000173711137725761015614 0ustar rootwheel# 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 Net::Interface qw(mac_bin2hex); $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 $binmac = pack("H*",'a1b2c3d4e5f6'); my $exp = 'A1:B2:C3:D4:E5:F6'; print "got: $_\nexp: $exp\nnot " unless ($_ = mac_bin2hex($binmac)) eq $exp; print "ok 2\n"; my $bo = _bo Net::Interface(); print "got: $_\nexp: $exp\nnot " unless ($_ = $bo->mac_bin2hex($binmac)) eq $exp; print "ok 3\n"; Net-Interface-1.012/t/plen2print.t0000644000000000000120000001552411137722405015521 0ustar rootwheel# 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.) use Test::More tests => 167; #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw( :afs :pfs :ifs _NI_AF_TEST mask2cidr cidr2mask full_inet_ntop )); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} # should fail foreach (3,5,15,17) { eval { cidr2mask(5,$_); }; ok($@,"forced croak on bad address length ". $_); } my @results = qw( 0000:0000:0000:0000:0000:0000:0000:0000 8000:0000:0000:0000:0000:0000:0000:0000 C000:0000:0000:0000:0000:0000:0000:0000 E000:0000:0000:0000:0000:0000:0000:0000 F000:0000:0000:0000:0000:0000:0000:0000 F800:0000:0000:0000:0000:0000:0000:0000 FC00:0000:0000:0000:0000:0000:0000:0000 FE00:0000:0000:0000:0000:0000:0000:0000 FF00:0000:0000:0000:0000:0000:0000:0000 FF80:0000:0000:0000:0000:0000:0000:0000 FFC0:0000:0000:0000:0000:0000:0000:0000 FFE0:0000:0000:0000:0000:0000:0000:0000 FFF0:0000:0000:0000:0000:0000:0000:0000 FFF8:0000:0000:0000:0000:0000:0000:0000 FFFC:0000:0000:0000:0000:0000:0000:0000 FFFE:0000:0000:0000:0000:0000:0000:0000 FFFF:0000:0000:0000:0000:0000:0000:0000 FFFF:8000:0000:0000:0000:0000:0000:0000 FFFF:C000:0000:0000:0000:0000:0000:0000 FFFF:E000:0000:0000:0000:0000:0000:0000 FFFF:F000:0000:0000:0000:0000:0000:0000 FFFF:F800:0000:0000:0000:0000:0000:0000 FFFF:FC00:0000:0000:0000:0000:0000:0000 FFFF:FE00:0000:0000:0000:0000:0000:0000 FFFF:FF00:0000:0000:0000:0000:0000:0000 FFFF:FF80:0000:0000:0000:0000:0000:0000 FFFF:FFC0:0000:0000:0000:0000:0000:0000 FFFF:FFE0:0000:0000:0000:0000:0000:0000 FFFF:FFF0:0000:0000:0000:0000:0000:0000 FFFF:FFF8:0000:0000:0000:0000:0000:0000 FFFF:FFFC:0000:0000:0000:0000:0000:0000 FFFF:FFFE:0000:0000:0000:0000:0000:0000 FFFF:FFFF:0000:0000:0000:0000:0000:0000 FFFF:FFFF:8000:0000:0000:0000:0000:0000 FFFF:FFFF:C000:0000:0000:0000:0000:0000 FFFF:FFFF:E000:0000:0000:0000:0000:0000 FFFF:FFFF:F000:0000:0000:0000:0000:0000 FFFF:FFFF:F800:0000:0000:0000:0000:0000 FFFF:FFFF:FC00:0000:0000:0000:0000:0000 FFFF:FFFF:FE00:0000:0000:0000:0000:0000 FFFF:FFFF:FF00:0000:0000:0000:0000:0000 FFFF:FFFF:FF80:0000:0000:0000:0000:0000 FFFF:FFFF:FFC0:0000:0000:0000:0000:0000 FFFF:FFFF:FFE0:0000:0000:0000:0000:0000 FFFF:FFFF:FFF0:0000:0000:0000:0000:0000 FFFF:FFFF:FFF8:0000:0000:0000:0000:0000 FFFF:FFFF:FFFC:0000:0000:0000:0000:0000 FFFF:FFFF:FFFE:0000:0000:0000:0000:0000 FFFF:FFFF:FFFF:0000:0000:0000:0000:0000 FFFF:FFFF:FFFF:8000:0000:0000:0000:0000 FFFF:FFFF:FFFF:C000:0000:0000:0000:0000 FFFF:FFFF:FFFF:E000:0000:0000:0000:0000 FFFF:FFFF:FFFF:F000:0000:0000:0000:0000 FFFF:FFFF:FFFF:F800:0000:0000:0000:0000 FFFF:FFFF:FFFF:FC00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FE00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FF00:0000:0000:0000:0000 FFFF:FFFF:FFFF:FF80:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFC0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFE0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFF0:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFF8:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFC:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFE:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:0000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:8000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:C000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:E000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:F000:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:F800:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FC00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FE00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FF00:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FF80:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFC0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFE0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFF0:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFF8:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFC:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFE:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:0000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:8000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:C000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:E000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:F000:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:F800:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FC00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FE00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FF00:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FF80:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFC0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFE0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFF0:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFF8:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFC:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:8000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:C000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:E000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F000:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F800:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FC00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FE00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:0000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:8000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:C000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:E000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F000 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:F800 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FC00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FE00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF00 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FF80 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFC0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFE0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF0 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFF8 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFC FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFE FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF ); foreach (0..$#results) { ok(full_inet_ntop(cidr2mask($_,16)) eq $results[$_]); } @results = qw( 00000000 80000000 c0000000 e0000000 f0000000 f8000000 fc000000 fe000000 ff000000 ff800000 ffc00000 ffe00000 fff00000 fff80000 fffc0000 fffe0000 ffff0000 ffff8000 ffffc000 ffffe000 fffff000 fffff800 fffffc00 fffffe00 ffffff00 ffffff80 ffffffc0 ffffffe0 fffffff0 fffffff8 fffffffc fffffffe ffffffff ); foreach (0..$#results) { ok(unpack('H8',cidr2mask($_,4)) eq $results[$_]); } Net-Interface-1.012/t/ipv4_inet.t0000644000000000000120000000234511140676723015327 0ustar rootwheel# 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 Net::Interface 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; } Net-Interface-1.012/ni_strlcpy.c0000644000000000000120000000556611145133734015333 0ustar rootwheel /* ******************************************************************** * * strlcpy.c version 0.01 1-12-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * SYNOPSIS size_t strlcpy(char *dst, const char *src, size_t size); DESCRIPTION The strlcpy() function copys strings and is designed to be safer, more consistent, and less error prone replacement for strncpy(3). Unlike that function, strlcpy() takes the full size of the buffer (not just the length) and guarantees to NUL-terminate the result (as long as size is larger than 0. Note that you should include a byte for the NUL in size. Also note that strlcpy() only operates on true `C'' strings. This means that for strlcpy() src must be NUL-terminated. The strlcpy() function copies up to size - 1 characters from the NUL-terminated string src to dst, NUL-terminating the result. RETURN VALUES The strlcpy() returns the total length of the string it tried to create, that means the length of src. While this may seem somewhat confusing it was done to make truncation detection simple. * */ #include "localconf.h" #ifndef HAVE_STRLCPY size_t strlcpy (char *d, const char *s, size_t size) { size_t n = 0; if ((int)size < 1) return 0; while (n < size) { if ((*(d + n) = *(s + n)) == 0) { n++; break; } else n++; } if (n < size) { *(d+n) = 0; } else { *(d + n -1) = 0; } return n; } #endif Net-Interface-1.012/defaults.h0000644000000000000120000001455111151344741014752 0ustar rootwheel /* ******************************************************************** * * defaults.h version 0.01 1-23-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef _NI_DEFAULTS_H #define _NI_DEFAULTS_H #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_STDIO_H #include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_NETINET_IP_H #include #endif #ifdef HAVE_PCAP #include #endif #ifdef HAVE_ASM_TYPES_H #include #endif #ifdef HAVE_FEATURES_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #ifdef HAVE_NETECONET_EC_H #include #endif #ifdef HAVE_LINUX_ATALK_H #include #endif #ifdef HAVE_NETINET_IF_FDDI_H #include #endif #ifdef HAVE_LINUX_IF_FDDI_H #include #endif #ifdef HAVE_LINUX_IF_TR_H #include #endif #ifdef HAVE_NET_IF_ARP_H #include #endif #ifdef HAVE_LINUX_IF_ETHER_H #include #endif #ifdef HAVE_ENDIAN_H #include #endif #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_ALLOCA_H #include #endif #ifdef HAVE_SYS_SOCKIO_H #include #endif #ifdef HAVE_SYS_SYSCTL_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_MODULE_H #include #endif #ifdef HAVE_SYS_LINKER_H #include #endif #ifdef HAVE_SYS_MAC_H #include #endif #ifdef HAVE_NETAX25_AX25_H #include #endif #ifdef HAVE_LINUX_AX25_H #include #endif #ifdef HAVE_LINUX_TYPES_H #include #endif #ifdef HAVE_LINUX_IF_STRIP_H #include #endif #ifdef HAVE_LINUX_X25_H #include #endif #ifdef HAVE_LINUX_IF_ARP_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_LIBC_INTERNAL_H #include #endif #ifdef HAVE_SIGNAL_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETATALK_AT_H #include #endif #ifdef HAVE_NET_PFVAR_H #include #endif #ifdef HAVE_NET_IF_PFSYNC_H #include #endif #ifdef HAVE_NETPACKET_PACKET_H #include #endif #ifdef HAVE_STDBOOL_H #include #endif #ifdef HAVE_TIME_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NET_IF_VAR_H #include #endif #ifdef HAVE_NETINET_IN_VAR_H #include #endif #ifdef HAVE_NETIPX_IPX_H #include #endif #ifdef HAVE_NETIPX_IPX_IF_H #include #endif #ifdef HAVE_NET_IF_DL_H #include #endif #ifdef HAVE_NET_IF_TYPES_H #include #endif #ifdef HAVE_NET_ROUTE_H #include #endif #ifdef HAVE_NETINET_ETHER_H #include #endif #ifdef HAVE_NETINET_IF_ETHER_H #include #endif #ifdef HAVE_LINUX_IF_SLIP_H #include #endif #ifdef HAVE_CTYPE_H #include #endif #ifdef HAVE_NETINET_IP_CARP_H #include #endif #ifdef HAVE_NET_IF_MEDIA_H #include #endif #ifdef HAVE_NET80211_IEEE80211_H #include #endif #ifdef HAVE_NET80211_IEEE80211_CRYPTO_H #include #endif #ifdef HAVE_NET80211_IEEE80211_IOCTL_H #include #endif #ifdef HAVE_NET_IF_LAGG_H #include #endif #ifdef HAVE_NET_IF_VLAN_VAR_H #include #endif #ifdef HAVE_NET_ETHERNET_H #include #endif #ifdef HAVE_IFADDRS_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_NETINET6_ND6_H #include #endif #ifdef HAVE_STDARG_H #include #endif #ifdef HAVE_NET80211_IEEE80211_FREEBSD_H #include #endif #ifdef HAVE_LINUX_ROSE_H #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifndef HAVE_MALLOC_IN_STDLIB # ifdef HAVE_MALLOC_H # include # endif #endif #ifdef HAVE_ARPA_INET_H #include #endif /* stuff to get the hardware address */ #ifdef HAVE_SYS_DLPI_H # include # if defined HAVE_STROPTS_H # include # endif #endif #ifdef HAVE_NET_NIT_IF_H #include #endif #ifdef HAVE_NETIO_H #include #endif #endif /* _NI_DEFAULTS_H */ Net-Interface-1.012/ni_strlcpy.h0000644000000000000120000000321211145133734015322 0ustar rootwheel /* ******************************************************************** * * strlcpy.h version 0.02 1-12-08 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef HAVE_STRLCPY size_t strlcpy(char *dst, const char *src, size_t size); #endif Net-Interface-1.012/MANIFEST.SKIP0000644000000000000000000000055411151111256014533 0ustar rootrootblib docs work config.log config.status config.h localperl.h Interface.c includes.txt Makefile$ Makefile\.old$ patch* pathnames.h build_stuff/generate_SIOCS.pl build_stuff/sioc_s.txt configure.scan DEADJOE lib/Net/Interface/NetSymbols.pm netsymbolC.inc netsymbolXS.inc ni_XStabs_inc.c ni_IFF_inc.c ni_addertype.c N*\.\d+\.tar\.gz$ ~$ tmp \.o$ \.bs$ \.sav$ \.yml$ Net-Interface-1.012/ni_memcmp.c0000644000000000000120000000461611145133734015104 0ustar rootwheel /* ******************************************************************** * * memcmp.c version 0.01 1-12-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * SYNOPSIS int memcmp(const void *s1, const void *s2, size_t n); DESCRIPTION The memcmp() function compares the first n bytes of the memory areas s1 and s2. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2. RETURN VALUE The memcmp() function returns an integer less than, equal to, or greater than zero if the first n bytes of s1 is found, respectively, to be less than, to match, or be greater than the first n bytes of s2. * */ #include "localconf.h" #ifndef HAVE_MEMCMP int memcmp (const void *s1, const void *s2, size_t n) { register unsigned char * a = (unsigned char *)s1, * b = (unsigned char *)s2; int rv; while (n != 0) { if ((rv = *a - *b) != 0) return rv; a++; b++; n--; } return 0; } #endif Net-Interface-1.012/ni_getifaddrs.c0000644000000000000120000002675411147125036015747 0ustar rootwheel /* ******************************************************************** * * ni_getifaddrs.c version 0.02 1-12-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * SYNOPSIS int ni_getifaddrs(struct ifaddrs **ifap); void ni_freeifaddrs(struct ifaddrs *ifp); DESCRIPTION The getifaddrs() function stores a reference to a linked list of the network interfaces on the local machine in the memory referenced by ifap. The list consists of ifaddrs structures, as defined in the include file . The ifaddrs structure contains at least the following entries: struct ifaddrs *ifa_next; Pointer to next struct char *ifa_name; Interface name u_int ifa_flags; Interface flags struct sockaddr *ifa_addr; Interface address struct sockaddr *ifa_netmask; Interface netmask struct sockaddr *ifa_dstaddr; P2P interface destination (broadcast) void *ifa_data; Address specific data The ifa_next field contains a pointer to the next structure on the list. This field is NULL in last structure on the list. The ifa_name field contains the interface name. The ifa_flags field contains the interface flags, as set by the ifconfig utility. The ifa_addr field references either the address of the interface or the link level address of the interface, if one exists, otherwise it is NULL. (The sa_family field of the ifa_addr field should be consulted to determine the format of the ifa_addr address.) The ifa_netmask field references the netmask associated with ifa_addr, if one is set, otherwise it is NULL. The ifa_broadaddr field, which should only be referenced for non-P2P interfaces, references the broadcast address associated with ifa_addr, if one exists, otherwise it is NULL. The ifa_dstaddr field references the destination address on a P2P interface, if one exists, otherwise it is NULL. The ifa_data field references address family specific data. For AF_LINK addresses it contains a pointer to the struct if_data (as defined in include file ) which contains various interface attributes and statistics. For all other address families, it contains a pointer to the struct ifa_data (as defined in include file ) which contains per-address interface statistics. The data returned by getifaddrs() is dynamically allocated and should be freed using freeifaddrs() when no longer needed. RETURN VALUES The getifaddrs() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. IMPLEMENTATION NOTES * * */ #include "localconf.h" /* we fill it, we have to clear it */ void ni_freeifaddrs(struct ifaddrs *ifap) { struct ifaddrs * me; if (ifap == NULL) return; /* * bsd & linux do not iterate through the link list they just do a * free(pointer). Apparently all the elements are allocated from the * same chunk of memory. solaris does the same as we do more or less */ while (ifap != NULL) { free(ifap->ifa_name); free(ifap->ifa_addr); free(ifap->ifa_netmask); free(ifap->ifa_dstaddr); free(ifap->ifa_data); me = ifap; ifap = ifap->ifa_next; free(me); } } void ni_free_gifa(struct ifaddrs * ifap, int flavor) { if (flavor) ni_freeifaddrs(ifap); else freeifaddrs(ifap); } int ni_getifaddrs(struct ifaddrs **ifap, int flavor) { struct ni_ifconf_flavor * nifp; int rv; if (flavor != 0) { /* if testing, go to specific routine */ if ((nifp = ni_ifcf_get(flavor)) == NULL) return -1; else { return nifp->gifaddrs(ifap,nifp); } } #ifdef HAVE_IFADDRS_H return getifaddrs(ifap); } #else /* this decision tree should be updated when new AF_XXX families are * are added and/or new flavors of 'ifreq' are encountered or updated * * the decision tree is a combination of compile time #ifdef's and * run time if's that depend on the response of the underlying OS * * examples: older Solaris systems have lifreq but it does not * appear to be implemented. the decision tree attempts * to use it and uses the soft fail to try other * methods to satisfy the request. Linux has a struct * in6_ifreq that is nothing like the BSD version and * does not respond to SIOCxxx requests. */ # ifdef __ni_Linux if ((nifp = ni_ifcf_get(NI_LINUXPROC)) == NULL) return -1; /* this should never happen */ # elif defined HAVE_STRUCT_LIFREQ /* several OS's have this, not sure how they all work */ if ((nifp = ni_ifcf_get(NI_LIFREQ)) == NULL) goto fallback; # elif defined HAVE_STRUCT_IN6_IFREQ /* several variants of this flavor */ if ((nifp = ni_ifcf_get(NI_IN6_IFREQ)) == NULL) goto fallback; # endif if ((rv = nifp->gifaddrs(ifap,nifp)) != -1) return rv; fallback: /* supports ipV4 only */ if ((nifp = ni_ifcf_get(NI_IFREQ)) == NULL) return -1; /* this should never happen */ return nifp->gifaddrs(ifap,nifp); } #endif /* ! have getifaddrs */ /* byte pointer, byte count */ static void xx_printbytes(u_char * cp,int cnt) { int i = 0; while (i < cnt) { printf("%02X ",cp[i]); i++; } printf("\n"); } void ni_getifaddrs_dump(int flavor, struct ifaddrs * ifap) { u_int af, sz, i, n, mtu, metric, fd, prefix; u_int64_t flags; u_int32_t xscope; struct sockaddr_in sin; #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 struct sockaddr_in6 * sin6; #endif #ifdef LOCAL_SIZEOF_SOCKADDR_DL struct sockaddr_dl * sadl; #elif defined LOCAL_SIZEOF_SOCKADDR_LL struct sockaddr_ll *sall; #endif #ifdef HAVE_STRUCT_LIFREQ struct lifreq lifr; #endif char hostaddr[40]; u_char * macp; struct ifreq ifr; struct ni_ifconf_flavor * nifp = ni_ifcf_get(flavor); struct if_data * ifi; #include "ni_IFF_inc.c" #include "ni_SMI-NUMBERS.c" while (1) { flags = (u_int64_t)ifap->ifa_flags; #ifdef HAVE_STRUCT_LIFREQ strlcpy(lifr.lifr_name,ifap->ifa_name,IFNAMSIZ); if ((fd = socket(AF_INET,SOCK_DGRAM,0)) < 0) goto no_xflags; if (ioctl(fd,nifp->siocgifflags,&lifr) != -1) flags = (u_int64_t)lifr.lifr_flags; close(fd); no_xflags: #endif af = ifap->ifa_addr->sa_family; printf("%s\taf %d ",ifap->ifa_name,af); if (af == AF_INET) { printf("flags=%0llx<",flags); if (flags & IFF_UP) printf("UP "); else printf("DOWN "); n = sizeof(ni_iff_tab) / sizeof(ni_iff_t); for (i=0;i "); if ((fd = socket(AF_INET,SOCK_DGRAM,0)) >= 0) { strlcpy(ifr.ifr_name,ifap->ifa_name,IFNAMSIZ); if ((mtu = ni_get_any(fd,nifp->siocgifmtu,&ifr)) < 0) mtu = 0; strlcpy(ifr.ifr_name,ifap->ifa_name,IFNAMSIZ); if ((metric = ni_get_any(fd,nifp->siocgifmetric,&ifr)) < 0) metric = 0; else if (metric == 0) metric = 1; if (mtu) printf("mtu %d ",mtu); if (metric) printf("metric %d ",metric); strlcpy(ifr.ifr_name,ifap->ifa_name,IFNAMSIZ); close(fd); if ((macp = ni_fallbackhwaddr(af,&ifr)) != NULL) { printf("\n\t"); NI_PRINT_MAC(macp); } } printf("\n"); printf("\taddr: %s ",inet_ntoa(((struct sockaddr_in *)ifap->ifa_addr)->sin_addr)); if (ifap->ifa_netmask != NULL) printf("mask %s ",inet_ntoa(((struct sockaddr_in *)ifap->ifa_netmask)->sin_addr)); if (ifap->ifa_dstaddr != NULL) { if (flags & IFF_POINTOPOINT) printf("dst "); else if (flags & IFF_BROADCAST) printf("brd "); else printf("ukn "); printf("%s ",inet_ntoa(((struct sockaddr_in *)ifap->ifa_dstaddr)->sin_addr)); } printf("\n"); } #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 else if (af == AF_INET6) { /* throw away scope to correct the extra bits in the address for KAME */ (void) ni_get_scopeid((struct sockaddr_in6 *)ifap->ifa_addr); /* calculate scope */ xscope = ni_in6_classify((u_char *)&((struct sockaddr_in6 *)ifap->ifa_addr)->sin6_addr); printf("type=%04x<",xscope); ni_linux_scope2txt(xscope); if (xscope == 0) printf(" "); printf("\b>\n"); inet_ntop(AF_INET6,&((struct sockaddr_in6 *)ifap->ifa_addr)->sin6_addr,hostaddr,LOCAL_SIZEOF_SOCKADDR_IN6); printf("\taddr : %s",hostaddr); if (ifap->ifa_netmask != NULL) { prefix = ni_prefix(&((struct sockaddr_in6 *)ifap->ifa_netmask)->sin6_addr,sizeof(struct in6_addr)); printf("/%d",prefix); } printf("\n"); if (ifap->ifa_dstaddr != NULL) { inet_ntop(AF_INET6,&((struct sockaddr_in6 *)ifap->ifa_dstaddr)->sin6_addr,hostaddr,LOCAL_SIZEOF_SOCKADDR_IN6); printf("\tdest : %s\n",hostaddr); } } #endif #ifdef LOCAL_SIZEOF_SOCKADDR_DL else if (af == AF_LINK) { printf("\n"); if (ifap->ifa_addr != NULL) { sadl = (struct sockaddr_dl *)ifap->ifa_addr; macp = (unsigned char *)(sadl->sdl_data + sadl->sdl_nlen); if (NI_MAC_NOT_ZERO(macp)) { printf("\t"); NI_PRINT_MAC(macp); printf("\n"); } } # ifdef KILL_ALL_CODE_save_for_postarity if (ifap->ifa_netmask != NULL) { printf("\tlmask : "); xx_printbytes((u_char *)ifap->ifa_netmask,64); } if (ifap->ifa_dstaddr != NULL) { printf("\tldest : "); xx_printbytes((u_char *)ifap->ifa_dstaddr,64); } # endif } #elif defined LOCAL_SIZEOF_SOCKADDR_LL else if (af == AF_PACKET) { printf("\n"); if (ifap->ifa_addr != NULL) { sall = (struct sockaddr_ll *)ifap->ifa_addr; macp = (unsigned char *)sall->sll_addr; if (NI_MAC_NOT_ZERO(macp)) { printf("\t"); NI_PRINT_MAC(macp); printf("\n"); } } # ifdef KILL_ALL_CODE_save_for_postarity if (ifap->ifa_addr != NULL) { printf("\tpaddr : "); xx_printbytes((u_char *)ifap->ifa_addr,64); } # endif } #endif if ((ifap = ifap->ifa_next) == NULL) break; } } Net-Interface-1.012/test.pl.developer0000644000000000000120000000462411304057145016271 0ustar rootwheel# 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.) use Test::More qw(no_plan); #use diagnostics; # test 1 BEGIN { use_ok( 'Net::Interface',qw( :afs :pfs :ifs _NI_AF_TEST mask2cidr cidr2mask full_inet_ntop net_symbols )); } my $loaded = 1; END {print "not ok 1\n" unless $loaded;} =pod my $hvp = dtest Net::Interface(); foreach (keys %{*{$hvp}}) { print "$_\t=> ${*{$hvp}}{$_}\n"; } print 'the GV ',${*{$hvp}},"\n"; print 'the Ref ',ref $hvp,"\n"; print "arref ",ref ${*{$hvp}}{array},"\n"; # can be expressed as ${*{$hvp}}{array}->[0] or as below print "ARVAL ",*{$hvp}->{array}->[0],"\n"; use Devel::Peek; Dump($hvp); print "\n\n"; Dump(${*{$hvp}}{array}); =cut =pod use Devel::Peek; use Data::Dumper; my @ifaces = interfaces Net::Interface(); foreach my $hvp (@ifaces) { Dump($hvp); print Dumper($hvp),"\n"; } =cut =pod my $hvp = Net::Interface->interfaces(); my $hvp = Net::Interface->dtest2(); use Devel::Peek; use Data::Dumper; print "HVP\n"; Dump($hvp); # print "\nthe PV ptr\n"; # print Dump(\${*{$hvp}}); # print "\nthe PV itself\n"; # print Dump(${*{$hvp}}); # print "\nthe HASHref\n"; # print Dump(\%{*{$hvp}}); # print "\n"; =cut =pod for(0..1000000) { print $_,"\n" unless $_ % 1000; my $hvp= interfaces Net::Interface(); # my $hvp = dtest Net::Interface(); } =cut =pod use Devel::Peek; use Data::Dumper; my $hvp = new Net::Interface('eth0'); Dump($hvp); print "\n\n"; print Dumper($hvp),"\n"; =cut =pod my @all = Net::Interface->interfaces(); print $all[0]->name,"\n"; my @allnames = "@all"; print @allnames,"\n"; =cut =pod use Data::Dumper; my $sym = net_symbols(); print Dumper($sym); =cut #print "\nifr\n"; d_ni_ifreq Net::Interface(); #print "\nlifr\n"; d_ni_lifreq Net::Interface(); #print "\nglifr\n"; gifa_lifreq Net::Interface(); #print "\nin6\n"; d_ni_in6_ifreq Net::Interface(); #print "\ngin6\n"; gifa_in6_ifreq Net::Interface(); #print "\nproc\n"; d_ni_linuxproc Net::Interface(); #print "gproc\n"; gifa_linuxproc Net::Interface(); #print "\nbase\n"; gifaddrs_base Net::Interface(); # put interface name in the parens Net::Interface::macstuff(); Net-Interface-1.012/ppport.h0000644000000000000120000001716311145133734014472 0ustar rootwheel #ifndef _P_P_PORTABILITY_H_ #define _P_P_PORTABILITY_H_ /* Perl/Pollution/Portability Version 1.0007 */ /* Copyright (C) 1999, Kenneth Albanowski. This code may be used and distributed under the same license as any version of Perl. */ /* For the latest version of this code, please retreive the Devel::PPPort module from CPAN, contact the author at , or check with the Perl maintainers. */ /* If you needed to customize this file for your project, please mention your changes, and visible alter the version number. */ /* In order for a Perl extension module to be as portable as possible across differing versions of Perl itself, certain steps need to be taken. Including this header is the first major one, then using dTHR is all the appropriate places and using a PL_ prefix to refer to global Perl variables is the second. */ /* If you use one of a few functions that were not present in earlier versions of Perl, please add a define before the inclusion of ppport.h for a static include, or use the GLOBAL request in a single module to produce a global definition that can be referenced from the other modules. Function: Static define: Extern define: newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL */ /* To verify whether ppport.h is needed for your module, and whether any special defines should be used, ppport.h can be run through Perl to check your source code. Simply say: perl -x ppport.h *.c *.h *.xs foo/*.c [etc] The result will be a list of patches suggesting changes that should at least be acceptable, if not necessarily the most efficient solution, or a fix for all possible problems. It won't catch where dTHR is needed, and doesn't attempt to account for global macro or function definitions, nested includes, typemaps, etc. In order to test for the need of dTHR, please try your module under a recent version of Perl that has threading compiled-in. */ /* #!/usr/bin/perl @ARGV = ("*.xs") if !@ARGV; %badmacros = %funcs = %macros = (); $replace = 0; foreach () { $funcs{$1} = 1 if /Provide:\s+(\S+)/; $macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/; $replace = $1 if /Replace:\s+(\d+)/; $badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/; $badmacros{$1}=$2 if /Replace (\S+) with (\S+)/; } foreach $filename (map(glob($_),@ARGV)) { unless (open(IN, "<$filename")) { warn "Unable to read from $file: $!\n"; next; } print "Scanning $filename...\n"; $c = ""; while () { $c .= $_; } close(IN); $need_include = 0; %add_func = (); $changes = 0; $has_include = ($c =~ /#.*include.*ppport/m); foreach $func (keys %funcs) { if ($c =~ /#.*define.*\bNEED_$func(_GLOBAL)?\b/m) { if ($c !~ /\b$func\b/m) { print "If $func isn't needed, you don't need to request it.\n" if $changes += ($c =~ s/^.*#.*define.*\bNEED_$func\b.*\n//m); } else { print "Uses $func\n"; $need_include = 1; } } else { if ($c =~ /\b$func\b/m) { $add_func{$func} =1 ; print "Uses $func\n"; $need_include = 1; } } } if (not $need_include) { foreach $macro (keys %macros) { if ($c =~ /\b$macro\b/m) { print "Uses $macro\n"; $need_include = 1; } } } foreach $badmacro (keys %badmacros) { if ($c =~ /\b$badmacro\b/m) { $changes += ($c =~ s/\b$badmacro\b/$badmacros{$badmacro}/gm); print "Uses $badmacros{$badmacro} (instead of $badmacro)\n"; $need_include = 1; } } if (scalar(keys %add_func) or $need_include != $has_include) { if (!$has_include) { $inc = join('',map("#define NEED_$_\n", sort keys %add_func)). "#include \"ppport.h\"\n"; $c = "$inc$c" unless $c =~ s/#.*include.*XSUB.*\n/$&$inc/m; } elsif (keys %add_func) { $inc = join('',map("#define NEED_$_\n", sort keys %add_func)); $c = "$inc$c" unless $c =~ s/^.*#.*include.*ppport.*$/$inc$&/m; } if (!$need_include) { print "Doesn't seem to need ppport.h.\n"; $c =~ s/^.*#.*include.*ppport.*\n//m; } $changes++; } if ($changes) { open(OUT,">/tmp/ppport.h.$$"); print OUT $c; close(OUT); open(DIFF, "diff -u $filename /tmp/ppport.h.$$|"); while () { s!/tmp/ppport\.h\.$$!$filename.patched!; print STDOUT; } close(DIFF); unlink("/tmp/ppport.h.$$"); } else { print "Looks OK\n"; } } __DATA__ */ #ifndef PERL_REVISION # ifndef __PATCHLEVEL_H_INCLUDED__ # include "patchlevel.h" # endif # ifndef PERL_REVISION # define PERL_REVISION (5) /* Replace: 1 */ # define PERL_VERSION PATCHLEVEL # define PERL_SUBVERSION SUBVERSION /* Replace PERL_PATCHLEVEL with PERL_VERSION */ /* Replace: 0 */ # endif #endif #define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION) #ifndef ERRSV # define ERRSV perl_get_sv("@",FALSE) #endif #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)) /* Replace: 1 */ # define PL_sv_undef sv_undef # define PL_sv_yes sv_yes # define PL_sv_no sv_no # define PL_na na # define PL_stdingv stdingv # define PL_hints hints # define PL_curcop curcop # define PL_curstash curstash # define PL_copline copline # define PL_Sv Sv /* Replace: 0 */ #endif #ifndef dTHR # ifdef WIN32 # define dTHR extern int Perl___notused # else # define dTHR extern int errno # endif #endif #ifndef boolSV # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) #endif #ifndef gv_stashpvn # define gv_stashpvn(str,len,flags) gv_stashpv(str,flags) #endif #ifndef newSVpvn # define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0)) #endif #ifndef newRV_inc /* Replace: 1 */ # define newRV_inc(sv) newRV(sv) /* Replace: 0 */ #endif #ifndef newRV_noinc # ifdef __GNUC__ # define newRV_noinc(sv) \ ({ \ SV *nsv = (SV*)newRV(sv); \ SvREFCNT_dec(sv); \ nsv; \ }) # else # if defined(CRIPPLED_CC) || defined(USE_THREADS) static SV * newRV_noinc (SV * sv) { SV *nsv = (SV*)newRV(sv); SvREFCNT_dec(sv); return nsv; } # else # define newRV_noinc(sv) \ ((PL_Sv=(SV*)newRV(sv), SvREFCNT_dec(sv), (SV*)PL_Sv) # endif # endif #endif /* Provide: newCONSTSUB */ /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */ #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63)) #if defined(NEED_newCONSTSUB) static #else extern void newCONSTSUB _((HV * stash, char * name, SV *sv)); #endif #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL) void newCONSTSUB(stash,name,sv) HV *stash; char *name; SV *sv; { U32 oldhints = PL_hints; HV *old_cop_stash = PL_curcop->cop_stash; HV *old_curstash = PL_curstash; line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = PL_copline; PL_hints &= ~HINT_BLOCK_SCOPE; if (stash) PL_curstash = PL_curcop->cop_stash = stash; newSUB( #if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22)) /* before 5.003_22 */ start_subparse(), #else # if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22) /* 5.003_22 */ start_subparse(0), # else /* 5.003_23 onwards */ start_subparse(FALSE, 0), # endif #endif newSVOP(OP_CONST, 0, newSVpv(name,0)), newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) ); PL_hints = oldhints; PL_curcop->cop_stash = old_cop_stash; PL_curstash = old_curstash; PL_curcop->cop_line = oldline; } #endif #endif /* newCONSTSUB */ #endif /* _P_P_PORTABILITY_H_ */ Net-Interface-1.012/ni_memcmp.h0000644000000000000120000000320311145133734015100 0ustar rootwheel /* ******************************************************************** * * memcmp.h version 0.01 1-12-08 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef HAVE_MEMCMP int memcmp(const void *s1, const void *s2, size_t n); #endif Net-Interface-1.012/README0000644000000000000120000000314311150134220013631 0ustar rootwheel README for Net::Interface version 1.xx Net::Interface is a module that allows access to the host network interfaces in a manner similar to ifconfig(8). Version 1.00 is a complete re-write and includes support for IPV6 as well as the traditional IPV4. Creating and deleting interfaces is not yet supported although the documentation says otherwise. Give it some time. Net::Interface 1.0x works on more platforms and supports all the operations of the previous version with the addition of ipV6 support as well as numerous new methods and functions. Hackers welcome, see Net::Interface::Developer. There are revisions to the API, see the section titled: WARNING - API CHANGES In most instances this will not make a difference since previous versions of Net::Interface had no support for multiple addresses on the same interface and no support for a variety of platforms where the difference would be noticed. NOT YET SUPPORTED: $if->delete $if->new(%iface_spec) (create or update) $if->hwaddr($new_mac) (change MAC addr) If something except the three items above does not work on your platform, please let me know. I have limited availability OS's with which to develop and a development account on a foreign host with a different OS would be very useful. UN-TESTED CODE Code to retrieve the MAC address using: #ifdef HAVE_NIT_IF_H (sun OS, not solaris) or #ifdef HAVE_NETIO_H (win32, not yet supported) or "style 1" DLPI (...ooold solaris) is implemented but untested. If you have a platform to test this, your assistance would be appreciated. Enjoy: Michael Robinton Net-Interface-1.012/META.yml0000644000000000000000000000064011345243332014110 0ustar rootroot--- #YAML:1.0 name: Net-Interface version: 1.012 abstract: ~ license: ~ author: ~ generated_by: ExtUtils::MakeMaker version 6.42 distribution_type: module requires: Socket: 0 Test::More: 0.62 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.3.html version: 1.3 Net-Interface-1.012/inet_aton.c0000644000000000000120000000375411145133734015122 0ustar rootwheel/* ******************************************************************** * * inet_aton.c * * * * COPYRIGHT 2006-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef HAVE_INET_ATON int my_inet_aton(const char *cp, struct in_addr *inp) { # ifdef HAVE_INET_PTON return inet_pton(AF_INET,cp,inp); # else # ifdef HAVE_INET_ADDR inp->s_addr = inet_addr(cp); if (inp->s_addr == -1) { if (strncmp("255.255.255.255",cp,15)) return 0; else return 1; } return 1; # else # error inet_aton, inet_pton, inet_addr not defined on this platform # endif # endif } #define inet_aton my_inet_aton #endif Net-Interface-1.012/ni_in6_ifreq.c0000644000000000000120000002775111154563305015516 0ustar rootwheel /* ******************************************************************** * * ni_in6_ifreq.c version 0.06 3-7-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * DESCRIPTION Accessor functions for 'ifconf' and 'ifreq' * */ #include "localconf.h" #if !defined (__ni_Linux) && defined (HAVE_STRUCT_IN6_IFREQ) static void * _ni_getifreqs(int fd, void * vifc) { int n,size; struct ifconf * ifc = vifc; void * ifr; bzero(ifc,sizeof(struct ifconf)); # ifdef SIOCGIFCOUNT if (ioctl(fd, SIOCGIFCOUNT, ifc) != -1) { size = ifc->ifc_len * sizeof(struct ifreq); ifr = malloc(size); if (ifr == NULL) { errno = ENOMEM; return NULL; } ifc->ifc_req = ifr; ifc->ifc_len = size; /* Solaris returns EINVAL for small buffer */ if (ioctl (fd, SIOCGIFCONF, ifc) < 0) { free (ifr); return NULL; } } else # endif { n = 2; /* New (0xbad, ifr, n, PAGE_SIZE); */ ifr = ifc->ifc_req; while (1) { ifr = realloc(ifr, n * PAGE_SIZE ); if (ifr == NULL) { free(ifc->ifc_req); errno = ENOMEM; return NULL; } ifc->ifc_req = ifr; size = n * PAGE_SIZE; ifc->ifc_len = size; if (ioctl( fd, SIOCGIFCONF, ifc ) < 0) { free (ifr); return NULL; } if (ifc->ifc_len < size - PAGE_SIZE) /* (n-1) * PAGE_SIZE */ break; n *= 2; } } return ifr; } /* returns flags6 or -1 */ static int ni_getflags6(struct nifreq * ifr, int fd) { # ifndef SIOCGLIFADDR struct in6_ifreq ifr6; memcpy(&ifr6,ifr,IFNAMSIZ + LOCAL_SIZEOF_SOCKADDR_IN6); /* copy name & family */ /* ifr6.ifr_ifru.ifru_addr; */ if (ioctl(fd,SIOCGIFAFLAG_IN6,&ifr6) < 0) { printf("gf6er fd %d, e %d, %s\n",fd,errno,strerror(errno)); return -1; } else return ifr6.ifr_ifru.ifru_flags6; # else struct sockaddr_in6 * sin6; struct if_laddrreq iflr; bzero(&iflr,sizeof(struct if_laddrreq)); strlcpy(iflr.iflr_name,ifr->ni_ifr_name,IFNAMSIZ); iflr.prefixlen = 1; iflr.flags = IFLR_PREFIX; sin6 = (struct sockaddr_in6 *)&iflr.addr; sin6->sin6_family = AF_INET6; sin6->sin6_len = LOCAL_SIZEOF_SOCKADDR_IN6; sin6->sin6_addr.s6_addr[0] = 0xFEu; /* hardcode per UNIX WIDE, don't want alias */ sin6->sin6_addr.s6_addr[1] = 0x80u; if ((ioctl(fd,SIOCGLIFADDR,&iflr)) < 0) { /* EADDRNOTAVAIL - unsupported */ /* printf("glifa %d, e %d, %s\n",fd,errno,strerror(errno)); */ return -1; } else return iflr.flags; # endif /* ndef SIOCGLIFADDR */ } int ni_flav_in6_ifreq_developer(void * ifcee) { /* ifcee unused */ int i, n, fd, inc, af, prefix, addr6good, lifetgood; u_int64_t flags; struct ifconf ifc; struct nifreq *ifr, *lifr; struct sockaddr_dl * sadl; struct sockaddr_in6 copy6; unsigned char * macp; char namebuf[NI_MAXHOST]; unsigned int scopeid; struct in6_addrlifetime lifetime; time_t t = time(NULL); struct ni_ifconf_flavor * nifp = ni_ifcf_get(NI_IN6_IFREQ); #include "ni_IFF_inc.c" if ((fd = socket(AF_INET,SOCK_DGRAM,0)) < 0) return errno; if (_ni_getifreqs(fd,&ifc) == NULL) { close(fd); return errno; } ifr = (struct nifreq *)ifc.ifc_req; lifr = (struct nifreq *)&(ifc.ifc_buf[ifc.ifc_len]); while (ifr < lifr) { lifetgood = prefix = addr6good = 0; macp = NULL; /* BSD pretty much assumes that SA_LEN is defined, if not fudge it */ inc = ni_SIZEOF_ADDR_IFREQ((struct ifreq *)ifr,(&ifr->ni_saddr),sizeof(struct ifreq)); af = ifr->ni_saddr.sa_family; printf("%s\t",ifr->ni_ifr_name); if (af == AF_INET) { fd = ni_clos_reopn_dgrm(fd,af); if (ioctl(fd, SIOCGIFFLAGS,ifr) < 0) printf("Faf_inet SIOCGIFFLAGS "); else { flags = ifr->ni_ushort; printf("flags=%0llx<",flags); if (flags & IFF_UP) printf("UP "); else printf("DOWN "); n = sizeof(ni_iff_tab) / sizeof(ni_iff_t); for (i=0;i "); } if (ioctl(fd,SIOCGIFMETRIC,ifr) < 0) printf("Faf_inet SIOCGIFMETRIC "); else printf("metric %d ",ifr->ni_int); if (ioctl(fd,SIOCGIFMTU,ifr) < 0) printf("Faf_inet SIOCGIFMTU "); else printf("mtu %d",ifr->ni_uint); printf("\n\t"); if (ioctl(fd,SIOCGIFADDR,ifr) <0) printf("Faf_inet SIOCGIFADDR "); else { #ifdef HAVE_GETNAMEINFO if (getnameinfo(&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN,namebuf,NI_MAXHOST,NULL,0,NI_NUMERICHOST) != 0) #endif strcpy(namebuf,inet_ntoa(ifr->ni_sin.sin_addr)); printf("address %s\t",namebuf); } if (ioctl(fd,SIOCGIFNETMASK,ifr) < 0) printf("Faf_inet SIOCGIFNETMASK "); else printf("mask 0x%lx\t",(unsigned long)ntohl(ifr->ni_sin.sin_addr.s_addr)); if (ioctl(fd,SIOCGIFBRDADDR,ifr) < 0) printf("Faf_inet SIOCGIFBRADDR "); else printf("broadcast %s\t",inet_ntoa(ifr->ni_sin.sin_addr)); } else if (af == AF_INET6) { memcpy(©6,&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN6); #define NI_RESTORE_COPYS memcpy(&ifr->ni_saddr,©6,LOCAL_SIZEOF_SOCKADDR_IN6) scopeid = ni_get_scopeid(&ifr->ni_sin6); #ifdef HAVE_GETNAMEINFO if (getnameinfo(&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN6,namebuf,NI_MAXHOST,NULL,0,NI_NUMERICHOST) != 0) #endif strcpy(namebuf,inet_ntop(AF_INET6,&ifr->ni_sin6.sin6_addr,namebuf,NI_MAXHOST)); addr6good = 1; fd = ni_clos_reopn_dgrm(fd,af); if(fd < 0) printf("bad socket\n"); if (ioctl(fd,SIOCGIFNETMASK_IN6,ifr) < 0) printf("Fafinet6 Netmask %s\n",strerror(errno)); else prefix = ni_prefix(&ifr->ni_sin6.sin6_addr,sizeof(struct in6_addr)); NI_RESTORE_COPYS; if (&nifp->refreshifr == NULL) { printf("REFRESH NOT AVAILABLE\n"); errno = ENOSYS; return -1; } if (nifp->refreshifr(fd,&ifc,(void **)&ifr,(void **)&lifr,nifp) < 0) { printf("REFRESH failed\n"); return -1; } bzero(&lifetime,sizeof(struct in6_addrlifetime)); if (ioctl(fd,SIOCGIFALIFETIME_IN6,ifr) < 0) printf("Fafinet6 LIFETIME %s\n",strerror(errno)); else memcpy(&lifetime,&ifr->ni_lifetime,sizeof(struct in6_addrlifetime)); NI_RESTORE_COPYS; if (nifp->refreshifr(fd,&ifc,(void **)&ifr,(void **)&lifr,nifp) < 0) { printf("REFRESH failed\n"); return -1; } /* if ((flags = ni_getflags6(ifr,fd)) < 0) { */ if (ioctl(fd,SIOCGIFAFLAG_IN6,ifr) < 0) { printf("flerr=<"); flags = 0; } else printf("flags6=%0x<",flags); /* if (flags & IFF_UP) printf("UP "); else printf("DOWN "); */ n = sizeof(ni_iff_tabIN6) / sizeof(ni_iff_t); for (i=0;i "); if (scopeid) { scopeid &= 0xfu; printf("scopeid 0x%x ",scopeid); if (scopeid == RFC2373_NODELOCAL) printf("IfaceLocal "); else if (scopeid == RFC2373_LINKLOCAL) printf("LinkLocal "); else if (scopeid == RFC2373_SITELOCAL) printf("SiteLocal "); else if (scopeid == RFC2373_GLOBAL) printf("Global "); else if (scopeid == RFC2373_ORGLOCAL) printf("OrgLocal "); } if (ioctl(fd,SIOCGIFMETRIC,ifr) < 0) printf("Faf_inet6 SIOCGIFMETRIC "); else printf("metric %d ",ifr->ni_int); if (ioctl(fd,SIOCGIFMTU,ifr) < 0) printf("Fafinet6 SIOCIFMTU "); else printf("mtu %d",ifr->ni_int); if (addr6good && prefix) printf("\n\taddress %s/%d ",namebuf,prefix); if (lifetgood) { if (lifetime.ia6t_preferred || lifetime.ia6t_expire) { printf("plt "); if (lifetime.ia6t_preferred) { if (lifetime.ia6t_preferred < t) printf("0 "); else printf("%lu ",(lifetime.ia6t_preferred - t)); } else printf("inft "); printf("vlt "); if (lifetime.ia6t_expire) { if (lifetime.ia6t_expire < t) printf("0 "); else printf("%lu ",(lifetime.ia6t_expire - t)); } else printf("inft "); } } } else if (af == AF_LINK) { sadl = (struct sockaddr_dl *)&(ifr->ni_saddr); if (NI_MAC_NOT_ZERO((unsigned char *)(sadl->sdl_data + sadl->sdl_nlen))) macp = (unsigned char *)(sadl->sdl_data + sadl->sdl_nlen); } printf("\n\taf %d, sz %d ",af,inc); if (macp != NULL) NI_PRINT_MAC(macp); printf("\n"); ifr = (struct nifreq *)(((char *)ifr) + inc); } close(fd); free(ifc.ifc_req); return 0; } static struct ni_ifconf_flavor ni_ifconf_flav_ni_ifreq = { .ni_type = NI_IN6_IFREQ, #ifdef SIOCGIFINDEX .siocgifindex = SIOCGIFINDEX, #else .siocgifindex = 0, #endif .siocsifaddr = SIOCSIFADDR, .siocgifaddr = SIOCGIFADDR, # ifdef SIOCDIFADDR .siocdifaddr = SIOCDIFADDR, # else .siocdifaddr = 0, # endif # ifdef SIOCAIFADDR .siocaifaddr = SIOCAIFADDR, # else .siocaifaddr = 0, # endif .siocsifdstaddr = SIOCSIFDSTADDR, .siocgifdstaddr = SIOCGIFDSTADDR, .siocsifflags = SIOCSIFFLAGS, .siocgifflags = SIOCGIFFLAGS, .siocsifmtu = SIOCSIFMTU, .siocgifmtu = SIOCGIFMTU, .siocsifbrdaddr = SIOCSIFBRDADDR, .siocgifbrdaddr = SIOCGIFBRDADDR, .siocsifnetmask = SIOCGIFNETMASK, .siocgifnetmask = SIOCGIFNETMASK, .siocsifmetric = SIOCSIFMETRIC, .siocgifmetric = SIOCGIFMETRIC, .ifr_offset = 0, .gifaddrs = nifreq_gifaddrs, .fifaddrs = ni_freeifaddrs, .refreshifr = ni_refresh_ifreq, .getifreqs = _ni_getifreqs, .developer = ni_flav_in6_ifreq_developer, }; void ni_in6_ifreq_ctor() { ni_ifcf_register(&ni_ifconf_flav_ni_ifreq); } #else void ni_in6_ifreq_ctor() { return; } #endif /* have in6_ifreq && ! __ni_Linux */ Net-Interface-1.012/configure0000755000000000000120000160041111154566020014675 0ustar rootwheel#! /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 &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 #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #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 build build_cpu build_vendor build_os host host_cpu host_vendor host_os 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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _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 if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory 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 # AX_SIZEOF_SOCKFUNC(lowercase_funcname, UPPERCASE_FUNCNAME) # --------------------------------------------------------- # checks if the function is present in the netinet/in.h file # and sets SIZEOF_SOCKFUNC if found # AX_CHECK_INCLUDE(include/file.name, INCLUDE_FILE_NAME) # --------------------------------------------------------- # checks if the include file is present # but does not check if it is usable # AX_IN_STDLIB(lowercase_funcname, UPPERCASE_FUNCNAME) # --------------------------------------------------------- # checks if the function is present in the stdlib.h file # and sets SIZEOF_SOCKFUNC if found ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: Checking OS type and VERSION" >&5 echo "$as_me: Checking OS type and VERSION" >&6;} my_host_version=`uname -r` case $host_os in alpha*) cat >>confdefs.h <<_ACEOF #define __ni_ALPHA $my_host_version _ACEOF ;; aix*) cat >>confdefs.h <<_ACEOF #define __ni_AIX $my_host_version _ACEOF ;; beos*) cat >>confdefs.h <<_ACEOF #define __ni_BEOS $my_host_version _ACEOF ;; *bsd*) cat >>confdefs.h <<_ACEOF #define __ni_BSD $my_host_version _ACEOF ;; cygwin*) cat >>confdefs.h <<_ACEOF #define __ni_Cygwin $my_host_version _ACEOF ;; darwin*) cat >>confdefs.h <<_ACEOF #define __ni_Darwin $my_host_version _ACEOF ;; dgux*) cat >>confdefs.h <<_ACEOF #define __ni_DGUX $my_host_version _ACEOF ;; dragonfly*) cat >>confdefs.h <<_ACEOF #define __ni_DragonFly $my_host_version _ACEOF ;; hpux*) cat >>confdefs.h <<_ACEOF #define __ni_HPUX $my_host_version _ACEOF ;; freebsd*) cat >>confdefs.h <<_ACEOF #define __ni_FreeBSD $my_host_version _ACEOF ;; interix*) cat >>confdefs.h <<_ACEOF #define __ni_Interix $my_host_version _ACEOF ;; irix*) cat >>confdefs.h <<_ACEOF #define __ni_IRIX $my_host_version _ACEOF ;; linux*) cat >>confdefs.h <<_ACEOF #define __ni_Linux $my_host_version _ACEOF ;; machten*) cat >>confdefs.h <<_ACEOF #define __ni_MachTen $my_host_version _ACEOF ;; mingw*) cat >>confdefs.h <<_ACEOF #define __ni_MingW $my_host_version _ACEOF ;; msdos* | go32* | windows*) cat >>confdefs.h <<_ACEOF #define __ni_Windows $my_host_version _ACEOF ;; netbsd*) cat >>confdefs.h <<_ACEOF #define __ni_NetBSD $my_host_version _ACEOF ;; next2*) cat >>confdefs.h <<_ACEOF #define __ni_Next2 $my_host_version _ACEOF ;; nextstep*) cat >>confdefs.h <<_ACEOF #define __ni_NextStep $my_host_version _ACEOF ;; openbsd*) cat >>confdefs.h <<_ACEOF #define __ni_OpenBSD $my_host_version _ACEOF ;; osf*) cat >>confdefs.h <<_ACEOF #define __ni_OSF $my_host_version _ACEOF ;; qnx*) cat >>confdefs.h <<_ACEOF #define __ni_QNX4 $my_host_version _ACEOF ;; sco*) cat >>confdefs.h <<_ACEOF #define __ni_SCO $my_host_version _ACEOF ;; solaris*) cat >>confdefs.h <<_ACEOF #define __ni_SunOS $my_host_version _ACEOF ;; sunos*) cat >>confdefs.h <<_ACEOF #define __ni_SUNOS $my_host_version _ACEOF ;; sysv4*) cat >>confdefs.h <<_ACEOF #define __ni_SRV4 $my_host_version _ACEOF ;; sysv5uw*) cat >>confdefs.h <<_ACEOF #define __ni_Unixware $my_host_version _ACEOF ;; unixware*) cat >>confdefs.h <<_ACEOF #define __ni_Unixware $my_host_version _ACEOF ;; ultrix*) cat >>confdefs.h <<_ACEOF #define __ni_Ultrix $my_host_version _ACEOF ;; win32*) cat >>confdefs.h <<_ACEOF #define __ni_Win32 $my_host_version _ACEOF ;; *) echo "" echo "*************************************************************" echo "configure does not currently recognize your operating system," echo "therefore you must do a manual configuration of:" echo "Checking host system type... $host_os" echo "Please contact miker@cpan.org" echo "including the above 'checking host system type...' line " echo "*************************************************************" echo "" exit;; esac { echo "$as_me:$LINENO: checking Operating system of this host is" >&5 echo $ECHO_N "checking Operating system of this host is... $ECHO_C" >&6; } # 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 #include #include #include /* 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 library functions. 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 to if __STDC__ is defined, since # 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 #else # include #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 _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 to if __STDC__ is defined, since # 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 #else # include #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 _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 #include #include #include 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 _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 _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 #include #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 { echo "$as_me:$LINENO: checking for stdio.h" >&5 echo $ECHO_N "checking for stdio.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdio_h+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 "confdefs.h" #include "defaults.h" #include _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_stdio_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdio_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdio_h" >&5 echo "${ECHO_T}$ac_cv_header_stdio_h" >&6; } if test $ac_cv_header_stdio_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDIO_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/socket.h" >&5 echo $ECHO_N "checking for sys/socket.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_socket_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_socket_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_socket_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_socket_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_socket_h" >&6; } if test $ac_cv_header_sys_socket_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_SOCKET_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/rtnetlink.h" >&5 echo $ECHO_N "checking for linux/rtnetlink.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_rtnetlink_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_rtnetlink_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_rtnetlink_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_rtnetlink_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_rtnetlink_h" >&6; } if test $ac_cv_header_linux_rtnetlink_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_RTNETLINK_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/netlink.h" >&5 echo $ECHO_N "checking for linux/netlink.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_netlink_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_netlink_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_netlink_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_netlink_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_netlink_h" >&6; } if test $ac_cv_header_linux_netlink_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_NETLINK_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/ip.h" >&5 echo $ECHO_N "checking for netinet/ip.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_ip_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_ip_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_ip_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ip_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_ip_h" >&6; } if test $ac_cv_header_netinet_ip_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IP_H 1 _ACEOF fi 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 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 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 # 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 stdlib.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 { echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (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_func_malloc_0_nonnull=yes 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_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi for ac_header in stdlib.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 { echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_realloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 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_func_realloc_0_nonnull=yes 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_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_REALLOC 0 _ACEOF case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi { echo "$as_me:$LINENO: checking for MALLOC in stdlib.h" >&5 echo $ECHO_N "checking for MALLOC in stdlib.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF #include int main() { void * mem = malloc(8192); return 1; } _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 { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC_IN_STDLIB 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext; # Checks for header files. { echo "$as_me:$LINENO: checking for asm/types.h" >&5 echo $ECHO_N "checking for asm/types.h... $ECHO_C" >&6; } if test "${ac_cv_header_asm_types_h+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 "confdefs.h" #include "defaults.h" #include _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_asm_types_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_asm_types_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_asm_types_h" >&5 echo "${ECHO_T}$ac_cv_header_asm_types_h" >&6; } if test $ac_cv_header_asm_types_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ASM_TYPES_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for features.h" >&5 echo $ECHO_N "checking for features.h... $ECHO_C" >&6; } if test "${ac_cv_header_features_h+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 "confdefs.h" #include "defaults.h" #include _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_features_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_features_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_features_h" >&5 echo "${ECHO_T}$ac_cv_header_features_h" >&6; } if test $ac_cv_header_features_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FEATURES_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/param.h" >&5 echo $ECHO_N "checking for sys/param.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_param_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_param_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_param_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_param_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_param_h" >&6; } if test $ac_cv_header_sys_param_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_PARAM_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/un.h" >&5 echo $ECHO_N "checking for sys/un.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_un_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_un_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_un_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_un_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_un_h" >&6; } if test $ac_cv_header_sys_un_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_UN_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for neteconet/ec.h" >&5 echo $ECHO_N "checking for neteconet/ec.h... $ECHO_C" >&6; } if test "${ac_cv_header_neteconet_ec_h+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 "confdefs.h" #include "defaults.h" #include _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_neteconet_ec_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_neteconet_ec_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_neteconet_ec_h" >&5 echo "${ECHO_T}$ac_cv_header_neteconet_ec_h" >&6; } if test $ac_cv_header_neteconet_ec_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETECONET_EC_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/atalk.h" >&5 echo $ECHO_N "checking for linux/atalk.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_atalk_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_atalk_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_atalk_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_atalk_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_atalk_h" >&6; } if test $ac_cv_header_linux_atalk_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_ATALK_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/if_fddi.h" >&5 echo $ECHO_N "checking for netinet/if_fddi.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_if_fddi_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_if_fddi_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_if_fddi_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_if_fddi_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_if_fddi_h" >&6; } if test $ac_cv_header_netinet_if_fddi_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IF_FDDI_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_fddi.h" >&5 echo $ECHO_N "checking for linux/if_fddi.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_fddi_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_fddi_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_fddi_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_fddi_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_fddi_h" >&6; } if test $ac_cv_header_linux_if_fddi_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_FDDI_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_tr.h" >&5 echo $ECHO_N "checking for linux/if_tr.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_tr_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_tr_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_tr_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_tr_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_tr_h" >&6; } if test $ac_cv_header_linux_if_tr_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_TR_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_arp.h" >&5 echo $ECHO_N "checking for net/if_arp.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_arp_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_arp_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_arp_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_arp_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_arp_h" >&6; } if test $ac_cv_header_net_if_arp_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_ARP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_ether.h" >&5 echo $ECHO_N "checking for linux/if_ether.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_ether_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_ether_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_ether_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_ether_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_ether_h" >&6; } if test $ac_cv_header_linux_if_ether_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_ETHER_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for endian.h" >&5 echo $ECHO_N "checking for endian.h... $ECHO_C" >&6; } if test "${ac_cv_header_endian_h+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 "confdefs.h" #include "defaults.h" #include _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_endian_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_endian_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_endian_h" >&5 echo "${ECHO_T}$ac_cv_header_endian_h" >&6; } if test $ac_cv_header_endian_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ENDIAN_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for byteswap.h" >&5 echo $ECHO_N "checking for byteswap.h... $ECHO_C" >&6; } if test "${ac_cv_header_byteswap_h+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 "confdefs.h" #include "defaults.h" #include _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_byteswap_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_byteswap_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_byteswap_h" >&5 echo "${ECHO_T}$ac_cv_header_byteswap_h" >&6; } if test $ac_cv_header_byteswap_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_BYTESWAP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for alloca.h" >&5 echo $ECHO_N "checking for alloca.h... $ECHO_C" >&6; } if test "${ac_cv_header_alloca_h+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 "confdefs.h" #include "defaults.h" #include _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_alloca_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_alloca_h" >&5 echo "${ECHO_T}$ac_cv_header_alloca_h" >&6; } if test $ac_cv_header_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/sockio.h" >&5 echo $ECHO_N "checking for sys/sockio.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sockio_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_sockio_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_sockio_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_sockio_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sockio_h" >&6; } if test $ac_cv_header_sys_sockio_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_SOCKIO_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/sysctl.h" >&5 echo $ECHO_N "checking for sys/sysctl.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sysctl_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_sysctl_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_sysctl_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysctl_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysctl_h" >&6; } if test $ac_cv_header_sys_sysctl_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_SYSCTL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/time.h" >&5 echo $ECHO_N "checking for sys/time.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_time_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_time_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_time_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_time_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_time_h" >&6; } if test $ac_cv_header_sys_time_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/module.h" >&5 echo $ECHO_N "checking for sys/module.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_module_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_module_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_module_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_module_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_module_h" >&6; } if test $ac_cv_header_sys_module_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_MODULE_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/linker.h" >&5 echo $ECHO_N "checking for sys/linker.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_linker_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_linker_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_linker_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_linker_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_linker_h" >&6; } if test $ac_cv_header_sys_linker_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_LINKER_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_mac_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_mac_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } if test $ac_cv_header_sys_mac_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_MAC_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netax25/ax25.h" >&5 echo $ECHO_N "checking for netax25/ax25.h... $ECHO_C" >&6; } if test "${ac_cv_header_netax25_ax25_h+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 "confdefs.h" #include "defaults.h" #include _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_netax25_ax25_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netax25_ax25_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netax25_ax25_h" >&5 echo "${ECHO_T}$ac_cv_header_netax25_ax25_h" >&6; } if test $ac_cv_header_netax25_ax25_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETAX25_AX25_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/ax25.h" >&5 echo $ECHO_N "checking for linux/ax25.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_ax25_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_ax25_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_ax25_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_ax25_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_ax25_h" >&6; } if test $ac_cv_header_linux_ax25_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_AX25_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/types.h" >&5 echo $ECHO_N "checking for linux/types.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_types_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_types_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_types_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_types_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_types_h" >&6; } if test $ac_cv_header_linux_types_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_TYPES_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_strip.h" >&5 echo $ECHO_N "checking for linux/if_strip.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_strip_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_strip_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_strip_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_strip_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_strip_h" >&6; } if test $ac_cv_header_linux_if_strip_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_STRIP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/x25.h" >&5 echo $ECHO_N "checking for linux/x25.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_x25_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_x25_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_x25_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_x25_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_x25_h" >&6; } if test $ac_cv_header_linux_x25_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_X25_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_arp.h" >&5 echo $ECHO_N "checking for linux/if_arp.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_arp_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_arp_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_arp_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_arp_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_arp_h" >&6; } if test $ac_cv_header_linux_if_arp_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_ARP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for sys/ioctl.h" >&5 echo $ECHO_N "checking for sys/ioctl.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_ioctl_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_ioctl_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_ioctl_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_ioctl_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_ioctl_h" >&6; } if test $ac_cv_header_sys_ioctl_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_IOCTL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for libc-internal.h" >&5 echo $ECHO_N "checking for libc-internal.h... $ECHO_C" >&6; } if test "${ac_cv_header_libc_internal_h+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 "confdefs.h" #include "defaults.h" #include _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_libc_internal_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_libc_internal_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_libc_internal_h" >&5 echo "${ECHO_T}$ac_cv_header_libc_internal_h" >&6; } if test $ac_cv_header_libc_internal_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIBC_INTERNAL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for signal.h" >&5 echo $ECHO_N "checking for signal.h... $ECHO_C" >&6; } if test "${ac_cv_header_signal_h+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 "confdefs.h" #include "defaults.h" #include _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_signal_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_signal_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_signal_h" >&5 echo "${ECHO_T}$ac_cv_header_signal_h" >&6; } if test $ac_cv_header_signal_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if.h" >&5 echo $ECHO_N "checking for net/if.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_h" >&6; } if test $ac_cv_header_net_if_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netatalk/at.h" >&5 echo $ECHO_N "checking for netatalk/at.h... $ECHO_C" >&6; } if test "${ac_cv_header_netatalk_at_h+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 "confdefs.h" #include "defaults.h" #include _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_netatalk_at_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netatalk_at_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netatalk_at_h" >&5 echo "${ECHO_T}$ac_cv_header_netatalk_at_h" >&6; } if test $ac_cv_header_netatalk_at_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETATALK_AT_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/pfvar.h" >&5 echo $ECHO_N "checking for net/pfvar.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_pfvar_h+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 "confdefs.h" #include "defaults.h" #include _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_net_pfvar_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_pfvar_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_pfvar_h" >&5 echo "${ECHO_T}$ac_cv_header_net_pfvar_h" >&6; } if test $ac_cv_header_net_pfvar_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_PFVAR_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_pfsync.h" >&5 echo $ECHO_N "checking for net/if_pfsync.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_pfsync_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_pfsync_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_pfsync_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_pfsync_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_pfsync_h" >&6; } if test $ac_cv_header_net_if_pfsync_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_PFSYNC_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netpacket/packet.h" >&5 echo $ECHO_N "checking for netpacket/packet.h... $ECHO_C" >&6; } if test "${ac_cv_header_netpacket_packet_h+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 "confdefs.h" #include "defaults.h" #include _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_netpacket_packet_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netpacket_packet_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netpacket_packet_h" >&5 echo "${ECHO_T}$ac_cv_header_netpacket_packet_h" >&6; } if test $ac_cv_header_netpacket_packet_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETPACKET_PACKET_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for stdbool.h" >&5 echo $ECHO_N "checking for stdbool.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+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 "confdefs.h" #include "defaults.h" #include _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_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for time.h" >&5 echo $ECHO_N "checking for time.h... $ECHO_C" >&6; } if test "${ac_cv_header_time_h+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 "confdefs.h" #include "defaults.h" #include _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_time_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time_h" >&5 echo "${ECHO_T}$ac_cv_header_time_h" >&6; } if test $ac_cv_header_time_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_TIME_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/in.h" >&5 echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_in_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_in_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_in_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6; } if test $ac_cv_header_netinet_in_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IN_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_var.h" >&5 echo $ECHO_N "checking for net/if_var.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_var_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_var_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_var_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_var_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_var_h" >&6; } if test $ac_cv_header_net_if_var_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_VAR_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/in_var.h" >&5 echo $ECHO_N "checking for netinet/in_var.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_in_var_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_in_var_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_in_var_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_var_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_in_var_h" >&6; } if test $ac_cv_header_netinet_in_var_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IN_VAR_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netipx/ipx.h" >&5 echo $ECHO_N "checking for netipx/ipx.h... $ECHO_C" >&6; } if test "${ac_cv_header_netipx_ipx_h+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 "confdefs.h" #include "defaults.h" #include _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_netipx_ipx_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netipx_ipx_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netipx_ipx_h" >&5 echo "${ECHO_T}$ac_cv_header_netipx_ipx_h" >&6; } if test $ac_cv_header_netipx_ipx_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETIPX_IPX_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netipx/ipx_if.h" >&5 echo $ECHO_N "checking for netipx/ipx_if.h... $ECHO_C" >&6; } if test "${ac_cv_header_netipx_ipx_if_h+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 "confdefs.h" #include "defaults.h" #include _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_netipx_ipx_if_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netipx_ipx_if_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netipx_ipx_if_h" >&5 echo "${ECHO_T}$ac_cv_header_netipx_ipx_if_h" >&6; } if test $ac_cv_header_netipx_ipx_if_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETIPX_IPX_IF_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_dl.h" >&5 echo $ECHO_N "checking for net/if_dl.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_dl_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_dl_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_dl_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_dl_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_dl_h" >&6; } if test $ac_cv_header_net_if_dl_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_DL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_types.h" >&5 echo $ECHO_N "checking for net/if_types.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_types_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_types_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_types_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_types_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_types_h" >&6; } if test $ac_cv_header_net_if_types_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_TYPES_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/route.h" >&5 echo $ECHO_N "checking for net/route.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_route_h+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 "confdefs.h" #include "defaults.h" #include _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_net_route_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_route_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_route_h" >&5 echo "${ECHO_T}$ac_cv_header_net_route_h" >&6; } if test $ac_cv_header_net_route_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ROUTE_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/ether.h" >&5 echo $ECHO_N "checking for netinet/ether.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_ether_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_ether_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_ether_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ether_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_ether_h" >&6; } if test $ac_cv_header_netinet_ether_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_ETHER_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/if_ether.h" >&5 echo $ECHO_N "checking for netinet/if_ether.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_if_ether_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_if_ether_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_if_ether_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_if_ether_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_if_ether_h" >&6; } if test $ac_cv_header_netinet_if_ether_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IF_ETHER_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/if_slip.h" >&5 echo $ECHO_N "checking for linux/if_slip.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_if_slip_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_if_slip_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_if_slip_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_if_slip_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_if_slip_h" >&6; } if test $ac_cv_header_linux_if_slip_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_IF_SLIP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for ctype.h" >&5 echo $ECHO_N "checking for ctype.h... $ECHO_C" >&6; } if test "${ac_cv_header_ctype_h+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 "confdefs.h" #include "defaults.h" #include _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_ctype_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_ctype_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_ctype_h" >&5 echo "${ECHO_T}$ac_cv_header_ctype_h" >&6; } if test $ac_cv_header_ctype_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_CTYPE_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet/ip_carp.h" >&5 echo $ECHO_N "checking for netinet/ip_carp.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet_ip_carp_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet_ip_carp_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet_ip_carp_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet_ip_carp_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet_ip_carp_h" >&6; } if test $ac_cv_header_netinet_ip_carp_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET_IP_CARP_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_media.h" >&5 echo $ECHO_N "checking for net/if_media.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_media_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_media_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_media_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_media_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_media_h" >&6; } if test $ac_cv_header_net_if_media_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_MEDIA_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net80211/ieee80211.h" >&5 echo $ECHO_N "checking for net80211/ieee80211.h... $ECHO_C" >&6; } if test "${ac_cv_header_net80211_ieee80211_h+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 "confdefs.h" #include "defaults.h" #include _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_net80211_ieee80211_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net80211_ieee80211_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net80211_ieee80211_h" >&5 echo "${ECHO_T}$ac_cv_header_net80211_ieee80211_h" >&6; } if test $ac_cv_header_net80211_ieee80211_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET80211_IEEE80211_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net80211/ieee80211_crypto.h" >&5 echo $ECHO_N "checking for net80211/ieee80211_crypto.h... $ECHO_C" >&6; } if test "${ac_cv_header_net80211_ieee80211_crypto_h+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 "confdefs.h" #include "defaults.h" #include _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_net80211_ieee80211_crypto_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net80211_ieee80211_crypto_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net80211_ieee80211_crypto_h" >&5 echo "${ECHO_T}$ac_cv_header_net80211_ieee80211_crypto_h" >&6; } if test $ac_cv_header_net80211_ieee80211_crypto_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET80211_IEEE80211_CRYPTO_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net80211/ieee80211_ioctl.h" >&5 echo $ECHO_N "checking for net80211/ieee80211_ioctl.h... $ECHO_C" >&6; } if test "${ac_cv_header_net80211_ieee80211_ioctl_h+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 "confdefs.h" #include "defaults.h" #include _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_net80211_ieee80211_ioctl_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net80211_ieee80211_ioctl_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net80211_ieee80211_ioctl_h" >&5 echo "${ECHO_T}$ac_cv_header_net80211_ieee80211_ioctl_h" >&6; } if test $ac_cv_header_net80211_ieee80211_ioctl_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET80211_IEEE80211_IOCTL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_lagg.h" >&5 echo $ECHO_N "checking for net/if_lagg.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_lagg_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_lagg_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_lagg_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_lagg_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_lagg_h" >&6; } if test $ac_cv_header_net_if_lagg_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_LAGG_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/if_vlan_var.h" >&5 echo $ECHO_N "checking for net/if_vlan_var.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_if_vlan_var_h+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 "confdefs.h" #include "defaults.h" #include _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_net_if_vlan_var_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_if_vlan_var_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_if_vlan_var_h" >&5 echo "${ECHO_T}$ac_cv_header_net_if_vlan_var_h" >&6; } if test $ac_cv_header_net_if_vlan_var_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_IF_VLAN_VAR_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/ethernet.h" >&5 echo $ECHO_N "checking for net/ethernet.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_ethernet_h+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 "confdefs.h" #include "defaults.h" #include _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_net_ethernet_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_ethernet_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_ethernet_h" >&5 echo "${ECHO_T}$ac_cv_header_net_ethernet_h" >&6; } if test $ac_cv_header_net_ethernet_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ETHERNET_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for ifaddrs.h" >&5 echo $ECHO_N "checking for ifaddrs.h... $ECHO_C" >&6; } if test "${ac_cv_header_ifaddrs_h+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 "confdefs.h" #include "defaults.h" #include _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_ifaddrs_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_ifaddrs_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_ifaddrs_h" >&5 echo "${ECHO_T}$ac_cv_header_ifaddrs_h" >&6; } if test $ac_cv_header_ifaddrs_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_IFADDRS_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netdb.h" >&5 echo $ECHO_N "checking for netdb.h... $ECHO_C" >&6; } if test "${ac_cv_header_netdb_h+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 "confdefs.h" #include "defaults.h" #include _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_netdb_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netdb_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netdb_h" >&5 echo "${ECHO_T}$ac_cv_header_netdb_h" >&6; } if test $ac_cv_header_netdb_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETDB_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netinet6/nd6.h" >&5 echo $ECHO_N "checking for netinet6/nd6.h... $ECHO_C" >&6; } if test "${ac_cv_header_netinet6_nd6_h+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 "confdefs.h" #include "defaults.h" #include _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_netinet6_nd6_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netinet6_nd6_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netinet6_nd6_h" >&5 echo "${ECHO_T}$ac_cv_header_netinet6_nd6_h" >&6; } if test $ac_cv_header_netinet6_nd6_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETINET6_ND6_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for stdarg.h" >&5 echo $ECHO_N "checking for stdarg.h... $ECHO_C" >&6; } if test "${ac_cv_header_stdarg_h+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 "confdefs.h" #include "defaults.h" #include _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_stdarg_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdarg_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdarg_h" >&5 echo "${ECHO_T}$ac_cv_header_stdarg_h" >&6; } if test $ac_cv_header_stdarg_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDARG_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net80211/ieee80211_freebsd.h" >&5 echo $ECHO_N "checking for net80211/ieee80211_freebsd.h... $ECHO_C" >&6; } if test "${ac_cv_header_net80211_ieee80211_freebsd_h+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 "confdefs.h" #include "defaults.h" #include _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_net80211_ieee80211_freebsd_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net80211_ieee80211_freebsd_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net80211_ieee80211_freebsd_h" >&5 echo "${ECHO_T}$ac_cv_header_net80211_ieee80211_freebsd_h" >&6; } if test $ac_cv_header_net80211_ieee80211_freebsd_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET80211_IEEE80211_FREEBSD_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for linux/rose.h" >&5 echo $ECHO_N "checking for linux/rose.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_rose_h+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 "confdefs.h" #include "defaults.h" #include _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_linux_rose_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_linux_rose_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_rose_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_rose_h" >&6; } if test $ac_cv_header_linux_rose_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINUX_ROSE_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for fcntl.h" >&5 echo $ECHO_N "checking for fcntl.h... $ECHO_C" >&6; } if test "${ac_cv_header_fcntl_h+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 "confdefs.h" #include "defaults.h" #include _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_fcntl_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_fcntl_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_fcntl_h" >&5 echo "${ECHO_T}$ac_cv_header_fcntl_h" >&6; } if test $ac_cv_header_fcntl_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FCNTL_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for malloc.h" >&5 echo $ECHO_N "checking for malloc.h... $ECHO_C" >&6; } if test "${ac_cv_header_malloc_h+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 "confdefs.h" #include "defaults.h" #include _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_malloc_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_malloc_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_malloc_h" >&5 echo "${ECHO_T}$ac_cv_header_malloc_h" >&6; } if test $ac_cv_header_malloc_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for arpa/inet.h" >&5 echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6; } if test "${ac_cv_header_arpa_inet_h+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 "confdefs.h" #include "defaults.h" #include _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_arpa_inet_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_arpa_inet_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5 echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6; } if test $ac_cv_header_arpa_inet_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ARPA_INET_H 1 _ACEOF fi # additional headers { echo "$as_me:$LINENO: checking for sys/dlpi.h" >&5 echo $ECHO_N "checking for sys/dlpi.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_dlpi_h+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 "confdefs.h" #include "defaults.h" #include _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_sys_dlpi_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_dlpi_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_dlpi_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_dlpi_h" >&6; } if test $ac_cv_header_sys_dlpi_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_DLPI_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for stropts.h" >&5 echo $ECHO_N "checking for stropts.h... $ECHO_C" >&6; } if test "${ac_cv_header_stropts_h+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 "confdefs.h" #include "defaults.h" #include _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_stropts_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stropts_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stropts_h" >&5 echo "${ECHO_T}$ac_cv_header_stropts_h" >&6; } if test $ac_cv_header_stropts_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STROPTS_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for net/nit_if.h" >&5 echo $ECHO_N "checking for net/nit_if.h... $ECHO_C" >&6; } if test "${ac_cv_header_net_nit_if_h+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 "confdefs.h" #include "defaults.h" #include _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_net_nit_if_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_net_nit_if_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_net_nit_if_h" >&5 echo "${ECHO_T}$ac_cv_header_net_nit_if_h" >&6; } if test $ac_cv_header_net_nit_if_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_NIT_IF_H 1 _ACEOF fi { echo "$as_me:$LINENO: checking for netio.h" >&5 echo $ECHO_N "checking for netio.h... $ECHO_C" >&6; } if test "${ac_cv_header_netio_h+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 "confdefs.h" #include "defaults.h" #include _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_netio_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_netio_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_netio_h" >&5 echo "${ECHO_T}$ac_cv_header_netio_h" >&6; } if test $ac_cv_header_netio_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NETIO_H 1 _ACEOF fi # 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 size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_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 size_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_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for int8_t" >&5 echo $ECHO_N "checking for int8_t... $ECHO_C" >&6; } if test "${ac_cv_c_int8_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int8_t=no for ac_type in 'int8_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 << (8 - 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 << (8 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (8 - 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 int8_t) ac_cv_c_int8_t=yes ;; *) ac_cv_c_int8_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_int8_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_int8_t" >&5 echo "${ECHO_T}$ac_cv_c_int8_t" >&6; } case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac { echo "$as_me:$LINENO: checking for int16_t" >&5 echo $ECHO_N "checking for int16_t... $ECHO_C" >&6; } if test "${ac_cv_c_int16_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int16_t=no for ac_type in 'int16_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 << (16 - 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 << (16 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (16 - 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 int16_t) ac_cv_c_int16_t=yes ;; *) ac_cv_c_int16_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_int16_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_int16_t" >&5 echo "${ECHO_T}$ac_cv_c_int16_t" >&6; } case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac { 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 int64_t" >&5 echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } if test "${ac_cv_c_int64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int64_t=no for ac_type in 'int64_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 << (64 - 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 << (64 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (64 - 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 int64_t) ac_cv_c_int64_t=yes ;; *) ac_cv_c_int64_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_int64_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_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 { 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 uint64_t" >&5 echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint64_t=no for ac_type in 'uint64_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 >> (64 - 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 uint64_t) ac_cv_c_uint64_t=yes ;; *) ac_cv_c_uint64_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_uint64_t" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT64_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac { echo "$as_me:$LINENO: checking for caddr_t" >&5 echo $ECHO_N "checking for caddr_t... $ECHO_C" >&6; } if test "${ac_cv_type_caddr_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 caddr_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_caddr_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_caddr_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_caddr_t" >&5 echo "${ECHO_T}$ac_cv_type_caddr_t" >&6; } if test $ac_cv_type_caddr_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_CADDR_T 1 _ACEOF fi for ac_func in memcmp memset memcpy bzero getpagesize memmove getnameinfo do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; 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. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* 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 $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF 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 eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # my additions { 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 #include 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 #include 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 #include 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 #include 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 #include 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 uint64_t" >&5 echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_type_uint64_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 uint64_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_uint64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uint64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 echo "${ECHO_T}$ac_cv_type_uint64_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 uint64_t" >&5 echo $ECHO_N "checking size of uint64_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_uint64_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 uint64_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 uint64_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 uint64_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 uint64_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 uint64_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_uint64_t=$ac_lo;; '') if test "$ac_cv_type_uint64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint64_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 uint64_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 #include 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_uint64_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_uint64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (uint64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (uint64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_uint64_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_uint64_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_uint64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UINT64_T $ac_cv_sizeof_uint64_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 #include 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 #include 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 #include 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 { echo "$as_me:$LINENO: checking for u_int64_t" >&5 echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_type_u_int64_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_int64_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_int64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_u_int64_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5 echo "${ECHO_T}$ac_cv_type_u_int64_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_int64_t" >&5 echo $ECHO_N "checking size of u_int64_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_u_int64_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_int64_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_int64_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_int64_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_int64_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_int64_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_int64_t=$ac_lo;; '') if test "$ac_cv_type_u_int64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int64_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_int64_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 #include 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_int64_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_int64_t" = yes; then { { echo "$as_me:$LINENO: error: cannot compute sizeof (u_int64_t) See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (u_int64_t) See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } else ac_cv_sizeof_u_int64_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_int64_t" >&5 echo "${ECHO_T}$ac_cv_sizeof_u_int64_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_U_INT64_T $ac_cv_sizeof_u_int64_t _ACEOF { echo "$as_me:$LINENO: checking for size of pointer" >&5 echo $ECHO_N "checking for size of pointer... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; long my_pointer_size = sizeof(char *); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_pointer_size); fclose(FP); return 0; } else return 1; } _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 # action if true ac_pointersize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_pointersize" >&5 echo "${ECHO_T}is $ac_pointersize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_POINTER $ac_pointersize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } # no action if false fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for PAGE_SIZE" >&5 echo $ECHO_N "checking for PAGE_SIZE... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* INPUT */ #include "confdefs.h" #include "defaults.h" int main() { #ifdef PAGE_SIZE return 0; #else return 1; #endif } _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 # ACTION IF TRUE # page size is defined { echo "$as_me:$LINENO: result: defined" >&5 echo "${ECHO_T}defined" >&6; } 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 ) # ACTION IF FALSE # page size is not define, run test { echo "$as_me:$LINENO: not defined, trying equivalent..." >&5 echo "$as_me: not defined, trying equivalent..." >&6;} if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* INPUT 2 */ # include "confdefs.h" # include "defaults.h" int main() { FILE *FP; long my_pagesize; # if defined (HAVE_UNISTD_H) && (defined(_SC_PAGESIZE) || defined(_SC_PAGE_SIZE) || defined(_SC_MMAP_PAGE_SIZE)) # if defined(_SC_PAGESIZE) my_pagesize = sysconf(_SC_PAGESIZE); # elif defined(_SC_PAGE_SIZE) my_pagesize = sysconf(_SC_PAGE_SIZE); # else my_pagesize = sysconf(_SC_MMAP_PAGE_SIZE); # endif # elif defined HAVE_GETPAGESIZE my_pagesize = getpagesize(); # elif defined(PAGESIZE) my_pagesize = PAGESIZE; # else my_pagesize = 0; # endif if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_pagesize); fclose(FP); if (my_pagesize != 0) return 0; else return 1; } return 1; } _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 # ACTION IF TRUE 2 # managed to find page size, define it in our config file ac_pagesize=`cat conftest.data` { echo "$as_me:$LINENO: result: found page size = $ac_pagesize" >&5 echo "${ECHO_T}found page size = $ac_pagesize" >&6; } if test $ac_pagesize -gt 0; then { echo "$as_me:$LINENO: result: define PAGE_SIZE $ac_pagesize" >&5 echo "${ECHO_T}define PAGE_SIZE $ac_pagesize" >&6; } cat >>confdefs.h <<_ACEOF #define PAGE_SIZE $ac_pagesize _ACEOF else # UGH! could not find a page size definition { { echo "$as_me:$LINENO: error: Could not find PAGE_SIZE for this OS" >&5 echo "$as_me: error: Could not find PAGE_SIZE for this OS" >&2;} { (exit 1); exit 1; }; } fi 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 ) # ACTION IF FALSE 2 { { echo "$as_me:$LINENO: error: Could not determine PAGE_SIZE for this OS" >&5 echo "$as_me: error: Could not determine PAGE_SIZE for this OS" >&2;} { (exit 1); exit 1; }; } 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 *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for library containing socket" >&5 echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; } if test "${ac_cv_search_socket+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 socket (); int main () { return socket (); ; 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_socket=$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_socket+set}" = set; then break fi done if test "${ac_cv_search_socket+set}" = set; then : else ac_cv_search_socket=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5 echo "${ECHO_T}$ac_cv_search_socket" >&6; } ac_res=$ac_cv_search_socket if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKET 1 _ACEOF fi { echo "$as_me:$LINENO: checking for library containing link_ntoa" >&5 echo $ECHO_N "checking for library containing link_ntoa... $ECHO_C" >&6; } if test "${ac_cv_search_link_ntoa+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 link_ntoa (); int main () { return link_ntoa (); ; 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 -lnsl $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_link_ntoa=$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_link_ntoa+set}" = set; then break fi done if test "${ac_cv_search_link_ntoa+set}" = set; then : else ac_cv_search_link_ntoa=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_link_ntoa" >&5 echo "${ECHO_T}$ac_cv_search_link_ntoa" >&6; } ac_res=$ac_cv_search_link_ntoa if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_LINK_NTOA 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 -lnsl $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 -lnsl $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 -lnsl $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 for library containing pcap_close" >&5 echo $ECHO_N "checking for library containing pcap_close... $ECHO_C" >&6; } if test "${ac_cv_search_pcap_close+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 pcap_close (); int main () { return pcap_close (); ; return 0; } _ACEOF for ac_lib in '' pcap; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $LDDLFLAGS $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_pcap_close=$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_pcap_close+set}" = set; then break fi done if test "${ac_cv_search_pcap_close+set}" = set; then : else ac_cv_search_pcap_close=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_pcap_close" >&5 echo "${ECHO_T}$ac_cv_search_pcap_close" >&6; } ac_res=$ac_cv_search_pcap_close if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_PCAP 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct ifaddrs" >&5 echo $ECHO_N "checking for struct ifaddrs... $ECHO_C" >&6; } if test "${ac_cv_type_struct_ifaddrs+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 "confdefs.h" #include "defaults.h" typedef struct ifaddrs 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_struct_ifaddrs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_ifaddrs=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_ifaddrs" >&5 echo "${ECHO_T}$ac_cv_type_struct_ifaddrs" >&6; } if test $ac_cv_type_struct_ifaddrs = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IFADDRS 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct ifreq" >&5 echo $ECHO_N "checking for struct ifreq... $ECHO_C" >&6; } if test "${ac_cv_type_struct_ifreq+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 "confdefs.h" #include "defaults.h" typedef struct ifreq 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_struct_ifreq=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_ifreq=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_ifreq" >&5 echo "${ECHO_T}$ac_cv_type_struct_ifreq" >&6; } if test $ac_cv_type_struct_ifreq = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IFREQ 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct if_laddrreq" >&5 echo $ECHO_N "checking for struct if_laddrreq... $ECHO_C" >&6; } if test "${ac_cv_type_struct_if_laddrreq+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 "confdefs.h" #include "defaults.h" typedef struct if_laddrreq 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_struct_if_laddrreq=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_if_laddrreq=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_if_laddrreq" >&5 echo "${ECHO_T}$ac_cv_type_struct_if_laddrreq" >&6; } if test $ac_cv_type_struct_if_laddrreq = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IF_LADDRREQ 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct if_data" >&5 echo $ECHO_N "checking for struct if_data... $ECHO_C" >&6; } if test "${ac_cv_type_struct_if_data+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 "confdefs.h" #include "defaults.h" typedef struct if_data 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_struct_if_data=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_if_data=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_if_data" >&5 echo "${ECHO_T}$ac_cv_type_struct_if_data" >&6; } if test $ac_cv_type_struct_if_data = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IF_DATA 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct in6_ifreq" >&5 echo $ECHO_N "checking for struct in6_ifreq... $ECHO_C" >&6; } if test "${ac_cv_type_struct_in6_ifreq+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 "confdefs.h" #include "defaults.h" typedef struct in6_ifreq 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_struct_in6_ifreq=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_in6_ifreq=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_in6_ifreq" >&5 echo "${ECHO_T}$ac_cv_type_struct_in6_ifreq" >&6; } if test $ac_cv_type_struct_in6_ifreq = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IN6_IFREQ 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct if_data" >&5 echo $ECHO_N "checking for struct if_data... $ECHO_C" >&6; } if test "${ac_cv_type_struct_if_data+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 "confdefs.h" #include "defaults.h" typedef struct if_data 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_struct_if_data=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_if_data=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_if_data" >&5 echo "${ECHO_T}$ac_cv_type_struct_if_data" >&6; } if test $ac_cv_type_struct_if_data = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IF_DATA 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct ifdevea" >&5 echo $ECHO_N "checking for struct ifdevea... $ECHO_C" >&6; } if test "${ac_cv_type_struct_ifdevea+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 "confdefs.h" #include "defaults.h" typedef struct ifdevea 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_struct_ifdevea=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_ifdevea=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_ifdevea" >&5 echo "${ECHO_T}$ac_cv_type_struct_ifdevea" >&6; } if test $ac_cv_type_struct_ifdevea = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_IFDEVEA 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct lifreq" >&5 echo $ECHO_N "checking for struct lifreq... $ECHO_C" >&6; } if test "${ac_cv_type_struct_lifreq+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 "confdefs.h" #include "defaults.h" typedef struct lifreq 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_struct_lifreq=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_struct_lifreq=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_struct_lifreq" >&5 echo "${ECHO_T}$ac_cv_type_struct_lifreq" >&6; } if test $ac_cv_type_struct_lifreq = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_LIFREQ 1 _ACEOF { echo "$as_me:$LINENO: checking for sizeof lifreq - nifreq" >&5 echo $ECHO_N "checking for sizeof lifreq - nifreq... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct lifreq lifr; int diffsize = sizeof(lifr.lifr_lifru) + sizeof(lifr.lifr_lifru1) + sizeof(uint_t) + LIFNAMSIZ - IFNAMSIZ; if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%d\n",diffsize); fclose(FP); return 0; } else return 1; } _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 # action if true ac_lifreqpad=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_lifreqpad" >&5 echo "${ECHO_T}is $ac_lifreqpad" >&6; } cat >>confdefs.h <<_ACEOF #define NI_LIFREQ_PAD $ac_lifreqpad _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for lifreq union offset" >&5 echo $ECHO_N "checking for lifreq union offset... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct lifreq lifr; int offset = LIFNAMSIZ - IFNAMSIZ + sizeof(lifr.lifr_lifru1) + sizeof(uint_t); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%d\n",offset); fclose(FP); return 0; } else return 1; } _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 # action if true ac_lifreqoffset=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_lifreqoffset" >&5 echo "${ECHO_T}is $ac_lifreqoffset" >&6; } cat >>confdefs.h <<_ACEOF #define NI_LIFREQ_OFFSET $ac_lifreqoffset _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } # action if false fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else cat >>confdefs.h <<_ACEOF #define NI_LIFREQ_OFFSET 0 _ACEOF fi # we do not want multiple thread libraries included as # extra LIBS so nest thread checks if test "${ac_cv_header_pthread_h+set}" = set; then { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking pthread.h usability" >&5 echo $ECHO_N "checking pthread.h 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 _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 pthread.h presence" >&5 echo $ECHO_N "checking pthread.h 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 _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: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi if test $ac_cv_header_pthread_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF { echo "$as_me:$LINENO: checking for library containing pthread_mutex_init" >&5 echo $ECHO_N "checking for library containing pthread_mutex_init... $ECHO_C" >&6; } if test "${ac_cv_search_pthread_mutex_init+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 pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF for ac_lib in '' pthreads; 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_pthread_mutex_init=$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_pthread_mutex_init+set}" = set; then break fi done if test "${ac_cv_search_pthread_mutex_init+set}" = set; then : else ac_cv_search_pthread_mutex_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_search_pthread_mutex_init" >&6; } ac_res=$ac_cv_search_pthread_mutex_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: ...have pthreads, do not check for thread.h" >&5 echo "$as_me: ...have pthreads, do not check for thread.h" >&6;} else if test "${ac_cv_header_thread_h+set}" = set; then { echo "$as_me:$LINENO: checking for thread.h" >&5 echo $ECHO_N "checking for thread.h... $ECHO_C" >&6; } if test "${ac_cv_header_thread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5 echo "${ECHO_T}$ac_cv_header_thread_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking thread.h usability" >&5 echo $ECHO_N "checking thread.h 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 _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 thread.h presence" >&5 echo $ECHO_N "checking thread.h 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 _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: thread.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: thread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: thread.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: thread.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: thread.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: thread.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: thread.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: thread.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: thread.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: thread.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: thread.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for thread.h" >&5 echo $ECHO_N "checking for thread.h... $ECHO_C" >&6; } if test "${ac_cv_header_thread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_thread_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_thread_h" >&5 echo "${ECHO_T}$ac_cv_header_thread_h" >&6; } fi if test $ac_cv_header_thread_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_THREAD_H 1 _ACEOF { echo "$as_me:$LINENO: checking for library containing mutex_init" >&5 echo $ECHO_N "checking for library containing mutex_init... $ECHO_C" >&6; } if test "${ac_cv_search_mutex_init+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 mutex_init (); int main () { return mutex_init (); ; return 0; } _ACEOF for ac_lib in '' thread; 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_mutex_init=$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_mutex_init+set}" = set; then break fi done if test "${ac_cv_search_mutex_init+set}" = set; then : else ac_cv_search_mutex_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_mutex_init" >&5 echo "${ECHO_T}$ac_cv_search_mutex_init" >&6; } ac_res=$ac_cv_search_mutex_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi fi { echo "$as_me:$LINENO: checking for library containing ioctl" >&5 echo $ECHO_N "checking for library containing ioctl... $ECHO_C" >&6; } if test "${ac_cv_search_ioctl+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 ioctl (); int main () { return ioctl (); ; return 0; } _ACEOF for ac_lib in '' ; 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_ioctl=$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_ioctl+set}" = set; then break fi done if test "${ac_cv_search_ioctl+set}" = set; then : else ac_cv_search_ioctl=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_ioctl" >&5 echo "${ECHO_T}$ac_cv_search_ioctl" >&6; } ac_res=$ac_cv_search_ioctl if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { echo "$as_me:$LINENO: checking for struct sockaddr.sa_len" >&5 echo $ECHO_N "checking for struct sockaddr.sa_len... $ECHO_C" >&6; } if test "${ac_cv_member_struct_sockaddr_sa_len+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 "confdefs.h" #include "defaults.h" int main () { static struct sockaddr ac_aggr; if (ac_aggr.sa_len) 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_member_struct_sockaddr_sa_len=yes 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. */ #include "confdefs.h" #include "defaults.h" int main () { static struct sockaddr ac_aggr; if (sizeof ac_aggr.sa_len) 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_member_struct_sockaddr_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sockaddr_sa_len=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 { echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_sa_len" >&5 echo "${ECHO_T}$ac_cv_member_struct_sockaddr_sa_len" >&6; } if test $ac_cv_member_struct_sockaddr_sa_len = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SA_LEN 1 _ACEOF fi { echo "$as_me:$LINENO: checking for struct sockaddr_in6.sin6_scopeid" >&5 echo $ECHO_N "checking for struct sockaddr_in6.sin6_scopeid... $ECHO_C" >&6; } if test "${ac_cv_member_struct_sockaddr_in6_sin6_scopeid+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 "confdefs.h" #include "defaults.h" int main () { static struct sockaddr_in6 ac_aggr; if (ac_aggr.sin6_scopeid) 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_member_struct_sockaddr_in6_sin6_scopeid=yes 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. */ #include "confdefs.h" #include "defaults.h" int main () { static struct sockaddr_in6 ac_aggr; if (sizeof ac_aggr.sin6_scopeid) 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_member_struct_sockaddr_in6_sin6_scopeid=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sockaddr_in6_sin6_scopeid=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 { echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in6_sin6_scopeid" >&5 echo "${ECHO_T}$ac_cv_member_struct_sockaddr_in6_sin6_scopeid" >&6; } if test $ac_cv_member_struct_sockaddr_in6_sin6_scopeid = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SIN6_SCOPEID 1 _ACEOF fi # add socket families as they are identified { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_STORAGE" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_STORAGE... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_storage sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_STORAGE $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_IN" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_IN... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_in sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_IN $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_AT" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_AT... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_at sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_AT $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_ASH" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_ASH... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ash sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_ASH $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_AX25" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_AX25... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ax25 sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_AX25 $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_X25" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_X25... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_x25 sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_X25 $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_EC" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_EC... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ec sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_EC $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_IN6" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_IN6... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_in6 sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_IN6 $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_IPX" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_IPX... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ipx sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_IPX $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_UN" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_UN... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_un sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_UN $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_LL" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_LL... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ll sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_LL $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_ROSE" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_ROSE... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_rose sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_ROSE $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_DL" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_DL... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_dl sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_DL $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_EON" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_EON... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_eon sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_EON $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_INARP" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_INARP... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_inarp sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_INARP $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_ISO" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_ISO... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_iso sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_ISO $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_NS" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_NS... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ns sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_NS $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_ATM" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_ATM... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_atm sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_ATM $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_DECnet" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_DECnet... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_dn sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_DECnet $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_TP" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_TP... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_tp sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_TP $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: checking for LOCAL_SIZEOF_SOCKADDR_OSITP" >&5 echo $ECHO_N "checking for LOCAL_SIZEOF_SOCKADDR_OSITP... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF #include "confdefs.h" #include "defaults.h" int main() { FILE *FP; struct sockaddr_ositp sa; long my_family_size = sizeof(sa); if (FP = fopen("conftest.data", "w")) { (void) fprintf(FP,"%ld\n",my_family_size); fclose(FP); return 0; } else return 1; } _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_familysize=`cat conftest.data` { echo "$as_me:$LINENO: result: is $ac_familysize" >&5 echo "${ECHO_T}is $ac_familysize" >&6; } cat >>confdefs.h <<_ACEOF #define LOCAL_SIZEOF_SOCKADDR_OSITP $ac_familysize _ACEOF 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 ) { echo "$as_me:$LINENO: result: not defined" >&5 echo "${ECHO_T}not defined" >&6; } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi 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 ." _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 Net-Interface-1.012/Makefile.PL0000644000000000000120000001050211155024014014724 0ustar rootwheeluse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. if ($^O eq 'MSWin32') { print STDERR "Windows is not supported\n"; exit 0 } # extra libs we would like to have that perl does not, # a SPACE separated list # # put a test for them in configure.ac and let the script # below find and insert them. Make sure and add the necessary # paths in %makeparms for INC and LIBS but not the library itself # my $wish_libs = ''; # 'C' files that are not objexts # my $include = ' ni_IFF_inc.c ni_XStabs_inc.c miniSocketXS.c '; # objecct files # my $depend = 'defaults.h localconf.h config.h localperl.h netsymbolC.inc netsymbolXS.inc inst/netsymbols.pl '. # ni_.h files '. 'ni_funct.h ni_strlcpy.h ni_memcmp.h ni_fixups.h '. # ni_.c files 'ni_getifaddrs.c ni_ifreq.c ni_in6_ifreq.c ni_lifreq.c ni_strlcpy.c ni_util.c '. 'ni_malloc.c ni_linuxproc.c ni_af_inetcommon.c ni_memcmp.c ni_in6_classify.c '. 'ni_fallbackhwaddr.c ni_get_set.c'; my $objects = 'Interface.o '. join(' ',grep {s/(ni_[^\.]+\.)c/${1}o/} split(/\ /,$depend)); $depend .= $include; use Config; my $pkg = 'Net::Interface'; $pkg =~ /[^:]+$/; my $module = $& .'.pm'; my $cfile = $& .'.c'; my %makeparms = ( NAME => $pkg, VERSION_FROM => $module, # finds $VERSION PREREQ_PM => { Test::More => 0.62, Socket => 0, }, # LIBS list should be a single string to be compatible with script below LIBS => '-L/usr/local/lib', INC => '-I/usr/local/include', OBJECT => $objects, dist => {'COMPRESS' => 'gzip', 'SUFFIX' => 'gz'}, clean => { FILES => q|*~ *.bs *.o tmp* localperl.h auto* *.inc |. q|lib/Net/Interface/NetSymbols.pm ni_IFF_inc.c ni_XStabs_inc.c |}, realclean => { FILES => "config.h config.log config.status"}, depend => {$cfile => $depend, }, ); ################################# # fix up compile and link flags ################################# my %addflags = ( ldflags => $makeparms{LIBS}, lddlflags => $makeparms{LIBS}, ccflags => $makeparms{INC}, ); my $cfgstrg = ''; foreach (sort keys %addflags) { my $KEY = uc $_; my $oldstuff = $Config{$_} =~ /(\S.+)/ ? $1 : ''; $oldstuff .= ' ' if $oldstuff && $oldstuff !~ / $/; #print "$_, $KEY, $oldstuff, $addflags{$_}\n"; unless ($oldstuff =~ m|$addflags{$_}|) { $oldstuff .= $addflags{$_}; } $cfgstrg .= qq|$KEY="$oldstuff" |; } unless (-e './config.h') { my $command = qq|./configure $cfgstrg|; print $command,"\n"; system($command); } ################################### # fix up lib list ################################### my %LIBS; open(F,'config.h') or die "could not open config.h\n"; foreach() { if ($_ =~ /^#define LIBS([ a-zA-Z-]+)/) { # make lib list unique map {$LIBS{$_} = 1} ($1 =~ /[a-zA-Z0-9-]+/g); last; } } close F; my $liblist = $Config{libs} .' '. $wish_libs; my $link = $makeparms{LIBS} =~ /(\S.+)/ ? $1 : ''; $link .= ' ' unless $link =~ / $/; foreach(keys %LIBS) { if ($liblist =~ /$_\b/) { $link .= $_ .' '; } } chop $link; $makeparms{LIBS} = [$link]; ####################################### # find build symbols for OS and threads ####################################### 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 * */ |; my @osvers = split(/[._-]/,$Config{osvers}); foreach (0..$#osvers) { print F qq|#define NI_OSVER_$_ $osvers[$_]\n|; } print F qq|#define NI_OSVER_BASE $Config{osvers} #define NI_OS_|, (uc $Config{osname}), q| 1 #define NI_OSARCH |, (uc $Config{myarchname}),q| |; print F q|#define LOCAL_PERL_WANTS_PTHREAD_H 1 | if $Config{i_pthread} eq 'define'; print F q|#define LOCAL_PERL_USE_THREADS 1 | if $Config{usethreads} eq 'define'; print F q|#define LOCAL_PERL_USE_I_THREADS 1 | if $Config{useithreads} eq 'define'; print F q|#define LOCAL_PERL_USE_5005THREADS 1 | if $Config{use5005threads} eq 'define'; close F; ################ build family definitions do 'inst/netsymbols.pl'; ## END ######### build family definitions sub MY::top_targets { package MY; my $begin = q| config :: config.h @$(NOOP) config.h : $(SHELL) configure |; my $inherited = shift->SUPER::top_targets(@_); # whatever additional change, additions that may be needed $begin . $inherited; } WriteMakefile(%makeparms); Net-Interface-1.012/ni_lifreq.c0000644000000000000120000002475711154562460015122 0ustar rootwheel /* ******************************************************************** * * ni_lifreq.c version 0.05 3-7-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * * * DESCRIPTION Accessor functions for 'lifconf' and 'lifreq' * */ #include "localconf.h" #ifdef HAVE_STRUCT_LIFREQ #ifndef LIFC_TEMPORARY #define LIFC_TEMPORARY 0 #endif #ifndef LIFC_ALLZONES #define LIFC_ALLZONES 0 #endif static int _ni_get_ifaddrs(int fd, struct ifaddrs * thisif, struct lifreq * ifr,...) { int cmd; if (ioctl(fd,SIOCGLIFFLAGS,ifr) < 0) return -1; thisif->ifa_flags = (u_int)(ifr->lifr_flags & 0xFFFFu); if (ioctl(fd,SIOCGLIFNETMASK,ifr) != -1) { if ((thisif->ifa_netmask = ni_memdup(&(ifr->lifr_addr), SA_LEN(((struct sockaddr *)&ifr->lifr_addr)))) == NULL) return -1; } if (thisif->ifa_flags & (IFF_POINTOPOINT | IFF_BROADCAST)) { if (thisif->ifa_flags & IFF_POINTOPOINT) cmd = SIOCGLIFDSTADDR; else cmd = SIOCGLIFBRDADDR; if (ioctl(fd,cmd,ifr) != -1) { if ((thisif->ifa_dstaddr = ni_memdup(&(ifr->lifr_addr), SA_LEN(((struct sockaddr *)&ifr->lifr_addr)))) == NULL) return -1; } } return 0; } /* nifp points to me */ static int ni_lifreq_gifaddrs(struct ifaddrs **ifap, struct ni_ifconf_flavor * nifp) { struct lifconf ifc; struct lifreq * ifr; struct ifaddrs * thisif, * lastif = NULL; struct sockaddr * sa; int fd, af, inc, ret, n; *ifap = NULL; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return errno; if (nifp->getifreqs(fd,&ifc) == NULL) { close(fd); return errno; } ifr = ifc.lifc_req; for (n = 0; n < ifc.lifc_len; n += sizeof(struct lifreq)) { if ((thisif = calloc(1, sizeof(struct ifaddrs))) == NULL) { errno = ENOMEM; goto error_out; } if (lastif == NULL) /* taken care of in init statement */ *ifap = thisif; else lastif->ifa_next = thisif; if ((thisif->ifa_name = strdup(ifr->lifr_name)) == NULL) { errno = ENOMEM; goto error_out; } af = ifr->lifr_addr.ss_family; if ((thisif->ifa_addr = ni_memdup(&(ifr->lifr_addr), SA_LEN(((struct sockaddr *)&ifr->lifr_addr)))) == NULL) goto error_out; if (af == AF_INET) { fd = ni_clos_reopn_dgrm(fd,af); if (_ni_get_ifaddrs(fd,thisif,ifr) < 0) goto error_out; } /* == AF_INET */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 else if (af == AF_INET6) { fd = ni_clos_reopn_dgrm(fd,af); if (_ni_get_ifaddrs(fd,thisif,ifr) < 0) goto error_out; } /* == AF_INET6 */ #endif /* for AF_LINK, AF_PACKET nothing is used except the contents of the addr record */ lastif = thisif; ifr = (struct lifreq *)((char *)ifr + sizeof(struct lifreq)); } close(fd); free(ifc.lifc_req); /* free ifreq */ return nifp->ni_type; /* return family type */ error_out: ret = errno; /* preserve errno */ free(ifc.lifc_req); ni_freeifaddrs(*ifap); close(fd); errno = ret; return -1; } static void * _ni_getifreqs(int fd, void * vifc) { int n, af, size; struct lifconf * ifc = vifc; struct lifnum lifn; void * buf; bzero(ifc,sizeof(struct lifconf)); errno = ENOSYS; n = 2; buf = NULL; while (1) { size = n * PAGE_SIZE; if (size > NI_IFREQ_MEM_MAX) { free(buf); errno = ENOMEM; return NULL; } buf = realloc(buf, size); if (buf == NULL) { free(ifc->lifc_buf); errno = ENOMEM; return NULL; } ifc->lifc_family = AF_UNSPEC; ifc->lifc_flags = LIFC_NOXMIT | LIFC_TEMPORARY | LIFC_ALLZONES; ifc->lifc_buf = buf; ifc->lifc_len = size; if (ioctl( fd, SIOCGLIFCONF, ifc) < 0 && errno != EINVAL) { free(buf); return NULL; } if (ifc->lifc_len < size - PAGE_SIZE) break; n *= 2; /* printf("n %d, len %d, buf %d, ifclen %d, ifr %u\n",size,buf,ifc->lifc_len,ifc->lifc_req); */ } return ifc->lifc_req; } static void _ni_common_flags(u_int64_t flags) { int i, n; #include "ni_IFF_inc.c" if (flags & IFF_UP) printf("UP "); else printf("DOWN "); n = sizeof(ni_iff_tab) / sizeof(ni_iff_t); for (i=0;ilifr_addr.ss_family; printf("%s\t",ifr->lifr_name); if (af == AF_INET) { fd = ni_clos_reopn_dgrm(fd,AF_INET); if (ioctl(fd, SIOCGLIFFLAGS,ifr) != -1) { flags = ifr->lifr_flags; printf("flags=%0llx<",flags); _ni_common_flags(flags); if (flags == 0) printf(" "); printf("\b> "); } if (ioctl(fd,SIOCGLIFMETRIC,ifr) != -1 ); printf("metric %d ",ifr->lifr_metric); if (ioctl(fd,SIOCGLIFMTU,ifr) != -1 ) printf("mtu %d",ifr->lifr_mtu); printf("\n\t"); if (ioctl(fd,SIOCGLIFADDR,ifr) != -1 ) { sin = (struct sockaddr_in *) &ifr->lifr_addr; #ifdef HAVE_GETNAMEINFO if (getnameinfo(&sin->sin_addr, LOCAL_SIZEOF_SOCKADDR_IN,namebuf,NI_MAXHOST,NULL,0,NI_NUMERICHOST) != 0) #endif strcpy(namebuf,inet_ntoa(sin->sin_addr)); printf("address %s\t",namebuf); } if (ioctl(fd,SIOCGLIFNETMASK,ifr) != -1 ) { sin = (struct sockaddr_in *) &ifr->lifr_addr; printf("mask 0x%lx\t",(unsigned long)ntohl(sin->sin_addr.s_addr)); } /* want to include here.... flags & IFF_BROADCAST */ if (ioctl(fd,SIOCGLIFBRDADDR,ifr) != -1) { sin = (struct sockaddr_in *) &ifr->lifr_addr; strcpy(namebuf,inet_ntoa(sin->sin_addr)); printf("netmask %s\t",namebuf); } } else if (af == AF_INET6) { fd = ni_clos_reopn_dgrm(fd,AF_INET6); if (ioctl(fd,SIOCGLIFADDR,ifr) != -1 ) { sin6 = (struct sockaddr_in6 *)&ifr->lifr_addr; #ifdef HAVE_GETNAMEINFO if (getnameinfo(&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN6,namebuf,NI_MAXHOST,NULL,0,NI_NUMERICHOST) != 0) #endif strcpy(namebuf,inet_ntop(AF_INET6,&sin6->sin6_addr,namebuf,NI_MAXHOST)); namegood = 1; } if (ioctl(fd,SIOCGLIFFLAGS,ifr) < 0 ) { printf("\nflags error: %d %s",errno, strerror(errno)); } else { flags = ifr->lifr_flags; printf("flags=%0llx<",flags); _ni_common_flags(flags); if (flags == 0) printf(" "); printf("\b> "); } if (ioctl(fd,SIOCGLIFMETRIC,ifr) != -1 ); printf("metric %d ",ifr->lifr_metric); if (ioctl(fd,SIOCGLIFMTU,ifr) != -1 ) printf("mtu %d",ifr->lifr_mtu); } printf("\n\t"); if (namegood) printf("address %s\n\t",namebuf); printf("af=%d sz=%d ",af,sizeof(struct lifreq)); #if defined SIOCENADDR if (ioctl(fd,SIOCENADDR,ifr) != -1) macgood = 1; #endif if (macgood == 1) macp = (unsigned char *)&ifr->lifr_enaddr; else { strlcpy(mifr.ifr_name,ifr->lifr_name,IFNAMSIZ); close(fd); fd = -1; if ((macp = ni_fallbackhwaddr(af,&mifr)) != NULL) macgood = 1; } if (macgood) printf("MAC addr %02X:%02X:%02X:%02X:%02X:%02X", macp[0],macp[1],macp[2],macp[3],macp[4],macp[5]); printf("\n"); ifr++; } close(fd); free(lifc.lifc_req); return 0; } static struct ni_ifconf_flavor ni_flavor_lifreq = { .ni_type = NI_LIFREQ, .siocgifindex = SIOCGLIFINDEX, .siocsifaddr = SIOCSLIFADDR, .siocgifaddr = SIOCGLIFADDR, .siocdifaddr = SIOCLIFREMOVEIF, .siocaifaddr = SIOCLIFADDIF, .siocsifdstaddr = SIOCSLIFDSTADDR, .siocgifdstaddr = SIOCGLIFDSTADDR, .siocsifflags = SIOCSLIFFLAGS, .siocgifflags = SIOCGLIFFLAGS, .siocsifmtu = SIOCSLIFMTU, .siocgifmtu = SIOCGLIFMTU, .siocsifbrdaddr = SIOCSLIFBRDADDR, .siocgifbrdaddr = SIOCGLIFBRDADDR, .siocsifnetmask = SIOCGLIFNETMASK, .siocgifnetmask = SIOCGLIFNETMASK, .siocsifmetric = SIOCSLIFMETRIC, .siocgifmetric = SIOCGLIFMETRIC, .ifr_offset = NI_LIFREQ_OFFSET, .gifaddrs = ni_lifreq_gifaddrs, .fifaddrs = ni_freeifaddrs, .refreshifr = NULL, .getifreqs = _ni_getifreqs, .developer = ni_flav_lifreq_developer, }; void ni_lifreq_ctor() { ni_ifcf_register(&ni_flavor_lifreq); } #else void ni_lifreq_ctor() { return; } #endif /* have lifreq */ Net-Interface-1.012/lib/0000755000000000000000000000000011345243332013405 5ustar rootrootNet-Interface-1.012/lib/Net/0000755000000000000000000000000011345243332014133 5ustar rootrootNet-Interface-1.012/lib/Net/Interface/0000755000000000000000000000000011345243332016033 5ustar rootrootNet-Interface-1.012/lib/Net/Interface/Developer.pm0000644000000000000120000003513711306547202020453 0ustar rootwheelpackage Net::Interface::Developer; use vars qw($VERSION); $VERSION = '0.03'; =pod =head1 NAME Net::Interface::Developer api, notes, hints =head1 DESCRIPTION This contains development notes and API documentation for the Net::Interface module. It is hoped that others will help fill in the missing pieces for OS's and address families that are currently unsupported. =head1 ARCHITECTURE Net::Interface gathers information about the network interfaces in an OS independent fashion by first attempting to use C if C is not supported on the OS it falls back to using system C and the C structures defined on the local host. Linux differs somewhat since ipV6 information is available only directly from the kernel on older versions where C is not available. The C and friends information is used to generate a C response. Herein lies the need for continued development by the opensource community. Many OS's have peculiar C variants and SIOC's variants that require unique code solutions. I'm sure that all of them are not presently included. Net::Interface is built in 5 layers, listed below from the base up. =head2 description: files code =head2 1) AF_xxx families: ni_af_inetcommon.c (C) Code modules for AF families. Currently supported are AF_INET, AF_INET6. There is partial support for AF_LINK and AF_PACKET for retrieval of MAC address from the interface where it is needed. Where the code is reasonably universal for a particular address family and the methods used to retrieve the information from the OS, it resides in an af_xxxx.c file. =head2 2) IFREQ families: ni_xx_ifreq.c (C) Code modules for IFREQ families. Currently supported are: =over 2 =item * C ni_ifreq.c Provides support for retrieval of ipV4 information. The structure C does not provide enough space to return data about socket address families larger than C. All known operating systems support this flavor of data retrieval. ni_ifreq.c makes use of calls to ni_af_inet.c =item * C ni_in6_ifreq.c Provides support for retrieval of both ipV4 and ipV6 information. C uses C rather than the smaller C that is used in C. This code modules support variants of the BSD operating system and a few others. ni_in6_ifreq makes use of calls to ni_af_inetcommon.c =item * C ni_lifreq.c Provides support for retrieval of both ipV4 and ipV6 information. C has a custom format unique to the SUN operating systems. Pretty much everything in it, while similar to the two previous code modules, is custom. =item * C ni_linuxproc.c Provides support for retrieval of both ipV4 and ipV6 information. C uses calls to ni_af_inet.c to get ipV4 information int C format and custom code to collect similarly formatted ipV6 information directly from the /proc file system. It then performs a merge on these two data sets to put them into proper order and add B AF_LINK or AF_PACKET records to provide C compatiable access to the MAC address through the returned C array. =back =head2 3) C ni_getifaddrs.c (C) The C code module contains the decision mechanism for how data is retrieved for a particular build of Net::Interface. At build time, portions of the code are #ifdef'd in/out depending on the availabiltiy of resource from the underlying OS. In addition, at run time, if the system does not have native C then a decision tree is used depending on the response to calls for data to the various code modules described in section 2). =head2 4) Sub-system Interface.xs (PERLXS) This file asks for the data about the interfaces with a generic call to C. The data returned resides in memory allocated by the OS and must be freed or a memory leak will result as it is not tracked by Perl's garbage collector. C moves the interface data from allocated memory to Perl managed memory where it can be reclaimed by the garbage collection mechanism if/when the user space program turns it loose. This eliminates the need for a C operation to free the OS's allocated memory. =head2 5) User space Interface.pm (Perl) =head1 DATA FLOW BLOCK DIAGRAM The pure perl portion of this module performs most of the presentation operations for the user that are published in the API for Net::Interface. *\ \ \ | / / /* * user space * ************************* ^ Net::Interface | Architecture Block Diagram v ************************* * Interface.pm * ************************* | ************************* * Interface.xs * ************************* | ************************* ************************* * system getifaddrs * * ni_getifreqs * * via *<-if missing ->* via * * (ni_getifaddrer.c) * * (ni_ifreq.c) * ************************* * (ni_lifreq.c) * * (ni_in6_ifreq.c) * * (ni_linuxproc.c) * ************************* | ************************* * (ni_af_inetcommon.c) * ************************* =head1 DEVELOPER API Access to the pieces of code in the block diagram above are available through a developer API. These codes snippets from Interfaces.xs describe the access. void __developer(ref) SV *ref ALIAS: d_ni_ifreq = NI_IFREQ d_ni_lifreq = NI_LIFREQ d_ni_in6_ifreq = NI_IN6_IFREQ d_ni_linuxproc = NI_LINUXPROC PREINIT: char * process; int er = ni_developer(ix); B void gifaddrs_base(ref) SV * ref ALIAS: # base = 0 gifa_ifreq = NI_IFREQ gifa_lifreq = NI_LIFREQ gifa_in6_ifreq = NI_IN6_IFREQ gifa_linuxproc = NI_LINUXPROC PREINIT: struct ifaddrs * ifap; int rv; CODE: if ((rv = ni_getifaddrs(&ifap,ix)) == -1) { printf("failed PUNT!\n"); XSRETURN_EMPTY; Both function sets result in a printed description to the terminal window to facilitate code creation and debug. Currently the B is unused. It is expected that future developement will modify or add to function access. # test.pl for developer # use strict; use Net::Interface; # to call OS native getifaddrs if present print "\nifreq\n"; gifaddrs_base Net::Interface(); # to call ni_linuxproc fallback getifaddrs print "\nlxp\n"; gifa_linuxproc Net::Interface(); # to call ni_linuxproc ifreq emulation print "\nglxp\n"; d_ni_linuxproc Net::Interface(); See: test.pl.developer =head1 DEVELOPER API DESCRIPTION If you have gotten this far, it is time to read some of the code. AF_familes and IFREQ_families are accessed through constuctor structs found at the bottom of each of the ni_af_xxx and ni_xx_ifreq source files. Their vectoring components are described in C near the bottom and in C in the section labeled B the essence of which is described here. struct ni_ifconf_flavor * ni_ifcf_get(enum ni_FLAVOR type) struct ni_ifconf_flavor * ni_safe_ifcf_get(enum ni_FLAVOR type); nifp = ni_ifcf_get(NI_IFREQ); Returns a pointer C to the structure for a particular flavor of B. If a flavor is unsupported on a particular architecture a NULL is returned by the first invocation and NI_IFREQ by the second. Currently supported flavors are: enum ni_FLAVOR { NI_NULL, reserved for the getifaddrs base system call NI_IFREQ, NI_LIFREQ, NI_IN6_IFREQ, NI_LINUXPROC }; struct ni_ifconf_flavor { enum ni_FLAVOR ni_type; int (*gifaddrs) int siocgifindex; int siocsifaddr; int siocgifaddr; int siocdifaddr; int siocaifaddr; int siocsifdstaddr; int siocgifdstaddr; int siocsifflags; int siocgifflags; int siocsifmtu; int siocgifmtu; int siocsifbrdaddr; int siocgifbrdaddr; int siocsifnetmask; int siocgifnetmask; int siocsifmetric; int siocgifmetric; int ifr_offset; void (*fifaddrs) howto free ifaddrs int (*refreshifr) howto refresh ifreq void * (*getifreqs) howto get ifreq int (*developer) developer access struct ni_ifconf_flavor * ni_ifcf_next; }; =head1 MACROS =over 4 =item NI_PRINT_MAC(u_char * hex_mac_string); printf statement for terminal output of the form XX:XX:XX:XX:XX:XX:XX:XX =item NI_MAC_NOT_ZERO(u_char * hex_mac_string) if( NI_MAC_NOT_ZERO(macp)) do something =item NI_PRINT_IPV6(struct sin6_addr); Takes an agrument of the form sockaddr_in6.sin6_addr and prints XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX =back =head1 FUNCTIONS =over 4 =item int ni_clos_reopn_dgrm(int fd, int af) Closes and then opens an C socket of type SOCK_DGRAM and returns the socket value. If the socket value is NEGATIVE, no close is attempted an the call is equivalent to: socket(af,SOCK_DGRAM,0) =item void ni_gifa_free(struct ifaddrs * ifap, int flavor) Use the appropriate free memory function call depending on the flavor of the getifaddrs function that returned the ifaddrs structure list. =item int nifreq_gifaddrs(struct ifaddrs **ifap, struct ni_ifconf_flavor *nifp) Our semi-standard version of C used by OS's that provide C and C. NOTE: all calls to C return -1 on failure and and the FLAVOR as enumerated above on success. i.e. NI_NULL for the native getifaddrs, NI_IFREQ, NI_LINUXPROC, etc... =item uint32_t ni_ipv6addr_gettype(struct in6_addr * in6p) Extracts information about the type of ipV6 address. The returned value may be passed to the NEXT function call to print. =item int ni_lx_map2scope(int lscope) This function maps I style scope bits to their RFC-2373 equivalent. scope flags rfc-2373 0 reserved 1 node-local (aka loopback, interface-local) 2 link-local 3 unassigned 4 unassigned 5 site-local 6 unassigned 7 unassigned 8 organization-local 9 unassigned A unassigned B unassigned C unassigned D unassigned E global scope F reserved Linux rfc-2372 0x0000 0xe GLOBAL 0x0010u 0x1 NODELOCAL, LOOPBACK, INTERFACELOCAL 0x0020u 0x2 LINKLOCAL 0x0040u 0x5 SITELOCAL =item void ni_linux_scope2txt(uint32_t type) Print information about an ipV6 address for each bit present in C. const ni_iff_t ni_lx_type2txt[] = { { IPV6_ADDR_ANY, "unknown" }, { IPV6_ADDR_UNICAST, "unicast" }, { IPV6_ADDR_MULTICAST, "multicast" }, { IPV6_ADDR_ANYCAST, "anycast" }, { IPV6_ADDR_LOOPBACK, "loopback" }, { IPV6_ADDR_LINKLOCAL, "link-local" }, { IPV6_ADDR_SITELOCAL, "site-local" }, { IPV6_ADDR_COMPATv4, "compat-v4" }, { IPV6_ADDR_SCOPE_MASK, "scope-mask" }, { IPV6_ADDR_MAPPED, "mapped" }, { IPV6_ADDR_RESERVED, "reserved" }, { IPV6_ADDR_ULUA, "uniq-lcl-unicast" }, { IPV6_ADDR_6TO4, "6to4" }, { IPV6_ADDR_6BONE, "6bone" }, { IPV6_ADDR_AGU, "global-unicast" }, { IPV6_ADDR_UNSPECIFIED, "unspecified" }, { IPV6_ADDR_SOLICITED_NODE, "solicited-node" }, { IPV6_ADDR_ISATAP, "ISATAP" }, { IPV6_ADDR_PRODUCTIVE, "productive" }, { IPV6_ADDR_6TO4_MICROSOFT, "6to4-ms" }, { IPV6_ADDR_TEREDO, "teredo" }, { IPV6_ADDR_ORCHID, "orchid" }, { IPV6_ADDR_NON_ROUTE_DOC, "non-routeable-doc" } }; =item int ni_sizeof_type2txt() Returns the size of the above table. =item u_int ni_get_scopeid(struct sockaddr_in6 * sin6) On systems using KAME, this function extracts and returns the scope from field 2 of the ipV6 address and sets fields 2,3 to zero. On all other systems it returns sin6->sin6_scopeid scope flags rfc-2373 0 reserved 1 node-local 2 link-local 3 unassigned 4 unassigned 5 site-local 6 unassigned 7 unassigned 8 organization-local 9 unassigned A unassigned B unassigned C unassigned D unassigned E global scope F reserved =item void * ni_memdup(void *memp, int size) Allocate memory of for B and copy contents from B. Returns NULL on error and sets B to ENOMEM. =item void ni_plen2mask(void * in_addr, int plen, int sizeofaddr) Create a NETMASK string from a prefix length For ipV4: ni_plen2mask(&in_addr, cidr, sizeof(struct in_addr)); For ipV6: ni_plen2mask(&in6_addr, cidr, sizeof(struct in6_addr)); =item int ni_prefix(void * ap, int len, int size) Calculated the prefix length for a NETMASK where *ap points to the binary representation of the NETMASK and size is the number of bytes in the mask. For ipV4: ni_prefix(&in_addr,sizeof(struct in_addr)); For ipV6: ni_prefix(&in6_addr,sizeof(struct(in6_addr)); =item int ni_refresh_ifreq(int fd, struct ifconf *ifc, void **oifr, void **olifr, struct ni_ifconf_flavor * nifp) Some OS lose scope on the particular device/addr handle when certain ioctl's are performed. This function refreshs the ifconf chain and positions the pointers in the exact same spot with fresh scope. See ni_in6_ifreq.c and ni_af_net6.c for usage. Search for the string B. Code snippit looks like: nifp->refreshir =head1 COPYRIGHT Copyright 2008-2009 - Michael Robinton 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, 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 in the file named "Copying" for more details. 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. 59 Temple Place, Suite 330 Boston, MA 02111-1307, USA or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =cut 1; Net-Interface-1.012/ni_fixups.h0000644000000000000120000002375111151353505015147 0ustar rootwheel /* ******************************************************************** * * ni_fixups.h version 0.02 2-25-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #ifndef _NI_FIXUPS_H #define _NI_FIXUPS_H 1 #ifndef HAVE_CADDR_T #error 'caddr_t' undefined on this platform #endif /* **************************************************** * * if this OS has buggy memory allocation, fix it * * **************************************************** */ #if HAVE_MALLOC == 0 || HAVE_REALLOC == 0 #undef malloc #undef calloc #undef realloc #undef free void * ni_rpl_malloc(); void * ni_rpl_calloc(); void * ni_rpl_realloc(); void ni_rpl_free(); #define malloc ni_rpl_malloc #define calloc ni_rpl_calloc #define realloc ni_rpl_realloc #define free ni_rpl_free #warning FUNCTIONS calloc, malloc, realloc, free re-defined because of buggy C lib #endif /* HAVE_MALLOC == 0 || HAVE_REALLOC == 0 */ /* **************************************************** * * If field sa_len is missing and there is * * no OS supplied work-around, do it here * * **************************************************** */ #ifndef SA_LEN # ifndef HAVE_SA_LEN static int __libc_sa_len (const sa_family_t af) { switch(af) { # ifdef LOCAL_SIZEOF_SOCKADDR_IN case AF_INET: return LOCAL_SIZEOF_SOCKADDR_IN; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_AT case AF_APPLETALK: return LOCAL_SIZEOF_SOCKADDR_AT; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_ASH case AF_ASH: return LOCAL_SIZEOF_SOCKADDR_ASH; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_X25 case AF_X25: return LOCAL_SIZEOF_SOCKADDR_X25; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_EC case AF_ECONET: return LOCAL_SIZEOF_SOCKADDR_EC; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_IN6 case AF_INET6: return LOCAL_SIZEOF_SOCKADDR_IN6; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_IPX case AF_IPX: return LOCAL_SIZEOF_SOCKADDR_IPX; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_UN case AF_LOCAL: /* also AF_UNIX, AF_FILE */ return LOCAL_SIZEOF_SOCKADDR_UN; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_LL case AF_PACKET: return LOCAL_SIZEOF_SOCKADDR_LL; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_ROSE case AF_ROSE: return LOCAL_SIZEOF_SOCKADDR_ROSE; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_DL case AF_LINK: return LOCAL_SIZEOF_SOCKADDR_DL; # endif /* This one is the same as AF_INET * #ifdef LOCAL_SIZEOF_SOCKADDR_INARP * case AF_ * return LOCAL_SIZEOF_SOCKADDR_INARP; * #endif */ /* Multiple socket families use ISO, some conflict */ # ifdef LOCAL_SIZEOF_SOCKADDR_ISO case AF_ISO: return LOCAL_SIZEOF_SOCKADDR_ISO; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_TP case AF_ISO: return LOCAL_SIZEOF_SOCKADDR_TP; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_EON case AF_ISO: return LOCAL_SIZEOF_SOCKADDR_EON; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_OSITP case AF_ISO: return LOCAL_SIZEOF_SOCKADDR_OSITP; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_NS case AF_NUTSS: return LOCAL_SIZEOF_SOCKADDR_NS; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_AX25 case AF_AX25: return LOCAL_SIZEOF_SOCKADDR_AX25; # endif # ifdef LOCAL_SIZEOF_SOCKADDR_DECnet case AF_DECnet: return LOCAL_SIZEOF_SOCKADDR_DECnet; # endif } return 0; } # define SA_LEN(sa) __libc_sa_len((sa)->sa_family) # else # define SA_LEN(sa) ((sa)->sa_len) # endif #endif /* **************************************************** * * If the OS does not supply _SIZE_OF_ADDR_IFREQ use * * this universal model for ifreq, in6_ifreq, lifreq * * **************************************************** */ #ifdef _SIZEOF_ADDR_IFREQ int ni_SIZEOF_ADDR_IFREQ(struct ifreq * ifrp,struct sockaddr * sa,int size); #else #define ni_SIZEOF_ADDR_IFREQ(ifr,sa,size) \ (SA_LEN(sa) > sizeof(struct sockaddr) ? \ size - sizeof(struct sockaddr) + SA_LEN(sa) : size) #endif /* **************************************************** * * If local libc does not have 'strlcpy', 'memcmp' * * some openbsd / sparc systems are missing memcmp, * * strlcpy is missing in a lot of places * * **************************************************** */ #ifndef HAVE_STRLCPY #include "ni_strlcpy.h" #endif #ifndef HAVE_MEMCMP #include "ni_memcmp.h" #endif /* **************************************************** * * define if_data if it is missing * * **************************************************** */ #ifndef HAVE_STRUCT_IF_DATA #define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ #define LINK_STATE_DOWN 1 /* link is down */ #define LINK_STATE_UP 2 /* link is up */ /* ************************************************************ * * Structure describing information about an interface * * which may be of interest to management entities. * * * * THIS STRUCT IS INCOMPLETE, INSTATNIATE WITH CARE * * ************************************************************ */ struct if_data { /* generic interface information */ u_char ifi_type; /* ethernet, tokenring, etc */ u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ u_char ifi_addrlen; /* media address length */ u_char ifi_hdrlen; /* media header length */ u_char ifi_link_state; /* current link state */ u_char ifi_spare_char1; /* spare byte */ u_char ifi_spare_char2; /* spare byte */ u_char ifi_datalen; /* length of this data struct */ u_long ifi_mtu; /* maximum transmission unit */ u_long ifi_metric; /* routing metric (external only) */ u_long ifi_baudrate; /* linespeed */ /* ************************************************************ * * incomplete -- this struct is longer but the remaining * * data is volitile and we will never use it, thus * * we don't need to know for this application. * * ************************************************************ */ }; #endif /* HAVE_STRUCT_IF_DATA */ /* **************************************************** * * define getifaddrs if the OS does not have one * * **************************************************** */ #ifndef HAVE_IFADDRS_H /* some of the structure members have names * that conflict with definitions in * for "struct ifaddr", don't need those here... */ # ifdef ifa_next # undef ifa_next # endif # ifdef ifa_name # undef ifa_name # endif # ifdef ifa_flags # undef ifa_flags # endif # ifdef ifa_addr # undef ifa_addr # endif # ifdef ifa_netmask # undef ifa_netmask # endif # ifdef ifa_dstaddr # undef ifa_dstaddr # endif # ifdef ifa_data # undef ifa_data # endif struct ifaddrs { struct ifaddrs *ifa_next; char *ifa_name; u_int ifa_flags; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; struct sockaddr *ifa_dstaddr; void *ifa_data; }; #endif /* not defined HAVE_IFADDRS_H */ void ni_freeifaddrs(struct ifaddrs *ifp); #ifndef HAVE_IFADDRS_H #define getifaddrs(__ifap) ni_getifaddrs(__ifap,0) #define freeifaddrs ni_freeifaddrs #endif #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 /* **************************************************** * * define missing IPV6 filter macros if needed * * **************************************************** */ /* * Unspecified */ #ifndef IN6_IS_ADDR_UNSPECIFIED #define IN6_IS_ADDR_UNSPECIFIED(a) ( \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[12])) == 0) #endif /* * Loopback */ #ifndef IN6_IS_ADDR_LOOPBACK #define IN6_IS_ADDR_LOOPBACK(a) ( \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[8])) == 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)) #endif /* * IPv4 compatible */ #ifndef IN6_IS_ADDR_V4COMPAT #define IN6_IS_ADDR_V4COMPAT(a) ( \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[8])) == 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)) #endif /* * Mapped */ #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) ( \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) | \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[4])) == 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000FFFF)) #endif #endif /* LOCAL_SIZEOF_SOCKADDR_IN6 */ #endif /* _NI_FIXUPS_H */ Net-Interface-1.012/inst/0000755000000000000000000000000011345243332013614 5ustar rootrootNet-Interface-1.012/inst/netsymbols.pl0000755000000000000120000004230011161773502016501 0ustar rootwheel#!/usr/bin/perl # # ##################################################################### # # netsymbols.pl version 0.09 3-23-09, michael@bizsystems.com # # # # # # COPYRIGHT 2008-2009 Michael Robinton # # # # 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. # # 59 Temple Place, Suite 330 # # Boston, MA 02111-1307, USA # # # # or visit their web page on the internet at: # # # # http://www.gnu.org/copyleft/gpl.html. # # ##################################################################### # use Config; #use diagnostics; ### generate AF/PF families # list of troublesome symbols to ignore my @donotuse = qw( AF_NETGRAPH PF_NETGRAPH ); # list of wanted AF/PF symbols, ignore the rest # this list should reflect the SOCKADDR's present # in the header file "ni_fixups.h" plus a few symbols # my @wantafsyms = qw( AF_UNSPEC AF_INET AF_INET6 AF_LOCAL AF_FILE AF_UNIX AF_MAX AF_PACKET AF_ROUTE AF_APPLETALK AF_ASH AF_X25 AF_ECONET AF_IPX AF_ROSE AF_LINK AF_ISO AF_NUTSS AF_AX25 AF_DECnet PF_UNSPEC PF_INET PF_INET6 PF_LOCAL PF_FILE PF_UNIX PF_MAX PF_PACKET PF_ROUTE PF_APPLETALK PF_ASH PF_X25 PF_ECONET PF_IPX PF_ROSE PF_LINK PF_ISO PF_NUTSS PF_AX25 PF_DECnet ); my(@slurp,%slurped,%fam,%unique); my $endv = 0; # maximum value found in defines sub cleanslurp { undef @slurp; %slurped = (); } sub slurp { my $in = shift; #print STDERR "slurping $in\n"; return if $slurped{$in}; $slurped{$in} = 1; local *F; open (F,$Config{usrinc} .'/'. $in) or return; my @new = ; close F; push @slurp, @new; } # input: hash pointer, # unique hash pointer or false # regular expression, # secondary regexp if enum (else undef) # sub fill { my($hp,$unique,$rgx1,$rgx2) = @_; my %enum; # enumeration cache foreach(@slurp) { if ($_ =~ /^#\s*include\s+\<\s*([^\s>]+)/) { slurp($1); next; } if ($rgx2 && $_ =~ /$rgx2/) { my $pri = $1; my $sec = $2; #print STDERR "IFF pri=$pri, sec=$sec\n"; next if $2 =~ /[^0-9x]/; # must be numeric or hex $sec = eval "$sec"; $enum{$pri} = $sec; $endv = $sec if $endv < $sec; # track maximum value next; } next unless $_ =~ /$rgx1/; my $pri = $1; my $sec = $2; #print STDERR "pri=$pri, sec=$sec\n"; if ($rgx2 && exists $enum{$pri} && $pri eq $sec) { $hp->{$pri} = $enum{$pri}; next; } elsif ($sec =~ /[^0-9x]/) { # if this is not a number next unless exists $hp->{$sec}; # should not happen $hp->{$pri} = $hp->{$sec}; } else { $sec = eval "$sec"; $hp->{$pri} = $sec; $endv = $sec if $endv < $sec; # track maximum value next unless $unique; next if exists $unique->{$sec}; #print STDERR "unique $sec\t=> $pri\n"; $unique->{$sec} = $pri; # track 1st definition } } } # input: filehandle, # symbol hash # array of symbols synonyms # sub extradef { my($F,$sym,@syn) = @_; #print STDERR "extra defs @syn\n"; my $x; foreach(0..$#syn) { # check each synonym if (exists $sym->{$syn[$_]}) { $x = $_; last; } } #print STDERR qq|\n\tadvisory warning\n"@syn"\n\tnot defined\n| unless defined $x; return unless defined $x; # define all undefined synonyms # foreach(0..$#syn) { next if $_ == $x; my $newsym = $syn[$_]; print $F "#ifndef $newsym\n# define $syn[$_] $syn[$x]\n#endif\n"; $sym->{$newsym} = $sym->{$syn[$x]}; } } cleanslurp(); slurp('sys/socket.h'); # parse sys/socket.h and its #includes fill(\%fam,\%unique,'^#\s*define\s+((?:A|P)F_[^\s]+)\s+([^\s]+)'); # repeat in case symbol dependencies are out of order cleanslurp(); slurp('sys/socket.h'); fill(\%fam,'','^#\s*define\s+((?:A|P)F_[^\s]+)\s+([^\s]+)'); my %ifs; cleanslurp(); slurp('net/if.h'); slurp('netinet/in.h') if -e '/usr/include/netinet/in.h'; slurp('netinet/in_var.h') if -e '/usr/include/netinet/in_var.h'; fill(\%ifs,'','^#\s*define\s+(IF[^\s]+)\s+([^\s]+)','(IF[^\s]+)\s*\=\s*([^\s,]+)'); fill(\%ifs,'','^#\s*define\s+(IN6_IF[^\s]+)\s+([^\s]+)','(IN6_IF[^\s]+)\s*\=\s*([^\s,]+)'); slurp('net/if.h'); slurp('netinet/in.h') if -e '/usr/include/netinet/in.h'; slurp('netinet/in_var.h') if -e '/usr/include/netinet/in_var.h'; fill(\%ifs,'','^#\s*define\s+(IF[^\s]+)\s+([^\s]+)','(IF[^\s]+)\s*\=\s*([^\s,]+)'); fill(\%ifs,'','^#\s*define\s+(IN6_IF[^\s]+)\s+([^\s]+)','(IN6_IF[^\s]+)\s*\=\s*([^\s,]+)'); # dispose of troublesome symbols my %ru = reverse %unique; foreach my $symhsh (\%ifs,\%fam,\%ru) { foreach(@donotuse) { # remove the ones that cause trouble delete $symhsh->{$_} if exists $symhsh->{$_}; } } foreach my $symhsh(\%fam) { my @allsyms = keys %$symhsh; foreach my $havsym (@allsyms) { unless (grep {/$havsym/} @wantafsyms) { delete $symhsh->{$havsym}; # delete unneeded symbol here delete $ru{$havsym}; # and in unique hash } } } %unique = reverse %ru; # fill done, bump max value ++$endv; # we're going to ignore all that end value tracking because IFF's exceed I32 # I32 size. Use the max number that fits in an I32 and do IFF's another way $endv = (2**31) -1; mkdir 'lib' unless -e 'lib' && -d 'lib'; mkdir 'lib/Net' unless -e 'lib/Net' && -d 'lib/Net'; mkdir 'lib/Net/Interface' unless -e 'lib/Net/Interface' && -d 'lib/Net/Interface'; open(NFe,'>lib/Net/Interface/NetSymbols.pm') or die "could not open NetSymbols.pm for write"; open(NFx,'>netsymbolXS.inc') or die "could not open netsymbolXS.inc for write"; open(NFc,'>netsymbolC.inc') or die "could not open netsymbolC.inc for write"; open(NFt,'>ni_IFF_inc.c') or die "could not open ni_IFF_inc.c for write"; open(NFz,'>ni_XStabs_inc.c') or die "could not open ni_XStabs_inc.c for write"; print NFz q|/* BEGIN ni_XStabs_inc.c * ************************************************************ * * DO NOT ALTER THIS FILE * * IT IS WRITTEN BY Makefile.PL & inst/netsymbols.pl * * EDIT THOSE INSTEAD * * ************************************************************ * * some of these symbols may be redundant * * ************************************************************ */ |; # make defines for synonyms extradef(*NFc,\%fam,qw( PF_LOCAL PF_UNIX PF_FILE AF_LOCAL AF_FILE AF_UNIX )); # are all synonyms extradef(*NFc,\%fam,qw( PF_MAX AF_MAX )); extradef(*NFc,\%fam,qw( AF_PACKET PF_PACKET AF_ROUTE PF_ROUTE )); extradef(*NFc,\%fam,qw( AF_ISO PF_ISO AF_BRIDGE PF_BRIDGE )); # this one is not correct... extradef(*NFc,\%fam,qw( AF_NS PF_NS AF_NUTSS PF_NUTSS AF_ATM PF_ATM )); extradef(*NFc,\%ifs,qw( IFNAMSIZ IF_NAMESIZE )); # Fix missing definition print NFc "#ifndef IFHWADDRLEN\n#define IFHWADDRLEN 6\n#endif\n"; $ifs{IFHWADDRLEN} = 6; # Add opening definition print NFc qq| #define __NI_AF_TEST $endv |; print NFz q| const ni_iff_t ni_af_sym_tab[] = { |; ### populate exports print NFe q|#!|. $Config{perlpath} .q| # # DO NOT ALTER THIS FILE # IT IS WRITTEN BY Makefile.PL and inst/netsymbols.pl # EDIT THOSE INSTEAD # package Net::Interface::NetSymbols; use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.01; |; print NFx q|void _net_af_syms() ALIAS: |; ### populate IFF flags # print NFt q| /* BEGIN ni_IFF_inc.c include **************************************************************** * DO NOT ALTER THIS FILE * * IT IS WRITTEN BY Makefile.PL & inst/netsymbols.pl * * EDIT THOSE INSTEAD * **************************************************************** */ const ni_iff_t ni_iff_tab[] = { |; ### populate C portion # my @tmp = grep {/^AF/} keys %fam; # tmp store AFs my @afs = sort { $fam{$a} <=> $fam{$b} } @tmp; @tmp = grep {/^PF/} keys %fam; my @pfs = sort { $fam{$a} <=> $fam{$b} } @tmp; my @ifs = keys %ifs; # iffs are not unique so we can safely purge unwanted symbols here my @iffs = sort grep {/^IFF_/ && $_ !~ /IFF_DRV/} keys %ifs; my @iffIN6 = sort grep {/^IN6_IFF/} keys %ifs; print NFe q|my @afs = qw( |; foreach(@afs) { $_ =~ /AF_([^\s]+)/; print NFx "\t$_ = _NI_$_\n"; print NFe "\t$_\n"; print NFc qq|#ifdef $_\n\# define _NI_$_ $fam{$_}\n#else\n# define _NI_$_ $endv\n#endif\n|; print NFz qq|\t{$_,\t"|, (lc $1), qq|"},\n|; } print NFe q|); my @pfs = qw( |; foreach(@pfs) { $_ =~ /PF_([^\s]+)/; print NFx "\t$_ = _NI_$_\n"; print NFe "\t$_\n"; print NFc qq|#ifdef $_\n\# define _NI_$_ $fam{$_}\n#else\n# define _NI_$_ $endv\n#endif\n|; print NFz qq|\t{$_,\t"|, (lc $1), qq|"},\n|; } print NFz qq|\t{__NI_AF_TEST,\t"placeholder"} }; |; print NFx qq|\t_NI_AF_TEST = __NI_AF_TEST PREINIT: SV * rv; int n, i; PPCODE: if (ix >= $endv) { croak("%s is not implemented on this architecture", GvNAME(CvGV(cv))); } rv = sv_2mortal(newSViv(ix)); n = sizeof(ni_af_sym_tab) / sizeof(ni_iff_t); for (i=0; i= $endv) { croak("%s is not implemented on this architecture", GvNAME(CvGV(cv))); } RETVAL = bigsymvals[ix]; OUTPUT: RETVAL void _net_i2f_syms() ALIAS: |; $comma = ''; foreach(sort @iffs) { $_ =~ /IFF_([^\s]+)/; print NFc qq|#ifdef $_\n\# define _NI_$_ $_\n#else\n# define _NI_$_ $endv\n#endif\n|; print NFz qq|\t{$_,\t"|, (lc $1), qq|"},\n|; print NFe "\t$_\n"; # print NFx "\t$_ = _NI_$_\n"; print NFx "\t$_ = $ifidx\n"; $idxary .= "$icoma\n\t$ifs{$_}"; $ifidx++; next if $_ eq 'IFF_UP'; # special case handled separately print NFt qq|$comma\n\t\{$_,\t"$1"\}|; $comma = ','; } print NFt q| }; #ifdef HAVE_STRUCT_IN6_IFREQ const ni_iff_t ni_iff_tabIN6[] = { |; print NFe q|); my @iffIN6 = qw( |; $comma = ''; foreach(sort @iffIN6) { $_ =~ /IFF_([^\s]+)/; print NFc qq|#ifdef $_\n\# define _NI_$_ $_\n#else\n# define _NI_$_ $endv\n#endif\n|; print NFz qq|\t{$_,\t"|. (lc $1). qq|"},\n|; next if $_ eq 'IFF_UP'; # special case handled separately print NFe "\t$_\n"; # print NFx "\t$_ = _NI_$_\n"; print NFx "\t$_ = $ifidx\n"; $idxary .= "$icoma\n\t$ifs{$_}"; $ifidx++; print NFt qq|$comma\n\t\{$_,\t"$1"\}|; $comma = ','; } print NFz qq|\t{__NI_AF_TEST,\t"placeholder"} }; $idxary }; |; print NFt q| }; #endif /* END ni_IFF_inc.c include */ |; print NFe q|); my %unique = ( |; my $utxt = ''; foreach(sort {$a <=> $b} keys %unique) { $utxt .= "\t$_\t=> '". $unique{$_} ."',\n"; } print NFe $utxt, q|); my @iftype = qw( IPV6_ADDR_ANY IPV6_ADDR_UNICAST IPV6_ADDR_MULTICAST IPV6_ADDR_ANYCAST IPV6_ADDR_LOOPBACK IPV6_ADDR_LINKLOCAL IPV6_ADDR_SITELOCAL IPV6_ADDR_COMPATv4 IPV6_ADDR_SCOPE_MASK IPV6_ADDR_MAPPED IPV6_ADDR_RESERVED IPV6_ADDR_ULUA IPV6_ADDR_6TO4 IPV6_ADDR_6BONE IPV6_ADDR_AGU IPV6_ADDR_UNSPECIFIED IPV6_ADDR_SOLICITED_NODE IPV6_ADDR_ISATAP IPV6_ADDR_PRODUCTIVE IPV6_ADDR_6TO4_MICROSOFT IPV6_ADDR_TEREDO IPV6_ADDR_ORCHID IPV6_ADDR_NON_ROUTE_DOC ); my @scope = qw( RFC2373_GLOBAL RFC2373_ORGLOCAL RFC2373_SITELOCAL RFC2373_LINKLOCAL RFC2373_NODELOCAL LINUX_COMPATv4 ); @EXPORT_OK = (@afs,@pfs,@ifs,@iftype,@scope); %EXPORT_TAGS = ( all => [@afs,@pfs,@ifs,@iftype,@scope], afs => [@afs], pfs => [@pfs], ifs => [@ifs], iffs => [@iffs], iffIN6 => [@iffIN6], iftype => [@iftype], scope => [@scope], ); sub NI_ENDVAL {return |. $endv .q|}; sub NI_UNIQUE {return \%unique}; sub DESTROY {}; 1; __END__ =head1 NAME Net::Interface::NetSymbols - AF_ PF_ IFxxx type symbols =head1 SYNOPSIS This module is built for this specific architecture during the F process using F. Do not edit this module, edit F instead. This module contains symbols arrays only for use by Net::Interface, in all other respects it is NOT functional. It contains documentation and data arrays for this specific architecture. B WARNING !! usage is Net::Interface B Net::Interface::NetSymbols use Net::Interface qw( Net::Interface::NetSymbols::NI_ENDVAL(); Net::Interface::NetSymbols::NI_UNIQUE(); |; print NFe qq|@afs @pfs @ifs @iffs |; if (@iffIN6) { print NFe qq| @iffIN6 populated for BSD flavored systems :all :afs :pfs :ifs :iffs :iffIN6 :iftype :scope ); |; } else { print NFe qq| :all :afs :pfs :ifs :iffs :iftype :scope ); |; } print NFe q| =head1 DESCRIPTION All of the AF_XXX and PF_XXX symbols available in local C plus usual aliases for AF_LOCAL i.e. (AF_FILE AF_UNIX PF_LOCAL PF_FILE PF_UNIX) All of the IFxxxx and IN6_IF symbols in C and their includes. Symbols may be accessed for their numeric value or their string name. i.e. if ($family == AF_INET) do something... or print AF_INET will product the string "inet" The same holds true for: printf("family is %s",AF_INET); or sprint("family is %s",AF_INET); To print the numeric value of the SYMBOL do: print (0 + SYMBOL), "\n"; |; if (exists $fam{AF_INET6}) { print NFe q|On systems supporting IPV6, these additional symbols are available which may be applied to the address I to determine the address attributes. IPV6_ADDR_ANY unknown IPV6_ADDR_UNICAST unicast IPV6_ADDR_MULTICAST multicast IPV6_ADDR_ANYCAST anycast IPV6_ADDR_LOOPBACK loopback IPV6_ADDR_LINKLOCAL link-local IPV6_ADDR_SITELOCAL site-local IPV6_ADDR_COMPATv4 compat-v4 IPV6_ADDR_SCOPE_MASK scope-mask IPV6_ADDR_MAPPED mapped IPV6_ADDR_RESERVED reserved IPV6_ADDR_ULUA uniq-lcl-unicast IPV6_ADDR_6TO4 6to4 IPV6_ADDR_6BONE 6bone IPV6_ADDR_AGU global-unicast IPV6_ADDR_UNSPECIFIED unspecified IPV6_ADDR_SOLICITED_NODE solicited-node IPV6_ADDR_ISATAP ISATAP IPV6_ADDR_PRODUCTIVE productive IPV6_ADDR_6TO4_MICROSOFT 6to4-ms IPV6_ADDR_TEREDO teredo IPV6_ADDR_ORCHID orchid IPV6_ADDR_NON_ROUTE_DOC non-routeable-doc if ($type & IPV6_ADDR_xxxx) { print IPV6_ADDR_xxxx,"\n"; } These symbols may be equated to the I of the address. RFC2373_GLOBAL global-scope RFC2373_ORGLOCAL org-local RFC2373_SITELOCAL site-local RFC2373_LINKLOCAL link-local RFC2373_NODELOCAL loopback LINUX_COMPATv4 lx-compat-v4 if ($scope eq RFC2373_xxxx) { print RFC2373_xxxx,"\n"; } |; } print NFe q| =over 4 =item * :all Import all symbols =item * :afs Import all AF_XXX symbols =item * :pfs Import all PF_XXX symbols =item * :ifs Import all IFxxxx symbols =item * :iffs Import all IFF symbols |; if (@iffIN6) { print NFe q| =item * :iffIN6 Import all IN6_IFF symbols (BSD flavors only) |; } if (exists $fam{AF_INET6}) { print NFe q| =item * :iftype Import all IPV6 type symbols =item * :scope Import all IPV6 scope symbols |; } print NFe q| =back =head1 non EXPORT functions =over 4 =item * Net::Interface::NetSymbols::NI_ENDVAL(); Reports the highest symbol value +1 of :all symbols above. Used for testing. =item * Net::Interface::NetSymbols::NI_UNIQUE(); Returns a hash pointer to the AF_ or PF_ symbol values mapped to their character strings as defined for this architecture. i.e. |, $utxt, q| =head1 AUTHOR Michael Robinton =head1 COPYRIGHT |. ((localtime())[5] +1900) .q| Michael Robinton, all rights reserved. This library is free software. You can distribute it and/or modify it under the same terms as Perl itself. =cut 1; |; # add test element and complete print NFx qq| PREINIT: SV * rv; int n, i; PPCODE: if (ix >= $endv) { croak("%s is not implemented on this architecture", GvNAME(CvGV(cv))); } rv = sv_2mortal(newSVnv(bigsymvals[ix])); n = sizeof(ni_sym_iff_tab) / sizeof(ni_iff_t); for (i=0; i. Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Net-Interface-1.012/ni_af_inetcommon.c0000644000000000000000000002254211152052565016316 0ustar rootroot /* ******************************************************************** * * ni_af_inetcommon.c version 0.03 2-27-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "localconf.h" static int _ni_get_ifaddrs(int fd, struct ifaddrs * thisif, struct ni_ifconf_flavor * nifp, struct nifreq * ifr,...) { int cmd; if (ioctl(fd,nifp->siocgifflags,ifr) < 0) return -1; thisif->ifa_flags = ifr->ni_ushort; if (ioctl(fd,nifp->siocgifnetmask,ifr) != -1) { if ((thisif->ifa_netmask = ni_memdup(&(ifr->ni_saddr), SA_LEN((&ifr->ni_saddr)))) == NULL) return -1; } if (thisif->ifa_flags & (IFF_POINTOPOINT | IFF_BROADCAST)) { if (thisif->ifa_flags & IFF_POINTOPOINT) cmd = nifp->siocgifdstaddr; else cmd = nifp->siocgifbrdaddr; if (ioctl(fd,cmd,ifr) != -1) { if ((thisif->ifa_dstaddr = ni_memdup(&(ifr->ni_saddr), SA_LEN((&ifr->ni_saddr)))) == NULL) return -1; } } return 0; } /* ******************************************************************** * * Not all OS's that use in6_ifreq are created equal, some loose * * scope on the connection to info we want. These OS's require * * refresh. If the forth parameter (struct nifreq * ifr) is NULL * * then 'refresh' is needed for this particular OS and the args * * in the second line are valid and refresh should be called * * after ioctl operations that retrieve address information * * ******************************************************************** */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 static int _ni_get_ifaddrs6(int fd, struct ifaddrs * thisif, struct ni_ifconf_flavor * nifp, struct nifreq * ifr,...) { /* struct ifconf * ifc, void **oifr, void **olifr) */ int cmd, needrefresh = 0; struct sockaddr_in6 copy6; struct ifconf * ifc; void ** oifr, ** olifr; va_list ap; va_start(ap,ifr); if (ifr == NULL) { /* then refresh is required, second line args valid */ needrefresh = 1; ifc = (struct ifconf *)va_arg(ap,void *); oifr = va_arg(ap,void **); olifr = va_arg(ap,void **); ifr = (struct nifreq *)*oifr; } va_end(ap); #define NI_RESTORE_COPYS memcpy(&ifr->ni_saddr,©6,LOCAL_SIZEOF_SOCKADDR_IN6) if (needrefresh) memcpy(©6,&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN6); if (ioctl(fd,nifp->siocgifflags,ifr) < 0) return -1; thisif->ifa_flags = ifr->ni_ushort; if (needrefresh) { NI_RESTORE_COPYS; if (nifp->refreshifr(fd,ifc,oifr,olifr,nifp) < 0) return -1; else ifr = *oifr; } /* no support for tunnels yet */ if (ioctl(fd,nifp->siocgifnetmask,ifr) != -1) { if ((thisif->ifa_netmask = ni_memdup(&(ifr->ni_saddr), SA_LEN((&ifr->ni_saddr)))) == NULL) { return -1; } } if (needrefresh) { NI_RESTORE_COPYS; if (nifp->refreshifr(fd,ifc,oifr,olifr,nifp) < 0) { return -1; } else ifr = *oifr; } /* don't know about destinations, tunnels, etc... yet. Save this as a template * * if (thisif->ifa_flags & (IFF_POINTOPOINT | IFF_BROADCAST)) { * if (thisif->ifa_flags & IFF_POINTOPOINT) * cmd = SIOCGIFDSTADDR; * else * cmd = SIOCGIFBRDADDR; * * if (ioctl(fd,cmd,ifr) != -1) { * if ((thisif->ifa_dstaddr = ni_memdup(&(ifr->ni_saddr), * SA_LEN((&ifr->ni_saddr)))) == NULL) * return -1; * } * } */ return 0; } #endif /* **************************************************** * * some OS lose scope on the particular device/addr * * handle when certain ioctl's are performed. this * * function refreshs the ifconf chain and positions * * the pointers in the exact same spot with fresh scope * * **************************************************** */ int ni_refresh_ifreq(int fd, struct ifconf * ifc, void ** oifr, void ** olifr, struct ni_ifconf_flavor * nifp) { unsigned char copy[sizeof(struct sockaddr_storage) + IFNAMSIZ]; struct nifreq * ifr, * lifr, * cifr = (struct nifreq *)© int af, inc; /* struct sockaddr_dl * sadl, * csadl; */ inc = ni_SIZEOF_ADDR_IFREQ((struct ifreq *)*oifr,(&((struct nifreq *)*oifr)->ni_saddr),sizeof(struct ifreq)); memcpy(cifr,*oifr,inc); /* copy the current ifreq struct */ if (ifc->ifc_req != NULL) free(ifc->ifc_req); /* free the old buffer */ if (nifp->getifreqs(fd,ifc) == NULL) return -1; /* oh crap! */ ifr = (struct nifreq *)(ifc->ifc_req); lifr = (struct nifreq *)&(ifc->ifc_buf[ifc->ifc_len]); for (; ifr < lifr; ifr = (struct nifreq *)(((char *)ifr) + inc)) { inc = ni_SIZEOF_ADDR_IFREQ((struct ifreq *)ifr,(&ifr->ni_saddr),sizeof(struct ifreq)); if (strncmp(ifr->ni_ifr_name,cifr->ni_ifr_name,IFNAMSIZ)) continue; if ((af = ifr->ni_saddr.sa_family) != cifr->ni_saddr.sa_family) continue; switch (af) { case AF_INET : if (memcmp(&cifr->ni_sin.sin_addr,&ifr->ni_sin.sin_addr,sizeof(struct in_addr))) continue; goto end_loop; #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 case AF_INET6 : if (memcmp(&cifr->ni_sin6.sin6_addr,&ifr->ni_sin6.sin6_addr,sizeof(struct in6_addr))) continue; goto end_loop; #endif #ifdef LOCAL_SIZEOF_SOCKET_DL case AF_LINK: break; /* dangerous, don't want to do this */ /* MAC comparison */ /* csadl = (struct sockaddr_dl *)&(cifr->ni_saddr); sadl = (struct sockaddr_dl *)&(ifr->ni_saddr); if (memcmp((unsigned char *)(csadl->sdl_data + csadl->sdl_nlen),(unsigned char *)(sadl->sdl_data + sadl->sdl_nlen),6) goto end_loop; */ #endif default : /* should never get here... this is bad */ break; } } free(ifc->ifc_req); /* we are in big trouble */ return -1; end_loop: *olifr = lifr; *oifr = ifr; return inc; } /* ******************************************** * * the semi-standard version of getifaddrs * * ******************************************** */ int nifreq_gifaddrs(struct ifaddrs **ifap, struct ni_ifconf_flavor * nifp) { struct ifconf ifc; struct nifreq * ifr, * lifr; struct ifaddrs * thisif, * lastif = NULL; struct sockaddr * sa; int fd, af, inc, ret, nop; *ifap = NULL; if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return errno; if (nifp->getifreqs(fd,&ifc) == NULL) { close(fd); return errno; } ifr = (struct nifreq *)ifc.ifc_req; lifr = (struct nifreq *)&(ifc.ifc_buf[ifc.ifc_len]); while(ifr < lifr) { inc = ni_SIZEOF_ADDR_IFREQ((struct ifreq *)ifr,(&ifr->ni_saddr),sizeof(struct ifreq)); if ((thisif = calloc(1, sizeof(struct ifaddrs))) == NULL) { errno = ENOMEM; goto error_out; } if (lastif == NULL) /* taken care of in init statement */ *ifap = thisif; else lastif->ifa_next = thisif; if ((thisif->ifa_name = strdup(ifr->ni_ifr_name)) == NULL) { errno = ENOMEM; goto error_out; } af = ifr->ni_saddr.sa_family; if ((thisif->ifa_addr = ni_memdup(&(ifr->ni_saddr), SA_LEN((&ifr->ni_saddr)))) == NULL) goto error_out; if (af == AF_INET) { fd = ni_clos_reopn_dgrm(fd,af); if (_ni_get_ifaddrs(fd,thisif,nifp, ifr) < 0) goto error_out; } /* == AF_INET */ #ifdef LOCAL_SIZEOF_SOCKADDR_IN6 else if (af == AF_INET6) { fd = ni_clos_reopn_dgrm(fd,af); if (&nifp->refreshifr == NULL) /* then no refresh needed */ nop = _ni_get_ifaddrs(fd,thisif,nifp,ifr); else nop = _ni_get_ifaddrs6(fd,thisif,nifp,NULL,&ifc,&ifr,&lifr); if (nop < 0) goto error_out; } /* == AF_INET6 */ #endif /* for AF_LINK, AF_PACKET nothing is used except the contents of the addr record */ lastif = thisif; ifr = (struct nifreq *)(((char *)ifr) + inc); } close(fd); free(ifc.ifc_req); /* free ifreq */ return nifp->ni_type; /* return family type */ error_out: ret = errno; /* preserve errno */ if (ret == 0) ret = EPERM; free(ifc.ifc_req); ni_freeifaddrs(*ifap); close(fd); *ifap = NULL; errno = ret; return -1; } Net-Interface-1.012/ni_ifreq.c0000644000000000000120000001526111154562415014734 0ustar rootwheel /* ******************************************************************** * * ni_ifreq.c version 0.04 3-7-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** * DESCRIPTION Accessor functions for 'ifconf' and 'ifreq' * */ /* for BSD flavors, consider using ifmib facility and struct if_data */ #include "localconf.h" #ifdef HAVE_STRUCT_IFREQ static void * _ni_getifreqs(int fd, void * vifc) { int n,size; struct ifconf * ifc = (struct ifconf *)vifc; void * ifr; bzero(ifc,sizeof(struct ifconf)); #ifdef SIOCGIFCOUNT if (ioctl(fd, SIOCGIFCOUNT, ifc) != -1) { size = ifc->ifc_len * sizeof(struct ifreq); if (size > NI_IFREQ_MEM_MAX) goto nifreq_nomem; ifr = malloc(size); if (ifr == NULL) { nifreq_nomem: errno = ENOMEM; return NULL; } ifc->ifc_req = ifr; ifc->ifc_len = size; /* Solaris returns EINVAL for small buffer */ if (ioctl (fd, SIOCGIFCONF, ifc) < 0) { free(ifr); if (errno == EINVAL) goto nifreq_iterate; else return NULL; } return ifr; } nifreq_iterate: #endif n = 2; ifr = ifc->ifc_req; while (1) { ifr = realloc(ifr, n * PAGE_SIZE ); if (ifr == NULL) { nifreq_mem_over: free(ifc->ifc_req); errno = ENOMEM; return NULL; } ifc->ifc_req = ifr; size = n * PAGE_SIZE; if (size > NI_IFREQ_MEM_MAX) goto nifreq_mem_over; ifc->ifc_len = size; if (ioctl( fd, SIOCGIFCONF, ifc ) < 0 && errno != EINVAL) { free (ifr); return NULL; } if (ifc->ifc_len < size - PAGE_SIZE) /* (n-1) * PAGE_SIZE */ break; n *= 2; } return ifr; } /* print stuff of interest, return 0 on success else the errno */ int ni_flav_ifreq_developer(void * ifcee) { /* ifcee unused */ int i, n, fd, inc, af, j; unsigned short flags; struct ifconf ifc; struct nifreq *ifr, *lifr; unsigned char * macp; char namebuf[NI_MAXHOST]; #ifdef LOCAL_SIZEOF_SOCKADDR_DL const struct sockaddr_dl * sdl; #endif #include "ni_IFF_inc.c" if ((fd = socket(AF_INET,SOCK_DGRAM,0)) < 0) return errno; if (_ni_getifreqs(fd,&ifc) == NULL) { close(fd); return errno; } ifr = (struct nifreq *)ifc.ifc_req; lifr = (struct nifreq *)&(ifc.ifc_buf[ifc.ifc_len]); /* while (ifr < lifr) { */ for(j = 0; j < ifc.ifc_len; j += inc) { macp = NULL; inc = ni_SIZEOF_ADDR_IFREQ((struct ifreq *)ifr,(&ifr->ni_saddr),sizeof(struct ifreq)); af = ifr->ni_saddr.sa_family; printf("%s\t",ifr->ni_ifr_name); if (af == AF_INET) { if (ioctl(fd, SIOCGIFFLAGS,ifr) != -1) { flags = ifr->ni_ushort; printf("flags=%0x<",flags); if (flags & IFF_UP) printf("UP "); else printf("DOWN "); n = sizeof(ni_iff_tab) / sizeof(ni_iff_t); for (i=0;i "); } if (ioctl(fd,SIOCGIFMETRIC,ifr) != -1 ); printf("metric %d ",ifr->ni_int); #ifdef SIOCGIFMTU if (ioctl(fd,SIOCGIFMTU,ifr) != -1 ) printf("mtu %d",ifr->ni_uint); #elif defined SIOCGIFDATA if (ioctl(fd,SIOCGIFDATA,ifr) != -1) printf("mtu %d",((struct ifdata *)ifr->ni_data)->ifi_mtu; #endif printf("\n\t"); if (ioctl(fd,SIOCGIFADDR,ifr) != -1 ) { #ifdef HAVE_GETNAMEINFO if (getnameinfo(&ifr->ni_saddr,LOCAL_SIZEOF_SOCKADDR_IN,namebuf,NI_MAXHOST,NULL,0,NI_NUMERICHOST) != 0) #endif strcpy(namebuf,inet_ntoa(ifr->ni_sin.sin_addr)); printf("address %s\t",namebuf); } if (ioctl(fd,SIOCGIFNETMASK,ifr) != -1 ) printf("mask 0x%lx\t",(unsigned long)ntohl(ifr->ni_sin.sin_addr.s_addr)); if (ioctl(fd,SIOCGIFBRDADDR,ifr) != -1 ) printf("broadcast %s\t",inet_ntoa(ifr->ni_sin.sin_addr)); } printf("\n\taf=%d sz=%d ",af,inc); #if defined SIOCGIFHWADDR if (ioctl(fd,SIOCGIFHWADDR,ifr) != -1 && NI_MAC_NOT_ZERO(&ifr->ni_saddr.sa_data)) macp = (unsigned char *)(&ifr->ni_saddr.sa_data); #endif #if defined SIOCGENADDR if (ioctl(fd,SIOCGENADDR,ifr) != -1) macp = (unsigned char *)(&ifr->ni_char); #endif if (macp != NULL) NI_PRINT_MAC(macp); printf("\n"); ifr = (struct nifreq *)(((char *)ifr) + inc); } close(fd); free(ifc.ifc_req); return 0; } static struct ni_ifconf_flavor ni_flavor_ifreq = { .ni_type = NI_IFREQ, #ifdef SIOCGIFINDEX .siocgifindex = SIOCGIFINDEX, #else .siocgifindex = 0, #endif .siocsifaddr = SIOCSIFADDR, .siocgifaddr = SIOCGIFADDR, #ifdef SIOCDIFADDR .siocdifaddr = SIOCDIFADDR, # else .siocdifaddr = 0, #endif #ifdef SIOCAIFADDR .siocaifaddr = SIOCAIFADDR, #else .siocaifaddr = 0, #endif .siocsifdstaddr = SIOCSIFDSTADDR, .siocgifdstaddr = SIOCGIFDSTADDR, .siocsifflags = SIOCSIFFLAGS, .siocgifflags = SIOCGIFFLAGS, .siocsifmtu = SIOCSIFMTU, .siocgifmtu = SIOCGIFMTU, .siocsifbrdaddr = SIOCSIFBRDADDR, .siocgifbrdaddr = SIOCGIFBRDADDR, .siocsifnetmask = SIOCGIFNETMASK, .siocgifnetmask = SIOCGIFNETMASK, .siocsifmetric = SIOCSIFMETRIC, .siocgifmetric = SIOCGIFMETRIC, .ifr_offset = 0, .gifaddrs = nifreq_gifaddrs, .fifaddrs = ni_freeifaddrs, .refreshifr = NULL, .getifreqs = _ni_getifreqs, .developer = ni_flav_ifreq_developer, }; void ni_ifreq_ctor() { ni_ifcf_register(&ni_flavor_ifreq); } #else void ni_ifreq_ctor() { return; }; #endif /* have ifreq */ Net-Interface-1.012/typemap0000644000000000000120000000003211145133734014362 0ustar rootwheelTYPEMAP const char * T_PV Net-Interface-1.012/Copying0000644000000000000120000004307611145133734014332 0ustar rootwheel GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 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., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Net-Interface-1.012/Interface.pm0000644000000000000120000007013611345242635015235 0ustar rootwheelpackage Net::Interface; use strict; #use lib qw(blib/lib blib/arch); use vars qw( $VERSION @ISA %EXPORT_TAGS @EXPORT_OK ); #use AutoLoader qw(AUTOLOAD); require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); require Net::Interface::NetSymbols; # just for the EXPORT symbol arrays @EXPORT_OK = ( @Net::Interface::NetSymbols::EXPORT_OK, qw( cidr2mask full_inet_ntop ipV6compress mac_bin2hex mask2cidr net_symbols type scope inet_aton inet_ntoa inet_pton inet_ntop _NI_AF_TEST ) ); %EXPORT_TAGS = %Net::Interface::NetSymbols::EXPORT_TAGS; $EXPORT_TAGS{constants} = $EXPORT_TAGS{ifs}; # deprecated form $EXPORT_TAGS{inet} = [qw( inet_aton inet_ntoa inet_pton inet_ntop )]; $VERSION = do { sprintf "%d.%03d", (q$Revision: 1.12 $ =~ /\d+/g) }; bootstrap Net::Interface $VERSION; # register the conditionally compiled family modules Net::Interface::conreg(); # provide AF family data for use in this module my $AF_inet = eval { 0 + AF_INET() } || 0; my $AF_inet6 = eval { 0 + AF_INET6() } || 0; sub af_inet { return $AF_inet; } sub af_inet6 { return $AF_inet6; } sub net_symbols() { no strict; my %sym; my $max = AF_MAX(); foreach ( @{$EXPORT_TAGS{afs}}, @{$EXPORT_TAGS{pfs}}, @{$EXPORT_TAGS{ifs}}, @{$EXPORT_TAGS{iftype}}, @{$EXPORT_TAGS{scope}}, ) { my $v = &$_; next if $v > $max; $sym{$_} = &$_; } return \%sym; } ########## begin code ############ *broadcast = \&destination; use overload '""' => sub { $_[0]->name(); }; our $full_format = "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X"; our $ipv6_format = 1; our $mac_format = "%02X:%02X:%02X:%02X:%02X:%02X"; sub import { if (grep { $_ eq ':lower' } @_) { $full_format = lc($full_format); $ipv6_format = 0; $mac_format = lc($mac_format); @_ = grep { $_ ne ':lower' } @_; } if (grep { $_ eq ':upper' } @_) { $full_format = uc($full_format); $ipv6_format = 1; $mac_format = uc($mac_format); @_ = grep { $_ ne ':upper' } @_; } Net::Interface->export_to_level(1,@_); } sub DESTROY () {} #1; #__END__ # create blessed object for testing # sub _bo($) { my $proto = shift; my $class = ref($proto) || $proto; bless {}, $class; } =head1 NAME Net::Interface - Perl extension to access network interfaces =head1 SYNOPSIS use Net::Interface qw( cidr2mask full_inet_ntop ipV6compress mac_bin2hex mask2cidr net_symbols type scope inet_aton inet_ntoa inet_pton inet_ntop :afs :pfs :ifs :iffs :iffIN6 :iftype :scope :constants :inet :all :lower :upper ); =head2 TAGS Note: tags :afs, :pfs, :constants, :ifs include all AF_[family names], PF_[family names] and IFxxxx values that exist on this architecture. :iffs includes only IFF_xxx values :iffIN6 includes IN6_IFF_xxx values on BSD flavored OS's :inet includes inet_aton, inet_ntoa, inet_pton, inet_ntop On platforms that support IPV6, :iftype :scope provide additional attribute screening :constants is a deprecated synonym for :ifs See L built specifically for this platform for a detailed list and description of all symbols available on this specific architecture and operating systems version. By default B functions and methods return string IPv6 addresses and MAC addresses in uppercase. To change that to lowercase: use Net::Interface qw(:lower); To ensure the current string case behavior even if the default changes: use Net::Interface qw(:upper); =head2 FUNCTIONS and METHODS @all_ifs = Net::Interface->interfaces(); $this_if = Net::Interface->new('eth0'); $refresh_if = $any_if->new(); $refresh_if = $this_if->delete($naddr); $create_if = Net::Interface->new(\%iface_spec); @ifnames = "@all_ifs"; $if_name_txt = $if->name; print $if,"\n"; # prints the name print "@all_ifs\n" # prints all names --------------------------------------------- WARNING API CHANGE ! $naddr = $if->address([$family],[$index]); $naddr = $if->netmask([$family],[$index]); $naddr = $if->destination([$family],[$index]); same as $naddr = $if->broadcast([$family],[$index]); @addresses = $if->address([$family]); @netmasks = $if->netmask([$family]); @destinats = $if->destination([$family]); same as @broaddrs = $if->broadcast([$family]); $bin_mac = $if->hwaddress($hwaddr); --------------------------------------------- $val = $if->flags($val); $val = $if->mtu ($val); $val = $if->metric($val); $val = $if=>index(); $cidr = $if->mask2cidr([$naddmsk]) $cidr = mask2cidr($naddrmsk); $naddrmsk = cidr2mask($cidr,[family]) $mac_txt = if->mac_bin2hex(); $mac_txt = mac_bin2hex($bin_mac); $naddr = inet_aton($host or $dotquad); $dotquad = inet_ntoa($naddr); $info = $if->info(); for ipV6 only $type = $if->type([$naddr6]); $type = type($naddr6); $scope = $if->scope([$naddr6]); $scope = scope($naddr6); $full_ipV6_txt = full_inet_ntop($naddr6); $ipV6_txt = inet_ntop($naddr6) $naddr6 = inet_pton($ipV6_txt); =head1 DESCRIPTION B is a module that allows access to the host network interfaces in a manner similar to I. Version 1.00 is a complete re-write and includes support for IPV6 as well as the traditional IPV4. Both read and write access to network device attributes including the creation of new logical and physical interfaces is available where supported by the OS and this module. NOTE: if your OS is not supported, please feel free to contribute new capabilities, patches, etc.... see: L ANOTHER NOTE: Many of the operations of B, particularly those that set interface values require privileged access to OS resources. Wherever possible, B will simply fail I when there are not adequate privileges to perform the requested operation or where the operation is not supported. =head1 OPERATION B retrieves information about the network devices on its host in a fashion similar to I running in a terminal window. With I, the information is returned to the screen and any additional activity on a particular network device goes on without the knowledge of the user. Similarly, B only retrieves information about network devices when methods I and I are invoked. Calls to I retrieves information about all network devices known to the host. Calls to I make the same function call to the host library but rather than returning all the interface net device information to the user, it selects out only information for the specified device. The function call to the OS is the same. This information is cached in the object returned to the user interface and it is from this object that data is returned to the user program. To continually monitor a particular device, it is necessary to issue repeat calls to I. =head1 SYMBOLS B provide a large number of network interface symbols with a module generated on its build host. These symbols include all of the available AF_xxxx, PF_xxx, IFF_xxx symbols and many more. For a detailed list of all of these symbols, see L. =head2 HINTS and TIPS for use SYMBOLS Most of the symbols provided by B have dual values. 1) a numeric value when use in arithmetic context and 2) a text value when used in string/text context Symbols are actually calls to functions. Because of this certain usage rules apply that are not necessarily obvious. If you make it a practice to build your Perl modules using: #!/usr/bin/perl use strict; Then usage of symbols will require that they explicitly be called as functions. i.e. $functval = &AF_INET is OK $functval = AF_INET() is better The first calling method allows the function to pick up the contents of B<@_>. This works fine as long as B<@_> is empty. Since symbols do not take arguments, when B<@_> contains something the symbol call will fail with a message from Perl about inappropriate calling syntax. If you do not C (not recommended) then bare symbols will work just fine in your Perl scripts. You can also imbed your symbols in blocks where B is not enforced. { no strict; $functval = AF_INET } Lastly, to access the numeric value of a symbol unconditionally: $numeric = 0 + AF_INET =head1 WARNING - API CHANGES The following changes have been made to the API. This may I existing code. If you have been using a previous version of Net::Interface you should verify that these API changes do not break your code. =over 6 B =item * I<$naddr=$if-Eaddress($naddr);> =item * I<$naddr=$if-Enetmask($naddr);> =item * I<$naddr=$if-Edestination($naddr);> =item * I<$naddr=$if-Ebroadcast($naddr);> =item * I<$mac = $if->hwaddress($hwaddr);> =back Setting address values was never implemented in previous versions of Net::Interface. With this version (where supported) changing an address will be implemented using a hash argument containing the required and optional elements in a manner similar to I. See: Net::Interface->new(\%iface_spec); =over 6 B =item * I<($sa_family,$size,$naddr)=$if-Eaddress($naddr);> =back On most platforms, multiple addresses and multiple address families can be assigned to the same interface. The returned data described above conflicts with the requirement to report multiple addresses for a particular interface. In addition, the returned information only reflected the attributes of the I address assigned to the device where there could be many of mixed families. i.e. AF_INET, AF_INET6, and perhaps more as the capabilities of this module are enhanced to support additional address families. The API has been changed to reflect this reality and the need to report multiple addresses on the same interface. @addresses = $if->address([$family]); The new API is described in detail later in this document. =over 6 B =item * I<($sa_family,$size,$hwaddr)=$if-Ehwaddress($hwaddr);> =back As in the preceding case, it is not possible to accurately report the address family attributes of an interface which may support assignments of more than one address from differing address families. see: if->info(); =head1 METHODS Brackets [] indicates an optional parameter. The return value for I attempts on systems that do not support the operation is not settled. Current practice is to silently ignore the set request. This may change so don't count on this behavior. Unless otherwise specified, errors for all methods return either B or and empty array depending on the expected return context. =cut # ********************************************* * # The information for each interface (IF) is * # contained in an HV. The name slot of the * # HV holds the IF name. The args slot points * # to a hash whose key values represent the * # last interrogated state of the IF. * # * # HV { * # indx => IV, * # flav => IV, * # name => interface name; * # args => { * # maci => bin string, * # mtui => IV, * # metk => IV, * # flag => NV, * # afk => { * # size => IV, * # addr => [], * # netm => [], * # dsta => [], * # }, * # afk => { * # size => IV, * # addr => [], * # netm => [], * # dsta => [], * # }, * # } * # }; * # Note: for ease of coding, all keys=4 chars * # except for 'afk' which is computed * # ********************************************* * =pod =over 4 =item * I<-Einterfaces();> Returns a list of interface objects for each interface that supports IPV4 or IPV6. On failure, returns an empty list. usage: @all_ifs = Net::Interface->interfaces(); foreach my $if (@all_ifs) { $if_name = $if->name; or print $if, "\n"; # (overloaded) } Get or Set (where supported) $old_mtu = $if->mtu($new_mtu); $old_metric = $if->metric($new_metric); etc... =back =item * I<-Enew();> has multiple calling invocations. This method will refresh the data for an existing interface OR it can modify and existing interface OR it can create a new interface or alias. =over 4 =item * $this_if = I<-Enew('eth0');> Same as I<-Einterfaces> above except for a single known interface. An interface object is returned for the specific logical device requested. On failure return B =item * $refresh_if = I<-Enew();> The a new (refreshed) interface object is returned for the same logical device. =item * $new_if = I<-Enew(%iface_spec);> =item * $new_if = I<-Enew(\%iface_spec);> A logical device is created or updated. The specification is contained in a hash table that is passed to I either directly or as a reference. The interface specification is architecture dependent. For example, adding an address to an existing interface. i.e. Linux $iface_spec = { name => 'eth0:0', address => inet_aton('192.168.1.2'), netmask => inet_aton('255.255.255.0), # netmask may be optionally specified as: # cidr => 24, broadcast => inet_aton('192.168.1.255), # optional values, defaults shown metric => 1, mtu => 1500, }; The address family is determined by inspection of the size of the address. i.e. BSD variants $iface_spec = { name => 'eth0', # primary interface alias => inet_aton('192.168.1.2'), netmask => inet_aton('255.255.255.255), # netmask may be optionally specified as: # cidr => 32, # optional values, defaults shown metric => 1, mtu => 1500, }; The keyword B says not to change the primary interface but instead to add an address to the interface. =item * $refresh_if = I<-Edelete($naddr);> Removes and address from an interface where supported. =item * I<-Ename();> Return the B of the interface. =cut sub name ($) { return $_[0]->{name}; } =item * I<-Eaddress([$family],[$index]);> B Get the interface specified by the optional C<$family> and C<$index>. Absent a C<$family> and C<$index>, the first available interface for the family AF_INET (or if not present AF_INET6) will be returned. NOTE: this is not a definitive response. The OS may report the interfaces in any order. Usually the primary interface is reported first but this is not guaranteed. Use ARRAY context instead to get all addresses. B Returns a list of addresses assigned to this interface. If a C<$family> is not specified then AF_INET is assumed or AF_INET6 if there are no AF_INET addresses present. =item * I<-Enetmask([$family],[$index]);> Similar to I<-Eaddress([$family],[$index]);> above. Netmasks are reported in the same order as the addresses above, in matching positions in the returned array. =item * I<-Edestination([$family],[$index]);> =item * I<-Ebroadcast([$family],[$index]);> These to methods are identical in execution. The returned address attribute(s) will be destination or broadcast addresses depending on the status of the POINTOPOINT flag. Similar to I<-Eaddress([$family],[$index]);> above. If an address attribute is unknown, the array slot will contain I. =cut sub address ($;$$) { unshift @_, 'addr'; # can't use 'goto', work around for broken perl 5.80-5.85 @_ bug return &_address if wantarray; return scalar &_address; } sub netmask ($;$$) { unshift @_, 'netm'; # can't use 'goto', work around for broken perl 5.80-5.85 @_ bug return &_address if wantarray; return scalar &_address; } sub destination ($;$$) { unshift @_, 'dsta'; # can't use 'goto', work around for broken perl 5.80-5.85 @_ bug return &_address if wantarray; return scalar &_address; } sub _address { my($k,$if,$f,$i) = @_; my $idx = $i || 0; $f = 0 unless $f; my $fam = 0 + $f; unless ($f) { # if the family is missing if (exists $if->{args}->{&af_inet}) { $fam = &af_inet; # select default, AF_INET } else { $fam = &af_inet6; # or AF_INET6 if present } } if (! exists $if->{args}->{$fam} || # there is no such family $idx < 0 || $idx > $#{$if->{args}->{$fam}->{addr}}) { # or the index is out of range return () if wantarray; # PUNT! return undef; } return @{$if->{args}->{$fam}->{$k}} if wantarray; return $if->{args}->{$fam}->{$k}->[$idx]; } =item * I<-Ehwaddress([$hwaddr]);> Returns the binary value of the MAC address for the interface. Optionally, where supported, it allows setting of the MAC address. i.e. $old_binmac = $if->hwaddress($new_binmac); $new_binmac = $if->hwaddress(); =item * I<-Eflags([$new_flags]);> Get or Set (where supported) the flags on the interface. i.e. down an interface. $flags = $if->flags(); $mask = ~IFF_UP; $old_fg = $if->flags($flags & $mask); $flags = $if->flags(); UPDATES the if object NOTE: returns undef if the interface is down or not configured. =item * I<-Emtu([$new_mtu]);> Get or Set (where supported) the mtu of the interface. $mtu = $if->mtu(); $old_mtu = $if->mtu($new_mtu); UPDATES the if object NOTE: returns undef if the interface is down or not configured. =item * I<-Emetric([$new_metric]);> Get or Set (where supported) the metric for the interface. $metric = $if->metric(); $old_metric = $if->metric($new_metric); UPDATES the if object NOTE: returns undef if the interface is down or not configured. =item * I<-Eindex();> Get the interface index, not to be confused with the index number of the IP assigned to a particular index. There is no provision to SET the index. $index = $if->index(); =item * I<-Emask2cidr([$naddrmsk]);> =item * $cidr = mask2cidr($naddrmsk); Returns the CIDR (prefix length) for the netmask C<$naddrmsk>. When no I<$naddrmsk> is specified the method will return the first address in the first family starting with AF_INET, AF_INET6, etc... This is particularly useful for interfaces with only a single address assigned. May be called as a METHOD or a FUNCTION. =item * I<-Emac_bin2hex();> =item * $mac_txt = mac_bin2hex($bin_mac); Converts a binary MAC address into hex text. i.e. A1:B2:C3:D4:E5:F6 May be called as a METHOD or a FUNCTION. =item * I<-Einfo();> Returns a pointer to a hash containing information about the interface as follows: $info = { name => 'eth0', index => 1, mtu => 1500, metric => 1, flags => 1234, mac => binary_mac_address, $fam0 => { number => of_addresses, size => of_address, }, $fam1 => etc.... }; where $famX is one of AF_INET, AF_INET6, etc... =cut sub info ($) { my $if = shift; my $name = $if->{name}; my ($mtu,$metric,$flags,$mac,$index) = @{$if->{args}}{qw(mtui metk flag maci indx)}; my $info = { name => $name, mtu => $mtu, metric => $metric, flags => $flags, mac => $mac, index => $index, }; my $af_inet6 = eval { &af_inet6 } || 0; foreach(&af_inet,$af_inet6) { next unless $_; if (exists $if->{args}->{$_}) { $info->{$_}->{size} = $if->{args}->{$_}->{size}; $info->{$_}->{number} = @{$if->{args}->{$_}->{addr}}; } } return $info; } =item * I<-Etype([$naddr6]);> =item * $type = type($naddr6); B method. Returns attributes of an IPV6 address that may be tested with these bit masks: IPV6_ADDR_ANY unknown IPV6_ADDR_UNICAST unicast IPV6_ADDR_MULTICAST multicast IPV6_ADDR_ANYCAST anycast IPV6_ADDR_LOOPBACK loopback IPV6_ADDR_LINKLOCAL link-local IPV6_ADDR_SITELOCAL site-local IPV6_ADDR_COMPATv4 compat-v4 IPV6_ADDR_SCOPE_MASK scope-mask IPV6_ADDR_MAPPED mapped IPV6_ADDR_RESERVED reserved IPV6_ADDR_ULUA uniq-lcl-unicast IPV6_ADDR_6TO4 6to4 IPV6_ADDR_6BONE 6bone IPV6_ADDR_AGU global-unicast IPV6_ADDR_UNSPECIFIED unspecified IPV6_ADDR_SOLICITED_NODE solicited-node IPV6_ADDR_ISATAP ISATAP IPV6_ADDR_PRODUCTIVE productive IPV6_ADDR_6TO4_MICROSOFT 6to4-ms IPV6_ADDR_TEREDO teredo IPV6_ADDR_ORCHID orchid IPV6_ADDR_NON_ROUTE_DOC non-routeable-doc i.e. if ($type & $mask) { print $mask,"\n"; ... ... will print the string shown to the right of the bit mask. When no I<$naddr6> is specified the method will return the first AF_INET6 address found. This is particularly useful for interfaces with only a single address assigned. May be called as a METHOD or a FUNCTION with an $naddr6 argument. =item * I<-Escope([$naddr6]);> =item * $scope = scope($naddr6); Returns the RFC-2373 scope of an IPV6 address that may be equated to these constants. RFC2373_GLOBAL global-scope 0xE RFC2373_ORGLOCAL org-local 0x8 RFC2373_SITELOCAL site-local 0x5 RFC2373_LINKLOCAL link-local 0x2 RFC2373_NODELOCAL loopback 0x1 One additional constant is provided as there is an out of band scope value mapped returned when determining scope. If you want B RFC2373 scope only, && the return value with 0xF LINUX_COMPATv4 lx-compat-v4 0x10 i.e. if ($scope = $const) { print $const,"\n"; ... ... will print the string shown to the right of the constant. When no I<$naddr6> is specified the method will return the first AF_INET6 address found. This is particularly useful for interfaces with only a single address assigned. May be called as a METHOD or a FUNCTION with an $naddr6 argument. =back =cut sub _family { my $len = length($_[0]); if ($len == 4) { return &af_inet; } elsif ($len == 16) { return &af_inet6; } return 0; } =head1 FUNCTIONS Unless otherwise specified, errors for all methods return either B or and empty array depending on the expected return context. =over 4 =item * $naddr = inet_aton($host or $dotquad); Converts a hostname or dotquad ipV4 address into a packed network address. =cut # if Socket lib is broken in some way, check for overange values # my $overange = yinet_aton('256.1') ? 1:0; sub inet_aton { if (! $overange || $_[0] =~ /[^0-9\.]/) { # hostname return &yinet_aton; } my @dq = split(/\./,$_[0]); foreach (@dq) { return undef if $_ > 255; } return &yinet_aton; } =item * $dotquad = inet_ntoa($naddr); Convert a binary IPV4 address into a dotquad text string. =item * $ipV6_txt = full_inet_ntop($naddr6); Returns an uncompressed text string for a net6 address. i.e. FE80:02A0:0000:0000:0000:0000:0123:4567 =item * $minimized = ipV6compress($ipV6_txt); Compress an ipV6 address to the minimum RFC-1884 format i.e. FE80:02A0:0000:0000:0000:0000:0123:4567 to FE80:2A0::123:4567 =cut sub _ipv6_acommon { 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 =~ /:$/; return $ipv6; } sub ipV6compress ($) { my $ipv6 = &_ipv6_acommon; return undef unless $ipv6; my $c = 'X'. join(':',map { # compression begins if ($_ !~ /[a-fA-F1-9]/) { 0; } elsif ($_ =~ /^0+(.+)/) { $1; } else { $_; }} split(/\:/,$ipv6)) .'X'; my @stuff = ($c =~ /[X\:][0\:]+[X\:]/g); unless (@stuff) { $c =~ s/X//g; return ($ipv6_format) ? uc $c : lc $c; } my $max = 0; my $idx = 0; foreach(0..$#stuff) { my $len = length($stuff[$_]); if ($len > $max) { $max = $len; $idx = $_; } } if ($max > 3) { $c =~ s/$stuff[$idx]/::/; } $c =~ s/X//g; return ($ipv6_format) ? uc $c : lc $c; } =item * $ipV6_txt = inet_ntop($naddr6) Returns a minimized RFC-1884 IPV6 address =cut sub inet_ntop ($) { return (ipV6compress(full_inet_ntop($_[0]))); } =item * $naddr6 = inet_pton($ipV6_txt); Takes an IPv6 text address of the form described in rfc1884 and returns a naddr6 128 bit binary address string in network order. =cut sub inet_pton { my $ipv6 = &_ipv6_acommon; return undef unless $ipv6; my @hex = split(/:/,$ipv6); foreach(0..$#hex) { $hex[$_] = hex($hex[$_] || 0); } pack("n8",@hex); } =item * $cidr = mask2cidr($naddrmsk); =item * I<-Emask2cidr($naddrmsk);> Returns the CIDR (prefix length) for the netmask C<$naddrmsk>. May be called as a FUNCTION or a METHOD. =item * $mac_txt = mac_bin2hex($bin_mac); =item * I<-Emac_bin2hex();> Converts a binary MAC address into hex text. i.e. A1:B2:C3:D4:E5:F6 May be called as a FUNCTION or a METHOD. =item * $type = type($naddr6); =item * I<-Etype($naddr6);> B method. Returns attributes of an IPV6 address that may be tested with the bit masks described in detail in the METHOD section above. May be called as a FUNCTION or a METHOD with an $naddr6 argument. =item * $scope = scope($naddr6); =item * I<-Escope($naddr6);> Returns the RFC-2373 scope of an IPV6 address that may be equated module constants described in detail in the METHOD section above. May be called as a FUNCTION or a METHOD with an $naddr6 argument. =item * $symbolptr = net_symbols(); Returns a hash containing most of the network symbols available for this architecture. where $symbolptr = { SYMBOL_TEXT => value, ... }; Most all of these symbols have both a numeric and text value. Perl does the B thing and uses the numeric value in all logic and arithmetic operations and provides the text value for print requests. To print the numeric value: print (0 + &SYMBOL),"\n"; i.e. print (0 + AF_INET()),"\n"; results in the digit B<2> being printed, whereas: print AF_INET,"\n"; results in the string "B" being printed. NOTE: that many symbols are OS dependent. Do not use numeric values in your code, instead use the symbol. i.e. AF_INET, AF_INET6, AF_LINK, etc... =back =head1 ACKNOWLEDGEMENTS This version of Net::Interface has been completely rewritten and updated to include support for IPV6. Credit should be given to the original author Stephen Zander for conceiving the idea behind Net::Interface and to the work done by Jerrad Pierce jpierce@cpan.org on the maintenance and improvements to the original version. Thanks also go to Jens Rehsack for inspiring me to create this updated version and for his assistance in vetting the design concepts and loads of other helpful things. The following functions are used in whole or in part as include files to Interface.xs. The copyright (same as Perl itself) is include in the file. file: functions: miniSocketXS.c inet_aton, inet_ntoa inet_aton, inet_ntoa are from the perl-5.8.0 release by Larry Wall, copyright 1989-2002. inet_aton, inet_ntoa code is current through perl-5.9.3 release. Thank you Larry for making PERL possible for all of us. =head1 COPYRIGHT 2008-2009 Michael Robinton 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. 59 Temple Place, Suite 330 Boston, MA 02111-1307, USA or visit their web page on the internet at: http://www.gnu.org/copyleft/gpl.html. =head1 SEE ALSO ifconfig(8), Net::Interface::NetSymbols, L =cut 1; Net-Interface-1.012/config.guess0000755000000000000120000012756211145133734015322 0ustar rootwheel#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-04-14' # This file 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Net-Interface-1.012/hints/0000755000000000000000000000000011345243332013764 5ustar rootrootNet-Interface-1.012/hints/solaris_2.pl0000644000076600007720000000004206557324314014456 0ustar $self->{DEFINE} .= '-DBSD_COMP'; Net-Interface-1.012/ni_SMI-NUMBERS.c0000644000000000000120000001245211145133734015364 0ustar rootwheel /* BEGIN ni_SMI-NUMBERS.c include **************************************************************** * DO NOT ALTER THIS FILE * * it was created by build_stuff/make_smi-numbers.pl * * EDIT THAT INSTEAD * **************************************************************** */ ni_iff_t ni_smi_tab[] = { {1, "other"}, {2, "regular1822"}, {3, "hdh1822"}, {4, "ddn-x25"}, {5, "x25"}, {6, "ethernet-csmacd"}, {7, "IEEE802.3"}, {8, "IEEE802.4"}, {9, "IEEE802.5"}, {10, "iso88026-man"}, {11, "starLan"}, {12, "proteon-10Mbit"}, {13, "proteon-80Mbit"}, {14, "hyperchannel"}, {15, "FDDI"}, {16, "lapb"}, {17, "sdlc"}, {18, "ds1"}, {19, "e1"}, {20, "basicISDN"}, {21, "primaryISDN"}, {22, "propPointToPointSerial"}, {23, "ppp"}, {24, "softwareLoopback"}, {25, "eon"}, {26, "ethernet-3Mbit"}, {27, "nsip"}, {28, "slip"}, {29, "ultra"}, {30, "ds3"}, {31, "sip"}, {32, "frame-relay"}, {33, "RS-232"}, {34, "Parallel"}, {35, "arcnet"}, {36, "arcnet-plus"}, {37, "atm"}, {38, "MIOX25"}, {39, "SONET"}, {40, "x25ple"}, {41, "iso88022llc"}, {42, "localTalk"}, {43, "smds-dxi"}, {44, "frameRelayService"}, {45, "v35"}, {46, "hssi"}, {47, "hippi"}, {48, "modem"}, {49, "aal5"}, {50, "sonetPath"}, {51, "sonetVT"}, {52, "smds-icip"}, {53, "propVirtual"}, {54, "propMultiLink"}, {55, "ieee80212"}, {56, "fibre-channel"}, {57, "hippiInterfaces"}, {58, "FrameRelayInterconnect"}, {59, "aflane8023"}, {60, "aflane8025"}, {61, "cctEmul"}, {62, "fastEther"}, {63, "isdn"}, {64, "v11"}, {65, "v36"}, {66, "g703-64k"}, {67, "g703-2mb"}, {68, "qllc"}, {69, "fastEtherFX"}, {70, "channel"}, {71, "IEEE802.11"}, {72, "ibm370parChan"}, {73, "ESCON"}, {74, "DLSw"}, {75, "ISDNs"}, {76, "ISDNu"}, {77, "lapd"}, {78, "ip-switch"}, {79, "rsrb"}, {80, "atm-logical"}, {81, "ds0"}, {82, "ds0Bundle"}, {83, "bsc"}, {84, "async"}, {85, "cnr"}, {86, "iso88025Dtr"}, {87, "eplrs"}, {88, "arap"}, {89, "propCnls"}, {90, "hostPad"}, {91, "termPad"}, {92, "frameRelayMPI"}, {93, "x213"}, {94, "adsl"}, {95, "radsl"}, {96, "sdsl"}, {97, "vdsl"}, {98, "iso88025CRFPInt"}, {99, "myrinet"}, {100, "voiceEM"}, {101, "voiceFXO"}, {102, "voiceFXS"}, {103, "voiceEncap"}, {104, "voiceOverIp"}, {105, "atmDxi"}, {106, "atmFuni"}, {107, "atmIma"}, {108, "pppMultilinkBundle"}, {109, "ipOverCdlc"}, {110, "ipOverClaw"}, {111, "stackToStack"}, {112, "virtualIpAddress"}, {113, "mpc"}, {114, "ipOverAtm"}, {115, "iso88025Fiber"}, {116, "tdlc"}, {117, "gigabitEthernet"}, {118, "hdlc"}, {119, "lapf"}, {120, "v37"}, {121, "x25mlp"}, {122, "x25huntGroup"}, {123, "transpHdlc"}, {124, "interleave"}, {125, "fast"}, {126, "ip"}, {127, "docsCableMaclayer"}, {128, "docsCableDownstream"}, {129, "docsCableUpstream"}, {130, "a12MppSwitch"}, {131, "tunnel"}, {132, "coffee"}, {133, "ces"}, {134, "atmSubInterface"}, {135, "l2vlan"}, {136, "l3ipvlan"}, {137, "l3ipxvlan"}, {138, "digitalPowerLine"}, {139, "mediaMailOverIp"}, {140, "dtm"}, {141, "dcn"}, {142, "ipForward"}, {143, "msdsl"}, {144, "ieee1394"}, {145, "if-gsn"}, {146, "dvbRccMacLayer"}, {147, "dvbRccDownstream"}, {148, "dvbRccUpstream"}, {149, "atmVirtual"}, {150, "mplsTunnel"}, {151, "srp"}, {152, "voiceOverAtm"}, {153, "voiceOverFrameRelay"}, {154, "idsl"}, {155, "compositeLink"}, {156, "ss7SigLink"}, {157, "propWirelessP2P"}, {158, "frForward"}, {159, "rfc1483"}, {160, "USB"}, {161, "ieee8023adLag"}, {162, "bgpPolicyAccounting"}, {163, "frf16MfrBundle"}, {164, "h323Gatekeeper"}, {165, "h323Proxy"}, {166, "mpls"}, {167, "mfSigLink"}, {168, "hdsl2"}, {169, "shdsl"}, {170, "ds1FDL"}, {171, "POS"}, {172, "dvbAsiIn"}, {173, "dvbAsiOut"}, {174, "plc"}, {175, "NFAS"}, {176, "TR008"}, {177, "GR303RDT"}, {178, "GR303IDT"}, {179, "ISUP"}, {180, "propDocsWirelessMaclayer"}, {181, "propDocsWirelessDownstream"}, {182, "propDocsWirelessUpstream"}, {183, "hiperlan2"}, {184, "propBWAp2Mp"}, {185, "sonetOverheadChannel"}, {186, "digitalWrapperOverheadChannel"}, {187, "aal2"}, {188, "radioMAC"}, {189, "atmRadio"}, {190, "IMT"}, {191, "mvl"}, {192, "reachDSL"}, {193, "frDlciEndPt"}, {194, "atmVciEndPt"}, {195, "opticalChannel"}, {196, "opticalTransport"}, {197, "propAtm"}, {198, "voiceOverCable"}, {199, "infiniband"}, {200, "teLink"}, {201, "q2931"}, {202, "virtualTg"}, {203, "sipTg"}, {204, "sipSig"}, {205, "docsCableUpstreamChannel"}, {206, "econet"}, {207, "pon155"}, {208, "pon622"}, {209, "bridge"}, {210, "linegroup"}, {211, "voiceEMFGD"}, {212, "voiceFGDEANA"}, {213, "voiceDID"}, {214, "mpegTransport"}, {215, "sixToFour"}, {216, "gtp"}, {217, "pdnEtherLoop1"}, {218, "pdnEtherLoop2"}, {219, "opticalChannelGroup"}, {220, "homepna"}, {221, "gfp"}, {222, "ciscoISLvlan"}, {223, "actelisMetaLOOP"}, {224, "fcipLink"}, {225, "rpr"}, {226, "qam"}, {227, "lmp"}, {228, "cblVectaStar"}, {229, "docsCableMCmtsDownstream"}, {230, "adsl2"}, {231, "macSecControlledIF"}, {232, "macSecUncontrolledIF"}, {233, "aviciOpticalEther"}, {234, "atmbond"}, {235, "voiceFGDOS"}, {236, "mocaVersion1"}, {237, "ieee80216WMAN"}, {238, "adsl2plus"}, {239, "dvbRcsMacLayer"}, {240, "dvbTdm"}, {241, "dvbRcsTdma"}, {242, "x86Laps"}, {243, "wwanPP"}, {244, "wwanPP2"}, {245, "voiceEBS"}, {246, "ifPwType"}, {247, "ILAN"}, {248, "PIP"}, {249, "aluELP"}, {250, "gpon"}, }; Net-Interface-1.012/config.h.in0000644000000000000000000003376411151344365014702 0ustar rootroot/* config.h.in. Generated from configure.ac by autoheader. */ /* define available include file */ #undef HAVE_ALLOCA_H /* define available include file */ #undef HAVE_ARPA_INET_H /* define available include file */ #undef HAVE_ASM_TYPES_H /* define available include file */ #undef HAVE_BYTESWAP_H /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO /* Define to 1 if the system has the type `caddr_t'. */ #undef HAVE_CADDR_T /* define available include file */ #undef HAVE_CTYPE_H /* define available include file */ #undef HAVE_ENDIAN_H /* define available include file */ #undef HAVE_FCNTL_H /* define available include file */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* define available include file */ #undef HAVE_IFADDRS_H /* Define to 1 if function 'inet_addr' is present */ #undef HAVE_INET_ADDR /* Define to 1 if function 'inet_aton' is present */ #undef HAVE_INET_ATON /* Define to 1 if function 'inet_pton' is present */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* define available include file */ #undef HAVE_LIBC_INTERNAL_H /* Define to 1 if function 'link_ntoa' is present */ #undef HAVE_LINK_NTOA /* define available include file */ #undef HAVE_LINUX_ATALK_H /* define available include file */ #undef HAVE_LINUX_AX25_H /* define available include file */ #undef HAVE_LINUX_IF_ARP_H /* define available include file */ #undef HAVE_LINUX_IF_ETHER_H /* define available include file */ #undef HAVE_LINUX_IF_FDDI_H /* define available include file */ #undef HAVE_LINUX_IF_SLIP_H /* define available include file */ #undef HAVE_LINUX_IF_STRIP_H /* define available include file */ #undef HAVE_LINUX_IF_TR_H /* define available include file */ #undef HAVE_LINUX_NETLINK_H /* define available include file */ #undef HAVE_LINUX_ROSE_H /* define available include file */ #undef HAVE_LINUX_RTNETLINK_H /* define available include file */ #undef HAVE_LINUX_TYPES_H /* define available include file */ #undef HAVE_LINUX_X25_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* define available include file */ #undef HAVE_MALLOC_H /* MALLOC in */ #undef HAVE_MALLOC_IN_STDLIB /* Define to 1 if you have the `memcmp' function. */ #undef HAVE_MEMCMP /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* define available include file */ #undef HAVE_NET80211_IEEE80211_CRYPTO_H /* define available include file */ #undef HAVE_NET80211_IEEE80211_FREEBSD_H /* define available include file */ #undef HAVE_NET80211_IEEE80211_H /* define available include file */ #undef HAVE_NET80211_IEEE80211_IOCTL_H /* define available include file */ #undef HAVE_NETATALK_AT_H /* define available include file */ #undef HAVE_NETAX25_AX25_H /* define available include file */ #undef HAVE_NETDB_H /* define available include file */ #undef HAVE_NETECONET_EC_H /* define available include file */ #undef HAVE_NETINET6_ND6_H /* define available include file */ #undef HAVE_NETINET_ETHER_H /* define available include file */ #undef HAVE_NETINET_IF_ETHER_H /* define available include file */ #undef HAVE_NETINET_IF_FDDI_H /* define available include file */ #undef HAVE_NETINET_IN_H /* define available include file */ #undef HAVE_NETINET_IN_VAR_H /* define available include file */ #undef HAVE_NETINET_IP_CARP_H /* define available include file */ #undef HAVE_NETINET_IP_H /* define available include file */ #undef HAVE_NETIO_H /* define available include file */ #undef HAVE_NETIPX_IPX_H /* define available include file */ #undef HAVE_NETIPX_IPX_IF_H /* define available include file */ #undef HAVE_NETPACKET_PACKET_H /* define available include file */ #undef HAVE_NET_ETHERNET_H /* define available include file */ #undef HAVE_NET_IF_ARP_H /* define available include file */ #undef HAVE_NET_IF_DL_H /* define available include file */ #undef HAVE_NET_IF_H /* define available include file */ #undef HAVE_NET_IF_LAGG_H /* define available include file */ #undef HAVE_NET_IF_MEDIA_H /* define available include file */ #undef HAVE_NET_IF_PFSYNC_H /* define available include file */ #undef HAVE_NET_IF_TYPES_H /* define available include file */ #undef HAVE_NET_IF_VAR_H /* define available include file */ #undef HAVE_NET_IF_VLAN_VAR_H /* define available include file */ #undef HAVE_NET_NIT_IF_H /* define available include file */ #undef HAVE_NET_PFVAR_H /* define available include file */ #undef HAVE_NET_ROUTE_H /* Define to 1 if pcap lib is present */ #undef HAVE_PCAP /* Define to 1 if you have . */ #undef HAVE_PTHREAD_H /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if sockaddr has member 'sa_len' */ #undef HAVE_SA_LEN /* define available include file */ #undef HAVE_SIGNAL_H /* Define to 1 if sockaddr_in6 has member 'sin6_scopeid' */ #undef HAVE_SIN6_SCOPEID /* Define to 1 if function 'socket' is present */ #undef HAVE_SOCKET /* define available include file */ #undef HAVE_STDARG_H /* define available include file */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* define available include file */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* define available include file */ #undef HAVE_STROPTS_H /* Define to 1 if the system has the type `struct ifaddrs'. */ #undef HAVE_STRUCT_IFADDRS /* Define to 1 if the system has the type `struct ifdevea'. */ #undef HAVE_STRUCT_IFDEVEA /* Define to 1 if the system has the type `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ /* Define to 1 if the system has the type `struct if_data'. */ #undef HAVE_STRUCT_IF_DATA /* Define to 1 if the system has the type `struct if_laddrreq'. */ #undef HAVE_STRUCT_IF_LADDRREQ /* Define to 1 if the system has the type `struct in6_ifreq'. */ #undef HAVE_STRUCT_IN6_IFREQ /* Define to 1 if the system has the type `struct lifreq'. */ #undef HAVE_STRUCT_LIFREQ /* define available include file */ #undef HAVE_SYS_DLPI_H /* define available include file */ #undef HAVE_SYS_IOCTL_H /* define available include file */ #undef HAVE_SYS_LINKER_H /* define available include file */ #undef HAVE_SYS_MAC_H /* define available include file */ #undef HAVE_SYS_MODULE_H /* define available include file */ #undef HAVE_SYS_PARAM_H /* define available include file */ #undef HAVE_SYS_SOCKET_H /* define available include file */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* define available include file */ #undef HAVE_SYS_SYSCTL_H /* define available include file */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* define available include file */ #undef HAVE_SYS_UN_H /* Define to 1 if you have . */ #undef HAVE_THREAD_H /* define available include file */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Extra libraries */ #undef LIBS /* define pointer size */ #undef LOCAL_SIZEOF_POINTER /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_ASH /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_AT /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_ATM /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_AX25 /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_DECnet /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_DL /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_EC /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_EON /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_IN /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_IN6 /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_INARP /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_IPX /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_ISO /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_LL /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_NS /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_OSITP /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_ROSE /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_STORAGE /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_TP /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_UN /* define family size */ #undef LOCAL_SIZEOF_SOCKADDR_X25 /* define lifreq union offset */ #undef NI_LIFREQ_OFFSET /* define lifreq pad size */ #undef NI_LIFREQ_PAD /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* define PAGE_SIZE for this operating system */ #undef PAGE_SIZE /* The size of `uint16_t', as computed by sizeof. */ #undef SIZEOF_UINT16_T /* The size of `uint32_t', as computed by sizeof. */ #undef SIZEOF_UINT32_T /* The size of `uint64_t', as computed by sizeof. */ #undef SIZEOF_UINT64_T /* The size of `uint8_t', as computed by sizeof. */ #undef SIZEOF_UINT8_T /* The size of `u_int16_t', as computed by sizeof. */ #undef SIZEOF_U_INT16_T /* The size of `u_int32_t', as computed by sizeof. */ #undef SIZEOF_U_INT32_T /* The size of `u_int64_t', as computed by sizeof. */ #undef SIZEOF_U_INT64_T /* The size of `u_int8_t', as computed by sizeof. */ #undef SIZEOF_U_INT8_T /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* 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 , , or 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 uint64_t typedef from , , or is not used. If the typedef was allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef was allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* OS name defined to version */ #undef __ni_AIX /* OS name defined to version */ #undef __ni_ALPHA /* OS name defined to version */ #undef __ni_BEOS /* OS name defined to version */ #undef __ni_BSD /* OS name defined to version */ #undef __ni_Cygwin /* OS name defined to version */ #undef __ni_DGUX /* OS name defined to version */ #undef __ni_Darwin /* OS name defined to version */ #undef __ni_DragonFly /* OS name defined to version */ #undef __ni_FreeBSD /* OS name defined to version */ #undef __ni_HPUX /* OS name defined to version */ #undef __ni_IRIX /* OS name defined to version */ #undef __ni_Interix /* OS name defined to version */ #undef __ni_Linux /* OS name defined to version */ #undef __ni_MachTen /* OS name defined to version */ #undef __ni_MingW /* OS name defined to version */ #undef __ni_NetBSD /* OS name defined to version */ #undef __ni_Next2 /* OS name defined to version */ #undef __ni_NextStep /* OS name defined to version */ #undef __ni_OSF /* OS name defined to version */ #undef __ni_OpenBSD /* OS name defined to version */ #undef __ni_QNX4 /* OS name defined to version */ #undef __ni_SCO /* OS name defined to version */ #undef __ni_SRV4 /* OS name defined to version */ #undef __ni_SUNOS /* OS name defined to version */ #undef __ni_SunOS /* OS name defined to version */ #undef __ni_Ultrix /* OS name defined to version */ #undef __ni_Unixware /* OS name defined to version */ #undef __ni_Win32 /* OS name defined to version */ #undef __ni_Windows /* 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 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* 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 a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_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 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_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 Net-Interface-1.012/localconf.h0000644000000000000120000000625711154565054015114 0ustar rootwheel /* ******************************************************************** * * localconf.h version 0.01 1-23-09 * * * * COPYRIGHT 2008-2009 Michael Robinton * * * * 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. * * 59 Temple Place, Suite 330 * * Boston, MA 02111-1307, USA * * * * or visit their web page on the internet at: * * * * http://www.gnu.org/copyleft/gpl.html. * * ******************************************************************** */ #include "config.h" #ifdef WORDS_BIGENDIAN #define host_is_BIG_ENDIAN 1 #else #define host_is_LITTLE_ENDIAN 1 #endif #include "defaults.h" #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 #if SIZEOF_U_INT64_T == 0 #undef SIZEOF_U_INT64_T #define SIZEOF_U_INT64_T SIZEOF_UINT64_T typedef uint64_t u_int64_t; #endif #ifdef HAVE_LINUX_NETLINK_H #define HAVE_NETLINK_H #include #endif #ifdef HAVE_LINUX_RTNETLINK_H #define HAVE_RTNETLINK_H #include #endif #include "localperl.h" /* * defined if the C program should include * LOCAL_PERL_WANTS_PTHREAD_H * * defined if perl was compiled to use threads * LOCAL_PERL_USE_THREADS * * defined if perl was compiled to use interpreter threads * LOCAL_PERL_USE_I_THREADS * * defined if perl was compiled to use 5005 threads * LOCAL_PERL_USE_5005_THREADS */ #if defined (HAVE_PTHREAD_H) && defined (LOCAL_PERL_WANTS_PTHREAD_H) #define LOCAL_USE_P_THREADS #include /* only want one flavor of threads */ # ifdef HAVE_THREAD_H # undef HAVE_THREAD_H # endif #endif #if defined (HAVE_THREAD_H) && defined (LOCAL_PERL_USE_THREADS) #include #include #define LOCAL_USE_THREADS #endif #include "netsymbolC.inc" #include "ni_fixups.h" #include "ni_funct.h"