From owner-freebsd-net Fri Jan 25 11:18:11 2002 Delivered-To: freebsd-net@freebsd.org Received: from sofia.digsys.bg (sofia.digsys.bg [193.68.3.250]) by hub.freebsd.org (Postfix) with ESMTP id 34AC737B41F for ; Fri, 25 Jan 2002 11:17:58 -0800 (PST) Received: from comm.uni-svishtov.bg (ns.uni-svishtov.bg [193.68.172.1]) by sofia.digsys.bg (8.9.0/8.9.0) with ESMTP id VAA15696 for ; Fri, 25 Jan 2002 21:17:48 +0200 (EET) Received: from grinch.uni-svishtov.bg (grinch.uni-svishtov.bg [193.68.172.9]) by comm.uni-svishtov.bg (8.9.3/8.9.3) with ESMTP id VAA25561 for ; Fri, 25 Jan 2002 21:17:46 +0200 (EET) Received: from deckland (deckland.uni-svishtov.bg [193.68.173.82]) by grinch.uni-svishtov.bg (8.12.1/8.12.1) with SMTP id g0PJHkOA028799 for ; Fri, 25 Jan 2002 21:17:46 +0200 (EET) Message-ID: <003301c1a5d4$fe2c4b10$52ad44c1@deckland> From: "Radoslav Vasilev" To: Subject: Re Netgraph Date: Fri, 25 Jan 2002 21:17:55 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0030_01C1A5E5.C19FBE50" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_0030_01C1A5E5.C19FBE50 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable rtfm# more ngdisc.c=20 #include #include #include #include #include int main(void) { int d; int ldisc; ldisc =3D NETGRAPHDISC; =20 if ((d =3D open("/dev/ttyd1", O_NONBLOCK)) =3D=3D -1) { perror("open"); } else { printf("descripto # %d\n", d);=20 if ((ioctl(d, TIOCSETD, &ldisc)) =3D=3D -1) { perror("ioctl"); } } printf("Netgraph TTY node initialized successfully\nPress any = key to destroy it"); getc(stdin); close(d); exit; } rtfm#=20 ------=_NextPart_000_0030_01C1A5E5.C19FBE50 Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable
rtfm# more ngdisc.c
#include=20 <sys/ioctl.h>
#include <stdio.h>
#include=20 <stdlib.h>
#include <fcntl.h>
#include=20 <unistd.h>
 
int=20 main(void)
{
        int=20 d;
        int=20 ldisc;
        ldisc =3D=20 NETGRAPHDISC;
       =20
        if ((d =3D = open("/dev/ttyd1",=20 O_NONBLOCK)) =3D=3D -1)=20 {
           &n= bsp;   =20 perror("open");
        } else=20 {
           =20 printf("descripto # %d\n", d);=20
            = if=20 ((ioctl(d, TIOCSETD, &ldisc)) =3D=3D -1)=20 {
           &n= bsp;   =20 perror("ioctl");
         = ;  =20 }
       =20 }
        printf("Netgraph TTY = node=20 initialized successfully\nPress any key to destroy=20 it");
       =20 getc(stdin);
       =20 close(d);
        = exit;
}
rtfm#=20
------=_NextPart_000_0030_01C1A5E5.C19FBE50-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message