summaryrefslogtreecommitdiff
path: root/usr.bin/telnet/main.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-06-05 00:20:47 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-06-05 00:20:47 +0000
commite7c72fa7318f594e47f10b4196cc7c769a51513a (patch)
tree23c0c880ea44a95515d1eb5f9ada5a529a399d0c /usr.bin/telnet/main.c
parent015b0be4351517901eb05b3de510b4ac1cc5b34a (diff)
Last but not least. Telnet -V rdomain to connect to systems in other routing
domains.
Diffstat (limited to 'usr.bin/telnet/main.c')
-rw-r--r--usr.bin/telnet/main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.bin/telnet/main.c b/usr.bin/telnet/main.c
index 2c9261ec043..7483c05192f 100644
--- a/usr.bin/telnet/main.c
+++ b/usr.bin/telnet/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.16 2007/03/15 22:51:16 jmc Exp $ */
+/* $OpenBSD: main.c,v 1.17 2009/06/05 00:20:46 claudio Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
@@ -60,6 +60,7 @@ static int default_forward=0;
#endif
int family = AF_UNSPEC;
+u_int rdomain;
/*
* Initialize variables.
@@ -91,7 +92,8 @@ usage()
# else
"usage: %s [-468acdEFfKLrx] [-b hostalias] [-e escapechar] "
"[-k realm]\n"
- "\t[-l user] [-n tracefile] [-X authtype] [host [port]]\n",
+ "\t[-l user] [-n tracefile] [-V rdoamin] [-X authtype] "
+ "[host [port]]\n",
#endif
__progname);
@@ -149,6 +151,7 @@ main(argc, argv)
extern int optind;
int ch;
char *user, *alias;
+ const char *errstr;
#ifdef FORWARD
extern int forward_flags;
#endif /* FORWARD */
@@ -177,7 +180,7 @@ main(argc, argv)
*/
autologin = -1;
- while ((ch = getopt(argc, argv, "4678DEKLS:X:ab:cde:fFk:l:n:rt:x"))
+ while ((ch = getopt(argc, argv, "4678DEKLS:X:ab:cde:fFk:l:n:rt:V:x"))
!= -1) {
switch(ch) {
case '4':
@@ -328,6 +331,15 @@ main(argc, argv)
prompt);
#endif
break;
+ case 'V':
+ rdomain = (unsigned int)strtonum(optarg, 0,
+ RT_TABLEID_MAX, &errstr);
+ if (errstr) {
+ fprintf(stderr,
+ "%s: Warning: -R ignored, rdomain %s: %s\n",
+ prompt, errstr, optarg);
+ }
+ break;
case 'x':
#ifdef ENCRYPTION
encrypt_auto(1);