Daily ChangeLog Update
[OpenChange-git-clone.git] / libmapiadmin / libmapiadmin.h
blob0fdf95c3937dd24b156648bb97c028eea12d3226
1 /*
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__
23 #define _GNU_SOURCE 1
25 struct mapiadmin_ctx;
27 #include <sys/types.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <stdbool.h>
32 #include <unistd.h>
33 #include <errno.h>
34 #include <string.h>
36 /* Samba4 includes */
37 #include <stdint.h>
38 #include <talloc.h>
39 #include <ldb.h>
40 #include <tevent.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)
49 #ifndef __BEGIN_DECLS
50 #ifdef __cplusplus
51 #define __BEGIN_DECLS extern "C" {
52 #define __END_DECLS }
53 #else
54 #define __BEGIN_DECLS
55 #define __END_DECLS
56 #endif
57 #endif
59 #ifndef MAX
60 #define MAX(p,q) (((p) >= (q)) ? (p) : (q))
61 #endif
63 /**
64 \file
65 Structures for MAPI admin functions
68 struct test_join {
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;
80 /**
81 MAPI admin function context
83 struct mapiadmin_ctx
85 struct mapi_session *session;
86 const char *username;
87 const char *password;
88 const char *fullname;
89 const char *description;
90 const char *comment;
91 struct test_join *user_ctx;
92 const char *binding;
93 const char *dc_binding;
94 struct policy_handle *handle;
98 * prototypes from Samba4
101 __BEGIN_DECLS
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 *);
109 __END_DECLS
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__ */