]> git.saurik.com Git - apple/network_cmds.git/blame - rpc_lockd.tproj/lockd_lock.h
network_cmds-245.8.tar.gz
[apple/network_cmds.git] / rpc_lockd.tproj / lockd_lock.h
CommitLineData
ac2f15b3
A
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 $ */
3
4/* Headers and function declarations for file-locking utilities */
5
7902cf7e
A
6#ifndef LOCKD_LOCK_H
7#define LOCKD_LOCK_H
ac2f15b3 8struct nlm4_holder * testlock(struct nlm4_lock *lock, bool_t exclusive, int flags);
2b484d24
A
9enum nlm4_stats getlock(nlm4_lockargs *lckarg, struct svc_req *rqstp, const int flags);
10enum nlm4_stats unlock(nlm4_lock *lock, const int flags);
11enum nlm4_stats cancellock(nlm4_cancargs *args, const int flags);
7902cf7e 12int lock_answer(int version, netobj *netcookie, nlm4_lock *lock, int flags, int result);
2b484d24
A
13enum nlm4_stats getshare(nlm_shareargs *shrarg, struct svc_req *rqstp, const int flags);
14enum nlm4_stats unshare(nlm_shareargs *shrarg, struct svc_req *rqstp, const int flags);
ac2f15b3 15void do_free_all(const char *hostname);
7902cf7e 16void granted_failed(nlm4_res *arg);
ac2f15b3
A
17
18void notify(const char *hostname, const int state);
19
6720d03d 20void monitor_lock_host_by_name(const char *, const struct sockaddr *);
ccaf7288
A
21void monitor_lock_host_by_addr(const struct sockaddr *addr);
22void unmonitor_lock_host(const char *hostname);
23
ac2f15b3
A
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) */
7902cf7e
A
28
29/* flags for lock_answer */
30#define LOCK_ANSWER_GRANTED 0x0001 /* NLM_GRANTED request */
31#define LOCK_ANSWER_LOCK_EXCL 0x0004 /* lock is exclusive */
ac2f15b3
A
32
33/* callbacks from lock_proc.c */
ccaf7288
A
34int transmit_result(int, nlm_res *, struct sockaddr *);
35int transmit4_result(int, nlm4_res *, struct sockaddr *);
ac2f15b3 36CLIENT *get_client(struct sockaddr *, rpcvers_t);
ccaf7288 37int addrcmp(const struct sockaddr *, const struct sockaddr *);
7902cf7e
A
38
39extern time_t currsec;
40
41#endif /* !LOCKD_LOCK_H */