/* parser auto-generated by pidl */

#include "replace.h"
#include "bin/default/source4/librpc/gen_ndr/ndr_sasl_helpers.h"

_PUBLIC_ enum ndr_err_code ndr_push_saslauthdRequest(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct saslauthdRequest *r)
{
	{
		libndr_flags _flags_save_STRUCT = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
		NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
		if (ndr_flags & NDR_SCALARS) {
			NDR_CHECK(ndr_push_align(ndr, 2));
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->authid)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->authid, strlen_m(r->authid), sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->passwd_length));
			NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->passwd, r->passwd_length));
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->service)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->service, strlen_m(r->service), sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, strlen_m(r->realm)));
			NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->realm, strlen_m(r->realm), sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_push_trailer_align(ndr, 2));
		}
		if (ndr_flags & NDR_BUFFERS) {
		}
		ndr->flags = _flags_save_STRUCT;
	}
	return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_saslauthdRequest(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct saslauthdRequest *r)
{
	uint32_t size_authid_0 = 0;
	uint32_t size_passwd_0 = 0;
	uint32_t size_service_0 = 0;
	uint32_t size_realm_0 = 0;
	{
		libndr_flags _flags_save_STRUCT = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
		NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
		if (ndr_flags & NDR_SCALARS) {
			NDR_CHECK(ndr_pull_align(ndr, 2));
			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->authid_length));
			size_authid_0 = r->authid_length;
			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->authid, size_authid_0, sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->passwd_length));
			size_passwd_0 = r->passwd_length;
			NDR_PULL_ALLOC_N(ndr, r->passwd, size_passwd_0);
			NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->passwd, size_passwd_0));
			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->service_length));
			size_service_0 = r->service_length;
			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->service, size_service_0, sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->realm_length));
			size_realm_0 = r->realm_length;
			NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->realm, size_realm_0, sizeof(uint8_t), CH_UTF8));
			NDR_CHECK(ndr_pull_trailer_align(ndr, 2));
		}
		if (ndr_flags & NDR_BUFFERS) {
		}
		ndr->flags = _flags_save_STRUCT;
	}
	return NDR_ERR_SUCCESS;
}

static void ndr_print_flags_saslauthdRequest(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct saslauthdRequest *r)
{
	ndr_print_saslauthdRequest(ndr, name, r);
}

_PUBLIC_ void ndr_print_saslauthdRequest(struct ndr_print *ndr, const char *name, const struct saslauthdRequest *r)
{
	ndr_print_struct(ndr, name, "saslauthdRequest");
	if (r == NULL) { ndr_print_null(ndr); return; }
	{
		libndr_flags _flags_save_STRUCT = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_BIGENDIAN|LIBNDR_PRINT_ARRAY_HEX);
		ndr->depth++;
		ndr_print_uint16(ndr, "authid_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->authid):r->authid_length);
		ndr_print_string(ndr, "authid", r->authid);
		ndr_print_uint16(ndr, "passwd_length", r->passwd_length);
		ndr_print_array_uint8(ndr, "passwd", r->passwd, r->passwd_length);
		ndr_print_uint16(ndr, "service_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->service):r->service_length);
		ndr_print_string(ndr, "service", r->service);
		ndr_print_uint16(ndr, "realm_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?strlen_m(r->realm):r->realm_length);
		ndr_print_string(ndr, "realm", r->realm);
		ndr->depth--;
		ndr->flags = _flags_save_STRUCT;
	}
}

#ifndef SKIP_NDR_TABLE_sasl_helpers
static const struct ndr_interface_public_struct sasl_helpers_public_structs[] = {
	{
		.name = "saslauthdRequest",
		.struct_size = sizeof(struct saslauthdRequest ),
		.ndr_push = (ndr_push_flags_fn_t) ndr_push_saslauthdRequest,
		.ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_saslauthdRequest,
		.ndr_print = (ndr_print_function_t) ndr_print_flags_saslauthdRequest,
	},
	{ .name = NULL }
};

static const struct ndr_interface_call sasl_helpers_calls[] = {
	{ .name = NULL }
};

static const char * const sasl_helpers_endpoint_strings[] = {
	"ncacn_np:[\\pipe\\sasl_helpers]", 
};

static const struct ndr_interface_string_array sasl_helpers_endpoints = {
	.count	= 1,
	.names	= sasl_helpers_endpoint_strings
};

static const char * const sasl_helpers_authservice_strings[] = {
	"host", 
};

static const struct ndr_interface_string_array sasl_helpers_authservices = {
	.count	= 1,
	.names	= sasl_helpers_authservice_strings
};


const struct ndr_interface_table ndr_table_sasl_helpers = {
	.name		= "sasl_helpers",
	.syntax_id	= {
		{0x7512b2f4,0x5f4f,0x11e4,{0xbb,0xe6},{0x3c,0x97,0x0e,0x8d,0x82,0x26}},
		NDR_SASL_HELPERS_VERSION
	},
	.helpstring	= NDR_SASL_HELPERS_HELPSTRING,
	.num_calls	= 0,
	.calls		= sasl_helpers_calls,
	.num_public_structs	= 1,
	.public_structs		= sasl_helpers_public_structs,
	.endpoints	= &sasl_helpers_endpoints,
	.authservices	= &sasl_helpers_authservices
};

#endif /* SKIP_NDR_TABLE_sasl_helpers */
