Date: Fri, 25 Jan 2002 21:17:55 +0200 From: "Radoslav Vasilev" <rvasilev@uni-svishtov.bg> To: <freebsd-net@freebsd.org> Subject: Re Netgraph Message-ID: <003301c1a5d4$fe2c4b10$52ad44c1@deckland>
next in thread | raw e-mail | index | archive | help
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 <sys/ioctl.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> 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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Dkoi8-r" http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>rtfm# more ngdisc.c <BR>#include=20 <sys/ioctl.h><BR>#include <stdio.h><BR>#include=20 <stdlib.h><BR>#include <fcntl.h><BR>#include=20 <unistd.h></FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>int=20 main(void)<BR>{<BR> int=20 d;<BR> int=20 ldisc;<BR> ldisc =3D=20 NETGRAPHDISC;<BR> =20 <BR> if ((d =3D = open("/dev/ttyd1",=20 O_NONBLOCK)) =3D=3D -1)=20 {<BR> &n= bsp; =20 perror("open");<BR> } else=20 {<BR> =20 printf("descripto # %d\n", d);=20 <BR> = if=20 ((ioctl(d, TIOCSETD, &ldisc)) =3D=3D -1)=20 {<BR> &n= bsp; =20 perror("ioctl");<BR>  = ; =20 }<BR> =20 }<BR> printf("Netgraph TTY = node=20 initialized successfully\nPress any key to destroy=20 it");<BR> =20 getc(stdin);<BR> =20 close(d);<BR> = exit;<BR>}<BR>rtfm#=20 </FONT></DIV></BODY></HTML> ------=_NextPart_000_0030_01C1A5E5.C19FBE50-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003301c1a5d4$fe2c4b10$52ad44c1>