File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 20
20
*/
21
21
#include "pibs.h"
22
22
23
+ void usage (void )
24
+ {
25
+ printf ("Usage: pibs [OPTION] ...\n" );
26
+ printf ("Identify backscatter in pacp files\n" );
27
+ printf ("\nOPTIONS\n" );
28
+ printf ("\n -n Create new shared memory segment data structure\n" );
29
+ printf ("\n -i Write shared segment identifier in a file.\n" );
30
+ printf (" This option must be used in conjuntion with -n option\n" );
31
+ printf (" -r read pcap files and identity potential backscatter traffic\n" );
32
+ printf (" -b Show potential backscatter on stdout. The be used in conjuntion with -r\n" );
33
+ }
34
+
23
35
int main (int argc , char * argv [])
24
36
{
25
37
@@ -30,7 +42,7 @@ int main(int argc, char* argv[])
30
42
31
43
fprintf (stderr , "[INFO] pid = %d\n" ,(int )getpid ());
32
44
33
- while ((opt = getopt (argc , argv , "r:dbsni:au:z:p:w:y:" )) != -1 ) {
45
+ while ((opt = getopt (argc , argv , "r:dbsni:au:z:p:w:y:h " )) != -1 ) {
34
46
switch (opt ) {
35
47
case 'r' :
36
48
strncpy (pibs -> filename , optarg , FILENAME_MAX );
@@ -69,7 +81,9 @@ int main(int argc, char* argv[])
69
81
case 'y' :
70
82
pibs -> redisdb = atoi (optarg );
71
83
break ;
72
-
84
+ case 'h' :
85
+ usage ();
86
+ break ;
73
87
default : /* '?' */
74
88
75
89
fprintf (stderr , "[ERROR] Invalid command line was specified\n" );
You can’t perform that action at this time.
0 commit comments