Added interface name to parameter list in first line.

pull/7/head
Oliver Hartkopp 2008-11-17 10:23:42 +00:00
parent 4e41082935
commit e7046e7fca
1 changed files with 4 additions and 1 deletions

View File

@ -126,6 +126,7 @@ static long loop = LOOP;
static unsigned char binary; static unsigned char binary;
static unsigned char binary_gap; static unsigned char binary_gap;
static unsigned char color; static unsigned char color;
static char *interface;
void rx_setup (int fd, int id); void rx_setup (int fd, int id);
void rx_delete (int fd, int id); void rx_delete (int fd, int id);
@ -291,6 +292,8 @@ int main(int argc, char **argv)
return 1; return 1;
} }
interface = argv[optind];
if ((s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM)) < 0) { if ((s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM)) < 0) {
perror("socket"); perror("socket");
return 1; return 1;
@ -543,7 +546,7 @@ int handle_timeo(int fd, long currcms){
if (clearscreen) { if (clearscreen) {
char startline[80]; char startline[80];
printf("%s%s", CLR_SCREEN, CSR_HOME); printf("%s%s", CLR_SCREEN, CSR_HOME);
snprintf(startline, 79, "< can-sniffer parameters: l=%ld h=%ld t=%ld >", loop, hold, timeout); snprintf(startline, 79, "< cansniffer %s # l=%ld h=%ld t=%ld >", interface, loop, hold, timeout);
printf("%s%*s",STARTLINESTR, 79-(int)strlen(STARTLINESTR), startline); printf("%s%*s",STARTLINESTR, 79-(int)strlen(STARTLINESTR), startline);
force_redraw = 1; force_redraw = 1;
clearscreen = 0; clearscreen = 0;