xref: /illumos-gate/usr/src/grub/grub-0.97/netboot/nfs.h (revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809)
1 #ifndef	_NFS_H
2 #define	_NFS_H
3 
4 #define SUNRPC_PORT	111
5 
6 #define PROG_PORTMAP	100000
7 #define PROG_NFS	100003
8 #define PROG_MOUNT	100005
9 
10 #define MSG_CALL	0
11 #define MSG_REPLY	1
12 
13 #define PORTMAP_GETPORT	3
14 
15 #define MOUNT_ADDENTRY	1
16 #define MOUNT_UMOUNTALL	4
17 
18 #define NFS_LOOKUP	4
19 #define	NFS_READLINK	5
20 #define NFS_READ	6
21 
22 #define NFS_FHSIZE	32
23 
24 #define NFSERR_PERM	1
25 #define NFSERR_NOENT	2
26 #define NFSERR_ACCES	13
27 #define	NFSERR_ISDIR	21
28 #define	NFSERR_INVAL	22
29 
30 /* Block size used for NFS read accesses.  A RPC reply packet (including  all
31  * headers) must fit within a single Ethernet frame to avoid fragmentation.
32  * Chosen to be a power of two, as most NFS servers are optimized for this.  */
33 #define NFS_READ_SIZE	1024
34 
35 #define NFS_MAXLINKDEPTH 16
36 
37 struct rpc_t {
38 	struct iphdr ip;
39 	struct udphdr udp;
40 	union {
41 		uint8_t  data[300];		/* longest RPC call must fit!!!! */
42 		struct {
43 			uint32_t id;
44 			uint32_t type;
45 			uint32_t rpcvers;
46 			uint32_t prog;
47 			uint32_t vers;
48 			uint32_t proc;
49 			uint32_t data[1];
50 		} call;
51 		struct {
52 			uint32_t id;
53 			uint32_t type;
54 			uint32_t rstatus;
55 			uint32_t verifier;
56 			uint32_t v2;
57 			uint32_t astatus;
58 			uint32_t data[1];
59 		} reply;
60 	} u;
61 };
62 
63 #endif	/* _NFS_H */
64