From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 31 00:21:51 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A35FB16A4CE for ; Thu, 31 Mar 2005 00:21:51 +0000 (GMT) Received: from arc.nasa.gov (pony2pub.arc.nasa.gov [128.102.31.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7524C43D3F for ; Thu, 31 Mar 2005 00:21:51 +0000 (GMT) (envelope-from jtoung@arc.nasa.gov) Received: from mrcrab.nas.nasa.gov ([129.99.139.47] verified) by pony2pub.arc.nasa.gov (CommuniGate Pro SMTP 4.2.8) with ESMTP id 18029650; Wed, 30 Mar 2005 16:21:50 -0800 From: Jerry Toung To: hackers Date: Wed, 30 Mar 2005 16:20:24 -0800 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503301620.24086.jtoung@arc.nasa.gov> cc: Julian Elischer Subject: netgraph TTY X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2005 00:21:51 -0000 Good afternoon list, I am still trying to build a simple netgraph using ng_tty. Ultimately I would like to go from inet->tee->ng_tty(/dev/cuaa0). Please advise what I am doing wrong as I still see an error message (see bottom of email). Excuse me for the slighty long thread. Here is my very simple line discipline code: int d; int ldisc; ldisc = NETGRAPHDISC; if ((d = open("/dev/cuaa0", O_RDWR)) == -1) { perror("open"); } else { printf("descripto # %d\n", d); if ((ioctl(d, TIOCSETD, &ldisc)) == -1) { perror("ioctl"); } } printf("Netgraph TTY node initialized successfully\nPress any key to destroy it"); getc(stdin); close(d); exit; mrcrab# gcc -g netgraph.c -o test mrcrab# ./test descripto # 3 Netgraph TTY node initialized successfully Press any key to destroy it + list There are 2 total nodes: Name: ngctl27022 Type: socket ID: 0000000a Num hooks: 0 Name: tty1 Type: tty ID: 00000008 Num hooks: 0 + mpeer . tee myhook right ngctl: "mpeer": unknown command + mkpeer . tee myhook right + name .:myhook mytee + mkpeer mytee: tty left hook ngctl: send msg: Operation not permitted +