2 OpenChange Exchange Administration library.
4 Copyright (C) Julien Kerihuel 2007.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __LIBMAPIADMIN_H__
21 #define __LIBMAPIADMIN_H__
27 #include <sys/types.h>
42 /* OpenChange includes */
43 #include <libmapi/libmapi.h>
44 #include <libmapiadmin/proto.h>
46 #undef _PRINTF_ATTRIBUTE
47 #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2)
51 #define __BEGIN_DECLS extern "C" {
60 #define MAX(p,q) (((p) >= (q)) ? (p) : (q))
65 Structures for MAPI admin functions
69 struct dcerpc_pipe
*p
;
70 struct policy_handle user_handle
;
71 struct libnet_JoinDomain
*libnet_r
;
72 struct dom_sid
*dom_sid
;
73 const char *dom_netbios_name
;
74 const char *dom_dns_name
;
75 struct dom_sid
*user_sid
;
76 struct GUID user_guid
;
77 const char *netbios_name
;
81 MAPI admin function context
85 struct mapi_session
*session
;
89 const char *description
;
91 struct test_join
*user_ctx
;
93 const char *dc_binding
;
94 struct policy_handle
*handle
;
98 * prototypes from Samba4
102 struct ldb_dn
*samdb_search_dn(struct ldb_context
*, TALLOC_CTX
*, struct ldb_dn
*, const char *, ...) _PRINTF_ATTRIBUTE(4,5);
103 int samdb_msg_add_string(struct ldb_context
*, TALLOC_CTX
*,
104 struct ldb_message
*, const char *, const char *);
105 int samdb_replace(struct ldb_context
*, TALLOC_CTX
*, struct ldb_message
*);
106 struct dom_sid
*dom_sid_add_rid(TALLOC_CTX
*, const struct dom_sid
*, uint32_t);
107 bool encode_pw_buffer(uint8_t buffer
[516], const char *, int);
108 void arcfour_crypt_blob(uint8_t *, int, const DATA_BLOB
*);
111 #define DEFAULT_PROFDB_PATH "%s/.openchange/profiles.ldb"
112 #define MAPIADMIN_DEBUG_STR "[%s:%d]: %s %s\n", __FUNCTION__, __LINE__
114 #endif /* __LIBMAPIADMIN_H__ */