msgb(4)msgb(4)NAMEmsgb - Defines a STREAMS message block
SYNOPSIS
#include <sys/stream.h>
struct msgb(
struct msgb *b_next,
struct msgb *b_prev,
struct msgb *b_cont,
unsigned char *b_rptr,
unsigned char *b_wptr,
struct datab *b_datap,
MSG_KERNEL_FIELDS );
PARAMETERS
A pointer to the next message on the queue. A pointer to the previous
message on the queue. A pointer to the next message block in the mes‐
sage. A pointer to the first unread data byte in the buffer. A
pointer to the first unwritten data byte in the buffer. A pointer to
the datab structure (data block) that contains the data for the mes‐
sage. Additional fields that are visible within the kernel. The
fields included and their contents depend on the kernel configuration.
DESCRIPTION
The msgb structure defines a message block. A message block carries
data or information in a stream. A STREAMS message consists of message
blocks linked through b_cont. Each message block points to a data block
descriptor, which in turn points to a data buffer.
The msgb structure is typedefed as mblk_t. The associated data block is
stored in a datab structure, which is typedefed as dblk_t.
The datab structure is defined (in sys/stream.h) as:
struct datab {
struct datab * db_freep;
unsigned char * db_base;
unsigned char * db_lim;
unsigned char db_ref;
unsigned char db_type;
unsigned char db_class;
unsigned char db_pad[1]; };
The datab fields are defined as follows: Used internally by the STREAMS
memory allocator. The first byte of the buffer. The last byte of the
buffer, plus one. The number of message blocks ( struct msgb) that
reference this data block. The message type. Used internally. Pad‐
ding.
Messages are typed according to the value in the db_type field in the
associated datab structure. Some possible type values are: The message
contains ordinary data. The message contains internal control informa‐
tion and data.
As part of its support for STREAMS, Tru64 UNIX provides the following
interfaces for exchanging messages betweens STREAMS modules on the one
hand and sockets and network protocols on the other: mbuf_to_mblk()-
Converts an mbuf chain to an mblk chain mblk_to_mbuf() - Converts an
mblk chain to an mbuf chain
msgb(4)