*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> msgb (4)              



NAME    [Toc]    [Back]

       msgb - Defines a STREAMS message block

SYNOPSIS    [Toc]    [Back]

       #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    [Toc]    [Back]

       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  message.   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 message.
   Additional fields that are visible within the kernel.
  The fields included and their contents depend on the
       kernel configuration.

DESCRIPTION    [Toc]    [Back]

       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.  Padding.

       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 information 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

[ Back ]
 Similar pages
Name OS Title
rmvb Tru64 STREAMS: Removes a message block from a message block
unlinkb Tru64 STREAMS: Removes a message block from the head of a message
freeb Tru64 STREAMS: Frees a message block
allocb Tru64 STREAMS: Allocates a message block
copyb Tru64 STREAMS: Copies a message block
rmvq Tru64 STREAMS: Removes a message block from a queue
dupb Tru64 STREAMS: Duplicates a message block descriptor
esballoc Tru64 STREAMS: Allocates a message block with a shared buffer
streamadm Tru64 Defines configuration information about a STREAMS module or driver
insq Tru64 STREAMS: Inserts a STREAMS message into a queue
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service