Regenerate SWIG file.
[nivanova/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(docstring="Python bindings for miscellaneous Samba functions.",package="samba.misc") misc
20
21 %{
22 #include "includes.h"
23 #include "ldb.h"
24 #include "param/param.h"
25 #include "auth/credentials/credentials.h"
26 #include "dsdb/samdb/samdb.h"
27 #include "lib/ldb-samba/ldif_handlers.h"
28 #include "librpc/ndr/libndr.h"
29 #include "version.h"
30 %}
31
32 %import "stdint.i"
33 %include "exception.i"
34 %import "../../lib/talloc/talloc.i"
35 %import "../../lib/ldb/ldb.i"
36 %import "../../auth/credentials/credentials.i"
37 %import "../../param/param.i"
38 %import "../../libcli/security/security.i"
39 %include "../../libcli/util/errors.i"
40
41 %feature("docstring") generate_random_str "S.random_password(len) -> string\n" \
42                                           "Generate random password with specified length.";
43
44 %rename(random_password) generate_random_str;
45 char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len);
46
47 %feature("docstring") ldb_set_credentials "S.set_credentials(credentials)\n"
48                                           "Set credentials to use when connecting.";
49
50 %feature("docstring") ldb_set_session_info "S.set_session_info(session_info)\n"
51                                           "Set session info to use when connecting.";
52
53 %feature("docstring") ldb_set_loadparm "S.set_loadparm(session_info)\n"
54                                           "Set loadparm context to use when connecting.";
55
56 %inline %{
57 void ldb_set_credentials(struct ldb_context *ldb, struct cli_credentials *creds)
58 {
59     ldb_set_opaque(ldb, "credentials", creds);
60 }
61
62 void ldb_set_session_info(struct ldb_context *ldb, struct auth_session_info *session_info)
63 {
64     ldb_set_opaque(ldb, "sessionInfo", session_info);
65 }
66
67 void ldb_set_loadparm(struct ldb_context *ldb, struct loadparm_context *lp_ctx)
68 {
69     ldb_set_opaque(ldb, "loadparm", lp_ctx);
70 }
71
72 %}
73
74 %feature("docstring") samdb_set_domain_sid "S.set_domain_sid(sid)\n"
75                                           "Set SID of domain to use.";
76 bool samdb_set_domain_sid(struct ldb_context *ldb, 
77                           const struct dom_sid *dom_sid_in);
78
79 WERROR dsdb_attach_schema_from_ldif_file(struct ldb_context *ldb, const char *pf, const char *df);
80
81 %feature("docstring") version "version()\n"
82                               "Obtain the Samba version.";
83
84 %inline {
85 const char *version(void) 
86
87     return SAMBA_VERSION_STRING; 
88 }
89 }
90 int dsdb_set_global_schema(struct ldb_context *ldb);
91 %feature("docstring") ldb_register_samba_handlers "register_samba_handlers()\n"
92                                           "Register Samba-specific LDB modules and schemas.";
93 int ldb_register_samba_handlers(struct ldb_context *ldb);
94
95 %inline %{
96 bool dsdb_set_ntds_invocation_id(struct ldb_context *ldb, const char *guid)
97 {
98     struct GUID invocation_id_in;
99     if (NT_STATUS_IS_ERR(GUID_from_string(guid, &invocation_id_in))) {
100         return false;
101     }
102     return samdb_set_ntds_invocation_id(ldb, &invocation_id_in);
103 }
104 %}
105
106 char *private_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
107                const char *name);
108