blob: 712afa089aa98428a7c2f13c5e4788aaf4831271 [file] [log] [blame]
wdenkcbd8a352004-02-24 02:00:03 +00001/*
2 * (C) Masami Komiya <mkomiya@sonare.it> 2004
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2, or (at
7 * your option) any later version.
8 */
9
10#ifndef __NFS_H__
11#define __NFS_H__
12
13#define SUNRPC_PORT 111
14
15#define PROG_PORTMAP 100000
16#define PROG_NFS 100003
17#define PROG_MOUNT 100005
18
19#define MSG_CALL 0
20#define MSG_REPLY 1
21
22#define PORTMAP_GETPORT 3
23
24#define MOUNT_ADDENTRY 1
25#define MOUNT_UMOUNTALL 4
26
27#define NFS_LOOKUP 4
28#define NFS_READLINK 5
29#define NFS_READ 6
30
31#define NFS_FHSIZE 32
32
33#define NFSERR_PERM 1
34#define NFSERR_NOENT 2
35#define NFSERR_ACCES 13
36#define NFSERR_ISDIR 21
37#define NFSERR_INVAL 22
38
39/* Block size used for NFS read accesses. A RPC reply packet (including all
40 * headers) must fit within a single Ethernet frame to avoid fragmentation.
41 * Chosen to be a power of two, as most NFS servers are optimized for this. */
42#define NFS_READ_SIZE 1024
43
44#define NFS_MAXLINKDEPTH 16
45
46struct rpc_t {
47 union {
48 uint8_t data[2048];
49 struct {
50 uint32_t id;
51 uint32_t type;
52 uint32_t rpcvers;
53 uint32_t prog;
54 uint32_t vers;
55 uint32_t proc;
56 uint32_t data[1];
57 } call;
58 struct {
59 uint32_t id;
60 uint32_t type;
61 uint32_t rstatus;
62 uint32_t verifier;
63 uint32_t v2;
64 uint32_t astatus;
wdenk11dadd52004-02-27 00:07:27 +000065 uint32_t data[19];
wdenkcbd8a352004-02-24 02:00:03 +000066 } reply;
67 } u;
68};
69extern void NfsStart (void); /* Begin NFS */
70
71
72/**********************************************************************/
73
74#endif /* __NFS_H__ */