mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-10 08:54:51 +00:00
webserver: autodetect device name
This commit is contained in:
parent
5cab4ef193
commit
59324ef0f8
@ -1,5 +1,6 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -O2
|
CFLAGS = -Wall -O2
|
||||||
|
LFLAGS =-lpcap
|
||||||
|
|
||||||
all: testarp
|
all: testarp
|
||||||
|
|
||||||
|
@ -3,9 +3,15 @@
|
|||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
|
||||||
char device[]="wlan0";
|
char *device_name,errbuf[PCAP_ERRBUF_SIZE];
|
||||||
|
|
||||||
printf("Using device: %s\n", device);
|
device_name=pcap_lookupdev(errbuf);
|
||||||
|
if (device_name==NULL) {
|
||||||
|
fprintf(stderr,"Can't find default device\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Using device: %s\n", device_name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user