summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-27 14:54:29 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-03-28 08:34:25 +0100
commitae02bf6f068d49478f159be726e628fa6287907a (patch)
tree18d55ab29fa6477c5085a350e26adbc644cd2222 /source4
parent4f0d5981f1fa7f53a3ea0d1a746584a4bf2f08da (diff)
downloadsamba-ae02bf6f068d49478f159be726e628fa6287907a.tar.gz
samba-ae02bf6f068d49478f159be726e628fa6287907a.tar.xz
samba-ae02bf6f068d49478f159be726e628fa6287907a.zip
s4:pyrpc: add py_dcerpc_syntax_init_helper()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/rpc/pyrpc_util.c22
-rw-r--r--source4/librpc/rpc/pyrpc_util.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/source4/librpc/rpc/pyrpc_util.c b/source4/librpc/rpc/pyrpc_util.c
index cec8574319e..314ad2cc8d7 100644
--- a/source4/librpc/rpc/pyrpc_util.c
+++ b/source4/librpc/rpc/pyrpc_util.c
@@ -304,6 +304,28 @@ bool PyInterface_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpc
return true;
}
+PyObject *py_dcerpc_syntax_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs,
+ const struct ndr_syntax_id *syntax)
+{
+ PyObject *ret;
+ struct ndr_syntax_id *obj;
+ const char *kwnames[] = { NULL };
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ":abstract_syntax", discard_const_p(char *, kwnames))) {
+ return NULL;
+ }
+
+ ret = pytalloc_new(struct ndr_syntax_id, type);
+ if (ret == NULL) {
+ return NULL;
+ }
+
+ obj = (struct ndr_syntax_id *)pytalloc_get_ptr(ret);
+ *obj = *syntax;
+
+ return ret;
+}
+
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status)
{
if (p && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
diff --git a/source4/librpc/rpc/pyrpc_util.h b/source4/librpc/rpc/pyrpc_util.h
index 837a33be169..21454cae15b 100644
--- a/source4/librpc/rpc/pyrpc_util.h
+++ b/source4/librpc/rpc/pyrpc_util.h
@@ -50,6 +50,10 @@ bool py_check_dcerpc_type(PyObject *obj, const char *module, const char *type_na
bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds);
PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table);
+struct ndr_syntax_id;
+PyObject *py_dcerpc_syntax_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs,
+ const struct ndr_syntax_id *syntax);
+
PyObject *py_return_ndr_struct(const char *module_name, const char *type_name,
TALLOC_CTX *r_ctx, void *r);