summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/ndr_wbint.c
blob: fed1ce2f1e676dfe4b151b1d5cdaf90e63252924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/* parser auto-generated by pidl */

#include "includes.h"
#include "librpc/gen_ndr/ndr_wbint.h"

static enum ndr_err_code ndr_push_wbint_Ping(struct ndr_push *ndr, int flags, const struct wbint_Ping *r)
{
	if (flags & NDR_IN) {
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
	}
	if (flags & NDR_OUT) {
		if (r->out.out_data == NULL) {
			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
		}
		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
	}
	return NDR_ERR_SUCCESS;
}

static enum ndr_err_code ndr_pull_wbint_Ping(struct ndr_pull *ndr, int flags, struct wbint_Ping *r)
{
	TALLOC_CTX *_mem_save_out_data_0;
	if (flags & NDR_IN) {
		ZERO_STRUCT(r->out);

		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
		NDR_PULL_ALLOC(ndr, r->out.out_data);
		ZERO_STRUCTP(r->out.out_data);
	}
	if (flags & NDR_OUT) {
		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
			NDR_PULL_ALLOC(ndr, r->out.out_data);
		}
		_mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
		NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
	}
	return NDR_ERR_SUCCESS;
}

_PUBLIC_ void ndr_print_wbint_Ping(struct ndr_print *ndr, const char *name, int flags, const struct wbint_Ping *r)
{
	ndr_print_struct(ndr, name, "wbint_Ping");
	ndr->depth++;
	if (flags & NDR_SET_VALUES) {
		ndr->flags |= LIBNDR_PRINT_SET_VALUES;
	}
	if (flags & NDR_IN) {
		ndr_print_struct(ndr, "in", "wbint_Ping");
		ndr->depth++;
		ndr_print_uint32(ndr, "in_data", r->in.in_data);
		ndr->depth--;
	}
	if (flags & NDR_OUT) {
		ndr_print_struct(ndr, "out", "wbint_Ping");
		ndr->depth++;
		ndr_print_ptr(ndr, "out_data", r->out.out_data);
		ndr->depth++;
		ndr_print_uint32(ndr, "out_data", *r->out.out_data);
		ndr->depth--;
		ndr->depth--;
	}
	ndr->depth--;
}

static const struct ndr_interface_call wbint_calls[] = {
	{
		"wbint_Ping",
		sizeof(struct wbint_Ping),
		(ndr_push_flags_fn_t) ndr_push_wbint_Ping,
		(ndr_pull_flags_fn_t) ndr_pull_wbint_Ping,
		(ndr_print_function_t) ndr_print_wbint_Ping,
		false,
	},
	{ NULL, 0, NULL, NULL, NULL, false }
};

static const char * const wbint_endpoint_strings[] = {
	"ncalrpc:",
};

static const struct ndr_interface_string_array wbint_endpoints = {
	.count	= 1,
	.names	= wbint_endpoint_strings
};

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

static const struct ndr_interface_string_array wbint_authservices = {
	.count	= 1,
	.names	= wbint_authservice_strings
};


const struct ndr_interface_table ndr_table_wbint = {
	.name		= "wbint",
	.syntax_id	= {
		{0xbf09192c,0xed60,0x4928,{0x9d,0xff},{0xd0,0xd7,0xbc,0xb0,0x3e,0xd8}},
		NDR_WBINT_VERSION
	},
	.helpstring	= NDR_WBINT_HELPSTRING,
	.num_calls	= 1,
	.calls		= wbint_calls,
	.endpoints	= &wbint_endpoints,
	.authservices	= &wbint_authservices
};