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
[-- Attachment #1 --]
rtfm# more ngdisc.c
#include <sys/ioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int d;
int ldisc;
ldisc = NETGRAPHDISC;
if ((d = open("/dev/ttyd1", O_NONBLOCK)) == -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;
}
rtfm#
[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=koi8-r" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>rtfm# more ngdisc.c <BR>#include
<sys/ioctl.h><BR>#include <stdio.h><BR>#include
<stdlib.h><BR>#include <fcntl.h><BR>#include
<unistd.h></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>int
main(void)<BR>{<BR> int
d;<BR> int
ldisc;<BR> ldisc =
NETGRAPHDISC;<BR>
<BR> if ((d = open("/dev/ttyd1",
O_NONBLOCK)) == -1)
{<BR>
perror("open");<BR> } else
{<BR>
printf("descripto # %d\n", d);
<BR> if
((ioctl(d, TIOCSETD, &ldisc)) == -1)
{<BR>
perror("ioctl");<BR>
}<BR>
}<BR> printf("Netgraph TTY node
initialized successfully\nPress any key to destroy
it");<BR>
getc(stdin);<BR>
close(d);<BR> exit;<BR>}<BR>rtfm#
</FONT></DIV></BODY></HTML>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?003301c1a5d4$fe2c4b10$52ad44c1>
