svn commit: samba r2167 - in branches/SAMBA_4_0/source/build/pidl: .

tpot at samba.org tpot at samba.org
Wed Sep 1 09:16:40 GMT 2004


Author: tpot
Date: 2004-09-01 09:16:39 +0000 (Wed, 01 Sep 2004)
New Revision: 2167

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/build/pidl&rev=2167&nolog=1

Log:
Implement some stubbed out functions.

Modified:
   branches/SAMBA_4_0/source/build/pidl/eparser.c


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/eparser.c
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/eparser.c	2004-09-01 07:29:02 UTC (rev 2166)
+++ branches/SAMBA_4_0/source/build/pidl/eparser.c	2004-09-01 09:16:39 UTC (rev 2167)
@@ -41,9 +41,7 @@
 
 void ndr_pull_align(struct ndr_pull *ndr, int size)
 {
-       	if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) {
-		ndr->offset = (ndr->offset + (size-1)) & ~(size-1);
-	}
+	ndr->offset = (ndr->offset + (size-1)) & ~(size-1);
 }
 
 void ndr_pull_ptr(struct ndr_pull *ndr, proto_tree *tree, int hf, guint32 *ptr)
@@ -86,50 +84,14 @@
 
 		ndr->offset += len2 * 2;
 
-#if 0
-
-		ndr_pull_uint32(ndr, &len1));
-		ndr_pull_uint32(ndr, &ofs);
-		ndr_pull_uint32(ndr, &len2);
-		if (len2 > len1) {
-			return ndr_pull_error(ndr, NDR_ERR_STRING, 
-					      "Bad string lengths len1=%u ofs=%u len2=%u\n", 
-					      len1, ofs, len2);
-		}
-		if (len2 == 0) {
-			*s = talloc_strdup(ndr->mem_ctx, "");
-			break;
-		}
-		NDR_PULL_NEED_BYTES(ndr, len2*2);
-		ret = convert_string_talloc(ndr->mem_ctx, chset, CH_UNIX, 
-					    ndr->data+ndr->offset, 
-					    len2*2,
-					    (const void **)&as);
-		if (ret == -1) {
-			return ndr_pull_error(ndr, NDR_ERR_CHARCNV, 
-					      "Bad character conversion");
-		}
-		ndr_pull_advance(ndr, len2*2);
-
-		/* this is a way of detecting if a string is sent with the wrong
-		   termination */
-		if (ndr->flags & LIBNDR_FLAG_STR_NOTERM) {
-			if (strlen(as) < len2) {
-				DEBUG(6,("short string '%s'\n", as));
-			}
-		} else {
-			if (strlen(as) == len2) {
-				DEBUG(6,("long string '%s'\n", as));
-			}
-		}
-		*s = as;
-
-#endif
-
 		break;
 
 	case LIBNDR_FLAG_STR_SIZE4:
 
+		g_warning("%d: unimplemented string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+		
 #if 0
 
 		ndr_pull_uint32(ndr, &len1);
@@ -155,6 +117,10 @@
 
 	case LIBNDR_FLAG_STR_NULLTERM:
 
+		g_warning("%d: unimplemented string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+
 #if 0
 
 		len1 = strnlen_w(ndr->data+ndr->offset, 
@@ -179,27 +145,32 @@
 	case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_SIZE4:
 	case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_NOTERM:
 
-#if 0
+		ndr_pull_uint32(ndr, tree, hf_string4_len, &len1);
+		ndr_pull_uint32(ndr, tree, hf_string4_offset, &ofs);
+		ndr_pull_uint32(ndr, tree, hf_string4_len2, &len2);
 
-		ndr_pull_uint32(ndr, &len1);
-		ndr_pull_uint32(ndr, &ofs);
-		ndr_pull_uint32(ndr, &len2);
-		if (len2 > len1) {
-			return ndr_pull_error(ndr, NDR_ERR_STRING, 
-					      "Bad ascii string lengths len1=%u ofs=%u len2=%u\n", 
-					      len1, ofs, len2);
-		}
-		NDR_ALLOC_N(ndr, as, (len2+1));
-		ndr_pull_bytes(ndr, as, len2);
-		as[len2] = 0;
-		(*s) = as;
+		g_warning("%d: len = %d", ndr->pinfo->fd->num, len1);
+		g_warning("%d: offset = %d", ndr->pinfo->fd->num, ofs);
+		g_warning("%d: len2 = %d", ndr->pinfo->fd->num, len2);
 
-#endif
+		ndr->offset += len2;
+		break;
 
+		data = g_malloc(len2 + 1);
+
+		proto_tree_add_bytes(tree, hf_string_data, ndr->tvb,
+				     ndr->offset, len2, data);
+
+		g_free(data);
+
 		break;
 
 	case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4:
 
+		g_warning("%d: unimplemented string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+
 #if 0
 		ndr_pull_uint32(ndr, &ofs);
 		ndr_pull_uint32(ndr, &len2);
@@ -214,6 +185,10 @@
 
 	case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_SIZE2:
 
+		g_warning("%d: unimplemented string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+
 #if 0
 
 		ndr_pull_uint16(ndr, &len3);
@@ -228,6 +203,10 @@
 
 	case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM:
 
+		g_warning("%d: unimplemented string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+
 #if 0
 
 		len1 = strnlen(ndr->data+ndr->offset, (ndr->data_size - ndr->offset));
@@ -245,6 +224,10 @@
 
 	default:
 
+		g_warning("%d: bad string flags 0x%x",
+			  ndr->pinfo->fd->num, 
+			  ndr->flags & LIBNDR_STRING_FLAGS);
+
 #if 0
 
 		return ndr_pull_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x\n",
@@ -422,7 +405,9 @@
 
 void ndr_pull_NTTIME(struct ndr_pull *ndr, proto_tree *tree, int hf, NTTIME *data)
 {
-	g_warning("%d: ndr_pull_NTTIME() not implemented", ndr->pinfo->fd->num);
+	ndr->offset = dissect_ndr_uint64(
+		ndr->tvb, ndr->offset, ndr->pinfo,
+		tree, ndr->drep, hf, data);	
 }
 
 void ndr_pull_NTSTATUS(struct ndr_pull *ndr, proto_tree *tree, int hf, NTSTATUS *data)
@@ -434,7 +419,9 @@
 
 void ndr_pull_HYPER_T(struct ndr_pull *ndr, proto_tree *tree, int hf, HYPER_T *data)
 {
-	g_warning("%d: ndr_pull_HYPER_T() not implemented", ndr->pinfo->fd->num);
+	ndr->offset = dissect_ndr_uint64(
+		ndr->tvb, ndr->offset, ndr->pinfo,
+		tree, ndr->drep, hf, data);	
 }
 
 static int hf_num_auths = -1;



More information about the samba-cvs mailing list