summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/libndr.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-21 13:14:17 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-21 13:14:17 +0000
commita465add90f3291f022104600c6221e8d90287e64 (patch)
tree155a7f43e7a50027be5d9144755bf134ee585810 /source4/librpc/ndr/libndr.h
parent82d6f5587b6052a226f90a82314573fb348fb0ce (diff)
downloadsamba-a465add90f3291f022104600c6221e8d90287e64.tar.gz
samba-a465add90f3291f022104600c6221e8d90287e64.tar.bz2
samba-a465add90f3291f022104600c6221e8d90287e64.zip
* changed the way strings are handled in pidl to a much more general
interface. We now support an arbitrary set of flags to each parser, and these can be used to control the string types. I have provided some common IDL string types in librpc/idl/idl_types.h which needs to be included in every IDL file. * added IDL for the endpoint mapper. Added a test suite that enumerates all endpoints on the server. (This used to be commit d2665f36a75b482ff82733f72ffac938c2acf87a)
Diffstat (limited to 'source4/librpc/ndr/libndr.h')
-rw-r--r--source4/librpc/ndr/libndr.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 7876d3cc1c..5c771ff2d2 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -91,8 +91,15 @@ struct ndr_print {
void *private;
};
-#define LIBNDR_FLAG_BIGENDIAN 1
+#define LIBNDR_FLAG_BIGENDIAN (1<<0)
+#define LIBNDR_FLAG_NOALIGN (1<<1)
+#define LIBNDR_FLAG_STR_ASCII (1<<2)
+#define LIBNDR_FLAG_STR_LEN4 (1<<3)
+#define LIBNDR_FLAG_STR_SIZE4 (1<<4)
+#define LIBNDR_FLAG_STR_NOTERM (1<<5)
+#define LIBNDR_FLAG_STR_NULLTERM (1<<6)
+#define LIBNDR_STRING_FLAGS (0x7C)
/* useful macro for debugging */
#define NDR_PRINT_DEBUG(type, p) ndr_print_debug((ndr_print_fn_t)ndr_print_ ##type, #p, p)
@@ -110,7 +117,9 @@ enum ndr_err_code {
NDR_ERR_OFFSET,
NDR_ERR_RELATIVE,
NDR_ERR_CHARCNV,
- NDR_ERR_LENGTH
+ NDR_ERR_LENGTH,
+ NDR_ERR_SUBCONTEXT,
+ NDR_ERR_STRING
};
/*
@@ -133,7 +142,9 @@ enum ndr_err_code {
} while(0)
#define NDR_PULL_ALIGN(ndr, n) do { \
- ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \
+ if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
+ ndr->offset = (ndr->offset + (n-1)) & ~(n-1); \
+ } \
if (ndr->offset >= ndr->data_size) { \
return NT_STATUS_BUFFER_TOO_SMALL; \
} \
@@ -142,8 +153,10 @@ enum ndr_err_code {
#define NDR_PUSH_NEED_BYTES(ndr, n) NDR_CHECK(ndr_push_expand(ndr, ndr->offset+(n)))
#define NDR_PUSH_ALIGN(ndr, n) do { \
- uint32 _pad = (ndr->offset & (n-1)); \
- while (_pad--) NDR_CHECK(ndr_push_uint8(ndr, 0)); \
+ if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
+ uint32 _pad = (ndr->offset & (n-1)); \
+ while (_pad--) NDR_CHECK(ndr_push_uint8(ndr, 0)); \
+ } \
} while(0)
@@ -201,4 +214,5 @@ typedef void (*ndr_print_union_fn_t)(struct ndr_print *, const char *, uint32, v
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "librpc/gen_ndr/ndr_atsvc.h"
#include "librpc/gen_ndr/ndr_eventlog.h"
+#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_winreg.h"