summaryrefslogtreecommitdiffstats
path: root/ax25
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-06-05 00:57:38 +0200
committerRalf Baechle <ralf@linux-mips.org>2013-06-17 17:11:30 +0200
commit1245fbd2a8d60bab7b16b8a1d3c0122fee72f53f (patch)
tree6dcf938b1472a9b5cac35648ffb0f3d185c39590 /ax25
parent0b4425760be1f92a1f25daeb5d3dc91814a98622 (diff)
Nuke trailing whitespace.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'ax25')
-rw-r--r--ax25/Makefile.am4
-rw-r--r--ax25/access.c6
-rw-r--r--ax25/ax25.42
-rw-r--r--ax25/ax25d.c34
-rw-r--r--ax25/axctl.c10
-rw-r--r--ax25/axgetput/Makefile.am10
-rw-r--r--ax25/axgetput/axgetput.c2
-rw-r--r--ax25/axgetput/proto_bin.c6
-rw-r--r--ax25/axgetput/util.c2
-rw-r--r--ax25/axparms.88
-rw-r--r--ax25/axparms.c24
-rw-r--r--ax25/axspawn.86
-rw-r--r--ax25/axspawn.c142
-rw-r--r--ax25/beacon.c8
-rw-r--r--ax25/bpqparms.c28
-rw-r--r--ax25/mheard.c4
-rw-r--r--ax25/mheardd.82
-rw-r--r--ax25/mheardd.c22
-rw-r--r--ax25/rxecho.c22
19 files changed, 171 insertions, 171 deletions
diff --git a/ax25/Makefile.am b/ax25/Makefile.am
index b3d393e..327510e 100644
--- a/ax25/Makefile.am
+++ b/ax25/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = axgetput
+SUBDIRS = axgetput
etcfiles = ax25.profile ax25d.conf axspawn.conf rxecho.conf
varfiles = mheard.dat
@@ -24,7 +24,7 @@ LDADD = $(AX25_LIB)
axspawn_LDADD = $(AX25_LIB) $(UTIL_LIB)
INCLUDES = -DAX25_SYSCONFDIR=\""$(AX25_SYSCONFDIR)"\" \
- -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\"
+ -DAX25_LOCALSTATEDIR=\""$(AX25_LOCALSTATEDIR)"\"
AX25_SYSCONFDIR=$(sysconfdir)/ax25/
AX25_LOCALSTATEDIR=$(localstatedir)/ax25/
diff --git a/ax25/access.c b/ax25/access.c
index bf02b04..6fac554 100644
--- a/ax25/access.c
+++ b/ax25/access.c
@@ -214,14 +214,14 @@ void write_example_passwd(char *pwfile, char pwlocation, struct passwd *pw) {
close(i);
if ( ! (f = fopen(pwfile, "w")) )
return;
- fprintf(f, "# %s Password file for axspawn\n", (pwlocation == SYSTEMPW ? "System" : "User"));
+ fprintf(f, "# %s Password file for axspawn\n", (pwlocation == SYSTEMPW ? "System" : "User"));
if (pwlocation == SYSTEMPW) {
fprintf(f, "# disable user self-administered passwords in $HOME/.%s\n", PWFILE);
fprintf(f, "# with the line \"systempasswordonly\"\n");
fprintf(f, "# systempasswordonly\n");
}
fprintf(f, "# Examples (sys and md5 passwords may differ):\n");
- fprintf(f, "# md5 standard (secure) - length: >= %d and <= %d characters\n", MINPWLEN_MD5, PASSSIZE);
+ fprintf(f, "# md5 standard (secure) - length: >= %d and <= %d characters\n", MINPWLEN_MD5, PASSSIZE);
fprintf(f, "# %smd5:%s\n", (pwlocation == SYSTEMPW ? "username:" : ""), generate_rand_pw(MINPWLEN_MD5));
fprintf(f, "# sys/baycom standard (not very secure) - length: >= %d and <= %d characters\n", MINPWLEN_SYS, PASSSIZE);
fprintf(f, "# %ssys:%s\n", (pwlocation == SYSTEMPW ? "username:" : ""), generate_rand_pw(MINPWLEN_SYS));
@@ -373,7 +373,7 @@ char *read_pwd (struct passwd *pw, int *pwtype)
}
}
found:
-
+
if (!pass || !*pwtype)
goto end;
diff --git a/ax25/ax25.4 b/ax25/ax25.4
index 6456971..f10bc06 100644
--- a/ax25/ax25.4
+++ b/ax25/ax25.4
@@ -38,7 +38,7 @@ association. a set of ioctl calls are provided to manage an association
table, and in addition the superuser may use an arbitary callsign by binding
to the callsign desired and specifying the port to use as a first digipeated
hop.
-.LP
+.LP
AX.25 supports the following socket options for SOL_AX25. AX25_T1 is the T1
timer in 1/10ths of a second, AX25_T2 is the T2 timer in 1/10ths of a
second, AX25_T3 is the T3 timer. The window is settable with AX25_WINDOW.
diff --git a/ax25/ax25d.c b/ax25/ax25d.c
index 730ca49..9e20b03 100644
--- a/ax25/ax25d.c
+++ b/ax25/ax25d.c
@@ -71,7 +71,7 @@
* 1.6 Aug 1995 Reset the 'defaults' entry's when we start parsing
* a new interface.
*
- * 1.7 Dec 1995 Added BROKEN_NETROM_KERNEL define for setsockopt.
+ * 1.7 Dec 1995 Added BROKEN_NETROM_KERNEL define for setsockopt.
*
* 1.8 Jan 1996 Added support for AX25_BIND_ANY_DEVICE, specify just
* [CALL-X VIA *].
@@ -228,7 +228,7 @@ void err_config(void) {
if (Logging)
syslog(LOG_INFO, "config file reload error, continuing with original");
}
-}
+}
/*--------------------------------------------------------------------------*/
@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
char buf[1024];
char *p;
char *mesg;
-
+
while ((cnt = getopt(argc, argv, "c:lv")) != EOF) {
switch (cnt) {
case 'c':
@@ -336,7 +336,7 @@ int main(int argc, char *argv[])
int argc;
int new;
int i;
-
+
/*
* Setting up a non-blocking accept() so is does not hang up
* - I am not sure at this time why I didn't/don't assign
@@ -358,7 +358,7 @@ int main(int argc, char *argv[])
i = FALSE;
ioctl(paxl->fd, FIONBIO, &i);
-
+
if (new < 0) {
if (errno == EWOULDBLOCK)
continue; /* It's gone ??? */
@@ -368,7 +368,7 @@ int main(int argc, char *argv[])
close(paxl->fd);
paxl->fd = -1;
reload_timer(10);
- continue;
+ continue;
}
switch (paxl->af_type) {
@@ -522,7 +522,7 @@ int main(int argc, char *argv[])
/* checkVC == 1: wait for data */
if (Logging && (!(paxl->flags & FLAG_NOLOGGING) || raxl->LoggingVC)) {
- syslog((raxl->LoggingVC ? LOG_NOTICE : LOG_INFO), "AX.25 %s (%s:%s) AX25.IP-VC host connected. %s",
+ syslog((raxl->LoggingVC ? LOG_NOTICE : LOG_INFO), "AX.25 %s (%s:%s) AX25.IP-VC host connected. %s",
User, Port, myAX25Name,
(raxl->VCloginEnable ? "waiting for first PID=text packet for triggered login" : "discarding PID=text packets"));
}
@@ -533,7 +533,7 @@ int main(int argc, char *argv[])
buf[i] = 0;
if (Logging && raxl->LoggingVC > 1) {
/* debug */
- syslog((LOG_DEBUG), "DEBUG: AX.25 %s (%s:%s) AX25.IP-VC host said: >%s<", User, Port, myAX25Name, buf);
+ syslog((LOG_DEBUG), "DEBUG: AX.25 %s (%s:%s) AX25.IP-VC host said: >%s<", User, Port, myAX25Name, buf);
}
/* skip leading mess */
for (p = buf; *p && (isspace(*p & 0xff) || *p == '\r'); p++) ;
@@ -645,7 +645,7 @@ static void SignalTERM(int code)
syslog(LOG_INFO, "terminating on SIGTERM\n");
closelog();
}
-
+
exit(0);
}
@@ -655,7 +655,7 @@ static void WorkoutArgs(int af_type, char *shell, int *argc, char **argv)
char *sp, *cp;
int cnt = 0;
int args = 0;
-
+
for (cp = shell; *cp != '\0'; cp++) {
if (isspace(*cp) && cnt != 0) {
buffer[cnt] = '\0';
@@ -829,7 +829,7 @@ static int ReadConfig(void)
if (buffer[0] == '#')
continue;
-
+
switch (buffer[0]) {
case '[': /* AX25 port call */
af_type = AF_AX25;
@@ -837,7 +837,7 @@ static int ReadConfig(void)
error = FALSE;
iamdigi = FALSE;
break;
-
+
case '<': /* NETROM iface call */
af_type = AF_NETROM;
hunt = TRUE;
@@ -851,7 +851,7 @@ static int ReadConfig(void)
error = FALSE;
iamdigi = FALSE;
break;
-
+
default:
if (hunt && !error)
goto BadLine;
@@ -1210,7 +1210,7 @@ ignore:
goto BadArgsFree;
axl_ent->flags = ParseFlags(s, line);
-
+
if (!(axl_ent->flags & FLAG_LOCKOUT)) {
/* Get username */
if ((s = strtok(NULL, " \t")) == NULL)
@@ -1340,7 +1340,7 @@ static unsigned long ParseFlags(const char *kp, int line)
static struct axlist *ClearList(struct axlist *list)
{
struct axlist *tp1, *tp2, *tmp;
-
+
for (tp1 = list; tp1 != NULL; ) {
for (tp2 = tp1->ents; tp2 != NULL; ) {
if (tp2->port != NULL)
@@ -1384,11 +1384,11 @@ static char *stripssid(const char *call)
{
static char newcall[10];
char *s;
-
+
strcpy(newcall, call);
if ((s = strchr(newcall, '-')) != NULL)
*s = '\0';
-
+
return newcall;
}
diff --git a/ax25/axctl.c b/ax25/axctl.c
index 2b7c034..45c742a 100644
--- a/ax25/axctl.c
+++ b/ax25/axctl.c
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
struct ax25_ctl_struct ax25_ctl;
char *addr;
int s;
-
+
if (argc == 2 && strncmp(argv[1], "-v", 2) == 0) {
printf("axctl: %s\n", VERSION);
return 0;
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
return 1;
if (ax25_aton_entry(argv[3], (char *)&ax25_ctl.source_addr) == -1)
return 1;
-
+
if ((s = socket(AF_AX25, SOCK_SEQPACKET, 0)) < 0) {
perror("axctl: socket");
return 1;
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
return 1;
}
ax25_ctl.arg = atoi(argv[5]);
-
+
if (strcmp(argv[4], "t1") == 0 || strcmp(argv[4], "-t1") == 0)
ax25_ctl.cmd = AX25_T1;
else if (strcmp(argv[4], "t2") == 0 || strcmp(argv[4], "-t2") == 0)
@@ -83,11 +83,11 @@ int main(int argc, char **argv)
}
ax25_ctl.digi_count = 0;
-
+
if (ioctl(s, SIOCAX25CTLCON, &ax25_ctl) != 0) {
perror("axctl: SIOAX25CTLCON");
return 1;
}
-
+
return 0;
}
diff --git a/ax25/axgetput/Makefile.am b/ax25/axgetput/Makefile.am
index 8eae7cc..de92dda 100644
--- a/ax25/axgetput/Makefile.am
+++ b/ax25/axgetput/Makefile.am
@@ -1,19 +1,19 @@
installconf:
-etcfiles =
-varfiles =
+etcfiles =
+varfiles =
-sbin_PROGRAMS =
+sbin_PROGRAMS =
bin_PROGRAMS = axgetput
-dist_man_MANS = axgetput.1
+dist_man_MANS = axgetput.1
axgetput_SOURCES = axgetput.c axgetput.h util.h proto_bin.h util.c proto_bin.c includes.h
install-exec-hook:
(cd $(DESTDIR)$(bindir) && ln -sf axgetput bget && ln -sf axgetput bput)
-install-data-hook:
+install-data-hook:
(cd $(DESTDIR)$(mandir)/man1 && ln -sf axgetput.1 bget.1 && ln -sf axgetput.1 bput.1)
diff --git a/ax25/axgetput/axgetput.c b/ax25/axgetput/axgetput.c
index 9513a8f..1696dbf 100644
--- a/ax25/axgetput/axgetput.c
+++ b/ax25/axgetput/axgetput.c
@@ -223,7 +223,7 @@ int main(int argc, char *argv[])
fdin_is_pipe = (isatty(fdin) ? 0 : 1);
fdout_is_pipe = (isatty(fdout) ? 0 : 1);
- if (fdin_is_pipe && fdout_is_pipe) {
+ if (fdin_is_pipe && fdout_is_pipe) {
fprintf(stderr, "error: cannot work in between two pipes\n");
exit(1);
}
diff --git a/ax25/axgetput/proto_bin.c b/ax25/axgetput/proto_bin.c
index 004ca5e..d02249b 100644
--- a/ax25/axgetput/proto_bin.c
+++ b/ax25/axgetput/proto_bin.c
@@ -21,7 +21,7 @@ static int crcbit[8] = {
static int init_crc(void)
{
int i,j;
-
+
for (i = 0; i < 256; i++) {
crctab[i] = 0;
for (j = 0; j < 8; j++) {
@@ -192,7 +192,7 @@ int bput(void)
goto abort;
}
if (!len) {
- save_close(fddata);
+ save_close(fddata);
if (!term_line) {
sprintf(err_msg, "error: unexpected end of file during read: %s\n", strerror(errno));
return 1;
@@ -331,7 +331,7 @@ int bget(void) {
file_time = statbuf.st_mtime;
else
file_time = time(0);
-
+
/* compute crc */
while ((len = read(fddata, buf, BLOCKSIZ)) > 0) {
int i;
diff --git a/ax25/axgetput/util.c b/ax25/axgetput/util.c
index 5ce6ffb..98caeeb 100644
--- a/ax25/axgetput/util.c
+++ b/ax25/axgetput/util.c
@@ -79,7 +79,7 @@ int my_read(int fd, char *s, int len_max, int *eof, char *p_break)
return len_got;
}
-
+
/*---------------------------------------------------------------------------*/
int secure_write(int fd, char *s, int len_write) {
diff --git a/ax25/axparms.8 b/ax25/axparms.8
index 9989be8..3187158 100644
--- a/ax25/axparms.8
+++ b/ax25/axparms.8
@@ -70,12 +70,12 @@ The formats of this option are:
.fi
.LP
Routes added via this command will not be removed from the internal routing
-table when they are \(lqold\(rq as normal entries are. The
+table when they are \(lqold\(rq as normal entries are. The
.B --ipmode
option sets mode vc or mode datagram for this destination.
.LP
-If the <callsign> argument is set to \(lqdefault\(rq then this will set the
-default route for all outgoing AX.25 connections which will be used when there
+If the <callsign> argument is set to \(lqdefault\(rq then this will set the
+default route for all outgoing AX.25 connections which will be used when there
is no specific route to the required destination.
.SH "--setcall Argument"
.LP
@@ -92,7 +92,7 @@ ax0, ax1, .., sp0, .., bpq0, ... etc..
The change is permanent as long as the interface exists, or another \(lqaxparms
--setcall\(rq is issued.
.LP
-The interface has to exist already in order to use this option; it
+The interface has to exist already in order to use this option; it
may be in state UP or DOWN.
.SH "--version Argument"
.LP
diff --git a/ax25/axparms.c b/ax25/axparms.c
index daac7d4..8decf93 100644
--- a/ax25/axparms.c
+++ b/ax25/axparms.c
@@ -103,18 +103,18 @@ int routes(int s, int argc, char *argv[], ax25_address *callsign)
perror("axparms: SIOCADDRT");
return 1;
}
-
+
ax25_opt.port_addr = *callsign;
ax25_opt.dest_addr = ax25_route.dest_addr;
ax25_opt.cmd = AX25_SET_RT_IPMODE;
ax25_opt.arg = ip_mode;
-
+
if (ioctl(s, SIOCAX25OPTRT, &ax25_opt) != 0) {
perror("axparms: SIOCAX25OPTRT");
return 1;
}
}
-
+
if (strcmp(argv[2], "del") == 0) {
ax25_route.port_addr = *callsign;
ax25_route.digi_count = 0;
@@ -150,14 +150,14 @@ int setifcall(int s, char *ifn, char *name)
{
char call[7];
struct ifreq ifr;
-
+
if (ax25_aton_entry(name, call) == -1)
return 1;
strcpy(ifr.ifr_name, ifn);
memcpy(ifr.ifr_hwaddr.sa_data, call, 7);
ifr.ifr_hwaddr.sa_family = AF_AX25;
-
+
if (ioctl(s, SIOCSIFHWADDR, &ifr) != 0) {
perror("axparms: SIOCSIFHWADDR");
return 1;
@@ -174,7 +174,7 @@ int associate(int s, int argc, char *argv[])
int opt;
FILE *fp;
-
+
if (strcmp(argv[2], "show") == 0) {
if (argc < 3) {
usageassoc();
@@ -239,7 +239,7 @@ int associate(int s, int argc, char *argv[])
usageassoc();
exit(1);
}
-
+
if (ax25_aton_entry(argv[2], (char *)&sax25.sax25_call) == -1) {
fprintf(stderr, "axparms: associate: invalid callsign %s\n", argv[2]);
return 1;
@@ -260,7 +260,7 @@ int associate(int s, int argc, char *argv[])
}
sax25.sax25_uid = pw->pw_uid;
-
+
if (ioctl(s, SIOCAX25ADDUID, &sax25) == -1) {
perror("axparms: SIOCAX25ADDUID");
return 1;
@@ -383,7 +383,7 @@ int main(int argc, char **argv)
usageroute();
return 1;
}
-
+
if (strcmp(argv[2], "add") != 0 && strcmp(argv[2], "del") != 0 && strcmp(argv[2], "list") != 0) {
usageroute();
return 1;
@@ -393,7 +393,7 @@ int main(int argc, char **argv)
usageroute();
return 1;
}
-
+
if (ax25_config_load_ports() == 0) {
fprintf(stderr, "axparms: no AX.25 port data configured\n");
return 1;
@@ -415,7 +415,7 @@ int main(int argc, char **argv)
n = routes(s, argc, argv, &callsign);
close(s);
-
+
return n;
}
@@ -424,7 +424,7 @@ int main(int argc, char **argv)
usagesetcall();
return 1;
}
-
+
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("axparms: socket");
return 1;
diff --git a/ax25/axspawn.8 b/ax25/axspawn.8
index db34d23..672f680 100644
--- a/ax25/axspawn.8
+++ b/ax25/axspawn.8
@@ -40,7 +40,7 @@ and
standards.
axspawn searches in /etc/ax25/bcpasswd (first) and ~user/.bcpasswd (second)
for a match of the required authentication mechanism and password.
-md5 and baycom passwords may differ. md5 passwords gain over baycom passwords.
+md5 and baycom passwords may differ. md5 passwords gain over baycom passwords.
Note: you could "lock" special "friends" out by specifying an empty password
in /etc/ax25/bcpasswd (line "n0call:md5:"). -> md5 Passwords are enforced. But
@@ -48,7 +48,7 @@ the length is shorter than the minimum (len 8 for md5, len 20 for baycom);
user's password file is not searched because in /etc/ax25/bcpasswd its already
found..
-Syntax and caveeats for /etc/ax25/bcpasswd:
+Syntax and caveeats for /etc/ax25/bcpasswd:
- Has to be a regular file (no symlink). Not world-readable/writable.
- Example lines:
# Thomas
@@ -82,7 +82,7 @@ properly.
.TP 5
.B -c, --changeuser
Allow connecting ax25 users to change their username for login. They'll be
-asked for their real login name.
+asked for their real login name.
.TP 5
.B -e, --embedded
Special treatment for axspawn on non-standard conform embedded devices.
diff --git a/ax25/axspawn.c b/ax25/axspawn.c
index e8ad0fa..31fddbc 100644
--- a/ax25/axspawn.c
+++ b/ax25/axspawn.c
@@ -4,18 +4,18 @@
* Copyright (c) 1996 Joerg Reuter DL1BKE (jreuter@poboxes.com)
*
* This program is a hack.
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * It might even kill your cat... ;-)
+ * It might even kill your cat... ;-)
*
* Status: alpha (still...)
*
@@ -28,19 +28,19 @@
* default * * * * * 1 root /usr/local/sbin/axspawn axspawn --wait
*
* The program will check if the peer is an AX.25 socket, the
- * callsign is a valid amateur radio callsign, strip the SSID,
+ * callsign is a valid amateur radio callsign, strip the SSID,
* check if UID/GID are valid, allow a password-less login if the
* password-entry in /etc/passwd is "+" or empty; in every other case
* login will prompt for a password.
*
- * Still on my TODO list: a TheNet compatible or MD5 based
+ * Still on my TODO list: a TheNet compatible or MD5 based
* authentication scheme... Won't help you if you changed the "+"-entry
- * in /etc/passwd to a valid passord and login with telnet, though.
+ * in /etc/passwd to a valid passord and login with telnet, though.
* A better solution could be a small program called from .profile.
*
* Axspawn can create user accounts automatically. You may specify
* the user shell, first and maximum user id, group ID in the config
- * file and (unlike WAMPES) create a file "/usr/local/etc/ax25.profile"
+ * file and (unlike WAMPES) create a file "/usr/local/etc/ax25.profile"
* which will be copied to ~/.profile.
*
* This is an example for the config file:
@@ -126,7 +126,7 @@
* shorter than 6 characters (without SSID). There must be at least
* one digit, and max. two digits within the call. The SSID must
* be within the range of 0 and 15. Please drop me a note if you
- * know a valid Amateur Radio (sic!) callsign that does not fit this
+ * know a valid Amateur Radio (sic!) callsign that does not fit this
* pattern _and_ can be represented correctly in AX.25.
*
* It uses the forkpty from libbsd.a (found after analyzing logind)
@@ -509,7 +509,7 @@ int Strncasecmp(const char *s1, const char *s2, int n)
pid_t forkpty(int *, char *, void *, struct winsize *);
/* The buffer in src (first byte length-1) is decoded into dest
- (first byte length-1). If decoding is not successful, non-0
+ (first byte length-1). If decoding is not successful, non-0
is returned
*/
@@ -522,7 +522,7 @@ int encstathuf(char *src, int srclen, char *dest, int *destlen)
int bit8;
unsigned short huffcode;
int hufflen;
-
+
if ((src == NULL) || (dest == NULL)) {
syslog(LOG_NOTICE, "Huffman encode: src or dest NULL!");
return(1);
@@ -574,7 +574,7 @@ int encstathuf(char *src, int srclen, char *dest, int *destlen)
}
/* The buffer in src (first byte length-1) is decoded into dest
- (first byte length-1). If decoding is not successful, non-0
+ (first byte length-1). If decoding is not successful, non-0
is returned
*/
@@ -679,11 +679,11 @@ int read_ax25(unsigned char *s, int size)
if (bin) {
return(len);
}
-
+
for (k = 0; k < len; k++)
if (s[k] == '\r') s[k] = '\n';
-
+
if (!huffman && !Strncasecmp(s, "//COMP ON\n", 10)) {
sprintf(buffer,"\r//COMP 1\r");
@@ -746,7 +746,7 @@ void kick_wqueue(int dummy)
int bufsize = (huffman ? 256-1 : paclen);
char decoded[260];
int declen;
-
+
signal(SIGALRM, SIG_IGN);
itv.it_value.tv_sec = 0;
itv.it_value.tv_usec = QUEUE_DELAY;
@@ -767,7 +767,7 @@ void kick_wqueue(int dummy)
}
p = s;
s_len = 0;
-
+
while ((w_buf = wqueue_head)) {
curr_len = (w_buf->len > bufsize-s_len ? bufsize-s_len : w_buf->len);
memcpy(p, w_buf->data, curr_len);
@@ -821,7 +821,7 @@ void kick_wqueue(int dummy)
wqueue_head = w_buf->next;
free(w_buf->data);
free(w_buf);
-
+
if (!wqueue_head) {
wqueue_tail = NULL;
return;
@@ -833,7 +833,7 @@ void kick_wqueue(int dummy)
* new data is available in order to send "full packets"
*/
if (wqueue_length < paclen)
- break;
+ break;
}
itv.it_interval.tv_sec = 0;
@@ -855,7 +855,7 @@ int write_ax25(char *s, int len, int kick)
int i = 0;
int j = 0;
char *p;
-
+
if (!len)
return 0;
signal(SIGALRM, SIG_IGN);
@@ -888,7 +888,7 @@ int write_ax25(char *s, int len, int kick)
tcsetattr(0, TCSANOW, &save_termios);
last_ended_with_CR = 0;
return 0;
- }
+ }
if (!bin) {
@@ -915,7 +915,7 @@ int write_ax25(char *s, int len, int kick)
}
else
*(p + i) = *(p + j);
- i++; j++;
+ i++; j++;
}
len = i;
if (len && s[len-1] == '\r')
@@ -935,8 +935,8 @@ int write_ax25(char *s, int len, int kick)
memcpy(buf->data, s, len);
buf->len = len;
- buf->next = NULL;
-
+ buf->next = NULL;
+
if (wqueue_head == NULL)
{
wqueue_head = buf;
@@ -947,7 +947,7 @@ int write_ax25(char *s, int len, int kick)
wqueue_tail = buf;
wqueue_length += len;
}
-
+
if (wqueue_length > 7*paclen || kick || bin)
{
kick_wqueue(0);
@@ -967,12 +967,12 @@ int get_assoc(struct sockaddr_ax25 *sax25)
FILE *fp;
int uid;
char buf[81];
-
+
fp = fopen(PROC_AX25_CALLS_FILE, "r");
if (!fp) return -1;
-
+
fgets(buf, sizeof(buf)-1, fp);
-
+
while(!feof(fp))
{
if (fscanf(fp, "%d %s", &uid, buf) == 2)
@@ -984,7 +984,7 @@ int get_assoc(struct sockaddr_ax25 *sax25)
}
}
fclose(fp);
-
+
return -1;
}
@@ -1020,7 +1020,7 @@ void cleanup(char *tty)
}
-/*
+/*
* add a new user to /etc/passwd and do some init
*/
@@ -1040,7 +1040,7 @@ void new_user(char *newuser)
struct stat fst;
int fd_a, fd_b, fd_l;
mode_t homedir_mode = S_IRUSR|S_IWUSR|S_IXUSR|S_IXOTH|(secure_home ? 0 : (S_IRGRP|S_IXGRP));
-
+
/*
* build path for home directory
*/
@@ -1072,9 +1072,9 @@ retry:
/*
* build directories for home
*/
-
+
p = homedir;
-
+
while (*p == '/') p++;
chdir("/");
@@ -1117,12 +1117,12 @@ retry:
{
chown(p, uid, user_gid);
chmod(p, homedir_mode);
- }
+ }
}
else
goto out;
}
-
+
if (chdir(p) < 0)
goto out;
p = q;
@@ -1157,7 +1157,7 @@ end_mkdirs:
fp = fopen(PASSWDFILE, "a+");
if (fp == NULL)
goto out;
-
+
pw.pw_name = newuser;
pw.pw_passwd = ((policy_add_empty_password) ? "" : "+");
pw.pw_uid = uid;
@@ -1165,12 +1165,12 @@ end_mkdirs:
pw.pw_gecos = username;
pw.pw_dir = userdir;
pw.pw_shell = user_shell;
-
+
if (getpwuid(uid) != NULL) goto retry; /* oops?! */
if (putpwent(&pw, fp) < 0)
goto out;
-
+
fclose(fp);
}
@@ -1179,7 +1179,7 @@ end_mkdirs:
*/
fd_a = open(CONF_AXSPAWN_PROF_FILE, O_RDONLY);
-
+
if (fd_a > 0)
{
int first = 1;
@@ -1187,7 +1187,7 @@ end_mkdirs:
if (fd_b < 0)
goto out;
-
+
/* just 2b sure */
if (lseek(fd_b, 0L, SEEK_END) > 0L)
write(fd_b, "\n", 1);
@@ -1222,16 +1222,16 @@ void read_config(void)
char buf[512];
char cmd[40], param[80];
char *p;
-
+
if (fp == NULL)
return;
-
+
while (!feof(fp))
{
fgets(buf, sizeof(buf), fp);
p = strchr(buf, '#');
if (p) *p='\0';
-
+
if (buf[0] != '\0')
{
sscanf(buf, "%s %s", cmd, param);
@@ -1297,12 +1297,12 @@ void read_config(void)
} else
if (!strncmp(cmd, "secure_home", 11)) {
secure_home = (param[0] == 'y');
- } else
+ } else
if (!strncmp(cmd, "assoc", 5))
{
if (!strcmp(param, "yes"))
policy_associate = 1;
- else
+ else
policy_associate = 0;
} else
if (!strncmp(cmd, "shell", 5))
@@ -1315,7 +1315,7 @@ void read_config(void)
}
}
}
-
+
fclose(fp);
}
@@ -1328,7 +1328,7 @@ void signal_handler(int dummy)
cleanup(ptyslave+5);
exit(1);
}
-
+
int main(int argc, char **argv)
{
char call[20], user[20], as_user[20];
@@ -1400,7 +1400,7 @@ int main(int argc, char **argv)
}
}
strupr(prompt);
-
+
openlog("axspawn", LOG_PID, LOG_DAEMON);
if (getuid() != 0) {
@@ -1411,7 +1411,7 @@ int main(int argc, char **argv)
addrlen = sizeof(struct full_sockaddr_ax25);
k = getpeername(0, (struct sockaddr *) &sockaddr, &addrlen);
-
+
if (k < 0) {
syslog(LOG_NOTICE, "getpeername: %m\n");
return 1;
@@ -1457,7 +1457,7 @@ int main(int argc, char **argv)
{
ssid *= 10;
ssid += (int) (call[k] - '0');
-
+
if (ssid > 15) invalid++;
}
ssidcnt++;
@@ -1481,7 +1481,7 @@ int main(int argc, char **argv)
else
invalid++;
}
-
+
if ( invalid || (k < MINLEN) || (digits > 2) || (digits < 1) )
{
write_ax25_static_line(MSG_NOCALL);
@@ -1489,7 +1489,7 @@ int main(int argc, char **argv)
sleep(EXITDELAY);
return 1;
}
-
+
if (wait_for_tcp) {
/* incoming TCP/IP connection? */
if (read_ax25(buf, sizeof(buf)) < 0)
@@ -1522,7 +1522,7 @@ int main(int argc, char **argv)
user_changed = 1;
}
}
-
+
if (!*as_user)
strcpy(as_user, user);
pw = getpwnam(as_user);
@@ -1536,13 +1536,13 @@ int main(int argc, char **argv)
return 1;
}
- if (policy_add_user)
+ if (policy_add_user)
{
new_user(as_user);
pw = getpwnam(as_user);
endpwent();
}
-
+
if (pw == NULL && policy_guest)
{
strcpy(as_user,guest);
@@ -1557,7 +1557,7 @@ int main(int argc, char **argv)
sleep(EXITDELAY);
return 1;
}
-
+
if (!rootlogin && (pw->pw_uid == 0 || pw->pw_gid == 0))
{
write_ax25_static_line(MSG_NOCALL);
@@ -1565,7 +1565,7 @@ int main(int argc, char **argv)
sleep(EXITDELAY);
return 1;
}
-
+
again:
if (!(pwd = read_pwd(pw, &pwtype))) {
if ((!pwtype || pwtype != PW_CLEARTEXT) && (pwtype != PW_UNIX)) {
@@ -1649,18 +1649,18 @@ again:
close(fds);
}
}
-
+
fcntl(1, F_SETFL, O_NONBLOCK);
-
+
pid = forkpty(&fdmaster, ptyslave, NULL, &win);
-
+
if (pid == 0)
{
struct termios termios;
char *shell = "/bin/sh";
memset((char *) &termios, 0, sizeof(termios));
-
+
ioctl(0, TIOCSCTTY, (char *) 0);
termios.c_iflag = ICRNL | IXOFF;
@@ -1686,7 +1686,7 @@ again:
gettimeofday(&tv, NULL);
ut_line.ut_tv.tv_sec = tv.tv_sec;
ut_line.ut_tv.tv_usec = tv.tv_usec;
- ut_line.ut_addr = 0;
+ ut_line.ut_addr = 0;
pututline(&ut_line);
endutent();
@@ -1731,7 +1731,7 @@ again:
if (p[1]) {
if ((p = strdup(p)))
*p = '-';
-
+
} else p = 0;
}
if (!p)
@@ -1773,7 +1773,7 @@ again:
*/
chargv[chargc++] = "-h";
chargv[chargc++] = protocol;
- if (pwtype != PW_CLEARTEXT /* PW_SYS or PW_MD5 are already authenticated */
+ if (pwtype != PW_CLEARTEXT /* PW_SYS or PW_MD5 are already authenticated */
|| pwcheck == 2 || (pwcheck == 3 && (pw->pw_gid == user_gid || is_guest)) || !strcmp(pw->pw_passwd, "+"))
chargv[chargc++] = "-f";
chargv[chargc++] = as_user;
@@ -1816,7 +1816,7 @@ again:
signal(SIGTERM, signal_handler);
signal(SIGINT, signal_handler);
signal(SIGQUIT, signal_handler);
-
+
while(1)
{
FD_ZERO(&fds_read);
@@ -1826,9 +1826,9 @@ again:
if (wqueue_length <= paclen*7)
FD_SET(fdmaster, &fds_read);
FD_SET(fdmaster, &fds_err);
-
+
k = select(fdmaster+1, &fds_read, NULL, &fds_err, NULL);
-
+
if (k > 0)
{
if (FD_ISSET(0, &fds_err))
@@ -1842,9 +1842,9 @@ again:
cleanup(ptyslave+5);
return 1;
}
-
+
if (FD_ISSET(fdmaster, &fds_err))
- {
+ {
/* give the last packet in the timer controlled sendqueue a chance.. */
if (wqueue_length) {
continue;
@@ -1869,7 +1869,7 @@ again:
} else
write(fdmaster, buf, cnt);
}
-
+
if (FD_ISSET(fdmaster, &fds_read))
{
cnt = read(fdmaster, buf, (huffman ? 254 : sizeof(buf)));
@@ -1889,7 +1889,7 @@ again:
}
write_ax25(buf, cnt, 0);
}
- } else
+ } else
if (k < 0 && errno != EINTR)
{
if (huffman) {
@@ -1903,7 +1903,7 @@ again:
return 0;
}
}
- }
+ }
else
{
write_ax25_static_line(MSG_CANNOTFORK);
@@ -1911,7 +1911,7 @@ again:
sleep(EXITDELAY);
return 1;
}
-
+
sleep(EXITDELAY);
return 0;
diff --git a/ax25/beacon.c b/ax25/beacon.c
index 095614f..26d1998 100644
--- a/ax25/beacon.c
+++ b/ax25/beacon.c
@@ -26,7 +26,7 @@ static void terminate(int sig)
syslog(LOG_INFO, "terminating on SIGTERM\n");
closelog();
}
-
+
exit(0);
}
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
int s, n, dlen, len, interval = 30;
char *addr, *port, *message, *portcall;
char *srccall = NULL, *destcall = NULL;
-
+
while ((n = getopt(argc, argv, "c:d:lmst:v")) != -1) {
switch (n) {
case 'c':
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
port = argv[optind];
message = argv[optind + 1];
-
+
if (ax25_config_load_ports() == 0) {
fprintf(stderr, "beacon: no AX.25 ports defined\n");
return 1;
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
}
return 1;
}
-
+
if (sendto(s, message, strlen(message), 0, (struct sockaddr *)&dest, dlen) == -1) {
if (logging) {
syslog(LOG_ERR, "sendto: %m");
diff --git a/ax25/bpqparms.c b/ax25/bpqparms.c
index f8e9d66..c5e12ad 100644
--- a/ax25/bpqparms.c
+++ b/ax25/bpqparms.c
@@ -1,19 +1,19 @@
-/*
+/*
bpqparms.c
Copyright 1996, by Joerg Reuter jreuter@poboxes.com
- This program is free software; you can redistribute it and/or modify
- it under the terms of the (modified) GNU General Public License
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the (modified) GNU General Public License
delivered with the LinuX kernel source.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should find a copy of the GNU General Public License in
- /usr/src/linux/COPYING;
+ You should find a copy of the GNU General Public License in
+ /usr/src/linux/COPYING;
*/
@@ -54,9 +54,9 @@ int get_hwaddr(unsigned char *k, char *s)
if (strcmp(s, "default") == 0 || strcmp(s, "broadcast") == 0) {
memcpy(k, broadcast, ETH_ALEN);
} else {
- n = sscanf(s, "%x:%x:%x:%x:%x:%x",
+ n = sscanf(s, "%x:%x:%x:%x:%x:%x",
&eth[0], &eth[1], &eth[2], &eth[3], &eth[4], &eth[5]);
-
+
if (n < 6)
return 1;
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
return 1;
}
break;
-
+
case 'a':
flag |= 2;
if (get_hwaddr(addr.accept, optarg)) {
@@ -117,26 +117,26 @@ int main(int argc, char **argv)
usage();
}
}
-
+
if (!(flag & 0x01) || optind+1 > argc)
usage();
-
+
strcpy(dev, argv[optind]);
if ((flag & 0x02) == 0)
memcpy(addr.accept, addr.destination, ETH_ALEN);
fd = socket(AF_INET, SOCK_DGRAM, 0);
-
+
strcpy(ifr.ifr_name, dev);
ifr.ifr_data = (caddr_t) &addr;
-
+
if (ioctl(fd, SIOCSBPQETHADDR, &ifr) < 0) {
perror("bpqparms SIOCSBPQETHADDR");
close(fd);
return 1;
}
-
+
close(fd);
return 0;
diff --git a/ax25/mheard.c b/ax25/mheard.c
index 5aeacf4..a7b46cf 100644
--- a/ax25/mheard.c
+++ b/ax25/mheard.c
@@ -286,7 +286,7 @@ static void SortByFrame(void)
p = n;
}
}
-
+
int main(int argc, char *argv[])
{
int headers = TRUE;
@@ -346,7 +346,7 @@ int main(int argc, char *argv[])
return 1;
}
}
-
+
LoadPortData();
switch (mode) {
diff --git a/ax25/mheardd.8 b/ax25/mheardd.8
index c0dd200..be4a121 100644
--- a/ax25/mheardd.8
+++ b/ax25/mheardd.8
@@ -29,7 +29,7 @@ Sets the number of entries in the activity list file, the default is 100. The
minimum value allowed is 10 and the maximum is 1000.
.TP 10
.BI "\-p [!]port1[,port2,..]"
-With -p, you instruct mheardd to only listen on specified ax25 ports.
+With -p, you instruct mheardd to only listen on specified ax25 ports.
You may give more ports, seperated by ','.
If you introduce the port(s) by a leading '!', then mheardd will listen
on all ports except those you specified.
diff --git a/ax25/mheardd.c b/ax25/mheardd.c
index 79acd79..40eab3b 100644
--- a/ax25/mheardd.c
+++ b/ax25/mheardd.c
@@ -187,7 +187,7 @@ int main(int argc, char **argv)
position = ftell(fp);
s++;
}
-
+
fclose(fp);
} else {
if ((fp = fopen(DATA_MHEARD_FILE, "w")) != NULL)
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
perror("mheardd: socket");
return 1;
}
-
+
if (!daemon_start(FALSE)) {
fprintf(stderr, "mheardd: cannot become a daemon\n");
return 1;
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
}
return 1;
}
-
+
if ((port = ax25_config_get_name(sa.sa_data)) == NULL) {
if (logging)
syslog(LOG_WARNING, "unknown port '%s'\n", sa.sa_data);
@@ -276,9 +276,9 @@ int main(int argc, char **argv)
while (!end) {
memcpy(&mheard->entry.digis[mheard->entry.ndigis], data, sizeof(ax25_address));
mheard->entry.ndigis++;
-
+
end = (data[ALEN] & HDLCAEB);
-
+
data += AXLEN;
size -= AXLEN;
}
@@ -387,10 +387,10 @@ int main(int argc, char **argv)
break;
}
}
-
+
if (mheard->entry.first_heard == 0)
time(&mheard->entry.first_heard);
-
+
time(&mheard->entry.last_heard);
if ((fp = fopen(DATA_MHEARD_FILE, "r+")) == NULL) {
@@ -398,16 +398,16 @@ int main(int argc, char **argv)
syslog(LOG_ERR, "cannot open mheard data file\n");
continue;
}
-
+
if (mheard->position == 0xFFFFFF) {
fseek(fp, 0L, SEEK_END);
mheard->position = ftell(fp);
}
fseek(fp, mheard->position, SEEK_SET);
-
+
fwrite(&mheard->entry, sizeof(struct mheard_struct), 1, fp);
-
+
fclose(fp);
}
}
@@ -445,7 +445,7 @@ static struct mheard_list_struct *findentry(ax25_address *callsign, char *port)
{
struct mheard_list_struct *oldest = NULL;
int i;
-
+
for (i = 0; i < mheard_list_size; i++)
if (mheard_list[i].in_use &&
ax25_cmp(&mheard_list[i].entry.from_call, callsign) == 0 &&
diff --git a/ax25/rxecho.c b/ax25/rxecho.c
index 7acb156..e9c7daa 100644
--- a/ax25/rxecho.c
+++ b/ax25/rxecho.c
@@ -136,7 +136,7 @@ static void terminate(int sig)
syslog(LOG_INFO, "terminating on SIGTERM\n");
closelog();
}
-
+
exit(0);
}
@@ -238,7 +238,7 @@ static struct config *readconfig(void)
}
/*
- * Slightly modified from linux/include/net/ax25.h and
+ * Slightly modified from linux/include/net/ax25.h and
* linux/net/ax25/ax25_subr.c:
*/
@@ -264,13 +264,13 @@ typedef struct {
static unsigned char *ax25_parse_addr(unsigned char *buf, int len, ax25_address *src, ax25_address *dest, ax25_digi *digi)
{
int d = 0;
-
+
if (len < 14) return NULL;
-
+
#if 0
if (flags != NULL) {
*flags = 0;
-
+
if (buf[6] & LAPB_C) {
*flags = C_COMMAND;
}
@@ -279,16 +279,16 @@ static unsigned char *ax25_parse_addr(unsigned char *buf, int len, ax25_address
*flags = C_RESPONSE;
}
}
-
- if (dama != NULL)
+
+ if (dama != NULL)
*dama = ~buf[13] & DAMA_FLAG;
#endif
-
+
/* Copy to, from */
- if (dest != NULL)
+ if (dest != NULL)
memcpy(dest, buf + 0, AX25_ADDR_LEN);
- if (src != NULL)
+ if (src != NULL)
memcpy(src, buf + 7, AX25_ADDR_LEN);
buf += 2 * AX25_ADDR_LEN;
@@ -296,7 +296,7 @@ static unsigned char *ax25_parse_addr(unsigned char *buf, int len, ax25_address
digi->lastrepeat = -1;
digi->ndigi = 0;
-
+
while (!(buf[-1] & LAPB_E)) {
if (d >= AX25_MAX_DIGIS) return NULL; /* Max of 6 digis */
if (len < 7) return NULL; /* Short packet */