]>
Commit | Line | Data |
---|---|---|
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 | 8 | struct nlm4_holder * testlock(struct nlm4_lock *lock, bool_t exclusive, int flags); |
2b484d24 A |
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); | |
7902cf7e | 12 | int lock_answer(int version, netobj *netcookie, nlm4_lock *lock, int flags, int result); |
2b484d24 A |
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); | |
ac2f15b3 | 15 | void do_free_all(const char *hostname); |
7902cf7e | 16 | void granted_failed(nlm4_res *arg); |
ac2f15b3 A |
17 | |
18 | void notify(const char *hostname, const int state); | |
19 | ||
6720d03d | 20 | void monitor_lock_host_by_name(const char *, const struct sockaddr *); |
ccaf7288 A |
21 | void monitor_lock_host_by_addr(const struct sockaddr *addr); |
22 | void 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 |
34 | int transmit_result(int, nlm_res *, struct sockaddr *); |
35 | int transmit4_result(int, nlm4_res *, struct sockaddr *); | |
ac2f15b3 | 36 | CLIENT *get_client(struct sockaddr *, rpcvers_t); |
ccaf7288 | 37 | int addrcmp(const struct sockaddr *, const struct sockaddr *); |
7902cf7e A |
38 | |
39 | extern time_t currsec; | |
40 | ||
41 | #endif /* !LOCKD_LOCK_H */ |