|
|
@ -490,19 +490,7 @@ int main(int argc, char **argv) |
|
|
|
/* capture loop */ |
|
|
|
/* capture loop */ |
|
|
|
while (1) |
|
|
|
while (1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (run_stop) |
|
|
|
if (run_dump) |
|
|
|
{ |
|
|
|
|
|
|
|
msg("Shutting down ...\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (promisc) |
|
|
|
|
|
|
|
set_promisc(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ring) |
|
|
|
|
|
|
|
ringbuf_free(ring); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (run_dump) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
msg("Dumping ring to %s ...\n", output); |
|
|
|
msg("Dumping ring to %s ...\n", output); |
|
|
|
|
|
|
|
|
|
|
@ -535,6 +523,18 @@ int main(int argc, char **argv) |
|
|
|
|
|
|
|
|
|
|
|
run_dump = 0; |
|
|
|
run_dump = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (run_stop) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
msg("Shutting down ...\n"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (promisc) |
|
|
|
|
|
|
|
set_promisc(0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ring) |
|
|
|
|
|
|
|
ringbuf_free(ring); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pktlen = recvfrom(capture_sock, pktbuf, sizeof(pktbuf), 0, NULL, 0); |
|
|
|
pktlen = recvfrom(capture_sock, pktbuf, sizeof(pktbuf), 0, NULL, 0); |
|
|
|
frames_captured++; |
|
|
|
frames_captured++; |
|
|
|