Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2005 16:20:24 -0800
From:      Jerry Toung <jtoung@arc.nasa.gov>
To:        hackers <freebsd-hackers@freebsd.org>
Cc:        Julian Elischer <julian@elischer.org>
Subject:   netgraph TTY
Message-ID:  <200503301620.24086.jtoung@arc.nasa.gov>

next in thread | raw e-mail | index | archive | help
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
+




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503301620.24086.jtoung>