/* parser auto-generated by pidl */

#include "replace.h"
#include "bin/default/librpc/gen_ndr/ndr_gmsa.h"

static enum ndr_err_code ndr_push_MANAGEDPASSWORD_BLOB_PASSWORDS(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct MANAGEDPASSWORD_BLOB_PASSWORDS *r)
{
	NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 5));
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->current));
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->previous));
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->query_interval));
			ndr->flags = _flags_save_hyper;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			NDR_CHECK(ndr_push_short_relative_ptr1(ndr, r->unchanged_interval));
			ndr->flags = _flags_save_hyper;
		}
		NDR_CHECK(ndr_push_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			if (r->current) {
				NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->current));
				NDR_CHECK(ndr_push_u16string(ndr, NDR_SCALARS, r->current));
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			if (r->previous) {
				NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->previous));
				NDR_CHECK(ndr_push_u16string(ndr, NDR_SCALARS, r->previous));
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			if (r->query_interval) {
				NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->query_interval));
				NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->query_interval));
			}
			ndr->flags = _flags_save_hyper;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			if (r->unchanged_interval) {
				NDR_CHECK(ndr_push_short_relative_ptr2(ndr, r->unchanged_interval));
				NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, *r->unchanged_interval));
			}
			ndr->flags = _flags_save_hyper;
		}
	}
	return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_MANAGEDPASSWORD_BLOB_PASSWORDS(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct MANAGEDPASSWORD_BLOB_PASSWORDS *r)
{
	uint16_t _ptr_current;
	TALLOC_CTX *_mem_save_current_0 = NULL;
	uint16_t _ptr_previous;
	TALLOC_CTX *_mem_save_previous_0 = NULL;
	uint16_t _ptr_query_interval;
	TALLOC_CTX *_mem_save_query_interval_0 = NULL;
	uint16_t _ptr_unchanged_interval;
	TALLOC_CTX *_mem_save_unchanged_interval_0 = NULL;
	NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_pull_align(ndr, 5));
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_current));
			if (_ptr_current) {
				NDR_PULL_ALLOC(ndr, r->current);
				NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->current, _ptr_current));
			} else {
				r->current = NULL;
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_previous));
			if (_ptr_previous) {
				NDR_PULL_ALLOC(ndr, r->previous);
				NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous, _ptr_previous));
			} else {
				r->previous = NULL;
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_query_interval));
			if (_ptr_query_interval) {
				NDR_PULL_ALLOC(ndr, r->query_interval);
				NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->query_interval, _ptr_query_interval));
			} else {
				r->query_interval = NULL;
			}
			ndr->flags = _flags_save_hyper;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			NDR_CHECK(ndr_pull_relative_ptr_short(ndr, &_ptr_unchanged_interval));
			if (_ptr_unchanged_interval) {
				NDR_PULL_ALLOC(ndr, r->unchanged_interval);
				NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->unchanged_interval, _ptr_unchanged_interval));
			} else {
				r->unchanged_interval = NULL;
			}
			ndr->flags = _flags_save_hyper;
		}
		NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			if (r->current) {
				uint32_t _relative_save_offset;
				_relative_save_offset = ndr->offset;
				NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->current));
				_mem_save_current_0 = NDR_PULL_GET_MEM_CTX(ndr);
				NDR_PULL_SET_MEM_CTX(ndr, r->current, 0);
				NDR_CHECK(ndr_pull_u16string(ndr, NDR_SCALARS, &r->current));
				NDR_PULL_SET_MEM_CTX(ndr, _mem_save_current_0, 0);
				if (ndr->offset > ndr->relative_highest_offset) {
					ndr->relative_highest_offset = ndr->offset;
				}
				ndr->offset = _relative_save_offset;
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_u16string = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
			if (r->previous) {
				uint32_t _relative_save_offset;
				_relative_save_offset = ndr->offset;
				NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous));
				_mem_save_previous_0 = NDR_PULL_GET_MEM_CTX(ndr);
				NDR_PULL_SET_MEM_CTX(ndr, r->previous, 0);
				NDR_CHECK(ndr_pull_u16string(ndr, NDR_SCALARS, &r->previous));
				NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_0, 0);
				if (ndr->offset > ndr->relative_highest_offset) {
					ndr->relative_highest_offset = ndr->offset;
				}
				ndr->offset = _relative_save_offset;
			}
			ndr->flags = _flags_save_u16string;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			if (r->query_interval) {
				uint32_t _relative_save_offset;
				_relative_save_offset = ndr->offset;
				NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->query_interval));
				_mem_save_query_interval_0 = NDR_PULL_GET_MEM_CTX(ndr);
				NDR_PULL_SET_MEM_CTX(ndr, r->query_interval, 0);
				NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->query_interval));
				NDR_PULL_SET_MEM_CTX(ndr, _mem_save_query_interval_0, 0);
				if (ndr->offset > ndr->relative_highest_offset) {
					ndr->relative_highest_offset = ndr->offset;
				}
				ndr->offset = _relative_save_offset;
			}
			ndr->flags = _flags_save_hyper;
		}
		{
			libndr_flags _flags_save_hyper = ndr->flags;
			ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
			if (r->unchanged_interval) {
				uint32_t _relative_save_offset;
				_relative_save_offset = ndr->offset;
				NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->unchanged_interval));
				_mem_save_unchanged_interval_0 = NDR_PULL_GET_MEM_CTX(ndr);
				NDR_PULL_SET_MEM_CTX(ndr, r->unchanged_interval, 0);
				NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, r->unchanged_interval));
				NDR_PULL_SET_MEM_CTX(ndr, _mem_save_unchanged_interval_0, 0);
				if (ndr->offset > ndr->relative_highest_offset) {
					ndr->relative_highest_offset = ndr->offset;
				}
				ndr->offset = _relative_save_offset;
			}
			ndr->flags = _flags_save_hyper;
		}
	}
	return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_MANAGEDPASSWORD_BLOB_PASSWORDS(struct ndr_print *ndr, const char *name, const struct MANAGEDPASSWORD_BLOB_PASSWORDS *r)
{
	ndr_print_struct(ndr, name, "MANAGEDPASSWORD_BLOB_PASSWORDS");
	if (r == NULL) { ndr_print_null(ndr); return; }
	ndr->depth++;
	{
		libndr_flags _flags_save_u16string = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
		ndr_print_ptr(ndr, "current", r->current);
		ndr->depth++;
		if (r->current) {
			ndr_print_u16string(ndr, "current", r->current);
		}
		ndr->depth--;
		ndr->flags = _flags_save_u16string;
	}
	{
		libndr_flags _flags_save_u16string = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_IS_SECRET|LIBNDR_FLAG_STR_NULLTERM);
		ndr_print_ptr(ndr, "previous", r->previous);
		ndr->depth++;
		if (r->previous) {
			ndr_print_u16string(ndr, "previous", r->previous);
		}
		ndr->depth--;
		ndr->flags = _flags_save_u16string;
	}
	{
		libndr_flags _flags_save_hyper = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
		ndr_print_ptr(ndr, "query_interval", r->query_interval);
		ndr->depth++;
		if (r->query_interval) {
			ndr_print_hyper(ndr, "query_interval", *r->query_interval);
		}
		ndr->depth--;
		ndr->flags = _flags_save_hyper;
	}
	{
		libndr_flags _flags_save_hyper = ndr->flags;
		ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
		ndr_print_ptr(ndr, "unchanged_interval", r->unchanged_interval);
		ndr->depth++;
		if (r->unchanged_interval) {
			ndr_print_hyper(ndr, "unchanged_interval", *r->unchanged_interval);
		}
		ndr->depth--;
		ndr->flags = _flags_save_hyper;
	}
	ndr->depth--;
}

