Lines Matching refs:mxa

55 static int ndr_recv_request(ndr_xa_t *mxa);
56 static int ndr_recv_frag(ndr_xa_t *mxa);
67 ndr_xa_t *mxa;
73 if ((mxa = malloc(sizeof (*mxa))) == NULL)
77 bzero(mxa, sizeof (*mxa));
78 rc = ndr_pipe_process(np, mxa);
81 free(mxa);
94 ndr_pipe_process(ndr_pipe_t *np, ndr_xa_t *mxa)
100 mxa->pipe = np;
101 mxa->binding_list = np->np_binding;
103 if ((mxa->heap = ndr_heap_create()) == NULL)
106 recv_nds = &mxa->recv_nds;
107 rc = nds_initialize(recv_nds, 0, NDR_MODE_CALL_RECV, mxa->heap);
111 send_nds = &mxa->send_nds;
112 rc = nds_initialize(send_nds, 0, NDR_MODE_RETURN_SEND, mxa->heap);
116 rc = ndr_recv_request(mxa);
120 (void) ndr_svc_process(mxa);
121 (void) ndr_send_reply(mxa);
125 nds_destruct(&mxa->send_nds);
127 nds_destruct(&mxa->recv_nds);
129 ndr_heap_destroy(mxa->heap);
175 ndr_recv_request(ndr_xa_t *mxa)
177 ndr_common_header_t *hdr = &mxa->recv_hdr.common_hdr;
178 ndr_stream_t *nds = &mxa->recv_nds;
182 rc = ndr_recv_frag(mxa);
189 rc = ndr_recv_frag(mxa);
200 rc = ndr_decode_pdu_hdr(mxa);
224 ndr_recv_frag(ndr_xa_t *mxa)
226 ndr_common_header_t *hdr = &mxa->recv_hdr.common_hdr;
227 ndr_stream_t *nds = &mxa->recv_nds;
240 rc = NDR_PIPE_RECV(mxa->pipe, data, NDR_RSP_HDR_SIZE);
251 hdr->frag_length > mxa->pipe->np_max_xmit_frag)
267 rc = NDR_PIPE_RECV(mxa->pipe, data, pay_size);
280 ndr_svc_process(ndr_xa_t *mxa)
284 (void) ndr_reply_prepare_hdr(mxa);
286 switch (mxa->ptype) {
288 rc = ndr_svc_bind(mxa);
292 rc = ndr_svc_request(mxa);
296 rc = ndr_svc_alter_context(mxa);
305 ndr_reply_fault(mxa, rc);
315 ndr_svc_bind(ndr_xa_t *mxa)
331 cont_list = &mxa->recv_hdr.bind_hdr.p_context_elem;
332 result_list = &mxa->send_hdr.bind_ack_hdr.p_result_list;
339 sec_addr = &mxa->send_hdr.bind_ack_hdr.sec_addr;
358 if ((mbind = ndr_svc_find_binding(mxa, p_cont_id)) != NULL) {
366 if ((mbind = ndr_svc_new_binding(mxa)) == NULL) {
392 sec_addr = &mxa->send_hdr.bind_ack_hdr.sec_addr;
403 mxa->binding = mbind;
411 rc = (msvc->bind_req)(mxa);
435 ndr_svc_alter_context(ndr_xa_t *mxa)
449 result_list = &mxa->send_hdr.alter_context_rsp_hdr.p_result_list;
459 cont_list = &mxa->recv_hdr.alter_context_hdr.p_context_elem;
462 if (ndr_svc_find_binding(mxa, p_cont_id) != NULL)
465 if ((mbind = ndr_svc_new_binding(mxa)) == NULL) {
489 mxa->binding = mbind;
491 sec_addr = &mxa->send_hdr.alter_context_rsp_hdr.sec_addr;
502 ndr_svc_request(ndr_xa_t *mxa)
509 mxa->opnum = mxa->recv_hdr.request_hdr.opnum;
510 p_cont_id = mxa->recv_hdr.request_hdr.p_cont_id;
512 if ((mbind = ndr_svc_find_binding(mxa, p_cont_id)) == NULL)
515 mxa->binding = mbind;
521 mxa->send_nds.pdu_scan_offset = NDR_RSP_HDR_SIZE;
524 rc = (*msvc->call_stub)(mxa);
526 rc = ndr_generic_call_stub(mxa);
530 msvc->name, mxa->opnum, rc);
542 ndr_generic_call_stub(ndr_xa_t *mxa)
544 ndr_binding_t *mbind = mxa->binding;
548 int opnum = mxa->opnum;
553 if (mxa->heap == NULL) {
564 if ((param = ndr_heap_malloc(mxa->heap, p_len)) == NULL)
569 rc = ndr_decode_call(mxa, param);
573 rc = (*ste->func)(param, mxa);
575 rc = ndr_encode_return(mxa, param);
586 ndr_reply_prepare_hdr(ndr_xa_t *mxa)
588 ndr_common_header_t *rhdr = &mxa->recv_hdr.common_hdr;
589 ndr_common_header_t *hdr = &mxa->send_hdr.common_hdr;
606 switch (mxa->ptype) {
613 if (mxa->pipe->np_max_xmit_frag >
614 mxa->recv_hdr.bind_hdr.max_xmit_frag)
615 mxa->pipe->np_max_xmit_frag =
616 mxa->recv_hdr.bind_hdr.max_xmit_frag;
617 if (mxa->pipe->np_max_recv_frag >
618 mxa->recv_hdr.bind_hdr.max_recv_frag)
619 mxa->pipe->np_max_recv_frag =
620 mxa->recv_hdr.bind_hdr.max_recv_frag;
623 mxa->send_hdr.bind_ack_hdr.max_xmit_frag =
624 mxa->pipe->np_max_xmit_frag;
625 mxa->send_hdr.bind_ack_hdr.max_recv_frag =
626 mxa->pipe->np_max_recv_frag;
633 mxa->send_hdr.bind_ack_hdr.assoc_group_id =
634 mxa->recv_hdr.bind_hdr.assoc_group_id;
635 if (mxa->send_hdr.bind_ack_hdr.assoc_group_id == 0)
636 mxa->send_hdr.bind_ack_hdr.assoc_group_id =
637 (DWORD)(uintptr_t)mxa->pipe;
643 /* mxa->send_hdr.response_hdr.alloc_hint */
644 mxa->send_hdr.response_hdr.p_cont_id =
645 mxa->recv_hdr.request_hdr.p_cont_id;
646 mxa->send_hdr.response_hdr.cancel_count = 0;
647 mxa->send_hdr.response_hdr.reserved = 0;
656 mxa->send_hdr.alter_context_rsp_hdr.max_xmit_frag =
657 mxa->recv_hdr.alter_context_hdr.max_xmit_frag;
658 mxa->send_hdr.alter_context_rsp_hdr.max_recv_frag =
659 mxa->recv_hdr.alter_context_hdr.max_recv_frag;
660 mxa->send_hdr.alter_context_rsp_hdr.assoc_group_id =
661 mxa->recv_hdr.alter_context_hdr.assoc_group_id;
674 ndr_reply_fault(ndr_xa_t *mxa, unsigned long drc)
676 ndr_common_header_t *rhdr = &mxa->recv_hdr.common_hdr;
677 ndr_common_header_t *hdr = &mxa->send_hdr.common_hdr;
678 ndr_stream_t *nds = &mxa->send_nds;
687 hdr->frag_length = sizeof (mxa->send_hdr.fault_hdr);
722 mxa->send_hdr.fault_hdr.common_hdr.ptype = NDR_PTYPE_FAULT;
723 mxa->send_hdr.fault_hdr.status = fault_status;
724 mxa->send_hdr.response_hdr.alloc_hint = hdr->frag_length;
732 ndr_send_reply(ndr_xa_t *mxa)
734 ndr_common_header_t *hdr = &mxa->send_hdr.common_hdr;
735 ndr_stream_t *nds = &mxa->send_nds;
742 frag_size = mxa->pipe->np_max_recv_frag;
755 hdr->frag_length = ndr_bind_ack_hdr_size(mxa);
764 mxa->send_hdr.response_hdr.alloc_hint =
778 (void) ndr_encode_pdu_hdr(mxa);
780 (void) NDR_PIPE_SEND(mxa->pipe, pdu_buf, pdu_size);
802 mxa->send_hdr.response_hdr.alloc_hint = pdu_data_size;
804 (void) ndr_encode_pdu_hdr(mxa);
805 (void) NDR_PIPE_SEND(mxa->pipe, pdu_buf, frag_size);
816 mxa->send_hdr.response_hdr.alloc_hint = pdu_data_size;
818 (void) ndr_encode_pdu_hdr(mxa);
820 (void) NDR_PIPE_SEND(mxa->pipe, pdu_buf, frag_size);
831 mxa->send_hdr.response_hdr.alloc_hint = pdu_data_size;
833 (void) ndr_encode_pdu_hdr(mxa);
835 (void) NDR_PIPE_SEND(mxa->pipe, pdu_buf, frag_size);