Lines Matching refs:hp

71 	slp_handle_impl_t *hp;
127 void slp_uc_tcp_send(slp_handle_impl_t *hp, slp_target_t *target,
133 if (!hp->tcp_lock) {
134 if (!(hp->tcp_lock = malloc(sizeof (*(hp->tcp_lock))))) {
139 (void) mutex_init(hp->tcp_lock, NULL, NULL);
141 if (!hp->tcp_wait) {
142 if (!(hp->tcp_wait = malloc(sizeof (*(hp->tcp_wait))))) {
147 (void) cond_init(hp->tcp_wait, NULL, NULL);
149 (void) mutex_lock(hp->tcp_lock);
150 (hp->tcp_ref_cnt)++;
151 (void) mutex_unlock(hp->tcp_lock);
163 rqst->hp = hp;
175 void slp_tcp_wait(slp_handle_impl_t *hp) {
176 (void) mutex_lock(hp->tcp_lock);
177 while (hp->tcp_ref_cnt > 0)
178 (void) cond_wait(hp->tcp_wait, hp->tcp_lock);
179 (void) mutex_unlock(hp->tcp_lock);
191 void slp_uc_udp_send(slp_handle_impl_t *hp, slp_target_t *target,
206 if (make_header(hp, header, scopes) != SLP_OK)
229 udp_make_msghdr(sin, hp->msg.iov, hp->msg.iovlen, msg);
242 !hp->cancel;
306 if (!ctarg || hp->cancel) {
317 (void) slp_enqueue(hp->q, reply);
321 hp, ctarg, scopes, SLP_FALSE, slp_get_xid(header));
334 void slp_mc_send(slp_handle_impl_t *hp, const char *scopes) {
347 if (make_header(hp, header, scopes) != SLP_OK)
351 if (make_mc_target(hp, sin, header, &pfd, &nfds, &bcifs) != SLP_OK)
353 udp_make_msghdr(sin, hp->msg.iov, hp->msg.iovlen, msg);
371 !hp->cancel;
381 mc_recvmsg(pfd, nfds, hp, scopes, header, &collator, final_to,
465 slp_handle_impl_t *hp;
481 hp = rqst->hp;
490 if (hp->cancel)
494 if (make_header(hp, header, scopes) != SLP_OK) {
503 ctarg && !hp->cancel;
528 if (writev(tcp_sockfd, hp->msg.iov, hp->msg.iovlen)
548 if (hp->cancel) {
554 (void) slp_enqueue(hp->q, reply);
560 (void) mutex_lock(hp->tcp_lock);
561 if (--(hp->tcp_ref_cnt) == 0)
562 (void) cond_signal(hp->tcp_wait);
563 (void) mutex_unlock(hp->tcp_lock);
637 static SLPError make_header(slp_handle_impl_t *hp, char *header,
646 msgLen = slp_hdrlang_length(hp);
647 hp->msg.iov[0].iov_base = header;
648 hp->msg.iov[0].iov_len = msgLen; /* now the length of the hdr */
651 hp->msg.prlist->iov_base = header + msgLen;
653 for (i = 1; i < hp->msg.iovlen; i++) {
654 msgLen += hp->msg.iov[i].iov_len;
659 if ((err = slp_add_header(hp->locale, header, mtu,
660 hp->fid, msgLen, &off)) != SLP_OK)
664 hp->msg.prlist->iov_len = 0;
668 if ((err = slp_add_sht((char *)hp->msg.scopeslen.iov_base,
672 hp->msg.scopes->iov_base = (caddr_t)scopes;
673 hp->msg.scopes->iov_len = slen;
699 static SLPError make_mc_target(slp_handle_impl_t *hp,
822 hp, given_ifs, num_givenifs, bcifs))
898 static SLPError make_bc_target(slp_handle_impl_t *hp,
904 if ((err = slp_broadcast_addrs(hp, given_ifs, num_givenifs,
992 * hp IN SLPHandle from originating call
1004 * timeout or the final timeout has expired, or if hp->cancel becomes true.
1006 static void mc_recvmsg(struct pollfd *pfd, nfds_t nfds, slp_handle_impl_t *hp,
1019 for (; !hp->cancel; ) {
1031 for (i = 0; !hp->cancel && i < nfds; i++) {
1052 tcp_handoff(hp, scopes,
1065 tcp_handoff(hp, scopes,
1072 if (add2pr_list(&(hp->msg), &responder, collator)) {
1073 (void) slp_enqueue(hp->q, reply);
1123 static void tcp_handoff(slp_handle_impl_t *hp, const char *scopes,
1128 slp_uc_tcp_send(hp, target, scopes, SLP_TRUE, xid);