From owner-freebsd-bugs Tue Mar 23 8:40:20 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9F9B614E40 for ; Tue, 23 Mar 1999 08:40:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id IAA12370; Tue, 23 Mar 1999 08:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from iseki-h5.cisco.com (iseki-h5.cisco.com [144.254.190.93]) by hub.freebsd.org (Postfix) with ESMTP id 164EA152BE for ; Tue, 23 Mar 1999 08:35:28 -0800 (PST) (envelope-from iseki@iseki-h5.cisco.com) Received: (from root@localhost) by iseki-h5.cisco.com (8.9.3/8.9.2) id BAA14190; Wed, 24 Mar 1999 01:35:04 +0900 (JST) (envelope-from iseki) Message-Id: <199903231635.BAA14190@iseki-h5.cisco.com> Date: Wed, 24 Mar 1999 01:35:04 +0900 (JST) From: Isao SEKI Reply-To: iseki@gongon.com To: FreeBSD-gnats-submit@freebsd.org Cc: iseki@gongon.com X-Send-Pr-Version: 3.2 Subject: bin/10753: added a new function to /sbin/nos-tun Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 + * 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 -s -d \n"); exit(1); } --- 365,371 ---- usage() { fprintf(stderr, ! "usage: nos_tun -t -s -d -p \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