STREAMS-UX Programmer's Guide (February 2007)
Modules and Drivers
STREAMS Module
Chapter 4
93
return;
}
}
int
mod_wput(q, mp)
queue_t *q;
mblk_t *mp;
{
mod_priv_t *modp;
modp = (mod_priv_t *)q->q_ptr;
if ((mp->b_datap->db_type >= QPCTL) &&
( mp->b_datap->db_type != M_FLUSH )) {
putnext(q, mp);
return;
}
switch (mp->b_datap->db_type) {
case M_DATA:
putq(q, mp);
return;
case M_PROTO:
/* process the protocol message */
...
...
case M_FLUSH:
/* process the M_FLUSH message */
...
...
case M_IOCTL:
struct iocblk * iocp = (struct iocblk *)mp->b_rptr;
switch (iocp->ioc_cmd) {
/* ioctl commands recognized by the module */
case MOD_IOCTL1:
/*
* process and reply back with a positive
* or negative acknowledgment