Lines Matching refs:hp

69 	slp_handle_impl_t *hp;  member
125 void slp_uc_tcp_send(slp_handle_impl_t *hp, slp_target_t *target, in slp_uc_tcp_send() argument
131 if (!hp->tcp_lock) { in slp_uc_tcp_send()
132 if (!(hp->tcp_lock = malloc(sizeof (*(hp->tcp_lock))))) { in slp_uc_tcp_send()
137 (void) mutex_init(hp->tcp_lock, USYNC_THREAD, NULL); in slp_uc_tcp_send()
139 if (!hp->tcp_wait) { in slp_uc_tcp_send()
140 if (!(hp->tcp_wait = malloc(sizeof (*(hp->tcp_wait))))) { in slp_uc_tcp_send()
145 (void) cond_init(hp->tcp_wait, USYNC_THREAD, NULL); in slp_uc_tcp_send()
147 (void) mutex_lock(hp->tcp_lock); in slp_uc_tcp_send()
148 (hp->tcp_ref_cnt)++; in slp_uc_tcp_send()
149 (void) mutex_unlock(hp->tcp_lock); in slp_uc_tcp_send()
161 rqst->hp = hp; in slp_uc_tcp_send()
173 void slp_tcp_wait(slp_handle_impl_t *hp) { in slp_tcp_wait() argument
174 (void) mutex_lock(hp->tcp_lock); in slp_tcp_wait()
175 while (hp->tcp_ref_cnt > 0) in slp_tcp_wait()
176 (void) cond_wait(hp->tcp_wait, hp->tcp_lock); in slp_tcp_wait()
177 (void) mutex_unlock(hp->tcp_lock); in slp_tcp_wait()
189 void slp_uc_udp_send(slp_handle_impl_t *hp, slp_target_t *target, in slp_uc_udp_send() argument
204 if (make_header(hp, header, scopes) != SLP_OK) in slp_uc_udp_send()
227 udp_make_msghdr(sin, hp->msg.iov, hp->msg.iovlen, msg); in slp_uc_udp_send()
240 !hp->cancel; in slp_uc_udp_send()
304 if (!ctarg || hp->cancel) { in slp_uc_udp_send()
315 (void) slp_enqueue(hp->q, reply); in slp_uc_udp_send()
319 hp, ctarg, scopes, SLP_FALSE, slp_get_xid(header)); in slp_uc_udp_send()
332 void slp_mc_send(slp_handle_impl_t *hp, const char *scopes) { in slp_mc_send() argument
345 if (make_header(hp, header, scopes) != SLP_OK) in slp_mc_send()
349 if (make_mc_target(hp, sin, header, &pfd, &nfds, &bcifs) != SLP_OK) in slp_mc_send()
351 udp_make_msghdr(sin, hp->msg.iov, hp->msg.iovlen, msg); in slp_mc_send()
369 !hp->cancel; in slp_mc_send()
379 mc_recvmsg(pfd, nfds, hp, scopes, header, &collator, final_to, in slp_mc_send()
466 slp_handle_impl_t *hp; in tcp_thread() local
482 hp = rqst->hp; in tcp_thread()
491 if (hp->cancel) in tcp_thread()
495 if (make_header(hp, header, scopes) != SLP_OK) { in tcp_thread()
503 for (ctarg = targets; ctarg && !hp->cancel; in tcp_thread()
528 if (writev(tcp_sockfd, hp->msg.iov, hp->msg.iovlen) in tcp_thread()
548 if (hp->cancel) { in tcp_thread()
554 (void) slp_enqueue(hp->q, reply); in tcp_thread()
560 (void) mutex_lock(hp->tcp_lock); in tcp_thread()
561 if (--(hp->tcp_ref_cnt) == 0) in tcp_thread()
562 (void) cond_signal(hp->tcp_wait); in tcp_thread()
563 (void) mutex_unlock(hp->tcp_lock); in tcp_thread()
638 static SLPError make_header(slp_handle_impl_t *hp, char *header, in make_header() argument
647 msgLen = slp_hdrlang_length(hp); in make_header()
648 hp->msg.iov[0].iov_base = header; in make_header()
649 hp->msg.iov[0].iov_len = msgLen; /* now the length of the hdr */ in make_header()
652 hp->msg.prlist->iov_base = header + msgLen; in make_header()
654 for (i = 1; i < hp->msg.iovlen; i++) { in make_header()
655 msgLen += hp->msg.iov[i].iov_len; in make_header()
660 if ((err = slp_add_header(hp->locale, header, mtu, in make_header()
661 hp->fid, msgLen, &off)) != SLP_OK) in make_header()
665 hp->msg.prlist->iov_len = 0; in make_header()
669 if ((err = slp_add_sht((char *)hp->msg.scopeslen.iov_base, in make_header()
673 hp->msg.scopes->iov_base = (caddr_t)scopes; in make_header()
674 hp->msg.scopes->iov_len = slen; in make_header()
700 static SLPError make_mc_target(slp_handle_impl_t *hp, in make_mc_target() argument
823 hp, given_ifs, num_givenifs, bcifs)) in make_mc_target()
899 static SLPError make_bc_target(slp_handle_impl_t *hp, in make_bc_target() argument
905 if ((err = slp_broadcast_addrs(hp, given_ifs, num_givenifs, in make_bc_target()
1007 static void mc_recvmsg(struct pollfd *pfd, nfds_t nfds, slp_handle_impl_t *hp, in mc_recvmsg() argument
1020 for (; !hp->cancel; ) { in mc_recvmsg()
1032 for (i = 0; !hp->cancel && i < nfds; i++) { in mc_recvmsg()
1053 tcp_handoff(hp, scopes, in mc_recvmsg()
1066 tcp_handoff(hp, scopes, in mc_recvmsg()
1073 if (add2pr_list(&(hp->msg), &responder, collator)) { in mc_recvmsg()
1074 (void) slp_enqueue(hp->q, reply); in mc_recvmsg()
1124 static void tcp_handoff(slp_handle_impl_t *hp, const char *scopes, in tcp_handoff() argument
1129 slp_uc_tcp_send(hp, target, scopes, SLP_TRUE, xid); in tcp_handoff()