1 /* parser auto-generated by pidl */
4 #include "librpc/gen_ndr/ndr_notify.h"
6 #include "librpc/gen_ndr/ndr_misc.h"
7 _PUBLIC_
enum ndr_err_code
ndr_push_notify_entry(struct ndr_push
*ndr
, int ndr_flags
, const struct notify_entry
*r
)
9 if (ndr_flags
& NDR_SCALARS
) {
10 NDR_CHECK(ndr_push_align(ndr
, 8));
11 NDR_CHECK(ndr_push_server_id(ndr
, NDR_SCALARS
, &r
->server
));
12 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->filter
));
13 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->subdir_filter
));
15 uint32_t _flags_save_string
= ndr
->flags
;
16 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
17 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->path
));
18 ndr
->flags
= _flags_save_string
;
20 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->path_len
));
21 NDR_CHECK(ndr_push_pointer(ndr
, NDR_SCALARS
, r
->private_data
));
23 if (ndr_flags
& NDR_BUFFERS
) {
24 NDR_CHECK(ndr_push_server_id(ndr
, NDR_BUFFERS
, &r
->server
));
26 return NDR_ERR_SUCCESS
;
29 _PUBLIC_
enum ndr_err_code
ndr_pull_notify_entry(struct ndr_pull
*ndr
, int ndr_flags
, struct notify_entry
*r
)
31 if (ndr_flags
& NDR_SCALARS
) {
32 NDR_CHECK(ndr_pull_align(ndr
, 8));
33 NDR_CHECK(ndr_pull_server_id(ndr
, NDR_SCALARS
, &r
->server
));
34 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->filter
));
35 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->subdir_filter
));
37 uint32_t _flags_save_string
= ndr
->flags
;
38 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
39 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->path
));
40 ndr
->flags
= _flags_save_string
;
42 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->path_len
));
43 NDR_CHECK(ndr_pull_pointer(ndr
, NDR_SCALARS
, &r
->private_data
));
45 if (ndr_flags
& NDR_BUFFERS
) {
46 NDR_CHECK(ndr_pull_server_id(ndr
, NDR_BUFFERS
, &r
->server
));
48 return NDR_ERR_SUCCESS
;
51 _PUBLIC_
void ndr_print_notify_entry(struct ndr_print
*ndr
, const char *name
, const struct notify_entry
*r
)
53 ndr_print_struct(ndr
, name
, "notify_entry");
55 ndr_print_server_id(ndr
, "server", &r
->server
);
56 ndr_print_uint32(ndr
, "filter", r
->filter
);
57 ndr_print_uint32(ndr
, "subdir_filter", r
->subdir_filter
);
58 ndr_print_string(ndr
, "path", r
->path
);
59 ndr_print_uint32(ndr
, "path_len", r
->path_len
);
60 ndr_print_pointer(ndr
, "private_data", r
->private_data
);
64 static enum ndr_err_code
ndr_push_notify_depth(struct ndr_push
*ndr
, int ndr_flags
, const struct notify_depth
*r
)
66 uint32_t cntr_entries_0
;
67 if (ndr_flags
& NDR_SCALARS
) {
68 NDR_CHECK(ndr_push_align(ndr
, 8));
69 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->max_mask
));
70 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->max_mask_subdir
));
71 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_entries
));
72 for (cntr_entries_0
= 0; cntr_entries_0
< r
->num_entries
; cntr_entries_0
++) {
73 NDR_CHECK(ndr_push_notify_entry(ndr
, NDR_SCALARS
, &r
->entries
[cntr_entries_0
]));
76 if (ndr_flags
& NDR_BUFFERS
) {
77 for (cntr_entries_0
= 0; cntr_entries_0
< r
->num_entries
; cntr_entries_0
++) {
78 NDR_CHECK(ndr_push_notify_entry(ndr
, NDR_BUFFERS
, &r
->entries
[cntr_entries_0
]));
81 return NDR_ERR_SUCCESS
;
84 static enum ndr_err_code
ndr_pull_notify_depth(struct ndr_pull
*ndr
, int ndr_flags
, struct notify_depth
*r
)
86 uint32_t cntr_entries_0
;
87 TALLOC_CTX
*_mem_save_entries_0
;
88 if (ndr_flags
& NDR_SCALARS
) {
89 NDR_CHECK(ndr_pull_align(ndr
, 8));
90 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->max_mask
));
91 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->max_mask_subdir
));
92 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_entries
));
93 NDR_PULL_ALLOC_N(ndr
, r
->entries
, r
->num_entries
);
94 _mem_save_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
95 NDR_PULL_SET_MEM_CTX(ndr
, r
->entries
, 0);
96 for (cntr_entries_0
= 0; cntr_entries_0
< r
->num_entries
; cntr_entries_0
++) {
97 NDR_CHECK(ndr_pull_notify_entry(ndr
, NDR_SCALARS
, &r
->entries
[cntr_entries_0
]));
99 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_entries_0
, 0);
101 if (ndr_flags
& NDR_BUFFERS
) {
102 _mem_save_entries_0
= NDR_PULL_GET_MEM_CTX(ndr
);
103 NDR_PULL_SET_MEM_CTX(ndr
, r
->entries
, 0);
104 for (cntr_entries_0
= 0; cntr_entries_0
< r
->num_entries
; cntr_entries_0
++) {
105 NDR_CHECK(ndr_pull_notify_entry(ndr
, NDR_BUFFERS
, &r
->entries
[cntr_entries_0
]));
107 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_entries_0
, 0);
109 return NDR_ERR_SUCCESS
;
112 _PUBLIC_
void ndr_print_notify_depth(struct ndr_print
*ndr
, const char *name
, const struct notify_depth
*r
)
114 uint32_t cntr_entries_0
;
115 ndr_print_struct(ndr
, name
, "notify_depth");
117 ndr_print_uint32(ndr
, "max_mask", r
->max_mask
);
118 ndr_print_uint32(ndr
, "max_mask_subdir", r
->max_mask_subdir
);
119 ndr_print_uint32(ndr
, "num_entries", r
->num_entries
);
120 ndr
->print(ndr
, "%s: ARRAY(%d)", "entries", (int)r
->num_entries
);
122 for (cntr_entries_0
=0;cntr_entries_0
<r
->num_entries
;cntr_entries_0
++) {
124 if (asprintf(&idx_0
, "[%d]", cntr_entries_0
) != -1) {
125 ndr_print_notify_entry(ndr
, "entries", &r
->entries
[cntr_entries_0
]);
133 _PUBLIC_
enum ndr_err_code
ndr_push_notify_array(struct ndr_push
*ndr
, int ndr_flags
, const struct notify_array
*r
)
135 uint32_t cntr_depth_0
;
136 if (ndr_flags
& NDR_SCALARS
) {
137 NDR_CHECK(ndr_push_align(ndr
, 8));
138 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->num_depths
));
139 for (cntr_depth_0
= 0; cntr_depth_0
< r
->num_depths
; cntr_depth_0
++) {
140 NDR_CHECK(ndr_push_notify_depth(ndr
, NDR_SCALARS
, &r
->depth
[cntr_depth_0
]));
143 if (ndr_flags
& NDR_BUFFERS
) {
144 for (cntr_depth_0
= 0; cntr_depth_0
< r
->num_depths
; cntr_depth_0
++) {
145 NDR_CHECK(ndr_push_notify_depth(ndr
, NDR_BUFFERS
, &r
->depth
[cntr_depth_0
]));
148 return NDR_ERR_SUCCESS
;
151 _PUBLIC_
enum ndr_err_code
ndr_pull_notify_array(struct ndr_pull
*ndr
, int ndr_flags
, struct notify_array
*r
)
153 uint32_t cntr_depth_0
;
154 TALLOC_CTX
*_mem_save_depth_0
;
155 if (ndr_flags
& NDR_SCALARS
) {
156 NDR_CHECK(ndr_pull_align(ndr
, 8));
157 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->num_depths
));
158 NDR_PULL_ALLOC_N(ndr
, r
->depth
, r
->num_depths
);
159 _mem_save_depth_0
= NDR_PULL_GET_MEM_CTX(ndr
);
160 NDR_PULL_SET_MEM_CTX(ndr
, r
->depth
, 0);
161 for (cntr_depth_0
= 0; cntr_depth_0
< r
->num_depths
; cntr_depth_0
++) {
162 NDR_CHECK(ndr_pull_notify_depth(ndr
, NDR_SCALARS
, &r
->depth
[cntr_depth_0
]));
164 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_depth_0
, 0);
166 if (ndr_flags
& NDR_BUFFERS
) {
167 _mem_save_depth_0
= NDR_PULL_GET_MEM_CTX(ndr
);
168 NDR_PULL_SET_MEM_CTX(ndr
, r
->depth
, 0);
169 for (cntr_depth_0
= 0; cntr_depth_0
< r
->num_depths
; cntr_depth_0
++) {
170 NDR_CHECK(ndr_pull_notify_depth(ndr
, NDR_BUFFERS
, &r
->depth
[cntr_depth_0
]));
172 NDR_PULL_SET_MEM_CTX(ndr
, _mem_save_depth_0
, 0);
174 return NDR_ERR_SUCCESS
;
177 _PUBLIC_
void ndr_print_notify_array(struct ndr_print
*ndr
, const char *name
, const struct notify_array
*r
)
179 uint32_t cntr_depth_0
;
180 ndr_print_struct(ndr
, name
, "notify_array");
182 ndr_print_uint32(ndr
, "num_depths", r
->num_depths
);
183 ndr
->print(ndr
, "%s: ARRAY(%d)", "depth", (int)r
->num_depths
);
185 for (cntr_depth_0
=0;cntr_depth_0
<r
->num_depths
;cntr_depth_0
++) {
187 if (asprintf(&idx_0
, "[%d]", cntr_depth_0
) != -1) {
188 ndr_print_notify_depth(ndr
, "depth", &r
->depth
[cntr_depth_0
]);
196 _PUBLIC_
enum ndr_err_code
ndr_push_notify_event(struct ndr_push
*ndr
, int ndr_flags
, const struct notify_event
*r
)
198 if (ndr_flags
& NDR_SCALARS
) {
199 NDR_CHECK(ndr_push_align(ndr
, 8));
200 NDR_CHECK(ndr_push_uint32(ndr
, NDR_SCALARS
, r
->action
));
202 uint32_t _flags_save_string
= ndr
->flags
;
203 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
204 NDR_CHECK(ndr_push_string(ndr
, NDR_SCALARS
, r
->path
));
205 ndr
->flags
= _flags_save_string
;
207 NDR_CHECK(ndr_push_pointer(ndr
, NDR_SCALARS
, r
->private_data
));
209 if (ndr_flags
& NDR_BUFFERS
) {
211 return NDR_ERR_SUCCESS
;
214 _PUBLIC_
enum ndr_err_code
ndr_pull_notify_event(struct ndr_pull
*ndr
, int ndr_flags
, struct notify_event
*r
)
216 if (ndr_flags
& NDR_SCALARS
) {
217 NDR_CHECK(ndr_pull_align(ndr
, 8));
218 NDR_CHECK(ndr_pull_uint32(ndr
, NDR_SCALARS
, &r
->action
));
220 uint32_t _flags_save_string
= ndr
->flags
;
221 ndr_set_flags(&ndr
->flags
, LIBNDR_FLAG_STR_UTF8
|LIBNDR_FLAG_STR_NULLTERM
);
222 NDR_CHECK(ndr_pull_string(ndr
, NDR_SCALARS
, &r
->path
));
223 ndr
->flags
= _flags_save_string
;
225 NDR_CHECK(ndr_pull_pointer(ndr
, NDR_SCALARS
, &r
->private_data
));
227 if (ndr_flags
& NDR_BUFFERS
) {
229 return NDR_ERR_SUCCESS
;
232 _PUBLIC_
void ndr_print_notify_event(struct ndr_print
*ndr
, const char *name
, const struct notify_event
*r
)
234 ndr_print_struct(ndr
, name
, "notify_event");
236 ndr_print_uint32(ndr
, "action", r
->action
);
237 ndr_print_string(ndr
, "path", r
->path
);
238 ndr_print_pointer(ndr
, "private_data", r
->private_data
);