Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/rpcsvc/nlm_prot.x is written in an unsupported language. File is not indexed.

0001 /* @(#)nlm_prot.x       2.1 88/08/01 4.0 RPCSRC */
0002 
0003 /*
0004  * Network lock manager protocol definition
0005  * Copyright (c) 2010, Oracle America, Inc.
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions are
0008  * met:
0009  *
0010  *     * Redistributions of source code must retain the above copyright
0011  *       notice, this list of conditions and the following disclaimer.
0012  *     * Redistributions in binary form must reproduce the above
0013  *       copyright notice, this list of conditions and the following
0014  *       disclaimer in the documentation and/or other materials
0015  *       provided with the distribution.
0016  *     * Neither the name of the "Oracle America, Inc." nor the names of its
0017  *       contributors may be used to endorse or promote products derived
0018  *       from this software without specific prior written permission.
0019  *
0020  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0021  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0022  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0023  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0024  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0025  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0026  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0027  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0028  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0029  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0030  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0031  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0032  *
0033  * protocol used between local lock manager and remote lock manager
0034  */
0035 
0036 #ifdef RPC_HDR
0037 %#define LM_MAXSTRLEN   1024
0038 %#define MAXNAMELEN     LM_MAXSTRLEN+1
0039 #endif
0040 
0041 /*
0042  * status of a call to the lock manager
0043  */
0044 enum nlm_stats {
0045         nlm_granted = 0,
0046         nlm_denied = 1,
0047         nlm_denied_nolocks = 2,
0048         nlm_blocked = 3,
0049         nlm_denied_grace_period = 4
0050 };
0051 
0052 struct nlm_holder {
0053         bool exclusive;
0054         int svid;
0055         netobj oh;
0056         unsigned l_offset;
0057         unsigned l_len;
0058 };
0059 
0060 union nlm_testrply switch (nlm_stats stat) {
0061         case nlm_denied:
0062                 struct nlm_holder holder;
0063         default:
0064                 void;
0065 };
0066 
0067 struct nlm_stat {
0068         nlm_stats stat;
0069 };
0070 
0071 struct nlm_res {
0072         netobj cookie;
0073         nlm_stat stat;
0074 };
0075 
0076 struct nlm_testres {
0077         netobj cookie;
0078         nlm_testrply stat;
0079 };
0080 
0081 struct nlm_lock {
0082         string caller_name<LM_MAXSTRLEN>;
0083         netobj fh;              /* identify a file */
0084         netobj oh;              /* identify owner of a lock */
0085         int svid;               /* generated from pid for svid */
0086         unsigned l_offset;
0087         unsigned l_len;
0088 };
0089 
0090 struct nlm_lockargs {
0091         netobj cookie;
0092         bool block;
0093         bool exclusive;
0094         struct nlm_lock alock;
0095         bool reclaim;           /* used for recovering locks */
0096         int state;              /* specify local status monitor state */
0097 };
0098 
0099 struct nlm_cancargs {
0100         netobj cookie;
0101         bool block;
0102         bool exclusive;
0103         struct nlm_lock alock;
0104 };
0105 
0106 struct nlm_testargs {
0107         netobj cookie;
0108         bool exclusive;
0109         struct nlm_lock alock;
0110 };
0111 
0112 struct nlm_unlockargs {
0113         netobj cookie;
0114         struct nlm_lock alock;
0115 };
0116 
0117 
0118 #ifdef RPC_HDR
0119 %/*
0120 % * The following enums are actually bit encoded for efficient
0121 % * boolean algebra.... DON'T change them.....
0122 % */
0123 #endif
0124 enum    fsh_mode {
0125         fsm_DN  = 0,    /* deny none */
0126         fsm_DR  = 1,    /* deny read */
0127         fsm_DW  = 2,    /* deny write */
0128         fsm_DRW = 3     /* deny read/write */
0129 };
0130 
0131 enum    fsh_access {
0132         fsa_NONE = 0,   /* for completeness */
0133         fsa_R    = 1,   /* read only */
0134         fsa_W    = 2,   /* write only */
0135         fsa_RW   = 3    /* read/write */
0136 };
0137 
0138 struct  nlm_share {
0139         string caller_name<LM_MAXSTRLEN>;
0140         netobj  fh;
0141         netobj  oh;
0142         fsh_mode        mode;
0143         fsh_access      access;
0144 };
0145 
0146 struct  nlm_shareargs {
0147         netobj  cookie;
0148         nlm_share       share;
0149         bool    reclaim;
0150 };
0151 
0152 struct  nlm_shareres {
0153         netobj  cookie;
0154         nlm_stats       stat;
0155         int     sequence;
0156 };
0157 
0158 struct  nlm_notify {
0159         string name<MAXNAMELEN>;
0160         long state;
0161 };
0162 
0163 /*
0164  * Over-the-wire protocol used between the network lock managers
0165  */
0166 
0167 program NLM_PROG {
0168         version NLM_VERS {
0169 
0170                 nlm_testres     NLM_TEST(struct nlm_testargs) = 1;
0171 
0172                 nlm_res         NLM_LOCK(struct nlm_lockargs) = 2;
0173 
0174                 nlm_res         NLM_CANCEL(struct nlm_cancargs) = 3;
0175                 nlm_res         NLM_UNLOCK(struct nlm_unlockargs) =     4;
0176 
0177                 /*
0178                  * remote lock manager call-back to grant lock
0179                  */
0180                 nlm_res         NLM_GRANTED(struct nlm_testargs)= 5;
0181                 /*
0182                  * message passing style of requesting lock
0183                  */
0184                 void            NLM_TEST_MSG(struct nlm_testargs) = 6;
0185                 void            NLM_LOCK_MSG(struct nlm_lockargs) = 7;
0186                 void            NLM_CANCEL_MSG(struct nlm_cancargs) =8;
0187                 void            NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
0188                 void            NLM_GRANTED_MSG(struct nlm_testargs) = 10;
0189                 void            NLM_TEST_RES(nlm_testres) = 11;
0190                 void            NLM_LOCK_RES(nlm_res) = 12;
0191                 void            NLM_CANCEL_RES(nlm_res) = 13;
0192                 void            NLM_UNLOCK_RES(nlm_res) = 14;
0193                 void            NLM_GRANTED_RES(nlm_res) = 15;
0194         } = 1;
0195 
0196         version NLM_VERSX {
0197                 nlm_shareres    NLM_SHARE(nlm_shareargs) = 20;
0198                 nlm_shareres    NLM_UNSHARE(nlm_shareargs) = 21;
0199                 nlm_res         NLM_NM_LOCK(nlm_lockargs) = 22;
0200                 void            NLM_FREE_ALL(nlm_notify) = 23;
0201         } = 3;
0202 
0203 } = 100021;