nlm_prot.x revision 1832
11832Swollman/* 21832Swollman * Network lock manager protocol definition 31832Swollman * Copyright (C) 1986 Sun Microsystems, Inc. 41832Swollman * 51832Swollman * protocol used between local lock manager and remote lock manager 61832Swollman */ 71832Swollman 81832Swollman#ifdef RPC_HDR 91832Swollman%#define LM_MAXSTRLEN 1024 101832Swollman%#define MAXNAMELEN LM_MAXSTRLEN+1 111832Swollman#else 121832Swollman%#ifndef lint 131832Swollman%/*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/ 141832Swollman%/*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ 151832Swollman%static char rcsid[] = "$Id: nlm_prot.x,v 1.1 1993/09/14 17:42:45 jtc Exp $"; 161832Swollman%#endif /* not lint */ 171832Swollman#endif 181832Swollman 191832Swollman/* 201832Swollman * status of a call to the lock manager 211832Swollman */ 221832Swollmanenum nlm_stats { 231832Swollman nlm_granted = 0, 241832Swollman nlm_denied = 1, 251832Swollman nlm_denied_nolocks = 2, 261832Swollman nlm_blocked = 3, 271832Swollman nlm_denied_grace_period = 4 281832Swollman}; 291832Swollman 301832Swollmanstruct nlm_holder { 311832Swollman bool exclusive; 321832Swollman int svid; 331832Swollman netobj oh; 341832Swollman unsigned l_offset; 351832Swollman unsigned l_len; 361832Swollman}; 371832Swollman 381832Swollmanunion nlm_testrply switch (nlm_stats stat) { 391832Swollman case nlm_denied: 401832Swollman struct nlm_holder holder; 411832Swollman default: 421832Swollman void; 431832Swollman}; 441832Swollman 451832Swollmanstruct nlm_stat { 461832Swollman nlm_stats stat; 471832Swollman}; 481832Swollman 491832Swollmanstruct nlm_res { 501832Swollman netobj cookie; 511832Swollman nlm_stat stat; 521832Swollman}; 531832Swollman 541832Swollmanstruct nlm_testres { 551832Swollman netobj cookie; 561832Swollman nlm_testrply stat; 571832Swollman}; 581832Swollman 591832Swollmanstruct nlm_lock { 601832Swollman string caller_name<LM_MAXSTRLEN>; 611832Swollman netobj fh; /* identify a file */ 621832Swollman netobj oh; /* identify owner of a lock */ 631832Swollman int svid; /* generated from pid for svid */ 641832Swollman unsigned l_offset; 651832Swollman unsigned l_len; 661832Swollman}; 671832Swollman 681832Swollmanstruct nlm_lockargs { 691832Swollman netobj cookie; 701832Swollman bool block; 711832Swollman bool exclusive; 721832Swollman struct nlm_lock alock; 731832Swollman bool reclaim; /* used for recovering locks */ 741832Swollman int state; /* specify local status monitor state */ 751832Swollman}; 761832Swollman 771832Swollmanstruct nlm_cancargs { 781832Swollman netobj cookie; 791832Swollman bool block; 801832Swollman bool exclusive; 811832Swollman struct nlm_lock alock; 821832Swollman}; 831832Swollman 841832Swollmanstruct nlm_testargs { 851832Swollman netobj cookie; 861832Swollman bool exclusive; 871832Swollman struct nlm_lock alock; 881832Swollman}; 891832Swollman 901832Swollmanstruct nlm_unlockargs { 911832Swollman netobj cookie; 921832Swollman struct nlm_lock alock; 931832Swollman}; 941832Swollman 951832Swollman 961832Swollman#ifdef RPC_HDR 971832Swollman%/* 981832Swollman% * The following enums are actually bit encoded for efficient 991832Swollman% * boolean algebra.... DON'T change them..... 1001832Swollman% */ 1011832Swollman#endif 1021832Swollmanenum fsh_mode { 1031832Swollman fsm_DN = 0, /* deny none */ 1041832Swollman fsm_DR = 1, /* deny read */ 1051832Swollman fsm_DW = 2, /* deny write */ 1061832Swollman fsm_DRW = 3 /* deny read/write */ 1071832Swollman}; 1081832Swollman 1091832Swollmanenum fsh_access { 1101832Swollman fsa_NONE = 0, /* for completeness */ 1111832Swollman fsa_R = 1, /* read only */ 1121832Swollman fsa_W = 2, /* write only */ 1131832Swollman fsa_RW = 3 /* read/write */ 1141832Swollman}; 1151832Swollman 1161832Swollmanstruct nlm_share { 1171832Swollman string caller_name<LM_MAXSTRLEN>; 1181832Swollman netobj fh; 1191832Swollman netobj oh; 1201832Swollman fsh_mode mode; 1211832Swollman fsh_access access; 1221832Swollman}; 1231832Swollman 1241832Swollmanstruct nlm_shareargs { 1251832Swollman netobj cookie; 1261832Swollman nlm_share share; 1271832Swollman bool reclaim; 1281832Swollman}; 1291832Swollman 1301832Swollmanstruct nlm_shareres { 1311832Swollman netobj cookie; 1321832Swollman nlm_stats stat; 1331832Swollman int sequence; 1341832Swollman}; 1351832Swollman 1361832Swollmanstruct nlm_notify { 1371832Swollman string name<MAXNAMELEN>; 1381832Swollman long state; 1391832Swollman}; 1401832Swollman 1411832Swollman/* 1421832Swollman * Over-the-wire protocol used between the network lock managers 1431832Swollman */ 1441832Swollman 1451832Swollmanprogram NLM_PROG { 1461832Swollman version NLM_VERS { 1471832Swollman 1481832Swollman nlm_testres NLM_TEST(struct nlm_testargs) = 1; 1491832Swollman 1501832Swollman nlm_res NLM_LOCK(struct nlm_lockargs) = 2; 1511832Swollman 1521832Swollman nlm_res NLM_CANCEL(struct nlm_cancargs) = 3; 1531832Swollman nlm_res NLM_UNLOCK(struct nlm_unlockargs) = 4; 1541832Swollman 1551832Swollman /* 1561832Swollman * remote lock manager call-back to grant lock 1571832Swollman */ 1581832Swollman nlm_res NLM_GRANTED(struct nlm_testargs)= 5; 1591832Swollman /* 1601832Swollman * message passing style of requesting lock 1611832Swollman */ 1621832Swollman void NLM_TEST_MSG(struct nlm_testargs) = 6; 1631832Swollman void NLM_LOCK_MSG(struct nlm_lockargs) = 7; 1641832Swollman void NLM_CANCEL_MSG(struct nlm_cancargs) =8; 1651832Swollman void NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9; 1661832Swollman void NLM_GRANTED_MSG(struct nlm_testargs) = 10; 1671832Swollman void NLM_TEST_RES(nlm_testres) = 11; 1681832Swollman void NLM_LOCK_RES(nlm_res) = 12; 1691832Swollman void NLM_CANCEL_RES(nlm_res) = 13; 1701832Swollman void NLM_UNLOCK_RES(nlm_res) = 14; 1711832Swollman void NLM_GRANTED_RES(nlm_res) = 15; 1721832Swollman } = 1; 1731832Swollman 1741832Swollman version NLM_VERSX { 1751832Swollman nlm_shareres NLM_SHARE(nlm_shareargs) = 20; 1761832Swollman nlm_shareres NLM_UNSHARE(nlm_shareargs) = 21; 1771832Swollman nlm_res NLM_NM_LOCK(nlm_lockargs) = 22; 1781832Swollman void NLM_FREE_ALL(nlm_notify) = 23; 1791832Swollman } = 3; 1801832Swollman 1811832Swollman} = 100021; 1821832Swollman 183