]>
git.saurik.com Git - apple/network_cmds.git/blob - rpc_lockd.tproj/lockd_lock.h
5c71e26b74eab40ff2b0e8c4f788a31bad25029a
1 /* $NetBSD: lockd_lock.h,v 1.2 2000/06/09 14:00:54 fvdl Exp $ */
2 /* $FreeBSD: src/usr.sbin/rpc.lockd/lockd_lock.h,v 1.4 2002/03/21 22:52:45 alfred Exp $ */
4 /* Headers and function declarations for file-locking utilities */
8 struct nlm4_holder
* testlock(struct nlm4_lock
*lock
, bool_t exclusive
, int flags
);
9 enum nlm4_stats
getlock(nlm4_lockargs
*lckarg
, struct svc_req
*rqstp
, const int flags
);
10 enum nlm4_stats
unlock(nlm4_lock
*lock
, const int flags
);
11 enum nlm4_stats
cancellock(nlm4_cancargs
*args
, const int flags
);
12 int lock_answer(int version
, netobj
*netcookie
, nlm4_lock
*lock
, int flags
, int result
);
13 enum nlm4_stats
getshare(nlm_shareargs
*shrarg
, struct svc_req
*rqstp
, const int flags
);
14 enum nlm4_stats
unshare(nlm_shareargs
*shrarg
, struct svc_req
*rqstp
, const int flags
);
15 void do_free_all(const char *hostname
);
16 void granted_failed(nlm4_res
*arg
);
18 void notify(const char *hostname
, const int state
);
20 void monitor_lock_host_by_name(const char *hostname
);
21 void monitor_lock_host_by_addr(const struct sockaddr
*addr
);
22 void unmonitor_lock_host(const char *hostname
);
24 /* flags for testlock, getlock & unlock */
25 #define LOCK_ASYNC 0x01 /* async version (getlock only) */
26 #define LOCK_V4 0x02 /* v4 version */
27 #define LOCK_MON 0x04 /* monitored lock (getlock only) */
29 /* flags for lock_answer */
30 #define LOCK_ANSWER_GRANTED 0x0001 /* NLM_GRANTED request */
31 #define LOCK_ANSWER_LOCK_EXCL 0x0004 /* lock is exclusive */
33 /* callbacks from lock_proc.c */
34 int transmit_result(int, nlm_res
*, struct sockaddr
*);
35 int transmit4_result(int, nlm4_res
*, struct sockaddr
*);
36 CLIENT
*get_client(struct sockaddr
*, rpcvers_t
);
37 int addrcmp(const struct sockaddr
*, const struct sockaddr
*);
39 extern time_t currsec
;
41 #endif /* !LOCKD_LOCK_H */