Print this page
1575 untangle libmlrpc ... (libmlrpc)

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libmlrpc/common/ndr_client.c
          +++ new/usr/src/lib/libmlrpc/common/ndr_client.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  24   26   */
  25   27  
  26   28  #include <sys/errno.h>
  27   29  #include <string.h>
  28   30  #include <strings.h>
  29   31  
  30      -#include <smbsrv/libsmb.h>
  31      -#include <smbsrv/libmlrpc.h>
       32 +#include <libmlrpc.h>
  32   33  
  33   34  #define NDR_DEFAULT_FRAGSZ      8192
  34   35  #define NDR_MULTI_FRAGSZ        (60 * 1024)
  35   36  
  36   37  static void ndr_clnt_init_hdr(ndr_client_t *, ndr_xa_t *);
  37   38  static int ndr_clnt_get_frags(ndr_client_t *, ndr_xa_t *);
  38   39  static int ndr_clnt_get_frag(ndr_client_t *, ndr_xa_t *, ndr_common_header_t *);
  39   40  
  40   41  int
  41      -ndr_clnt_bind(ndr_client_t *clnt, const char *service_name,
       42 +ndr_clnt_bind(ndr_client_t *clnt, ndr_service_t *msvc,
  42   43      ndr_binding_t **ret_binding_p)
  43   44  {
  44      -        ndr_service_t           *msvc;
  45   45          ndr_binding_t           *mbind;
  46   46          ndr_xa_t                mxa;
  47   47          ndr_bind_hdr_t          *bhdr;
  48   48          ndr_p_cont_elem_t       *pce;
  49   49          ndr_bind_ack_hdr_t      *bahdr;
  50   50          ndr_p_result_t          *pre;
  51   51          int                     rc;
  52   52  
  53   53          bzero(&mxa, sizeof (mxa));
  54   54  
  55      -        msvc = ndr_svc_lookup_name(service_name);
  56      -        if (msvc == NULL)
  57      -                return (NDR_DRC_FAULT_API_SERVICE_INVALID);
  58      -
  59   55          mxa.binding_list = clnt->binding_list;
  60   56          if ((mbind = ndr_svc_new_binding(&mxa)) == NULL)
  61   57                  return (NDR_DRC_FAULT_API_BIND_NO_SLOTS);
  62   58  
  63   59          ndr_clnt_init_hdr(clnt, &mxa);
  64   60  
  65   61          bhdr = &mxa.send_hdr.bind_hdr;
  66   62          bhdr->common_hdr.ptype = NDR_PTYPE_BIND;
  67   63          bhdr->common_hdr.frag_length = sizeof (*bhdr);
  68   64          bhdr->max_xmit_frag = NDR_DEFAULT_FRAGSZ;
↓ open down ↓ 64 lines elided ↑ open up ↑
 133  129  
 134  130  fault_exit:
 135  131          (*clnt->xa_destruct)(clnt, &mxa);
 136  132          return (rc);
 137  133  }
 138  134  
 139  135  int
 140  136  ndr_clnt_call(ndr_binding_t *mbind, int opnum, void *params)
 141  137  {
 142  138          ndr_client_t            *clnt = mbind->clnt;
 143      -        ndr_service_t           *msvc = mbind->service;
 144  139          ndr_xa_t                mxa;
 145  140          ndr_request_hdr_t       *reqhdr;
 146  141          ndr_common_header_t     *rsphdr;
 147  142          unsigned long           recv_pdu_scan_offset;
 148  143          int                     rc;
 149  144  
 150      -        if (ndr_svc_lookup_name(msvc->name) == NULL)
 151      -                return (NDR_DRC_FAULT_API_SERVICE_INVALID);
 152      -
 153  145          bzero(&mxa, sizeof (mxa));
 154  146          mxa.ptype = NDR_PTYPE_REQUEST;
 155  147          mxa.opnum = opnum;
 156  148          mxa.binding = mbind;
 157  149  
 158  150          ndr_clnt_init_hdr(clnt, &mxa);
 159  151  
 160  152          reqhdr = &mxa.send_hdr.request_hdr;
 161  153          reqhdr->common_hdr.ptype = NDR_PTYPE_REQUEST;
 162  154          reqhdr->p_cont_id = mbind->p_cont_id;
↓ open down ↓ 171 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX