- Timestamp:
- 09/20/06 15:29:49 (14 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- ef3660cb
- Parents:
- 6187a46
- Location:
- examples/skeleton
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/skeleton/complete.c
r0eef5d4 r34ee7eb 17 17 void usage(char *argv0) 18 18 { 19 fprintf(stderr,"usage: %s [ --filter | -f bpfexp ] [ --snaplen | -s snap ]\n\t\t[ --promisc | -p flag] [ --help | -h ] libtraceuri...\n",argv0);19 fprintf(stderr,"usage: %s [ --filter | -f bpfexp ] [ --snaplen | -s snap ]\n\t\t[ --promisc | -p flag] [ --help | -h ] [ --libtrace-help | -H ] libtraceuri...\n",argv0); 20 20 } 21 21 … … 31 31 int option_index; 32 32 struct option long_options[] = { 33 { "filter", 1, 0, 'f' }, 34 { "snaplen", 1, 0, 's' }, 35 { "promisc", 1, 0, 'p' }, 36 { "help", 0, 0, 'h' }, 37 { NULL, 0, 0, 0 } 33 { "filter", 1, 0, 'f' }, 34 { "snaplen", 1, 0, 's' }, 35 { "promisc", 1, 0, 'p' }, 36 { "help", 0, 0, 'h' }, 37 { "libtrace-help", 0, 0, 'H' }, 38 { NULL, 0, 0, 0 } 38 39 }; 39 40 40 int c= getopt_long(argc, argv, "f:s:p:h ",41 int c= getopt_long(argc, argv, "f:s:p:hH", 41 42 long_options, &option_index); 42 43 … … 54 55 promisc=atoi(optarg); 55 56 break; 57 case 'H': 58 trace_help(); 59 return 1; 56 60 default: 57 61 fprintf(stderr,"Unknown option: %c\n",c); -
examples/skeleton/trivial.c
r0eef5d4 r34ee7eb 13 13 void per_packet(libtrace_packet_t *packet) 14 14 { 15 /* You really should consider using complete.c instead */ 16 15 17 /* Your code goes here */ 16 18 }
Note: See TracChangeset
for help on using the changeset viewer.