1/* 2 * Network lock manager protocol definition 3 * Copyright (C) 1986 Sun Microsystems, Inc. 4 * 5 * protocol used between local lock manager and remote lock manager 6 */ 7 8#ifdef RPC_HDR 9%#define LM_MAXSTRLEN 1024 10%#define MAXNAMELEN LM_MAXSTRLEN+1 11#else 12%#ifndef lint 13%static const char rcsid[] =
| 4/* 5 * Network lock manager protocol definition 6 * Copyright (C) 1986 Sun Microsystems, Inc. 7 * 8 * protocol used between local lock manager and remote lock manager 9 */ 10 11#ifdef RPC_HDR 12%#define LM_MAXSTRLEN 1024 13%#define MAXNAMELEN LM_MAXSTRLEN+1 14#else 15%#ifndef lint 16%static const char rcsid[] =
|
15%#endif /* not lint */ 16#endif 17 18/* 19 * status of a call to the lock manager 20 */ 21enum nlm_stats { 22 nlm_granted = 0, 23 nlm_denied = 1, 24 nlm_denied_nolocks = 2, 25 nlm_blocked = 3, 26 nlm_denied_grace_period = 4 27}; 28 29struct nlm_holder { 30 bool exclusive; 31 int svid; 32 netobj oh; 33 unsigned l_offset; 34 unsigned l_len; 35}; 36 37union nlm_testrply switch (nlm_stats stat) { 38 case nlm_denied: 39 struct nlm_holder holder; 40 default: 41 void; 42}; 43 44struct nlm_stat { 45 nlm_stats stat; 46}; 47 48struct nlm_res { 49 netobj cookie; 50 nlm_stat stat; 51}; 52 53struct nlm_testres { 54 netobj cookie; 55 nlm_testrply stat; 56}; 57 58struct nlm_lock { 59 string caller_name<LM_MAXSTRLEN>; 60 netobj fh; /* identify a file */ 61 netobj oh; /* identify owner of a lock */ 62 int svid; /* generated from pid for svid */ 63 unsigned l_offset; 64 unsigned l_len; 65}; 66 67struct nlm_lockargs { 68 netobj cookie; 69 bool block; 70 bool exclusive; 71 struct nlm_lock alock; 72 bool reclaim; /* used for recovering locks */ 73 int state; /* specify local status monitor state */ 74}; 75 76struct nlm_cancargs { 77 netobj cookie; 78 bool block; 79 bool exclusive; 80 struct nlm_lock alock; 81}; 82 83struct nlm_testargs { 84 netobj cookie; 85 bool exclusive; 86 struct nlm_lock alock; 87}; 88 89struct nlm_unlockargs { 90 netobj cookie; 91 struct nlm_lock alock; 92}; 93 94 95#ifdef RPC_HDR 96%/* 97% * The following enums are actually bit encoded for efficient 98% * boolean algebra.... DON'T change them..... 99% */ 100#endif 101enum fsh_mode { 102 fsm_DN = 0, /* deny none */ 103 fsm_DR = 1, /* deny read */ 104 fsm_DW = 2, /* deny write */ 105 fsm_DRW = 3 /* deny read/write */ 106}; 107 108enum fsh_access { 109 fsa_NONE = 0, /* for completeness */ 110 fsa_R = 1, /* read only */ 111 fsa_W = 2, /* write only */ 112 fsa_RW = 3 /* read/write */ 113}; 114 115struct nlm_share { 116 string caller_name<LM_MAXSTRLEN>; 117 netobj fh; 118 netobj oh; 119 fsh_mode mode; 120 fsh_access access; 121}; 122 123struct nlm_shareargs { 124 netobj cookie; 125 nlm_share share; 126 bool reclaim; 127}; 128 129struct nlm_shareres { 130 netobj cookie; 131 nlm_stats stat; 132 int sequence; 133}; 134 135struct nlm_notify { 136 string name<MAXNAMELEN>; 137 long state; 138}; 139 140/* 141 * Over-the-wire protocol used between the network lock managers 142 */ 143 144program NLM_PROG { 145 version NLM_VERS { 146 147 nlm_testres NLM_TEST(struct nlm_testargs) = 1; 148 149 nlm_res NLM_LOCK(struct nlm_lockargs) = 2; 150 151 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3; 152 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4; 153 154 /* 155 * remote lock manager call-back to grant lock 156 */ 157 nlm_res NLM_GRANTED(struct nlm_testargs)= 5; 158 /* 159 * message passing style of requesting lock 160 */ 161 void NLM_TEST_MSG(struct nlm_testargs) = 6; 162 void NLM_LOCK_MSG(struct nlm_lockargs) = 7; 163 void NLM_CANCEL_MSG(struct nlm_cancargs) =8; 164 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9; 165 void NLM_GRANTED_MSG(struct nlm_testargs) = 10; 166 void NLM_TEST_RES(nlm_testres) = 11; 167 void NLM_LOCK_RES(nlm_res) = 12; 168 void NLM_CANCEL_RES(nlm_res) = 13; 169 void NLM_UNLOCK_RES(nlm_res) = 14; 170 void NLM_GRANTED_RES(nlm_res) = 15; 171 } = 1; 172 173 version NLM_VERSX { 174 nlm_shareres NLM_SHARE(nlm_shareargs) = 20; 175 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21; 176 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22; 177 void NLM_FREE_ALL(nlm_notify) = 23; 178 } = 3; 179 180} = 100021; 181
| 18%#endif /* not lint */ 19#endif 20 21/* 22 * status of a call to the lock manager 23 */ 24enum nlm_stats { 25 nlm_granted = 0, 26 nlm_denied = 1, 27 nlm_denied_nolocks = 2, 28 nlm_blocked = 3, 29 nlm_denied_grace_period = 4 30}; 31 32struct nlm_holder { 33 bool exclusive; 34 int svid; 35 netobj oh; 36 unsigned l_offset; 37 unsigned l_len; 38}; 39 40union nlm_testrply switch (nlm_stats stat) { 41 case nlm_denied: 42 struct nlm_holder holder; 43 default: 44 void; 45}; 46 47struct nlm_stat { 48 nlm_stats stat; 49}; 50 51struct nlm_res { 52 netobj cookie; 53 nlm_stat stat; 54}; 55 56struct nlm_testres { 57 netobj cookie; 58 nlm_testrply stat; 59}; 60 61struct nlm_lock { 62 string caller_name<LM_MAXSTRLEN>; 63 netobj fh; /* identify a file */ 64 netobj oh; /* identify owner of a lock */ 65 int svid; /* generated from pid for svid */ 66 unsigned l_offset; 67 unsigned l_len; 68}; 69 70struct nlm_lockargs { 71 netobj cookie; 72 bool block; 73 bool exclusive; 74 struct nlm_lock alock; 75 bool reclaim; /* used for recovering locks */ 76 int state; /* specify local status monitor state */ 77}; 78 79struct nlm_cancargs { 80 netobj cookie; 81 bool block; 82 bool exclusive; 83 struct nlm_lock alock; 84}; 85 86struct nlm_testargs { 87 netobj cookie; 88 bool exclusive; 89 struct nlm_lock alock; 90}; 91 92struct nlm_unlockargs { 93 netobj cookie; 94 struct nlm_lock alock; 95}; 96 97 98#ifdef RPC_HDR 99%/* 100% * The following enums are actually bit encoded for efficient 101% * boolean algebra.... DON'T change them..... 102% */ 103#endif 104enum fsh_mode { 105 fsm_DN = 0, /* deny none */ 106 fsm_DR = 1, /* deny read */ 107 fsm_DW = 2, /* deny write */ 108 fsm_DRW = 3 /* deny read/write */ 109}; 110 111enum fsh_access { 112 fsa_NONE = 0, /* for completeness */ 113 fsa_R = 1, /* read only */ 114 fsa_W = 2, /* write only */ 115 fsa_RW = 3 /* read/write */ 116}; 117 118struct nlm_share { 119 string caller_name<LM_MAXSTRLEN>; 120 netobj fh; 121 netobj oh; 122 fsh_mode mode; 123 fsh_access access; 124}; 125 126struct nlm_shareargs { 127 netobj cookie; 128 nlm_share share; 129 bool reclaim; 130}; 131 132struct nlm_shareres { 133 netobj cookie; 134 nlm_stats stat; 135 int sequence; 136}; 137 138struct nlm_notify { 139 string name<MAXNAMELEN>; 140 long state; 141}; 142 143/* 144 * Over-the-wire protocol used between the network lock managers 145 */ 146 147program NLM_PROG { 148 version NLM_VERS { 149 150 nlm_testres NLM_TEST(struct nlm_testargs) = 1; 151 152 nlm_res NLM_LOCK(struct nlm_lockargs) = 2; 153 154 nlm_res NLM_CANCEL(struct nlm_cancargs) = 3; 155 nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4; 156 157 /* 158 * remote lock manager call-back to grant lock 159 */ 160 nlm_res NLM_GRANTED(struct nlm_testargs)= 5; 161 /* 162 * message passing style of requesting lock 163 */ 164 void NLM_TEST_MSG(struct nlm_testargs) = 6; 165 void NLM_LOCK_MSG(struct nlm_lockargs) = 7; 166 void NLM_CANCEL_MSG(struct nlm_cancargs) =8; 167 void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9; 168 void NLM_GRANTED_MSG(struct nlm_testargs) = 10; 169 void NLM_TEST_RES(nlm_testres) = 11; 170 void NLM_LOCK_RES(nlm_res) = 12; 171 void NLM_CANCEL_RES(nlm_res) = 13; 172 void NLM_UNLOCK_RES(nlm_res) = 14; 173 void NLM_GRANTED_RES(nlm_res) = 15; 174 } = 1; 175 176 version NLM_VERSX { 177 nlm_shareres NLM_SHARE(nlm_shareargs) = 20; 178 nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21; 179 nlm_res NLM_NM_LOCK(nlm_lockargs) = 22; 180 void NLM_FREE_ALL(nlm_notify) = 23; 181 } = 3; 182 183} = 100021; 184
|