streams 1-to-many multiplexor driver

Tanya Katz tanya at adds.newyork.NCR.COM
Sat Jul 1 06:48:56 AEST 1989


	I am writing  a streams multiplexer driver that monitors 
input from several (many) ttys, packets the data, and routes the packeted 
input to one single process.   On output, the M_DATA field will
be encoded with the port number, sent through the multiplexor, and
routed to the proper tty.

	All the examples I have seen have many user processes 
connected to a single tty port, or are connected 1-to-1.
I have not seen examples of the architecture we are interested in, where
one process is reading from / writing to many ttys and a multiplexor 
is handling this data.

	A central issue in this design is minimizing the use of
file descriptors.  We would prefer having only one multiplexor device, 
and link multiple tty streams to it, but the streams data structures 
design seem to indicate that we must open a separate minor multiplexor 
device for each tty stream & link these in separately
in order to properly initialize the lower write queue of the linkblk
structure.

	Is there a way to open the multiplexor only once, and to use
this open multiplexor fd to link in each open tty stream and
properly maintain the l_qbot pointer in the linkblk structure for
each member of the multiplexor array?

	In other words, what I am asking is:  If the driver is opened
once (dev 0 ) and only the first array member is initialized, can my upper
write put routine link this device with each open tty (separate ioctl
calls of course) and initialize the multiplexor array with the correct 
streams l_qbot/write pointer & mux-id?

	I would appreciate any information from others who have written
multiplexors on how such a beast might be designed, as well
as any practical advice from those who have "been there."

	Thanks,
		Tanya


------------------------------------------------------------------------------
    ###   ######  ######   #####       Tanya Katz       (516) 231-5400 x430 
   #   #  #     # #     # #           
  #     # #     # #     #  #####       ...uunet!ncrlnk!adds!tanya      
  ####### #     # #     #       #      tanya.katz at adds.newyork.ncr.com
  #     # ######  ######   #####       

  Applied Digital Data Systems, Inc.   100 Marcus Blvd., Hauppauge, NY 11788 
------------------------------------------------------------------------------



More information about the Comp.unix.wizards mailing list