File: conn.h

package info (click to toggle)
nfs-utils 1%3A1.0.10-6
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 4,228 kB
  • ctags: 2,554
  • sloc: ansic: 24,689; sh: 9,398; makefile: 667
file content (43 lines) | stat: -rw-r--r-- 1,013 bytes parent folder | download | duplicates (2)
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
/* 
 * conn.h -- Connection routines for NFS mount / umount code.
 *
 * 2006-06-06 Amit Gud <agud@redhat.com>
 * - Moved code snippets here from util-linux/mount
 */

#ifndef _CONN_H
#define _CONN_H

#ifdef HAVE_RPCSVC_NFS_PROT_H
#include <rpcsvc/nfs_prot.h>
#else
#include <linux/nfs.h>
#define nfsstat nfs_stat
#endif

#include <rpc/pmap_prot.h>
#include <rpc/clnt.h>

#define MNT_SENDBUFSIZE ((u_int)2048)
#define MNT_RECVBUFSIZE ((u_int)1024)

typedef struct {
	char **hostname;
	struct sockaddr_in saddr;
	struct pmap pmap;
} clnt_addr_t;

/* RPC call timeout values */
static const struct timeval TIMEOUT = { 20, 0 };
static const struct timeval RETRY_TIMEOUT = { 3, 0 };

int clnt_ping(struct sockaddr_in *, const u_long, const u_long, const u_int,
	      struct sockaddr_in *);
u_long nfsvers_to_mnt(const u_long);
u_long mntvers_to_nfs(const u_long);
int get_socket(struct sockaddr_in *, u_int, int);
CLIENT * mnt_openclnt(clnt_addr_t *, int *);
void mnt_closeclnt(CLIENT *, int);

#endif /* _CONN_H */