STREAMS-UX Programmer's Guide (February 2007)

Multiplexing
STREAMS Multiplexor
Chapter 5
127
-1, /* major no */
{ &mux_urinit, &mux_uwinit, &mux_lrinit, &mux_lwinit}, /* streamtab */
STR_IS_DEVICE | MGR_IS_MP | STR_SYSV4_OPEN, /* streams flags */
SQLVL_QUEUEPAIR, /* sync level */
"", /* elsewhere sync name */
};
struct streamtab mux_strtab = {
&mux_urinit,
&mux_uwinit,
&mux_lrinit,
&mux_lwinit
};
/* data structures private to the multiplexor used in this example */
/* Number of upper streams allowed in this N-to-1 configuration */
#define MUXCNT 10
struct mux{
queue_t *top_rq; /* pointer to the multiplexor’s upper read queue */
}mux_data_t;
mux_data_t mux_list[MUXCNT];
queue_t *muxbot_wq; /* write-q of the linked lower stream */
int muxerr; /* Set if the lower stream recv’s a M_ERROR/M_HANGUP */