110 time_t ah_timestamp;
111 char *ah_name; /* User account name */
112 char *ah_path; /* Home directory path */
113 char *ah_container; /* ADS container distinguished name */
114 } smb_autohome_t;
115
116 extern void smb_autohome_add(const smb_token_t *);
117 extern void smb_autohome_remove(const char *);
118
119 /*
120 * A local unique id (LUID) is an opaque id used by servers to identify
121 * local resources, such as privileges. A client will use lookup
122 * functions to translate the LUID to a more general, machine independent
123 * form; such as a string.
124 */
125 typedef struct ms_luid {
126 uint32_t low_part;
127 uint32_t high_part;
128 } ms_luid_t;
129
130 /*
131 * Information about a server as reported by NetServerGetInfo.
132 * The SV_PLATFORM and SV_TYPE definitions are in srvsvc.ndl.
133 */
134 typedef struct srvsvc_server_info {
135 uint32_t sv_platform_id;
136 char *sv_name;
137 uint32_t sv_version_major;
138 uint32_t sv_version_minor;
139 uint32_t sv_type;
140 char *sv_comment;
141 uint32_t sv_os;
142 } srvsvc_server_info_t;
143
144 int srvsvc_net_server_getinfo(char *, char *, srvsvc_server_info_t *);
145 int srvsvc_net_remote_tod(char *, char *, struct timeval *, struct tm *);
146
147
148 /*
149 * A client_t is created while binding a client connection to hold the
150 * context for calls made using that connection.
151 *
152 * Handles are RPC call specific and we use an inheritance mechanism to
153 * ensure that each handle has a pointer to the client_t. When the top
154 * level (bind) handle is released, we close the connection.
155 */
156 typedef struct mlsvc_handle {
157 ndr_hdid_t handle;
158 ndr_client_t *clnt;
159 srvsvc_server_info_t svinfo;
160 } mlsvc_handle_t;
161
162 void ndr_rpc_init(void);
163 void ndr_rpc_fini(void);
164 uint32_t ndr_rpc_bind(mlsvc_handle_t *, char *, char *, char *, const char *);
165 void ndr_rpc_unbind(mlsvc_handle_t *);
166 int ndr_rpc_call(mlsvc_handle_t *, int, void *);
167 void ndr_rpc_set_nonull(mlsvc_handle_t *);
168 const srvsvc_server_info_t *ndr_rpc_server_info(mlsvc_handle_t *);
169 uint32_t ndr_rpc_server_os(mlsvc_handle_t *);
170 int ndr_rpc_get_ssnkey(mlsvc_handle_t *, unsigned char *, size_t);
171 void *ndr_rpc_malloc(mlsvc_handle_t *, size_t);
172 ndr_heap_t *ndr_rpc_get_heap(mlsvc_handle_t *);
173 void ndr_rpc_release(mlsvc_handle_t *);
174 boolean_t ndr_is_null_handle(mlsvc_handle_t *);
175 boolean_t ndr_is_bind_handle(mlsvc_handle_t *);
176 void ndr_inherit_handle(mlsvc_handle_t *, mlsvc_handle_t *);
177 void ndr_rpc_status(mlsvc_handle_t *, int, uint32_t);
178
179 /* SVCCTL service */
180 /*
181 * Calculate the wide-char equivalent string length required to
182 * store a string - including the terminating null wide-char.
183 */
184 #define SVCCTL_WNSTRLEN(S) ((strlen((S)) + 1) * sizeof (smb_wchar_t))
185
186 /* An AVL-storable node representing each service in the SCM database. */
187 typedef struct svcctl_svc_node {
188 uu_avl_node_t sn_node;
189 char *sn_name; /* Service Name (Key) */
|
110 time_t ah_timestamp;
111 char *ah_name; /* User account name */
112 char *ah_path; /* Home directory path */
113 char *ah_container; /* ADS container distinguished name */
114 } smb_autohome_t;
115
116 extern void smb_autohome_add(const smb_token_t *);
117 extern void smb_autohome_remove(const char *);
118
119 /*
120 * A local unique id (LUID) is an opaque id used by servers to identify
121 * local resources, such as privileges. A client will use lookup
122 * functions to translate the LUID to a more general, machine independent
123 * form; such as a string.
124 */
125 typedef struct ms_luid {
126 uint32_t low_part;
127 uint32_t high_part;
128 } ms_luid_t;
129
130 int srvsvc_net_remote_tod(char *, char *, struct timeval *, struct tm *);
131
132
133 /*
134 * A client_t is created while binding a client connection to hold the
135 * context for calls made using that connection.
136 *
137 * Handles are RPC call specific and we use an inheritance mechanism to
138 * ensure that each handle has a pointer to the client_t. When the top
139 * level (bind) handle is released, we close the connection.
140 */
141 typedef struct mlsvc_handle {
142 ndr_hdid_t handle;
143 ndr_client_t *clnt;
144 } mlsvc_handle_t;
145
146 void ndr_rpc_init(void);
147 void ndr_rpc_fini(void);
148 uint32_t ndr_rpc_bind(mlsvc_handle_t *, char *, char *, char *, const char *);
149 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 void ndr_rpc_status(mlsvc_handle_t *, int, uint32_t);
160
161 /* SVCCTL service */
162 /*
163 * Calculate the wide-char equivalent string length required to
164 * store a string - including the terminating null wide-char.
165 */
166 #define SVCCTL_WNSTRLEN(S) ((strlen((S)) + 1) * sizeof (smb_wchar_t))
167
168 /* An AVL-storable node representing each service in the SCM database. */
169 typedef struct svcctl_svc_node {
170 uu_avl_node_t sn_node;
171 char *sn_name; /* Service Name (Key) */
|