static size_t ndr_size_MANAGEDPASSWORD_BLOB_PASSWORDS(const struct MANAGEDPASSWORD_BLOB_PASSWORDS *r, libndr_flags flags)
{
	return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_MANAGEDPASSWORD_BLOB_PASSWORDS);
}

_PUBLIC_ enum ndr_err_code ndr_push_MANAGEDPASSWORD_BLOB(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct MANAGEDPASSWORD_BLOB *r)
{
	NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_push_align(ndr, 5));
		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 1));
		NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, 0));
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 8 + ndr_size_MANAGEDPASSWORD_BLOB_PASSWORDS(&r->passwords, ndr->flags)));
		NDR_CHECK(ndr_push_MANAGEDPASSWORD_BLOB_PASSWORDS(ndr, NDR_SCALARS, &r->passwords));
		NDR_CHECK(ndr_push_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		NDR_CHECK(ndr_push_MANAGEDPASSWORD_BLOB_PASSWORDS(ndr, NDR_BUFFERS, &r->passwords));
	}
	return NDR_ERR_SUCCESS;
}

_PUBLIC_ enum ndr_err_code ndr_pull_MANAGEDPASSWORD_BLOB(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct MANAGEDPASSWORD_BLOB *r)
{
	NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
	if (ndr_flags & NDR_SCALARS) {
		NDR_CHECK(ndr_pull_align(ndr, 5));
		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->version));
		NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved));
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
		NDR_CHECK(ndr_pull_MANAGEDPASSWORD_BLOB_PASSWORDS(ndr, NDR_SCALARS, &r->passwords));
		NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
	}
	if (ndr_flags & NDR_BUFFERS) {
		NDR_CHECK(ndr_pull_MANAGEDPASSWORD_BLOB_PASSWORDS(ndr, NDR_BUFFERS, &r->passwords));
	}
	return NDR_ERR_SUCCESS;
}

