summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-06-04 07:59:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:25 -0500
commit5c3f152d08ccc43a16ebfd6072551256249f4526 (patch)
tree61c2bfa80b44233bfd64c567aedcd2baa7838c1d
parent8f84a98e299e63b7fb7fdd797e8e7969b68a106f (diff)
downloadsamba-5c3f152d08ccc43a16ebfd6072551256249f4526.tar.gz
samba-5c3f152d08ccc43a16ebfd6072551256249f4526.tar.bz2
samba-5c3f152d08ccc43a16ebfd6072551256249f4526.zip
r1002: Add helper files for eparser output.
(This used to be commit 595b6e0f2c9832b3e4a8eaa24d64f32d6a693ff3)
-rw-r--r--source4/build/pidl/packet-dcerpc-eparser.c67
-rw-r--r--source4/build/pidl/packet-dcerpc-eparser.h23
2 files changed, 90 insertions, 0 deletions
diff --git a/source4/build/pidl/packet-dcerpc-eparser.c b/source4/build/pidl/packet-dcerpc-eparser.c
new file mode 100644
index 0000000000..bafdf34006
--- /dev/null
+++ b/source4/build/pidl/packet-dcerpc-eparser.c
@@ -0,0 +1,67 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "packet-dcerpc.h"
+#include "packet-dcerpc-nt.h"
+#include "packet-dcerpc-eparser.h"
+
+/* Create a ndr_pull structure from data stored in a tvb at a given offset. */
+
+struct e_ndr_pull *ndr_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
+ proto_tree *tree, guint8 *drep)
+{
+ struct e_ndr_pull *ndr;
+
+ ndr = (struct e_ndr_pull *)g_malloc(sizeof(*ndr));
+
+ ndr->tvb = tvb;
+ ndr->offset = offset;
+ ndr->pinfo = pinfo;
+ ndr->tree = tree;
+ ndr->drep = drep;
+
+ return ndr;
+}
+
+/* Dispose of a dynamically allocated ndr_pull structure */
+
+void ndr_pull_free(struct e_ndr_pull *ndr)
+{
+ g_free(ndr);
+}
+
+void ndr_pull_ptr(struct e_ndr_pull *e_ndr, int hf, guint32 *ptr)
+{
+ e_ndr->offset = dissect_ndr_uint32(
+ e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
+ e_ndr->tree, e_ndr->drep, hf, ptr);
+}
+
+void ndr_pull_NTSTATUS(struct e_ndr_pull *e_ndr, int hf)
+{
+ e_ndr->offset = dissect_ntstatus(
+ e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
+ e_ndr->tree, e_ndr->drep, hf, NULL);
+}
+
+void ndr_pull_uint16(struct e_ndr_pull *e_ndr, int hf)
+{
+ e_ndr->offset = dissect_ndr_uint16(
+ e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
+ e_ndr->tree, e_ndr->drep, hf, NULL);
+}
+
+void ndr_pull_uint32(struct e_ndr_pull *e_ndr, int hf)
+{
+ e_ndr->offset = dissect_ndr_uint32(
+ e_ndr->tvb, e_ndr->offset, e_ndr->pinfo,
+ e_ndr->tree, e_ndr->drep, hf, NULL);
+}
+
+void ndr_pull_policy_handle(struct e_ndr_pull *e_ndr, int hf)
+{
+ e_ndr->offset = dissect_nt_policy_hnd(
+ e_ndr->tvb, e_ndr->offset, e_ndr->pinfo, e_ndr->tree,
+ e_ndr->drep, hf, NULL, NULL, 0, 0);
+}
diff --git a/source4/build/pidl/packet-dcerpc-eparser.h b/source4/build/pidl/packet-dcerpc-eparser.h
new file mode 100644
index 0000000000..0d181c9c8a
--- /dev/null
+++ b/source4/build/pidl/packet-dcerpc-eparser.h
@@ -0,0 +1,23 @@
+#define NDR_SCALARS 1
+#define NDR_BUFFERS 2
+
+/* Ethereal version of struct ndr_pull */
+
+struct e_ndr_pull {
+ tvbuff_t *tvb;
+ int offset;
+ packet_info *pinfo;
+ proto_tree *tree;
+ guint8 *drep;
+};
+
+/* Create a ndr_pull structure from data stored in a tvb at a given offset. */
+
+struct e_ndr_pull *ndr_pull_init(tvbuff_t *tvb, int offset, packet_info *pinfo,
+ proto_tree *tree, guint8 *drep);
+void ndr_pull_free(struct e_ndr_pull *ndr);
+void ndr_pull_ptr(struct e_ndr_pull *ndr, int hf, guint32 *ptr);
+void ndr_pull_NTSTATUS(struct e_ndr_pull *ndr, int hf);
+void ndr_pull_uint16(struct e_ndr_pull *ndr, int hf);
+void ndr_pull_uint32(struct e_ndr_pull *ndr, int hf);
+void ndr_pull_policy_handle(struct e_ndr_pull *e_ndr, int hf);