Show
Ignore:
Timestamp:
03/31/07 22:31:53 (22 months ago)
Author:
aturner
Message:

users can now use --enable-force-<method> to force a particular injection
method. Note that if you foolishly choose something which your system does
not support you're hosed, so be careful. :) fixes #139

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/common/sendpacket.c

    r1778 r1780  
    7070#include "sendpacket.h" 
    7171 
     72 
     73/* Allow users to force the injection method */ 
     74#ifdef FORCE_INJECT_LIBNET 
     75#undef HAVE_PCAP_INJECT 
     76#undef HAVE_PCAP_SENDPACKET 
     77#undef HAVE_BPF 
     78#elif defined FORCE_INJECT_BPF 
     79#undef HAVE_LIBNET 
     80#undef HAVE_PCAP_INJECT 
     81#undef HAVE_PCAP_SENDPACKET 
     82#elif defined FORCE_INJECT_PCAP_INJECT 
     83#undef HAVE_LIBNET 
     84#undef HAVE_PCAP_SENDPACKET 
     85#undef HAVE_BPF 
     86#elif defined FORCE_INJECT_PCAP_SENDPACKET 
     87#undef HAVE_LIBNET 
     88#undef HAVE_PCAP_INJECT 
     89#undef HAVE_BPF 
     90#endif 
     91 
     92 
    7293#if (defined HAVE_WINPCAP && defined HAVE_PCAP_INJECT) 
    7394#undef HAVE_PCAP_INJECT /* configure returns true for some odd reason */ 
     
    349370    pcap_t *pcap; 
    350371    sendpacket_t *sp; 
    351     /* 
     372/* 
    352373    u_int spoof_eth_src = 1; 
    353374    int fd; 
    354     */ 
     375 */ 
    355376    assert(device); 
    356377    assert(errbuf); 
     
    364385    sp = (sendpacket_t *)safe_malloc(sizeof(sendpacket_t)); 
    365386    strlcpy(sp->device, device, sizeof(sp->device)); 
     387/* 
    366388    sp->handle.pcap = pcap; 
    367 /* 
    368389    fd = pcap_get_selectable_fd(pcap); 
    369390    if (ioctl(fd, BIOCSHDRCMPLT, &spoof_eth_src) == -1) { 
    370391        errx(1, "Unable to enable source MAC spoof support: %s", strerror(errno)); 
    371392    } 
    372 */     
     393 */ 
     394     
    373395    return sp; 
    374396}