added '-p' flag (promiscious)

This commit is contained in:
Arnout Engelen
2004-09-01 08:24:31 +00:00
parent 71878bdcd3
commit a1fd56b389

View File

@@ -124,6 +124,7 @@ public:
int main (int argc, char** argv) int main (int argc, char** argv)
{ {
device * devices = NULL; device * devices = NULL;
int promisc = 0;
for (argv++; *argv; argv++) for (argv++; *argv; argv++)
{ {
@@ -138,6 +139,8 @@ int main (int argc, char** argv)
exit(0); exit(0);
case 't': tracemode = true; case 't': tracemode = true;
break; break;
case 'p': promisc = 1;
break;
case 'd': if (argv[1]) case 'd': if (argv[1])
{ {
argv++; argv++;
@@ -182,7 +185,7 @@ int main (int argc, char** argv)
caption->append(" "); caption->append(" ");
} }
pcap_t * newhandle = pcap_open_live(current_dev->name, BUFSIZ, 0, 100, errbuf); pcap_t * newhandle = pcap_open_live(current_dev->name, BUFSIZ, promisc, 100, errbuf);
if (newhandle != NULL) if (newhandle != NULL)
{ {
/* The following code solves sf.net bug 1019381, but is only available /* The following code solves sf.net bug 1019381, but is only available