# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # Copyright (c) 2012 by Delphix. All rights reserved. # # uts/common/rpcsvc/Makefile # This makefile installs system header files that go into # /usr/include/rpcsvc. # # include global definitions include ../../../Makefile.master # Protocol descriptions. Alas, the NFS protocol cannot be expressed # completely via rpcgen. The NLM description should go here some day. # Also, the v3 headers have been hacked so that they no longer # quite reflect what goes over the wire. IDMAP_PROT_X= idmap_prot.x RPCGEN_SRC= sm_inter.x nsm_addr.x # Hammerhead: autofs_prot.h, nlm_prot.h, idmap_prot.h are pre-generated # and checked into the repo. rpcgen + GNU cpp truncates %#define output. PREGENERATED_HDRS= autofs_prot.h nlm_prot.h idmap_prot.h # Hammerhead: pre-generated (rpcgen + GNU cpp truncation bug) # Headers are now committed source files, not derived. DERIVED_HDRS= $(RPCGEN_SRC:%.x=%.h) ALLHDRS= $(RPCGEN_SRC) $(DERIVED_HDRS) $(PREGENERATED_HDRS) \ $(IDMAP_PROT_X) autofs_prot.x nlm_prot.x ROOTDIRS= $(ROOT)/usr/include/rpcsvc ROOTHDRS= $(ALLHDRS:%=$(ROOTDIRS)/%) RPCGENFLAGS = -C # Hammerhead: GNU Make target-specific syntax (was dmake :=) idmap_prot.h: RPCGENFLAGS += -MN nlm_prot.h: RPCGENFLAGS += -M sm_inter.h: RPCGENFLAGS += -M nsm_addr.h: RPCGENFLAGS += -M $(ROOTDIRS)/%: % $(INS.file) .KEEP_STATE: # all_h permits derived headers to be built here in the uts source area # for the kernel to reference, without going so far as to install them. # all_h: $(DERIVED_HDRS) install_h: all_h $(ROOTDIRS) $(ROOTHDRS) clean: @# Hammerhead: pre-generated files are permanent source, do not delete @true clobber: clean # Don't check rpcgen-derived files. check: $(ROOTDIRS): $(INS.dir) # Hammerhead: pre-generated (rpcgen + GNU cpp truncation bug) # %.h: %.x # $(RPCGEN) $(RPCGENFLAGS) -h $< -o $@ /* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _AUTOFS_PROT_H_RPCGEN #define _AUTOFS_PROT_H_RPCGEN #include #ifdef __cplusplus extern "C" { #endif /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include #include #include #include #define xdr_dev_t xdr_u_int #define xdr_bool_t xdr_bool #define AUTOFS_MAXPATHLEN 1024 #define AUTOFS_MAXCOMPONENTLEN 255 #define AUTOFS_MAXOPTSLEN 1024 #define AUTOFS_DAEMONCOOKIE 100000 enum autofs_stat { AUTOFS_ACTION = 0, AUTOFS_DONE = 1 }; typedef enum autofs_stat autofs_stat; enum autofs_action { AUTOFS_MOUNT_RQ = 0, AUTOFS_LINK_RQ = 1, AUTOFS_NONE = 2 }; typedef enum autofs_action autofs_action; enum autofs_res { AUTOFS_OK = 0, AUTOFS_NOENT = 2, AUTOFS_ECOMM = 5, AUTOFS_NOMEM = 12, AUTOFS_NOTDIR = 20, AUTOFS_SHUTDOWN = 1000 }; typedef enum autofs_res autofs_res; struct autofs_lookupargs { char *map; char *path; char *name; char *subdir; char *opts; bool_t isdirect; uid_t uid; }; typedef struct autofs_lookupargs autofs_lookupargs; struct linka { char *dir; char *link; }; typedef struct linka linka; struct autofs_args { struct netbuf addr; char *path; char *opts; char *map; char *subdir; char *key; int mount_to; int rpc_to; int direct; }; typedef struct autofs_args autofs_args; #ifdef _SYSCALL32 /* * This is an LP64 representation of the ILP32 autofs_args data structure * for use by autofs_mount which may receive the data structure "raw" * from a 32-bit program without being processed by XDR. rpcgen doesn't * need to see this structure since RPC/XDR only deals with the "native" * version of autofs_args. If this isn't hidden from rpcgen then it will * insist on generating unnecessary code to deal with it. */ struct autofs_args32 { struct netbuf32 addr; /* daemon address */ caddr32_t path; /* autofs mountpoint */ caddr32_t opts; /* default mount options */ caddr32_t map; /* name of map */ caddr32_t subdir; /* subdir within map */ caddr32_t key; /* used in direct mounts */ int32_t mount_to; /* time in sec the fs is to remain */ /* mounted after last reference */ int32_t rpc_to; /* timeout for rpc calls */ int32_t direct; /* 1 = direct mount */ }; #endif /* _SYSCALL32 */ struct action_list_entry { autofs_action action; union { struct mounta mounta; struct linka linka; } action_list_entry_u; }; typedef struct action_list_entry action_list_entry; struct action_list { action_list_entry action; struct action_list *next; }; typedef struct action_list action_list; struct mount_result_type { autofs_stat status; union { action_list *list; int error; } mount_result_type_u; }; typedef struct mount_result_type mount_result_type; struct autofs_mountres { mount_result_type mr_type; int mr_verbose; }; typedef struct autofs_mountres autofs_mountres; struct lookup_result_type { autofs_action action; union { struct linka lt_linka; } lookup_result_type_u; }; typedef struct lookup_result_type lookup_result_type; struct autofs_lookupres { enum autofs_res lu_res; lookup_result_type lu_type; int lu_verbose; }; typedef struct autofs_lookupres autofs_lookupres; struct umntrequest { bool_t isdirect; char *mntresource; char *mntpnt; char *fstype; char *mntopts; struct umntrequest *next; }; typedef struct umntrequest umntrequest; struct umntres { int status; }; typedef struct umntres umntres; struct autofs_rddirargs { char *rda_map; u_int rda_offset; u_int rda_count; uid_t uid; }; typedef struct autofs_rddirargs autofs_rddirargs; struct autofsrddir { u_int rddir_offset; u_int rddir_size; bool_t rddir_eof; struct dirent64 *rddir_entries; }; typedef struct autofsrddir autofsrddir; struct autofs_rddirres { enum autofs_res rd_status; u_int rd_bufsize; struct autofsrddir rd_rddir; }; typedef struct autofs_rddirres autofs_rddirres; /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_autofs_stat(XDR *, autofs_stat*); extern bool_t xdr_autofs_action(XDR *, autofs_action*); extern bool_t xdr_autofs_res(XDR *, autofs_res*); extern bool_t xdr_autofs_lookupargs(XDR *, autofs_lookupargs*); extern bool_t xdr_linka(XDR *, linka*); extern bool_t xdr_autofs_args(XDR *, autofs_args*); extern bool_t xdr_action_list_entry(XDR *, action_list_entry*); extern bool_t xdr_action_list(XDR *, action_list*); extern bool_t xdr_mount_result_type(XDR *, mount_result_type*); extern bool_t xdr_autofs_mountres(XDR *, autofs_mountres*); extern bool_t xdr_lookup_result_type(XDR *, lookup_result_type*); extern bool_t xdr_autofs_lookupres(XDR *, autofs_lookupres*); extern bool_t xdr_umntrequest(XDR *, umntrequest*); extern bool_t xdr_umntres(XDR *, umntres*); extern bool_t xdr_autofs_rddirargs(XDR *, autofs_rddirargs*); extern bool_t xdr_autofsrddir(XDR *, autofsrddir*); extern bool_t xdr_autofs_rddirres(XDR *, autofs_rddirres*); #else /* K&R C */ extern bool_t xdr_autofs_stat(); extern bool_t xdr_autofs_action(); extern bool_t xdr_autofs_res(); extern bool_t xdr_autofs_lookupargs(); extern bool_t xdr_linka(); extern bool_t xdr_autofs_args(); extern bool_t xdr_action_list_entry(); extern bool_t xdr_action_list(); extern bool_t xdr_mount_result_type(); extern bool_t xdr_autofs_mountres(); extern bool_t xdr_lookup_result_type(); extern bool_t xdr_autofs_lookupres(); extern bool_t xdr_umntrequest(); extern bool_t xdr_umntres(); extern bool_t xdr_autofs_rddirargs(); extern bool_t xdr_autofsrddir(); extern bool_t xdr_autofs_rddirres(); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_AUTOFS_PROT_H_RPCGEN */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ %/* % * Copyright 2007 Sun Microsystems, Inc. All rights reserved. % * Use is subject to license terms. % */ % %#include %#include %#include %#include % %#define xdr_dev_t xdr_u_int %#define xdr_bool_t xdr_bool % /* * Autofs/automountd communication protocol. */ const AUTOFS_MAXPATHLEN = 1024; const AUTOFS_MAXCOMPONENTLEN = 255; const AUTOFS_MAXOPTSLEN = 1024; const AUTOFS_DAEMONCOOKIE = 100000; /* * Action Status * Automountd replies to autofs indicating whether the operation is done, * or further action needs to be taken by autofs. */ enum autofs_stat { AUTOFS_ACTION=0, /* list of actions included */ AUTOFS_DONE=1 /* no further action required by kernel */ }; /* * Used by autofs to either create a link, or mount a new filesystem. */ enum autofs_action { AUTOFS_MOUNT_RQ=0, /* mount request */ AUTOFS_LINK_RQ=1, /* link create */ AUTOFS_NONE=2 /* no action */ }; enum autofs_res { AUTOFS_OK=0, AUTOFS_NOENT=2, AUTOFS_ECOMM=5, AUTOFS_NOMEM=12, AUTOFS_NOTDIR=20, AUTOFS_SHUTDOWN=1000 }; /* * Lookup/Mount request. * Argument structure passed to both autofs_lookup() and autofs_mount(). * autofs_lookup(): * Query automountd if 'path/subdir/name' exists in 'map' * autofs_mount(): * Request automountd to mount the map entry associated with * 'path/subdir/name' in 'map' given 'opts' options. */ struct autofs_lookupargs { string map; /* context or map name */ string path; /* mountpoint */ string name; /* entry we're looking for */ string subdir; /* subdir within map */ string opts; bool_t isdirect; /* direct mountpoint? */ uid_t uid; /* uid of caller */ }; /* * Symbolic link information. */ struct linka { string dir; /* original name */ string link; /* link (new) name */ }; /* * We don't define netbuf in RPCL, we include the header file that * includes it, and implement the xdr function ourselves. */ /* * Autofs Mount specific information - used to mount a new * autofs filesystem. */ struct autofs_args { struct netbuf addr; /* daemon address */ string path; /* autofs mountpoint */ string opts; /* default mount options */ string map; /* name of map */ string subdir; /* subdir within map */ string key; /* used in direct mounts only */ int mount_to; /* time in sec the fs is to remain */ /* mounted after last reference */ int rpc_to; /* timeout for rpc calls */ int direct; /* 1 = direct mount */ }; %#ifdef _SYSCALL32 %/* % * This is an LP64 representation of the ILP32 autofs_args data structure % * for use by autofs_mount which may receive the data structure "raw" % * from a 32-bit program without being processed by XDR. rpcgen doesn't % * need to see this structure since RPC/XDR only deals with the "native" % * version of autofs_args. If this isn't hidden from rpcgen then it will % * insist on generating unnecessary code to deal with it. % */ %struct autofs_args32 { % struct netbuf32 addr; /* daemon address */ % caddr32_t path; /* autofs mountpoint */ % caddr32_t opts; /* default mount options */ % caddr32_t map; /* name of map */ % caddr32_t subdir; /* subdir within map */ % caddr32_t key; /* used in direct mounts */ % int32_t mount_to; /* time in sec the fs is to remain */ % /* mounted after last reference */ % int32_t rpc_to; /* timeout for rpc calls */ % int32_t direct; /* 1 = direct mount */ %}; %#endif /* _SYSCALL32 */ /* * Contains the necessary information to notify autofs to * perfom either a new mount or create a symbolic link. */ union action_list_entry switch (autofs_action action) { case AUTOFS_MOUNT_RQ: struct mounta mounta; case AUTOFS_LINK_RQ: struct linka linka; default: void; }; /* * List of actions that need to be performed by autofs to * finish the requested operation. */ struct action_list { action_list_entry action; action_list *next; }; union mount_result_type switch (autofs_stat status) { case AUTOFS_ACTION: action_list *list; case AUTOFS_DONE: int error; default: void; }; /* * Result from mount operation. */ struct autofs_mountres { mount_result_type mr_type; int mr_verbose; }; union lookup_result_type switch (autofs_action action) { case AUTOFS_LINK_RQ: struct linka lt_linka; case AUTOFS_MOUNT_RQ: void; default: void; }; /* * Result from lookup operation. */ struct autofs_lookupres { enum autofs_res lu_res; lookup_result_type lu_type; int lu_verbose; }; /* * Unmount operation request * Automountd will issue unmount system call for the * given fstype on the given mntpnt. */ struct umntrequest { bool_t isdirect; /* direct mount? */ string mntresource; /* mntpnt source */ string mntpnt; /* mntpnt to unmount */ string fstype; /* filesystem type to umount */ string mntopts; /* mntpnt options */ struct umntrequest *next; /* next unmount */ }; /* * Unmount operation result * status = 0 if unmount was successful, * otherwise status = errno. */ struct umntres { int status; }; /* * AUTOFS readdir request * Request list of entries in 'rda_map' map starting at the given * offset 'rda_offset', for 'rda_count' bytes. */ struct autofs_rddirargs { string rda_map; u_int rda_offset; /* starting offset */ u_int rda_count; /* total size requested */ uid_t uid; /* uid of caller */ }; struct autofsrddir { u_int rddir_offset; /* last offset in list */ u_int rddir_size; /* size in bytes of entries */ bool_t rddir_eof; /* TRUE if last entry in result */ struct dirent64 *rddir_entries; /* variable number of entries */ }; /* * AUTOFS readdir result. */ struct autofs_rddirres { enum autofs_res rd_status; u_int rd_bufsize; /* autofs request size (not xdr'ed) */ struct autofsrddir rd_rddir; }; /* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _IDMAP_PROT_H_RPCGEN #define _IDMAP_PROT_H_RPCGEN #include #ifndef _KERNEL #include #include #endif /* !_KERNEL */ #ifdef __cplusplus extern "C" { #endif #if defined(_KERNEL) #include #else #include #endif typedef nvlist_t *nvlist_t_ptr; typedef char *idmap_utf8str; typedef struct { u_int idmap_utf8str_list_len; idmap_utf8str *idmap_utf8str_list_val; } idmap_utf8str_list; typedef int idmap_retcode; enum idmap_id_type { IDMAP_NONE = 0, IDMAP_UID = 1, IDMAP_GID = 1 + 1, IDMAP_SID = 1 + 2, IDMAP_USID = 1 + 3, IDMAP_GSID = 1 + 4, IDMAP_POSIXID = 1 + 5 }; typedef enum idmap_id_type idmap_id_type; enum idmap_map_type { IDMAP_MAP_TYPE_UNKNOWN = 0, IDMAP_MAP_TYPE_DS_AD = 0 + 1, IDMAP_MAP_TYPE_DS_NLDAP = 0 + 2, IDMAP_MAP_TYPE_RULE_BASED = 0 + 3, IDMAP_MAP_TYPE_EPHEMERAL = 0 + 4, IDMAP_MAP_TYPE_LOCAL_SID = 0 + 5, IDMAP_MAP_TYPE_KNOWN_SID = 0 + 6, IDMAP_MAP_TYPE_IDMU = 0 + 7 }; typedef enum idmap_map_type idmap_map_type; enum idmap_map_src { IDMAP_MAP_SRC_UNKNOWN = 0, IDMAP_MAP_SRC_NEW = 0 + 1, IDMAP_MAP_SRC_CACHE = 0 + 2, IDMAP_MAP_SRC_HARD_CODED = 0 + 3, IDMAP_MAP_SRC_ALGORITHMIC = 0 + 4 }; typedef enum idmap_map_src idmap_map_src; struct idmap_sid { char *prefix; uint32_t rid; }; typedef struct idmap_sid idmap_sid; struct idmap_id { idmap_id_type idtype; union { uint32_t uid; uint32_t gid; idmap_sid sid; idmap_sid usid; idmap_sid gsid; } idmap_id_u; }; typedef struct idmap_id idmap_id; struct idmap_namerule { bool_t is_user; bool_t is_wuser; int direction; idmap_utf8str windomain; idmap_utf8str winname; idmap_utf8str unixname; bool_t is_nt4; }; typedef struct idmap_namerule idmap_namerule; struct idmap_namerules_res { idmap_retcode retcode; uint64_t lastrowid; struct { u_int rules_len; idmap_namerule *rules_val; } rules; }; typedef struct idmap_namerules_res idmap_namerules_res; struct idmap_how_ds_based { idmap_utf8str dn; idmap_utf8str attr; idmap_utf8str value; }; typedef struct idmap_how_ds_based idmap_how_ds_based; struct idmap_how { idmap_map_type map_type; union { idmap_how_ds_based ad; idmap_how_ds_based nldap; idmap_namerule rule; idmap_how_ds_based idmu; } idmap_how_u; }; typedef struct idmap_how idmap_how; struct idmap_info { idmap_map_src src; idmap_how how; nvlist_t_ptr trace; }; typedef struct idmap_info idmap_info; struct idmap_id_res { idmap_retcode retcode; idmap_id id; int direction; idmap_info info; }; typedef struct idmap_id_res idmap_id_res; struct idmap_ids_res { idmap_retcode retcode; struct { u_int ids_len; idmap_id_res *ids_val; } ids; }; typedef struct idmap_ids_res idmap_ids_res; #define IDMAP_REQ_FLG_NO_NEW_ID_ALLOC 0x00000001 #define IDMAP_REQ_FLG_VALIDATE 0x00000002 #define IDMAP_REQ_FLG_NO_NAMESERVICE 0x00000004 #define IDMAP_REQ_FLG_MAPPING_INFO 0x00000008 #define IDMAP_REQ_FLG_WK_OR_LOCAL_SIDS_ONLY 0x00000020 #define IDMAP_REQ_FLG_TRACE 0x00000040 #define IDMAP_DIRECTION_UNDEF -1 #define IDMAP_DIRECTION_BI 0 #define IDMAP_DIRECTION_W2U 1 #define IDMAP_DIRECTION_U2W 2 struct idmap_mapping { int32_t flag; int direction; idmap_id id1; idmap_utf8str id1domain; idmap_utf8str id1name; idmap_id id2; idmap_utf8str id2domain; idmap_utf8str id2name; idmap_info info; }; typedef struct idmap_mapping idmap_mapping; typedef struct { u_int idmap_mapping_batch_len; idmap_mapping *idmap_mapping_batch_val; } idmap_mapping_batch; struct idmap_mappings_res { idmap_retcode retcode; uint64_t lastrowid; struct { u_int mappings_len; idmap_mapping *mappings_val; } mappings; }; typedef struct idmap_mappings_res idmap_mappings_res; struct idmap_update_res { idmap_retcode retcode; int64_t error_index; idmap_namerule error_rule; idmap_namerule conflict_rule; }; typedef struct idmap_update_res idmap_update_res; enum idmap_opnum { OP_NONE = 0, OP_ADD_NAMERULE = 1, OP_RM_NAMERULE = 2, OP_FLUSH_NAMERULES = 3 }; typedef enum idmap_opnum idmap_opnum; struct idmap_update_op { idmap_opnum opnum; union { idmap_namerule rule; } idmap_update_op_u; }; typedef struct idmap_update_op idmap_update_op; typedef struct { u_int idmap_update_batch_len; idmap_update_op *idmap_update_batch_val; } idmap_update_batch; #define AD_DISC_MAXHOSTNAME 256 struct idmap_ad_disc_ds_t { int port; int priority; int weight; char host[AD_DISC_MAXHOSTNAME]; }; typedef struct idmap_ad_disc_ds_t idmap_ad_disc_ds_t; enum idmap_prop_type { PROP_UNKNOWN = 0, PROP_LIST_SIZE_LIMIT = 1, PROP_DEFAULT_DOMAIN = 2, PROP_DOMAIN_NAME = 3, PROP_MACHINE_SID = 4, PROP_DOMAIN_CONTROLLER = 5, PROP_FOREST_NAME = 6, PROP_SITE_NAME = 7, PROP_GLOBAL_CATALOG = 8, PROP_AD_UNIXUSER_ATTR = 9, PROP_AD_UNIXGROUP_ATTR = 10, PROP_NLDAP_WINNAME_ATTR = 11, PROP_DIRECTORY_BASED_MAPPING = 12 }; typedef enum idmap_prop_type idmap_prop_type; struct idmap_prop_val { idmap_prop_type prop; union { uint64_t intval; idmap_utf8str utf8val; idmap_ad_disc_ds_t dsval; } idmap_prop_val_u; }; typedef struct idmap_prop_val idmap_prop_val; struct idmap_prop_res { idmap_retcode retcode; idmap_prop_val value; bool_t auto_discovered; }; typedef struct idmap_prop_res idmap_prop_res; enum idmap_flush_op { IDMAP_FLUSH_EXPIRE = 0, IDMAP_FLUSH_DELETE = 1 }; typedef enum idmap_flush_op idmap_flush_op; struct directory_error_rpc { idmap_utf8str code; idmap_utf8str fmt; struct { u_int params_len; idmap_utf8str *params_val; } params; }; typedef struct directory_error_rpc directory_error_rpc; typedef struct { u_int directory_value_rpc_len; char *directory_value_rpc_val; } directory_value_rpc; struct directory_values_rpc { bool_t found; union { struct { u_int values_len; directory_value_rpc *values_val; } values; } directory_values_rpc_u; }; typedef struct directory_values_rpc directory_values_rpc; enum directory_lookup_status_rpc { DIRECTORY_NOT_FOUND = 0, DIRECTORY_FOUND = 1, DIRECTORY_ERROR = 2 }; typedef enum directory_lookup_status_rpc directory_lookup_status_rpc; struct directory_entry_rpc { directory_lookup_status_rpc status; union { struct { u_int attrs_len; directory_values_rpc *attrs_val; } attrs; directory_error_rpc err; } directory_entry_rpc_u; }; typedef struct directory_entry_rpc directory_entry_rpc; struct directory_results_rpc { bool_t failed; union { directory_error_rpc err; struct { u_int entries_len; directory_entry_rpc *entries_val; } entries; } directory_results_rpc_u; }; typedef struct directory_results_rpc directory_results_rpc; struct idmap_list_mappings_1_argument { int64_t lastrowid; uint64_t limit; int32_t flag; }; typedef struct idmap_list_mappings_1_argument idmap_list_mappings_1_argument; struct idmap_list_namerules_1_argument { idmap_namerule rule; uint64_t lastrowid; uint64_t limit; }; typedef struct idmap_list_namerules_1_argument idmap_list_namerules_1_argument; struct directory_get_common_1_argument { idmap_utf8str_list ids; idmap_utf8str types; idmap_utf8str_list attrs; }; typedef struct directory_get_common_1_argument directory_get_common_1_argument; #define IDMAP_PROG 100172 #define IDMAP_V1 1 #if defined(__STDC__) || defined(__cplusplus) #define IDMAP_NULL 0 extern enum clnt_stat idmap_null_1(void *, CLIENT *); extern bool_t idmap_null_1_svc(void *, struct svc_req *); #define IDMAP_GET_MAPPED_IDS 1 extern enum clnt_stat idmap_get_mapped_ids_1(idmap_mapping_batch , idmap_ids_res *, CLIENT *); extern bool_t idmap_get_mapped_ids_1_svc(idmap_mapping_batch , idmap_ids_res *, struct svc_req *); #define IDMAP_LIST_MAPPINGS 2 extern enum clnt_stat idmap_list_mappings_1(int64_t , uint64_t , int32_t , idmap_mappings_res *, CLIENT *); extern bool_t idmap_list_mappings_1_svc(int64_t , uint64_t , int32_t , idmap_mappings_res *, struct svc_req *); #define IDMAP_LIST_NAMERULES 3 extern enum clnt_stat idmap_list_namerules_1(idmap_namerule , uint64_t , uint64_t , idmap_namerules_res *, CLIENT *); extern bool_t idmap_list_namerules_1_svc(idmap_namerule , uint64_t , uint64_t , idmap_namerules_res *, struct svc_req *); #define IDMAP_UPDATE 4 extern enum clnt_stat idmap_update_1(idmap_update_batch , idmap_update_res *, CLIENT *); extern bool_t idmap_update_1_svc(idmap_update_batch , idmap_update_res *, struct svc_req *); #define IDMAP_GET_MAPPED_ID_BY_NAME 5 extern enum clnt_stat idmap_get_mapped_id_by_name_1(idmap_mapping , idmap_mappings_res *, CLIENT *); extern bool_t idmap_get_mapped_id_by_name_1_svc(idmap_mapping , idmap_mappings_res *, struct svc_req *); #define IDMAP_GET_PROP 6 extern enum clnt_stat idmap_get_prop_1(idmap_prop_type , idmap_prop_res *, CLIENT *); extern bool_t idmap_get_prop_1_svc(idmap_prop_type , idmap_prop_res *, struct svc_req *); #define DIRECTORY_GET_COMMON 7 extern enum clnt_stat directory_get_common_1(idmap_utf8str_list , idmap_utf8str , idmap_utf8str_list , directory_results_rpc *, CLIENT *); extern bool_t directory_get_common_1_svc(idmap_utf8str_list , idmap_utf8str , idmap_utf8str_list , directory_results_rpc *, struct svc_req *); #define IDMAP_FLUSH 8 extern enum clnt_stat idmap_flush_1(idmap_flush_op , idmap_retcode *, CLIENT *); extern bool_t idmap_flush_1_svc(idmap_flush_op , idmap_retcode *, struct svc_req *); extern int idmap_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define IDMAP_NULL 0 extern enum clnt_stat idmap_null_1(); extern bool_t idmap_null_1_svc(); #define IDMAP_GET_MAPPED_IDS 1 extern enum clnt_stat idmap_get_mapped_ids_1(); extern bool_t idmap_get_mapped_ids_1_svc(); #define IDMAP_LIST_MAPPINGS 2 extern enum clnt_stat idmap_list_mappings_1(); extern bool_t idmap_list_mappings_1_svc(); #define IDMAP_LIST_NAMERULES 3 extern enum clnt_stat idmap_list_namerules_1(); extern bool_t idmap_list_namerules_1_svc(); #define IDMAP_UPDATE 4 extern enum clnt_stat idmap_update_1(); extern bool_t idmap_update_1_svc(); #define IDMAP_GET_MAPPED_ID_BY_NAME 5 extern enum clnt_stat idmap_get_mapped_id_by_name_1(); extern bool_t idmap_get_mapped_id_by_name_1_svc(); #define IDMAP_GET_PROP 6 extern enum clnt_stat idmap_get_prop_1(); extern bool_t idmap_get_prop_1_svc(); #define DIRECTORY_GET_COMMON 7 extern enum clnt_stat directory_get_common_1(); extern bool_t directory_get_common_1_svc(); #define IDMAP_FLUSH 8 extern enum clnt_stat idmap_flush_1(); extern bool_t idmap_flush_1_svc(); extern int idmap_prog_1_freeresult(); #endif /* K&R C */ /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_idmap_utf8str(XDR *, idmap_utf8str*); extern bool_t xdr_idmap_utf8str_list(XDR *, idmap_utf8str_list*); extern bool_t xdr_idmap_retcode(XDR *, idmap_retcode*); extern bool_t xdr_idmap_id_type(XDR *, idmap_id_type*); extern bool_t xdr_idmap_map_type(XDR *, idmap_map_type*); extern bool_t xdr_idmap_map_src(XDR *, idmap_map_src*); extern bool_t xdr_idmap_sid(XDR *, idmap_sid*); extern bool_t xdr_idmap_id(XDR *, idmap_id*); extern bool_t xdr_idmap_namerule(XDR *, idmap_namerule*); extern bool_t xdr_idmap_namerules_res(XDR *, idmap_namerules_res*); extern bool_t xdr_idmap_how_ds_based(XDR *, idmap_how_ds_based*); extern bool_t xdr_idmap_how(XDR *, idmap_how*); extern bool_t xdr_idmap_info(XDR *, idmap_info*); extern bool_t xdr_idmap_id_res(XDR *, idmap_id_res*); extern bool_t xdr_idmap_ids_res(XDR *, idmap_ids_res*); extern bool_t xdr_idmap_mapping(XDR *, idmap_mapping*); extern bool_t xdr_idmap_mapping_batch(XDR *, idmap_mapping_batch*); extern bool_t xdr_idmap_mappings_res(XDR *, idmap_mappings_res*); extern bool_t xdr_idmap_update_res(XDR *, idmap_update_res*); extern bool_t xdr_idmap_opnum(XDR *, idmap_opnum*); extern bool_t xdr_idmap_update_op(XDR *, idmap_update_op*); extern bool_t xdr_idmap_update_batch(XDR *, idmap_update_batch*); extern bool_t xdr_idmap_ad_disc_ds_t(XDR *, idmap_ad_disc_ds_t*); extern bool_t xdr_idmap_prop_type(XDR *, idmap_prop_type*); extern bool_t xdr_idmap_prop_val(XDR *, idmap_prop_val*); extern bool_t xdr_idmap_prop_res(XDR *, idmap_prop_res*); extern bool_t xdr_idmap_flush_op(XDR *, idmap_flush_op*); extern bool_t xdr_directory_error_rpc(XDR *, directory_error_rpc*); extern bool_t xdr_directory_value_rpc(XDR *, directory_value_rpc*); extern bool_t xdr_directory_values_rpc(XDR *, directory_values_rpc*); extern bool_t xdr_directory_lookup_status_rpc(XDR *, directory_lookup_status_rpc*); extern bool_t xdr_directory_entry_rpc(XDR *, directory_entry_rpc*); extern bool_t xdr_directory_results_rpc(XDR *, directory_results_rpc*); extern bool_t xdr_idmap_list_mappings_1_argument(XDR *, idmap_list_mappings_1_argument*); extern bool_t xdr_idmap_list_namerules_1_argument(XDR *, idmap_list_namerules_1_argument*); extern bool_t xdr_directory_get_common_1_argument(XDR *, directory_get_common_1_argument*); #else /* K&R C */ extern bool_t xdr_idmap_utf8str(); extern bool_t xdr_idmap_utf8str_list(); extern bool_t xdr_idmap_retcode(); extern bool_t xdr_idmap_id_type(); extern bool_t xdr_idmap_map_type(); extern bool_t xdr_idmap_map_src(); extern bool_t xdr_idmap_sid(); extern bool_t xdr_idmap_id(); extern bool_t xdr_idmap_namerule(); extern bool_t xdr_idmap_namerules_res(); extern bool_t xdr_idmap_how_ds_based(); extern bool_t xdr_idmap_how(); extern bool_t xdr_idmap_info(); extern bool_t xdr_idmap_id_res(); extern bool_t xdr_idmap_ids_res(); extern bool_t xdr_idmap_mapping(); extern bool_t xdr_idmap_mapping_batch(); extern bool_t xdr_idmap_mappings_res(); extern bool_t xdr_idmap_update_res(); extern bool_t xdr_idmap_opnum(); extern bool_t xdr_idmap_update_op(); extern bool_t xdr_idmap_update_batch(); extern bool_t xdr_idmap_ad_disc_ds_t(); extern bool_t xdr_idmap_prop_type(); extern bool_t xdr_idmap_prop_val(); extern bool_t xdr_idmap_prop_res(); extern bool_t xdr_idmap_flush_op(); extern bool_t xdr_directory_error_rpc(); extern bool_t xdr_directory_value_rpc(); extern bool_t xdr_directory_values_rpc(); extern bool_t xdr_directory_lookup_status_rpc(); extern bool_t xdr_directory_entry_rpc(); extern bool_t xdr_directory_results_rpc(); extern bool_t xdr_idmap_list_mappings_1_argument(); extern bool_t xdr_idmap_list_namerules_1_argument(); extern bool_t xdr_directory_get_common_1_argument(); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_IDMAP_PROT_H_RPCGEN */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. */ %#if defined(_KERNEL) %#include %#else %#include %#endif /* * XDR support for nvlist_t. libnvpair includes support for serializing * an nvlist, but does not include any direct XDR plug-in support. Support * is made trickier by the fact that on read xdr_pointer() wants to allocate * structures on its own, even when there's a custom xdr_*() function for * the structure. nvlist_unpack *also* wants to allocate the nvlist_t, * and it seems wrong to burn sizeof(nvlist_t) into the program binary. * * Another possibility is to use opaque<> in this declaration, but that * requires moving part of the encoding (the interaction with nvlist_pack * and nvlist_unpack) out into the application, instead of keeping it * all encapsulated in this layer. * * The resolution here is to put an nvlist_t * into a new typedef, and have * *that* typedef have a custom xdr_*() function. xdr allocates space for * the pointer, but leaves all initialization of it nvlist_t *) to the * custom function. */ #if defined(RPC_HDR) %typedef nvlist_t *nvlist_t_ptr; #endif #if defined(RPC_XDR) %#if !defined(_KERNEL) %#include %#include %#endif % %bool_t %xdr_nvlist_t_ptr(XDR *xdrs, nvlist_t_ptr *n) %{ % char *buf; % u_int len; % bool_t ret; % int err; % size_t sz; % bool_t present; % % switch (xdrs->x_op) { % case XDR_DECODE: % if (!xdr_bool(xdrs, &present)) % return (FALSE); % if (!present) { % *n = NULL; % return (TRUE); % } % buf = NULL; % if (!xdr_bytes(xdrs, &buf, &len, ~0)) % return (FALSE); % % err = nvlist_unpack(buf, (size_t)len, n, 0); %#if defined(_KERNEL) % kmem_free(buf, len); %#else % free(buf); %#endif % % if (err != 0) { %#if !defined(_KERNEL) % fprintf(stderr, "xdr_nvlist_t unpack: %s\n", % strerror(err)); %#endif % return (FALSE); % } % return (TRUE); % % case XDR_ENCODE: % present = (*n != NULL); % if (!xdr_bool(xdrs, &present)) % return (FALSE); % if (!present) % return (TRUE); % buf = NULL; % err = nvlist_pack(*n, &buf, &sz, NV_ENCODE_XDR, 0); % if (err != 0) { %#if !defined(_KERNEL) % fprintf(stderr, "xdr_nvlist_t pack: %s\n", % strerror(err)); %#endif % return (FALSE); % } % % /* nvlist_pack() and xdr_bytes() want different types */ % len = (u_int) sz; % % ret = xdr_bytes(xdrs, &buf, &len, ~0); %#if defined(_KERNEL) % kmem_free(buf, len); %#else % free(buf); %#endif % % return (ret); % % case XDR_FREE: % if (*n != NULL) { % nvlist_free(*n); % *n = NULL; % } % return (TRUE); % % default: % return (FALSE); % } %} #endif /* opaque type to support non-ASCII strings */ typedef string idmap_utf8str<>; typedef idmap_utf8str idmap_utf8str_list<>; /* Return status */ typedef int idmap_retcode; /* Identity types */ enum idmap_id_type { IDMAP_NONE = 0, IDMAP_UID = 1, IDMAP_GID, IDMAP_SID, IDMAP_USID, IDMAP_GSID, IDMAP_POSIXID }; /* The type of ID mapping */ enum idmap_map_type { IDMAP_MAP_TYPE_UNKNOWN = 0, IDMAP_MAP_TYPE_DS_AD, IDMAP_MAP_TYPE_DS_NLDAP, IDMAP_MAP_TYPE_RULE_BASED, IDMAP_MAP_TYPE_EPHEMERAL, IDMAP_MAP_TYPE_LOCAL_SID, IDMAP_MAP_TYPE_KNOWN_SID, IDMAP_MAP_TYPE_IDMU }; /* Source of ID mapping */ enum idmap_map_src { IDMAP_MAP_SRC_UNKNOWN = 0, IDMAP_MAP_SRC_NEW, IDMAP_MAP_SRC_CACHE, IDMAP_MAP_SRC_HARD_CODED, IDMAP_MAP_SRC_ALGORITHMIC }; /* SID */ struct idmap_sid { string prefix<>; uint32_t rid; }; /* Identity (sid-posix) */ union idmap_id switch(idmap_id_type idtype) { case IDMAP_UID: uint32_t uid; case IDMAP_GID: uint32_t gid; case IDMAP_SID: idmap_sid sid; case IDMAP_USID: idmap_sid usid; case IDMAP_GSID: idmap_sid gsid; case IDMAP_NONE: void; case IDMAP_POSIXID: void; }; /* Name-based mapping rules */ struct idmap_namerule { bool is_user; bool is_wuser; int direction; idmap_utf8str windomain; idmap_utf8str winname; idmap_utf8str unixname; bool is_nt4; }; struct idmap_namerules_res { idmap_retcode retcode; uint64_t lastrowid; idmap_namerule rules<>; }; /* How ID is mapped */ struct idmap_how_ds_based { idmap_utf8str dn; idmap_utf8str attr; idmap_utf8str value; }; union idmap_how switch(idmap_map_type map_type) { case IDMAP_MAP_TYPE_UNKNOWN: void; case IDMAP_MAP_TYPE_DS_AD: idmap_how_ds_based ad; case IDMAP_MAP_TYPE_DS_NLDAP: idmap_how_ds_based nldap; case IDMAP_MAP_TYPE_RULE_BASED: idmap_namerule rule; case IDMAP_MAP_TYPE_EPHEMERAL: void; case IDMAP_MAP_TYPE_LOCAL_SID: void; case IDMAP_MAP_TYPE_KNOWN_SID: void; case IDMAP_MAP_TYPE_IDMU: idmap_how_ds_based idmu; }; struct idmap_info { idmap_map_src src; idmap_how how; nvlist_t_ptr trace; }; /* Id result */ struct idmap_id_res { idmap_retcode retcode; idmap_id id; int direction; idmap_info info; }; struct idmap_ids_res { idmap_retcode retcode; idmap_id_res ids<>; }; /* * Flag supported by mapping requests */ /* Don't allocate a new value for the mapping */ const IDMAP_REQ_FLG_NO_NEW_ID_ALLOC = 0x00000001; /* Validate the given identity before mapping */ const IDMAP_REQ_FLG_VALIDATE = 0x00000002; /* Avoid name service lookups to prevent looping */ const IDMAP_REQ_FLG_NO_NAMESERVICE = 0x00000004; /* Request how a mapping was formed */ const IDMAP_REQ_FLG_MAPPING_INFO = 0x00000008; /* * This libidmap only flag is defined in idmap.h * It enables use of the libidmap cache * const IDMAP_REQ_FLG_USE_CACHE = 0x00000010; */ /* Request mapping for well-known or local SIDs only */ const IDMAP_REQ_FLG_WK_OR_LOCAL_SIDS_ONLY = 0x00000020; /* Request trace of mapping process */ const IDMAP_REQ_FLG_TRACE = 0x00000040; /* * Mapping direction definitions */ const IDMAP_DIRECTION_UNDEF = -1; /* not defined */ const IDMAP_DIRECTION_BI = 0; /* bi-directional */ const IDMAP_DIRECTION_W2U = 1; /* windows to unix only */ const IDMAP_DIRECTION_U2W = 2; /* unix to windows only */ /* Identity mappings (sid-posix) */ struct idmap_mapping { int32_t flag; int direction; idmap_id id1; idmap_utf8str id1domain; idmap_utf8str id1name; idmap_id id2; idmap_utf8str id2domain; idmap_utf8str id2name; idmap_info info; }; typedef idmap_mapping idmap_mapping_batch<>; #ifndef IDMAP_XDR_MAPPING_ONLY struct idmap_mappings_res { idmap_retcode retcode; uint64_t lastrowid; idmap_mapping mappings<>; }; /* Update result */ struct idmap_update_res { idmap_retcode retcode; int64_t error_index; idmap_namerule error_rule; idmap_namerule conflict_rule; }; /* Update requests */ enum idmap_opnum { OP_NONE = 0, OP_ADD_NAMERULE = 1, OP_RM_NAMERULE = 2, OP_FLUSH_NAMERULES = 3 }; union idmap_update_op switch(idmap_opnum opnum) { case OP_ADD_NAMERULE: case OP_RM_NAMERULE: idmap_namerule rule; default: void; }; typedef idmap_update_op idmap_update_batch<>; const AD_DISC_MAXHOSTNAME = 256; struct idmap_ad_disc_ds_t { int port; int priority; int weight; char host[AD_DISC_MAXHOSTNAME]; }; /* get-prop, set-prop */ enum idmap_prop_type { PROP_UNKNOWN = 0, PROP_LIST_SIZE_LIMIT = 1, PROP_DEFAULT_DOMAIN = 2, /* default domain name */ PROP_DOMAIN_NAME = 3, /* AD domain name */ PROP_MACHINE_SID = 4, /* machine sid */ PROP_DOMAIN_CONTROLLER = 5, /* domain controller hosts */ PROP_FOREST_NAME = 6, /* forest name */ PROP_SITE_NAME = 7, /* site name */ PROP_GLOBAL_CATALOG = 8, /* global catalog hosts */ PROP_AD_UNIXUSER_ATTR = 9, PROP_AD_UNIXGROUP_ATTR = 10, PROP_NLDAP_WINNAME_ATTR = 11, PROP_DIRECTORY_BASED_MAPPING = 12 }; union idmap_prop_val switch(idmap_prop_type prop) { case PROP_LIST_SIZE_LIMIT: uint64_t intval; case PROP_DEFAULT_DOMAIN: case PROP_DOMAIN_NAME: case PROP_MACHINE_SID: case PROP_FOREST_NAME: case PROP_SITE_NAME: case PROP_AD_UNIXUSER_ATTR: case PROP_AD_UNIXGROUP_ATTR: case PROP_NLDAP_WINNAME_ATTR: case PROP_DIRECTORY_BASED_MAPPING: idmap_utf8str utf8val; case PROP_DOMAIN_CONTROLLER: case PROP_GLOBAL_CATALOG: idmap_ad_disc_ds_t dsval; default: void; }; struct idmap_prop_res { idmap_retcode retcode; idmap_prop_val value; bool auto_discovered; }; enum idmap_flush_op { IDMAP_FLUSH_EXPIRE = 0, IDMAP_FLUSH_DELETE = 1 }; /* * Represents an error from the directory lookup service. * * code is an ASCII string that is a key for the error. It is not * localized. * * fmt is a format string with %n markers for where to include * params[n-1]. It should be, but NEEDSWORK is not localized to * the caller's locale. * * params is a list of parameters for the error - e.g. the name that * encountered a failure, the server that reported the failure, et cetera. * The values are to be used both as marked in fmt and for machine * interpretation of the error. */ struct directory_error_rpc { idmap_utf8str code; idmap_utf8str fmt; idmap_utf8str params<>; }; /* * One value of a multivalued attribute. */ typedef opaque directory_value_rpc<>; /* * The value of an attribute, if found. Note that this is a list * of directory_value_rpc objects, to support multivalued attributes. */ union directory_values_rpc switch (bool found) { case TRUE: directory_value_rpc values<>; case FALSE: void; }; /* * The status of the lookup for any particular identifier. */ enum directory_lookup_status_rpc { DIRECTORY_NOT_FOUND = 0, DIRECTORY_FOUND = 1, DIRECTORY_ERROR = 2 }; /* * This is the data returned for a particular identifier, either a * list of attribute values or an error. */ union directory_entry_rpc switch (directory_lookup_status_rpc status) { case DIRECTORY_NOT_FOUND: void; case DIRECTORY_FOUND: directory_values_rpc attrs<>; case DIRECTORY_ERROR: directory_error_rpc err; }; /* * This is the result from a request, either a list of the entries for * the identifiers specified, or an error. */ union directory_results_rpc switch (bool failed) { case TRUE: directory_error_rpc err; case FALSE: directory_entry_rpc entries<>; }; #endif /* IDMAP_XDR_MAPPING_ONLY */ program IDMAP_PROG { version IDMAP_V1 { #ifndef IDMAP_XDR_MAPPING_ONLY void IDMAP_NULL(void) = 0; #endif /* IDMAP_XDR_MAPPING_ONLY */ /* Batch of requests to get mapped identities */ idmap_ids_res IDMAP_GET_MAPPED_IDS(idmap_mapping_batch batch) = 1; #ifndef IDMAP_XDR_MAPPING_ONLY /* List all identity mappings */ idmap_mappings_res IDMAP_LIST_MAPPINGS(int64_t lastrowid, uint64_t limit, int32_t flag) = 2; /* List all name-based mapping rules */ idmap_namerules_res IDMAP_LIST_NAMERULES(idmap_namerule rule, uint64_t lastrowid, uint64_t limit) = 3; /* Batch of update requests */ idmap_update_res IDMAP_UPDATE(idmap_update_batch batch) = 4; /* Get mapped identity by name */ idmap_mappings_res IDMAP_GET_MAPPED_ID_BY_NAME(idmap_mapping request) = 5; /* Get configuration property */ idmap_prop_res IDMAP_GET_PROP(idmap_prop_type) = 6; /* * Retrieve directory information about a list of users * or groups by name or SID. * * ids is a list of user names, group names, or SIDs. * * types is a list of types of the ids in the id list. * If the type list is shorter than the id list, the last * type listed applies to all of the ids from that point. * The defined types are: * 'n' - name (could be user or group) * 'u' - user * 'g' - group * 's' - SID * * attrs is a list of attribute names to retrieve. */ directory_results_rpc DIRECTORY_GET_COMMON( idmap_utf8str_list ids, idmap_utf8str types, idmap_utf8str_list attrs) = 7; idmap_retcode IDMAP_FLUSH(idmap_flush_op) = 8; #endif /* IDMAP_XDR_MAPPING_ONLY */ } = 1; } = 100172; /* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _NLM_PROT_H_RPCGEN #define _NLM_PROT_H_RPCGEN #include #ifndef _KERNEL #include #include #endif /* !_KERNEL */ #ifdef __cplusplus extern "C" { #endif #include #define LM_MAXSTRLEN 1024 #define LM_MAXNAMELEN (LM_MAXSTRLEN + 1) enum nlm_stats { nlm_granted = 0, nlm_denied = 1, nlm_denied_nolocks = 2, nlm_blocked = 3, nlm_denied_grace_period = 4, nlm_deadlck = 5 }; typedef enum nlm_stats nlm_stats; struct nlm_holder { bool_t exclusive; int svid; netobj oh; u_int l_offset; u_int l_len; }; typedef struct nlm_holder nlm_holder; struct nlm_testrply { nlm_stats stat; union { struct nlm_holder holder; } nlm_testrply_u; }; typedef struct nlm_testrply nlm_testrply; struct nlm_stat { nlm_stats stat; }; typedef struct nlm_stat nlm_stat; struct nlm_res { netobj cookie; nlm_stat stat; }; typedef struct nlm_res nlm_res; struct nlm_testres { netobj cookie; nlm_testrply stat; }; typedef struct nlm_testres nlm_testres; struct nlm_lock { char *caller_name; netobj fh; netobj oh; int svid; u_int l_offset; u_int l_len; }; typedef struct nlm_lock nlm_lock; struct nlm_lockargs { netobj cookie; bool_t block; bool_t exclusive; struct nlm_lock alock; bool_t reclaim; int state; }; typedef struct nlm_lockargs nlm_lockargs; struct nlm_cancargs { netobj cookie; bool_t block; bool_t exclusive; struct nlm_lock alock; }; typedef struct nlm_cancargs nlm_cancargs; struct nlm_testargs { netobj cookie; bool_t exclusive; struct nlm_lock alock; }; typedef struct nlm_testargs nlm_testargs; struct nlm_unlockargs { netobj cookie; struct nlm_lock alock; }; typedef struct nlm_unlockargs nlm_unlockargs; /* * The following enums are actually bit encoded for efficient * boolean algebra.... DON'T change them..... * The mixed-case enums violate the present style guide, but we're * stuck with 'em. */ enum fsh_mode { fsm_DN = 0, fsm_DR = 1, fsm_DW = 2, fsm_DRW = 3 }; typedef enum fsh_mode fsh_mode; enum fsh_access { fsa_NONE = 0, fsa_R = 1, fsa_W = 2, fsa_RW = 3 }; typedef enum fsh_access fsh_access; struct nlm_share { char *caller_name; netobj fh; netobj oh; fsh_mode mode; fsh_access access; }; typedef struct nlm_share nlm_share; struct nlm_shareargs { netobj cookie; nlm_share share; bool_t reclaim; }; typedef struct nlm_shareargs nlm_shareargs; struct nlm_shareres { netobj cookie; nlm_stats stat; int sequence; }; typedef struct nlm_shareres nlm_shareres; struct nlm_notify { char *name; int state; }; typedef struct nlm_notify nlm_notify; enum nlm4_stats { nlm4_granted = 0, nlm4_denied = 1, nlm4_denied_nolocks = 2, nlm4_blocked = 3, nlm4_denied_grace_period = 4, nlm4_deadlck = 5, nlm4_rofs = 6, nlm4_stale_fh = 7, nlm4_fbig = 8, nlm4_failed = 9 }; typedef enum nlm4_stats nlm4_stats; struct nlm4_holder { bool_t exclusive; int32 svid; netobj oh; uint64 l_offset; uint64 l_len; }; typedef struct nlm4_holder nlm4_holder; struct nlm4_testrply { nlm4_stats stat; union { struct nlm4_holder holder; } nlm4_testrply_u; }; typedef struct nlm4_testrply nlm4_testrply; struct nlm4_stat { nlm4_stats stat; }; typedef struct nlm4_stat nlm4_stat; struct nlm4_res { netobj cookie; nlm4_stat stat; }; typedef struct nlm4_res nlm4_res; struct nlm4_testres { netobj cookie; nlm4_testrply stat; }; typedef struct nlm4_testres nlm4_testres; struct nlm4_lock { char *caller_name; netobj fh; netobj oh; int32 svid; uint64 l_offset; uint64 l_len; }; typedef struct nlm4_lock nlm4_lock; struct nlm4_lockargs { netobj cookie; bool_t block; bool_t exclusive; struct nlm4_lock alock; bool_t reclaim; int32 state; }; typedef struct nlm4_lockargs nlm4_lockargs; struct nlm4_cancargs { netobj cookie; bool_t block; bool_t exclusive; struct nlm4_lock alock; }; typedef struct nlm4_cancargs nlm4_cancargs; struct nlm4_testargs { netobj cookie; bool_t exclusive; struct nlm4_lock alock; }; typedef struct nlm4_testargs nlm4_testargs; struct nlm4_unlockargs { netobj cookie; struct nlm4_lock alock; }; typedef struct nlm4_unlockargs nlm4_unlockargs; struct nlm4_share { char *caller_name; netobj fh; netobj oh; fsh_mode mode; fsh_access access; }; typedef struct nlm4_share nlm4_share; struct nlm4_shareargs { netobj cookie; nlm4_share share; bool_t reclaim; }; typedef struct nlm4_shareargs nlm4_shareargs; struct nlm4_shareres { netobj cookie; nlm4_stats stat; int32 sequence; }; typedef struct nlm4_shareres nlm4_shareres; struct nlm4_notify { char *name; int32 state; }; typedef struct nlm4_notify nlm4_notify; struct nlm_sm_status { char *mon_name; int32 state; char priv[16]; }; typedef struct nlm_sm_status nlm_sm_status; #define NLM_PROG 100021 #define NLM_VERS 1 #if defined(__STDC__) || defined(__cplusplus) #define NLM_NULL 0 extern enum clnt_stat nlm_null_1(void *, void *, CLIENT *); extern bool_t nlm_null_1_svc(void *, void *, struct svc_req *); #define NLM_TEST 1 extern enum clnt_stat nlm_test_1(nlm_testargs *, nlm_testres *, CLIENT *); extern bool_t nlm_test_1_svc(nlm_testargs *, nlm_testres *, struct svc_req *); #define NLM_LOCK 2 extern enum clnt_stat nlm_lock_1(nlm_lockargs *, nlm_res *, CLIENT *); extern bool_t nlm_lock_1_svc(nlm_lockargs *, nlm_res *, struct svc_req *); #define NLM_CANCEL 3 extern enum clnt_stat nlm_cancel_1(nlm_cancargs *, nlm_res *, CLIENT *); extern bool_t nlm_cancel_1_svc(nlm_cancargs *, nlm_res *, struct svc_req *); #define NLM_UNLOCK 4 extern enum clnt_stat nlm_unlock_1(nlm_unlockargs *, nlm_res *, CLIENT *); extern bool_t nlm_unlock_1_svc(nlm_unlockargs *, nlm_res *, struct svc_req *); #define NLM_GRANTED 5 extern enum clnt_stat nlm_granted_1(nlm_testargs *, nlm_res *, CLIENT *); extern bool_t nlm_granted_1_svc(nlm_testargs *, nlm_res *, struct svc_req *); #define NLM_TEST_MSG 6 extern enum clnt_stat nlm_test_msg_1(nlm_testargs *, void *, CLIENT *); extern bool_t nlm_test_msg_1_svc(nlm_testargs *, void *, struct svc_req *); #define NLM_LOCK_MSG 7 extern enum clnt_stat nlm_lock_msg_1(nlm_lockargs *, void *, CLIENT *); extern bool_t nlm_lock_msg_1_svc(nlm_lockargs *, void *, struct svc_req *); #define NLM_CANCEL_MSG 8 extern enum clnt_stat nlm_cancel_msg_1(nlm_cancargs *, void *, CLIENT *); extern bool_t nlm_cancel_msg_1_svc(nlm_cancargs *, void *, struct svc_req *); #define NLM_UNLOCK_MSG 9 extern enum clnt_stat nlm_unlock_msg_1(nlm_unlockargs *, void *, CLIENT *); extern bool_t nlm_unlock_msg_1_svc(nlm_unlockargs *, void *, struct svc_req *); #define NLM_GRANTED_MSG 10 extern enum clnt_stat nlm_granted_msg_1(nlm_testargs *, void *, CLIENT *); extern bool_t nlm_granted_msg_1_svc(nlm_testargs *, void *, struct svc_req *); #define NLM_TEST_RES 11 extern enum clnt_stat nlm_test_res_1(nlm_testres *, void *, CLIENT *); extern bool_t nlm_test_res_1_svc(nlm_testres *, void *, struct svc_req *); #define NLM_LOCK_RES 12 extern enum clnt_stat nlm_lock_res_1(nlm_res *, void *, CLIENT *); extern bool_t nlm_lock_res_1_svc(nlm_res *, void *, struct svc_req *); #define NLM_CANCEL_RES 13 extern enum clnt_stat nlm_cancel_res_1(nlm_res *, void *, CLIENT *); extern bool_t nlm_cancel_res_1_svc(nlm_res *, void *, struct svc_req *); #define NLM_UNLOCK_RES 14 extern enum clnt_stat nlm_unlock_res_1(nlm_res *, void *, CLIENT *); extern bool_t nlm_unlock_res_1_svc(nlm_res *, void *, struct svc_req *); #define NLM_GRANTED_RES 15 extern enum clnt_stat nlm_granted_res_1(nlm_res *, void *, CLIENT *); extern bool_t nlm_granted_res_1_svc(nlm_res *, void *, struct svc_req *); extern int nlm_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define NLM_NULL 0 extern enum clnt_stat nlm_null_1(); extern bool_t nlm_null_1_svc(); #define NLM_TEST 1 extern enum clnt_stat nlm_test_1(); extern bool_t nlm_test_1_svc(); #define NLM_LOCK 2 extern enum clnt_stat nlm_lock_1(); extern bool_t nlm_lock_1_svc(); #define NLM_CANCEL 3 extern enum clnt_stat nlm_cancel_1(); extern bool_t nlm_cancel_1_svc(); #define NLM_UNLOCK 4 extern enum clnt_stat nlm_unlock_1(); extern bool_t nlm_unlock_1_svc(); #define NLM_GRANTED 5 extern enum clnt_stat nlm_granted_1(); extern bool_t nlm_granted_1_svc(); #define NLM_TEST_MSG 6 extern enum clnt_stat nlm_test_msg_1(); extern bool_t nlm_test_msg_1_svc(); #define NLM_LOCK_MSG 7 extern enum clnt_stat nlm_lock_msg_1(); extern bool_t nlm_lock_msg_1_svc(); #define NLM_CANCEL_MSG 8 extern enum clnt_stat nlm_cancel_msg_1(); extern bool_t nlm_cancel_msg_1_svc(); #define NLM_UNLOCK_MSG 9 extern enum clnt_stat nlm_unlock_msg_1(); extern bool_t nlm_unlock_msg_1_svc(); #define NLM_GRANTED_MSG 10 extern enum clnt_stat nlm_granted_msg_1(); extern bool_t nlm_granted_msg_1_svc(); #define NLM_TEST_RES 11 extern enum clnt_stat nlm_test_res_1(); extern bool_t nlm_test_res_1_svc(); #define NLM_LOCK_RES 12 extern enum clnt_stat nlm_lock_res_1(); extern bool_t nlm_lock_res_1_svc(); #define NLM_CANCEL_RES 13 extern enum clnt_stat nlm_cancel_res_1(); extern bool_t nlm_cancel_res_1_svc(); #define NLM_UNLOCK_RES 14 extern enum clnt_stat nlm_unlock_res_1(); extern bool_t nlm_unlock_res_1_svc(); #define NLM_GRANTED_RES 15 extern enum clnt_stat nlm_granted_res_1(); extern bool_t nlm_granted_res_1_svc(); extern int nlm_prog_1_freeresult(); #endif /* K&R C */ #define NLM_SM 2 #if defined(__STDC__) || defined(__cplusplus) #define NLM_SM_NOTIFY1 17 extern enum clnt_stat nlm_sm_notify1_2(struct nlm_sm_status *, void *, CLIENT *); extern bool_t nlm_sm_notify1_2_svc(struct nlm_sm_status *, void *, struct svc_req *); #define NLM_SM_NOTIFY2 18 extern enum clnt_stat nlm_sm_notify2_2(struct nlm_sm_status *, void *, CLIENT *); extern bool_t nlm_sm_notify2_2_svc(struct nlm_sm_status *, void *, struct svc_req *); extern int nlm_prog_2_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define NLM_SM_NOTIFY1 17 extern enum clnt_stat nlm_sm_notify1_2(); extern bool_t nlm_sm_notify1_2_svc(); #define NLM_SM_NOTIFY2 18 extern enum clnt_stat nlm_sm_notify2_2(); extern bool_t nlm_sm_notify2_2_svc(); extern int nlm_prog_2_freeresult(); #endif /* K&R C */ #define NLM_VERSX 3 #if defined(__STDC__) || defined(__cplusplus) #define NLM_SHARE 20 extern enum clnt_stat nlm_share_3(nlm_shareargs *, nlm_shareres *, CLIENT *); extern bool_t nlm_share_3_svc(nlm_shareargs *, nlm_shareres *, struct svc_req *); #define NLM_UNSHARE 21 extern enum clnt_stat nlm_unshare_3(nlm_shareargs *, nlm_shareres *, CLIENT *); extern bool_t nlm_unshare_3_svc(nlm_shareargs *, nlm_shareres *, struct svc_req *); #define NLM_NM_LOCK 22 extern enum clnt_stat nlm_nm_lock_3(nlm_lockargs *, nlm_res *, CLIENT *); extern bool_t nlm_nm_lock_3_svc(nlm_lockargs *, nlm_res *, struct svc_req *); #define NLM_FREE_ALL 23 extern enum clnt_stat nlm_free_all_3(nlm_notify *, void *, CLIENT *); extern bool_t nlm_free_all_3_svc(nlm_notify *, void *, struct svc_req *); extern int nlm_prog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define NLM_SHARE 20 extern enum clnt_stat nlm_share_3(); extern bool_t nlm_share_3_svc(); #define NLM_UNSHARE 21 extern enum clnt_stat nlm_unshare_3(); extern bool_t nlm_unshare_3_svc(); #define NLM_NM_LOCK 22 extern enum clnt_stat nlm_nm_lock_3(); extern bool_t nlm_nm_lock_3_svc(); #define NLM_FREE_ALL 23 extern enum clnt_stat nlm_free_all_3(); extern bool_t nlm_free_all_3_svc(); extern int nlm_prog_3_freeresult(); #endif /* K&R C */ #define NLM4_VERS 4 #if defined(__STDC__) || defined(__cplusplus) #define NLM4_NULL 0 extern enum clnt_stat nlm4_null_4(void *, void *, CLIENT *); extern bool_t nlm4_null_4_svc(void *, void *, struct svc_req *); #define NLM4_TEST 1 extern enum clnt_stat nlm4_test_4(nlm4_testargs *, nlm4_testres *, CLIENT *); extern bool_t nlm4_test_4_svc(nlm4_testargs *, nlm4_testres *, struct svc_req *); #define NLM4_LOCK 2 extern enum clnt_stat nlm4_lock_4(nlm4_lockargs *, nlm4_res *, CLIENT *); extern bool_t nlm4_lock_4_svc(nlm4_lockargs *, nlm4_res *, struct svc_req *); #define NLM4_CANCEL 3 extern enum clnt_stat nlm4_cancel_4(nlm4_cancargs *, nlm4_res *, CLIENT *); extern bool_t nlm4_cancel_4_svc(nlm4_cancargs *, nlm4_res *, struct svc_req *); #define NLM4_UNLOCK 4 extern enum clnt_stat nlm4_unlock_4(nlm4_unlockargs *, nlm4_res *, CLIENT *); extern bool_t nlm4_unlock_4_svc(nlm4_unlockargs *, nlm4_res *, struct svc_req *); #define NLM4_GRANTED 5 extern enum clnt_stat nlm4_granted_4(nlm4_testargs *, nlm4_res *, CLIENT *); extern bool_t nlm4_granted_4_svc(nlm4_testargs *, nlm4_res *, struct svc_req *); #define NLM4_TEST_MSG 6 extern enum clnt_stat nlm4_test_msg_4(nlm4_testargs *, void *, CLIENT *); extern bool_t nlm4_test_msg_4_svc(nlm4_testargs *, void *, struct svc_req *); #define NLM4_LOCK_MSG 7 extern enum clnt_stat nlm4_lock_msg_4(nlm4_lockargs *, void *, CLIENT *); extern bool_t nlm4_lock_msg_4_svc(nlm4_lockargs *, void *, struct svc_req *); #define NLM4_CANCEL_MSG 8 extern enum clnt_stat nlm4_cancel_msg_4(nlm4_cancargs *, void *, CLIENT *); extern bool_t nlm4_cancel_msg_4_svc(nlm4_cancargs *, void *, struct svc_req *); #define NLM4_UNLOCK_MSG 9 extern enum clnt_stat nlm4_unlock_msg_4(nlm4_unlockargs *, void *, CLIENT *); extern bool_t nlm4_unlock_msg_4_svc(nlm4_unlockargs *, void *, struct svc_req *); #define NLM4_GRANTED_MSG 10 extern enum clnt_stat nlm4_granted_msg_4(nlm4_testargs *, void *, CLIENT *); extern bool_t nlm4_granted_msg_4_svc(nlm4_testargs *, void *, struct svc_req *); #define NLM4_TEST_RES 11 extern enum clnt_stat nlm4_test_res_4(nlm4_testres *, void *, CLIENT *); extern bool_t nlm4_test_res_4_svc(nlm4_testres *, void *, struct svc_req *); #define NLM4_LOCK_RES 12 extern enum clnt_stat nlm4_lock_res_4(nlm4_res *, void *, CLIENT *); extern bool_t nlm4_lock_res_4_svc(nlm4_res *, void *, struct svc_req *); #define NLM4_CANCEL_RES 13 extern enum clnt_stat nlm4_cancel_res_4(nlm4_res *, void *, CLIENT *); extern bool_t nlm4_cancel_res_4_svc(nlm4_res *, void *, struct svc_req *); #define NLM4_UNLOCK_RES 14 extern enum clnt_stat nlm4_unlock_res_4(nlm4_res *, void *, CLIENT *); extern bool_t nlm4_unlock_res_4_svc(nlm4_res *, void *, struct svc_req *); #define NLM4_GRANTED_RES 15 extern enum clnt_stat nlm4_granted_res_4(nlm4_res *, void *, CLIENT *); extern bool_t nlm4_granted_res_4_svc(nlm4_res *, void *, struct svc_req *); #define NLM4_SHARE 20 extern enum clnt_stat nlm4_share_4(nlm4_shareargs *, nlm4_shareres *, CLIENT *); extern bool_t nlm4_share_4_svc(nlm4_shareargs *, nlm4_shareres *, struct svc_req *); #define NLM4_UNSHARE 21 extern enum clnt_stat nlm4_unshare_4(nlm4_shareargs *, nlm4_shareres *, CLIENT *); extern bool_t nlm4_unshare_4_svc(nlm4_shareargs *, nlm4_shareres *, struct svc_req *); #define NLM4_NM_LOCK 22 extern enum clnt_stat nlm4_nm_lock_4(nlm4_lockargs *, nlm4_res *, CLIENT *); extern bool_t nlm4_nm_lock_4_svc(nlm4_lockargs *, nlm4_res *, struct svc_req *); #define NLM4_FREE_ALL 23 extern enum clnt_stat nlm4_free_all_4(nlm4_notify *, void *, CLIENT *); extern bool_t nlm4_free_all_4_svc(nlm4_notify *, void *, struct svc_req *); extern int nlm_prog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define NLM4_NULL 0 extern enum clnt_stat nlm4_null_4(); extern bool_t nlm4_null_4_svc(); #define NLM4_TEST 1 extern enum clnt_stat nlm4_test_4(); extern bool_t nlm4_test_4_svc(); #define NLM4_LOCK 2 extern enum clnt_stat nlm4_lock_4(); extern bool_t nlm4_lock_4_svc(); #define NLM4_CANCEL 3 extern enum clnt_stat nlm4_cancel_4(); extern bool_t nlm4_cancel_4_svc(); #define NLM4_UNLOCK 4 extern enum clnt_stat nlm4_unlock_4(); extern bool_t nlm4_unlock_4_svc(); #define NLM4_GRANTED 5 extern enum clnt_stat nlm4_granted_4(); extern bool_t nlm4_granted_4_svc(); #define NLM4_TEST_MSG 6 extern enum clnt_stat nlm4_test_msg_4(); extern bool_t nlm4_test_msg_4_svc(); #define NLM4_LOCK_MSG 7 extern enum clnt_stat nlm4_lock_msg_4(); extern bool_t nlm4_lock_msg_4_svc(); #define NLM4_CANCEL_MSG 8 extern enum clnt_stat nlm4_cancel_msg_4(); extern bool_t nlm4_cancel_msg_4_svc(); #define NLM4_UNLOCK_MSG 9 extern enum clnt_stat nlm4_unlock_msg_4(); extern bool_t nlm4_unlock_msg_4_svc(); #define NLM4_GRANTED_MSG 10 extern enum clnt_stat nlm4_granted_msg_4(); extern bool_t nlm4_granted_msg_4_svc(); #define NLM4_TEST_RES 11 extern enum clnt_stat nlm4_test_res_4(); extern bool_t nlm4_test_res_4_svc(); #define NLM4_LOCK_RES 12 extern enum clnt_stat nlm4_lock_res_4(); extern bool_t nlm4_lock_res_4_svc(); #define NLM4_CANCEL_RES 13 extern enum clnt_stat nlm4_cancel_res_4(); extern bool_t nlm4_cancel_res_4_svc(); #define NLM4_UNLOCK_RES 14 extern enum clnt_stat nlm4_unlock_res_4(); extern bool_t nlm4_unlock_res_4_svc(); #define NLM4_GRANTED_RES 15 extern enum clnt_stat nlm4_granted_res_4(); extern bool_t nlm4_granted_res_4_svc(); #define NLM4_SHARE 20 extern enum clnt_stat nlm4_share_4(); extern bool_t nlm4_share_4_svc(); #define NLM4_UNSHARE 21 extern enum clnt_stat nlm4_unshare_4(); extern bool_t nlm4_unshare_4_svc(); #define NLM4_NM_LOCK 22 extern enum clnt_stat nlm4_nm_lock_4(); extern bool_t nlm4_nm_lock_4_svc(); #define NLM4_FREE_ALL 23 extern enum clnt_stat nlm4_free_all_4(); extern bool_t nlm4_free_all_4_svc(); extern int nlm_prog_4_freeresult(); #endif /* K&R C */ /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_nlm_stats(XDR *, nlm_stats*); extern bool_t xdr_nlm_holder(XDR *, nlm_holder*); extern bool_t xdr_nlm_testrply(XDR *, nlm_testrply*); extern bool_t xdr_nlm_stat(XDR *, nlm_stat*); extern bool_t xdr_nlm_res(XDR *, nlm_res*); extern bool_t xdr_nlm_testres(XDR *, nlm_testres*); extern bool_t xdr_nlm_lock(XDR *, nlm_lock*); extern bool_t xdr_nlm_lockargs(XDR *, nlm_lockargs*); extern bool_t xdr_nlm_cancargs(XDR *, nlm_cancargs*); extern bool_t xdr_nlm_testargs(XDR *, nlm_testargs*); extern bool_t xdr_nlm_unlockargs(XDR *, nlm_unlockargs*); extern bool_t xdr_fsh_mode(XDR *, fsh_mode*); extern bool_t xdr_fsh_access(XDR *, fsh_access*); extern bool_t xdr_nlm_share(XDR *, nlm_share*); extern bool_t xdr_nlm_shareargs(XDR *, nlm_shareargs*); extern bool_t xdr_nlm_shareres(XDR *, nlm_shareres*); extern bool_t xdr_nlm_notify(XDR *, nlm_notify*); extern bool_t xdr_nlm4_stats(XDR *, nlm4_stats*); extern bool_t xdr_nlm4_holder(XDR *, nlm4_holder*); extern bool_t xdr_nlm4_testrply(XDR *, nlm4_testrply*); extern bool_t xdr_nlm4_stat(XDR *, nlm4_stat*); extern bool_t xdr_nlm4_res(XDR *, nlm4_res*); extern bool_t xdr_nlm4_testres(XDR *, nlm4_testres*); extern bool_t xdr_nlm4_lock(XDR *, nlm4_lock*); extern bool_t xdr_nlm4_lockargs(XDR *, nlm4_lockargs*); extern bool_t xdr_nlm4_cancargs(XDR *, nlm4_cancargs*); extern bool_t xdr_nlm4_testargs(XDR *, nlm4_testargs*); extern bool_t xdr_nlm4_unlockargs(XDR *, nlm4_unlockargs*); extern bool_t xdr_nlm4_share(XDR *, nlm4_share*); extern bool_t xdr_nlm4_shareargs(XDR *, nlm4_shareargs*); extern bool_t xdr_nlm4_shareres(XDR *, nlm4_shareres*); extern bool_t xdr_nlm4_notify(XDR *, nlm4_notify*); extern bool_t xdr_nlm_sm_status(XDR *, nlm_sm_status*); #else /* K&R C */ extern bool_t xdr_nlm_stats(); extern bool_t xdr_nlm_holder(); extern bool_t xdr_nlm_testrply(); extern bool_t xdr_nlm_stat(); extern bool_t xdr_nlm_res(); extern bool_t xdr_nlm_testres(); extern bool_t xdr_nlm_lock(); extern bool_t xdr_nlm_lockargs(); extern bool_t xdr_nlm_cancargs(); extern bool_t xdr_nlm_testargs(); extern bool_t xdr_nlm_unlockargs(); extern bool_t xdr_fsh_mode(); extern bool_t xdr_fsh_access(); extern bool_t xdr_nlm_share(); extern bool_t xdr_nlm_shareargs(); extern bool_t xdr_nlm_shareres(); extern bool_t xdr_nlm_notify(); extern bool_t xdr_nlm4_stats(); extern bool_t xdr_nlm4_holder(); extern bool_t xdr_nlm4_testrply(); extern bool_t xdr_nlm4_stat(); extern bool_t xdr_nlm4_res(); extern bool_t xdr_nlm4_testres(); extern bool_t xdr_nlm4_lock(); extern bool_t xdr_nlm4_lockargs(); extern bool_t xdr_nlm4_cancargs(); extern bool_t xdr_nlm4_testargs(); extern bool_t xdr_nlm4_unlockargs(); extern bool_t xdr_nlm4_share(); extern bool_t xdr_nlm4_shareargs(); extern bool_t xdr_nlm4_shareres(); extern bool_t xdr_nlm4_notify(); extern bool_t xdr_nlm_sm_status(); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_NLM_PROT_H_RPCGEN */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright (C) 1986, 1992, 1993, 1997, 1999 by Sun Microsystems, Inc. * All rights reserved. * * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * * Protocol used between local lock manager and remote lock manager. * * There are currently 3 versions of the protocol in use. Versions 1 * and 3 are used with NFS version 2. Version 4 is used with NFS * version 3. * * (Note: there is also a version 2, but it defines an orthogonal set of * procedures that the status monitor uses to notify the lock manager of * changes in monitored systems.) */ #if RPC_HDR % %#include % #endif #ifdef RPC_HDR %#define LM_MAXSTRLEN 1024 %#define LM_MAXNAMELEN (LM_MAXSTRLEN + 1) #endif /* * Types for versions 1 and 3. */ /* * Status of a call to the lock manager. The lower case enums violate the * current style guide, but we're stuck with 'em. */ enum nlm_stats { nlm_granted = 0, nlm_denied = 1, nlm_denied_nolocks = 2, nlm_blocked = 3, nlm_denied_grace_period = 4, nlm_deadlck = 5 }; /* * The holder of a conflicting lock. */ struct nlm_holder { bool exclusive; int svid; netobj oh; unsigned l_offset; unsigned l_len; }; union nlm_testrply switch (nlm_stats stat) { case nlm_denied: struct nlm_holder holder; default: void; }; struct nlm_stat { nlm_stats stat; }; struct nlm_res { netobj cookie; nlm_stat stat; }; struct nlm_testres { netobj cookie; nlm_testrply stat; }; struct nlm_lock { string caller_name; netobj fh; /* identify a file */ netobj oh; /* identify owner of a lock */ int svid; /* generated from pid for svid */ unsigned l_offset; unsigned l_len; }; struct nlm_lockargs { netobj cookie; bool block; bool exclusive; struct nlm_lock alock; bool reclaim; /* used for recovering locks */ int state; /* specify local status monitor state */ }; struct nlm_cancargs { netobj cookie; bool block; bool exclusive; struct nlm_lock alock; }; struct nlm_testargs { netobj cookie; bool exclusive; struct nlm_lock alock; }; struct nlm_unlockargs { netobj cookie; struct nlm_lock alock; }; #ifdef RPC_HDR %/* % * The following enums are actually bit encoded for efficient % * boolean algebra.... DON'T change them..... % * The mixed-case enums violate the present style guide, but we're % * stuck with 'em. % */ #endif enum fsh_mode { fsm_DN = 0, /* deny none */ fsm_DR = 1, /* deny read */ fsm_DW = 2, /* deny write */ fsm_DRW = 3 /* deny read/write */ }; enum fsh_access { fsa_NONE = 0, /* for completeness */ fsa_R = 1, /* read only */ fsa_W = 2, /* write only */ fsa_RW = 3 /* read/write */ }; struct nlm_share { string caller_name; netobj fh; netobj oh; fsh_mode mode; fsh_access access; }; struct nlm_shareargs { netobj cookie; nlm_share share; bool reclaim; }; struct nlm_shareres { netobj cookie; nlm_stats stat; int sequence; }; struct nlm_notify { string name; int state; }; /* * Types for version 4. * * This revision is designed to work with NFS V3. The main changes from * NFS V2 to V3 that affect the NLM protocol are that all file offsets * and sizes are now unsigned 64-bit ints, and file handles are now * variable length. In NLM V1 and V3, the fixed-length V2 file handle * was encoded as a 'netobj', which is a count followed by the data * bytes. For NLM 4, the file handle is already a count followed by * data bytes, so the handle is copied directly into the netobj, rather * than being encoded with an additional byte count. */ /* * Status of a call to the lock manager. */ enum nlm4_stats { nlm4_granted = 0, /* lock was granted */ nlm4_denied = 1, /* lock was not granted, usually */ /* due to conflicting lock */ nlm4_denied_nolocks = 2, /* not granted: out of resources */ nlm4_blocked = 3, /* not granted: expect callback */ /* when granted */ nlm4_denied_grace_period = 4, /* not granted: server is */ /* reestablishing old locks */ nlm4_deadlck = 5, /* not granted: deadlock detected */ nlm4_rofs = 6, /* not granted: read-only filesystem */ nlm4_stale_fh = 7, /* not granted: stale file handle */ nlm4_fbig = 8, /* not granted: offset or length */ /* too big */ nlm4_failed = 9 /* not granted: some other error */ }; /* * The holder of a conflicting lock. */ struct nlm4_holder { bool exclusive; int32 svid; netobj oh; uint64 l_offset; uint64 l_len; }; union nlm4_testrply switch (nlm4_stats stat) { case nlm4_denied: struct nlm4_holder holder; default: void; }; struct nlm4_stat { nlm4_stats stat; }; struct nlm4_res { netobj cookie; nlm4_stat stat; }; struct nlm4_testres { netobj cookie; nlm4_testrply stat; }; struct nlm4_lock { string caller_name; netobj fh; /* identify a file */ netobj oh; /* identify owner of a lock */ int32 svid; /* generated from pid for svid */ uint64 l_offset; uint64 l_len; }; struct nlm4_lockargs { netobj cookie; bool block; bool exclusive; struct nlm4_lock alock; bool reclaim; /* used for recovering locks */ int32 state; /* specify local status monitor state */ }; struct nlm4_cancargs { netobj cookie; bool block; bool exclusive; struct nlm4_lock alock; }; struct nlm4_testargs { netobj cookie; bool exclusive; struct nlm4_lock alock; }; struct nlm4_unlockargs { netobj cookie; struct nlm4_lock alock; }; struct nlm4_share { string caller_name; netobj fh; netobj oh; fsh_mode mode; fsh_access access; }; struct nlm4_shareargs { netobj cookie; nlm4_share share; bool reclaim; }; struct nlm4_shareres { netobj cookie; nlm4_stats stat; int32 sequence; }; struct nlm4_notify { string name; int32 state; }; /* * Argument for the NLM call-back procedure called by rpc.statd * when a monitored host status changes. The statd calls the * NLM prog,vers,proc specified in the SM_MON call. * NB: This struct must exactly match sm_inter.x:sm_status * and requires LM_MAXSTRLEN == SM_MAXSTRLEN */ struct nlm_sm_status { string mon_name; /* name of host */ int32 state; /* new state */ opaque priv[16]; /* private data */ }; /* * Over-the-wire protocol used between the network lock managers */ program NLM_PROG { version NLM_VERS { void NLM_NULL(void) = 0; nlm_testres NLM_TEST(nlm_testargs) = 1; nlm_res NLM_LOCK(nlm_lockargs) = 2; nlm_res NLM_CANCEL(nlm_cancargs) = 3; nlm_res NLM_UNLOCK(nlm_unlockargs) = 4; /* * remote lock manager call-back to grant lock */ nlm_res NLM_GRANTED(nlm_testargs) = 5; /* * message passing style of requesting lock */ void NLM_TEST_MSG(nlm_testargs) = 6; void NLM_LOCK_MSG(nlm_lockargs) = 7; void NLM_CANCEL_MSG(nlm_cancargs) = 8; void NLM_UNLOCK_MSG(nlm_unlockargs) = 9; void NLM_GRANTED_MSG(nlm_testargs) = 10; void NLM_TEST_RES(nlm_testres) = 11; void NLM_LOCK_RES(nlm_res) = 12; void NLM_CANCEL_RES(nlm_res) = 13; void NLM_UNLOCK_RES(nlm_res) = 14; void NLM_GRANTED_RES(nlm_res) = 15; } = 1; /* * Private (loopback-only) call-backs from statd, * used to notify that some machine has restarted. * The meaning of these is up to the lock manager * implemenation. (See the SM_MON calls.) */ version NLM_SM { void NLM_SM_NOTIFY1(struct nlm_sm_status) = 17; void NLM_SM_NOTIFY2(struct nlm_sm_status) = 18; } = 2; version NLM_VERSX { nlm_shareres NLM_SHARE(nlm_shareargs) = 20; nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21; nlm_res NLM_NM_LOCK(nlm_lockargs) = 22; void NLM_FREE_ALL(nlm_notify) = 23; } = 3; version NLM4_VERS { void NLM4_NULL(void) = 0; nlm4_testres NLM4_TEST(nlm4_testargs) = 1; nlm4_res NLM4_LOCK(nlm4_lockargs) = 2; nlm4_res NLM4_CANCEL(nlm4_cancargs) = 3; nlm4_res NLM4_UNLOCK(nlm4_unlockargs) = 4; /* * remote lock manager call-back to grant lock */ nlm4_res NLM4_GRANTED(nlm4_testargs) = 5; /* * message passing style of requesting lock */ void NLM4_TEST_MSG(nlm4_testargs) = 6; void NLM4_LOCK_MSG(nlm4_lockargs) = 7; void NLM4_CANCEL_MSG(nlm4_cancargs) = 8; void NLM4_UNLOCK_MSG(nlm4_unlockargs) = 9; void NLM4_GRANTED_MSG(nlm4_testargs) = 10; void NLM4_TEST_RES(nlm4_testres) = 11; void NLM4_LOCK_RES(nlm4_res) = 12; void NLM4_CANCEL_RES(nlm4_res) = 13; void NLM4_UNLOCK_RES(nlm4_res) = 14; void NLM4_GRANTED_RES(nlm4_res) = 15; /* * DOS-style file sharing */ nlm4_shareres NLM4_SHARE(nlm4_shareargs) = 20; nlm4_shareres NLM4_UNSHARE(nlm4_shareargs) = 21; nlm4_res NLM4_NM_LOCK(nlm4_lockargs) = 22; void NLM4_FREE_ALL(nlm4_notify) = 23; } = 4; } = 100021; /* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _NSM_ADDR_H_RPCGEN #define _NSM_ADDR_H_RPCGEN #include #ifndef _KERNEL #include #include #endif /* !_KERNEL */ #ifdef __cplusplus extern "C" { #endif /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* from nsm_addr.x */ /* * This is the definition for the REG procedure which is used * to register name/address pairs with statd. */ enum nsm_addr_res { nsm_addr_succ = 0, nsm_addr_fail = 1 }; typedef enum nsm_addr_res nsm_addr_res; struct reg1args { u_int family; char *name; netobj address; }; typedef struct reg1args reg1args; struct reg1res { nsm_addr_res status; }; typedef struct reg1res reg1res; /* * This is the definition for the UNREG procedure which is used * to unregister an address (and its associated name, if that name * has no other addresses registered with it) with statd. */ struct unreg1args { u_int family; char *name; netobj address; }; typedef struct unreg1args unreg1args; struct unreg1res { nsm_addr_res status; }; typedef struct unreg1res unreg1res; /* * This is the definition for the NSM address registration network * protocol which is used to privately support address registration * with the status daemon statd (NSM). */ #define NSM_ADDR_PROGRAM 100133 #define NSM_ADDR_V1 1 #if defined(__STDC__) || defined(__cplusplus) #define NSMADDRPROC1_NULL 0 extern enum clnt_stat nsmaddrproc1_null_1(void *, void *, CLIENT *); extern bool_t nsmaddrproc1_null_1_svc(void *, void *, struct svc_req *); #define NSMADDRPROC1_REG 1 extern enum clnt_stat nsmaddrproc1_reg_1(reg1args *, reg1res *, CLIENT *); extern bool_t nsmaddrproc1_reg_1_svc(reg1args *, reg1res *, struct svc_req *); #define NSMADDRPROC1_UNREG 2 extern enum clnt_stat nsmaddrproc1_unreg_1(unreg1args *, unreg1res *, CLIENT *); extern bool_t nsmaddrproc1_unreg_1_svc(unreg1args *, unreg1res *, struct svc_req *); extern int nsm_addr_program_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define NSMADDRPROC1_NULL 0 extern enum clnt_stat nsmaddrproc1_null_1(); extern bool_t nsmaddrproc1_null_1_svc(); #define NSMADDRPROC1_REG 1 extern enum clnt_stat nsmaddrproc1_reg_1(); extern bool_t nsmaddrproc1_reg_1_svc(); #define NSMADDRPROC1_UNREG 2 extern enum clnt_stat nsmaddrproc1_unreg_1(); extern bool_t nsmaddrproc1_unreg_1_svc(); extern int nsm_addr_program_1_freeresult(); #endif /* K&R C */ /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_nsm_addr_res(XDR *, nsm_addr_res*); extern bool_t xdr_reg1args(XDR *, reg1args*); extern bool_t xdr_reg1res(XDR *, reg1res*); extern bool_t xdr_unreg1args(XDR *, unreg1args*); extern bool_t xdr_unreg1res(XDR *, unreg1res*); #else /* K&R C */ extern bool_t xdr_nsm_addr_res(); extern bool_t xdr_reg1args(); extern bool_t xdr_reg1res(); extern bool_t xdr_unreg1args(); extern bool_t xdr_unreg1res(); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_NSM_ADDR_H_RPCGEN */ %/* % * Copyright 2005 Sun Microsystems, Inc. All rights reserved. % * Use is subject to license terms. % * % * CDDL HEADER START % * % * The contents of this file are subject to the terms of the % * Common Development and Distribution License, Version 1.0 only % * (the "License"). You may not use this file except in compliance % * with the License. % * % * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE % * or http://www.opensolaris.org/os/licensing. % * See the License for the specific language governing permissions % * and limitations under the License. % * % * When distributing Covered Code, include this CDDL HEADER in each % * file and include the License file at usr/src/OPENSOLARIS.LICENSE. % * If applicable, add the following below this CDDL HEADER, with the % * fields enclosed by brackets "[]" replaced with your own identifying % * information: Portions Copyright [yyyy] [name of copyright owner] % * % * CDDL HEADER END % */ % %/* from nsm_addr.x */ % %/* % * This is the definition for the REG procedure which is used % * to register name/address pairs with statd. % */ % enum nsm_addr_res { nsm_addr_succ = 0, /* simple success/failure result */ nsm_addr_fail = 1 }; struct reg1args { unsigned int family; /* address families from socket.h */ string name<1024>; /* name to register with this addr */ netobj address; }; struct reg1res { nsm_addr_res status; }; % %/* % * This is the definition for the UNREG procedure which is used % * to unregister an address (and its associated name, if that name % * has no other addresses registered with it) with statd. % */ struct unreg1args { unsigned int family; /* address families from socket.h */ string name<1024>; /* name under this addr to unregister */ netobj address; }; struct unreg1res { nsm_addr_res status; }; % %/* % * This is the definition for the NSM address registration network % * protocol which is used to privately support address registration % * with the status daemon statd (NSM). % */ program NSM_ADDR_PROGRAM { version NSM_ADDR_V1 { void NSMADDRPROC1_NULL(void) = 0; reg1res NSMADDRPROC1_REG(reg1args) = 1; unreg1res NSMADDRPROC1_UNREG(unreg1args) = 2; } = 1; } = 100133; /* * Please do not edit this file. * It was generated using rpcgen. */ #ifndef _SM_INTER_H_RPCGEN #define _SM_INTER_H_RPCGEN #include #ifndef _KERNEL #include #include #endif /* !_KERNEL */ #ifdef __cplusplus extern "C" { #endif /* * Copyright (c) 1986, 1994 by Sun Microsystems, Inc. * All rights reserved. */ /* from sm_inter.x */ #define SM_MAXSTRLEN 1024 struct sm_name { char *mon_name; }; typedef struct sm_name sm_name; struct my_id { char *my_name; int my_prog; int my_vers; int my_proc; }; typedef struct my_id my_id; struct mon_id { char *mon_name; struct my_id my_id; }; typedef struct mon_id mon_id; struct mon { struct mon_id mon_id; char priv[16]; }; typedef struct mon mon; struct sm_stat { int state; }; typedef struct sm_stat sm_stat; enum sm_res { stat_succ = 0, stat_fail = 1 }; typedef enum sm_res sm_res; struct sm_stat_res { sm_res res_stat; int state; }; typedef struct sm_stat_res sm_stat_res; struct sm_status { char *mon_name; int state; char priv[16]; }; typedef struct sm_status sm_status; struct stat_chge { char *mon_name; int state; }; typedef struct stat_chge stat_chge; #define SM_PROG 100024 #define SM_VERS 1 #if defined(__STDC__) || defined(__cplusplus) #define SM_STAT 1 extern enum clnt_stat sm_stat_1(struct sm_name *, struct sm_stat_res *, CLIENT *); extern bool_t sm_stat_1_svc(struct sm_name *, struct sm_stat_res *, struct svc_req *); #define SM_MON 2 extern enum clnt_stat sm_mon_1(struct mon *, struct sm_stat_res *, CLIENT *); extern bool_t sm_mon_1_svc(struct mon *, struct sm_stat_res *, struct svc_req *); #define SM_UNMON 3 extern enum clnt_stat sm_unmon_1(struct mon_id *, struct sm_stat *, CLIENT *); extern bool_t sm_unmon_1_svc(struct mon_id *, struct sm_stat *, struct svc_req *); #define SM_UNMON_ALL 4 extern enum clnt_stat sm_unmon_all_1(struct my_id *, struct sm_stat *, CLIENT *); extern bool_t sm_unmon_all_1_svc(struct my_id *, struct sm_stat *, struct svc_req *); #define SM_SIMU_CRASH 5 extern enum clnt_stat sm_simu_crash_1(void *, void *, CLIENT *); extern bool_t sm_simu_crash_1_svc(void *, void *, struct svc_req *); #define SM_NOTIFY 6 extern enum clnt_stat sm_notify_1(struct stat_chge *, void *, CLIENT *); extern bool_t sm_notify_1_svc(struct stat_chge *, void *, struct svc_req *); extern int sm_prog_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t); #else /* K&R C */ #define SM_STAT 1 extern enum clnt_stat sm_stat_1(); extern bool_t sm_stat_1_svc(); #define SM_MON 2 extern enum clnt_stat sm_mon_1(); extern bool_t sm_mon_1_svc(); #define SM_UNMON 3 extern enum clnt_stat sm_unmon_1(); extern bool_t sm_unmon_1_svc(); #define SM_UNMON_ALL 4 extern enum clnt_stat sm_unmon_all_1(); extern bool_t sm_unmon_all_1_svc(); #define SM_SIMU_CRASH 5 extern enum clnt_stat sm_simu_crash_1(); extern bool_t sm_simu_crash_1_svc(); #define SM_NOTIFY 6 extern enum clnt_stat sm_notify_1(); extern bool_t sm_notify_1_svc(); extern int sm_prog_1_freeresult(); #endif /* K&R C */ /* the xdr functions */ #if defined(__STDC__) || defined(__cplusplus) extern bool_t xdr_sm_name(XDR *, sm_name*); extern bool_t xdr_my_id(XDR *, my_id*); extern bool_t xdr_mon_id(XDR *, mon_id*); extern bool_t xdr_mon(XDR *, mon*); extern bool_t xdr_sm_stat(XDR *, sm_stat*); extern bool_t xdr_sm_res(XDR *, sm_res*); extern bool_t xdr_sm_stat_res(XDR *, sm_stat_res*); extern bool_t xdr_sm_status(XDR *, sm_status*); extern bool_t xdr_stat_chge(XDR *, stat_chge*); #else /* K&R C */ extern bool_t xdr_sm_name(); extern bool_t xdr_my_id(); extern bool_t xdr_mon_id(); extern bool_t xdr_mon(); extern bool_t xdr_sm_stat(); extern bool_t xdr_sm_res(); extern bool_t xdr_sm_stat_res(); extern bool_t xdr_sm_status(); extern bool_t xdr_stat_chge(); #endif /* K&R C */ #ifdef __cplusplus } #endif #endif /* !_SM_INTER_H_RPCGEN */ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ %/* % * Copyright (c) 1986, 1994 by Sun Microsystems, Inc. % * All rights reserved. % */ %/* from sm_inter.x */ /* * Status monitor protocol specification */ program SM_PROG { version SM_VERS { /* res_stat = stat_succ if status monitor agrees to monitor */ /* res_stat = stat_fail if status monitor cannot monitor */ /* if res_stat == stat_succ, state = state number of site */ /* sm_name */ struct sm_stat_res SM_STAT(struct sm_name) = 1; /* res_stat = stat_succ if status monitor agrees to monitor */ /* res_stat = stat_fail if status monitor cannot monitor */ /* stat consists of state number of local site */ struct sm_stat_res SM_MON(struct mon) = 2; /* stat consists of state number of local site */ struct sm_stat SM_UNMON(struct mon_id) = 3; /* stat consists of state number of local site */ struct sm_stat SM_UNMON_ALL(struct my_id) = 4; void SM_SIMU_CRASH(void) = 5; void SM_NOTIFY(struct stat_chge) = 6; } = 1; } = 100024; const SM_MAXSTRLEN = 1024; struct sm_name { string mon_name; }; struct my_id { string my_name; /* name of the site iniates the */ /* monitoring request */ int my_prog; /* rpc program # of the requesting process */ int my_vers; /* rpc version # of the requesting process */ int my_proc; /* rpc procedure # of the requesting process */ }; struct mon_id { string mon_name; /* name of the site to be monitored */ struct my_id my_id; }; struct mon{ struct mon_id mon_id; opaque priv[16]; /* private information to store at monitor */ /* for requesting process */ }; /* * state # of status monitor monitonically increases each time * status of the site changes: * an even number (>= 0) indicates the site is down and * an odd number (> 0) indicates the site is up; */ struct sm_stat { int state; /* state # of status monitor */ }; enum sm_res { stat_succ = 0, /* status monitor agrees to monitor */ stat_fail = 1 /* status monitor cannot monitor */ }; struct sm_stat_res { sm_res res_stat; int state; }; /* * structure of the status message sent by the status monitor to the * requesting program when a monitored site changes status. */ struct sm_status { string mon_name; int state; opaque priv[16]; /* stored private information */ }; /* * structure sent between statd's to announce a state change (e.g., * reboot). */ struct stat_chge { string mon_name; int state; };