svn commit: lorikeet r189 - in trunk/ethereal/plugins/pidl: .
tpot at samba.org
tpot at samba.org
Wed Jan 19 06:05:26 GMT 2005
Author: tpot
Date: 2005-01-19 06:05:25 +0000 (Wed, 19 Jan 2005)
New Revision: 189
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=189
Log:
Add parsers for WERROR and arrays of uint16's.
Modified:
trunk/ethereal/plugins/pidl/eparser.c
trunk/ethereal/plugins/pidl/eparser.h
Changeset:
Modified: trunk/ethereal/plugins/pidl/eparser.c
===================================================================
--- trunk/ethereal/plugins/pidl/eparser.c 2005-01-18 06:54:15 UTC (rev 188)
+++ trunk/ethereal/plugins/pidl/eparser.c 2005-01-19 06:05:25 UTC (rev 189)
@@ -159,6 +159,16 @@
return NT_STATUS_OK;
}
+NTSTATUS ndr_pull_WERROR(struct pidl_pull *ndr, pidl_tree *tree, int hf,
+ WERROR *data)
+{
+ ndr->offset = dissect_doserror(
+ ndr->tvb, ndr->offset, ndr->pinfo, tree->proto_tree,
+ ndr->drep, hf, data);
+
+ return NT_STATUS_OK;
+}
+
NTSTATUS ndr_pull_HYPER_T(struct pidl_pull *ndr, pidl_tree *tree, int hf,
HYPER_T *data)
{
@@ -472,8 +482,6 @@
pidl_tree *tree, int hf, uint8_t *data,
uint32_t n)
{
- uint32_t i;
-
if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
@@ -491,7 +499,6 @@
uint32_t n)
{
int len = n * sizeof(uint32_t);
- uint32_t i;
if (!(ndr_flags & NDR_SCALARS))
return NT_STATUS_OK;
@@ -507,6 +514,26 @@
return NT_STATUS_OK;
}
+NTSTATUS ndr_pull_array_uint16(struct pidl_pull *ndr, int ndr_flags,
+ pidl_tree *tree, int hf, uint16_t *data,
+ uint32_t n)
+{
+ int len = n * sizeof(uint16_t);
+
+ if (!(ndr_flags & NDR_SCALARS))
+ return NT_STATUS_OK;
+
+ ndr_pull_align(ndr, sizeof(uint16_t));
+
+ proto_tree_add_bytes(
+ tree->proto_tree, hf, ndr->tvb, ndr->offset, len,
+ tvb_get_ptr(ndr->tvb, ndr->offset, len));
+
+ ndr->offset += len;
+
+ return NT_STATUS_OK;
+}
+
NTSTATUS ndr_pull_struct_start(struct pidl_pull *ndr)
{
return NT_STATUS_OK;
@@ -516,8 +543,8 @@
{
}
-NTSTATUS ndr_pull_error(struct pidl_pull *ndr,
- enum ndr_err_code err, const char *format, ...)
+NTSTATUS ndr_pull_error(struct pidl_pull *ndr, enum ndr_err_code err,
+ const char *format, ...)
{
return NT_STATUS_OK;
}
Modified: trunk/ethereal/plugins/pidl/eparser.h
===================================================================
--- trunk/ethereal/plugins/pidl/eparser.h 2005-01-18 06:54:15 UTC (rev 188)
+++ trunk/ethereal/plugins/pidl/eparser.h 2005-01-19 06:05:25 UTC (rev 189)
@@ -34,6 +34,7 @@
// Some miscellaneous glue to include libndr.h
typedef uint32_t NTSTATUS;
+typedef uint32_t WERROR;
typedef uint64_t NTTIME;
typedef uint64_t NTTIME_hyper;
typedef uint64_t HYPER_T;
@@ -44,6 +45,7 @@
#define NT_STATUS_NO_MEMORY 0xC0000017
#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED 0xC000008c
#define NT_STATUS_INVALID_PARAMETER 0xC0000057
+#define NT_STATUS_INVALID_PARAMETER_MIX 0xC0000030
#define NT_STATUS_IS_OK(x) ((x) == NT_STATUS_OK)
@@ -121,6 +123,7 @@
enum ndr_err_code err, const char *format, ...);
NTSTATUS ndr_pull_string(struct pidl_pull *ndr, int ndr_flags, pidl_tree *tree, const char **s);
NTSTATUS ndr_pull_NTSTATUS(struct pidl_pull *ndr, pidl_tree *tree, int hf, NTSTATUS *status);
+NTSTATUS ndr_pull_WERROR(struct pidl_pull *ndr, pidl_tree *tree, int hf, NTSTATUS *status);
NTSTATUS ndr_pull_array_size(struct pidl_pull *ndr, pidl_tree *tree, const void *p);
uint32_t ndr_get_array_size(struct pidl_pull *ndr, const void *p);
NTSTATUS ndr_pull_array(struct pidl_pull *ndr, int ndr_flags,
@@ -130,6 +133,7 @@
pidl_tree *tree, void *));
NTSTATUS ndr_check_array_size(struct pidl_pull *ndr, void *p, uint32_t size);
NTSTATUS ndr_pull_array_uint8(struct pidl_pull *ndr, int ndr_flags, pidl_tree *tree, int hf, uint8_t *data, uint32_t n);
+NTSTATUS ndr_pull_array_uint16(struct pidl_pull *ndr, int ndr_flags, pidl_tree *tree, int hf, uint16_t *data, uint32_t n);
NTSTATUS ndr_pull_array_uint32(struct pidl_pull *ndr, int ndr_flags, pidl_tree *tree, int hf, uint32_t *data, uint32_t n);
NTSTATUS ndr_pull_time_t(struct pidl_pull *ndr, pidl_tree *tree, int hf,
time_t *data);
More information about the samba-cvs
mailing list