ntlmssp: add some void decode calls (useful for ndrdump).
authorGünther Deschner <gd@samba.org>
Thu, 3 Sep 2009 00:06:34 +0000 (02:06 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 8 Sep 2009 20:27:41 +0000 (22:27 +0200)
Guenther

librpc/gen_ndr/ndr_ntlmssp.c
librpc/gen_ndr/ndr_ntlmssp.h
librpc/gen_ndr/ntlmssp.h
librpc/idl/ntlmssp.idl
source4/librpc/config.mk

index 549b4dec6f9114d879827f6ef785a69e1936d5fd..b593d9e7e3f18db877ddc830f7a6ac8e525643f9 100644 (file)
@@ -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
+};
+
index 514d871cc7628e9e6c564397ba7a1f1b6fbd1e7e..ab095d1cc2e4e452a1b678e4e6a81a460cded12a 100644 (file)
@@ -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 */
index 6e5020f2828d34654e89af0d632da8945c09b2c1..45099159749136684fa25c607c8dd68cef612719 100644 (file)
@@ -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 */
index dd42da092540d63c3ab561f5b1e3f9eac4a9d3d5..0bb30bb22e316211dd646e02dc22093d48703f5a 100644 (file)
@@ -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
+               );
+
 }
index e51aa61d3a6ada5d28f06bb9b510bc6507c43eab..ae5e86a5785a4c8c788504c3845ec55c6764d05d 100644 (file)
@@ -291,6 +291,11 @@ PUBLIC_DEPENDENCIES = LIBNDR NDR_STANDARD
 NDR_WINBIND_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winbind.o
 #PUBLIC_HEADERS += $(gen_ndrsrcdir)/winbind.h
 
+[SUBSYSTEM::NDR_NTLMSSP]
+PUBLIC_DEPENDENCIES = LIBNDR NDR_STANDARD
+
+NDR_NTLMSSP_OBJ_FILES = ../librpc/gen_ndr/ndr_ntlmssp.o ../librpc/ndr/ndr_ntlmssp.o
+
 $(librpcsrcdir)/idl-deps:
        $(PERL) $(librpcsrcdir)/idl-deps.pl $(wildcard $(librpcsrcdir)/idl/*.idl ../librpc/idl/*.idl) >$@
 
@@ -346,7 +351,8 @@ PUBLIC_DEPENDENCIES = \
        NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND \
        NDR_FRSRPC NDR_FRSAPI NDR_FRSTRANS \
        NDR_NFS4ACL NDR_NTP_SIGND \
-       NDR_DCOM NDR_WMI NDR_NAMED_PIPE_AUTH
+       NDR_DCOM NDR_WMI NDR_NAMED_PIPE_AUTH \
+       NDR_NTLMSSP
 
 NDR_TABLE_OBJ_FILES = ../librpc/ndr/ndr_table.o $(gen_ndrsrcdir)/tables.o