ec_capture.c (ettercap-0.8.3) | : | ec_capture.c (ettercap-0.8.3.1) | ||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
ec_thread_new(thread_name, "pcap handler and packet decoder", &capture, iface ); | ec_thread_new(thread_name, "pcap handler and packet decoder", &capture, iface ); | |||
} | } | |||
void capture_stop(struct iface_env *iface) | void capture_stop(struct iface_env *iface) | |||
{ | { | |||
pthread_t pid; | pthread_t pid; | |||
char thread_name[64]; | char thread_name[64]; | |||
snprintf(thread_name, sizeof(thread_name), "capture[%s]", iface->name); | snprintf(thread_name, sizeof(thread_name), "capture[%s]", iface->name); | |||
pid = ec_thread_getpid(thread_name); | pid = ec_thread_getpid(thread_name); | |||
if(!pthread_equal(pid, EC_PTHREAD_NULL)) | if(!pthread_equal(pid, ec_thread_getpid(NULL))) | |||
ec_thread_destroy(pid); | ec_thread_destroy(pid); | |||
} | } | |||
/* | /* | |||
* start capturing packets | * start capturing packets | |||
*/ | */ | |||
EC_THREAD_FUNC(capture) | EC_THREAD_FUNC(capture) | |||
{ | { | |||
int ret; | int ret; | |||
skipping to change at line 170 | skipping to change at line 170 | |||
fprintf(stdout, " %s \t%s\n", dev->name, dev->description); | fprintf(stdout, " %s \t%s\n", dev->name, dev->description); | |||
fprintf(stdout, "\n\n"); | fprintf(stdout, "\n\n"); | |||
clean_exit(0); | clean_exit(0); | |||
} | } | |||
} | } | |||
/* | /* | |||
* return default interface | ||||
*/ | ||||
char* capture_default_if(void) | ||||
{ | ||||
/* | ||||
* as per deprecation message of pcap_lookupdev() the new way to determine | ||||
* the default interface, is to use the first interface detected by the call | ||||
* of pcap_findalldevs(). This is already determined in capture_getifs() and | ||||
* stored in EC_GBL_PCAP->ifs | ||||
*/ | ||||
if (EC_GBL_PCAP && EC_GBL_PCAP->ifs) | ||||
return EC_GBL_PCAP->ifs->name; | ||||
return NULL; | ||||
} | ||||
/* | ||||
* check if the given file is a pcap file | * check if the given file is a pcap file | |||
*/ | */ | |||
int is_pcap_file(char *file, char *pcap_errbuf) | int is_pcap_file(char *file, char *pcap_errbuf) | |||
{ | { | |||
pcap_t *pcap; | pcap_t *pcap; | |||
pcap = pcap_open_offline(file, pcap_errbuf); | pcap = pcap_open_offline(file, pcap_errbuf); | |||
if (pcap == NULL) | if (pcap == NULL) | |||
return -E_INVALID; | return -E_INVALID; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 19 lines changed or added |