File: rpc.h

package info (click to toggle)
oskit 0.97.20000202-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 58,008 kB
  • ctags: 172,612
  • sloc: ansic: 832,827; asm: 7,640; sh: 3,920; yacc: 3,664; perl: 1,457; lex: 427; makefile: 337; csh: 141; awk: 78
file content (77 lines) | stat: -rw-r--r-- 1,546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* Modified from FreeBSD 2.1 sys/i386/boot/netboot */
/***********************************************************************

Remote Procedure Call Support Routines

Author: Martin Renters
  Date: Oct/1994

***********************************************************************/

#ifndef __RPC_H_INCLUDED__
#define __RPC_H_INCLUDED__

#include "ip.h"
#include "udp.h"

struct rpc_t {
	struct iphdr	ip;
	struct udphdr	udp;
	union {
		char data[1400];
		struct {
			long id;
			long type;
			long rstatus;
			long verifier;
			long v2;
			long astatus;
			long data[1];
		} reply;
	} u;
};

struct rpc_buf {
	int valid;
	int sent;		   /* Is the request on the wire? */
	unsigned long offset;
	unsigned long len;
	unsigned long id;
	char buffer[1400];
};

#define SUNRPC		111

#define RPC_SOCKET	620			/* Arbitrary */

#define PROG_PORTMAP	100000
#define PROG_NFS	100003
#define PROG_MOUNT	100005

#define MSG_CALL	0
#define MSG_REPLY	1

#define PORTMAP_LOOKUP	3

#define MOUNT_ADDENTRY	1
#define NFS_LOOKUP	4
#define NFS_READ	6

#define NFS_FHSIZE	32

#define NFSERR_PERM	1
#define NFSERR_NOENT	2
#define NFSERR_ACCES	13

extern int rpc_id;

void rpc_init(void);
int rpc_lookup(int addr, int prog, int ver);
int nfs_mount(int server, int port, char *path, char *fh);
int nfs_lookup(int server, int port, char *fh, char *path, char *file_fh);
int nfs_read(int server, int port, char *fh, int offset, int len,
	     char *buffer, int readahead);
char *rpc_strerror(struct rpc_t *rpc);
char *nfs_strerror(int err);

#endif /* __RPC_H_INCLUDED__ */