xref: /titanic_41/usr/src/lib/smbsrv/libsmbns/common/libsmbns.h (revision ba2be53024c0b999e74ba9adcd7d80fec5df8c57)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_LIBSMBNS_H
27 #define	_LIBSMBNS_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <ldap.h>
32 #include <smbsrv/libsmb.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /* ADS typedef/data structures and functions */
39 #define	ADS_MAXBUFLEN 100
40 
41 typedef struct ads_handle_s {
42 	char *user;		/* admin user to create share in ADS */
43 	char *pwd;		/* user password */
44 	char *domain;		/* ADS domain */
45 	char *domain_dn;	/* domain in Distinquish Name format */
46 	char *ip_addr;		/* ip addr in string format */
47 	char *hostname;		/* fully qualified hostname */
48 	char *site;		/* local ADS site */
49 	LDAP *ld;		/* LDAP handle */
50 } ADS_HANDLE;
51 
52 /*
53  * The possible return status of the adjoin routine.
54  */
55 typedef enum adjoin_status {
56 	ADJOIN_SUCCESS = 0,
57 	ADJOIN_ERR_GET_HANDLE,
58 	ADJOIN_ERR_GEN_PASSWD,
59 	ADJOIN_ERR_ADD_TRUST_ACCT,
60 	ADJOIN_ERR_MOD_TRUST_ACCT,
61 	ADJOIN_ERR_GET_ENCTYPES,
62 	ADJOIN_ERR_INIT_KRB_CTX,
63 	ADJOIN_ERR_GET_SPNS,
64 	ADJOIN_ERR_KSETPWD,
65 	ADJOIN_ERR_UPDATE_CNTRL_ATTR,
66 	ADJOIN_ERR_WRITE_KEYTAB,
67 	ADJOIN_ERR_IDMAP_SET_DOMAIN,
68 	ADJOIN_ERR_IDMAP_REFRESH,
69 	ADJOIN_NUM_STATUS
70 } adjoin_status_t;
71 
72 /* ADS functions */
73 extern void ads_init(void);
74 extern void ads_refresh(void);
75 extern ADS_HANDLE *ads_open(void);
76 extern void ads_close(ADS_HANDLE *);
77 extern int ads_publish_share(ADS_HANDLE *, const char *, const char *,
78     const char *, const char *);
79 extern int ads_remove_share(ADS_HANDLE *, const char *, const char *,
80     const char *, const char *);
81 extern int ads_build_unc_name(char *, int, const char *, const char *);
82 extern int ads_lookup_share(ADS_HANDLE *, const char *, const char *, char *);
83 extern int ads_add_share(ADS_HANDLE *, const char *, const char *,
84     const char *);
85 extern adjoin_status_t ads_join(char *, char *, char *, char *, int);
86 extern char *adjoin_report_err(adjoin_status_t);
87 extern int ads_domain_change_cleanup(char *);
88 
89 /* DYNDNS functions */
90 extern int dns_msgid_init(void);
91 extern int dyndns_update(char *, boolean_t);
92 extern int dyndns_clear_rev_zone(char *);
93 
94 /* Kerberos initialization function */
95 extern int smb_kinit(char *, char *);
96 extern int smb_ccache_init(char *, char *);
97 extern void smb_ccache_remove(char *);
98 
99 /* NETBIOS Functions */
100 extern int msdcs_lookup_ads(char *, char *);
101 extern int smb_netbios_start(void);
102 extern void smb_netbios_shutdown(void);
103 extern void smb_netbios_name_reconfig(void);
104 
105 /* Browser Functions */
106 extern void smb_browser_reconfig(void);
107 extern void smb_browser_netlogon(char *);
108 
109 
110 #ifdef	__cplusplus
111 }
112 #endif
113 
114 #endif	/* _LIBSMBNS_H */
115