summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 12:11:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 12:11:01 +0000
commite701506b2a72165e4d7cd568b6f1e1cac6fb9a99 (patch)
tree02703ff55a5a8549f5bcc398ee60c0049bab8148
parente020986eef139ac10c794970a59bbf413d4c7302 (diff)
slip or strip
-rw-r--r--sbin/slattach/slattach.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c
index 1d93e9e3d75..437569b0529 100644
--- a/sbin/slattach/slattach.c
+++ b/sbin/slattach/slattach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: slattach.c,v 1.16 1995/03/21 18:48:59 mycroft Exp $ */
+/* $NetBSD: slattach.c,v 1.17 1996/05/19 21:57:39 jonathan Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)slattach.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$NetBSD: slattach.c,v 1.16 1995/03/21 18:48:59 mycroft Exp $";
+static char rcsid[] = "$NetBSD: slattach.c,v 1.17 1996/05/19 21:57:39 jonathan Exp $";
#endif
#endif /* not lint */
@@ -76,6 +76,9 @@ char devicename[32];
void usage __P((void));
+int ttydisc __P((char *));
+
+
int
main(argc, argv)
int argc;
@@ -88,7 +91,7 @@ main(argc, argv)
int ch;
sigset_t sigset;
- while ((ch = getopt(argc, argv, "hms:")) != -1) {
+ while ((ch = getopt(argc, argv, "hms:t:")) != -1) {
switch (ch) {
case 'h':
cflag |= CRTSCTS;
@@ -99,6 +102,9 @@ main(argc, argv)
case 's':
speed = atoi(optarg);
break;
+ case 'r': case 't':
+ slipdisc = ttydisc(optarg);
+ break;
case '?':
default:
usage();
@@ -141,10 +147,25 @@ main(argc, argv)
sigsuspend(&sigset);
}
+int
+ttydisc(name)
+ char *name;
+{
+ if (strcmp(name, "slip") == 0)
+ return(SLIPDISC);
+#ifdef STRIPDISC
+ else if (strcmp(name, "strip") == 0)
+ return(STRIPDISC);
+#endif
+ else
+ usage();
+}
+
void
usage()
{
- (void)fprintf(stderr, "usage: slattach [-hm] [-s baudrate] ttyname\n");
+ (void)fprintf(stderr,
+ "usage: slattach [-t ldisc] [-hm] [-s baudrate] ttyname\n");
exit(1);
}