Lines Matching defs:ts
156 tsd_t *ts = (tsd_t *)tsd;
158 request = (mach_msg_header_t *)ts->request_msg;
160 reply = (mach_msg_header_t *)ts->reply_msg;
166 if (ts->verbose) printf("Awaiting message\n");
171 ts->request_msg_size,
172 ts->server_port,
183 if (ts->verbose) printf("Received message\n");
187 complex_request = (ipc_complex_message *)ts->request_msg;
193 if (ts->verbose) printf("Sending reply\n");
195 reply->msgh_size = ts->reply_msg_size;
208 ts->reply_msg_size,
209 ts->request_msg_size,
210 ts->server_port,
219 ts->reply_msg_size,
243 tsd_t *ts = (tsd_t *)tsd;
249 request = (mach_msg_header_t *)ts->request_msg;
250 reply = (mach_msg_header_t *)ts->reply_msg;
252 for (idx = 0; idx < ts->num_msgs; idx++) {
255 request->msgh_size = ts->request_msg_size;
256 request->msgh_remote_port = ts->server_port;
257 request->msgh_local_port = ts->reply_port;
259 if (ts->msg_type == msg_type_complex) {
264 complexmsg->descriptor.address = ts->ints;
265 complexmsg->descriptor.size = ts->num_ints * sizeof(u_int32_t);
271 if (ts->oneway) {
279 if (ts->verbose) printf("Sending request\n");
283 ts->request_msg_size,
284 ts->reply_msg_size,
285 ts->reply_port,
299 ts->request_msg_size,
300 ts->reply_msg_size,
301 ts->reply_port,
312 if (ts->verbose && !ts->oneway) printf("Received reply\n");
331 tsd_t *ts = (tsd_t *)tsd;
333 ts->server_mode = -1;
334 ts->verbose = opt_verbose;
335 ts->oneway = opt_oneway;
336 ts->overwrite = 0;
337 ts->msg_type = opt_msg_type;
338 ts->num_ints = opt_num_ints;
339 ts->num_msgs = opt_num_msgs;
340 ts->server_port_name = opt_server_port_name;
341 ts->server_port = MACH_PORT_NULL;
342 ts->reply_port = MACH_PORT_NULL;
343 ts->request_msg = NULL;
344 ts->request_msg_size = 0;
345 ts->reply_msg = NULL;
346 ts->reply_msg_size = 0;
348 switch (ts->msg_type) {
350 ts->request_msg_size = sizeof(ipc_trivial_message);
354 ts->request_msg_size = sizeof(ipc_inline_message) +
355 sizeof(u_int32_t) * ts->num_ints;
359 ts->request_msg_size = sizeof(ipc_complex_message);
360 ts->ints = malloc(sizeof(u_int32_t) * ts->num_ints);
364 ts->request_msg = malloc(ts->request_msg_size);
365 ts->reply_msg = malloc(ts->reply_msg_size);
367 if (ts->server_mode) {
371 ts->reply_msg_size -= sizeof(mach_msg_trailer_t);
373 &(ts->server_port));
378 ret = mach_port_insert_right(mach_task_self(), ts->server_port,
379 ts->server_port, MACH_MSG_TYPE_MAKE_SEND);
389 ret = bootstrap_check_in(bsport, (char *)ts->server_port_name,
390 &ts->server_port);
399 ts->request_msg_size -= sizeof(mach_msg_trailer_t);
402 &(ts->reply_port));
413 ret = bootstrap_look_up(bsport, (char *)ts->server_port_name,
414 &(ts->server_port));
421 if (ts->verbose) {
422 if (ts->server_mode) {
424 ts->server_port_name);
427 ts->num_msgs, (ts->msg_type == msg_type_inline) ? "inline" :
428 ((ts->msg_type == msg_type_complex) ? "complex" : "trivial"),
429 ts->server_port_name, (ts->oneway ? "oneway" : "rpc"));
442 ts->pid = pid;
508 tsd_t *ts = (tsd_t *)tsd;
509 kill(ts->pid, SIGKILL);
524 // tsd_t *ts = (tsd_t *)tsd;
573 // tsd_t *ts = (tsd_t *)tsd;
593 // tsd_t *ts = (tsd_t *)tsd;