| 1 | /* | 
|---|
| 2 | * IDENTIFICATION: | 
|---|
| 3 | * stub generated by bootstrap_cmds-133 | 
|---|
| 4 | * OPTIONS: | 
|---|
| 5 | *	KernelUser | 
|---|
| 6 | */ | 
|---|
| 7 | #define	__MIG_check__Reply__audit_triggers_subsystem__ 1 | 
|---|
| 8 |  | 
|---|
| 9 | #include "audit_triggers.h" | 
|---|
| 10 |  | 
|---|
| 11 | /* TODO: #include <mach/mach.h> */ | 
|---|
| 12 | #ifdef __cplusplus | 
|---|
| 13 | extern "C"{ | 
|---|
| 14 | #endif /* __cplusplus */ | 
|---|
| 15 | extern void mach_msg_destroy(mach_msg_header_t *); | 
|---|
| 16 | #ifdef __cplusplus | 
|---|
| 17 | } | 
|---|
| 18 | #endif /* __cplusplus */ | 
|---|
| 19 |  | 
|---|
| 20 | #ifndef	mig_internal | 
|---|
| 21 | #define	mig_internal	static __inline__ | 
|---|
| 22 | #endif	/* mig_internal */ | 
|---|
| 23 |  | 
|---|
| 24 | #ifndef	mig_external | 
|---|
| 25 | #define mig_external | 
|---|
| 26 | #endif	/* mig_external */ | 
|---|
| 27 |  | 
|---|
| 28 | #if	!defined(__MigTypeCheck) && defined(TypeCheck) | 
|---|
| 29 | #define	__MigTypeCheck		TypeCheck	/* Legacy setting */ | 
|---|
| 30 | #endif	/* !defined(__MigTypeCheck) */ | 
|---|
| 31 |  | 
|---|
| 32 | #if	!defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) | 
|---|
| 33 | #define	__MigKernelSpecificCode	_MIG_KERNEL_SPECIFIC_CODE_	/* Legacy setting */ | 
|---|
| 34 | #endif	/* !defined(__MigKernelSpecificCode) */ | 
|---|
| 35 |  | 
|---|
| 36 | #ifndef	LimitCheck | 
|---|
| 37 | #define	LimitCheck 0 | 
|---|
| 38 | #endif	/* LimitCheck */ | 
|---|
| 39 |  | 
|---|
| 40 | #ifndef	min | 
|---|
| 41 | #define	min(a,b)  ( ((a) < (b))? (a): (b) ) | 
|---|
| 42 | #endif	/* min */ | 
|---|
| 43 |  | 
|---|
| 44 | #if !defined(_WALIGN_) | 
|---|
| 45 | #define _WALIGN_(x) (((x) + 3) & ~3) | 
|---|
| 46 | #endif /* !defined(_WALIGN_) */ | 
|---|
| 47 |  | 
|---|
| 48 | #if !defined(_WALIGNSZ_) | 
|---|
| 49 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) | 
|---|
| 50 | #endif /* !defined(_WALIGNSZ_) */ | 
|---|
| 51 |  | 
|---|
| 52 | #ifndef	UseStaticTemplates | 
|---|
| 53 | #define	UseStaticTemplates	0 | 
|---|
| 54 | #endif	/* UseStaticTemplates */ | 
|---|
| 55 |  | 
|---|
| 56 | #ifndef MIG_SERVER_ROUTINE | 
|---|
| 57 | #define MIG_SERVER_ROUTINE | 
|---|
| 58 | #endif | 
|---|
| 59 |  | 
|---|
| 60 | #ifndef	__MachMsgErrorWithTimeout | 
|---|
| 61 | #define	__MachMsgErrorWithTimeout(_R_) { \ | 
|---|
| 62 | switch (_R_) { \ | 
|---|
| 63 | case MACH_SEND_INVALID_DATA: \ | 
|---|
| 64 | case MACH_SEND_INVALID_DEST: \ | 
|---|
| 65 | case MACH_SEND_INVALID_HEADER: \ | 
|---|
| 66 | mig_put_reply_port(InP->Head.msgh_reply_port); \ | 
|---|
| 67 | break; \ | 
|---|
| 68 | case MACH_SEND_TIMED_OUT: \ | 
|---|
| 69 | case MACH_RCV_TIMED_OUT: \ | 
|---|
| 70 | default: \ | 
|---|
| 71 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ | 
|---|
| 72 | } \ | 
|---|
| 73 | } | 
|---|
| 74 | #endif	/* __MachMsgErrorWithTimeout */ | 
|---|
| 75 |  | 
|---|
| 76 | #ifndef	__MachMsgErrorWithoutTimeout | 
|---|
| 77 | #define	__MachMsgErrorWithoutTimeout(_R_) { \ | 
|---|
| 78 | switch (_R_) { \ | 
|---|
| 79 | case MACH_SEND_INVALID_DATA: \ | 
|---|
| 80 | case MACH_SEND_INVALID_DEST: \ | 
|---|
| 81 | case MACH_SEND_INVALID_HEADER: \ | 
|---|
| 82 | mig_put_reply_port(InP->Head.msgh_reply_port); \ | 
|---|
| 83 | break; \ | 
|---|
| 84 | default: \ | 
|---|
| 85 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ | 
|---|
| 86 | } \ | 
|---|
| 87 | } | 
|---|
| 88 | #endif	/* __MachMsgErrorWithoutTimeout */ | 
|---|
| 89 |  | 
|---|
| 90 | #ifndef	__DeclareSendRpc | 
|---|
| 91 | #define	__DeclareSendRpc(_NUM_, _NAME_) | 
|---|
| 92 | #endif	/* __DeclareSendRpc */ | 
|---|
| 93 |  | 
|---|
| 94 | #ifndef	__BeforeSendRpc | 
|---|
| 95 | #define	__BeforeSendRpc(_NUM_, _NAME_) | 
|---|
| 96 | #endif	/* __BeforeSendRpc */ | 
|---|
| 97 |  | 
|---|
| 98 | #ifndef	__AfterSendRpc | 
|---|
| 99 | #define	__AfterSendRpc(_NUM_, _NAME_) | 
|---|
| 100 | #endif	/* __AfterSendRpc */ | 
|---|
| 101 |  | 
|---|
| 102 | #ifndef	__DeclareSendSimple | 
|---|
| 103 | #define	__DeclareSendSimple(_NUM_, _NAME_) | 
|---|
| 104 | #endif	/* __DeclareSendSimple */ | 
|---|
| 105 |  | 
|---|
| 106 | #ifndef	__BeforeSendSimple | 
|---|
| 107 | #define	__BeforeSendSimple(_NUM_, _NAME_) | 
|---|
| 108 | #endif	/* __BeforeSendSimple */ | 
|---|
| 109 |  | 
|---|
| 110 | #ifndef	__AfterSendSimple | 
|---|
| 111 | #define	__AfterSendSimple(_NUM_, _NAME_) | 
|---|
| 112 | #endif	/* __AfterSendSimple */ | 
|---|
| 113 |  | 
|---|
| 114 | #define msgh_request_port	msgh_remote_port | 
|---|
| 115 | #define msgh_reply_port		msgh_local_port | 
|---|
| 116 |  | 
|---|
| 117 |  | 
|---|
| 118 |  | 
|---|
| 119 | /* SimpleRoutine audit_triggers */ | 
|---|
| 120 | mig_external kern_return_t audit_triggers | 
|---|
| 121 | ( | 
|---|
| 122 | mach_port_t audit_port, | 
|---|
| 123 | int flags | 
|---|
| 124 | ) | 
|---|
| 125 | { | 
|---|
| 126 |  | 
|---|
| 127 | #ifdef  __MigPackStructs | 
|---|
| 128 | #pragma pack(push, 4) | 
|---|
| 129 | #endif | 
|---|
| 130 | typedef struct { | 
|---|
| 131 | mach_msg_header_t Head; | 
|---|
| 132 | NDR_record_t NDR; | 
|---|
| 133 | int flags; | 
|---|
| 134 | } Request __attribute__((unused)); | 
|---|
| 135 | #ifdef  __MigPackStructs | 
|---|
| 136 | #pragma pack(pop) | 
|---|
| 137 | #endif | 
|---|
| 138 | /* | 
|---|
| 139 | * typedef struct { | 
|---|
| 140 | * 	mach_msg_header_t Head; | 
|---|
| 141 | * 	NDR_record_t NDR; | 
|---|
| 142 | * 	kern_return_t RetCode; | 
|---|
| 143 | * } mig_reply_error_t; | 
|---|
| 144 | */ | 
|---|
| 145 |  | 
|---|
| 146 | union { | 
|---|
| 147 | Request In; | 
|---|
| 148 | } Mess; | 
|---|
| 149 |  | 
|---|
| 150 | Request *InP = &Mess.In; | 
|---|
| 151 |  | 
|---|
| 152 | mach_msg_return_t msg_result; | 
|---|
| 153 |  | 
|---|
| 154 | #ifdef	__MIG_check__Reply__audit_triggers_t__defined | 
|---|
| 155 | kern_return_t check_result; | 
|---|
| 156 | #endif	/* __MIG_check__Reply__audit_triggers_t__defined */ | 
|---|
| 157 |  | 
|---|
| 158 | __DeclareSendSimple(123, "audit_triggers") | 
|---|
| 159 |  | 
|---|
| 160 | InP->NDR = NDR_record; | 
|---|
| 161 |  | 
|---|
| 162 | InP->flags = flags; | 
|---|
| 163 |  | 
|---|
| 164 | InP->Head.msgh_reply_port = MACH_PORT_NULL; | 
|---|
| 165 | InP->Head.msgh_bits = | 
|---|
| 166 | MACH_MSGH_BITS(19, 0); | 
|---|
| 167 | /* msgh_size passed as argument */ | 
|---|
| 168 | InP->Head.msgh_request_port = audit_port; | 
|---|
| 169 | InP->Head.msgh_id = 123; | 
|---|
| 170 | InP->Head.msgh_reserved = 0; | 
|---|
| 171 |  | 
|---|
| 172 | __BeforeSendSimple(123, "audit_triggers") | 
|---|
| 173 | #if	__MigKernelSpecificCode | 
|---|
| 174 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); | 
|---|
| 175 | #else | 
|---|
| 176 | 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); | 
|---|
| 177 | #endif /* __MigKernelSpecificCode */ | 
|---|
| 178 | __AfterSendSimple(123, "audit_triggers") | 
|---|
| 179 | return msg_result; | 
|---|
| 180 | } | 
|---|
| 181 |  | 
|---|
| 182 | /* SimpleRoutine audit_analytics */ | 
|---|
| 183 | mig_external kern_return_t audit_analytics | 
|---|
| 184 | ( | 
|---|
| 185 | mach_port_t audit_port, | 
|---|
| 186 | string_t caller_id, | 
|---|
| 187 | string_t caller_name | 
|---|
| 188 | ) | 
|---|
| 189 | { | 
|---|
| 190 |  | 
|---|
| 191 | #ifdef  __MigPackStructs | 
|---|
| 192 | #pragma pack(push, 4) | 
|---|
| 193 | #endif | 
|---|
| 194 | typedef struct { | 
|---|
| 195 | mach_msg_header_t Head; | 
|---|
| 196 | NDR_record_t NDR; | 
|---|
| 197 | mach_msg_type_number_t caller_idOffset; /* MiG doesn't use it */ | 
|---|
| 198 | mach_msg_type_number_t caller_idCnt; | 
|---|
| 199 | char caller_id[1024]; | 
|---|
| 200 | mach_msg_type_number_t caller_nameOffset; /* MiG doesn't use it */ | 
|---|
| 201 | mach_msg_type_number_t caller_nameCnt; | 
|---|
| 202 | char caller_name[1024]; | 
|---|
| 203 | } Request __attribute__((unused)); | 
|---|
| 204 | #ifdef  __MigPackStructs | 
|---|
| 205 | #pragma pack(pop) | 
|---|
| 206 | #endif | 
|---|
| 207 | /* | 
|---|
| 208 | * typedef struct { | 
|---|
| 209 | * 	mach_msg_header_t Head; | 
|---|
| 210 | * 	NDR_record_t NDR; | 
|---|
| 211 | * 	kern_return_t RetCode; | 
|---|
| 212 | * } mig_reply_error_t; | 
|---|
| 213 | */ | 
|---|
| 214 |  | 
|---|
| 215 | union audit_analyticsMessU { | 
|---|
| 216 | Request In; | 
|---|
| 217 | } *Mess = (union audit_analyticsMessU *) mig_user_allocate(size: sizeof(*Mess)); | 
|---|
| 218 |  | 
|---|
| 219 | Request *InP = &Mess->In; | 
|---|
| 220 |  | 
|---|
| 221 | mach_msg_return_t msg_result; | 
|---|
| 222 | unsigned int msgh_size; | 
|---|
| 223 | unsigned int msgh_size_delta; | 
|---|
| 224 |  | 
|---|
| 225 |  | 
|---|
| 226 | #ifdef	__MIG_check__Reply__audit_analytics_t__defined | 
|---|
| 227 | kern_return_t check_result; | 
|---|
| 228 | #endif	/* __MIG_check__Reply__audit_analytics_t__defined */ | 
|---|
| 229 |  | 
|---|
| 230 | __DeclareSendSimple(124, "audit_analytics") | 
|---|
| 231 |  | 
|---|
| 232 | InP->NDR = NDR_record; | 
|---|
| 233 |  | 
|---|
| 234 | #ifdef USING_MIG_STRNCPY_ZEROFILL | 
|---|
| 235 | if (mig_strncpy_zerofill != NULL) { | 
|---|
| 236 | InP->caller_idCnt = (mach_msg_type_number_t) mig_strncpy_zerofill(dest: InP->caller_id, src: caller_id, len: 1024); | 
|---|
| 237 | } else { | 
|---|
| 238 | #endif /* USING_MIG_STRNCPY_ZEROFILL */ | 
|---|
| 239 | InP->caller_idCnt = (mach_msg_type_number_t) mig_strncpy(dest: InP->caller_id, src: caller_id, len: 1024); | 
|---|
| 240 | #ifdef USING_MIG_STRNCPY_ZEROFILL | 
|---|
| 241 | } | 
|---|
| 242 | #endif /* USING_MIG_STRNCPY_ZEROFILL */ | 
|---|
| 243 | InP->caller_idOffset = 0; | 
|---|
| 244 |  | 
|---|
| 245 | msgh_size_delta = _WALIGN_(InP->caller_idCnt); | 
|---|
| 246 | msgh_size = (mach_msg_size_t)(sizeof(Request) - 2048) + msgh_size_delta; | 
|---|
| 247 | InP = (Request *) ((pointer_t) InP + msgh_size_delta - 1024); | 
|---|
| 248 |  | 
|---|
| 249 | #ifdef USING_MIG_STRNCPY_ZEROFILL | 
|---|
| 250 | if (mig_strncpy_zerofill != NULL) { | 
|---|
| 251 | InP->caller_nameCnt = (mach_msg_type_number_t) mig_strncpy_zerofill(dest: InP->caller_name, src: caller_name, len: 1024); | 
|---|
| 252 | } else { | 
|---|
| 253 | #endif /* USING_MIG_STRNCPY_ZEROFILL */ | 
|---|
| 254 | InP->caller_nameCnt = (mach_msg_type_number_t) mig_strncpy(dest: InP->caller_name, src: caller_name, len: 1024); | 
|---|
| 255 | #ifdef USING_MIG_STRNCPY_ZEROFILL | 
|---|
| 256 | } | 
|---|
| 257 | #endif /* USING_MIG_STRNCPY_ZEROFILL */ | 
|---|
| 258 | InP->caller_nameOffset = 0; | 
|---|
| 259 |  | 
|---|
| 260 | msgh_size += _WALIGN_(InP->caller_nameCnt); | 
|---|
| 261 | InP = &Mess->In; | 
|---|
| 262 | InP->Head.msgh_reply_port = MACH_PORT_NULL; | 
|---|
| 263 | InP->Head.msgh_bits = | 
|---|
| 264 | MACH_MSGH_BITS(19, 0); | 
|---|
| 265 | /* msgh_size passed as argument */ | 
|---|
| 266 | InP->Head.msgh_request_port = audit_port; | 
|---|
| 267 | InP->Head.msgh_id = 124; | 
|---|
| 268 | InP->Head.msgh_reserved = 0; | 
|---|
| 269 |  | 
|---|
| 270 | __BeforeSendSimple(124, "audit_analytics") | 
|---|
| 271 | #if	__MigKernelSpecificCode | 
|---|
| 272 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: msgh_size); | 
|---|
| 273 | #else | 
|---|
| 274 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); | 
|---|
| 275 | #endif /* __MigKernelSpecificCode */ | 
|---|
| 276 | __AfterSendSimple(124, "audit_analytics") | 
|---|
| 277 | { mig_user_deallocate(data: (char *) Mess, size: sizeof(*Mess)); return msg_result; } | 
|---|
| 278 | } | 
|---|
| 279 |  | 
|---|