#include "dsdb/samdb/samdb.h"
#include "lib/ldb-samba/ldif_handlers.h"
#include "librpc/ndr/libndr.h"
+ #include "version.h"
%}
%import "stdint.i"
WERROR dsdb_attach_schema_from_ldif_file(struct ldb_context *ldb, const char *pf, const char *df);
- %feature("docstring") samba_version_string "version()\n"
- "Obtain the Samba version.";
- %rename(version) samba_version_string;
- const char *samba_version_string(void);
+ %feature("docstring") version "version()\n"
+ "Obtain the Samba version.";
+
+ %inline {
+ const char *version(void)
+ {
+ return SAMBA_VERSION_STRING;
+ }
+ }
int dsdb_set_global_schema(struct ldb_context *ldb);
%feature("docstring") ldb_register_samba_handlers "register_samba_handlers()\n"
"Register Samba-specific LDB modules and schemas.";
char *private_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx,
const char *name);
+typedef unsigned long time_t;
+
+/*
+ convert from unix time to NT time
+*/
+%inline %{
+uint64_t unix2nttime(time_t t)
+{
+ NTTIME nt;
+ unix_to_nt_time(&nt, t);
+ return (uint64_t)nt;
+}
+%}
#include "dsdb/samdb/samdb.h"
#include "lib/ldb-samba/ldif_handlers.h"
#include "librpc/ndr/libndr.h"
+ #include "version.h"
#include "libcli/util/pyerrors.h"
+ const char *version(void)
+ {
+ return SAMBA_VERSION_STRING;
+ }
+
+
#define SWIG_From_long PyInt_FromLong
return samdb_set_ntds_invocation_id(ldb, &invocation_id_in);
}
+
+uint64_t unix2nttime(time_t t)
+{
+ NTTIME nt;
+ unix_to_nt_time(&nt, t);
+ return (uint64_t)nt;
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+# define LLONG_MAX __LONG_LONG_MAX__
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERNINLINE PyObject*
+SWIG_From_long_SS_long (long long value)
+{
+ return ((value < LONG_MIN) || (value > LONG_MAX)) ?
+ PyLong_FromLongLong(value) : PyInt_FromLong((long)(value));
+}
+
+
+SWIGINTERNINLINE PyObject*
+SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
+{
+ return (value > LONG_MAX) ?
+ PyLong_FromUnsignedLongLong(value) : PyInt_FromLong((long)(value));
+}
+
#ifdef __cplusplus
extern "C" {
#endif
char *result = 0 ;
if (!SWIG_Python_UnpackTuple(args,"version",0,0,0)) SWIG_fail;
- result = (char *)samba_version_string();
+ result = (char *)version();
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
}
+SWIGINTERN PyObject *_wrap_unix2nttime(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
+ PyObject *resultobj = 0;
+ time_t arg1 ;
+ unsigned long val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ char * kwnames[] = {
+ (char *) "t", NULL
+ };
+ uint64_t result;
+
+ if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:unix2nttime",kwnames,&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "unix2nttime" "', argument " "1"" of type '" "time_t""'");
+ }
+ arg1 = (time_t)(val1);
+ result = (uint64_t)unix2nttime(arg1);
+ resultobj = SWIG_From_unsigned_SS_long_SS_long((unsigned long long)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
static PyMethodDef SwigMethods[] = {
{ (char *)"random_password", (PyCFunction) _wrap_random_password, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
"S.random_password(len) -> string\n"
""},
{ (char *)"dsdb_set_ntds_invocation_id", (PyCFunction) _wrap_dsdb_set_ntds_invocation_id, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"private_path", (PyCFunction) _wrap_private_path, METH_VARARGS | METH_KEYWORDS, NULL},
+ { (char *)"unix2nttime", (PyCFunction) _wrap_unix2nttime, METH_VARARGS | METH_KEYWORDS, NULL},
{ NULL, NULL, 0, NULL }
};