tunslip6: remove trailing whitespace

This commit is contained in:
Michael Richardson 2014-05-10 17:03:11 -04:00
parent deb3ea4e9c
commit 6232cc488c

View file

@ -34,7 +34,7 @@
/* Below define allows importing saved output into Wireshark as "Raw IP" packet type */ /* Below define allows importing saved output into Wireshark as "Raw IP" packet type */
#define WIRESHARK_IMPORT_FORMAT 1 #define WIRESHARK_IMPORT_FORMAT 1
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -116,7 +116,7 @@ stamptime(void)
time_t t; time_t t;
struct tm *tmp; struct tm *tmp;
char timec[20]; char timec[20];
gettimeofday(&tv, NULL) ; gettimeofday(&tv, NULL) ;
msecs=tv.tv_usec/1000; msecs=tv.tv_usec/1000;
secs=tv.tv_sec; secs=tv.tv_sec;
@ -226,7 +226,7 @@ serial_to_tun(FILE *inslip, int outfd)
if(timestamp) stamptime(); if(timestamp) stamptime();
fprintf(stderr,"*** Address:%s => %02x%02x:%02x%02x:%02x%02x:%02x%02x\n", fprintf(stderr,"*** Address:%s => %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
// printf("*** Address:%s => %02x%02x:%02x%02x:%02x%02x:%02x%02x\n", // printf("*** Address:%s => %02x%02x:%02x%02x:%02x%02x:%02x%02x\n",
ipaddr, ipaddr,
addr.s6_addr[0], addr.s6_addr[1], addr.s6_addr[0], addr.s6_addr[1],
addr.s6_addr[2], addr.s6_addr[3], addr.s6_addr[2], addr.s6_addr[3],
addr.s6_addr[4], addr.s6_addr[5], addr.s6_addr[4], addr.s6_addr[5],
@ -240,7 +240,7 @@ serial_to_tun(FILE *inslip, int outfd)
slip_send(slipfd, SLIP_END); slip_send(slipfd, SLIP_END);
} }
#define DEBUG_LINE_MARKER '\r' #define DEBUG_LINE_MARKER '\r'
} else if(uip.inbuf[0] == DEBUG_LINE_MARKER) { } else if(uip.inbuf[0] == DEBUG_LINE_MARKER) {
fwrite(uip.inbuf + 1, inbufptr - 1, 1, stdout); fwrite(uip.inbuf + 1, inbufptr - 1, 1, stdout);
} else if(is_sensible_string(uip.inbuf, inbufptr)) { } else if(is_sensible_string(uip.inbuf, inbufptr)) {
if(verbose==1) { /* strings already echoed below for verbose>1 */ if(verbose==1) { /* strings already echoed below for verbose>1 */
@ -310,7 +310,7 @@ serial_to_tun(FILE *inslip, int outfd)
if(c=='\n') if(timestamp) stamptime(); if(c=='\n') if(timestamp) stamptime();
} }
} }
break; break;
} }
@ -358,7 +358,7 @@ void
slip_flushbuf(int fd) slip_flushbuf(int fd)
{ {
int n; int n;
if(slip_empty()) { if(slip_empty()) {
return; return;
} }
@ -636,7 +636,7 @@ ifconf(const char *tundev, const char *ipaddr)
} else { } else {
cc=0; cc=0;
digit = c-'0'; digit = c-'0';
if (digit > 9) if (digit > 9)
digit = 10 + (c & 0xdf) - 'A'; digit = 10 + (c & 0xdf) - 'A';
a[ai] = (a[ai] << 4) + digit; a[ai] = (a[ai] << 4) + digit;
} }
@ -713,7 +713,7 @@ main(int argc, char **argv)
case 'H': case 'H':
flowcontrol=1; flowcontrol=1;
break; break;
case 'L': case 'L':
timestamp=1; timestamp=1;
break; break;
@ -755,7 +755,7 @@ main(int argc, char **argv)
case 'T': case 'T':
tap = 1; tap = 1;
break; break;
case '?': case '?':
case 'h': case 'h':
default: default:
@ -950,7 +950,7 @@ exit(1);
FD_SET(slipfd, &rset); /* Read from slip ASAP! */ FD_SET(slipfd, &rset); /* Read from slip ASAP! */
if(slipfd > maxfd) maxfd = slipfd; if(slipfd > maxfd) maxfd = slipfd;
/* We only have one packet at a time queued for slip output. */ /* We only have one packet at a time queued for slip output. */
if(slip_empty()) { if(slip_empty()) {
FD_SET(tunfd, &rset); FD_SET(tunfd, &rset);
@ -964,12 +964,12 @@ exit(1);
if(FD_ISSET(slipfd, &rset)) { if(FD_ISSET(slipfd, &rset)) {
serial_to_tun(inslip, tunfd); serial_to_tun(inslip, tunfd);
} }
if(FD_ISSET(slipfd, &wset)) { if(FD_ISSET(slipfd, &wset)) {
slip_flushbuf(slipfd); slip_flushbuf(slipfd);
sigalarm_reset(); sigalarm_reset();
} }
/* Optional delay between outgoing packets */ /* Optional delay between outgoing packets */
/* Base delay times number of 6lowpan fragments to be sent */ /* Base delay times number of 6lowpan fragments to be sent */
if(delaymsec) { if(delaymsec) {