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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlsvc/common/libmlsvc.h
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/libmlsvc.h
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  
  26   26  #ifndef _LIBMLSVC_H
  27   27  #define _LIBMLSVC_H
  28   28  
  29      -#include <uuid/uuid.h>
  30   29  #include <sys/param.h>
  31   30  #include <sys/types.h>
  32   31  #include <sys/uio.h>
  33   32  #include <sys/ksynch.h>
       33 +#include <uuid/uuid.h>
       34 +
  34   35  #include <time.h>
  35   36  #include <stdio.h>
  36   37  #include <string.h>
       38 +#include <syslog.h>
  37   39  #include <netdb.h>
  38   40  #include <libuutil.h>
  39      -#include <smbsrv/wintypes.h>
       41 +
       42 +#include <smb/wintypes.h>
       43 +#include <libmlrpc/libmlrpc.h>
       44 +
  40   45  #include <smbsrv/hash_table.h>
  41   46  #include <smbsrv/smb_token.h>
  42   47  #include <smbsrv/smb_privilege.h>
  43   48  #include <smbsrv/smb_share.h>
  44   49  #include <smbsrv/smb_xdr.h>
  45   50  #include <smbsrv/smb_dfs.h>
  46   51  #include <smbsrv/libsmb.h>
  47      -#include <smbsrv/libmlrpc.h>
  48      -#include <smbsrv/ndl/lsarpc.ndl>
  49   52  
  50   53  #ifdef  __cplusplus
  51   54  extern "C" {
  52   55  #endif
  53   56  
  54   57  uint32_t lsa_lookup_name(char *, uint16_t, smb_account_t *);
  55   58  uint32_t lsa_lookup_sid(smb_sid_t *, smb_account_t *);
  56   59  
  57   60  /*
  58   61   * SMB domain API to discover a domain controller and obtain domain
↓ open down ↓ 61 lines elided ↑ open up ↑
 120  123   * A local unique id (LUID) is an opaque id used by servers to identify
 121  124   * local resources, such as privileges.  A client will use lookup
 122  125   * functions to translate the LUID to a more general, machine independent
 123  126   * form; such as a string.
 124  127   */
 125  128  typedef struct ms_luid {
 126  129          uint32_t low_part;
 127  130          uint32_t high_part;
 128  131  } ms_luid_t;
 129  132  
 130      -int srvsvc_net_remote_tod(char *, char *, struct timeval *, struct tm *);
 131      -
 132      -
 133  133  /*
 134  134   * A client_t is created while binding a client connection to hold the
 135  135   * context for calls made using that connection.
 136  136   *
 137  137   * Handles are RPC call specific and we use an inheritance mechanism to
 138  138   * ensure that each handle has a pointer to the client_t.  When the top
 139  139   * level (bind) handle is released, we close the connection.
 140  140   */
 141      -typedef struct mlsvc_handle {
 142      -        ndr_hdid_t                      handle;
 143      -        ndr_client_t                    *clnt;
 144      -} mlsvc_handle_t;
      141 +typedef struct mlrpc_handle mlsvc_handle_t;
 145  142  
      143 +/* mlsvc_client.c */
 146  144  void ndr_rpc_init(void);
 147  145  void ndr_rpc_fini(void);
 148  146  uint32_t ndr_rpc_bind(mlsvc_handle_t *, char *, char *, char *, const char *);
 149  147  void ndr_rpc_unbind(mlsvc_handle_t *);
 150      -int ndr_rpc_call(mlsvc_handle_t *, int, void *);
 151      -void ndr_rpc_set_nonull(mlsvc_handle_t *);
 152      -int ndr_rpc_get_ssnkey(mlsvc_handle_t *, unsigned char *, size_t);
 153      -void *ndr_rpc_malloc(mlsvc_handle_t *, size_t);
 154      -ndr_heap_t *ndr_rpc_get_heap(mlsvc_handle_t *);
 155      -void ndr_rpc_release(mlsvc_handle_t *);
 156      -boolean_t ndr_is_null_handle(mlsvc_handle_t *);
 157      -boolean_t ndr_is_bind_handle(mlsvc_handle_t *);
 158      -void ndr_inherit_handle(mlsvc_handle_t *, mlsvc_handle_t *);
 159  148  void ndr_rpc_status(mlsvc_handle_t *, int, uint32_t);
 160  149  
      150 +/* These three get info about the connected client. */
      151 +boolean_t ndr_is_admin(ndr_xa_t *);
      152 +boolean_t ndr_is_poweruser(ndr_xa_t *);
      153 +int32_t ndr_native_os(ndr_xa_t *);
      154 +
      155 +/* SRVSVC */
      156 +int srvsvc_net_remote_tod(char *, char *, struct timeval *, struct tm *);
      157 +
 161  158  /* SVCCTL service */
 162  159  /*
 163  160   * Calculate the wide-char equivalent string length required to
 164  161   * store a string - including the terminating null wide-char.
 165  162   */
 166  163  #define SVCCTL_WNSTRLEN(S)      ((strlen((S)) + 1) * sizeof (smb_wchar_t))
 167  164  
 168  165  /* An AVL-storable node representing each service in the SCM database. */
 169  166  typedef struct svcctl_svc_node {
 170  167          uu_avl_node_t           sn_node;
↓ open down ↓ 111 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX