Date: Fri, 13 Oct 2000 18:21:36 -0500 From: Dan Nelson <dnelson@emsphone.com> To: Alfred Perlstein <bright@wintelcom.net> Cc: Dan Bongert <dbongert@ssc.wisc.edu>, freebsd-questions@FreeBSD.ORG Subject: Re: NFS Mounts 4.0-RELEASE -> Tru64 5.0 Message-ID: <20001013182136.A25191@dan.emsphone.com> In-Reply-To: <20001012211905.B4156@dan.emsphone.com>; from "Dan Nelson" on Thu Oct 12 21:19:05 GMT 2000 References: <XFMail.20001012163701.dbongert@ssc.wisc.edu> <20001012165038.A25813@dan.emsphone.com> <20001012165618.B272@fw.wintelcom.net> <20001012211905.B4156@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--9amGYk9869ThD9tj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In the last episode (Oct 12), Alfred Perlstein said: > * Dan Nelson <dnelson@emsphone.com> [001012 16:53] wrote: > > In the last episode (Oct 12), Dan Bongert said: > > > Oct 12 16:03:48 mariah lockd[373]: Can't create client handle to > > > charles NLMv4: RPC: Program not registered > > > > That's cause pine is trying to lock a mailbox, and FreeBSD's lockd > > doesn't support NLMv4 at all, not even dummy "return OK for > > everything" code. Alfred Perlstein has patches though (poke poke). > > any chance you can regen them for me from what I gave you? I've no > clue where the last set of working ones I had are. :( Attached; this diff is from a recent-ish 4.1 system. It should apply to 3.* or 5.* with minimal changes. -- Dan Nelson dnelson@emsphone.com --9amGYk9869ThD9tj Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="nlm4.diff" Index: include/rpcsvc/nlm_prot.x =================================================================== RCS file: /home/ncvs/src/include/rpcsvc/nlm_prot.x,v retrieving revision 1.8 diff -b -u -p -r1.8 nlm_prot.x --- include/rpcsvc/nlm_prot.x 1999/08/27 23:45:10 1.8 +++ include/rpcsvc/nlm_prot.x 2000/02/05 22:44:36 @@ -11,6 +11,7 @@ #ifdef RPC_HDR %#define LM_MAXSTRLEN 1024 %#define MAXNAMELEN LM_MAXSTRLEN+1 +%#include <sys/types.h> #else %#ifndef lint %static const char rcsid[] = @@ -33,8 +34,8 @@ struct nlm_holder { bool exclusive; int svid; netobj oh; - unsigned l_offset; - unsigned l_len; + u_int32_t l_offset; + u_int32_t l_len; }; union nlm_testrply switch (nlm_stats stat) { @@ -62,9 +63,9 @@ struct nlm_lock { string caller_name<LM_MAXSTRLEN>; netobj fh; /* identify a file */ netobj oh; /* identify owner of a lock */ - int svid; /* generated from pid for svid */ - unsigned l_offset; - unsigned l_len; + int32_t svid; /* generated from pid for svid */ + u_int32_t l_offset; + u_int32_t l_len; }; struct nlm_lockargs { @@ -73,7 +74,7 @@ struct nlm_lockargs { bool exclusive; struct nlm_lock alock; bool reclaim; /* used for recovering locks */ - int state; /* specify local status monitor state */ + int32_t state; /* specify local status monitor state */ }; struct nlm_cancargs { @@ -132,14 +133,119 @@ struct nlm_shareargs { struct nlm_shareres { netobj cookie; nlm_stats stat; - int sequence; + int32_t sequence; }; struct nlm_notify { string name<MAXNAMELEN>; - long state; + int32_t state; }; +enum nlm4_stats { + nlm4_granted = 0, + nlm4_denied = 1, + nlm4_denied_nolocks = 2, + nlm4_blocked = 3, + nlm4_denied_grace_period = 4, + nlm4_deadlck = 5, + nlm4_rofs = 6, + nlm4_stale_fh = 7, + nlm4_fbig = 8, + nlm4_failed = 9 +}; + +struct nlm4_holder { + bool exclusive; + int32_t svid; + netobj oh; + u_int64_t l_offset; + u_int64_t l_len; +}; + +struct nlm4_stat { + nlm4_stats stat; +}; + +union nlm4_testrply switch (nlm4_stats stat) { + case nlm4_denied: + struct nlm4_holder holder; + default: + void; +}; + +struct nlm4_res { + netobj cookie; + nlm4_stat stat; +}; + +struct nlm4_testres { + netobj cookie; + nlm4_testrply stat; +}; + + +struct nlm4_lock { + string caller_name<LM_MAXSTRLEN>; + netobj fh; /* identify a file */ + netobj oh; /* identify owner of a lock */ + int32_t svid; /* generated from pid for svid */ + int64_t l_offset; + int64_t l_len; +}; + +struct nlm4_lockargs { + netobj cookie; + bool block; + bool exclusive; + struct nlm4_lock alock; + bool reclaim; /* used for recovering locks */ + int32_t state; /* specify local status monitor state */ +}; + + +struct nlm4_cancargs { + netobj cookie; + bool block; + bool exclusive; + struct nlm4_lock alock; +}; + +struct nlm4_testargs { + netobj cookie; + bool exclusive; + struct nlm4_lock alock; +}; + +struct nlm4_unlockargs { + netobj cookie; + struct nlm4_lock alock; +}; + +struct nlm4_share { + string caller_name<LM_MAXSTRLEN>; + netobj fh; + netobj oh; + fsh_mode mode; + fsh_access access; +}; + +struct nlm4_shareargs { + netobj cookie; + nlm4_share share; + bool reclaim; +}; + +struct nlm4_shareres { + netobj cookie; + nlm4_stats stat; + int32_t sequence; +}; + +struct nlm4_notify { + string name<MAXNAMELEN>; + int32_t state; +}; + /* * Over-the-wire protocol used between the network lock managers */ @@ -179,6 +285,40 @@ program NLM_PROG { nlm_res NLM_NM_LOCK(nlm_lockargs) = 22; void NLM_FREE_ALL(nlm_notify) = 23; } = 3; + + version NLM4_VERS { + void NLMPROC4_NULL(void) = 0; + + nlm4_testres NLMPROC4_TEST(struct nlm4_testargs) = 1; + + nlm4_res NLMPROC4_LOCK(struct nlm4_lockargs) = 2; + + nlm4_res NLMPROC4_CANCEL(struct nlm4_cancargs) = 3; + nlm4_res NLMPROC4_UNLOCK(struct nlm4_unlockargs) = 4; + + /* + * remote lock manager call-back to grant lock + */ + nlm4_res NLMPROC4_GRANTED(struct nlm4_testargs)= 5; + /* + * message passing style of requesting lock + */ + void NLMPROC4_TEST_MSG(struct nlm4_testargs) = 6; + void NLMPROC4_LOCK_MSG(struct nlm4_lockargs) = 7; + void NLMPROC4_CANCEL_MSG(struct nlm4_cancargs) =8; + void NLMPROC4_UNLOCK_MSG(struct nlm4_unlockargs) = 9; + void NLMPROC4_GRANTED_MSG(struct nlm4_testargs) = 10; + void NLMPROC4_TEST_RES(nlm4_testres) = 11; + void NLMPROC4_LOCK_RES(nlm4_res) = 12; + void NLMPROC4_CANCEL_RES(nlm4_res) = 13; + void NLMPROC4_UNLOCK_RES(nlm4_res) = 14; + void NLMPROC4_GRANTED_RES(nlm4_res) = 15; + + nlm4_shareres NLMPROC4_SHARE(nlm4_shareargs) = 20; + nlm4_shareres NLMPROC4_UNSHARE(nlm4_shareargs) = 21; + nlm4_res NLMPROC4_NM_LOCK(nlm4_lockargs) = 22; + void NLMPROC4_FREE_ALL(nlm4_notify) = 23; + } = 4; } = 100021; Index: usr.sbin/rpc.lockd/Makefile =================================================================== RCS file: /home/ncvs/src/usr.sbin/rpc.lockd/Makefile,v retrieving revision 1.8 diff -b -u -p -r1.8 Makefile --- usr.sbin/rpc.lockd/Makefile 1999/08/28 01:19:34 1.8 +++ usr.sbin/rpc.lockd/Makefile 2000/02/05 22:51:27 @@ -1,7 +1,11 @@ # $FreeBSD: src/usr.sbin/rpc.lockd/Makefile,v 1.8 1999/08/28 01:19:34 peter Exp $ PROG = rpc.lockd -SRCS = nlm_prot_svc.c nlm_prot.h lockd.c procs.c +SRCS = nlm_prot_svc.c nlm_prot_clnt.c nlm_prot.h \ + lockd.c procs.c +# klm_procs.c \ +# klm_prot_svc.c klm_prot.h + MAN8 = rpc.lockd.8 DPADD= ${LIBRPCSVC} @@ -9,16 +13,27 @@ LDADD= -lrpcsvc CFLAGS+= -I. -CLEANFILES= nlm_prot_svc.c nlm_prot.h +CLEANFILES= nlm_prot_svc.c nlm_prot.h nlm_prot_clnt.c \ + klm_prot_svc.c klm_prot.h -RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x +NLMRPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x +KLMRPCSRC= ${DESTDIR}/usr/include/rpcsvc/klm_prot.x RPCGEN= rpcgen -L -C + +nlm_prot_clnt.c: ${NLMRPCSRC} + ${RPCGEN} -l -o ${.TARGET} ${NLMRPCSRC} + +nlm_prot_svc.c: ${NLMRPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${NLMRPCSRC} + +nlm_prot.h: ${NLMRPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${NLMRPCSRC} -nlm_prot_svc.c: ${RPCSRC} - ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} +klm_prot_svc.c: ${KLMRPCSRC} + ${RPCGEN} -m -o ${.TARGET} ${KLMRPCSRC} -nlm_prot.h: ${RPCSRC} - ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} +klm_prot.h: ${KLMRPCSRC} + ${RPCGEN} -h -o ${.TARGET} ${KLMRPCSRC} test: test.c cc -o test test.c -lrpcsvc Index: usr.sbin/rpc.lockd/lockd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/rpc.lockd/lockd.c,v retrieving revision 1.5 diff -b -u -p -r1.5 lockd.c --- usr.sbin/rpc.lockd/lockd.c 1999/08/28 01:19:35 1.5 +++ usr.sbin/rpc.lockd/lockd.c 2000/02/05 22:51:27 @@ -49,6 +49,7 @@ static const char rcsid[] = void nlm_prog_1 __P((struct svc_req *, SVCXPRT *)); void nlm_prog_3 __P((struct svc_req *, SVCXPRT *)); +void nlm_prog_4 __P((struct svc_req *, SVCXPRT *)); static void usage __P((void)); int debug_level = 0; /* Zero means no debugging syslog() calls */ @@ -70,6 +71,7 @@ main(int argc, char **argv) (void)pmap_unset(NLM_PROG, NLM_VERS); (void)pmap_unset(NLM_PROG, NLM_VERSX); + (void)pmap_unset(NLM_PROG, NLM4_VERS); transp = svcudp_create(RPC_ANYSOCK); if (transp == NULL) @@ -78,6 +80,8 @@ main(int argc, char **argv) errx(1, "unable to register (NLM_PROG, NLM_VERS, udp)"); if (!svc_register(transp, NLM_PROG, NLM_VERSX, nlm_prog_3, IPPROTO_UDP)) errx(1, "unable to register (NLM_PROG, NLM_VERSX, udp)"); + if (!svc_register(transp, NLM_PROG, NLM4_VERS, nlm_prog_4, IPPROTO_UDP)) + errx(1, "unable to register (NLM_PROG, NLM4_VERS, udp)"); transp = svctcp_create(RPC_ANYSOCK, 0, 0); if (transp == NULL) @@ -86,6 +90,8 @@ main(int argc, char **argv) errx(1, "unable to register (NLM_PROG, NLM_VERS, tcp)"); if (!svc_register(transp, NLM_PROG, NLM_VERSX, nlm_prog_3, IPPROTO_TCP)) errx(1, "unable to register (NLM_PROG, NLM_VERSX, tcp)"); + if (!svc_register(transp, NLM_PROG, NLM4_VERS, nlm_prog_4, IPPROTO_TCP)) + errx(1, "unable to register (NLM_PROG, NLM4_VERS, tcp)"); /* Note that it is NOT sensible to run this program from inetd - the */ /* protocol assumes that it will run immediately at boot time. */ Index: usr.sbin/rpc.lockd/procs.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/rpc.lockd/procs.c,v retrieving revision 1.4.2.1 diff -b -u -p -r1.4.2.1 procs.c --- usr.sbin/rpc.lockd/procs.c 2000/07/20 10:35:23 1.4.2.1 +++ usr.sbin/rpc.lockd/procs.c 2000/09/16 20:30:07 @@ -49,6 +49,13 @@ static const char rcsid[] = #define CLIENT_CACHE_SIZE 64 /* No. of client sockets cached */ #define CLIENT_CACHE_LIFETIME 120 /* In seconds */ +#if 0 +#undef LOG_DEBUG +#undef LOG_ERR +#define LOG_DEBUG stderr +#define LOG_ERR stderr +#define syslog fprintf +#endif /* log_from_addr ----------------------------------------------------------- */ /* @@ -200,7 +207,7 @@ static CLIENT *get_client(struct sockadd without expecting a result */ -static void transmit_result(int opcode, nlm_res *result, struct svc_req *req) +static void transmit_result(int opcode, void *result, struct svc_req *req) { static char dummy; struct sockaddr_in *addr; @@ -217,7 +224,7 @@ static void transmit_result(int opcode, success = clnt_call(cli, opcode, xdr_nlm_res, result, xdr_void, &dummy, timeo); - if (debug_level > 2) syslog(LOG_DEBUG, "clnt_call returns %d\n", success); + if (debug_level > 2) syslog(LOG_DEBUG, "clnt_call returns %d", success); } } @@ -271,6 +278,21 @@ nlm_testres *nlm_test_1_svc(nlm_testargs return (&res); } +nlm4_testres *nlmproc4_test_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) +{ + static nlm4_testres res; + if (debug_level) log_from_addr("nlm_test", rqstp); + + /* Copy the cookie from the argument into the result. Note that this */ + /* is slightly hazardous, as the structure contains a pointer to a */ + /* malloc()ed buffer that will get freed by the caller. However, the */ + /* main function transmits the result before freeing the argument */ + /* so it is in fact safe. */ + res.cookie = arg->cookie; + res.stat.stat = nlm4_granted; + return (&res); +} + void *nlm_test_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { nlm_testres res; @@ -296,11 +318,43 @@ void *nlm_test_msg_1_svc(nlm_testargs *a success = clnt_call(cli, NLM_TEST_RES, xdr_nlm_testres, &res, xdr_void, &dummy, timeo); - if (debug_level > 2) syslog(LOG_DEBUG, "clnt_call returns %d\n", success); + if (debug_level > 2) syslog(LOG_DEBUG, "clnt_call returns %d", success); } return (NULL); } +void *nlmproc4_test_msg_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) +{ + nlm4_testres res; + static char dummy; + struct sockaddr_in *addr; + CLIENT *cli; + int success; + struct timeval timeo; + + if (debug_level) log_from_addr("nlm_test_msg", rqstp); + + res.cookie = arg->cookie; + res.stat.stat = nlm4_granted; + + /* nlm_test has different result type to the other operations, so */ + /* can't use transmit_result() in this case */ + addr = svc_getcaller(rqstp->rq_xprt); + if ((cli = get_client(addr))) + { + timeo.tv_sec = 0; /* No timeout - not expecting response */ + timeo.tv_usec = 0; + + success = clnt_call(cli, NLMPROC4_TEST_RES, xdr_nlm_testres, &res, xdr_void, + &dummy, timeo); + + if (debug_level > 2) syslog(LOG_DEBUG, "clnt_call returns %d", success); + } + return (NULL); +} + + + /* nlm_lock ---------------------------------------------------------------- */ /* Purposes: Establish a lock @@ -320,6 +374,19 @@ nlm_res *nlm_lock_1_svc(nlm_lockargs *ar return (&res); } +nlm4_res *nlmproc4_lock_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + + if (debug_level) log_from_addr("nlm_lock", rqstp); + + /* copy cookie from arg to result. See comment in nlm_test_1() */ + res.cookie = arg->cookie; + + res.stat.stat = nlm4_granted; + return (&res); +} + void *nlm_lock_msg_1_svc(nlm_lockargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -333,6 +400,20 @@ void *nlm_lock_msg_1_svc(nlm_lockargs *a return (NULL); } +void *nlmproc4_lock_msg_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + + if (debug_level) log_from_addr("nlm_lock_msg", rqstp); + + res.cookie = arg->cookie; + res.stat.stat = nlm4_granted; + transmit_result(NLMPROC4_LOCK_RES, &res, rqstp); + + return (NULL); +} + + /* nlm_cancel -------------------------------------------------------------- */ /* Purpose: Cancel a blocked lock request @@ -354,6 +435,20 @@ nlm_res *nlm_cancel_1_svc(nlm_cancargs * return (&res); } +nlm4_res *nlmproc4_cancel_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_cancel", rqstp); + + /* copy cookie from arg to result. See comment in nlm_test_1() */ + res.cookie = arg->cookie; + + /* Since at present we never return 'nlm_blocked', there can never be */ + /* a lock to cancel, so this call always fails. */ + res.stat.stat = nlm4_denied; + return (&res); +} + void *nlm_cancel_msg_1_svc(nlm_cancargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -367,6 +462,19 @@ void *nlm_cancel_msg_1_svc(nlm_cancargs return (NULL); } +void *nlmproc4_cancel_msg_4_svc(nlm4_cancargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_cancel_msg", rqstp); + + res.cookie = arg->cookie; + /* Since at present we never return 'nlm_blocked', there can never be */ + /* a lock to cancel, so this call always fails. */ + res.stat.stat = nlm4_denied; + transmit_result(NLMPROC4_CANCEL_RES, &res, rqstp); + return (NULL); +} + /* nlm_unlock -------------------------------------------------------------- */ /* Purpose: Release an existing lock @@ -387,6 +495,17 @@ nlm_res *nlm_unlock_1_svc(nlm_unlockargs return (&res); } +nlm4_res *nlmproc4_unlock_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_unlock", rqstp); + + res.stat.stat= nlm4_granted; + res.cookie = arg->cookie; + + return (&res); +} + void *nlm_unlock_msg_1_svc(nlm_unlockargs *arg, struct svc_req *rqstp) { static nlm_res res; @@ -399,6 +518,18 @@ void *nlm_unlock_msg_1_svc(nlm_unlockarg return (NULL); } +void *nlmproc4_unlock_msg_4_svc(nlm4_unlockargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_unlock_msg", rqstp); + + res.stat.stat = nlm4_granted; + res.cookie = arg->cookie; + + transmit_result(NLMPROC4_UNLOCK_RES, &res, rqstp); + return (NULL); +} + /* ------------------------------------------------------------------------- */ /* Client-side pseudo-RPCs for results. Note that for the client there @@ -430,6 +561,18 @@ nlm_res *nlm_granted_1_svc(nlm_testargs return (&res); } +nlm4_res *nlmproc4_granted_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_granted", rqstp); + + /* copy cookie from arg to result. See comment in nlm_test_1() */ + res.cookie = arg->cookie; + + res.stat.stat = nlm4_granted; + return (&res); +} + void *nlm_granted_msg_1_svc(nlm_testargs *arg, struct svc_req *rqstp) { nlm_res res; @@ -441,6 +584,17 @@ void *nlm_granted_msg_1_svc(nlm_testargs return (NULL); } +void *nlmproc4_granted_msg_4_svc(nlm4_testargs *arg, struct svc_req *rqstp) +{ + nlm4_res res; + if (debug_level) log_from_addr("nlm_granted_msg", rqstp); + + res.cookie = arg->cookie; + res.stat.stat = nlm4_granted; + transmit_result(NLMPROC4_GRANTED_RES, &res, rqstp); + return (NULL); +} + /* nlm_test_res ------------------------------------------------------------ */ /* Purpose: Accept result from earlier nlm_test_msg() call @@ -453,6 +607,12 @@ void *nlm_test_res_1_svc(nlm_testres *ar return (NULL); } +void *nlmproc4_test_res_4_svc(nlm4_testres *arg, struct svc_req *rqstp) +{ + if (debug_level) log_from_addr("nlm_test_res", rqstp); + return (NULL); +} + /* nlm_lock_res ------------------------------------------------------------ */ /* Purpose: Accept result from earlier nlm_lock_msg() call @@ -466,6 +626,13 @@ void *nlm_lock_res_1_svc(nlm_res *arg, s return (NULL); } +void *nlmproc4_lock_res_4_svc(nlm4_res *arg, struct svc_req *rqstp) +{ + if (debug_level) log_from_addr("nlm_lock_res", rqstp); + + return (NULL); +} + /* nlm_cancel_res ---------------------------------------------------------- */ /* Purpose: Accept result from earlier nlm_cancel_msg() call @@ -478,6 +645,12 @@ void *nlm_cancel_res_1_svc(nlm_res *arg, return (NULL); } +void *nlmproc4_cancel_res_4_svc(nlm4_res *arg, struct svc_req *rqstp) +{ + if (debug_level) log_from_addr("nlm_cancel_res", rqstp); + return (NULL); +} + /* nlm_unlock_res ---------------------------------------------------------- */ /* Purpose: Accept result from earlier nlm_unlock_msg() call @@ -490,6 +663,12 @@ void *nlm_unlock_res_1_svc(nlm_res *arg, return (NULL); } +void *nlmproc4_unlock_res_4_svc(nlm4_res *arg, struct svc_req *rqstp) +{ + if (debug_level) log_from_addr("nlm_unlock_res", rqstp); + return (NULL); +} + /* nlm_granted_res --------------------------------------------------------- */ /* Purpose: Accept result from earlier nlm_granted_msg() call @@ -502,6 +681,12 @@ void *nlm_granted_res_1_svc(nlm_res *arg return (NULL); } +void *nlmproc4_granted_res_4_svc(nlm4_res *arg, struct svc_req *rqstp) +{ + if (debug_level) log_from_addr("nlm_granted_res", rqstp); + return (NULL); +} + /* ------------------------------------------------------------------------- */ /* Calls for PCNFS locking (aka non-monitored locking, no involvement @@ -530,6 +715,17 @@ nlm_shareres *nlm_share_3_svc(nlm_sharea return (&res); } +nlm4_shareres *nlmproc4_share_4_svc(nlm4_shareargs *arg, struct svc_req *rqstp) +{ + static nlm4_shareres res; + if (debug_level) log_from_addr("nlm_share", rqstp); + + res.cookie = arg->cookie; + res.stat = nlm4_granted; + res.sequence = 1234356; /* X/Open says this field is ignored? */ + return (&res); +} + /* nlm_unshare ------------------------------------------------------------ */ /* Purpose: Release a DOS-style lock @@ -548,6 +744,17 @@ nlm_shareres *nlm_unshare_3_svc(nlm_shar return (&res); } +nlm4_shareres *nlmproc4_unshare_4_svc(nlm4_shareargs *arg, struct svc_req *rqstp) +{ + static nlm4_shareres res; + if (debug_level) log_from_addr("nlm_unshare", rqstp); + + res.cookie = arg->cookie; + res.stat = nlm4_granted; + res.sequence = 1234356; /* X/Open says this field is ignored? */ + return (&res); +} + /* nlm_nm_lock ------------------------------------------------------------ */ /* Purpose: non-monitored version of nlm_lock() @@ -570,6 +777,17 @@ nlm_res *nlm_nm_lock_3_svc(nlm_lockargs return (&res); } +nlm4_res *nlmproc4_nm_lock_4_svc(nlm4_lockargs *arg, struct svc_req *rqstp) +{ + static nlm4_res res; + if (debug_level) log_from_addr("nlm_nm_lock", rqstp); + + /* copy cookie from arg to result. See comment in nlm_test_1() */ + res.cookie = arg->cookie; + res.stat.stat = nlm4_granted; + return (&res); +} + /* nlm_free_all ------------------------------------------------------------ */ /* Purpose: Release all locks held by a named client @@ -582,6 +800,22 @@ nlm_res *nlm_nm_lock_3_svc(nlm_lockargs */ void *nlm_free_all_3_svc(nlm_notify *arg, struct svc_req *rqstp) +{ + static char dummy; + + if (debug_level) log_from_addr("nlm_free_all", rqstp); + return (&dummy); +} + +void *nlmproc4_free_all_4_svc(nlm4_notify *arg, struct svc_req *rqstp) +{ + static char dummy; + + if (debug_level) log_from_addr("nlm_free_all", rqstp); + return (&dummy); +} + +void *nlmproc4_null_4_svc(void *arg, struct svc_req *rqstp) { static char dummy; Index: usr.sbin/rpc.lockd/test.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/rpc.lockd/test.c,v retrieving revision 1.4 diff -b -u -p -r1.4 test.c --- usr.sbin/rpc.lockd/test.c 1999/08/28 01:19:36 1.4 +++ usr.sbin/rpc.lockd/test.c 2000/02/05 22:51:27 @@ -310,6 +310,13 @@ int main(int argc, char **argv) nlm_lockargs arg; struct timeval tim; + if (argc != 2) + { + printf("usage: %s <lockd hostname>\n", argv[0]); + exit(1); + } + + printf("Creating client for host %s\n", argv[1]); cli = clnt_create(argv[1], NLM_PROG, NLM_VERS, "udp"); if (!cli) --9amGYk9869ThD9tj-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001013182136.A25191>