CFNetDiagnosticsProtocolUser.c [plain text]
#define __MIG_check__Reply__CFNetDiagnosticsProtocol_subsystem__ 1
#define __NDR_convert__Reply__CFNetDiagnosticsProtocol_subsystem__ 1
#define __NDR_convert__mig_reply_error_subsystem__ 1
#include "CFNetDiagnosticsProtocol.h"
#ifndef mig_internal
#define mig_internal static __inline__
#endif
#ifndef mig_external
#define mig_external
#endif
#if !defined(__MigTypeCheck) && defined(TypeCheck)
#define __MigTypeCheck TypeCheck
#endif
#if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_)
#define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_
#endif
#ifndef LimitCheck
#define LimitCheck 0
#endif
#ifndef min
#define min(a,b) ( ((a) < (b))? (a): (b) )
#endif
#if !defined(_WALIGN_)
#define _WALIGN_(x) (((x) + 3) & ~3)
#endif
#if !defined(_WALIGNSZ_)
#define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
#endif
#ifndef UseStaticTemplates
#define UseStaticTemplates 0
#endif
#ifndef __MachMsgErrorWithTimeout
#define __MachMsgErrorWithTimeout(_R_) { \
switch (_R_) { \
case MACH_SEND_INVALID_REPLY: \
case MACH_RCV_INVALID_NAME: \
case MACH_RCV_PORT_DIED: \
case MACH_RCV_PORT_CHANGED: \
case MACH_RCV_TIMED_OUT: \
mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
break; \
default: \
mig_put_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif
#ifndef __MachMsgErrorWithoutTimeout
#define __MachMsgErrorWithoutTimeout(_R_) { \
switch (_R_) { \
case MACH_SEND_INVALID_REPLY: \
case MACH_RCV_INVALID_NAME: \
case MACH_RCV_PORT_DIED: \
case MACH_RCV_PORT_CHANGED: \
mig_dealloc_reply_port(InP->Head.msgh_reply_port); \
break; \
default: \
mig_put_reply_port(InP->Head.msgh_reply_port); \
} \
}
#endif
#ifndef __DeclareSendRpc
#define __DeclareSendRpc(_NUM_, _NAME_)
#endif
#ifndef __BeforeSendRpc
#define __BeforeSendRpc(_NUM_, _NAME_)
#endif
#ifndef __AfterSendRpc
#define __AfterSendRpc(_NUM_, _NAME_)
#endif
#ifndef __DeclareSendSimple
#define __DeclareSendSimple(_NUM_, _NAME_)
#endif
#ifndef __BeforeSendSimple
#define __BeforeSendSimple(_NUM_, _NAME_)
#endif
#ifndef __AfterSendSimple
#define __AfterSendSimple(_NUM_, _NAME_)
#endif
#define msgh_request_port msgh_remote_port
#define msgh_reply_port msgh_local_port
mig_external kern_return_t _CFNetDiagnosticClient_passDescriptor
(
mach_port_t server_port,
int32_t protocol_version,
vm_address_t descriptor,
mach_msg_type_number_t descriptorCnt
)
{
{
#ifdef __MigPackStructs
#pragma pack(4)
#endif
typedef struct {
mach_msg_header_t Head;
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t descriptor;
NDR_record_t NDR;
int32_t protocol_version;
mach_msg_type_number_t descriptorCnt;
} Request;
#ifdef __MigPackStructs
#pragma pack()
#endif
union {
Request In;
} Mess;
Request *InP = &Mess.In;
mach_msg_return_t msg_result;
#ifdef __MIG_check__Reply__passDescriptor_t__defined
kern_return_t check_result;
#endif
__DeclareSendSimple(10000, "passDescriptor")
#if UseStaticTemplates
const static mach_msg_ool_descriptor_t descriptorTemplate = {
(void *)0,
0,
FALSE,
MACH_MSG_VIRTUAL_COPY,
0,
MACH_MSG_OOL_DESCRIPTOR,
};
#endif
InP->msgh_body.msgh_descriptor_count = 1;
#if UseStaticTemplates
InP->descriptor = descriptorTemplate;
InP->descriptor.address = (void *)(descriptor);
InP->descriptor.size = descriptorCnt;
#else
InP->descriptor.address = (void *)(descriptor);
InP->descriptor.size = descriptorCnt;
InP->descriptor.deallocate = FALSE;
InP->descriptor.copy = MACH_MSG_VIRTUAL_COPY;
InP->descriptor.type = MACH_MSG_OOL_DESCRIPTOR;
#endif
InP->NDR = NDR_record;
InP->protocol_version = protocol_version;
InP->descriptorCnt = descriptorCnt;
InP->Head.msgh_bits = MACH_MSGH_BITS_COMPLEX|
MACH_MSGH_BITS(19, 0);
InP->Head.msgh_request_port = server_port;
InP->Head.msgh_reply_port = MACH_PORT_NULL;
InP->Head.msgh_id = 10000;
__BeforeSendSimple(10000, "passDescriptor")
msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
__AfterSendSimple(10000, "passDescriptor")
return msg_result;
return KERN_SUCCESS;
}
}