Converts an address anywhere within an mbuf structure to the head of that mbuf structure.
#include <sys/mbuf.h>
DTOM ( bp);
bp | Points to an address within an mbuf structure. |
The DTOM macro converts an address anywhere within an mbuf structure to the head of that mbuf structure. This macro is valid only for mbuf structures without an external buffer (that is, with the M_EXT flag not set).
This macro can be viewed as the opposite of the MTOD macro, which converts the address of an mbuf structure into the address of the actual data contained in the buffer. However, the DTOM macro is more general than this view implies. That is, the input parameter can point to any address within the mbuf structure, not merely the address of the actual data.
The DTOM macro can be used as follows:
char *bp; struct mbuf *m; m = DTOM(bp);
The MTOD macro for mbuf Kernel Services.
I/O Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.