static void ndr_print_flags_MANAGEDPASSWORD_BLOB(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct MANAGEDPASSWORD_BLOB *r)
{
	ndr_print_MANAGEDPASSWORD_BLOB(ndr, name, r);
}

_PUBLIC_ void ndr_print_MANAGEDPASSWORD_BLOB(struct ndr_print *ndr, const char *name, const struct MANAGEDPASSWORD_BLOB *r)
{
	ndr_print_struct(ndr, name, "MANAGEDPASSWORD_BLOB");
	if (r == NULL) { ndr_print_null(ndr); return; }
	ndr->depth++;
	ndr_print_uint16(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
	ndr_print_uint16(ndr, "reserved", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved);
	ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?8 + ndr_size_MANAGEDPASSWORD_BLOB_PASSWORDS(&r->passwords, ndr->flags):r->length);
	ndr_print_MANAGEDPASSWORD_BLOB_PASSWORDS(ndr, "passwords", &r->passwords);
	ndr->depth--;
}

#ifndef SKIP_NDR_TABLE_gmsa
static const struct ndr_interface_public_struct gmsa_public_structs[] = {
	{
		.name = "MANAGEDPASSWORD_BLOB",
		.struct_size = sizeof(struct MANAGEDPASSWORD_BLOB ),
		.ndr_push = (ndr_push_flags_fn_t) ndr_push_MANAGEDPASSWORD_BLOB,
		.ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_MANAGEDPASSWORD_BLOB,
		.ndr_print = (ndr_print_function_t) ndr_print_flags_MANAGEDPASSWORD_BLOB,
	},
	{ .name = NULL }
};

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

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

static const struct ndr_interface_string_array gmsa_endpoints = {
	.count	= 1,
	.names	= gmsa_endpoint_strings
};

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

static const struct ndr_interface_string_array gmsa_authservices = {
	.count	= 1,
	.names	= gmsa_authservice_strings
};


const struct ndr_interface_table ndr_table_gmsa = {
	.name		= "gmsa",
	.syntax_id	= {
		{0xe43b8cf6,0x1ead,0x11ee,{0xae,0xd1},{0xe3,0x59,0x71,0x36,0xce,0x70}},
		NDR_GMSA_VERSION
	},
	.helpstring	= NDR_GMSA_HELPSTRING,
	.num_calls	= 0,
	.calls		= gmsa_calls,
	.num_public_structs	= 1,
	.public_structs		= gmsa_public_structs,
	.endpoints	= &gmsa_endpoints,
	.authservices	= &gmsa_authservices
};

#endif /* SKIP_NDR_TABLE_gmsa */
