1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5 
6 #ifndef _IDMAP_PROT_H_RPCGEN
7 #define	_IDMAP_PROT_H_RPCGEN
8 
9 #include <rpc/rpc.h>
10 #ifndef _KERNEL
11 #include <synch.h>
12 #include <thread.h>
13 #endif /* !_KERNEL */
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #if	defined(_KERNEL)
20 #include <sys/nvpair.h>
21 #else
22 #include <libnvpair.h>
23 #endif
24 typedef nvlist_t *nvlist_t_ptr;
25 
26 typedef char *idmap_utf8str;
27 
28 typedef struct {
29 	u_int idmap_utf8str_list_len;
30 	idmap_utf8str *idmap_utf8str_list_val;
31 } idmap_utf8str_list;
32 
33 typedef int idmap_retcode;
34 
35 enum idmap_id_type {
36 	IDMAP_NONE = 0,
37 	IDMAP_UID = 1,
38 	IDMAP_GID = 1 + 1,
39 	IDMAP_SID = 1 + 2,
40 	IDMAP_USID = 1 + 3,
41 	IDMAP_GSID = 1 + 4,
42 	IDMAP_POSIXID = 1 + 5
43 };
44 typedef enum idmap_id_type idmap_id_type;
45 
46 enum idmap_map_type {
47 	IDMAP_MAP_TYPE_UNKNOWN = 0,
48 	IDMAP_MAP_TYPE_DS_AD = 0 + 1,
49 	IDMAP_MAP_TYPE_DS_NLDAP = 0 + 2,
50 	IDMAP_MAP_TYPE_RULE_BASED = 0 + 3,
51 	IDMAP_MAP_TYPE_EPHEMERAL = 0 + 4,
52 	IDMAP_MAP_TYPE_LOCAL_SID = 0 + 5,
53 	IDMAP_MAP_TYPE_KNOWN_SID = 0 + 6,
54 	IDMAP_MAP_TYPE_IDMU = 0 + 7
55 };
56 typedef enum idmap_map_type idmap_map_type;
57 
58 enum idmap_map_src {
59 	IDMAP_MAP_SRC_UNKNOWN = 0,
60 	IDMAP_MAP_SRC_NEW = 0 + 1,
61 	IDMAP_MAP_SRC_CACHE = 0 + 2,
62 	IDMAP_MAP_SRC_HARD_CODED = 0 + 3,
63 	IDMAP_MAP_SRC_ALGORITHMIC = 0 + 4
64 };
65 typedef enum idmap_map_src idmap_map_src;
66 
67 struct idmap_sid {
68 	char *prefix;
69 	uint32_t rid;
70 };
71 typedef struct idmap_sid idmap_sid;
72 
73 struct idmap_id {
74 	idmap_id_type idtype;
75 	union {
76 		uint32_t uid;
77 		uint32_t gid;
78 		idmap_sid sid;
79 		idmap_sid usid;
80 		idmap_sid gsid;
81 	} idmap_id_u;
82 };
83 typedef struct idmap_id idmap_id;
84 
85 struct idmap_namerule {
86 	bool_t is_user;
87 	bool_t is_wuser;
88 	int direction;
89 	idmap_utf8str windomain;
90 	idmap_utf8str winname;
91 	idmap_utf8str unixname;
92 	bool_t is_nt4;
93 };
94 typedef struct idmap_namerule idmap_namerule;
95 
96 struct idmap_namerules_res {
97 	idmap_retcode retcode;
98 	uint64_t lastrowid;
99 	struct {
100 		u_int rules_len;
101 		idmap_namerule *rules_val;
102 	} rules;
103 };
104 typedef struct idmap_namerules_res idmap_namerules_res;
105 
106 struct idmap_how_ds_based {
107 	idmap_utf8str dn;
108 	idmap_utf8str attr;
109 	idmap_utf8str value;
110 };
111 typedef struct idmap_how_ds_based idmap_how_ds_based;
112 
113 struct idmap_how {
114 	idmap_map_type map_type;
115 	union {
116 		idmap_how_ds_based ad;
117 		idmap_how_ds_based nldap;
118 		idmap_namerule rule;
119 		idmap_how_ds_based idmu;
120 	} idmap_how_u;
121 };
122 typedef struct idmap_how idmap_how;
123 
124 struct idmap_info {
125 	idmap_map_src src;
126 	idmap_how how;
127 	nvlist_t_ptr trace;
128 };
129 typedef struct idmap_info idmap_info;
130 
131 struct idmap_id_res {
132 	idmap_retcode retcode;
133 	idmap_id id;
134 	int direction;
135 	idmap_info info;
136 };
137 typedef struct idmap_id_res idmap_id_res;
138 
139 struct idmap_ids_res {
140 	idmap_retcode retcode;
141 	struct {
142 		u_int ids_len;
143 		idmap_id_res *ids_val;
144 	} ids;
145 };
146 typedef struct idmap_ids_res idmap_ids_res;
147 #define	IDMAP_REQ_FLG_NO_NEW_ID_ALLOC 0x00000001
148 #define	IDMAP_REQ_FLG_VALIDATE 0x00000002
149 #define	IDMAP_REQ_FLG_NO_NAMESERVICE 0x00000004
150 #define	IDMAP_REQ_FLG_MAPPING_INFO 0x00000008
151 #define	IDMAP_REQ_FLG_WK_OR_LOCAL_SIDS_ONLY 0x00000020
152 #define	IDMAP_REQ_FLG_TRACE 0x00000040
153 #define	IDMAP_DIRECTION_UNDEF -1
154 #define	IDMAP_DIRECTION_BI 0
155 #define	IDMAP_DIRECTION_W2U 1
156 #define	IDMAP_DIRECTION_U2W 2
157 
158 struct idmap_mapping {
159 	int32_t flag;
160 	int direction;
161 	idmap_id id1;
162 	idmap_utf8str id1domain;
163 	idmap_utf8str id1name;
164 	idmap_id id2;
165 	idmap_utf8str id2domain;
166 	idmap_utf8str id2name;
167 	idmap_info info;
168 };
169 typedef struct idmap_mapping idmap_mapping;
170 
171 typedef struct {
172 	u_int idmap_mapping_batch_len;
173 	idmap_mapping *idmap_mapping_batch_val;
174 } idmap_mapping_batch;
175 
176 struct idmap_mappings_res {
177 	idmap_retcode retcode;
178 	uint64_t lastrowid;
179 	struct {
180 		u_int mappings_len;
181 		idmap_mapping *mappings_val;
182 	} mappings;
183 };
184 typedef struct idmap_mappings_res idmap_mappings_res;
185 
186 struct idmap_update_res {
187 	idmap_retcode retcode;
188 	int64_t error_index;
189 	idmap_namerule error_rule;
190 	idmap_namerule conflict_rule;
191 };
192 typedef struct idmap_update_res idmap_update_res;
193 
194 enum idmap_opnum {
195 	OP_NONE = 0,
196 	OP_ADD_NAMERULE = 1,
197 	OP_RM_NAMERULE = 2,
198 	OP_FLUSH_NAMERULES = 3
199 };
200 typedef enum idmap_opnum idmap_opnum;
201 
202 struct idmap_update_op {
203 	idmap_opnum opnum;
204 	union {
205 		idmap_namerule rule;
206 	} idmap_update_op_u;
207 };
208 typedef struct idmap_update_op idmap_update_op;
209 
210 typedef struct {
211 	u_int idmap_update_batch_len;
212 	idmap_update_op *idmap_update_batch_val;
213 } idmap_update_batch;
214 #define	AD_DISC_MAXHOSTNAME 256
215 
216 struct idmap_ad_disc_ds_t {
217 	int port;
218 	int priority;
219 	int weight;
220 	char host[AD_DISC_MAXHOSTNAME];
221 };
222 typedef struct idmap_ad_disc_ds_t idmap_ad_disc_ds_t;
223 
224 enum idmap_prop_type {
225 	PROP_UNKNOWN = 0,
226 	PROP_LIST_SIZE_LIMIT = 1,
227 	PROP_DEFAULT_DOMAIN = 2,
228 	PROP_DOMAIN_NAME = 3,
229 	PROP_MACHINE_SID = 4,
230 	PROP_DOMAIN_CONTROLLER = 5,
231 	PROP_FOREST_NAME = 6,
232 	PROP_SITE_NAME = 7,
233 	PROP_GLOBAL_CATALOG = 8,
234 	PROP_AD_UNIXUSER_ATTR = 9,
235 	PROP_AD_UNIXGROUP_ATTR = 10,
236 	PROP_NLDAP_WINNAME_ATTR = 11,
237 	PROP_DIRECTORY_BASED_MAPPING = 12
238 };
239 typedef enum idmap_prop_type idmap_prop_type;
240 
241 struct idmap_prop_val {
242 	idmap_prop_type prop;
243 	union {
244 		uint64_t intval;
245 		idmap_utf8str utf8val;
246 		idmap_ad_disc_ds_t dsval;
247 	} idmap_prop_val_u;
248 };
249 typedef struct idmap_prop_val idmap_prop_val;
250 
251 struct idmap_prop_res {
252 	idmap_retcode retcode;
253 	idmap_prop_val value;
254 	bool_t auto_discovered;
255 };
256 typedef struct idmap_prop_res idmap_prop_res;
257 
258 enum idmap_flush_op {
259 	IDMAP_FLUSH_EXPIRE = 0,
260 	IDMAP_FLUSH_DELETE = 1
261 };
262 typedef enum idmap_flush_op idmap_flush_op;
263 
264 struct directory_error_rpc {
265 	idmap_utf8str code;
266 	idmap_utf8str fmt;
267 	struct {
268 		u_int params_len;
269 		idmap_utf8str *params_val;
270 	} params;
271 };
272 typedef struct directory_error_rpc directory_error_rpc;
273 
274 typedef struct {
275 	u_int directory_value_rpc_len;
276 	char *directory_value_rpc_val;
277 } directory_value_rpc;
278 
279 struct directory_values_rpc {
280 	bool_t found;
281 	union {
282 		struct {
283 			u_int values_len;
284 			directory_value_rpc *values_val;
285 		} values;
286 	} directory_values_rpc_u;
287 };
288 typedef struct directory_values_rpc directory_values_rpc;
289 
290 enum directory_lookup_status_rpc {
291 	DIRECTORY_NOT_FOUND = 0,
292 	DIRECTORY_FOUND = 1,
293 	DIRECTORY_ERROR = 2
294 };
295 typedef enum directory_lookup_status_rpc directory_lookup_status_rpc;
296 
297 struct directory_entry_rpc {
298 	directory_lookup_status_rpc status;
299 	union {
300 		struct {
301 			u_int attrs_len;
302 			directory_values_rpc *attrs_val;
303 		} attrs;
304 		directory_error_rpc err;
305 	} directory_entry_rpc_u;
306 };
307 typedef struct directory_entry_rpc directory_entry_rpc;
308 
309 struct directory_results_rpc {
310 	bool_t failed;
311 	union {
312 		directory_error_rpc err;
313 		struct {
314 			u_int entries_len;
315 			directory_entry_rpc *entries_val;
316 		} entries;
317 	} directory_results_rpc_u;
318 };
319 typedef struct directory_results_rpc directory_results_rpc;
320 
321 struct idmap_list_mappings_1_argument {
322 	int64_t lastrowid;
323 	uint64_t limit;
324 	int32_t flag;
325 };
326 typedef struct idmap_list_mappings_1_argument idmap_list_mappings_1_argument;
327 
328 struct idmap_list_namerules_1_argument {
329 	idmap_namerule rule;
330 	uint64_t lastrowid;
331 	uint64_t limit;
332 };
333 typedef struct idmap_list_namerules_1_argument idmap_list_namerules_1_argument;
334 
335 struct directory_get_common_1_argument {
336 	idmap_utf8str_list ids;
337 	idmap_utf8str types;
338 	idmap_utf8str_list attrs;
339 };
340 typedef struct directory_get_common_1_argument directory_get_common_1_argument;
341 
342 #define	IDMAP_PROG	100172
343 #define	IDMAP_V1	1
344 
345 #if defined(__STDC__) || defined(__cplusplus)
346 #define	IDMAP_NULL	0
347 extern  enum clnt_stat idmap_null_1(void *, CLIENT *);
348 extern  bool_t idmap_null_1_svc(void *, struct svc_req *);
349 #define	IDMAP_GET_MAPPED_IDS	1
350 extern  enum clnt_stat idmap_get_mapped_ids_1(idmap_mapping_batch , idmap_ids_res *, CLIENT *);
351 extern  bool_t idmap_get_mapped_ids_1_svc(idmap_mapping_batch , idmap_ids_res *, struct svc_req *);
352 #define	IDMAP_LIST_MAPPINGS	2
353 extern  enum clnt_stat idmap_list_mappings_1(int64_t , uint64_t , int32_t , idmap_mappings_res *, CLIENT *);
354 extern  bool_t idmap_list_mappings_1_svc(int64_t , uint64_t , int32_t , idmap_mappings_res *, struct svc_req *);
355 #define	IDMAP_LIST_NAMERULES	3
356 extern  enum clnt_stat idmap_list_namerules_1(idmap_namerule , uint64_t , uint64_t , idmap_namerules_res *, CLIENT *);
357 extern  bool_t idmap_list_namerules_1_svc(idmap_namerule , uint64_t , uint64_t , idmap_namerules_res *, struct svc_req *);
358 #define	IDMAP_UPDATE	4
359 extern  enum clnt_stat idmap_update_1(idmap_update_batch , idmap_update_res *, CLIENT *);
360 extern  bool_t idmap_update_1_svc(idmap_update_batch , idmap_update_res *, struct svc_req *);
361 #define	IDMAP_GET_MAPPED_ID_BY_NAME	5
362 extern  enum clnt_stat idmap_get_mapped_id_by_name_1(idmap_mapping , idmap_mappings_res *, CLIENT *);
363 extern  bool_t idmap_get_mapped_id_by_name_1_svc(idmap_mapping , idmap_mappings_res *, struct svc_req *);
364 #define	IDMAP_GET_PROP	6
365 extern  enum clnt_stat idmap_get_prop_1(idmap_prop_type , idmap_prop_res *, CLIENT *);
366 extern  bool_t idmap_get_prop_1_svc(idmap_prop_type , idmap_prop_res *, struct svc_req *);
367 #define	DIRECTORY_GET_COMMON	7
368 extern  enum clnt_stat directory_get_common_1(idmap_utf8str_list , idmap_utf8str , idmap_utf8str_list , directory_results_rpc *, CLIENT *);
369 extern  bool_t directory_get_common_1_svc(idmap_utf8str_list , idmap_utf8str , idmap_utf8str_list , directory_results_rpc *, struct svc_req *);
370 #define	IDMAP_FLUSH	8
371 extern  enum clnt_stat idmap_flush_1(idmap_flush_op , idmap_retcode *, CLIENT *);
372 extern  bool_t idmap_flush_1_svc(idmap_flush_op , idmap_retcode *, struct svc_req *);
373 extern int idmap_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);
374 
375 #else /* K&R C */
376 #define	IDMAP_NULL	0
377 extern  enum clnt_stat idmap_null_1();
378 extern  bool_t idmap_null_1_svc();
379 #define	IDMAP_GET_MAPPED_IDS	1
380 extern  enum clnt_stat idmap_get_mapped_ids_1();
381 extern  bool_t idmap_get_mapped_ids_1_svc();
382 #define	IDMAP_LIST_MAPPINGS	2
383 extern  enum clnt_stat idmap_list_mappings_1();
384 extern  bool_t idmap_list_mappings_1_svc();
385 #define	IDMAP_LIST_NAMERULES	3
386 extern  enum clnt_stat idmap_list_namerules_1();
387 extern  bool_t idmap_list_namerules_1_svc();
388 #define	IDMAP_UPDATE	4
389 extern  enum clnt_stat idmap_update_1();
390 extern  bool_t idmap_update_1_svc();
391 #define	IDMAP_GET_MAPPED_ID_BY_NAME	5
392 extern  enum clnt_stat idmap_get_mapped_id_by_name_1();
393 extern  bool_t idmap_get_mapped_id_by_name_1_svc();
394 #define	IDMAP_GET_PROP	6
395 extern  enum clnt_stat idmap_get_prop_1();
396 extern  bool_t idmap_get_prop_1_svc();
397 #define	DIRECTORY_GET_COMMON	7
398 extern  enum clnt_stat directory_get_common_1();
399 extern  bool_t directory_get_common_1_svc();
400 #define	IDMAP_FLUSH	8
401 extern  enum clnt_stat idmap_flush_1();
402 extern  bool_t idmap_flush_1_svc();
403 extern int idmap_prog_1_freeresult();
404 #endif /* K&R C */
405 
406 /* the xdr functions */
407 
408 #if defined(__STDC__) || defined(__cplusplus)
409 extern  bool_t xdr_idmap_utf8str(XDR *, idmap_utf8str*);
410 extern  bool_t xdr_idmap_utf8str_list(XDR *, idmap_utf8str_list*);
411 extern  bool_t xdr_idmap_retcode(XDR *, idmap_retcode*);
412 extern  bool_t xdr_idmap_id_type(XDR *, idmap_id_type*);
413 extern  bool_t xdr_idmap_map_type(XDR *, idmap_map_type*);
414 extern  bool_t xdr_idmap_map_src(XDR *, idmap_map_src*);
415 extern  bool_t xdr_idmap_sid(XDR *, idmap_sid*);
416 extern  bool_t xdr_idmap_id(XDR *, idmap_id*);
417 extern  bool_t xdr_idmap_namerule(XDR *, idmap_namerule*);
418 extern  bool_t xdr_idmap_namerules_res(XDR *, idmap_namerules_res*);
419 extern  bool_t xdr_idmap_how_ds_based(XDR *, idmap_how_ds_based*);
420 extern  bool_t xdr_idmap_how(XDR *, idmap_how*);
421 extern  bool_t xdr_idmap_info(XDR *, idmap_info*);
422 extern  bool_t xdr_idmap_id_res(XDR *, idmap_id_res*);
423 extern  bool_t xdr_idmap_ids_res(XDR *, idmap_ids_res*);
424 extern  bool_t xdr_idmap_mapping(XDR *, idmap_mapping*);
425 extern  bool_t xdr_idmap_mapping_batch(XDR *, idmap_mapping_batch*);
426 extern  bool_t xdr_idmap_mappings_res(XDR *, idmap_mappings_res*);
427 extern  bool_t xdr_idmap_update_res(XDR *, idmap_update_res*);
428 extern  bool_t xdr_idmap_opnum(XDR *, idmap_opnum*);
429 extern  bool_t xdr_idmap_update_op(XDR *, idmap_update_op*);
430 extern  bool_t xdr_idmap_update_batch(XDR *, idmap_update_batch*);
431 extern  bool_t xdr_idmap_ad_disc_ds_t(XDR *, idmap_ad_disc_ds_t*);
432 extern  bool_t xdr_idmap_prop_type(XDR *, idmap_prop_type*);
433 extern  bool_t xdr_idmap_prop_val(XDR *, idmap_prop_val*);
434 extern  bool_t xdr_idmap_prop_res(XDR *, idmap_prop_res*);
435 extern  bool_t xdr_idmap_flush_op(XDR *, idmap_flush_op*);
436 extern  bool_t xdr_directory_error_rpc(XDR *, directory_error_rpc*);
437 extern  bool_t xdr_directory_value_rpc(XDR *, directory_value_rpc*);
438 extern  bool_t xdr_directory_values_rpc(XDR *, directory_values_rpc*);
439 extern  bool_t xdr_directory_lookup_status_rpc(XDR *, directory_lookup_status_rpc*);
440 extern  bool_t xdr_directory_entry_rpc(XDR *, directory_entry_rpc*);
441 extern  bool_t xdr_directory_results_rpc(XDR *, directory_results_rpc*);
442 extern  bool_t xdr_idmap_list_mappings_1_argument(XDR *, idmap_list_mappings_1_argument*);
443 extern  bool_t xdr_idmap_list_namerules_1_argument(XDR *, idmap_list_namerules_1_argument*);
444 extern  bool_t xdr_directory_get_common_1_argument(XDR *, directory_get_common_1_argument*);
445 
446 #else /* K&R C */
447 extern bool_t xdr_idmap_utf8str();
448 extern bool_t xdr_idmap_utf8str_list();
449 extern bool_t xdr_idmap_retcode();
450 extern bool_t xdr_idmap_id_type();
451 extern bool_t xdr_idmap_map_type();
452 extern bool_t xdr_idmap_map_src();
453 extern bool_t xdr_idmap_sid();
454 extern bool_t xdr_idmap_id();
455 extern bool_t xdr_idmap_namerule();
456 extern bool_t xdr_idmap_namerules_res();
457 extern bool_t xdr_idmap_how_ds_based();
458 extern bool_t xdr_idmap_how();
459 extern bool_t xdr_idmap_info();
460 extern bool_t xdr_idmap_id_res();
461 extern bool_t xdr_idmap_ids_res();
462 extern bool_t xdr_idmap_mapping();
463 extern bool_t xdr_idmap_mapping_batch();
464 extern bool_t xdr_idmap_mappings_res();
465 extern bool_t xdr_idmap_update_res();
466 extern bool_t xdr_idmap_opnum();
467 extern bool_t xdr_idmap_update_op();
468 extern bool_t xdr_idmap_update_batch();
469 extern bool_t xdr_idmap_ad_disc_ds_t();
470 extern bool_t xdr_idmap_prop_type();
471 extern bool_t xdr_idmap_prop_val();
472 extern bool_t xdr_idmap_prop_res();
473 extern bool_t xdr_idmap_flush_op();
474 extern bool_t xdr_directory_error_rpc();
475 extern bool_t xdr_directory_value_rpc();
476 extern bool_t xdr_directory_values_rpc();
477 extern bool_t xdr_directory_lookup_status_rpc();
478 extern bool_t xdr_directory_entry_rpc();
479 extern bool_t xdr_directory_results_rpc();
480 extern bool_t xdr_idmap_list_mappings_1_argument();
481 extern bool_t xdr_idmap_list_namerules_1_argument();
482 extern bool_t xdr_directory_get_common_1_argument();
483 
484 #endif /* K&R C */
485 
486 #ifdef __cplusplus
487 }
488 #endif
489 
490 #endif /* !_IDMAP_PROT_H_RPCGEN */
491