Skip to content

Instantly share code, notes, and snippets.

@karadza3a
Created June 11, 2016 13:15
Show Gist options
  • Save karadza3a/efecd5e0d16ae0546a578564043b093d to your computer and use it in GitHub Desktop.
Save karadza3a/efecd5e0d16ae0546a578564043b093d to your computer and use it in GitHub Desktop.
#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