1
/* ----------------------------------------------------------------------- *
3
* repl_list.h - header file for replicated mount server selection
5
* Copyright 2004 Jeff Moyer <jmoyer@redaht.com> - All Rights Reserved
6
* Copyright 2004-2006 Ian Kent <raven@themaw.net> - All Rights Reserved
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
11
* USA; either version 2 of the License, or (at your option) any later
12
* version; incorporated herein by reference.
14
* ----------------------------------------------------------------------- */
19
#define PROXIMITY_ERROR 0x0000
20
#define PROXIMITY_LOCAL 0x0001
21
#define PROXIMITY_SUBNET 0x0002
22
#define PROXIMITY_NET 0x0004
23
#define PROXIMITY_OTHER 0x0008
24
#define PROXIMITY_UNSUPPORTED 0x0010
26
#define NFS2_SUPPORTED 0x0010
27
#define NFS3_SUPPORTED 0x0020
28
#define NFS4_SUPPORTED 0x0040
29
#define NFS_VERS_MASK (NFS2_SUPPORTED|NFS3_SUPPORTED)
30
#define NFS4_VERS_MASK (NFS4_SUPPORTED)
32
#define NFS2_REQUESTED NFS2_SUPPORTED
33
#define NFS3_REQUESTED NFS3_SUPPORTED
34
#define NFS4_REQUESTED NFS4_SUPPORTED
36
#define TCP_SUPPORTED 0x0001
37
#define UDP_SUPPORTED 0x0002
38
#define TCP_REQUESTED TCP_SUPPORTED
39
#define UDP_REQUESTED UDP_SUPPORTED
40
#define NFS_PROTO_MASK (TCP_SUPPORTED|UDP_SUPPORTED)
42
#define NFS2_TCP_SUPPORTED NFS2_SUPPORTED
43
#define NFS3_TCP_SUPPORTED NFS3_SUPPORTED
44
#define NFS4_TCP_SUPPORTED NFS4_SUPPORTED
45
#define NFS2_UDP_SUPPORTED (NFS2_SUPPORTED << 8)
46
#define NFS3_UDP_SUPPORTED (NFS3_SUPPORTED << 8)
47
#define NFS4_UDP_SUPPORTED (NFS4_SUPPORTED << 8)
48
#define TCP_SELECTED_MASK 0x00FF
49
#define UDP_SELECTED_MASK 0xFF00
55
struct sockaddr *addr;
59
unsigned int proximity;
65
void seed_random(void);
66
void free_host_list(struct host **);
67
int parse_location(unsigned, struct host **, const char *, unsigned int);
68
int prune_host_list(unsigned, struct host **, unsigned int, const char *, unsigned int);
69
void dump_host_list(struct host *);