STREAMS-UX Programmer's Guide (February 2007)

Messages
Message Processing and Flow Control
Chapter 3
56
Figure 3-4 Pulling Up a Complex Message
Message Processing Utilities
int putnext(queue_t *q, mblk_t *mp)
putnext () Is used for passing messages to the next queue in a stream. This utility calls the put
procedure associated with the next queue in a stream and passes it a message block pointer
as an argument.
int putq(queue_t *q, mblk_t *mp)
putq () Is typically used by the put procedure for deferred processing of the messages. The putq ()
utility puts the message mp in the message queue based on its priority. The service
procedure is enabled if a high priority message is put in the queue and QNOENAB is unset if
flow control parameters are updated for this queue.
The putq () utility returns 1 on success. Otherwise it returns 0.
int insq(queue_t *q, mblk_t *emp, mblk_t *nmp)
insq () Inserts a driver supplied new message block nmp into a specific place in the message queue,
right before the message emp already in the queue. If emp is NULL, place the nmp at the end
of the queue.
The priority band of the new message must adhere to the following ordering:
emp->b_band <= nmp->b_band <= emp->b_prev->b_band
M
A
b_cont
D
A
100
M
B
D
B
50
AfterBefore
M
C
D
C
150
b_wptr
b_rpt
b_wptr
db_base
b_datap
b_datap
db_lim db_base
b_wptr
b_rptrb_datap
db_base
db_lim
b_rptr
db_lim