svn commit: lorikeet r192 - in trunk/ethereal/plugins/pidl: .

tpot at samba.org tpot at samba.org
Wed Jan 19 10:18:44 GMT 2005


Author: tpot
Date: 2005-01-19 10:18:44 +0000 (Wed, 19 Jan 2005)
New Revision: 192

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=192

Log:
Handle DATA_BLOB's and NTTIME_1sec'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-19 06:28:34 UTC (rev 191)
+++ trunk/ethereal/plugins/pidl/eparser.c	2005-01-19 10:18:44 UTC (rev 192)
@@ -133,6 +133,12 @@
 	return NT_STATUS_OK;
 }
 
+NTSTATUS ndr_pull_NTTIME_1sec(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+			 NTTIME *data)
+{
+	return ndr_pull_NTTIME(ndr, tree, hf, data);
+}
+
 NTSTATUS ndr_pull_NTTIME_hyper(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
 			       NTTIME *data)
 {
@@ -835,6 +841,24 @@
 	return ndr_token_store(ndr, &ndr->array_length_list, p, length);
 }
 
+NTSTATUS ndr_pull_DATA_BLOB(struct pidl_pull *ndr, pidl_tree *tree, int hf, 
+			    DATA_BLOB *data)
+{
+	data->length = (ndr->drep[0] & 0x10)
+		? tvb_get_letohl(ndr->tvb, ndr->offset)
+		: tvb_get_ntohl(ndr->tvb, ndr->offset);
+
+	ndr->offset += sizeof(guint32);
+
+	if (data->length) {
+		data->data = tvb_get_ptr(ndr->tvb, ndr->offset, data->length);
+		ndr->offset += data->length;
+	} else
+		data->data = NULL;
+
+	return NT_STATUS_OK;
+}
+
 gint hf_conformant_size = -1;
 
 void proto_register_eparser(void)

Modified: trunk/ethereal/plugins/pidl/eparser.h
===================================================================
--- trunk/ethereal/plugins/pidl/eparser.h	2005-01-19 06:28:34 UTC (rev 191)
+++ trunk/ethereal/plugins/pidl/eparser.h	2005-01-19 10:18:44 UTC (rev 192)
@@ -37,8 +37,15 @@
 typedef uint32_t WERROR;
 typedef uint64_t NTTIME;
 typedef uint64_t NTTIME_hyper;
+typedef uint64_t NTTIME_1sec;
 typedef uint64_t HYPER_T;
 
+typedef struct data_blob
+{
+	uint8_t *data;
+	size_t length;
+} DATA_BLOB;
+
 #define NT_STATUS_OK                    0x00000000
 #define NT_STATUS_BUFFER_TOO_SMALL      0xC0000023
 #define NT_STATUS_INTERNAL_ERROR        0xC00000e5
@@ -115,6 +122,7 @@
 NTSTATUS ndr_pull_int32(struct pidl_pull *ndr, pidl_tree *tree, int hf, int32_t *v);
 NTSTATUS ndr_pull_int64(struct pidl_pull *ndr, pidl_tree *tree, int hf, int64_t *v);
 NTSTATUS ndr_pull_NTTIME(struct pidl_pull *ndr, pidl_tree *tree, int hf, NTTIME *data);
+NTSTATUS ndr_pull_NTTIME_1sec(struct pidl_pull *ndr, pidl_tree *tree, int hf, NTTIME *data);
 NTSTATUS ndr_pull_NTTIME_hyper(struct pidl_pull *ndr, pidl_tree *tree, int hf, NTTIME *data);
 NTSTATUS ndr_pull_HYPER_T(struct pidl_pull *ndr, pidl_tree *tree, int hf, HYPER_T *data);
 void ndr_set_flags(uint32_t *pflags, uint32_t new_flags);
@@ -151,6 +159,8 @@
 uint32_t ndr_get_array_length(struct pidl_pull *ndr, const void *p);
 NTSTATUS ndr_pull_array_length(struct pidl_pull *ndr, pidl_tree *tree, const void *p);
 
+NTSTATUS ndr_pull_DATA_BLOB(struct pidl_pull *ndr, pidl_tree *tree, int hf, DATA_BLOB *data);
+
 // Just about everything uses stuff from misc.idl
 
 #include "packet-dcerpc-misc.h"



More information about the samba-cvs mailing list