*/
#include "includes.h"
+#if (_SAMBA_BUILD_ >= 4)
#include "lib/cmdline/popt_common.h"
#include "system/filesys.h"
#include "system/locale.h"
#include "librpc/rpc/dcerpc.h"
#include "librpc/rpc/dcerpc_table.h"
+#endif
static const struct dcerpc_interface_call *find_function(
const struct dcerpc_interface_table *p,
return &p->calls[i];
}
+#if (_SAMBA_BUILD_ >= 4)
static void show_pipes(void)
{
exit(1);
}
+#endif
+
static void show_functions(const struct dcerpc_interface_table *p)
{
int i;
{ NULL }
};
+#if (_SAMBA_BUILD_ >= 4)
dcerpc_table_init();
+#endif
pc = poptGetContext("ndrdump", argc, argv, long_options, 0);
if (!pipe_name) {
poptPrintUsage(pc, stderr, 0);
+#if (_SAMBA_BUILD_ >= 4)
show_pipes();
+#endif
exit(1);
}
if (plugin != NULL) {
p = load_iface_from_plugin(plugin, pipe_name);
+ }
+#if (_SAMBA_BUILD_ <= 3)
+ else {
+ fprintf(stderr, "Only loading from DSO's supported in Samba 3\n");
+ exit(1);
}
-
+#else
if (!p) {
p = idl_iface_by_name(pipe_name);
}
p = idl_iface_by_uuid(&uuid);
}
}
+#endif
if (!p) {
printf("Unknown pipe or UUID '%s'\n", pipe_name);
exit(1);
}
+#if (_SAMBA_BUILD_ >= 4)
data = (uint8_t *)file_load(ctx_filename, &size, mem_ctx);
+#else
+ data = (uint8_t *)file_load(ctx_filename, &size, 0);
+#endif
if (!data) {
perror(ctx_filename);
exit(1);
}
if (filename)
+#if (_SAMBA_BUILD_ >= 4)
data = (uint8_t *)file_load(filename, &size, mem_ctx);
+#else
+ data = (uint8_t *)file_load(filename, &size, 0);
+#endif
else
data = (uint8_t *)stdin_load(mem_ctx, &size);