Changeset 1716

Show
Ignore:
Timestamp:
02/27/07 21:14:28 (23 months ago)
Author:
aturner
Message:

improve Win32 support. mostly fix printing libpcap/winpcap version. refs #110

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/configure.in

    r1712 r1716  
    897897    ;; 
    898898 
     899        *-*-cygwin) 
     900        AC_MSG_RESULT(Win32/Cygwin) 
     901        AC_DEFINE([WIN32],[1], [Platform is Win32/Cygwin]) 
     902        nic1=%0 
     903        nic1=%0 
     904        ;; 
     905         
    899906        *) 
    900907        AC_MSG_RESULT([$host is unknown!   
  • trunk/src/config.h.in

    r1709 r1716  
    158158/* Does libpcap have pcap_sendpacket? */ 
    159159#undef HAVE_PCAP_SENDPACKET 
     160 
     161/* Does libpcap have pcap_version[] */ 
     162#undef HAVE_PCAP_VERSION 
    160163 
    161164/* Do we have Linux PF_PACKET socket support? */ 
  • trunk/src/flowreplay_opts.def

    r1685 r1716  
    269269#endif 
    270270    fprintf(stderr, "\n"); 
    271     fprintf(stderr, "Copyright 2001-2006 by Aaron Turner <aturner at synfin dot net>\n"); 
     271    fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n"); 
    272272#ifdef HAVE_LIBNET 
    273273    fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION); 
     
    275275        fprintf(stderr, "Not compiled with libnet.\n"); 
    276276#endif 
     277#ifdef HAVE_WINPCAP 
     278        fprintf(stderr, "Compiled against winpcap: %s\n", pcap_lib_version()); 
     279#else 
    277280    fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version); 
     281#endif 
    278282#ifdef ENABLE_64BITS 
    279283    fprintf(stderr, "64 bit packet counters: enabled\n"); 
  • trunk/src/tcpprep_opts.def

    r1685 r1716  
    537537#endif 
    538538    fprintf(stderr, "\n"); 
    539     fprintf(stderr, "Copyright 2001-2006 by Aaron Turner <aturner at synfin dot net>\n"); 
     539    fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n"); 
    540540    fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 
    541541#ifdef HAVE_LIBNET 
     
    544544        fprintf(stderr, "Not compiled with libnet.\n"); 
    545545#endif 
     546#ifdef HAVE_WINPCAP 
     547        fprintf(stderr, "Compiled against winpcap: %s\n", pcap_lib_version()); 
     548#else 
    546549    fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version); 
     550#endif 
    547551#ifdef ENABLE_64BITS 
    548552    fprintf(stderr, "64 bit packet counters: enabled\n"); 
  • trunk/src/tcpreplay_opts.def

    r1714 r1716  
    205205    pcap_if_ptr = pcap_if; 
    206206    printf("%s", "Available network interfaces:\n"); 
    207 #ifdef HAVE_WINPCAP 
    208         printf("Short Name\tName\tDescription\n"); 
    209 #endif 
     207#ifdef WIN32  /* Win32 has alias/name/description */ 
     208        printf("Alias\tName\n"); 
     209#else 
     210        /* Unix just has a warning about being root */ 
    210211        if (geteuid() != 0) 
    211212                printf("Warning!  Need to run as root to get complete list.\n"); 
     213#endif 
    212214 
    213215    while (pcap_if_ptr != NULL) { 
    214216        if (! pcap_if_ptr->flags & PCAP_IF_LOOPBACK) { 
    215 #ifdef HAVE_WINPCAP 
    216             printf("%%%d\t%s\t%s\n", i, pcap_if_ptr->name, pcap_if_ptr->description); 
     217#ifdef WIN32 
     218            printf("%%%d\t%s\n\t%s\n", i, pcap_if_ptr->name, pcap_if_ptr->description); 
    217219#else 
    218220                        printf("%s\n", pcap_if_ptr->name); 
     
    373375#endif 
    374376    fprintf(stderr, "\n"); 
    375     fprintf(stderr, "Copyright 2001-2006 by Aaron Turner <aturner at synfin dot net>\n"); 
     377    fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n"); 
    376378    fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 
    377379#ifdef HAVE_LIBNET 
     
    380382        fprintf(stderr, "Not compiled with libnet.\n"); 
    381383#endif 
     384#ifdef HAVE_WINPCAP 
     385        fprintf(stderr, "Compiled against winpcap: %s\n", pcap_lib_version()); 
     386#else 
    382387    fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version); 
     388#endif 
    383389#ifdef ENABLE_64BITS 
    384390    fprintf(stderr, "64 bit packet counters: enabled\n"); 
  • trunk/src/tcprewrite_opts.def

    r1701 r1716  
    185185        fprintf(stderr, "Not compiled with libnet.\n"); 
    186186#endif 
     187#ifdef HAVE_WINPCAP 
     188        fprintf(stderr, "Compiled against winpcap: %s\n", pcap_lib_version()); 
     189#else 
    187190    fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version); 
     191#endif 
    188192#ifdef ENABLE_64BITS 
    189193    fprintf(stderr, "64 bit packet counters: enabled\n");