Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/rpcsvc/nis.h
$ cat -n /usr/include/rpcsvc/nis.h 1 /* 2 * Copyright (c) 2010, Oracle America, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: 7 * 8 * * Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * * Redistributions in binary form must reproduce the above 11 * copyright notice, this list of conditions and the following 12 * disclaimer in the documentation and/or other materials 13 * provided with the distribution. 14 * * Neither the name of the "Oracle America, Inc." nor the names of its 15 * contributors may be used to endorse or promote products derived 16 * from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _RPCSVC_NIS_H 33 #define _RPCSVC_NIS_H 1 34 35 #include
36 #include
37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 41 42 /* 43 * nis.h 44 * 45 * This file is the main include file for NIS clients. It contains 46 * both the client library function defines and the various data 47 * structures used by the NIS service. It includes the file nis_tags.h 48 * which defines the tag values. This allows the tags to change without 49 * having to change the nis.x file. 50 * 51 * NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO 52 * ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN ! 53 * 54 * I have removed all the Solaris internal structs and variables, 55 * because they are not supported, Sun changed them between various 56 * releases and they shouldn't be used in user programs. 57 *
58 */ 59 60 61 #ifndef __nis_object_h 62 #define __nis_object_h 63 64 #define NIS_MAXSTRINGLEN 255 65 #define NIS_MAXNAMELEN 1024 66 #define NIS_MAXATTRNAME 32 67 #define NIS_MAXATTRVAL 2048 68 #define NIS_MAXCOLUMNS 64 69 #define NIS_MAXATTR 16 70 #define NIS_MAXPATH 1024 71 #define NIS_MAXREPLICAS 128 72 #define NIS_MAXLINKS 16 73 #define NIS_PK_NONE 0 74 #define NIS_PK_DH 1 75 #define NIS_PK_RSA 2 76 #define NIS_PK_KERB 3 77 #define NIS_PK_DHEXT 4 78 79 struct nis_attr { 80 char *zattr_ndx; 81 struct { 82 u_int zattr_val_len; 83 char *zattr_val_val; 84 } zattr_val; 85 }; 86 typedef struct nis_attr nis_attr; 87 88 typedef char *nis_name; 89 90 enum zotypes { 91 BOGUS_OBJ = 0, 92 NO_OBJ = 1, 93 DIRECTORY_OBJ = 2, 94 GROUP_OBJ = 3, 95 TABLE_OBJ = 4, 96 ENTRY_OBJ = 5, 97 LINK_OBJ = 6, 98 PRIVATE_OBJ = 7, 99 NIS_BOGUS_OBJ = 0, 100 NIS_NO_OBJ = 1, 101 NIS_DIRECTORY_OBJ = 2, 102 NIS_GROUP_OBJ = 3, 103 NIS_TABLE_OBJ = 4, 104 NIS_ENTRY_OBJ = 5, 105 NIS_LINK_OBJ = 6, 106 NIS_PRIVATE_OBJ = 7 107 }; 108 typedef enum zotypes zotypes; 109 110 enum nstype { 111 UNKNOWN = 0, 112 NIS = 1, 113 SUNYP = 2, 114 IVY = 3, 115 DNS = 4, 116 X500 = 5, 117 DNANS = 6, 118 XCHS = 7, 119 CDS = 8, 120 }; 121 typedef enum nstype nstype; 122 123 struct oar_mask { 124 uint32_t oa_rights; 125 zotypes oa_otype; 126 }; 127 typedef struct oar_mask oar_mask; 128 129 struct endpoint { 130 char *uaddr; 131 char *family; 132 char *proto; 133 }; 134 typedef struct endpoint endpoint; 135 136 struct nis_server { 137 nis_name name; 138 struct { 139 u_int ep_len; 140 endpoint *ep_val; 141 } ep; 142 uint32_t key_type; 143 netobj pkey; 144 }; 145 typedef struct nis_server nis_server; 146 147 struct directory_obj { 148 nis_name do_name; 149 nstype do_type; 150 struct { 151 u_int do_servers_len; 152 nis_server *do_servers_val; 153 } do_servers; 154 uint32_t do_ttl; 155 struct { 156 u_int do_armask_len; 157 oar_mask *do_armask_val; 158 } do_armask; 159 }; 160 typedef struct directory_obj directory_obj; 161 162 #define EN_BINARY 1 163 #define EN_CRYPT 2 164 #define EN_XDR 4 165 #define EN_MODIFIED 8 166 #define EN_ASN1 64 167 168 struct entry_col { 169 uint32_t ec_flags; 170 struct { 171 u_int ec_value_len; 172 char *ec_value_val; 173 } ec_value; 174 }; 175 typedef struct entry_col entry_col; 176 177 struct entry_obj { 178 char *en_type; 179 struct { 180 u_int en_cols_len; 181 entry_col *en_cols_val; 182 } en_cols; 183 }; 184 typedef struct entry_obj entry_obj; 185 186 struct group_obj { 187 uint32_t gr_flags; 188 struct { 189 u_int gr_members_len; 190 nis_name *gr_members_val; 191 } gr_members; 192 }; 193 typedef struct group_obj group_obj; 194 195 struct link_obj { 196 zotypes li_rtype; 197 struct { 198 u_int li_attrs_len; 199 nis_attr *li_attrs_val; 200 } li_attrs; 201 nis_name li_name; 202 }; 203 typedef struct link_obj link_obj; 204 205 #define TA_BINARY 1 206 #define TA_CRYPT 2 207 #define TA_XDR 4 208 #define TA_SEARCHABLE 8 209 #define TA_CASE 16 210 #define TA_MODIFIED 32 211 #define TA_ASN1 64 212 213 struct table_col { 214 char *tc_name; 215 uint32_t tc_flags; 216 uint32_t tc_rights; 217 }; 218 typedef struct table_col table_col; 219 220 struct table_obj { 221 char *ta_type; 222 int ta_maxcol; 223 u_char ta_sep; 224 struct { 225 u_int ta_cols_len; 226 table_col *ta_cols_val; 227 } ta_cols; 228 char *ta_path; 229 }; 230 typedef struct table_obj table_obj; 231 232 struct objdata { 233 zotypes zo_type; 234 union { 235 struct directory_obj di_data; 236 struct group_obj gr_data; 237 struct table_obj ta_data; 238 struct entry_obj en_data; 239 struct link_obj li_data; 240 struct { 241 u_int po_data_len; 242 char *po_data_val; 243 } po_data; 244 } objdata_u; 245 }; 246 typedef struct objdata objdata; 247 248 struct nis_oid { 249 uint32_t ctime; 250 uint32_t mtime; 251 }; 252 typedef struct nis_oid nis_oid; 253 254 struct nis_object { 255 nis_oid zo_oid; 256 nis_name zo_name; 257 nis_name zo_owner; 258 nis_name zo_group; 259 nis_name zo_domain; 260 uint32_t zo_access; 261 uint32_t zo_ttl; 262 objdata zo_data; 263 }; 264 typedef struct nis_object nis_object; 265 266 #endif /* if __nis_object_h */ 267 268 enum nis_error { 269 NIS_SUCCESS = 0, 270 NIS_S_SUCCESS = 1, 271 NIS_NOTFOUND = 2, 272 NIS_S_NOTFOUND = 3, 273 NIS_CACHEEXPIRED = 4, 274 NIS_NAMEUNREACHABLE = 5, 275 NIS_UNKNOWNOBJ = 6, 276 NIS_TRYAGAIN = 7, 277 NIS_SYSTEMERROR = 8, 278 NIS_CHAINBROKEN = 9, 279 NIS_PERMISSION = 10, 280 NIS_NOTOWNER = 11, 281 NIS_NOT_ME = 12, 282 NIS_NOMEMORY = 13, 283 NIS_NAMEEXISTS = 14, 284 NIS_NOTMASTER = 15, 285 NIS_INVALIDOBJ = 16, 286 NIS_BADNAME = 17, 287 NIS_NOCALLBACK = 18, 288 NIS_CBRESULTS = 19, 289 NIS_NOSUCHNAME = 20, 290 NIS_NOTUNIQUE = 21, 291 NIS_IBMODERROR = 22, 292 NIS_NOSUCHTABLE = 23, 293 NIS_TYPEMISMATCH = 24, 294 NIS_LINKNAMEERROR = 25, 295 NIS_PARTIAL = 26, 296 NIS_TOOMANYATTRS = 27, 297 NIS_RPCERROR = 28, 298 NIS_BADATTRIBUTE = 29, 299 NIS_NOTSEARCHABLE = 30, 300 NIS_CBERROR = 31, 301 NIS_FOREIGNNS = 32, 302 NIS_BADOBJECT = 33, 303 NIS_NOTSAMEOBJ = 34, 304 NIS_MODFAIL = 35, 305 NIS_BADREQUEST = 36, 306 NIS_NOTEMPTY = 37, 307 NIS_COLDSTART_ERR = 38, 308 NIS_RESYNC = 39, 309 NIS_FAIL = 40, 310 NIS_UNAVAIL = 41, 311 NIS_RES2BIG = 42, 312 NIS_SRVAUTH = 43, 313 NIS_CLNTAUTH = 44, 314 NIS_NOFILESPACE = 45, 315 NIS_NOPROC = 46, 316 NIS_DUMPLATER = 47, 317 }; 318 typedef enum nis_error nis_error; 319 320 struct nis_result { 321 nis_error status; 322 struct { 323 u_int objects_len; 324 nis_object *objects_val; 325 } objects; 326 netobj cookie; 327 uint32_t zticks; 328 uint32_t dticks; 329 uint32_t aticks; 330 uint32_t cticks; 331 }; 332 typedef struct nis_result nis_result; 333 334 struct ns_request { 335 nis_name ns_name; 336 struct { 337 u_int ns_object_len; 338 nis_object *ns_object_val; 339 } ns_object; 340 }; 341 typedef struct ns_request ns_request; 342 343 struct ib_request { 344 nis_name ibr_name; 345 struct { 346 u_int ibr_srch_len; 347 nis_attr *ibr_srch_val; 348 } ibr_srch; 349 uint32_t ibr_flags; 350 struct { 351 u_int ibr_obj_len; 352 nis_object *ibr_obj_val; 353 } ibr_obj; 354 struct { 355 u_int ibr_cbhost_len; 356 nis_server *ibr_cbhost_val; 357 } ibr_cbhost; 358 u_int ibr_bufsize; 359 netobj ibr_cookie; 360 }; 361 typedef struct ib_request ib_request; 362 363 struct ping_args { 364 nis_name dir; 365 uint32_t stamp; 366 }; 367 typedef struct ping_args ping_args; 368 369 enum log_entry_t { 370 LOG_NOP = 0, 371 ADD_NAME = 1, 372 REM_NAME = 2, 373 MOD_NAME_OLD = 3, 374 MOD_NAME_NEW = 4, 375 ADD_IBASE = 5, 376 REM_IBASE = 6, 377 MOD_IBASE = 7, 378 UPD_STAMP = 8, 379 }; 380 typedef enum log_entry_t log_entry_t; 381 382 struct log_entry { 383 uint32_t le_time; 384 log_entry_t le_type; 385 nis_name le_princp; 386 nis_name le_name; 387 struct { 388 u_int le_attrs_len; 389 nis_attr *le_attrs_val; 390 } le_attrs; 391 nis_object le_object; 392 }; 393 typedef struct log_entry log_entry; 394 395 struct log_result { 396 nis_error lr_status; 397 netobj lr_cookie; 398 struct { 399 u_int lr_entries_len; 400 log_entry *lr_entries_val; 401 } lr_entries; 402 }; 403 typedef struct log_result log_result; 404 405 struct cp_result { 406 nis_error cp_status; 407 uint32_t cp_zticks; 408 uint32_t cp_dticks; 409 }; 410 typedef struct cp_result cp_result; 411 412 struct nis_tag { 413 uint32_t tag_type; 414 char *tag_val; 415 }; 416 typedef struct nis_tag nis_tag; 417 418 struct nis_taglist { 419 struct { 420 u_int tags_len; 421 nis_tag *tags_val; 422 } tags; 423 }; 424 typedef struct nis_taglist nis_taglist; 425 426 struct dump_args { 427 nis_name da_dir; 428 uint32_t da_time; 429 struct { 430 u_int da_cbhost_len; 431 nis_server *da_cbhost_val; 432 } da_cbhost; 433 }; 434 typedef struct dump_args dump_args; 435 436 struct fd_args { 437 nis_name dir_name; 438 nis_name requester; 439 }; 440 typedef struct fd_args fd_args; 441 442 struct fd_result { 443 nis_error status; 444 nis_name source; 445 struct { 446 u_int dir_data_len; 447 char *dir_data_val; 448 } dir_data; 449 struct { 450 u_int signature_len; 451 char *signature_val; 452 } signature; 453 }; 454 typedef struct fd_result fd_result; 455 456 /* Generic client creating flags */ 457 #define ZMH_VC 1 458 #define ZMH_DG 2 459 #define ZMH_AUTH 4 460 461 /* Testing Access rights for objects */ 462 463 #define NIS_READ_ACC 1 464 #define NIS_MODIFY_ACC 2 465 #define NIS_CREATE_ACC 4 466 #define NIS_DESTROY_ACC 8 467 /* Test macros. a == access rights, m == desired rights. */ 468 #define NIS_WORLD(a, m) (((a) & (m)) != 0) 469 #define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0) 470 #define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0) 471 #define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0) 472 /* 473 * EOL Alert - The following non-prefixed test macros are 474 * here for backward compatibility, and will be not be present 475 * in future releases - use the NIS_*() macros above. 476 */ 477 #define WORLD(a, m) (((a) & (m)) != 0) 478 #define GROUP(a, m) (((a) & ((m) << 8)) != 0) 479 #define OWNER(a, m) (((a) & ((m) << 16)) != 0) 480 #define NOBODY(a, m) (((a) & ((m) << 24)) != 0) 481 482 #define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype) 483 #define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights) 484 #define WORLD_DEFAULT (NIS_READ_ACC) 485 #define GROUP_DEFAULT (NIS_READ_ACC << 8) 486 #define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\ 487 NIS_DESTROY_ACC) << 16) 488 #define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT) 489 490 /* Result manipulation defines ... */ 491 #define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len) 492 #define NIS_RES_OBJECT(x) ((x)->objects.objects_val) 493 #define NIS_RES_COOKIE(x) ((x)->cookie) 494 #define NIS_RES_STATUS(x) ((x)->status) 495 496 /* These defines make getting at the variant part of the object easier. */ 497 #define TA_data zo_data.objdata_u.ta_data 498 #define EN_data zo_data.objdata_u.en_data 499 #define DI_data zo_data.objdata_u.di_data 500 #define LI_data zo_data.objdata_u.li_data 501 #define GR_data zo_data.objdata_u.gr_data 502 503 #define __type_of(o) ((o)->zo_data.zo_type) 504 505 /* Declarations for the internal subroutines in nislib.c */ 506 enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME}; 507 typedef enum name_pos name_pos; 508 509 /* 510 * Defines for getting at column data in entry objects. Because RPCGEN 511 * generates some rather wordy structures, we create some defines that 512 * collapse the needed keystrokes to access a particular value using 513 * these definitions they take an nis_object *, and an int and return 514 * a u_char * for Value, and an int for length. 515 */ 516 #define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val 517 #define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len 518 519 520 /* Prototypes, and extern declarations for the NIS library functions. */ 521 #include
522 #endif 523 524 /* 525 * nis_3.h 526 * 527 * This file contains definitions that are only of interest to the actual 528 * service daemon and client stubs. Normal users of NIS will not include 529 * this file. 530 * 531 * NOTE : This include file is automatically created by a combination 532 * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead 533 * and then remake this file. 534 */ 535 #ifndef __nis_3_h 536 #define __nis_3_h 537 538 #define NIS_PROG 100300 539 #define NIS_VERSION 3 540 541 #define NIS_LOOKUP 1 542 extern nis_result * nis_lookup_3 (ns_request *, CLIENT *); 543 extern nis_result * nis_lookup_3_svc (ns_request *, struct svc_req *); 544 #define NIS_ADD 2 545 extern nis_result * nis_add_3 (ns_request *, CLIENT *); 546 extern nis_result * nis_add_3_svc (ns_request *, struct svc_req *); 547 #define NIS_MODIFY 3 548 extern nis_result * nis_modify_3 (ns_request *, CLIENT *); 549 extern nis_result * nis_modify_3_svc (ns_request *, struct svc_req *); 550 #define NIS_REMOVE 4 551 extern nis_result * nis_remove_3 (ns_request *, CLIENT *); 552 extern nis_result * nis_remove_3_svc (ns_request *, struct svc_req *); 553 #define NIS_IBLIST 5 554 extern nis_result * nis_iblist_3 (ib_request *, CLIENT *); 555 extern nis_result * nis_iblist_3_svc (ib_request *, struct svc_req *); 556 #define NIS_IBADD 6 557 extern nis_result * nis_ibadd_3 (ib_request *, CLIENT *); 558 extern nis_result * nis_ibadd_3_svc (ib_request *, struct svc_req *); 559 #define NIS_IBMODIFY 7 560 extern nis_result * nis_ibmodify_3 (ib_request *, CLIENT *); 561 extern nis_result * nis_ibmodify_3_svc (ib_request *, struct svc_req *) 562 ; 563 #define NIS_IBREMOVE 8 564 extern nis_result * nis_ibremove_3 (ib_request *, CLIENT *); 565 extern nis_result * nis_ibremove_3_svc (ib_request *, struct svc_req *) 566 ; 567 #define NIS_IBFIRST 9 568 extern nis_result * nis_ibfirst_3 (ib_request *, CLIENT *); 569 extern nis_result * nis_ibfirst_3_svc (ib_request *, struct svc_req *) 570 ; 571 #define NIS_IBNEXT 10 572 extern nis_result * nis_ibnext_3 (ib_request *, CLIENT *); 573 extern nis_result * nis_ibnext_3_svc (ib_request *, struct svc_req *); 574 #define NIS_FINDDIRECTORY 12 575 extern fd_result * nis_finddirectory_3 (fd_args *, CLIENT *); 576 extern fd_result * nis_finddirectory_3_svc (fd_args *, 577 struct svc_req *); 578 #define NIS_STATUS 14 579 extern nis_taglist * nis_status_3 (nis_taglist *, CLIENT *); 580 extern nis_taglist * nis_status_3_svc (nis_taglist *, struct svc_req *) 581 ; 582 #define NIS_DUMPLOG 15 583 extern log_result * nis_dumplog_3 (dump_args *, CLIENT *); 584 extern log_result * nis_dumplog_3_svc (dump_args *, struct svc_req *); 585 #define NIS_DUMP 16 586 extern log_result * nis_dump_3 (dump_args *, CLIENT *); 587 extern log_result * nis_dump_3_svc (dump_args *, struct svc_req *); 588 #define NIS_CALLBACK 17 589 extern bool_t * nis_callback_3 (netobj *, CLIENT *); 590 extern bool_t * nis_callback_3_svc (netobj *, struct svc_req *); 591 #define NIS_CPTIME 18 592 extern uint32_t * nis_cptime_3 (nis_name *, CLIENT *); 593 extern uint32_t * nis_cptime_3_svc (nis_name *, struct svc_req *); 594 #define NIS_CHECKPOINT 19 595 extern cp_result * nis_checkpoint_3 (nis_name *, CLIENT *); 596 extern cp_result * nis_checkpoint_3_svc (nis_name *, struct svc_req *) 597 ; 598 #define NIS_PING 20 599 extern void * nis_ping_3 (ping_args *, CLIENT *); 600 extern void * nis_ping_3_svc (ping_args *, struct svc_req *); 601 #define NIS_SERVSTATE 21 602 extern nis_taglist * nis_servstate_3 (nis_taglist *, CLIENT *); 603 extern nis_taglist * nis_servstate_3_svc (nis_taglist *, 604 struct svc_req *); 605 #define NIS_MKDIR 22 606 extern nis_error * nis_mkdir_3 (nis_name *, CLIENT *); 607 extern nis_error * nis_mkdir_3_svc (nis_name *, struct svc_req *); 608 #define NIS_RMDIR 23 609 extern nis_error * nis_rmdir_3 (nis_name *, CLIENT *); 610 extern nis_error * nis_rmdir_3_svc (nis_name *, struct svc_req *); 611 #define NIS_UPDKEYS 24 612 extern nis_error * nis_updkeys_3 (nis_name *, CLIENT *); 613 extern nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *); 614 615 #ifdef __cplusplus 616 } 617 #endif 618 619 #endif /* ! _RPCSVC_NIS_H */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™