From 53939b407ecaf19c833447464805308c619757c5 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 13 Aug 2000 07:48:56 +0000 Subject: [PATCH] Give, in "README.hpux", what appears to be the new URL for the UK HP-UX Porting and Archive Centre site. Warn in the very beginning of that file that libpcap may not work very well without patches. Give patches to libpcap for: vanilla LBL libpcap 0.4 vanilla tcpdump.org libpcap 0.5 libpcap 0.4 from the HP-UX Porting and Archive Centre (which is the only version that includes configure-script changes to work with HP's C compiler as well as GCC) and put them in files separate from "README.hpux" (to make it easier for users to apply the patches). Make those versions of the patch give a slightly different error message if libpcap fails to find the PPA for the device, to make it easier to figure out if the user reporting a problem with HP-UX capture has a patched version of libpcap or not (so that we know whether the problem may just be that they're using an unmodified libpcap, or if they're running a patched version and that patch needs more work, e.g. to look at devices other than just "/dev/dlpi"). Give information on how to find "patch", warn that probably only the HP-UX Porting and Archive Centre version will work with the HP C compiler, warn that applying a version of the patch other than the one for the particular version of libpcap you've downloaded will probably not work, and warn that you need to download source to libpcap in order to do any of this in the first place. (The current libpcap CVS tree at tcpdump.org has this patch in it, so the next release of libpcap from tcpdump.org should have it; hopefully the HP-UX Porting and Archive Centre will switch to that version when it comes out, and people will just be able to push a few buttons to get an Ethereal that works on HP-UX.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2264 f5534014-38df-0310-8fa8-9805f1628bb7 --- Makefile.am | 5 +- README.hpux | 563 +-------- libpcap-0.4.HPUX.HPUXPAC.patch | 1854 ++++++++++++++++++++++++++++ libpcap-0.4.HPUX.LBL.patch | 503 ++++++++ libpcap-0.5.HPUX.tcpdump.org.patch | 519 ++++++++ 5 files changed, 2927 insertions(+), 517 deletions(-) create mode 100644 libpcap-0.4.HPUX.HPUXPAC.patch create mode 100644 libpcap-0.4.HPUX.LBL.patch create mode 100644 libpcap-0.5.HPUX.tcpdump.org.patch diff --git a/Makefile.am b/Makefile.am index 0c16c0ada1..81ea4b12c0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.220 2000/08/12 05:41:00 guy Exp $ +# $Id: Makefile.am,v 1.221 2000/08/13 07:48:54 guy Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs @@ -514,6 +514,9 @@ EXTRA_DIST = \ image/icon-ethereal.xpm \ image/tethereal.rc \ INSTALL.configure \ + libpcap-0.4.HPUX.HPUXPAC.patch \ + libpcap-0.4.HPUX.LBL.patch \ + libpcap-0.5.HPUX.tcpdump.org.patch \ Makefile.nmake \ make-reg-dotc \ manuf \ diff --git a/README.hpux b/README.hpux index 28a22c04b6..51110805d5 100644 --- a/README.hpux +++ b/README.hpux @@ -1,21 +1,21 @@ -$Id: README.hpux,v 1.12 2000/04/29 08:38:35 guy Exp $ +$Id: README.hpux,v 1.13 2000/08/13 07:48:55 guy Exp $ Contents: 1 - Building ethereal 2 - Building GTK+/GLib with HP's C compiler 3 - nettl support -4 - "libpcap" on HP-UX +4 - libpcap on HP-UX 1 - Building ethereal The Software Porting And Archive Centre for HP-UX, at - http://hpux.csc.liv.ac.uk/ + http://hpux.connect.org.uk/ (and with mirrors in various countries, listed on the Centre's home page) has ported versions, in both source and binary form, for Ethereal, -as well as for the "libpcap", GLib, GTK+, "zlib", and CMU SNMP libraries +as well as for the libpcap, GLib, GTK+, zlib, and CMU SNMP libraries that it uses. The changes they've made appear largely to be compile option changes; if @@ -27,6 +27,14 @@ They appear to have used HP-UX's "cc" compiler, with the options "-Ae -O"; there's a comment "Add -Dhpux_9 if building under 9.X". It may also build with GCC. +The libpcap library has not been changed to properly open network +devices when given the name reported by the lanscan and ifconfig +commands; this means you may have difficulty capturing packets with +Ethereal on HP-UX. The "libpcap on HP-UX" item below discusses patches +to the libpcap source code that should fix this problem, and the process +you will have to go through to apply those patches and build and install +a new version of libpcap that includes those patches. + 2 - Building GTK+/GLib with HP's C compiler By default, HP's C compiler doesn't support "long long int" to provide @@ -359,515 +367,38 @@ know that it didn't work - we'll probably send you debugging patches in the hopes of being able to make it work on 10.20 as well. (It appeared to work in some tests done on HP-UX 10.20 systems.) -Here's the patch (to vanilla libpcap 0.4; it patches "aclocal.m4", -"configure", and "configure.in", to make the configure script check -whether your version of HP-UX supplies the interface names in the reply -to a DL_HP_PPA_REQ request, and patches "pcap-dlpi.c"): - -diff -c ../libpcap-0.4/aclocal.m4 ./aclocal.m4 -*** ../libpcap-0.4/aclocal.m4 Fri Jun 12 03:45:15 1998 ---- ./aclocal.m4 Tue Jan 4 21:02:13 2000 -*************** -*** 415,420 **** ---- 415,454 ---- - fi]) - - dnl -+ dnl Checks to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00 -+ dnl dl_module_id_1 member -+ dnl -+ dnl usage: -+ dnl -+ dnl AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 -+ dnl -+ dnl results: -+ dnl -+ dnl HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 (defined) -+ dnl -+ dnl NOTE: any compile failure means we conclude that it doesn't have -+ dnl that member, so if we don't have DLPI, don't have a -+ dnl header, or have one that doesn't declare a dl_hp_ppa_info_t type, -+ dnl we conclude it doesn't have that member (which is OK, as either we -+ dnl won't be using code that would use that member, or we wouldn't -+ dnl compile in any case). -+ dnl -+ AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1, -+ [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member) -+ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1, -+ AC_TRY_COMPILE([ -+ # include -+ # include -+ # include ], -+ [u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1)], -+ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes, -+ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no)) -+ AC_MSG_RESULT($ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1) -+ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then -+ AC_DEFINE(HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1) -+ fi]) -+ -+ dnl - dnl Checks to see if -R is used - dnl - dnl usage: -Common subdirectories: ../libpcap-0.4/bpf and ./bpf - -diff -c ../libpcap-0.4/configure ./configure -*** ../libpcap-0.4/configure Sat Jul 25 12:41:51 1998 ---- ./configure Fri Jan 14 00:40:04 2000 -*************** -*** 1702,1709 **** - - fi - - echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 -! echo "configure:1707: checking if unaligned accesses fail" >&5 - if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else ---- 1702,1745 ---- - - fi - -+ echo $ac_n "checking if dl_hp_ppa_info_t struct has dl_module_id_1 member""... $ac_c" 1>&6 -+ echo "configure:1707: checking if dl_hp_ppa_info_t struct has dl_module_id_1 member" >&5 -+ if eval "test \"`echo '$''{'ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1'+set}'`\" = set"; then -+ echo $ac_n "(cached) $ac_c" 1>&6 -+ else -+ cat > conftest.$ac_ext < -+ # include -+ # include -+ int main() { -+ u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1) -+ ; return 0; } -+ EOF -+ if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ rm -rf conftest* -+ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes -+ else -+ echo "configure: failed program was:" >&5 -+ cat conftest.$ac_ext >&5 -+ rm -rf conftest* -+ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no -+ fi -+ rm -f conftest* -+ fi -+ -+ echo "$ac_t""$ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1" 1>&6 -+ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then -+ cat >> confdefs.h <<\EOF -+ #define HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 1 -+ EOF -+ -+ fi -+ - echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 -! echo "configure:1743: checking if unaligned accesses fail" >&5 - if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -*************** -*** 1799,1805 **** - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" - # ./install, which can be erroneously created by make from ./install.sh. - echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -! echo "configure:1803: checking for a BSD compatible install" >&5 - if test -z "$INSTALL"; then - if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 ---- 1835,1841 ---- - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" - # ./install, which can be erroneously created by make from ./install.sh. - echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -! echo "configure:1839: checking for a BSD compatible install" >&5 - if test -z "$INSTALL"; then - if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - -diff -c ../libpcap-0.4/configure.in ./configure.in -*** ../libpcap-0.4/configure.in Sun Jul 27 22:16:22 1997 ---- ./configure.in Tue Jan 4 21:02:13 2000 -*************** -*** 154,159 **** ---- 154,161 ---- - - AC_LBL_SOCKADDR_SA_LEN - -+ AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 -+ - AC_LBL_UNALIGNED_ACCESS - - if test "${srcdir}" = "." ; then - -diff -c ../libpcap-0.4/pcap-dlpi.c ./pcap-dlpi.c -*** ../libpcap-0.4/pcap-dlpi.c Wed Oct 15 21:59:34 1997 ---- ./pcap-dlpi.c Wed Apr 26 21:32:33 2000 -*************** -*** 246,255 **** - } - memset(p, 0, sizeof(*p)); - - /* -! ** Determine device and ppa - */ -! cp = strpbrk(device, "0123456789"); - if (cp == NULL) { - sprintf(ebuf, "%s missing unit number", device); - goto bad; ---- 246,266 ---- - } - memset(p, 0, sizeof(*p)); - -+ #ifdef HAVE_DEV_DLPI - /* -! ** Remove any "/dev/" on the front of the device. - */ -! cp = strrchr(device, '/'); -! if (cp == NULL) -! cp = device; -! else -! cp++; -! strcpy(dname, cp); -! -! /* -! * Split the name into a device type and a unit number. -! */ -! cp = strpbrk(dname, "0123456789"); - if (cp == NULL) { - sprintf(ebuf, "%s missing unit number", device); - goto bad; -*************** -*** 259,281 **** - sprintf(ebuf, "%s bad unit number", device); - goto bad; - } - -! if (*device == '/') -! strcpy(dname, device); -! else -! sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); -! #ifdef HAVE_DEV_DLPI -! /* Map network device to /dev/dlpi unit */ - cp = "/dev/dlpi"; - if ((p->fd = open(cp, O_RDWR)) < 0) { - sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); - goto bad; - } -! /* Map network interface to /dev/dlpi unit */ - ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); - if (ppa < 0) - goto bad; - #else - /* Try device without unit number */ - strcpy(dname2, dname); - cp = strchr(dname, *cp); ---- 270,321 ---- - sprintf(ebuf, "%s bad unit number", device); - goto bad; - } -+ *cp = '\0'; - -! /* -! * Use "/dev/dlpi" as the device. -! * -! * XXX - HP's DLPI Programmer's Guide for HP-UX 11.00 says that -! * the "dl_mjr_num" field is for the "major number of interface -! * driver"; that's the major of "/dev/dlpi" on the system on -! * which I tried this, but there may be DLPI devices that -! * use a different driver, in which case we may need to -! * search "/dev" for the appropriate device with that major -! * device number, rather than hardwiring "/dev/dlpi". -! */ - cp = "/dev/dlpi"; - if ((p->fd = open(cp, O_RDWR)) < 0) { - sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); - goto bad; - } -! -! /* -! * Get a table of all PPAs for that device, and search that -! * table for the specified device type name and unit number. -! */ - ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); - if (ppa < 0) - goto bad; - #else -+ /* -+ ** Determine device and ppa -+ */ -+ cp = strpbrk(device, "0123456789"); -+ if (cp == NULL) { -+ sprintf(ebuf, "%s missing unit number", device); -+ goto bad; -+ } -+ ppa = strtol(cp, &eos, 10); -+ if (*eos != '\0') { -+ sprintf(ebuf, "%s bad unit number", device); -+ goto bad; -+ } -+ -+ if (*device == '/') -+ strcpy(dname, device); -+ else -+ sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); -+ - /* Try device without unit number */ - strcpy(dname2, dname); - cp = strchr(dname, *cp); -*************** -*** 391,397 **** - break; - - default: -! sprintf(ebuf, "unknown mac type 0x%lu", infop->dl_mac_type); - goto bad; - } - ---- 431,438 ---- - break; - - default: -! sprintf(ebuf, "unknown mac type 0x%lu", -! (unsigned long)infop->dl_mac_type); - goto bad; - } - -*************** -*** 709,737 **** - - #ifdef DL_HP_PPA_ACK_OBS - /* -! * Under HP-UX 10, we can ask for the ppa - */ - - -! /* Determine ppa number that specifies ifname */ - static int - get_dlpi_ppa(register int fd, register const char *device, register int unit, - register char *ebuf) - { - register dl_hp_ppa_ack_t *ap; -! register dl_hp_ppa_info_t *ip; - register int i; - register u_long majdev; -- dl_hp_ppa_req_t req; - struct stat statbuf; - bpf_u_int32 buf[MAXDLBUF]; - -- if (stat(device, &statbuf) < 0) { -- sprintf(ebuf, "stat: %s: %s", device, pcap_strerror(errno)); -- return (-1); -- } -- majdev = major(statbuf.st_rdev); -- - memset((char *)&req, 0, sizeof(req)); - req.dl_primitive = DL_HP_PPA_REQ; - ---- 750,806 ---- - - #ifdef DL_HP_PPA_ACK_OBS - /* -! * Under HP-UX 10 and HP-UX 11, we can ask for the ppa - */ - - -! /* -! * Determine ppa number that specifies ifname. -! * -! * If the "dl_hp_ppa_info_t" doesn't have a "dl_module_id_1" member, -! * the code that's used here is the old code for HP-UX 10.x. -! * -! * However, HP-UX 10.20, at least, appears to have such a member -! * in its "dl_hp_ppa_info_t" structure, so the new code is used. -! * The new code didn't work on an old 10.20 system on which Rick -! * Jones of HP tried it, but with later patches installed, it -! * worked - it appears that the older system had those members but -! * didn't put anything in them, so, if the search by name fails, we -! * do the old search. -! * -! * Rick suggests that making sure your system is "up on the latest -! * lancommon/DLPI/driver patches" is probably a good idea; it'd fix -! * that problem, as well as allowing libpcap to see packets sent -! * from the system on which the libpcap application is being run. -! * (On 10.20, in addition to getting the latest patches, you need -! * to turn the kernel "lanc_outbound_promisc_flag" flag on with ADB; -! * a posting to "comp.sys.hp.hpux" at -! * -! * http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=558092266 -! * -! * says that, to see the machine's outgoing traffic, you'd need to -! * apply the right patches to your system, and also set that variable -! * with: -! -! echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem -! -! * which could be put in, for example, "/sbin/init.d/lan". -! * -! * Setting the variable is not necessary on HP-UX 11.x. -! */ - static int - get_dlpi_ppa(register int fd, register const char *device, register int unit, - register char *ebuf) - { - register dl_hp_ppa_ack_t *ap; -! register dl_hp_ppa_info_t *ipstart, *ip; - register int i; -+ char dname[100]; - register u_long majdev; - struct stat statbuf; -+ dl_hp_ppa_req_t req; - bpf_u_int32 buf[MAXDLBUF]; - - memset((char *)&req, 0, sizeof(req)); - req.dl_primitive = DL_HP_PPA_REQ; - -*************** -*** 741,760 **** - return (-1); - - ap = (dl_hp_ppa_ack_t *)buf; -! ip = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); - -! for(i = 0; i < ap->dl_count; i++) { -! if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit) -! break; - -! ip = (dl_hp_ppa_info_t *)((u_char *)ip + ip->dl_next_offset); -! } - if (i == ap->dl_count) { -! sprintf(ebuf, "can't find PPA for %s", device); - return (-1); - } - if (ip->dl_hdw_state == HDW_DEAD) { -! sprintf(ebuf, "%s: hardware state: DOWN\n", device); - return (-1); - } - return ((int)ip->dl_ppa); ---- 810,887 ---- - return (-1); - - ap = (dl_hp_ppa_ack_t *)buf; -! ipstart = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); -! ip = ipstart; - -! #ifdef HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 -! /* -! * The "dl_hp_ppa_info_t" structure has a "dl_module_id_1" -! * member that should, in theory, contain the part of the -! * name for the device that comes before the unit number, -! * and should also have a "dl_module_id_2" member that may -! * contain an alternate name (e.g., I think Ethernet devices -! * have both "lan", for "lanN", and "snap", for "snapN", with -! * the former being for Ethernet packets and the latter being -! * for 802.3/802.2 packets). -! * -! * Search for the device that has the specified name and -! * instance number. -! */ -! for (i = 0; i < ap->dl_count; i++) { -! if ((strcmp(ip->dl_module_id_1, device) == 0 || -! strcmp(ip->dl_module_id_2, device) == 0) && -! ip->dl_instance_num == unit) -! break; - -! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); -! } -! #else -! /* -! * We don't have that member, so the search is impossible; make it -! * look as if the search failed. -! */ -! i = ap->dl_count; -! #endif -! -! if (i == ap->dl_count) { -! /* -! * Well, we didn't, or can't, find the device by name. -! * -! * HP-UX 10.20, whilst it has "dl_module_id_1" and -! * "dl_module_id_2" fields in the "dl_hp_ppa_info_t", -! * doesn't seem to fill them in unless the system is -! * at a reasonably up-to-date patch level. -! * -! * Older HP-UX 10.x systems might not have those fields -! * at all. -! * -! * Therefore, we'll search for the entry with the major -! * device number of a device with the name "/dev/", -! * if such a device exists, as the old code did. -! */ -! sprintf(dname, "/dev/%s%d", device, unit); -! if (stat(dname, &statbuf) < 0) { -! sprintf(ebuf, "stat: %s: %s", dname, pcap_strerror(errno)); -! return (-1); -! } -! majdev = major(statbuf.st_rdev); -! -! ip = ipstart; -! -! for (i = 0; i < ap->dl_count; i++) { -! if (ip->dl_mjr_num == majdev && -! ip->dl_instance_num == unit) -! break; -! -! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); -! } -! } - if (i == ap->dl_count) { -! sprintf(ebuf, "can't find PPA for %s%d", device, unit); - return (-1); - } - if (ip->dl_hdw_state == HDW_DEAD) { -! sprintf(ebuf, "%s%d: hardware state: DOWN\n", device, unit); - return (-1); - } - return ((int)ip->dl_ppa); -*************** -*** 783,789 **** - register int kd; - void *addr; - struct ifnet ifnet; -! char if_name[sizeof(ifnet.if_name)], tifname[32]; - - cp = strrchr(ifname, '/'); - if (cp != NULL) ---- 910,916 ---- - register int kd; - void *addr; - struct ifnet ifnet; -! char if_name[sizeof(ifnet.if_name) + 1]; - - cp = strrchr(ifname, '/'); - if (cp != NULL) -*************** -*** 811,823 **** - if (dlpi_kread(kd, (off_t)addr, - &ifnet, sizeof(ifnet), ebuf) < 0 || - dlpi_kread(kd, (off_t)ifnet.if_name, -! if_name, sizeof(if_name), ebuf) < 0) { - (void)close(kd); - return (-1); - } -! sprintf(tifname, "%.*s%d", -! (int)sizeof(if_name), if_name, ifnet.if_unit); -! if (strcmp(tifname, ifname) == 0) - return (ifnet.if_index); - } - ---- 938,949 ---- - if (dlpi_kread(kd, (off_t)addr, - &ifnet, sizeof(ifnet), ebuf) < 0 || - dlpi_kread(kd, (off_t)ifnet.if_name, -! if_name, sizeof(ifnet.if_name), ebuf) < 0) { - (void)close(kd); - return (-1); - } -! if_name[sizeof(ifnet.if_name)] = '\0'; -! if (strcmp(if_name, ifname) == 0 && ifnet.if_unit == unit) - return (ifnet.if_index); - } - +To use this patch, you will need the source to libpcap; if you don't +already have it, it is available from the Software Porting And Archive +Centre for HP-UX (see above for its URL). Search for "libpcap" in the +"Package Search" box. + +The patch would be applied with the "patch" program; if you don't +already have it, it is also available from the Software Porting And +Archive Centre for HP-UX. Search for "patch" in the "Package Search" - +it will find many packages; look for the one in the "Sysadmin" category +with the description "Applies diffs to files to reproduce new versions". + +If you have downloaded the source to libpcap 0.4 from the Porting and +Archive Centre, the patch to use is in the file + + libpcap-0.4.HPUX.HPUXPAC.patch + +If you have downloaded the source to libpcap 0.4 from the Lawrence +Berkeley Laboratory Web site, the patch to use is in the file + + libpcap-0.4.HPUX.LBL.patch + +If you have downloaded the source to libpcap 0.5 from the tcpdump.org +Web site, the patch to use is in the file + + libpcap-0.5.HPUX.tcpdump.org.patch + +Note that the versions from Lawrence Berkeley Laboratory and tcpdump.org +will probably not compile on HP-UX with HP's ANSI C compiler, and will +not build and install a shared library, so patching, building, and +installing those versions will require that you have GCC installed, and +that you download the source to Ethereal and build it from source. + +You should apply only the patch file appropriate to the particular +version of libpcap source that you have downloaded; attempting to apply +a different patch file will probably cause errors. diff --git a/libpcap-0.4.HPUX.HPUXPAC.patch b/libpcap-0.4.HPUX.HPUXPAC.patch new file mode 100644 index 0000000000..f486f9dfad --- /dev/null +++ b/libpcap-0.4.HPUX.HPUXPAC.patch @@ -0,0 +1,1854 @@ +diff -c ../libpcap-0.4.HPUX/aclocal.m4 ./aclocal.m4 +*** ../libpcap-0.4.HPUX/aclocal.m4 Fri Jun 12 03:45:15 1998 +--- ./aclocal.m4 Sat Aug 12 23:38:08 2000 +*************** +*** 415,420 **** +--- 415,454 ---- + fi]) + + dnl ++ dnl Checks to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00 ++ dnl dl_module_id_1 member ++ dnl ++ dnl usage: ++ dnl ++ dnl AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ dnl ++ dnl results: ++ dnl ++ dnl HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 (defined) ++ dnl ++ dnl NOTE: any compile failure means we conclude that it doesn't have ++ dnl that member, so if we don't have DLPI, don't have a ++ dnl header, or have one that doesn't declare a dl_hp_ppa_info_t type, ++ dnl we conclude it doesn't have that member (which is OK, as either we ++ dnl won't be using code that would use that member, or we wouldn't ++ dnl compile in any case). ++ dnl ++ AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1, ++ [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member) ++ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1, ++ AC_TRY_COMPILE([ ++ # include ++ # include ++ # include ], ++ [u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1)], ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes, ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no)) ++ AC_MSG_RESULT($ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1) ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ AC_DEFINE(HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1) ++ fi]) ++ ++ dnl + dnl Checks to see if -R is used + dnl + dnl usage: +diff -c ../libpcap-0.4.HPUX/configure ./configure +*** ../libpcap-0.4.HPUX/configure Fri Feb 11 07:04:51 2000 +--- ./configure Sat Aug 12 23:43:23 2000 +*************** +*** 1,7 **** + #! /bin/sh + + # Guess values for system-dependent variables and create Makefiles. +! # Generated automatically using autoconf version 2.12 + # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # + # This configure script is free software; the Free Software Foundation +--- 1,7 ---- + #! /bin/sh + + # Guess values for system-dependent variables and create Makefiles. +! # Generated automatically using autoconf version 2.13 + # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # + # This configure script is free software; the Free Software Foundation +*************** +*** 63,68 **** +--- 63,69 ---- + # Initialize some other variables. + subdirs= + MFLAGS= MAKEFLAGS= ++ SHELL=${CONFIG_SHELL-/bin/sh} + # Maximum number of lines to put in a shell here document. + ac_max_here_lines=12 + +*************** +*** 346,352 **** + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) +! echo "configure generated by autoconf version 2.12" + exit 0 ;; + + -with-* | --with-*) +--- 347,353 ---- + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) +! echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) +*************** +*** 516,524 **** + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then +--- 517,527 ---- + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + ++ ac_exeext= ++ ac_objext=o + if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then +*************** +*** 575,607 **** + + + # Make sure we can run config.sub. +! if $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 +! echo "configure:578: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in + NONE) + case $nonopt in + NONE) +! if host_alias=`$ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; + esac + +! host=`$ac_config_sub $host_alias` + host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking target system type""... $ac_c" 1>&6 +! echo "configure:599: checking target system type" >&5 + + target_alias=$target + case "$target_alias" in +--- 578,610 ---- + + + # Make sure we can run config.sub. +! if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 +! echo "configure:581: checking host system type" >&5 + + host_alias=$host + case "$host_alias" in + NONE) + case $nonopt in + NONE) +! if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; + esac + +! host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` + host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$host" 1>&6 + + echo $ac_n "checking target system type""... $ac_c" 1>&6 +! echo "configure:602: checking target system type" >&5 + + target_alias=$target + case "$target_alias" in +*************** +*** 612,625 **** + esac ;; + esac + +! target=`$ac_config_sub $target_alias` + target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$target" 1>&6 + + echo $ac_n "checking build system type""... $ac_c" 1>&6 +! echo "configure:617: checking build system type" >&5 + + build_alias=$build + case "$build_alias" in +--- 615,628 ---- + esac ;; + esac + +! target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` + target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + echo "$ac_t""$target" 1>&6 + + echo $ac_n "checking build system type""... $ac_c" 1>&6 +! echo "configure:620: checking build system type" >&5 + + build_alias=$build + case "$build_alias" in +*************** +*** 630,636 **** + esac ;; + esac + +! build=`$ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +--- 633,639 ---- + esac ;; + esac + +! build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` + build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` + build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` + build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +*************** +*** 673,687 **** + # Extract the first word of "shlicc2", so it can be a program name with args. + set dummy shlicc2; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:671: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_SHLICC2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$SHLICC2"; then + ac_cv_prog_SHLICC2="$SHLICC2" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_SHLICC2="yes" +--- 676,691 ---- + # Extract the first word of "shlicc2", so it can be a program name with args. + set dummy shlicc2; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:674: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_SHLICC2'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$SHLICC2"; then + ac_cv_prog_SHLICC2="$SHLICC2" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_SHLICC2="yes" +*************** +*** 713,727 **** + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:711: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" +--- 717,732 ---- + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:715: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" +*************** +*** 742,757 **** + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:740: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + ac_prog_rejected=no +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then +--- 747,763 ---- + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:745: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then +*************** +*** 786,810 **** + echo "$ac_t""no" 1>&6 + fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +! echo "configure:788: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +! ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + +! cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +--- 792,852 ---- + echo "$ac_t""no" 1>&6 + fi + ++ if test -z "$CC"; then ++ case "`uname -s`" in ++ *win32* | *WIN32*) ++ # Extract the first word of "cl", so it can be a program name with args. ++ set dummy cl; ac_word=$2 ++ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++ echo "configure:796: checking for $ac_word" >&5 ++ if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++ else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++ else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="cl" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" ++ fi ++ fi ++ CC="$ac_cv_prog_CC" ++ if test -n "$CC"; then ++ echo "$ac_t""$CC" 1>&6 ++ else ++ echo "$ac_t""no" 1>&6 ++ fi ++ ;; ++ esac ++ fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +! echo "configure:828: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + ac_cpp='$CPP $CPPFLAGS' + ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +! ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' + cross_compiling=$ac_cv_prog_cc_cross + +! cat > conftest.$ac_ext << EOF +! +! #line 839 "configure" + #include "confdefs.h" ++ + main(){return(0);} + EOF +! if { (eval echo configure:844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +*************** +*** 818,835 **** + ac_cv_prog_cc_works=no + fi + rm -fr conftest* + + echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 + if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +! echo "configure:822: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +! echo "configure:827: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 860,883 ---- + ac_cv_prog_cc_works=no + fi + rm -fr conftest* ++ ac_ext=c ++ # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ ac_cpp='$CPP $CPPFLAGS' ++ ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++ cross_compiling=$ac_cv_prog_cc_cross + + echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 + if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +! echo "configure:870: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +! echo "configure:875: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 838,844 **** + yes; + #endif + EOF +! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:836: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +--- 886,892 ---- + yes; + #endif + EOF +! if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +*************** +*** 849,859 **** + + if test $ac_cv_prog_gcc = yes; then + GCC=yes +! ac_test_CFLAGS="${CFLAGS+set}" +! ac_save_CFLAGS="$CFLAGS" +! CFLAGS= +! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +! echo "configure:851: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 897,911 ---- + + if test $ac_cv_prog_gcc = yes; then + GCC=yes +! else +! GCC= +! fi +! +! ac_test_CFLAGS="${CFLAGS+set}" +! ac_save_CFLAGS="$CFLAGS" +! CFLAGS= +! echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +! echo "configure:903: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 868,883 **** + fi + + echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +! if test "$ac_test_CFLAGS" = set; then +! CFLAGS="$ac_save_CFLAGS" +! elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else +! CFLAGS="-O2" + fi + else +! GCC= +! test "${CFLAGS+set}" = set || CFLAGS="-g" + fi + + if test "$GCC" = yes ; then +--- 920,939 ---- + fi + + echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + + if test "$GCC" = yes ; then +*************** +*** 886,892 **** + V_CCOPT="-O2" + else + echo $ac_n "checking gcc version""... $ac_c" 1>&6 +! echo "configure:884: checking gcc version" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_gcc_vers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 942,948 ---- + V_CCOPT="-O2" + else + echo $ac_n "checking gcc version""... $ac_c" 1>&6 +! echo "configure:940: checking gcc version" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_gcc_vers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 904,922 **** + fi + else + echo $ac_n "checking that $CC handles ansi prototypes""... $ac_c" 1>&6 +! echo "configure:902: checking that $CC handles ansi prototypes" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_cc_ansi_prototypes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + int frob(int, char *) + ; return 0; } + EOF +! if { (eval echo configure:914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_ansi_prototypes=yes + else +--- 960,978 ---- + fi + else + echo $ac_n "checking that $CC handles ansi prototypes""... $ac_c" 1>&6 +! echo "configure:958: checking that $CC handles ansi prototypes" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_cc_ansi_prototypes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + int frob(int, char *) + ; return 0; } + EOF +! if { (eval echo configure:970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_ansi_prototypes=yes + else +*************** +*** 934,954 **** + + hpux*) + echo $ac_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)""... $ac_c" 1>&6 +! echo "configure:932: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5 + savedcflags="$CFLAGS" + CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS" + if eval "test \"`echo '$''{'ac_cv_lbl_cc_hpux_cc_aa'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + int frob(int, char *) + ; return 0; } + EOF +! if { (eval echo configure:946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_hpux_cc_aa=yes + else +--- 990,1010 ---- + + hpux*) + echo $ac_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)""... $ac_c" 1>&6 +! echo "configure:988: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5 + savedcflags="$CFLAGS" + CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS" + if eval "test \"`echo '$''{'ac_cv_lbl_cc_hpux_cc_aa'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + int frob(int, char *) + ; return 0; } + EOF +! if { (eval echo configure:1002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_hpux_cc_aa=yes + else +*************** +*** 991,1002 **** + + ultrix*) + echo $ac_n "checking that Ultrix $CC hacks const in prototypes""... $ac_c" 1>&6 +! echo "configure:990: checking that Ultrix $CC hacks const in prototypes" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_cc_const_proto'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { +--- 1047,1058 ---- + + ultrix*) + echo $ac_n "checking that Ultrix $CC hacks const in prototypes""... $ac_c" 1>&6 +! echo "configure:1046: checking that Ultrix $CC hacks const in prototypes" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_cc_const_proto'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { +*************** +*** 1004,1010 **** + void c(const struct a *) + ; return 0; } + EOF +! if { (eval echo configure:1003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_const_proto=yes + else +--- 1060,1066 ---- + void c(const struct a *) + ; return 0; } + EOF +! if { (eval echo configure:1059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_cc_const_proto=yes + else +*************** +*** 1029,1035 **** + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +! echo "configure:1028: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +--- 1085,1091 ---- + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +! echo "configure:1084: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +*************** +*** 1044,1057 **** + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + : + else +--- 1100,1113 ---- + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1105: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else +*************** +*** 1061,1074 **** + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + : + else +--- 1117,1147 ---- + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +! Syntax Error +! EOF +! ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +! if test -z "$ac_err"; then +! : +! else +! echo "$ac_err" >&5 +! echo "configure: failed program was:" >&5 +! cat conftest.$ac_ext >&5 +! rm -rf conftest* +! CPP="${CC-cc} -nologo -E" +! cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : + else +*************** +*** 1081,1086 **** +--- 1154,1161 ---- + rm -f conftest* + fi + rm -f conftest* ++ fi ++ rm -f conftest* + ac_cv_prog_CPP="$CPP" + fi + CPP="$ac_cv_prog_CPP" +*************** +*** 1093,1110 **** + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +! echo "configure:1092: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +--- 1168,1185 ---- + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +! echo "configure:1167: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +*************** +*** 1132,1143 **** + + if test "$GCC" = yes ; then + echo $ac_n "checking for ANSI ioctl definitions""... $ac_c" 1>&6 +! echo "configure:1131: checking for ANSI ioctl definitions" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_gcc_fixincludes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&6 +! echo "configure:1206: checking for ANSI ioctl definitions" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_gcc_fixincludes'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_gcc_fixincludes=yes + else +--- 1231,1237 ---- + } + ; return 0; } + EOF +! if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_gcc_fixincludes=yes + else +*************** +*** 1179,1190 **** + for ac_func in ether_hostton strerror + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +! echo "configure:1178: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&6 +! echo "configure:1253: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +--- 1282,1288 ---- + + ; return 0; } + EOF +! if { (eval echo configure:1281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +*************** +*** 1239,1245 **** + fi + + echo $ac_n "checking packet capture type""... $ac_c" 1>&6 +! echo "configure:1238: checking packet capture type" >&5 + if test ! -z "$with_pcap" ; then + V_PCAP="$withval" + elif test -r /dev/bpf0 ; then +--- 1314,1320 ---- + fi + + echo $ac_n "checking packet capture type""... $ac_c" 1>&6 +! echo "configure:1313: checking packet capture type" >&5 + if test ! -z "$with_pcap" ; then + V_PCAP="$withval" + elif test -r /dev/bpf0 ; then +*************** +*** 1276,1293 **** + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +! echo "configure:1275: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +--- 1351,1368 ---- + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +! echo "configure:1350: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1360: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +*************** +*** 1313,1319 **** + done + + echo $ac_n "checking for /dev/dlpi device""... $ac_c" 1>&6 +! echo "configure:1312: checking for /dev/dlpi device" >&5 + if test -c /dev/dlpi ; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +--- 1388,1394 ---- + done + + echo $ac_n "checking for /dev/dlpi device""... $ac_c" 1>&6 +! echo "configure:1387: checking for /dev/dlpi device" >&5 + if test -c /dev/dlpi ; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +*************** +*** 1324,1330 **** + echo "$ac_t""no" 1>&6 + dir="/dev/dlpi" + echo $ac_n "checking for $dir directory""... $ac_c" 1>&6 +! echo "configure:1323: checking for $dir directory" >&5 + if test -d $dir ; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 + dir="/dev/dlpi" + echo $ac_n "checking for $dir directory""... $ac_c" 1>&6 +! echo "configure:1398: checking for $dir directory" >&5 + if test -d $dir ; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 +! echo "configure:1341: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1351: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +--- 1417,1434 ---- + do + ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +! echo "configure:1416: checking for $ac_hdr" >&5 + if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +! { (eval echo configure:1426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +! ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +*************** +*** 1379,1385 **** + done + + echo $ac_n "checking Linux kernel version""... $ac_c" 1>&6 +! echo "configure:1378: checking Linux kernel version" >&5 + if eval "test \"`echo '$''{'ac_cv_linux_vers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 1454,1460 ---- + done + + echo $ac_n "checking Linux kernel version""... $ac_c" 1>&6 +! echo "configure:1453: checking Linux kernel version" >&5 + if eval "test \"`echo '$''{'ac_cv_linux_vers'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 1420,1434 **** + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1419: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_LEX"; then + ac_cv_prog_V_LEX="$V_LEX" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_LEX="$ac_prog" +--- 1495,1510 ---- + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1494: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_LEX'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_LEX"; then + ac_cv_prog_V_LEX="$V_LEX" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_LEX="$ac_prog" +*************** +*** 1453,1459 **** + if test "$V_LEX" = flex ; then + # The -V flag was added in 2.4 + echo $ac_n "checking for flex 2.4 or higher""... $ac_c" 1>&6 +! echo "configure:1452: checking for flex 2.4 or higher" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_flex_v24'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 1529,1535 ---- + if test "$V_LEX" = flex ; then + # The -V flag was added in 2.4 + echo $ac_n "checking for flex 2.4 or higher""... $ac_c" 1>&6 +! echo "configure:1528: checking for flex 2.4 or higher" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_flex_v24'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 1479,1493 **** + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1478: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_YACC"; then + ac_cv_prog_V_YACC="$V_YACC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_YACC="$ac_prog" +--- 1555,1570 ---- + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1554: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_YACC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_YACC"; then + ac_cv_prog_V_YACC="$V_YACC" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_YACC="$ac_prog" +*************** +*** 1553,1571 **** + + sinix*) + echo $ac_n "checking if SINIX compiler defines sinix""... $ac_c" 1>&6 +! echo "configure:1552: checking if SINIX compiler defines sinix" >&5 + if eval "test \"`echo '$''{'ac_cv_cc_sinix_defined'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cc_sinix_defined=yes + else +--- 1630,1648 ---- + + sinix*) + echo $ac_n "checking if SINIX compiler defines sinix""... $ac_c" 1>&6 +! echo "configure:1629: checking if SINIX compiler defines sinix" >&5 + if eval "test \"`echo '$''{'ac_cv_cc_sinix_defined'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cc_sinix_defined=yes + else +*************** +*** 1603,1617 **** + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1602: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_RANLIB"; then + ac_cv_prog_V_RANLIB="$V_RANLIB" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" +! for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_RANLIB="$ac_prog" +--- 1680,1695 ---- + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +! echo "configure:1679: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_V_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + if test -n "$V_RANLIB"; then + ac_cv_prog_V_RANLIB="$V_RANLIB" # Let the user override the test. + else +! IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +! ac_dummy="$PATH" +! for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_V_RANLIB="$ac_prog" +*************** +*** 1673,1684 **** + fi + + echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6 +! echo "configure:1672: checking if sockaddr struct has sa_len member" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +--- 1751,1762 ---- + fi + + echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6 +! echo "configure:1750: checking if sockaddr struct has sa_len member" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < +*************** +*** 1687,1693 **** + u_int i = sizeof(((struct sockaddr *)0)->sa_len) + ; return 0; } + EOF +! if { (eval echo configure:1686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_sockaddr_has_sa_len=yes + else +--- 1765,1771 ---- + u_int i = sizeof(((struct sockaddr *)0)->sa_len) + ; return 0; } + EOF +! if { (eval echo configure:1764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_lbl_sockaddr_has_sa_len=yes + else +*************** +*** 1707,1714 **** + + fi + + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1707: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 1785,1828 ---- + + fi + ++ echo $ac_n "checking if dl_hp_ppa_info_t struct has dl_module_id_1 member""... $ac_c" 1>&6 ++ echo "configure:1785: checking if dl_hp_ppa_info_t struct has dl_module_id_1 member" >&5 ++ if eval "test \"`echo '$''{'ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++ else ++ cat > conftest.$ac_ext < ++ # include ++ # include ++ int main() { ++ u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1) ++ ; return 0; } ++ EOF ++ if { (eval echo configure:1800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes ++ else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no ++ fi ++ rm -f conftest* ++ fi ++ ++ echo "$ac_t""$ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1" 1>&6 ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ cat >> confdefs.h <<\EOF ++ #define HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 1 ++ EOF ++ ++ fi ++ + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1821: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 1800,1827 **** + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1803: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +! IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +! for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. +- # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" +--- 1914,1943 ---- + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install ++ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1918: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +! IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. +! # Don't use installbsd from OSF since it installs stuff as root +! # by default. +! for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" +*************** +*** 1851,1856 **** +--- 1967,1974 ---- + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + ++ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' ++ + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +*************** +*** 1877,1883 **** + # 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. + (set) 2>&1 | +! case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). +--- 1995,2001 ---- + # 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. + (set) 2>&1 | +! case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). +*************** +*** 1956,1962 **** + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) +! echo "$CONFIG_STATUS generated by autoconf version 2.12" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; +--- 2074,2080 ---- + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) +! echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; +*************** +*** 1976,1984 **** +--- 2094,2104 ---- + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF + $ac_vpsub + $extrasub ++ s%@SHELL@%$SHELL%g + s%@CFLAGS@%$CFLAGS%g + s%@CPPFLAGS@%$CPPFLAGS%g + s%@CXXFLAGS@%$CXXFLAGS%g ++ s%@FFLAGS@%$FFLAGS%g + s%@DEFS@%$DEFS%g + s%@LDFLAGS@%$LDFLAGS%g + s%@LIBS@%$LIBS%g +*************** +*** 2022,2027 **** +--- 2142,2148 ---- + s%@V_INCLS@%$V_INCLS%g + s%@V_PCAP@%$V_PCAP%g + s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g ++ s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g + s%@INSTALL_DATA@%$INSTALL_DATA%g + + CEOF +diff -c ../libpcap-0.4.HPUX/configure.in ./configure.in +*** ../libpcap-0.4.HPUX/configure.in Sun Jul 27 22:16:22 1997 +--- ./configure.in Sat Aug 12 23:38:08 2000 +*************** +*** 154,159 **** +--- 154,161 ---- + + AC_LBL_SOCKADDR_SA_LEN + ++ AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ + AC_LBL_UNALIGNED_ACCESS + + if test "${srcdir}" = "." ; then +diff -c ../libpcap-0.4.HPUX/pcap-dlpi.c ./pcap-dlpi.c +*** ../libpcap-0.4.HPUX/pcap-dlpi.c Wed Oct 15 21:59:34 1997 +--- ./pcap-dlpi.c Sat Aug 12 23:39:39 2000 +*************** +*** 246,255 **** + } + memset(p, 0, sizeof(*p)); + + /* +! ** Determine device and ppa + */ +! cp = strpbrk(device, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +--- 246,266 ---- + } + memset(p, 0, sizeof(*p)); + ++ #ifdef HAVE_DEV_DLPI + /* +! ** Remove any "/dev/" on the front of the device. + */ +! cp = strrchr(device, '/'); +! if (cp == NULL) +! cp = device; +! else +! cp++; +! strcpy(dname, cp); +! +! /* +! * Split the name into a device type and a unit number. +! */ +! cp = strpbrk(dname, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +*************** +*** 259,281 **** + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } + +! if (*device == '/') +! strcpy(dname, device); +! else +! sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); +! #ifdef HAVE_DEV_DLPI +! /* Map network device to /dev/dlpi unit */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! /* Map network interface to /dev/dlpi unit */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +--- 270,321 ---- + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } ++ *cp = '\0'; + +! /* +! * Use "/dev/dlpi" as the device. +! * +! * XXX - HP's DLPI Programmer's Guide for HP-UX 11.00 says that +! * the "dl_mjr_num" field is for the "major number of interface +! * driver"; that's the major of "/dev/dlpi" on the system on +! * which I tried this, but there may be DLPI devices that +! * use a different driver, in which case we may need to +! * search "/dev" for the appropriate device with that major +! * device number, rather than hardwiring "/dev/dlpi". +! */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! +! /* +! * Get a table of all PPAs for that device, and search that +! * table for the specified device type name and unit number. +! */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else ++ /* ++ ** Determine device and ppa ++ */ ++ cp = strpbrk(device, "0123456789"); ++ if (cp == NULL) { ++ sprintf(ebuf, "%s missing unit number", device); ++ goto bad; ++ } ++ ppa = strtol(cp, &eos, 10); ++ if (*eos != '\0') { ++ sprintf(ebuf, "%s bad unit number", device); ++ goto bad; ++ } ++ ++ if (*device == '/') ++ strcpy(dname, device); ++ else ++ sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); ++ + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +*************** +*** 391,397 **** + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", infop->dl_mac_type); + goto bad; + } + +--- 431,438 ---- + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", +! (unsigned long)infop->dl_mac_type); + goto bad; + } + +*************** +*** 709,737 **** + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10, we can ask for the ppa + */ + + +! /* Determine ppa number that specifies ifname */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ip; + register int i; + register u_long majdev; +- dl_hp_ppa_req_t req; + struct stat statbuf; + bpf_u_int32 buf[MAXDLBUF]; + +- if (stat(device, &statbuf) < 0) { +- sprintf(ebuf, "stat: %s: %s", device, pcap_strerror(errno)); +- return (-1); +- } +- majdev = major(statbuf.st_rdev); +- + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +--- 750,806 ---- + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10 and HP-UX 11, we can ask for the ppa + */ + + +! /* +! * Determine ppa number that specifies ifname. +! * +! * If the "dl_hp_ppa_info_t" doesn't have a "dl_module_id_1" member, +! * the code that's used here is the old code for HP-UX 10.x. +! * +! * However, HP-UX 10.20, at least, appears to have such a member +! * in its "dl_hp_ppa_info_t" structure, so the new code is used. +! * The new code didn't work on an old 10.20 system on which Rick +! * Jones of HP tried it, but with later patches installed, it +! * worked - it appears that the older system had those members but +! * didn't put anything in them, so, if the search by name fails, we +! * do the old search. +! * +! * Rick suggests that making sure your system is "up on the latest +! * lancommon/DLPI/driver patches" is probably a good idea; it'd fix +! * that problem, as well as allowing libpcap to see packets sent +! * from the system on which the libpcap application is being run. +! * (On 10.20, in addition to getting the latest patches, you need +! * to turn the kernel "lanc_outbound_promisc_flag" flag on with ADB; +! * a posting to "comp.sys.hp.hpux" at +! * +! * http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=558092266 +! * +! * says that, to see the machine's outgoing traffic, you'd need to +! * apply the right patches to your system, and also set that variable +! * with: +! +! echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem +! +! * which could be put in, for example, "/sbin/init.d/lan". +! * +! * Setting the variable is not necessary on HP-UX 11.x. +! */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ipstart, *ip; + register int i; ++ char dname[100]; + register u_long majdev; + struct stat statbuf; ++ dl_hp_ppa_req_t req; + bpf_u_int32 buf[MAXDLBUF]; + + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +*************** +*** 741,760 **** + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ip = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); + +! for(i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ip + ip->dl_next_offset); +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find PPA for %s", device); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s: hardware state: DOWN\n", device); + return (-1); + } + return ((int)ip->dl_ppa); +--- 810,887 ---- + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ipstart = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); +! ip = ipstart; + +! #ifdef HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 +! /* +! * The "dl_hp_ppa_info_t" structure has a "dl_module_id_1" +! * member that should, in theory, contain the part of the +! * name for the device that comes before the unit number, +! * and should also have a "dl_module_id_2" member that may +! * contain an alternate name (e.g., I think Ethernet devices +! * have both "lan", for "lanN", and "snap", for "snapN", with +! * the former being for Ethernet packets and the latter being +! * for 802.3/802.2 packets). +! * +! * Search for the device that has the specified name and +! * instance number. +! */ +! for (i = 0; i < ap->dl_count; i++) { +! if ((strcmp(ip->dl_module_id_1, device) == 0 || +! strcmp(ip->dl_module_id_2, device) == 0) && +! ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! #else +! /* +! * We don't have that member, so the search is impossible; make it +! * look as if the search failed. +! */ +! i = ap->dl_count; +! #endif +! +! if (i == ap->dl_count) { +! /* +! * Well, we didn't, or can't, find the device by name. +! * +! * HP-UX 10.20, whilst it has "dl_module_id_1" and +! * "dl_module_id_2" fields in the "dl_hp_ppa_info_t", +! * doesn't seem to fill them in unless the system is +! * at a reasonably up-to-date patch level. +! * +! * Older HP-UX 10.x systems might not have those fields +! * at all. +! * +! * Therefore, we'll search for the entry with the major +! * device number of a device with the name "/dev/", +! * if such a device exists, as the old code did. +! */ +! sprintf(dname, "/dev/%s%d", device, unit); +! if (stat(dname, &statbuf) < 0) { +! sprintf(ebuf, "stat: %s: %s", dname, pcap_strerror(errno)); +! return (-1); +! } +! majdev = major(statbuf.st_rdev); +! +! ip = ipstart; +! +! for (i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && +! ip->dl_instance_num == unit) +! break; +! +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find /dev/dlpi PPA for %s%d", device, unit); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s%d: hardware state: DOWN\n", device, unit); + return (-1); + } + return ((int)ip->dl_ppa); +*************** +*** 783,789 **** + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name)], tifname[32]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +--- 910,916 ---- + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name) + 1]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +*************** +*** 811,823 **** + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! sprintf(tifname, "%.*s%d", +! (int)sizeof(if_name), if_name, ifnet.if_unit); +! if (strcmp(tifname, ifname) == 0) + return (ifnet.if_index); + } + +--- 938,949 ---- + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(ifnet.if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! if_name[sizeof(ifnet.if_name)] = '\0'; +! if (strcmp(if_name, ifname) == 0 && ifnet.if_unit == unit) + return (ifnet.if_index); + } + diff --git a/libpcap-0.4.HPUX.LBL.patch b/libpcap-0.4.HPUX.LBL.patch new file mode 100644 index 0000000000..99c47b5f62 --- /dev/null +++ b/libpcap-0.4.HPUX.LBL.patch @@ -0,0 +1,503 @@ +diff -c ../libpcap-0.4/aclocal.m4 ./aclocal.m4 +*** ../libpcap-0.4/aclocal.m4 Fri Jun 12 03:45:15 1998 +--- ./aclocal.m4 Tue Jan 4 21:02:13 2000 +*************** +*** 415,420 **** +--- 415,454 ---- + fi]) + + dnl ++ dnl Checks to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00 ++ dnl dl_module_id_1 member ++ dnl ++ dnl usage: ++ dnl ++ dnl AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ dnl ++ dnl results: ++ dnl ++ dnl HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 (defined) ++ dnl ++ dnl NOTE: any compile failure means we conclude that it doesn't have ++ dnl that member, so if we don't have DLPI, don't have a ++ dnl header, or have one that doesn't declare a dl_hp_ppa_info_t type, ++ dnl we conclude it doesn't have that member (which is OK, as either we ++ dnl won't be using code that would use that member, or we wouldn't ++ dnl compile in any case). ++ dnl ++ AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1, ++ [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member) ++ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1, ++ AC_TRY_COMPILE([ ++ # include ++ # include ++ # include ], ++ [u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1)], ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes, ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no)) ++ AC_MSG_RESULT($ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1) ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ AC_DEFINE(HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1) ++ fi]) ++ ++ dnl + dnl Checks to see if -R is used + dnl + dnl usage: +diff -c ../libpcap-0.4/configure ./configure +*** ../libpcap-0.4/configure Sat Jul 25 12:41:51 1998 +--- ./configure Fri Jan 14 00:40:04 2000 +*************** +*** 1702,1709 **** + + fi + + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1707: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 1702,1745 ---- + + fi + ++ echo $ac_n "checking if dl_hp_ppa_info_t struct has dl_module_id_1 member""... $ac_c" 1>&6 ++ echo "configure:1707: checking if dl_hp_ppa_info_t struct has dl_module_id_1 member" >&5 ++ if eval "test \"`echo '$''{'ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++ else ++ cat > conftest.$ac_ext < ++ # include ++ # include ++ int main() { ++ u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1) ++ ; return 0; } ++ EOF ++ if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes ++ else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no ++ fi ++ rm -f conftest* ++ fi ++ ++ echo "$ac_t""$ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1" 1>&6 ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ cat >> confdefs.h <<\EOF ++ #define HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 1 ++ EOF ++ ++ fi ++ + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1743: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 1799,1805 **** + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1803: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +--- 1835,1841 ---- + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1839: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +diff -c ../libpcap-0.4/configure.in ./configure.in +*** ../libpcap-0.4/configure.in Sun Jul 27 22:16:22 1997 +--- ./configure.in Tue Jan 4 21:02:13 2000 +*************** +*** 154,159 **** +--- 154,161 ---- + + AC_LBL_SOCKADDR_SA_LEN + ++ AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ + AC_LBL_UNALIGNED_ACCESS + + if test "${srcdir}" = "." ; then +diff -c ../libpcap-0.4/pcap-dlpi.c ./pcap-dlpi.c +*** ../libpcap-0.4/pcap-dlpi.c Wed Oct 15 21:59:34 1997 +--- ./pcap-dlpi.c Sat Aug 12 23:57:13 2000 +*************** +*** 246,255 **** + } + memset(p, 0, sizeof(*p)); + + /* +! ** Determine device and ppa + */ +! cp = strpbrk(device, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +--- 246,266 ---- + } + memset(p, 0, sizeof(*p)); + ++ #ifdef HAVE_DEV_DLPI + /* +! ** Remove any "/dev/" on the front of the device. + */ +! cp = strrchr(device, '/'); +! if (cp == NULL) +! cp = device; +! else +! cp++; +! strcpy(dname, cp); +! +! /* +! * Split the name into a device type and a unit number. +! */ +! cp = strpbrk(dname, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +*************** +*** 259,281 **** + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } + +! if (*device == '/') +! strcpy(dname, device); +! else +! sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); +! #ifdef HAVE_DEV_DLPI +! /* Map network device to /dev/dlpi unit */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! /* Map network interface to /dev/dlpi unit */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +--- 270,321 ---- + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } ++ *cp = '\0'; + +! /* +! * Use "/dev/dlpi" as the device. +! * +! * XXX - HP's DLPI Programmer's Guide for HP-UX 11.00 says that +! * the "dl_mjr_num" field is for the "major number of interface +! * driver"; that's the major of "/dev/dlpi" on the system on +! * which I tried this, but there may be DLPI devices that +! * use a different driver, in which case we may need to +! * search "/dev" for the appropriate device with that major +! * device number, rather than hardwiring "/dev/dlpi". +! */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! +! /* +! * Get a table of all PPAs for that device, and search that +! * table for the specified device type name and unit number. +! */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else ++ /* ++ ** Determine device and ppa ++ */ ++ cp = strpbrk(device, "0123456789"); ++ if (cp == NULL) { ++ sprintf(ebuf, "%s missing unit number", device); ++ goto bad; ++ } ++ ppa = strtol(cp, &eos, 10); ++ if (*eos != '\0') { ++ sprintf(ebuf, "%s bad unit number", device); ++ goto bad; ++ } ++ ++ if (*device == '/') ++ strcpy(dname, device); ++ else ++ sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); ++ + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +*************** +*** 391,397 **** + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", infop->dl_mac_type); + goto bad; + } + +--- 431,438 ---- + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", +! (unsigned long)infop->dl_mac_type); + goto bad; + } + +*************** +*** 709,737 **** + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10, we can ask for the ppa + */ + + +! /* Determine ppa number that specifies ifname */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ip; + register int i; + register u_long majdev; +- dl_hp_ppa_req_t req; + struct stat statbuf; + bpf_u_int32 buf[MAXDLBUF]; + +- if (stat(device, &statbuf) < 0) { +- sprintf(ebuf, "stat: %s: %s", device, pcap_strerror(errno)); +- return (-1); +- } +- majdev = major(statbuf.st_rdev); +- + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +--- 750,806 ---- + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10 and HP-UX 11, we can ask for the ppa + */ + + +! /* +! * Determine ppa number that specifies ifname. +! * +! * If the "dl_hp_ppa_info_t" doesn't have a "dl_module_id_1" member, +! * the code that's used here is the old code for HP-UX 10.x. +! * +! * However, HP-UX 10.20, at least, appears to have such a member +! * in its "dl_hp_ppa_info_t" structure, so the new code is used. +! * The new code didn't work on an old 10.20 system on which Rick +! * Jones of HP tried it, but with later patches installed, it +! * worked - it appears that the older system had those members but +! * didn't put anything in them, so, if the search by name fails, we +! * do the old search. +! * +! * Rick suggests that making sure your system is "up on the latest +! * lancommon/DLPI/driver patches" is probably a good idea; it'd fix +! * that problem, as well as allowing libpcap to see packets sent +! * from the system on which the libpcap application is being run. +! * (On 10.20, in addition to getting the latest patches, you need +! * to turn the kernel "lanc_outbound_promisc_flag" flag on with ADB; +! * a posting to "comp.sys.hp.hpux" at +! * +! * http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=558092266 +! * +! * says that, to see the machine's outgoing traffic, you'd need to +! * apply the right patches to your system, and also set that variable +! * with: +! +! echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem +! +! * which could be put in, for example, "/sbin/init.d/lan". +! * +! * Setting the variable is not necessary on HP-UX 11.x. +! */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ipstart, *ip; + register int i; ++ char dname[100]; + register u_long majdev; + struct stat statbuf; ++ dl_hp_ppa_req_t req; + bpf_u_int32 buf[MAXDLBUF]; + + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +*************** +*** 741,760 **** + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ip = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); + +! for(i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ip + ip->dl_next_offset); +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find PPA for %s", device); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s: hardware state: DOWN\n", device); + return (-1); + } + return ((int)ip->dl_ppa); +--- 810,887 ---- + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ipstart = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); +! ip = ipstart; + +! #ifdef HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 +! /* +! * The "dl_hp_ppa_info_t" structure has a "dl_module_id_1" +! * member that should, in theory, contain the part of the +! * name for the device that comes before the unit number, +! * and should also have a "dl_module_id_2" member that may +! * contain an alternate name (e.g., I think Ethernet devices +! * have both "lan", for "lanN", and "snap", for "snapN", with +! * the former being for Ethernet packets and the latter being +! * for 802.3/802.2 packets). +! * +! * Search for the device that has the specified name and +! * instance number. +! */ +! for (i = 0; i < ap->dl_count; i++) { +! if ((strcmp(ip->dl_module_id_1, device) == 0 || +! strcmp(ip->dl_module_id_2, device) == 0) && +! ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! #else +! /* +! * We don't have that member, so the search is impossible; make it +! * look as if the search failed. +! */ +! i = ap->dl_count; +! #endif +! +! if (i == ap->dl_count) { +! /* +! * Well, we didn't, or can't, find the device by name. +! * +! * HP-UX 10.20, whilst it has "dl_module_id_1" and +! * "dl_module_id_2" fields in the "dl_hp_ppa_info_t", +! * doesn't seem to fill them in unless the system is +! * at a reasonably up-to-date patch level. +! * +! * Older HP-UX 10.x systems might not have those fields +! * at all. +! * +! * Therefore, we'll search for the entry with the major +! * device number of a device with the name "/dev/", +! * if such a device exists, as the old code did. +! */ +! sprintf(dname, "/dev/%s%d", device, unit); +! if (stat(dname, &statbuf) < 0) { +! sprintf(ebuf, "stat: %s: %s", dname, pcap_strerror(errno)); +! return (-1); +! } +! majdev = major(statbuf.st_rdev); +! +! ip = ipstart; +! +! for (i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && +! ip->dl_instance_num == unit) +! break; +! +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find /dev/dlpi PPA for %s%d", device, unit); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s%d: hardware state: DOWN\n", device, unit); + return (-1); + } + return ((int)ip->dl_ppa); +*************** +*** 783,789 **** + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name)], tifname[32]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +--- 910,916 ---- + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name) + 1]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +*************** +*** 811,823 **** + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! sprintf(tifname, "%.*s%d", +! (int)sizeof(if_name), if_name, ifnet.if_unit); +! if (strcmp(tifname, ifname) == 0) + return (ifnet.if_index); + } + +--- 938,949 ---- + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(ifnet.if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! if_name[sizeof(ifnet.if_name)] = '\0'; +! if (strcmp(if_name, ifname) == 0 && ifnet.if_unit == unit) + return (ifnet.if_index); + } + diff --git a/libpcap-0.5.HPUX.tcpdump.org.patch b/libpcap-0.5.HPUX.tcpdump.org.patch new file mode 100644 index 0000000000..3031f3fcd5 --- /dev/null +++ b/libpcap-0.5.HPUX.tcpdump.org.patch @@ -0,0 +1,519 @@ +Index: aclocal.m4 +=================================================================== +RCS file: /tcpdump/master/libpcap/aclocal.m4,v +retrieving revision 1.66 +diff -c -r1.66 aclocal.m4 +*** aclocal.m4 1999/10/30 04:41:48 1.66 +--- aclocal.m4 2000/08/13 07:23:45 +*************** +*** 415,420 **** +--- 415,454 ---- + fi]) + + dnl ++ dnl Checks to see if the dl_hp_ppa_info_t struct has the HP-UX 11.00 ++ dnl dl_module_id_1 member ++ dnl ++ dnl usage: ++ dnl ++ dnl AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ dnl ++ dnl results: ++ dnl ++ dnl HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 (defined) ++ dnl ++ dnl NOTE: any compile failure means we conclude that it doesn't have ++ dnl that member, so if we don't have DLPI, don't have a ++ dnl header, or have one that doesn't declare a dl_hp_ppa_info_t type, ++ dnl we conclude it doesn't have that member (which is OK, as either we ++ dnl won't be using code that would use that member, or we wouldn't ++ dnl compile in any case). ++ dnl ++ AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1, ++ [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member) ++ AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1, ++ AC_TRY_COMPILE([ ++ # include ++ # include ++ # include ], ++ [u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1)], ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes, ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no)) ++ AC_MSG_RESULT($ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1) ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ AC_DEFINE(HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1) ++ fi]) ++ ++ dnl + dnl Checks to see if -R is used + dnl + dnl usage: +Index: configure +=================================================================== +RCS file: /tcpdump/master/libpcap/configure,v +retrieving revision 1.5 +diff -c -r1.5 configure +*** configure 1999/11/01 15:56:40 1.5 +--- configure 2000/08/13 07:23:50 +*************** +*** 1822,1829 **** + + fi + + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1827: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +--- 1822,1865 ---- + + fi + ++ echo $ac_n "checking if dl_hp_ppa_info_t struct has dl_module_id_1 member""... $ac_c" 1>&6 ++ echo "configure:1827: checking if dl_hp_ppa_info_t struct has dl_module_id_1 member" >&5 ++ if eval "test \"`echo '$''{'ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++ else ++ cat > conftest.$ac_ext < ++ # include ++ # include ++ int main() { ++ u_int i = sizeof(((dl_hp_ppa_info_t *)0)->dl_module_id_1) ++ ; return 0; } ++ EOF ++ if { (eval echo configure:1842: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=yes ++ else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1=no ++ fi ++ rm -f conftest* ++ fi ++ ++ echo "$ac_t""$ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1" 1>&6 ++ if test $ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1 = yes ; then ++ cat >> confdefs.h <<\EOF ++ #define HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 1 ++ EOF ++ ++ fi ++ + echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6 +! echo "configure:1863: checking if unaligned accesses fail" >&5 + if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +*************** +*** 1912,1918 **** + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1916: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +--- 1948,1954 ---- + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +! echo "configure:1952: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +Index: configure.in +=================================================================== +RCS file: /tcpdump/master/libpcap/configure.in,v +retrieving revision 1.71 +diff -c -r1.71 configure.in +*** configure.in 1999/11/01 15:56:40 1.71 +--- configure.in 2000/08/13 07:23:51 +*************** +*** 175,180 **** +--- 175,182 ---- + + AC_LBL_SOCKADDR_SA_LEN + ++ AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1 ++ + AC_LBL_UNALIGNED_ACCESS + + if test -r ${srcdir}/lbl/gnuc.h ; then +Index: pcap-dlpi.c +=================================================================== +RCS file: /tcpdump/master/libpcap/pcap-dlpi.c,v +retrieving revision 1.52.1.1 +diff -c -r1.52.1.1 pcap-dlpi.c +*** pcap-dlpi.c 1999/10/07 23:46:40 1.52.1.1 +--- pcap-dlpi.c 2000/08/13 07:23:52 +*************** +*** 246,255 **** + } + memset(p, 0, sizeof(*p)); + + /* +! ** Determine device and ppa + */ +! cp = strpbrk(device, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +--- 246,266 ---- + } + memset(p, 0, sizeof(*p)); + ++ #ifdef HAVE_DEV_DLPI + /* +! ** Remove any "/dev/" on the front of the device. + */ +! cp = strrchr(device, '/'); +! if (cp == NULL) +! cp = device; +! else +! cp++; +! strcpy(dname, cp); +! +! /* +! * Split the name into a device type and a unit number. +! */ +! cp = strpbrk(dname, "0123456789"); + if (cp == NULL) { + sprintf(ebuf, "%s missing unit number", device); + goto bad; +*************** +*** 259,281 **** + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } + +! if (*device == '/') +! strcpy(dname, device); +! else +! sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); +! #ifdef HAVE_DEV_DLPI +! /* Map network device to /dev/dlpi unit */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! /* Map network interface to /dev/dlpi unit */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +--- 270,321 ---- + sprintf(ebuf, "%s bad unit number", device); + goto bad; + } ++ *cp = '\0'; + +! /* +! * Use "/dev/dlpi" as the device. +! * +! * XXX - HP's DLPI Programmer's Guide for HP-UX 11.00 says that +! * the "dl_mjr_num" field is for the "major number of interface +! * driver"; that's the major of "/dev/dlpi" on the system on +! * which I tried this, but there may be DLPI devices that +! * use a different driver, in which case we may need to +! * search "/dev" for the appropriate device with that major +! * device number, rather than hardwiring "/dev/dlpi". +! */ + cp = "/dev/dlpi"; + if ((p->fd = open(cp, O_RDWR)) < 0) { + sprintf(ebuf, "%s: %s", cp, pcap_strerror(errno)); + goto bad; + } +! +! /* +! * Get a table of all PPAs for that device, and search that +! * table for the specified device type name and unit number. +! */ + ppa = get_dlpi_ppa(p->fd, dname, ppa, ebuf); + if (ppa < 0) + goto bad; + #else ++ /* ++ ** Determine device and ppa ++ */ ++ cp = strpbrk(device, "0123456789"); ++ if (cp == NULL) { ++ sprintf(ebuf, "%s missing unit number", device); ++ goto bad; ++ } ++ ppa = strtol(cp, &eos, 10); ++ if (*eos != '\0') { ++ sprintf(ebuf, "%s bad unit number", device); ++ goto bad; ++ } ++ ++ if (*device == '/') ++ strcpy(dname, device); ++ else ++ sprintf(dname, "%s/%s", PCAP_DEV_PREFIX, device); ++ + /* Try device without unit number */ + strcpy(dname2, dname); + cp = strchr(dname, *cp); +*************** +*** 391,397 **** + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", infop->dl_mac_type); + goto bad; + } + +--- 431,438 ---- + break; + + default: +! sprintf(ebuf, "unknown mac type 0x%lu", +! (unsigned long)infop->dl_mac_type); + goto bad; + } + +*************** +*** 709,737 **** + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10, we can ask for the ppa + */ + + +! /* Determine ppa number that specifies ifname */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ip; + register int i; + register u_long majdev; +- dl_hp_ppa_req_t req; + struct stat statbuf; + bpf_u_int32 buf[MAXDLBUF]; + +- if (stat(device, &statbuf) < 0) { +- sprintf(ebuf, "stat: %s: %s", device, pcap_strerror(errno)); +- return (-1); +- } +- majdev = major(statbuf.st_rdev); +- + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +--- 750,806 ---- + + #ifdef DL_HP_PPA_ACK_OBS + /* +! * Under HP-UX 10 and HP-UX 11, we can ask for the ppa + */ + + +! /* +! * Determine ppa number that specifies ifname. +! * +! * If the "dl_hp_ppa_info_t" doesn't have a "dl_module_id_1" member, +! * the code that's used here is the old code for HP-UX 10.x. +! * +! * However, HP-UX 10.20, at least, appears to have such a member +! * in its "dl_hp_ppa_info_t" structure, so the new code is used. +! * The new code didn't work on an old 10.20 system on which Rick +! * Jones of HP tried it, but with later patches installed, it +! * worked - it appears that the older system had those members but +! * didn't put anything in them, so, if the search by name fails, we +! * do the old search. +! * +! * Rick suggests that making sure your system is "up on the latest +! * lancommon/DLPI/driver patches" is probably a good idea; it'd fix +! * that problem, as well as allowing libpcap to see packets sent +! * from the system on which the libpcap application is being run. +! * (On 10.20, in addition to getting the latest patches, you need +! * to turn the kernel "lanc_outbound_promisc_flag" flag on with ADB; +! * a posting to "comp.sys.hp.hpux" at +! * +! * http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=558092266 +! * +! * says that, to see the machine's outgoing traffic, you'd need to +! * apply the right patches to your system, and also set that variable +! * with: +! +! echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem +! +! * which could be put in, for example, "/sbin/init.d/lan". +! * +! * Setting the variable is not necessary on HP-UX 11.x. +! */ + static int + get_dlpi_ppa(register int fd, register const char *device, register int unit, + register char *ebuf) + { + register dl_hp_ppa_ack_t *ap; +! register dl_hp_ppa_info_t *ipstart, *ip; + register int i; ++ char dname[100]; + register u_long majdev; + struct stat statbuf; ++ dl_hp_ppa_req_t req; + bpf_u_int32 buf[MAXDLBUF]; + + memset((char *)&req, 0, sizeof(req)); + req.dl_primitive = DL_HP_PPA_REQ; + +*************** +*** 741,760 **** + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ip = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); + +! for(i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ip + ip->dl_next_offset); +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find PPA for %s", device); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s: hardware state: DOWN\n", device); + return (-1); + } + return ((int)ip->dl_ppa); +--- 810,887 ---- + return (-1); + + ap = (dl_hp_ppa_ack_t *)buf; +! ipstart = (dl_hp_ppa_info_t *)((u_char *)ap + ap->dl_offset); +! ip = ipstart; + +! #ifdef HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 +! /* +! * The "dl_hp_ppa_info_t" structure has a "dl_module_id_1" +! * member that should, in theory, contain the part of the +! * name for the device that comes before the unit number, +! * and should also have a "dl_module_id_2" member that may +! * contain an alternate name (e.g., I think Ethernet devices +! * have both "lan", for "lanN", and "snap", for "snapN", with +! * the former being for Ethernet packets and the latter being +! * for 802.3/802.2 packets). +! * +! * Search for the device that has the specified name and +! * instance number. +! */ +! for (i = 0; i < ap->dl_count; i++) { +! if ((strcmp(ip->dl_module_id_1, device) == 0 || +! strcmp(ip->dl_module_id_2, device) == 0) && +! ip->dl_instance_num == unit) +! break; + +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! #else +! /* +! * We don't have that member, so the search is impossible; make it +! * look as if the search failed. +! */ +! i = ap->dl_count; +! #endif +! +! if (i == ap->dl_count) { +! /* +! * Well, we didn't, or can't, find the device by name. +! * +! * HP-UX 10.20, whilst it has "dl_module_id_1" and +! * "dl_module_id_2" fields in the "dl_hp_ppa_info_t", +! * doesn't seem to fill them in unless the system is +! * at a reasonably up-to-date patch level. +! * +! * Older HP-UX 10.x systems might not have those fields +! * at all. +! * +! * Therefore, we'll search for the entry with the major +! * device number of a device with the name "/dev/", +! * if such a device exists, as the old code did. +! */ +! sprintf(dname, "/dev/%s%d", device, unit); +! if (stat(dname, &statbuf) < 0) { +! sprintf(ebuf, "stat: %s: %s", dname, pcap_strerror(errno)); +! return (-1); +! } +! majdev = major(statbuf.st_rdev); +! +! ip = ipstart; +! +! for (i = 0; i < ap->dl_count; i++) { +! if (ip->dl_mjr_num == majdev && +! ip->dl_instance_num == unit) +! break; +! +! ip = (dl_hp_ppa_info_t *)((u_char *)ipstart + ip->dl_next_offset); +! } +! } + if (i == ap->dl_count) { +! sprintf(ebuf, "can't find /dev/dlpi PPA for %s%d", device, unit); + return (-1); + } + if (ip->dl_hdw_state == HDW_DEAD) { +! sprintf(ebuf, "%s%d: hardware state: DOWN\n", device, unit); + return (-1); + } + return ((int)ip->dl_ppa); +*************** +*** 783,789 **** + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name)], tifname[32]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +--- 910,916 ---- + register int kd; + void *addr; + struct ifnet ifnet; +! char if_name[sizeof(ifnet.if_name) + 1]; + + cp = strrchr(ifname, '/'); + if (cp != NULL) +*************** +*** 811,823 **** + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! sprintf(tifname, "%.*s%d", +! (int)sizeof(if_name), if_name, ifnet.if_unit); +! if (strcmp(tifname, ifname) == 0) + return (ifnet.if_index); + } + +--- 938,949 ---- + if (dlpi_kread(kd, (off_t)addr, + &ifnet, sizeof(ifnet), ebuf) < 0 || + dlpi_kread(kd, (off_t)ifnet.if_name, +! if_name, sizeof(ifnet.if_name), ebuf) < 0) { + (void)close(kd); + return (-1); + } +! if_name[sizeof(ifnet.if_name)] = '\0'; +! if (strcmp(if_name, ifname) == 0 && ifnet.if_unit == unit) + return (ifnet.if_index); + } + -- 2.34.1