-int usage(void)
-{
- puts("usage: hdw-sniff <options>");
- puts("\toptions:\t-m <mode> \t1 monitoring, 2 managed");
- puts("\t\t-d <device> \twlan0,eth0");
- puts("\t\t-l <logfile>");
- puts("\t\t-h \tdisplay this help message");
- return -23;
+
+int get_user_event(t_info *info) {
+ char event;
+ if(read(0,&event,1)!=1) {
+ perror("reading user interaction failed");
+ return -23;
+ }
+ printf("user event: %c ",event);
+ if(event=='h') {
+ info->mode^=MODE_HEXOUT;
+ printf("- hex output: %c\n",info->mode&MODE_HEXOUT?'a':'n');
+ }
+ if(event=='a') {
+ info->mode^=MODE_ASCIIOUT;
+ printf("- ascii output: %c\n",info->mode&MODE_ASCIIOUT?'a':'n');
+ }
+ if(event=='q') {
+ info->mode|=MODE_QUIT;
+ printf("- shutting down!\n");
+ }
+
+ return 23;