Date: Wed, 24 Mar 1999 01:35:04 +0900 (JST) From: Isao SEKI <iseki@gongon.com> To: FreeBSD-gnats-submit@freebsd.org Cc: iseki@gongon.com Subject: bin/10753: added a new function to /sbin/nos-tun Message-ID: <199903231635.BAA14190@iseki-h5.cisco.com>
next in thread | raw e-mail | index | archive | help
>Number: 10753 >Category: bin >Synopsis: added a new function to /sbin/nos-tun >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Mar 23 08:40:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Isao SEKI >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: IBM ThinkPad535 with 40MB DRAM >Description: added a new function to /sbin/nos-tun >How-To-Repeat: >Fix: Please see the following patch diff -c nos-tun/nos-tun.8 nos-tun.iseki/nos-tun.8 *** nos-tun/nos-tun.8 Tue May 5 15:24:12 1998 --- nos-tun.iseki/nos-tun.8 Wed Mar 24 01:19:54 1999 *************** *** 22,27 **** --- 22,29 ---- .Ar source .Fl d .Ar destination + .Fl p + .Ar protocol_number .Ar target .Sh DESCRIPTION .Nm Nos-tun *************** *** 51,56 **** --- 53,62 ---- .Bx Free end, a concept cisco doesn't really implement. .Pp + .Ar Protocol number + sets tunnel mode. Original KA9Q NOS uses 94 but many peoples use 4 + in worldwide backbone of ampr.org. + .Pp .Ar Target is the address of the remote tunnel device, this must match the source address set on the remote end. *************** *** 77,79 **** --- 83,87 ---- wrote the program, .An Poul-Henning Kamp Aq phk@FreeBSD.org wrote the man-page. + .An Isao SEKI Aq iseki@gongon.com + added a new flag, IP protocol number. diff -c nos-tun/nos-tun.c nos-tun.iseki/nos-tun.c *** nos-tun/nos-tun.c Mon Aug 3 01:06:34 1998 --- nos-tun.iseki/nos-tun.c Wed Mar 24 00:53:41 1999 *************** *** 48,53 **** --- 48,60 ---- * (and why do you want more ?) */ + /* + * Mar. 23 1999 by Isao SEKI <iseki@gongon.com> + * I added a new flag for ip protocol number. + * We are using 4 as protocol number in ampr.org. + * + */ + #ifndef lint static const char rcsid[] = "$Id: nos-tun.c,v 1.4 1998/08/02 16:06:34 bde Exp $"; *************** *** 232,237 **** --- 239,246 ---- char *point_to = NULL; char *to_point = NULL; char *target; + char *protocol = NULL; + int protnum; struct sockaddr t_laddr; /* Source address of tunnel */ struct sockaddr whereto; /* Destination of tunnel */ *************** *** 244,250 **** int nfds; /* Return from select() */ ! while ((c = getopt(argc, argv, "d:s:t:")) != -1) { switch (c) { case 'd': to_point = optarg; --- 253,259 ---- int nfds; /* Return from select() */ ! while ((c = getopt(argc, argv, "d:s:t:p:")) != -1) { switch (c) { case 'd': to_point = optarg; *************** *** 255,260 **** --- 264,272 ---- case 't': devname = optarg; break; + case 'p': + protocol = optarg; + break; } } argc -= optind; *************** *** 265,270 **** --- 277,287 ---- usage(); } + if(protocol == NULL) + protnum = 94; + else + protnum = atoi(protocol); + target = *argv; /* Establish logging through 'syslog' */ *************** *** 284,290 **** if(Set_address(target, to)) Finish(4); ! if ((net = socket(AF_INET, SOCK_RAW, 94)) < 0) { syslog(LOG_ERR,"can't open socket - %m"); Finish(5); } --- 301,307 ---- if(Set_address(target, to)) Finish(4); ! if ((net = socket(AF_INET, SOCK_RAW, protnum)) < 0) { syslog(LOG_ERR,"can't open socket - %m"); Finish(5); } *************** *** 348,354 **** usage() { fprintf(stderr, ! "usage: nos_tun -t <tun_name> -s <source_addr> -d <dest_addr> <target_addr>\n"); exit(1); } --- 365,371 ---- usage() { fprintf(stderr, ! "usage: nos_tun -t <tun_name> -s <source_addr> -d <dest_addr> -p <protocol_number> <target_addr>\n"); exit(1); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903231635.BAA14190>