[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Kernel and Subsystems, Volume 1

DTOM Macro for mbuf Kernel Services

Purpose

Converts an address anywhere within an mbuf structure to the head of that mbuf structure.

Syntax

#include <sys/mbuf.h>


DTOM ( bp);

Parameter

bp Points to an address within an mbuf structure.

Description

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.

Example

The DTOM macro can be used as follows:

char               *bp;
struct mbuf        *m;
m = DTOM(bp);

Related Information

The MTOD macro for mbuf Kernel Services.

I/O Kernel Services in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]