sys/nfs/krpc.h
author jonathan <jonathan@NetBSD.org>
Sat, 22 May 2004 22:52:13 +0000
branchtrunk
changeset 127396 e7661f3e490a
parent 112348 329a90a20769
child 141710 be5be780006a
child 288704 26eb3cabc67c
permissions -rw-r--r--
Eliminate several uses of `curproc' from the socket-layer code and from NFS. Add a new explicit `struct proc *p' argument to socreate(), sosend(). Use that argument instead of curproc. Follow-on changes to pass that argument to socreate(), sosend(), and (*so->so_send)() calls. These changes reviewed and independently recoded by Matt Thomas. Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas: pass soreceive()'s struct uio* uio->uio_procp to unp_externalize(). Eliminate curproc from unp_externalize. Also, now soreceive() uses its uio->uio_procp value, pass that same value downward to ((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0. Similar changes in sys/nfs to eliminate (most) uses of curproc, either via the req-> r_procp field of a struct nfsreq *req argument, or by passing down new explicit struct proc * arguments. Reviewed by: Matt Thomas, posted to tech-kern. NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.

/*	$NetBSD: krpc.h,v 1.7 2004/05/22 22:52:15 jonathan Exp $	*/

#include <sys/cdefs.h>

#ifdef _KERNEL
int krpc_call __P((struct sockaddr_in *sin,
	u_int prog, u_int vers, u_int func,
	struct mbuf **data, struct mbuf **from, struct proc *p));

int krpc_portmap __P((struct sockaddr_in *sin,
	u_int prog, u_int vers, u_int proto, u_int16_t *portp,
	struct proc *p));

struct mbuf *xdr_string_encode __P((char *str, int len));
struct mbuf *xdr_string_decode __P((struct mbuf *m, char *str, int *len_p));
struct mbuf *xdr_inaddr_encode __P((struct in_addr *ia));
struct mbuf *xdr_inaddr_decode __P((struct mbuf *m, struct in_addr *ia));
#endif /* _KERNEL */


/*
 * RPC definitions for the portmapper
 */
#define	PMAPPORT		111
#define	PMAPPROG		100000
#define	PMAPVERS		2
#define	PMAPPROC_NULL		0
#define	PMAPPROC_SET		1
#define	PMAPPROC_UNSET		2
#define	PMAPPROC_GETPORT	3
#define	PMAPPROC_DUMP		4
#define	PMAPPROC_CALLIT		5


/*
 * RPC definitions for bootparamd
 */
#define	BOOTPARAM_PROG		100026
#define	BOOTPARAM_VERS		1
#define BOOTPARAM_WHOAMI	1
#define BOOTPARAM_GETFILE	2