/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _LIBNTSVCS_H
#define _LIBNTSVCS_H
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <libuutil.h>
#include <smb/wintypes.h>
#include <smbsrv/smb_token.h>
#include <smbsrv/smb_privilege.h>
#include <smbsrv/smb_share.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int dssetup_check_service(void);
extern void dssetup_clear_domain_info(void);
void ntsvcs_init(void);
void ntsvcs_fini(void);
boolean_t ntsvcs_srv_down(int);
DWORD netlogon_setup_auth(char *, char *);
void smb_authinfo_free(smb_authinfo_t *);
void netr_logon_abort(void);
ndr_buf_t *netr_ndrbuf_init(void);
void netr_ndrbuf_fini(ndr_buf_t *);
DWORD sam_create_trust_account(char *, char *);
DWORD sam_remove_trust_account(char *, char *);
void smb_session_key_destroy(smb_session_key_t *);
/*
* The maximum number of domains (NT limit).
*/
/*
* Passthrough negotiation and authentication interface.
*
* NT supports two forms of password: a Lanman (case-insensitive)
* password and an NT (case-sensitive) password. If either of the
* passwords is not available its pointer and length should be set
* to zero. The session key and vc number are required to validate
* the encrypted passwords.
*/
int outmax);
typedef struct smb_autohome {
extern void smb_autohome_add(const smb_token_t *);
/*
* A local unique id (LUID) is an opaque id used by servers to identify
* local resources, such as privileges. A client will use lookup
* functions to translate the LUID to a more general, machine independent
* form; such as a string.
*/
typedef struct ms_luid {
} ms_luid_t;
typedef struct wksta_info {
char *wki_computername;
char *wki_domainname;
} wksta_info_t;
int wkssvc_getinfo(char *, char *, wksta_info_t *);
void wkssvc_freeinfo(wksta_info_t *);
typedef struct srvsvc_share_info {
char *si_netname;
char *si_comment;
char *si_path;
char *si_servername;
typedef struct srvsvc_session_info {
char *ui_account;
char *ui_workstation;
typedef struct srvsvc_connect_info {
char *ci_username;
char *ci_share;
typedef struct srvsvc_file_info {
char *fi_path;
char *fi_username;
typedef struct srvsvc_info {
union {
} l_list;
typedef struct srvsvc_list {
void srvsvc_net_enum_init(srvsvc_list_t *);
void srvsvc_net_enum_fini(srvsvc_list_t *);
int srvsvc_net_share_get_info(char *, char *, char *, uint32_t,
int srvsvc_net_session_enum(char *, char *, char *, char *, uint32_t,
srvsvc_list_t *);
int srvsvc_net_files_enum(char *, char *, char *, char *, uint32_t,
srvsvc_list_t *);
/*
* Information about a server as reported by NetServerGetInfo.
* The SV_PLATFORM and SV_TYPE definitions are in srvsvc.ndl.
*/
typedef struct srvsvc_server_info {
char *sv_name;
char *sv_comment;
int srvsvc_net_server_getinfo(char *, char *, srvsvc_server_info_t *);
int srvsvc_timecheck(char *, char *);
/*
* A client_t is created while binding a client connection to hold the
* context for calls made using that connection.
*
* Handles are RPC call specific and we use an inheritance mechanism to
* ensure that each handle has a pointer to the client_t. When the top
* level (bind) handle is released, we close the connection.
*/
typedef struct mlsvc_handle {
/*
* Minimum buffer size for a NetBIOS name RPC binding handle.
* The handle is the NetBIOS name prefixed (UNC style) by '\\'.
*/
int ndr_rpc_bind(mlsvc_handle_t *, char *, char *, char *, const char *);
void ndr_rpc_unbind(mlsvc_handle_t *);
int ndr_rpc_call(mlsvc_handle_t *, int, void *);
void ndr_rpc_set_nonull(mlsvc_handle_t *);
void *ndr_rpc_derive_nbhandle(mlsvc_handle_t *, const char *);
void ndr_rpc_format_nbhandle(const char *, char *, size_t);
void ndr_rpc_release(mlsvc_handle_t *);
int ndr_svinfo_update(const char *, const char *, const srvsvc_server_info_t *);
/* SVCCTL service */
/*
* Calculate the wide-char equivalent string length required to
* store a string - including the terminating null wide-char.
*/
/* An AVL-storable node representing each service in the SCM database. */
typedef struct svcctl_svc_node {
/* This structure provides context for each svcctl_s_OpenManager call. */
typedef struct svcctl_manager_context {
/* This structure provides context for each svcctl_s_OpenService call. */
typedef struct svcctl_service_context {
typedef enum {
/* This structure provides abstraction for service and manager context call. */
typedef struct svcctl_context {
union {
void *uc_cp;
} c_ctx;
/* Service Control Manager (SCM) functions */
void svcctl_init(void);
void svcctl_fini(void);
void svcctl_scm_fini(svcctl_manager_context_t *);
uint32_t svcctl_scm_map_status(const char *);
/* LOGR service */
typedef struct logr_entry {
} logr_entry_t;
typedef struct logr_info {
} logr_info_t;
typedef struct logr_read_data {
/* This structure provides the context for eventlog calls from clients. */
typedef struct logr_context {
char *lc_source_name;
void logr_init(void);
void logr_fini(void);
boolean_t logr_is_supported(char *);
int logr_get_snapshot(logr_context_t *);
void dfs_info_free(dfs_info_t *);
void *dfs_ns_export(void *);
void dfs_ns_unexport(const char *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBNTSVCS_H */