summaryrefslogtreecommitdiffstats
path: root/ax25ipd
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2013-06-05 01:47:43 +0200
committerRalf Baechle <ralf@linux-mips.org>2015-05-02 18:16:06 +0200
commit8ad248395c0fa0bccff6d0f9c43712018f0645f9 (patch)
tree6e39778d2b046c1b3c3a398bfd37bca7b76ac562 /ax25ipd
parent1725ab720b56a94f895528a8aa89fe054ae9136d (diff)
Use tabs for indentation, not spaces.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'ax25ipd')
-rw-r--r--ax25ipd/README.ax25ipd58
-rw-r--r--ax25ipd/ax25ipd.c16
-rw-r--r--ax25ipd/config.c22
-rw-r--r--ax25ipd/io.c72
4 files changed, 84 insertions, 84 deletions
diff --git a/ax25ipd/README.ax25ipd b/ax25ipd/README.ax25ipd
index bfc12d8..a9c0a9d 100644
--- a/ax25ipd/README.ax25ipd
+++ b/ax25ipd/README.ax25ipd
@@ -3,8 +3,8 @@
** This file is a cobbling together of the various notes on ax25ipd.
**
- ax25ipd
- =======
+ ax25ipd
+ =======
This README files pertains to version 1.0.2 of ax25ipd.
(this document is still incomplete -- the UDP features lack examples)
@@ -142,17 +142,17 @@ using ax25ipd to carry AX.25 traffic.
| on | | | | TCP/IP network
| PC | | | |
`----------' `----------' |
- |
- (vast distance)
- |
- | fish.sea.com W1AW-5
- | .----------. .----------.
- | | | | |
- | | UNIX | KISS | |
- |---| host |------| NOS |
- | | | 1200 | on |
- | | baud | PC |
- `----------' `----------'
+ |
+ (vast distance)
+ |
+ | fish.sea.com W1AW-5
+ | .----------. .----------.
+ | | | | |
+ | | UNIX | KISS | |
+ |---| host |------| NOS |
+ | | | 1200 | on |
+ | | baud | PC |
+ `----------' `----------'
Config file: Config file:
@@ -174,8 +174,8 @@ Sample Configuration - digi-to-digi
This example shows how to configure ax25ipd as a pair of digipeaters.
- (KA9WSB-3)
- one.two.com
+ (KA9WSB-3)
+ one.two.com
.----------. .----------.
| | | |
| Standard | KISS | UNIX | |
@@ -183,18 +183,18 @@ Sample Configuration - digi-to-digi
| TNC | | | | TCP/IP network
| & radio | | | |
`----------' `----------' |
- |
- (vast distance)
- |
- | (W1AW-5)
- | fish.sea.com W1AW-5
- | .----------. .----------.
- | | | | |
- | | UNIX | KISS | Standard |
- |---| host |------| KISS |
- | | | 9600 | TNC |
- | | baud | & radio |
- `----------' `----------'
+ |
+ (vast distance)
+ |
+ | (W1AW-5)
+ | fish.sea.com W1AW-5
+ | .----------. .----------.
+ | | | | |
+ | | UNIX | KISS | Standard |
+ |---| host |------| KISS |
+ | | | 9600 | TNC |
+ | | baud | & radio |
+ `----------' `----------'
Config file: Config file:
@@ -270,10 +270,10 @@ AXIP (IP encapsulation of AX.25 frames) daemon by Michael Westerhof.
Network Working Group B. Kantor
Request for Comments: 1226 Univ. of Calif San Diego
- May 1991
+ May 1991
- Internet Protocol Encapsulation of AX.25 Frames
+ Internet Protocol Encapsulation of AX.25 Frames
Status of this Memo
diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c
index 4888c07..b1786f5 100644
--- a/ax25ipd/ax25ipd.c
+++ b/ax25ipd/ax25ipd.c
@@ -41,7 +41,7 @@ struct option options[] = {
{"help", 0, NULL, 'h'},
{"configfile", 1, NULL, 'c'},
{"ttydevice", 1, NULL, 'd'},
- {"nofork", 0, NULL, 'f'},
+ {"nofork", 0, NULL, 'f'},
{0, 0, 0, 0}
};
@@ -75,8 +75,8 @@ int main(int argc, char **argv)
strncpy(opt_ttydevice, optarg, sizeof(opt_ttydevice)-1);
opt_ttydevice[sizeof(opt_ttydevice)-1] = 0;
break;
- case 'f':
- opt_nofork = 1;
+ case 'f':
+ opt_nofork = 1;
break;
case 'h':
opt_help = 1;
@@ -116,8 +116,8 @@ int main(int argc, char **argv)
(" --configfile FILE, -c FILE Set configuration file to FILE\n");
printf
(" --ttydevice TTYDEV, -d TTYDEV Set device parameter to TTYDEV\n");
- printf
- (" --nofork, -f Do not put daemon in background\n");
+ printf
+ (" --nofork, -f Do not put daemon in background\n");
exit(0);
}
@@ -145,12 +145,12 @@ int main(int argc, char **argv)
io_open();
/* if we get this far without error, let's fork off ! :-) */
- if (opt_nofork == 0) {
+ if (opt_nofork == 0) {
if (!daemon_start(TRUE)) {
- syslog(LOG_DAEMON | LOG_CRIT, "ax25ipd: cannot become a daemon\n");
+ syslog(LOG_DAEMON | LOG_CRIT, "ax25ipd: cannot become a daemon\n");
return 1;
}
- }
+ }
/* we need to close stdin, stdout, stderr: because otherwise
* scripting like ttyname=$(ax25ipd | tail -1) does not work
diff --git a/ax25ipd/config.c b/ax25ipd/config.c
index 5b2c3e4..e1a7f70 100644
--- a/ax25ipd/config.c
+++ b/ax25ipd/config.c
@@ -319,17 +319,17 @@ int parse_line(char *buf)
uport = ntohs(my_udp);
while ((q = strtok(NULL, " \t\n\r")) != NULL) {
if (strcmp(q, "udp") == 0) {
- /* uport == 0 should never happen.
- * re-use setting. It costed me a long time
- * to realize that "udp" in ax25ipd.conf
- * is not enough. It used the wrong port;
- * 93 is standard, I configured socket udp 93,
- * but ax25ipd talked to partners on that
- * strange 10093. Even more, ax25ipd.conf's
- * examples for axip did not help - and the
- * manual is far from complete.
- */
- if (uport == 0)
+ /* uport == 0 should never happen.
+ * re-use setting. It costed me a long time
+ * to realize that "udp" in ax25ipd.conf
+ * is not enough. It used the wrong port;
+ * 93 is standard, I configured socket udp 93,
+ * but ax25ipd talked to partners on that
+ * strange 10093. Even more, ax25ipd.conf's
+ * examples for axip did not help - and the
+ * manual is far from complete.
+ */
+ if (uport == 0)
uport = DEFAULT_UDP_PORT;
q = strtok(NULL, " \t\n\r");
if (q != NULL) {
diff --git a/ax25ipd/io.c b/ax25ipd/io.c
index 6d5fcd5..db26657 100644
--- a/ax25ipd/io.c
+++ b/ax25ipd/io.c
@@ -545,49 +545,49 @@ int io_error(
/* if (oops >= 0)
return 0; */ /* do we have an error ? */
/* dl9sau: nobody has set fd's to O_NONBLOCK.
- * thus EAGAIN (below) or EWOULDBLOCK are never be set.
- * Has someone removed this behaviour previously?
- * Anyway, in the current implementation, with blocking
- * read/writes, a read or write of 0 bytes means EOF,
- * for e.g. if the attached tty is closed.
- * We have to exit then. We've currentlsy no mechanism
- * for regulary reconnects.
- */
+ * thus EAGAIN (below) or EWOULDBLOCK are never be set.
+ * Has someone removed this behaviour previously?
+ * Anyway, in the current implementation, with blocking
+ * read/writes, a read or write of 0 bytes means EOF,
+ * for e.g. if the attached tty is closed.
+ * We have to exit then. We've currentlsy no mechanism
+ * for regulary reconnects.
+ */
if (oops > 0)
- return 0; /* do we have an error ? */
+ return 0; /* do we have an error ? */
- if (oops == 0) {
- if (dir == READ_MSG && oops != TTY_MODE /* && != TCP_MODE, if we'd implement this */ )
- return 0;
- fprintf(stderr, "Close event on mode 0x%2.2x (during %s). LINE %d. Terminating normaly.\n", mode, (dir == READ_MSG ? "READ" : "WRITE"), where);
- exit(1);
- }
+ if (oops == 0) {
+ if (dir == READ_MSG && oops != TTY_MODE /* && != TCP_MODE, if we'd implement this */ )
+ return 0;
+ fprintf(stderr, "Close event on mode 0x%2.2x (during %s). LINE %d. Terminating normaly.\n", mode, (dir == READ_MSG ? "READ" : "WRITE"), where);
+ exit(1);
+ }
#ifdef EAGAIN
- if (errno == EAGAIN) {
+ if (errno == EAGAIN) {
#ifdef notdef
- /* select() said that data is available, but recvfrom sais
- * EAGAIN - i really do not know what's the sense in this.. */
- if (dir == READ_MSG && oops != TTY_MODE /* && != TCP_MODE, if we'd implement this */ )
- return 0;
- perror("System 5 I/O error!");
- fprintf(stderr, "A System 5 style I/O error was detected. This rogram requires BSD 4.2\n");
- fprintf(stderr, "behaviour. This is probably a result of compile-time environment.\n");
- fprintf(stderr, "Mode 0x%2.2x, LINE: %d. During %s\n", mode, where, (dir == READ_MSG ? "READ" : "WRITE"));
- exit(3);
+ /* select() said that data is available, but recvfrom sais
+ * EAGAIN - i really do not know what's the sense in this.. */
+ if (dir == READ_MSG && oops != TTY_MODE /* && != TCP_MODE, if we'd implement this */ )
+ return 0;
+ perror("System 5 I/O error!");
+ fprintf(stderr, "A System 5 style I/O error was detected. This rogram requires BSD 4.2\n");
+ fprintf(stderr, "behaviour. This is probably a result of compile-time environment.\n");
+ fprintf(stderr, "Mode 0x%2.2x, LINE: %d. During %s\n", mode, where, (dir == READ_MSG ? "READ" : "WRITE"));
+ exit(3);
#else
- int ret = 0;
- if (dir == READ_MSG) {
- LOGL4("read / recv returned -1 EAGAIN\n");
- ret = 0;
- } else if (dir == SEND_MSG) {
- LOGL4("write / send returned -1 EAGAIN, sleeping and retrying!\n");
- usleep(100000);
- ret = 1;
- }
- return ret;
+ int ret = 0;
+ if (dir == READ_MSG) {
+ LOGL4("read / recv returned -1 EAGAIN\n");
+ ret = 0;
+ } else if (dir == SEND_MSG) {
+ LOGL4("write / send returned -1 EAGAIN, sleeping and retrying!\n");
+ usleep(100000);
+ ret = 1;
+ }
+ return ret;
#endif
- }
+ }
#endif
if (dir == READ_MSG) {