summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-09-03 02:06:34 +0200
committerGünther Deschner <gd@samba.org>2009-09-08 22:27:41 +0200
commit2b16380a0e22cc455f698e59cd94bfd899c989d0 (patch)
treecf4be7e67c3d20a784e8d35d9e2d762e643afec9 /librpc
parent4b6e9a8e49bb0f63eed65fd84c0aa28b394482cd (diff)
downloadsamba-2b16380a0e22cc455f698e59cd94bfd899c989d0.tar.gz
samba-2b16380a0e22cc455f698e59cd94bfd899c989d0.tar.bz2
samba-2b16380a0e22cc455f698e59cd94bfd899c989d0.zip
ntlmssp: add some void decode calls (useful for ndrdump).
Guenther
Diffstat (limited to 'librpc')
-rw-r--r--librpc/gen_ndr/ndr_ntlmssp.c232
-rw-r--r--librpc/gen_ndr/ndr_ntlmssp.h19
-rw-r--r--librpc/gen_ndr/ntlmssp.h32
-rw-r--r--librpc/idl/ntlmssp.idl23
4 files changed, 304 insertions, 2 deletions
diff --git a/librpc/gen_ndr/ndr_ntlmssp.c b/librpc/gen_ndr/ndr_ntlmssp.c
index 549b4dec6f..b593d9e7e3 100644
--- a/librpc/gen_ndr/ndr_ntlmssp.c
+++ b/librpc/gen_ndr/ndr_ntlmssp.c
@@ -2094,3 +2094,235 @@ _PUBLIC_ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr,
}
}
+static enum ndr_err_code ndr_push_decode_NEGOTIATE_MESSAGE(struct ndr_push *ndr, int flags, const struct decode_NEGOTIATE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_NEGOTIATE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.negotiate));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_decode_NEGOTIATE_MESSAGE(struct ndr_pull *ndr, int flags, struct decode_NEGOTIATE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_NEGOTIATE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.negotiate));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_decode_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_NEGOTIATE_MESSAGE *r)
+{
+ ndr_print_struct(ndr, name, "decode_NEGOTIATE_MESSAGE");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "decode_NEGOTIATE_MESSAGE");
+ ndr->depth++;
+ ndr_print_NEGOTIATE_MESSAGE(ndr, "negotiate", &r->in.negotiate);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "decode_NEGOTIATE_MESSAGE");
+ ndr->depth++;
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_decode_CHALLENGE_MESSAGE(struct ndr_push *ndr, int flags, const struct decode_CHALLENGE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_CHALLENGE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.challenge));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_decode_CHALLENGE_MESSAGE(struct ndr_pull *ndr, int flags, struct decode_CHALLENGE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_CHALLENGE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.challenge));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_decode_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_CHALLENGE_MESSAGE *r)
+{
+ ndr_print_struct(ndr, name, "decode_CHALLENGE_MESSAGE");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "decode_CHALLENGE_MESSAGE");
+ ndr->depth++;
+ ndr_print_CHALLENGE_MESSAGE(ndr, "challenge", &r->in.challenge);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "decode_CHALLENGE_MESSAGE");
+ ndr->depth++;
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_decode_AUTHENTICATE_MESSAGE(struct ndr_push *ndr, int flags, const struct decode_AUTHENTICATE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_AUTHENTICATE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.authenticate));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_decode_AUTHENTICATE_MESSAGE(struct ndr_pull *ndr, int flags, struct decode_AUTHENTICATE_MESSAGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_AUTHENTICATE_MESSAGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.authenticate));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_decode_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_AUTHENTICATE_MESSAGE *r)
+{
+ ndr_print_struct(ndr, name, "decode_AUTHENTICATE_MESSAGE");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "decode_AUTHENTICATE_MESSAGE");
+ ndr->depth++;
+ ndr_print_AUTHENTICATE_MESSAGE(ndr, "authenticate", &r->in.authenticate);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "decode_AUTHENTICATE_MESSAGE");
+ ndr->depth++;
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static enum ndr_err_code ndr_push_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_push *ndr, int flags, const struct decode_NTLMv2_CLIENT_CHALLENGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_push_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.challenge));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+static enum ndr_err_code ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_pull *ndr, int flags, struct decode_NTLMv2_CLIENT_CHALLENGE *r)
+{
+ if (flags & NDR_IN) {
+ NDR_CHECK(ndr_pull_NTLMv2_CLIENT_CHALLENGE(ndr, NDR_SCALARS|NDR_BUFFERS, &r->in.challenge));
+ }
+ if (flags & NDR_OUT) {
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ void ndr_print_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_NTLMv2_CLIENT_CHALLENGE *r)
+{
+ ndr_print_struct(ndr, name, "decode_NTLMv2_CLIENT_CHALLENGE");
+ ndr->depth++;
+ if (flags & NDR_SET_VALUES) {
+ ndr->flags |= LIBNDR_PRINT_SET_VALUES;
+ }
+ if (flags & NDR_IN) {
+ ndr_print_struct(ndr, "in", "decode_NTLMv2_CLIENT_CHALLENGE");
+ ndr->depth++;
+ ndr_print_NTLMv2_CLIENT_CHALLENGE(ndr, "challenge", &r->in.challenge);
+ ndr->depth--;
+ }
+ if (flags & NDR_OUT) {
+ ndr_print_struct(ndr, "out", "decode_NTLMv2_CLIENT_CHALLENGE");
+ ndr->depth++;
+ ndr->depth--;
+ }
+ ndr->depth--;
+}
+
+static const struct ndr_interface_call ntlmssp_calls[] = {
+ {
+ "decode_NEGOTIATE_MESSAGE",
+ sizeof(struct decode_NEGOTIATE_MESSAGE),
+ (ndr_push_flags_fn_t) ndr_push_decode_NEGOTIATE_MESSAGE,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_NEGOTIATE_MESSAGE,
+ (ndr_print_function_t) ndr_print_decode_NEGOTIATE_MESSAGE,
+ false,
+ },
+ {
+ "decode_CHALLENGE_MESSAGE",
+ sizeof(struct decode_CHALLENGE_MESSAGE),
+ (ndr_push_flags_fn_t) ndr_push_decode_CHALLENGE_MESSAGE,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_CHALLENGE_MESSAGE,
+ (ndr_print_function_t) ndr_print_decode_CHALLENGE_MESSAGE,
+ false,
+ },
+ {
+ "decode_AUTHENTICATE_MESSAGE",
+ sizeof(struct decode_AUTHENTICATE_MESSAGE),
+ (ndr_push_flags_fn_t) ndr_push_decode_AUTHENTICATE_MESSAGE,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_AUTHENTICATE_MESSAGE,
+ (ndr_print_function_t) ndr_print_decode_AUTHENTICATE_MESSAGE,
+ false,
+ },
+ {
+ "decode_NTLMv2_CLIENT_CHALLENGE",
+ sizeof(struct decode_NTLMv2_CLIENT_CHALLENGE),
+ (ndr_push_flags_fn_t) ndr_push_decode_NTLMv2_CLIENT_CHALLENGE,
+ (ndr_pull_flags_fn_t) ndr_pull_decode_NTLMv2_CLIENT_CHALLENGE,
+ (ndr_print_function_t) ndr_print_decode_NTLMv2_CLIENT_CHALLENGE,
+ false,
+ },
+ { NULL, 0, NULL, NULL, NULL, false }
+};
+
+static const char * const ntlmssp_endpoint_strings[] = {
+ "ncacn_np:[\\pipe\\ntlmssp]",
+};
+
+static const struct ndr_interface_string_array ntlmssp_endpoints = {
+ .count = 1,
+ .names = ntlmssp_endpoint_strings
+};
+
+static const char * const ntlmssp_authservice_strings[] = {
+ "host",
+};
+
+static const struct ndr_interface_string_array ntlmssp_authservices = {
+ .count = 1,
+ .names = ntlmssp_authservice_strings
+};
+
+
+const struct ndr_interface_table ndr_table_ntlmssp = {
+ .name = "ntlmssp",
+ .syntax_id = {
+ {0x6e746c6d,0x7373,0x700a,{0x00,0x00},{0x00,0x00,0x00,0x00}},
+ NDR_NTLMSSP_VERSION
+ },
+ .helpstring = NDR_NTLMSSP_HELPSTRING,
+ .num_calls = 4,
+ .calls = ntlmssp_calls,
+ .endpoints = &ntlmssp_endpoints,
+ .authservices = &ntlmssp_authservices
+};
+
diff --git a/librpc/gen_ndr/ndr_ntlmssp.h b/librpc/gen_ndr/ndr_ntlmssp.h
index 514d871cc7..ab095d1cc2 100644
--- a/librpc/gen_ndr/ndr_ntlmssp.h
+++ b/librpc/gen_ndr/ndr_ntlmssp.h
@@ -7,7 +7,20 @@
#define _HEADER_NDR_ntlmssp
#include "../librpc/ndr/ndr_ntlmssp.h"
-#define NDR_NTLMSSP_CALL_COUNT (0)
+#define NDR_NTLMSSP_UUID "6e746c6d-7373-700a-0000-00000000"
+#define NDR_NTLMSSP_VERSION 0.0
+#define NDR_NTLMSSP_NAME "ntlmssp"
+#define NDR_NTLMSSP_HELPSTRING "NTLM messages"
+extern const struct ndr_interface_table ndr_table_ntlmssp;
+#define NDR_DECODE_NEGOTIATE_MESSAGE (0x00)
+
+#define NDR_DECODE_CHALLENGE_MESSAGE (0x01)
+
+#define NDR_DECODE_AUTHENTICATE_MESSAGE (0x02)
+
+#define NDR_DECODE_NTLMV2_CLIENT_CHALLENGE (0x03)
+
+#define NDR_NTLMSSP_CALL_COUNT (4)
void ndr_print_ntlmssp_MessageType(struct ndr_print *ndr, const char *name, enum ntlmssp_MessageType r);
void ndr_print_NEGOTIATE(struct ndr_print *ndr, const char *name, uint32_t r);
void ndr_print_ntlmssp_WindowsMajorVersion(struct ndr_print *ndr, const char *name, enum ntlmssp_WindowsMajorVersion r);
@@ -57,4 +70,8 @@ void ndr_print_NTLMSSP_MESSAGE_SIGNATURE(struct ndr_print *ndr, const char *name
enum ndr_err_code ndr_push_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_push *ndr, int ndr_flags, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r);
enum ndr_err_code ndr_pull_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_pull *ndr, int ndr_flags, struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r);
void ndr_print_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(struct ndr_print *ndr, const char *name, const struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 *r);
+void ndr_print_decode_NEGOTIATE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_NEGOTIATE_MESSAGE *r);
+void ndr_print_decode_CHALLENGE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_CHALLENGE_MESSAGE *r);
+void ndr_print_decode_AUTHENTICATE_MESSAGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_AUTHENTICATE_MESSAGE *r);
+void ndr_print_decode_NTLMv2_CLIENT_CHALLENGE(struct ndr_print *ndr, const char *name, int flags, const struct decode_NTLMv2_CLIENT_CHALLENGE *r);
#endif /* _HEADER_NDR_ntlmssp */
diff --git a/librpc/gen_ndr/ntlmssp.h b/librpc/gen_ndr/ntlmssp.h
index 6e5020f282..4509915974 100644
--- a/librpc/gen_ndr/ntlmssp.h
+++ b/librpc/gen_ndr/ntlmssp.h
@@ -282,4 +282,36 @@ struct NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 {
uint32_t SeqNum;
}/* [public,flag(LIBNDR_PRINT_ARRAY_HEX)] */;
+
+struct decode_NEGOTIATE_MESSAGE {
+ struct {
+ struct NEGOTIATE_MESSAGE negotiate;
+ } in;
+
+};
+
+
+struct decode_CHALLENGE_MESSAGE {
+ struct {
+ struct CHALLENGE_MESSAGE challenge;
+ } in;
+
+};
+
+
+struct decode_AUTHENTICATE_MESSAGE {
+ struct {
+ struct AUTHENTICATE_MESSAGE authenticate;
+ } in;
+
+};
+
+
+struct decode_NTLMv2_CLIENT_CHALLENGE {
+ struct {
+ struct NTLMv2_CLIENT_CHALLENGE challenge;
+ } in;
+
+};
+
#endif /* _HEADER_ntlmssp */
diff --git a/librpc/idl/ntlmssp.idl b/librpc/idl/ntlmssp.idl
index dd42da0925..0bb30bb22e 100644
--- a/librpc/idl/ntlmssp.idl
+++ b/librpc/idl/ntlmssp.idl
@@ -6,7 +6,9 @@
[
pointer_default(unique),
- helper("../librpc/ndr/ndr_ntlmssp.h")
+ helper("../librpc/ndr/ndr_ntlmssp.h"),
+ helpstring("NTLM messages"),
+ uuid("6e746c6d-7373-700a-0000-00000000")
]
interface ntlmssp
{
@@ -270,4 +272,23 @@ interface ntlmssp
uint8 Checksum[8];
uint32 SeqNum;
} NTLMSSP_MESSAGE_SIGNATURE_NTLMv2;
+
+ /* some ndrdump helpers */
+
+ void decode_NEGOTIATE_MESSAGE(
+ [in] NEGOTIATE_MESSAGE negotiate
+ );
+
+ void decode_CHALLENGE_MESSAGE(
+ [in] CHALLENGE_MESSAGE challenge
+ );
+
+ void decode_AUTHENTICATE_MESSAGE(
+ [in] AUTHENTICATE_MESSAGE authenticate
+ );
+
+ void decode_NTLMv2_CLIENT_CHALLENGE(
+ [in] NTLMv2_CLIENT_CHALLENGE challenge
+ );
+
}