[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, 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);

Implementation Specifics

The DTOM macro is part of Base Operating System (BOS) Runtime.

Related Information

The MTOD macro for mbuf Kernel Services.

I/O Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]