iknt -- In-Kernel Network Terminal driver


Programmer's interface:
#include <sys/types.h>
#include <sys/stream.h>
#include <sys/net/iknt.h>
#include <sys/spt.h>

s = ioctl(p, TIOCAIKNT, &ikarg);


The In-Kernel Network Terminal (IKNT) driver provides reliable, flow-controlled, two-way transmission of data between the master side of the pseudo-tty (SPT) driver and the underlying transport driver/protocol, bypassing the server process. Thus it eliminates two context-switches per character exchanged between the client and the user processes. The SPT driver opens the IKNT driver automatically when the master side is opened. The server process (usually telnetd(ADMN) or rlogind(ADMN)) issues an ioctl to set up a connection between the master side of the pseudo-tty and the transport driver. Thus all the characters which arrive at that transport provider (destined for the user process) are automatically accessible to the SPT driver, bypassing the server process, thereby eliminating two context switches. Similarly, all the characters generated by the user process and destined for the client also bypass the server process.

For more information about how pseudo-tty's are implemented and examples of code that use them, see the ``Terminal Modes'' chapter in W. Richard Stevens, UNIX Network Programming.

IKNT supports several options which are set with the following ioctl:

To set up the connection between the master side of the SPT driver and TCP driver. The following structure is passed as an argument to the TIOCAIKNT ioctl to extract the desired information:
struct ikarg {
        int     file_p;
        u_long  flags;

The argument flags can be set to any of the following values.
#define	IK_RLOGIN	0x020	/* invoke in rlogin mode */
#define	IK_TELNET	0x040	/* invoke in telnet mode */
#define IK_HS_WONT_BIN	0x100	/* client not using telnet binary option */
#define IK_MY_WONT_BIN	0x200	/* server not using telnet binary option */


An ioctl operation may fail with the errno set to one of the following:

when the associated file pointer does not point to an inode or the associated stream is not found

when bad argument/NULL argument is passed to the driver

when the file descriptor in the ikarg structure is not valid



See also

rlogind(ADMN), telnetd(ADMN), tcp(ADMP)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003