From 81fceb37a95304786f88f6611289a27c7262d394 Mon Sep 17 00:00:00 2001 From: archie Date: Tue, 30 Nov 1999 02:45:32 +0000 Subject: Add two new generic control messages, NGM_ASCII2BINARY and NGM_BINARY2ASCII, which convert control messages to ASCII and back. This allows control messages to be sent and received in ASCII form using ngctl(8), which makes ngctl a lot more useful. This also allows all the type-specific debugging code in libnetgraph to go away -- instead, we just ask the node itself to do the ASCII translation for us. Currently, all generic control messages are supported, as well as messages associated with the following node types: async, cisco, ksocket, and ppp. See /usr/share/examples/netgraph/ngctl for an example of using this. Also give ngctl(8) the ability to print out incoming data and control messages at any time. Eventually nghook(8) may be subsumed. Several other misc. bug fixes. Reviewed by: julian --- sys/netgraph/ng_tty.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'sys/netgraph/ng_tty.c') diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 2d3a1c4..9b5568f 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -89,15 +89,15 @@ /* Per-node private info */ struct ngt_sc { - struct tty *tp; /* Terminal device */ - node_p node; /* Netgraph node */ - hook_p hook; /* Netgraph hook */ - struct mbuf *m; /* Incoming data buffer */ - struct mbuf *qhead, **qtail; /* Queue of outgoing mbuf's */ - short qlen; /* Length of queue */ - short hotchar; /* Hotchar, or -1 if none */ - u_int flags; /* Flags */ - struct callout_handle chand; /* See man timeout(9) */ + struct tty *tp; /* Terminal device */ + node_p node; /* Netgraph node */ + hook_p hook; /* Netgraph hook */ + struct mbuf *m; /* Incoming data buffer */ + struct mbuf *qhead, **qtail; /* Queue of outgoing mbuf's */ + short qlen; /* Length of queue */ + short hotchar; /* Hotchar, or -1 if none */ + u_int flags; /* Flags */ + struct callout_handle chand; /* See man timeout(9) */ }; typedef struct ngt_sc *sc_p; @@ -106,7 +106,7 @@ typedef struct ngt_sc *sc_p; #define FLG_DEBUG 0x0002 /* Debugging */ -#ifdef DIAGNOSTICS +#ifdef INVARIANTS #define QUEUECHECK(sc) \ do { \ struct mbuf **mp; \ @@ -173,6 +173,7 @@ static struct ng_type typestruct = { ngt_rcvdata, ngt_rcvdata, ngt_disconnect, + NULL }; NETGRAPH_INIT(tty, &typestruct); -- cgit v1.1