summaryrefslogtreecommitdiff
path: root/librpc/tools/ndrdump.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-16 23:57:32 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-16 23:59:53 -0700
commit9407ab573e492c8ab01c2694d3e6f31924bbb0f8 (patch)
treed388c12ed31c2eec373cc76029455835131b3def /librpc/tools/ndrdump.c
parent99c3fc19587431efda1ae6161453d84673b32071 (diff)
downloadsamba-9407ab573e492c8ab01c2694d3e6f31924bbb0f8.tar.gz
samba-9407ab573e492c8ab01c2694d3e6f31924bbb0f8.tar.bz2
samba-9407ab573e492c8ab01c2694d3e6f31924bbb0f8.zip
ndr: added --ndr64 flag to ndrdump
This only does pull, but it is useful for w2k8-r2 <-> w2k8-r2 ndrdump usage, which is always 64bit.
Diffstat (limited to 'librpc/tools/ndrdump.c')
-rw-r--r--librpc/tools/ndrdump.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 7126d26c59..fbb0f3ab2a 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -157,19 +157,25 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
const char *plugin = NULL;
bool validate = false;
bool dumpdata = false;
+ bool assume_ndr64 = false;
int opt;
- enum {OPT_CONTEXT_FILE=1000, OPT_VALIDATE, OPT_DUMP_DATA, OPT_LOAD_DSO};
+ enum {OPT_CONTEXT_FILE=1000, OPT_VALIDATE, OPT_DUMP_DATA, OPT_LOAD_DSO, OPT_NDR64};
struct poptOption long_options[] = {
POPT_AUTOHELP
{"context-file", 'c', POPT_ARG_STRING, NULL, OPT_CONTEXT_FILE, "In-filename to parse first", "CTX-FILE" },
{"validate", 0, POPT_ARG_NONE, NULL, OPT_VALIDATE, "try to validate the data", NULL },
{"dump-data", 0, POPT_ARG_NONE, NULL, OPT_DUMP_DATA, "dump the hex data", NULL },
{"load-dso", 'l', POPT_ARG_STRING, NULL, OPT_LOAD_DSO, "load from shared object file", NULL },
+ {"ndr64", 'l', POPT_ARG_NONE, NULL, OPT_NDR64, "Assume NDR64 data", NULL },
POPT_COMMON_SAMBA
POPT_COMMON_VERSION
{ NULL }
};
+ if (DEBUGLEVEL < 1) {
+ DEBUGLEVEL = 1;
+ }
+
ndr_table_init();
/* Initialise samba stuff */
@@ -200,6 +206,9 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
case OPT_LOAD_DSO:
plugin = poptGetOptArg(pc);
break;
+ case OPT_NDR64:
+ assume_ndr64 = true;
+ break;
}
}
@@ -287,6 +296,9 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (assume_ndr64) {
+ ndr_pull->flags |= LIBNDR_FLAG_NDR64;
+ }
ndr_err = f->ndr_pull(ndr_pull, NDR_IN, st);
@@ -320,6 +332,9 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx, lp_iconv_convenience(cmdline_lp_ctx));
ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC;
+ if (assume_ndr64) {
+ ndr_pull->flags |= LIBNDR_FLAG_NDR64;
+ }
ndr_err = f->ndr_pull(ndr_pull, flags, st);
status = ndr_map_error2ntstatus(ndr_err);