]> The Tcpdump Group git mirrors - tcpdump/blob - tcpdump.c
Add Loris Digioanni, as he's credited as the main programmer on the
[tcpdump] / tcpdump.c
1 /*
2 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * Support for splitting captures into multiple files with a maximum
22 * file size:
23 *
24 * Copyright (c) 2001
25 * Seth Webster <swebster@sst.ll.mit.edu>
26 */
27
28 #ifndef lint
29 static const char copyright[] =
30 "@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
31 The Regents of the University of California. All rights reserved.\n";
32 static const char rcsid[] =
33 "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.180 2002-08-01 08:53:37 risso Exp $ (LBL)";
34 #endif
35
36 /*
37 * tcpdump - monitor tcp/ip traffic on an ethernet.
38 *
39 * First written in 1987 by Van Jacobson, Lawrence Berkeley Laboratory.
40 * Mercilessly hacked and occasionally improved since then via the
41 * combined efforts of Van, Steve McCanne and Craig Leres of LBL.
42 */
43
44 #ifdef HAVE_CONFIG_H
45 #include "config.h"
46 #endif
47
48 #include <tcpdump-stdinc.h>
49
50 #ifdef WIN32
51 #include "getopt.h"
52 #include "w32_fzs.h"
53 extern int strcasecmp (const char *__s1, const char *__s2);
54 extern int SIZE_BUF;
55 #define off_t long
56 #define uint UINT
57 #endif /* WIN32 */
58
59 #include <pcap.h>
60 #include <signal.h>
61 #include <stdio.h>
62 #include <stdlib.h>
63 #include <string.h>
64
65
66 #include "interface.h"
67 #include "addrtoname.h"
68 #include "machdep.h"
69 #include "setsignal.h"
70 #include "gmt2local.h"
71
72 int aflag; /* translate network and broadcast addresses */
73 int dflag; /* print filter code */
74 int eflag; /* print ethernet header */
75 int fflag; /* don't translate "foreign" IP address */
76 int nflag; /* leave addresses as numbers */
77 int Nflag; /* remove domains from printed host names */
78 int Oflag = 1; /* run filter code optimizer */
79 int pflag; /* don't go promiscuous */
80 int qflag; /* quick (shorter) output */
81 int Rflag = 1; /* print sequence # field in AH/ESP*/
82 int sflag = 0; /* use the libsmi to translate OIDs */
83 int Sflag; /* print raw TCP sequence numbers */
84 int tflag = 1; /* print packet arrival time */
85 int uflag = 0; /* Print undecoded NFS handles */
86 int vflag; /* verbose */
87 int xflag; /* print packet in hex */
88 int Xflag; /* print packet in ascii as well as hex */
89 off_t Cflag = 0; /* rotate dump files after this many bytes */
90 int Aflag = 0; /* print packet only in ascii observing LF, CR, TAB, SPACE */
91
92 char *espsecret = NULL; /* ESP secret key */
93
94 int packettype;
95
96 int infodelay;
97 int infoprint;
98
99 char *program_name;
100
101 int32_t thiszone; /* seconds offset from gmt to local time */
102
103 /* Forwards */
104 static RETSIGTYPE cleanup(int);
105 static void usage(void) __attribute__((noreturn));
106
107 static void dump_and_trunc(u_char *, const struct pcap_pkthdr *, const u_char *);
108
109 #ifdef SIGINFO
110 RETSIGTYPE requestinfo(int);
111 #endif
112
113 /* Length of saved portion of packet. */
114 int snaplen = DEFAULT_SNAPLEN;
115
116 struct printer {
117 pcap_handler f;
118 int type;
119 };
120
121 static struct printer printers[] = {
122 { arcnet_if_print, DLT_ARCNET },
123 { ether_if_print, DLT_EN10MB },
124 { token_if_print, DLT_IEEE802 },
125 #ifdef DLT_LANE8023
126 { lane_if_print, DLT_LANE8023 },
127 #endif
128 #ifdef DLT_CIP
129 { cip_if_print, DLT_CIP },
130 #endif
131 #ifdef DLT_ATM_CLIP
132 { cip_if_print, DLT_ATM_CLIP },
133 #endif
134 { sl_if_print, DLT_SLIP },
135 { sl_bsdos_if_print, DLT_SLIP_BSDOS },
136 { ppp_if_print, DLT_PPP },
137 { ppp_bsdos_if_print, DLT_PPP_BSDOS },
138 { fddi_if_print, DLT_FDDI },
139 { null_if_print, DLT_NULL },
140 #ifdef DLT_LOOP
141 { null_if_print, DLT_LOOP },
142 #endif
143 { raw_if_print, DLT_RAW },
144 { atm_if_print, DLT_ATM_RFC1483 },
145 #ifdef DLT_C_HDLC
146 { chdlc_if_print, DLT_C_HDLC },
147 #endif
148 #ifdef DLT_HDLC
149 { chdlc_if_print, DLT_HDLC },
150 #endif
151 #ifdef DLT_PPP_SERIAL
152 { ppp_hdlc_if_print, DLT_PPP_SERIAL },
153 #endif
154 #ifdef DLT_PPP_ETHER
155 { pppoe_if_print, DLT_PPP_ETHER },
156 #endif
157 #ifdef DLT_LINUX_SLL
158 { sll_if_print, DLT_LINUX_SLL },
159 #endif
160 #ifdef DLT_IEEE802_11
161 { ieee802_11_if_print, DLT_IEEE802_11},
162 #endif
163 #ifdef DLT_LTALK
164 { ltalk_if_print, DLT_LTALK },
165 #endif
166 #ifdef DLT_PFLOG
167 { pflog_if_print, DLT_PFLOG },
168 #endif
169 #ifdef DLT_FR
170 { fr_if_print, DLT_FR },
171 #endif
172 #ifdef DLT_FRELAY
173 { fr_if_print, DLT_FRELAY },
174 #endif
175 #ifdef DLT_SUNATM
176 { sunatm_if_print, DLT_SUNATM },
177 #endif
178 { NULL, 0 },
179 };
180
181 static pcap_handler
182 lookup_printer(int type)
183 {
184 struct printer *p;
185
186 for (p = printers; p->f; ++p)
187 if (type == p->type)
188 return p->f;
189
190 error("unknown data link type %d", type);
191 /* NOTREACHED */
192 }
193
194 static pcap_t *pd;
195
196 extern int optind;
197 extern int opterr;
198 extern char *optarg;
199
200 struct dump_info {
201 char *WFileName;
202 pcap_t *pd;
203 pcap_dumper_t *p;
204 };
205
206 int
207 main(int argc, char **argv)
208 {
209 register int cnt, op, i;
210 bpf_u_int32 localnet, netmask;
211 register char *cp, *infile, *cmdbuf, *device, *RFileName, *WFileName;
212 pcap_handler printer;
213 struct bpf_program fcode;
214 #ifndef WIN32
215 RETSIGTYPE (*oldhandler)(int);
216 #endif
217 struct dump_info dumpinfo;
218 u_char *pcap_userdata;
219 char ebuf[PCAP_ERRBUF_SIZE];
220 pcap_if_t *devpointer;
221 int devnum;
222 #ifdef WIN32
223 int ii;
224 DWORD dwVersion;
225 DWORD dwWindowsMajorVersion;
226 u_int UserBufferSize=1000000;
227 #endif
228
229 #ifdef WIN32
230 dwVersion=GetVersion(); /* get the OS version */
231 dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
232 if(wsockinit()!=0) return 1;
233 #endif /* WIN32 */
234
235 cnt = -1;
236 device = NULL;
237 infile = NULL;
238 RFileName = NULL;
239 WFileName = NULL;
240 if ((cp = strrchr(argv[0], '/')) != NULL)
241 program_name = cp + 1;
242 else
243 program_name = argv[0];
244
245 if (abort_on_misalignment(ebuf, sizeof(ebuf)) < 0)
246 error("%s", ebuf);
247
248 #ifdef LIBSMI
249 smiInit("tcpdump");
250 #endif
251
252 opterr = 0;
253 while (
254 #ifdef WIN32
255 (op = getopt(argc, argv, "aB:c:C:dDeE:fF:i:lm:nNOpqr:Rs:StT:uvw:xXY")) != -1)
256 #else
257 (op = getopt(argc, argv, "ac:C:dDeE:fF:i:lm:nNOpqr:Rs:StT:uvw:xXY")) != -1)
258 #endif /* WIN32 */
259 switch (op) {
260
261 case 'a':
262 ++aflag;
263 break;
264
265 case 'A':
266 ++xflag;
267 ++Xflag;
268 ++Aflag;
269 break;
270
271 #ifdef WIN32
272 case 'B':
273 UserBufferSize = atoi(optarg)*1024;
274 if (UserBufferSize < 0)
275 error("invalid packet buffer size %s", optarg);
276 break;
277 #endif /* WIN32 */
278
279 case 'c':
280 cnt = atoi(optarg);
281 if (cnt <= 0)
282 error("invalid packet count %s", optarg);
283 break;
284
285 case 'C':
286 Cflag = atoi(optarg) * 1000000;
287 if (Cflag < 0)
288 error("invalid file size %s", optarg);
289 break;
290
291 case 'd':
292 ++dflag;
293 break;
294
295 case 'D':
296 if (pcap_findalldevs(&devpointer, ebuf) < 0)
297 error("%s", ebuf);
298 else {
299 for (i = 0; devpointer != 0; i++) {
300 printf("%d.%s", i+1, devpointer->name);
301 if (devpointer->description != NULL)
302 printf(" (%s)", devpointer->description);
303 printf("\n");
304 devpointer = devpointer->next;
305 }
306 }
307 return 0;
308
309 case 'e':
310 ++eflag;
311 break;
312
313 case 'E':
314 #ifndef HAVE_LIBCRYPTO
315 warning("crypto code not compiled in");
316 #endif
317 espsecret = optarg;
318 break;
319
320 case 'f':
321 ++fflag;
322 break;
323
324 case 'F':
325 infile = optarg;
326 break;
327
328 case 'i':
329 if (optarg[0] == '0' && optarg[1] == 0)
330 error("Invalid adapter index");
331
332 /*
333 * If the argument is a number, treat it as
334 * an index into the list of adapters, as
335 * printed by "tcpdump -D".
336 *
337 * This should be OK on UNIX systems, as interfaces
338 * shouldn't have names that begin with digits.
339 * It can be useful on Windows, where more than
340 * one interface can have the same name.
341 */
342 if ((devnum = atoi(optarg)) != 0) {
343 if (devnum < 0)
344 error("Invalid adapter index");
345
346 if (pcap_findalldevs(&devpointer, ebuf) < 0)
347 error("%s", ebuf);
348 else {
349 for (i = 0; i < devnum-1; i++){
350 devpointer = devpointer->next;
351 if (devpointer == NULL)
352 error("Invalid adapter index");
353 }
354 }
355 device = devpointer->name;
356 break;
357 }
358 device = optarg;
359 break;
360
361 case 'l':
362 #ifdef HAVE_SETLINEBUF
363 setlinebuf(stdout);
364 #else
365 setvbuf(stdout, NULL, _IOLBF, 0);
366 #endif
367 break;
368
369 case 'n':
370 ++nflag;
371 break;
372
373 case 'N':
374 ++Nflag;
375 break;
376
377 case 'm':
378 #ifdef LIBSMI
379 if (smiLoadModule(optarg) == 0) {
380 error("could not load MIB module %s", optarg);
381 }
382 sflag = 1;
383 #else
384 (void)fprintf(stderr, "%s: ignoring option `-m %s' ",
385 program_name, optarg);
386 (void)fprintf(stderr, "(no libsmi support)\n");
387 #endif
388
389 case 'O':
390 Oflag = 0;
391 break;
392
393 case 'p':
394 ++pflag;
395 break;
396
397 case 'q':
398 ++qflag;
399 break;
400
401 case 'r':
402 RFileName = optarg;
403 break;
404
405 case 'R':
406 Rflag = 0;
407 break;
408
409 case 's': {
410 char *end;
411
412 snaplen = strtol(optarg, &end, 0);
413 if (optarg == end || *end != '\0'
414 || snaplen < 0 || snaplen > 65535)
415 error("invalid snaplen %s", optarg);
416 else if (snaplen == 0)
417 snaplen = 65535;
418 break;
419 }
420
421 case 'S':
422 ++Sflag;
423 break;
424
425 case 't':
426 --tflag;
427 break;
428
429 case 'T':
430 if (strcasecmp(optarg, "vat") == 0)
431 packettype = PT_VAT;
432 else if (strcasecmp(optarg, "wb") == 0)
433 packettype = PT_WB;
434 else if (strcasecmp(optarg, "rpc") == 0)
435 packettype = PT_RPC;
436 else if (strcasecmp(optarg, "rtp") == 0)
437 packettype = PT_RTP;
438 else if (strcasecmp(optarg, "rtcp") == 0)
439 packettype = PT_RTCP;
440 else if (strcasecmp(optarg, "snmp") == 0)
441 packettype = PT_SNMP;
442 else if (strcasecmp(optarg, "cnfp") == 0)
443 packettype = PT_CNFP;
444 else
445 error("unknown packet type `%s'", optarg);
446 break;
447
448 case 'u':
449 ++uflag;
450 break;
451
452 case 'v':
453 ++vflag;
454 break;
455
456 case 'w':
457 WFileName = optarg;
458 break;
459
460 case 'x':
461 ++xflag;
462 break;
463
464 case 'X':
465 ++xflag;
466 ++Xflag;
467 break;
468
469 #ifdef YYDEBUG
470 case 'Y':
471 {
472 /* Undocumented flag */
473 extern int yydebug;
474 yydebug = 1;
475 }
476 break;
477 #endif
478 default:
479 usage();
480 /* NOTREACHED */
481 }
482
483 if (aflag && nflag)
484 error("-a and -n options are incompatible");
485
486 if (tflag > 0)
487 thiszone = gmt2local(0);
488
489 if (RFileName != NULL) {
490 /*
491 * We don't need network access, so set it back to the user id.
492 * Also, this prevents the user from reading anyone's
493 * trace file.
494 */
495 #ifndef WIN32
496 setuid(getuid());
497 #endif /* WIN32 */
498
499 pd = pcap_open_offline(RFileName, ebuf);
500 if (pd == NULL)
501 error("%s", ebuf);
502 localnet = 0;
503 netmask = 0;
504 if (fflag != 0)
505 error("-f and -r options are incompatible");
506 } else {
507 if (device == NULL) {
508 device = pcap_lookupdev(ebuf);
509 if (device == NULL)
510 error("%s", ebuf);
511 }
512 #ifdef WIN32
513 else
514 {
515 if (!(dwVersion >= 0x80000000 && dwWindowsMajorVersion >= 4)) /* Windows '95 */
516 {
517 if(device[1]!=0)
518 device=(char*)SChar2WChar(device);
519 }
520 else{
521 for (ii=0;ii<(signed)strlen(device);ii++)
522 for (ii=strlen(device)-1;ii>0&&(device[ii]==' '||device[ii]=='\t');ii--)device[ii]='\0';
523 for (ii=0;ii<(signed)strlen(device)&&(device[ii]==' '||device[ii]=='\t');ii++);
524 strcpy(device,device+ii);
525 }
526 }
527 PrintCapBegins (program_name,device);
528 #endif /* WIN32 */
529 *ebuf = '\0';
530 pd = pcap_open_live(device, snaplen, !pflag, 1000, ebuf);
531 if (pd == NULL)
532 error("%s", ebuf);
533 else if (*ebuf)
534 warning("%s", ebuf);
535 #ifdef WIN32
536 if(UserBufferSize != 1000000)
537 if(pcap_setbuff(pd, UserBufferSize)==-1){
538 error("%s", pcap_geterr(pd));
539 }
540 #endif /* WIN32 */
541 i = pcap_snapshot(pd);
542 if (snaplen < i) {
543 warning("snaplen raised from %d to %d", snaplen, i);
544 snaplen = i;
545 }
546 if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) {
547 localnet = 0;
548 netmask = 0;
549 warning("%s", ebuf);
550 }
551 /*
552 * Let user own process after socket has been opened.
553 */
554 #ifndef WIN32
555 setuid(getuid());
556 #endif /* WIN32 */
557 }
558 if (infile)
559 cmdbuf = read_infile(infile);
560 else
561 cmdbuf = copy_argv(&argv[optind]);
562
563 if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0)
564 error("%s", pcap_geterr(pd));
565 if (dflag) {
566 bpf_dump(&fcode, dflag);
567 #ifdef WIN32
568 pcap_close(pd);
569 #endif /* WIN32 */
570 exit(0);
571 }
572 init_addrtoname(localnet, netmask);
573
574 (void)setsignal(SIGTERM, cleanup);
575 (void)setsignal(SIGINT, cleanup);
576 /* Cooperate with nohup(1) */
577 #ifndef WIN32
578 if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL)
579 (void)setsignal(SIGHUP, oldhandler);
580 #endif /* WIN32 */
581
582 if (pcap_setfilter(pd, &fcode) < 0)
583 error("%s", pcap_geterr(pd));
584 if (WFileName) {
585 pcap_dumper_t *p = pcap_dump_open(pd, WFileName);
586 if (p == NULL)
587 error("%s", pcap_geterr(pd));
588 if (Cflag != 0) {
589 printer = dump_and_trunc;
590 dumpinfo.WFileName = WFileName;
591 dumpinfo.pd = pd;
592 dumpinfo.p = p;
593 pcap_userdata = (u_char *)&dumpinfo;
594 } else {
595 printer = pcap_dump;
596 pcap_userdata = (u_char *)p;
597 }
598 } else {
599 printer = lookup_printer(pcap_datalink(pd));
600 pcap_userdata = 0;
601 #ifdef SIGINFO
602 (void)setsignal(SIGINFO, requestinfo);
603 #endif
604 }
605 #ifndef WIN32
606 if (RFileName == NULL) {
607 (void)fprintf(stderr, "%s: listening on %s\n",
608 program_name, device);
609 (void)fflush(stderr);
610 }
611 #endif /* WIN32 */
612 if (pcap_loop(pd, cnt, printer, pcap_userdata) < 0) {
613 (void)fprintf(stderr, "%s: pcap_loop: %s\n",
614 program_name, pcap_geterr(pd));
615 cleanup(0);
616 pcap_close(pd);
617 exit(1);
618 }
619 if (RFileName == NULL)
620 info(1);
621 pcap_close(pd);
622 exit(0);
623 }
624
625 /* make a clean exit on interrupts */
626 static RETSIGTYPE
627 cleanup(int signo)
628 {
629
630 /* Can't print the summary if reading from a savefile */
631 if (pd != NULL && pcap_file(pd) == NULL) {
632 (void)fflush(stdout);
633 putc('\n', stderr);
634 info(1);
635 }
636 if (signo)
637 exit(0);
638 }
639
640 void
641 info(register int verbose)
642 {
643 struct pcap_stat stat;
644
645 if (pcap_stats(pd, &stat) < 0) {
646 (void)fprintf(stderr, "pcap_stats: %s\n", pcap_geterr(pd));
647 return;
648 }
649
650 if (!verbose)
651 fprintf(stderr, "%s: ", program_name);
652
653 (void)fprintf(stderr, "%d packets received by filter", stat.ps_recv);
654 if (!verbose)
655 fputs(", ", stderr);
656 else
657 putc('\n', stderr);
658 (void)fprintf(stderr, "%d packets dropped by kernel\n", stat.ps_drop);
659 infoprint = 0;
660 }
661
662 static void
663 reverse(char *s)
664 {
665 int i, j, c;
666
667 for (i = 0, j = strlen(s) - 1; i < j; i++, j--) {
668 c = s[i];
669 s[i] = s[j];
670 s[j] = c;
671 }
672 }
673
674
675 static void
676 swebitoa(unsigned int n, char *s)
677 {
678 unsigned int i;
679
680 i = 0;
681 do {
682 s[i++] = n % 10 + '0';
683 } while ((n /= 10) > 0);
684
685 s[i] = '\0';
686 reverse(s);
687 }
688
689 static void
690 dump_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
691 {
692 struct dump_info *info;
693 static uint cnt = 2;
694 char *name;
695
696 info = (struct dump_info *)user;
697
698 /*
699 * XXX - this won't prevent capture files from getting
700 * larger than Cflag - the last packet written to the
701 * file could put it over Cflag.
702 */
703 if (ftell((FILE *)info->p) > Cflag) {
704 name = (char *) malloc(strlen(info->WFileName) + 4);
705 if (name == NULL)
706 error("dump_and_trunc: malloc");
707 strcpy(name, info->WFileName);
708 swebitoa(cnt, name + strlen(info->WFileName));
709 cnt++;
710 pcap_dump_close(info->p);
711 info->p = pcap_dump_open(info->pd, name);
712 free(name);
713 if (info->p == NULL)
714 error("%s", pcap_geterr(pd));
715 }
716
717 pcap_dump((u_char *)info->p, h, sp);
718 }
719
720 /* Like default_print() but data need not be aligned */
721 void
722 default_print_unaligned(register const u_char *cp, register u_int length)
723 {
724 register u_int i, s;
725 register int nshorts;
726
727 if (Xflag) {
728 ascii_print(cp, length);
729 return;
730 }
731 nshorts = (u_int) length / sizeof(u_short);
732 i = 0;
733 while (--nshorts >= 0) {
734 if ((i++ % 8) == 0)
735 (void)printf("\n\t\t\t");
736 s = *cp++;
737 (void)printf(" %02x%02x", s, *cp++);
738 }
739 if (length & 1) {
740 if ((i % 8) == 0)
741 (void)printf("\n\t\t\t");
742 (void)printf(" %02x", *cp);
743 }
744 }
745
746 #ifdef WIN32
747 char WDversion[]="current-cvs.tcpdump.org";
748 char version[]="current-cvs.tcpdump.org";
749 char pcap_version[]="current-cvs.tcpdump.org";
750 char Wpcap_version[]="3.0 alpha";
751 #endif
752
753 /*
754 * By default, print the packet out in hex.
755 */
756 void
757 default_print(register const u_char *bp, register u_int length)
758 {
759 default_print_unaligned(bp, length);
760 }
761
762 #ifdef SIGINFO
763 RETSIGTYPE requestinfo(int signo)
764 {
765 if (infodelay)
766 ++infoprint;
767 else
768 info(0);
769 }
770 #endif
771
772 static void
773 usage(void)
774 {
775 extern char version[];
776 extern char pcap_version[];
777
778 #ifdef WIN32
779 (void)fprintf(stderr, "%s version %s, based on tcpdump version %s\n", program_name, WDversion, version);
780 (void)fprintf(stderr, "WinPcap version %s, based on libpcap version %s\n",Wpcap_version, pcap_version);
781 #else
782 (void)fprintf(stderr, "%s version %s\n", program_name, version);
783 (void)fprintf(stderr, "libpcap version %s\n", pcap_version);
784 #endif /* WIN32 */
785 (void)fprintf(stderr,
786 #ifdef WIN32
787 "Usage: %s [-adDeflnNOpqStuvxX] [-B size] [-c count] [ -C file_size ]\n", program_name);
788 #else
789 "Usage: %s [-adDeflnNOpqStuvxX] [-c count] [ -C file_size ]\n", program_name);
790 #endif /* WIN32 */
791 (void)fprintf(stderr,
792 "\t\t[ -F file ] [ -i interface ] [ -r file ] [ -s snaplen ]\n");
793 (void)fprintf(stderr,
794 "\t\t[ -T type ] [ -w file ] [ -E algo:secret ] [ expression ]\n");
795 exit(1);
796 }