a0519644b88794388084ed7001de5b0be28a97a5
[gd/samba-autobuild/.git] / source4 / scripting / python / misc.i
1 /* 
2    Unix SMB/CIFS implementation.
3    Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
4    
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9    
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14    
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 %module(package="samba.misc") misc
20
21 %{
22 #include "includes.h"
23 #include "ldb.h"
24 #include "param/param.h"
25 #include "dsdb/samdb/samdb.h"
26 %}
27
28 %import "stdint.i"
29 %include "exception.i"
30 %import "../../lib/talloc/talloc.i"
31 %import "../../lib/ldb/ldb.i"
32 %import "../../auth/credentials/credentials.i"
33 %import "../../param/param.i"
34 %import "../../libcli/security/security.i"
35 %import "../../libcli/util/errors.i"
36
37 %rename(random_password) generate_random_str;
38 char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len);
39
40 %inline %{
41 void ldb_set_credentials(struct ldb_context *ldb, struct cli_credentials *creds)
42 {
43     ldb_set_opaque(ldb, "credentials", creds);
44 }
45
46 void ldb_set_session_info(struct ldb_context *ldb, struct auth_session_info *session_info)
47 {
48     ldb_set_opaque(ldb, "sessionInfo", session_info);
49 }
50
51 void ldb_set_loadparm(struct ldb_context *ldb, struct loadparm_context *lp_ctx)
52 {
53     ldb_set_opaque(ldb, "loadparm", lp_ctx);
54 }
55
56 %}
57
58 bool samdb_set_domain_sid(struct ldb_context *ldb, 
59                           const struct dom_sid *dom_sid_in);
60
61 WERROR dsdb_attach_schema_from_ldif_file(struct ldb_context *ldb, const char *pf, const char *df);
62
63 %rename(version) samba_version_string;
64 const char *samba_version_string(void);