1*33de042dSApple OSS Distributions<h2>mach_msg_header</h2> 2*33de042dSApple OSS Distributions<hr> 3*33de042dSApple OSS Distributions<p> 4*33de042dSApple OSS Distributions<strong>Structure</strong> - Specifies the content of an IPC message header. 5*33de042dSApple OSS Distributions<h3>SYNOPSIS</h3> 6*33de042dSApple OSS Distributions<pre> 7*33de042dSApple OSS Distributions<strong>typedef struct</strong> 8*33de042dSApple OSS Distributions<strong>{</strong> 9*33de042dSApple OSS Distributions <strong>mach_msg_bits_t </strong> <var>msgh_bits</var><strong>;</strong> 10*33de042dSApple OSS Distributions <strong>mach_msg_size_t</strong> <var>msgh_size</var><strong>;</strong> 11*33de042dSApple OSS Distributions <strong>mach_port_t</strong> <var>msgh_remote_port</var><strong>;</strong> 12*33de042dSApple OSS Distributions <strong>mach_port_t</strong> <var>msgh_local_port</var><strong>;</strong> 13*33de042dSApple OSS Distributions <strong>mach_msg_size_t</strong> <var>msgh_reserved</var><strong>;</strong> 14*33de042dSApple OSS Distributions <strong>mach_msg_id_t</strong> <var>msgh_id</var><strong>;</strong> 15*33de042dSApple OSS Distributions<strong>} mach_msg_header_t;</strong> 16*33de042dSApple OSS Distributions 17*33de042dSApple OSS Distributions<strong>typedef struct</strong> 18*33de042dSApple OSS Distributions<strong>{</strong> 19*33de042dSApple OSS Distributions <strong>mach_msg_size_t</strong> <var>msgh_descriptor_count</var><strong>;</strong> 20*33de042dSApple OSS Distributions<strong>} mach_msg_body_t;</strong> 21*33de042dSApple OSS Distributions 22*33de042dSApple OSS Distributions<strong>typedef struct</strong> 23*33de042dSApple OSS Distributions<strong>{</strong> 24*33de042dSApple OSS Distributions <strong>mach_msg_trailer_type_t</strong> <var>msgh_trailer_type</var><strong>;</strong> 25*33de042dSApple OSS Distributions <strong>mach_msg_trailer_size_t</strong> <var>msgh_trailer_size</var><strong>;</strong> 26*33de042dSApple OSS Distributions<strong>} mach_msg_trailer_t;</strong> 27*33de042dSApple OSS Distributions 28*33de042dSApple OSS Distributions<strong>typedef struct</strong> 29*33de042dSApple OSS Distributions<strong>{</strong> 30*33de042dSApple OSS Distributions <strong>mach_msg_trailer_type_t</strong> <var>msgh_trailer_type</var><strong>;</strong> 31*33de042dSApple OSS Distributions <strong>mach_msg_trailer_size_t</strong> <var>msgh_trailer_size</var><strong>;</strong> 32*33de042dSApple OSS Distributions <strong>mach_port_seqno_t</strong> <var>msgh_seqno</var><strong>;</strong> 33*33de042dSApple OSS Distributions<strong>} mach_msg_seqno_trailer_t;</strong> 34*33de042dSApple OSS Distributions 35*33de042dSApple OSS Distributions<strong>typedef struct</strong> 36*33de042dSApple OSS Distributions<strong>{</strong> 37*33de042dSApple OSS Distributions <strong>mach_msg_trailer_type_t</strong> <var>msgh_trailer_type</var><strong>;</strong> 38*33de042dSApple OSS Distributions <strong>mach_msg_trailer_size_t</strong> <var>msgh_trailer_size</var><strong>;</strong> 39*33de042dSApple OSS Distributions <strong>mach_port_seqno_t</strong> <var>msgh_seqno</var><strong>;</strong> 40*33de042dSApple OSS Distributions <strong>security_token_t</strong> <var>msgh_sender</var><strong>;</strong> 41*33de042dSApple OSS Distributions<strong>} mach_msg_security_trailer_t;</strong> 42*33de042dSApple OSS Distributions 43*33de042dSApple OSS Distributions<strong>typedef struct</strong> 44*33de042dSApple OSS Distributions<strong>{</strong> 45*33de042dSApple OSS Distributions <strong>mach_msg_trailer_type_t</strong> <var>msgh_trailer_type</var><strong>;</strong> 46*33de042dSApple OSS Distributions <strong>mach_msg_trailer_size_t</strong> <var>msgh_trailer_size</var><strong>;</strong> 47*33de042dSApple OSS Distributions <strong>mach_port_seqno_t</strong> <var>msgh_seqno</var><strong>;</strong> 48*33de042dSApple OSS Distributions <strong>security_token_t</strong> <var>msgh_sender</var><strong>;</strong> 49*33de042dSApple OSS Distributions <strong>unsigned int</strong> <var>dipc_sender_kmsg</var><strong>;</strong> 50*33de042dSApple OSS Distributions<strong>} mach_msg_dipc_trailer_t;</strong> 51*33de042dSApple OSS Distributions</pre> 52*33de042dSApple OSS Distributions<h3>FIELDS</h3> 53*33de042dSApple OSS Distributions<dl> 54*33de042dSApple OSS Distributions<dt> <var>msgh_bits</var> 55*33de042dSApple OSS Distributions<dd> 56*33de042dSApple OSS DistributionsThis field specifies the following properties of the message: 57*33de042dSApple OSS Distributions<dl> 58*33de042dSApple OSS Distributions <p> 59*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS_REMOTE_MASK</strong> 60*33de042dSApple OSS Distributions<dd> 61*33de042dSApple OSS DistributionsEncodes <var>mach_msg_type_name_t</var> values that specify the port 62*33de042dSApple OSS Distributionsrights in the <var>msgh_remote_port</var> field. The value must specify 63*33de042dSApple OSS Distributionsa send or send-once right for the destination of the message. 64*33de042dSApple OSS Distributions <p> 65*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS_LOCAL_MASK</strong> 66*33de042dSApple OSS Distributions<dd> 67*33de042dSApple OSS DistributionsEncodes <var>mach_msg_type_name_t</var> values that specify the port 68*33de042dSApple OSS Distributionsrights in the <var>msgh_local_port</var> field. If the value doesn't 69*33de042dSApple OSS Distributionsspecify a send or send-once right for the message's reply port, it 70*33de042dSApple OSS Distributionsmust be zero and <var>msgh_local_port</var> must be <strong>MACH_PORT_NULL</strong>. 71*33de042dSApple OSS Distributions <p> 72*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS_COMPLEX</strong> 73*33de042dSApple OSS Distributions<dd> 74*33de042dSApple OSS DistributionsThe complex bit must be specified if the message body 75*33de042dSApple OSS Distributionscontains additional port rights or out-of-line memory regions. 76*33de042dSApple OSS Distributions <p> 77*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS_REMOTE</strong>(<var>bits</var>) 78*33de042dSApple OSS Distributions<dd> 79*33de042dSApple OSS DistributionsThis macro returns the appropriate <var>mach_msg_type_name_t</var> 80*33de042dSApple OSS Distributionsvalues, given a <var>msgh_bits</var> value. 81*33de042dSApple OSS Distributions <p> 82*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS_LOCAL</strong>(<var>bits</var>) 83*33de042dSApple OSS Distributions<dd> 84*33de042dSApple OSS DistributionsThis macro returns the appropriate <var>mach_msg_type_name_t</var> 85*33de042dSApple OSS Distributionsvalues, given a <var>msgh_bits</var> value. 86*33de042dSApple OSS Distributions <p> 87*33de042dSApple OSS Distributions<dt> <strong>MACH_MSGH_BITS</strong>(<var>remote</var>, <var>local</var>) 88*33de042dSApple OSS Distributions<dd> 89*33de042dSApple OSS DistributionsThis macro constructs a value for <var>msgh_bits</var>, given two 90*33de042dSApple OSS Distributions<var>mach_msg_type_name_t</var> values. 91*33de042dSApple OSS Distributions</dl> 92*33de042dSApple OSS Distributions<p> 93*33de042dSApple OSS Distributions<dt> <var>msgh_size</var> 94*33de042dSApple OSS Distributions<dd> 95*33de042dSApple OSS DistributionsThis field is ignored on send (the size to send is specified by the 96*33de042dSApple OSS Distributions<var>send_size</var> parameter to <strong>mach_msg</strong>); the field is set on 97*33de042dSApple OSS Distributionsreceive to the sum of 98*33de042dSApple OSS Distributionsthe message header and body sizes (in bytes). Note that this value may 99*33de042dSApple OSS Distributionsbe different from the send size specified by the sender if the sender and 100*33de042dSApple OSS Distributionsreceiver machines have differing sizes for port names, memory 101*33de042dSApple OSS Distributionsaddresses or memory range sizes. 102*33de042dSApple OSS Distributions <p> 103*33de042dSApple OSS Distributions<dt> <var>msgh_remote_port</var> 104*33de042dSApple OSS Distributions<dd> 105*33de042dSApple OSS DistributionsWhen sending, specifies the destination port of the message. The field 106*33de042dSApple OSS Distributionsmust carry a legitimate send or send-once right for a port. When 107*33de042dSApple OSS Distributionsreceived, this field is swapped with <var>msgh_local_port</var>. 108*33de042dSApple OSS Distributions <p> 109*33de042dSApple OSS Distributions<dt> <var>msgh_local_port</var> 110*33de042dSApple OSS Distributions<dd> 111*33de042dSApple OSS DistributionsWhen sending, specifies an auxiliary port right, which is 112*33de042dSApple OSS Distributionsconventionally used as a reply port by the recipient of the message. 113*33de042dSApple OSS DistributionsThe field must 114*33de042dSApple OSS Distributionscarry a send right, a send-once right, <strong>MACH_PORT_NULL</strong>, or 115*33de042dSApple OSS Distributions<strong>MACH_PORT_DEAD</strong>. When received, this field is swapped with 116*33de042dSApple OSS Distributions<var>msgh_remote_port</var>. 117*33de042dSApple OSS Distributions <p> 118*33de042dSApple OSS Distributions<dt> <var>msgh_id</var> 119*33de042dSApple OSS Distributions<dd> 120*33de042dSApple OSS DistributionsNot set or read by the <strong>mach_msg</strong> call. The conventional meaning is to 121*33de042dSApple OSS Distributionsconvey an operation or function ID. 122*33de042dSApple OSS Distributions <p> 123*33de042dSApple OSS Distributions<dt> <var>msgh_descriptor_count</var> 124*33de042dSApple OSS Distributions<dd> 125*33de042dSApple OSS DistributionsThe number of descriptors of kernel processed data (port rights and 126*33de042dSApple OSS Distributionsout-of-line data). 127*33de042dSApple OSS Distributions <p> 128*33de042dSApple OSS Distributions<dt> <var>msgh_trailer_type</var> 129*33de042dSApple OSS Distributions<dd> 130*33de042dSApple OSS DistributionsAn identifier of the trailer version. Different values indicate not 131*33de042dSApple OSS Distributionsnecessarily compatible trailer formats. The current (and only) trailer format 132*33de042dSApple OSS Distributionsis <strong>MACH_MSG_TRAILER_FORMAT_0</strong>. There is currently only one 133*33de042dSApple OSS Distributionsattribute defined within this trailer type: the sender's identity. 134*33de042dSApple OSS Distributions <p> 135*33de042dSApple OSS Distributions<dt> <var>msgh_trailer_size</var> 136*33de042dSApple OSS Distributions<dd> 137*33de042dSApple OSS DistributionsThe length, in bytes, of the message trailer, including the trailer type 138*33de042dSApple OSS Distributionsand length fields. 139*33de042dSApple OSS Distributions <p> 140*33de042dSApple OSS Distributions<dt> <var>msgh_seqno</var> 141*33de042dSApple OSS Distributions<dd> 142*33de042dSApple OSS DistributionsThe sequence number of this message relative to the port from which it 143*33de042dSApple OSS Distributionsis received. 144*33de042dSApple OSS Distributions <p> 145*33de042dSApple OSS Distributions<dt> <var>msgh_sender</var> 146*33de042dSApple OSS Distributions<dd> 147*33de042dSApple OSS DistributionsThe security ID of the sender of the message. 148*33de042dSApple OSS Distributions</dl> 149*33de042dSApple OSS Distributions<h3>DESCRIPTION</h3> 150*33de042dSApple OSS Distributions<p> 151*33de042dSApple OSS DistributionsThe <strong>mach_msg_header</strong> structure defines the fixed size header of a Mach 152*33de042dSApple OSS Distributionsmessage. The header is followed by a message body containing data and port 153*33de042dSApple OSS Distributionsdescriptors and zero or more data bytes. 154*33de042dSApple OSS Distributions<p> 155*33de042dSApple OSS DistributionsIf the <strong>MACH_MSGH_BITS_COMPLEX</strong> flag in the <var>msgh_bits</var> field is not set, 156*33de042dSApple OSS Distributionsthen this is a simple message described by <strong>mach_msg_header_t</strong>. 157*33de042dSApple OSS DistributionsIn this case, the header is immediately followed by untyped data. 158*33de042dSApple OSS Distributions<p> 159*33de042dSApple OSS DistributionsIf the complex flag is set, then this is a "complex" message consisting of a 160*33de042dSApple OSS Distributions<strong>mach_msg_header_t</strong> structure followed by a <strong>mach_msg_body_t</strong> structure 161*33de042dSApple OSS Distributionscontaining a count followed by an array of descriptors specifying 162*33de042dSApple OSS Distributionsthe disposition 163*33de042dSApple OSS Distributions(processing) to be performed for the out-of-line memory regions and additional 164*33de042dSApple OSS Distributionsport rights. 165*33de042dSApple OSS Distributions<p> 166*33de042dSApple OSS DistributionsFollowing the header (and any kernel processed descriptors), at natural 167*33de042dSApple OSS Distributionsalignment can be additional (un-typed) data, up to the size of the message 168*33de042dSApple OSS Distributions(<var>msgh_size</var>). This extra data typically carries information 169*33de042dSApple OSS Distributionsused to decode the data stream and out-of-line data. 170*33de042dSApple OSS Distributions<p> 171*33de042dSApple OSS DistributionsAt the next natural boundary following the message data is the message trailer 172*33de042dSApple OSS Distributions(<strong>mach_msg_trailer_t</strong>). This structure indicates the type and length of the 173*33de042dSApple OSS Distributionstrailer. If the length is greater than sizeof (<strong>mach_msg_trailer_t</strong>), 174*33de042dSApple OSS Distributionsadditional fields 175*33de042dSApple OSS Distributionsfollow providing kernel-generated message attributes. 176*33de042dSApple OSS Distributions<h3>RELATED INFORMATION</h3> 177*33de042dSApple OSS Distributions<p> 178*33de042dSApple OSS DistributionsFunctions: 179*33de042dSApple OSS Distributions<a href="mach_msg.html"><strong>mach_msg</strong></a>. 180*33de042dSApple OSS Distributions<p> 181*33de042dSApple OSS DistributionsData Structures: 182*33de042dSApple OSS Distributions<a href="mach_msg_descriptor.html"><strong>mach_msg_descriptor</strong></a>. 183*33de042dSApple OSS Distributions 184