Created
June 11, 2016 13:15
-
-
Save karadza3a/efecd5e0d16ae0546a578564043b093d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void print_usage(){ | |
printf("usage: \n"); | |
printf(" -b host path\n"); | |
printf(" -e id\n"); | |
} | |
int main(int argc, char **argv) { | |
int r; | |
if(argc < 3){ | |
print_usage(); | |
return -1; | |
} | |
if (argv[1][1] == 'b'){ | |
if(argc != 4){ | |
print_usage(); | |
return -1; | |
} | |
r = start_sniffing(argv[2], argv[3]); | |
}else if (argv[1][1] == 'e'){ | |
r = stop_sniffing(atoi(argv[2])); | |
}else{ | |
print_usage(); | |
return -1; | |
} | |
printf("returned: %d\n", r); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment