summaryrefslogtreecommitdiffstats
path: root/kiss
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-08-10 05:54:53 +0200
committerRalf Baechle <ralf@linux-mips.org>1999-08-10 05:54:53 +0200
commita4cc50373fbe27c973f95628fc142efec14e05cf (patch)
treebc163bed95c61b53f1399cb27e1fe9dd60bb6b4f /kiss
parent5f5d1604492ae15967f9d86f41fbeeedcae0ae2b (diff)
Import ax25-tools 0.0.4 from tarballax25-tools-0.0.4
Diffstat (limited to 'kiss')
-rw-r--r--kiss/Makefile.am2
-rw-r--r--kiss/Makefile.in7
-rw-r--r--kiss/kissattach.89
-rw-r--r--kiss/kissattach.c21
-rw-r--r--kiss/kissparms.c5
-rw-r--r--kiss/net2kiss.c6
6 files changed, 37 insertions, 13 deletions
diff --git a/kiss/Makefile.am b/kiss/Makefile.am
index c37accc..47c6ef4 100644
--- a/kiss/Makefile.am
+++ b/kiss/Makefile.am
@@ -16,5 +16,5 @@ AX25_SYSCONFDIR=${sysconfdir}/ax25/
AX25_LOCALSTATEDIR=${localstatedir}/ax25/
install-exec-local:
- (cd $(DESTDIR)$(sbindir) ; ln -s kissattach spattach)
+ (cd $(DESTDIR)$(sbindir) ; ln -sf kissattach spattach)
diff --git a/kiss/Makefile.in b/kiss/Makefile.in
index fdada1d..1fcf531 100644
--- a/kiss/Makefile.in
+++ b/kiss/Makefile.in
@@ -61,6 +61,7 @@ AWK = @AWK@
AX25IO_LIB = @AX25IO_LIB@
AX25_LIB = @AX25_LIB@
CC = @CC@
+DMASCC = @DMASCC@
MAKEINFO = @MAKEINFO@
NCURSES_LIB = @NCURSES_LIB@
PACKAGE = @PACKAGE@
@@ -91,10 +92,6 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-X_CFLAGS = @X_CFLAGS@
-X_LIBS = @X_LIBS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
kissattach_SOURCES = kissattach.c
kissattach_OBJECTS = kissattach.o
kissattach_LDADD = $(LDADD)
@@ -372,7 +369,7 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
installconf:
install-exec-local:
- (cd $(DESTDIR)$(sbindir) ; ln -s kissattach spattach)
+ (cd $(DESTDIR)$(sbindir) ; ln -sf kissattach spattach)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/kiss/kissattach.8 b/kiss/kissattach.8
index 1ba0ea7..54bb648 100644
--- a/kiss/kissattach.8
+++ b/kiss/kissattach.8
@@ -2,7 +2,7 @@
.SH NAME
kissattach, spattach \- Attach a KISS or 6PACK interface
.SH SYNOPSIS
-.B kissattach [-6] [-i inetaddr] [-l] [-m mtu] [-v] tty port
+.B kissattach [-6] [-l] [-m mtu] [-v] tty port inetaddr
.sp
.B spattach [-i inetaddr] [-l] [-m mtu] [-v] tty port
.SH DESCRIPTION
@@ -22,6 +22,10 @@ The tty argument will typically be that of a serial port with a KISS or 6PACK
TNC attached, although it could be a pseudo tty or a KISS port emulator such as
an SCC card. The port arguments is the name of a port as given in the
axports(5) file.
+.LP
+The inetaddr argument is the IP address of the new interface. This is now a
+mandatory argument although due to historical reasons this restriction is
+lifted if the old -i option is used.
.SH OPTIONS
.TP 16
.BI "\-6"
@@ -30,7 +34,8 @@ the program is called as spattach.
.TP 16
.BI "\-i inetaddr"
Set the internet address of the interface. This address may either be a
-dotted decimal address or a host name.
+dotted decimal address or a host name. This option is now depreciated and
+the program will complain about it, though still work.
.TP 16
.BI \-l
Log messages to the system log, the default is not to.
diff --git a/kiss/kissattach.c b/kiss/kissattach.c
index 7b26560..8da27f5 100644
--- a/kiss/kissattach.c
+++ b/kiss/kissattach.c
@@ -45,7 +45,7 @@ static int mtu = 0;
static int logging = FALSE;
static char *progname;
-static char *basename(char *s)
+static char *kiss_bname(char *s)
{
char *p = strrchr(s, '/');
return p ? p + 1 : s;
@@ -206,6 +206,10 @@ static int startiface(char *dev, struct hostent *hp)
return TRUE;
}
+static void usage(char *progname)
+{
+ fprintf(stderr, "usage: %s [-l] [-m mtu] [-v] ttyinterface port inetaddr\n", progname);
+}
int main(int argc, char *argv[])
{
@@ -215,7 +219,7 @@ int main(int argc, char *argv[])
int v = 4;
struct hostent *hp = NULL;
- progname = basename(argv[0]);
+ progname = kiss_bname(argv[0]);
if (!strcmp(progname, "spattach"))
disc = N_6PACK;
@@ -226,6 +230,7 @@ int main(int argc, char *argv[])
disc = N_6PACK;
break;
case 'i':
+ fprintf(stderr,"%s: -i flag depreciated, use new command line format instead.\n", progname);
if ((hp = gethostbyname(optarg)) == NULL) {
fprintf(stderr, "%s: invalid internet name/address - %s\n", progname, optarg);
return 1;
@@ -245,13 +250,13 @@ int main(int argc, char *argv[])
return 0;
case ':':
case '?':
- fprintf(stderr, "usage: %s [-i inetaddr] [-l] [-m mtu] [-v] ttyinterface port\n", progname);
+ usage(progname);
return 1;
}
}
- if ((argc - optind) != 2) {
- fprintf(stderr, "usage: %s [-i inetaddr] [-l] [-m mtu] [-v] ttyinterface port\n", progname);
+ if ((argc - optind) != 3 && ((argc - optind) != 2 || hp == NULL)) {
+ usage(progname);
return 1;
}
@@ -263,6 +268,12 @@ int main(int argc, char *argv[])
if (!readconfig(argv[optind + 1]))
return 1;
+ if ((argc - optind) == 3) {
+ if ((hp = gethostbyname(argv[optind + 2])) == NULL) {
+ fprintf(stderr, "%s: invalid internet name/address - %s\n", progname, argv[optind+2]);
+ }
+ }
+
if ((fd = open(argv[optind], O_RDONLY | O_NONBLOCK)) == -1) {
fprintf(stderr, "%s: ", progname);
perror("open");
diff --git a/kiss/kissparms.c b/kiss/kissparms.c
index ea0f0bd..3d23ed6 100644
--- a/kiss/kissparms.c
+++ b/kiss/kissparms.c
@@ -8,7 +8,12 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
+
+#ifdef __GLIBC__
#include <net/ethernet.h>
+#else
+#include <linux/if_ether.h>
+#endif
#ifdef HAVE_NETAX25_AX25_H
#include <netax25/ax25.h>
diff --git a/kiss/net2kiss.c b/kiss/net2kiss.c
index 19a7385..72e10e0 100644
--- a/kiss/net2kiss.c
+++ b/kiss/net2kiss.c
@@ -47,7 +47,13 @@
#include <sys/socket.h>
#include <net/if.h>
+
+#ifdef __GLIBC__
#include <net/ethernet.h>
+#else
+#include <linux/if_ether.h>
+#endif
+
/* --------------------------------------------------------------------- */