nlm_prot.x revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
* 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
*/
/*
* Network lock manager protocol definition
* Copyright (C) 1986, 1992, 1993, 1997, 1999 by Sun Microsystems, 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.)
*/
%#pragma ident "%Z%%M% %I% %E% SMI"
#if RPC_HDR
%
%#include <rpc/rpc_sztypes.h>
%
#endif
#ifdef RPC_HDR
%#define LM_MAXSTRLEN 1024
#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_deadlck = 5
};
/*
* The holder of a conflicting lock.
*/
struct nlm_holder {
bool exclusive;
int svid;
unsigned l_offset;
unsigned l_len;
};
case nlm_denied:
struct nlm_holder holder;
default:
void;
};
struct nlm_stat {
};
struct nlm_res {
};
struct nlm_testres {
};
struct nlm_lock {
int svid; /* generated from pid for svid */
unsigned l_offset;
unsigned l_len;
};
struct nlm_lockargs {
bool block;
bool exclusive;
bool reclaim; /* used for recovering locks */
int state; /* specify local status monitor state */
};
struct nlm_cancargs {
bool block;
bool exclusive;
};
struct nlm_testargs {
bool exclusive;
};
struct nlm_unlockargs {
};
#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 */
};
enum fsh_access {
fsa_NONE = 0, /* for completeness */
};
struct nlm_share {
};
struct nlm_shareargs {
bool reclaim;
};
struct nlm_shareres {
int sequence;
};
struct nlm_notify {
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 */
/* due to conflicting lock */
/* when granted */
/* reestablishing old locks */
/* too big */
};
/*
* The holder of a conflicting lock.
*/
struct nlm4_holder {
bool exclusive;
};
case NLM4_DENIED:
struct nlm4_holder holder;
default:
void;
};
struct nlm4_stat {
};
struct nlm4_res {
};
struct nlm4_testres {
};
struct nlm4_lock {
};
struct nlm4_lockargs {
bool block;
bool exclusive;
bool reclaim; /* used for recovering locks */
};
struct nlm4_cancargs {
bool block;
bool exclusive;
};
struct nlm4_testargs {
bool exclusive;
};
struct nlm4_unlockargs {
};
#ifdef RPC_HDR
%/*
% * The following enums are actually bit encoded for efficient
% * boolean algebra.... DON'T change them.....
% */
#endif
enum fsh4_mode {
FSM_DN = 0, /* deny none */
};
enum fsh4_access {
FSA_NONE = 0, /* for completeness */
};
struct nlm4_share {
};
struct nlm4_shareargs {
bool reclaim;
};
struct nlm4_shareres {
};
struct nlm4_notify {
};
/*
* Over-the-wire protocol used between the network lock managers
*/
/*
* remote lock manager call-back to grant lock
*/
/*
* message passing style of requesting lock
*/
void
void
void
void
void
void
void
void
void
void
} = 1;
void
} = 3;
void
NLMPROC4_NULL(void) = 0;
/*
* remote lock manager call-back to grant lock
*/
/*
* message passing style of requesting lock
*/
void
void
void
void
void
void
void
void
void
void
/*
* DOS-style file sharing
*/
void
} = 4;
} = 100021;