~ubuntu-branches/ubuntu/precise/autofs5/precise

« back to all changes in this revision

Viewing changes to .pc/autofs-5.0.5-use-weight-only-for-server-selection.patch/include/replicated.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-03 14:35:46 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110703143546-nej26krjij0rf792
Tags: 5.0.6-0ubuntu1
* New upstream release:
  - Dropped upstream patches 
  - Refreshed debian/patches/17ld.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ----------------------------------------------------------------------- *
2
 
 *
3
 
 *  repl_list.h - header file for replicated mount server selection
4
 
 *
5
 
 *   Copyright 2004 Jeff Moyer <jmoyer@redaht.com> - All Rights Reserved
6
 
 *   Copyright 2004-2006 Ian Kent <raven@themaw.net> - All Rights Reserved
7
 
 *
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.
13
 
 *
14
 
 * ----------------------------------------------------------------------- */
15
 
 
16
 
#ifndef _REPLICATED_H
17
 
#define _REPLICATED_H
18
 
 
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
25
 
 
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)
31
 
 
32
 
#define NFS2_REQUESTED          NFS2_SUPPORTED
33
 
#define NFS3_REQUESTED          NFS3_SUPPORTED
34
 
#define NFS4_REQUESTED          NFS4_SUPPORTED
35
 
 
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)
41
 
 
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
50
 
 
51
 
#define RPC_TIMEOUT             5
52
 
 
53
 
struct host {
54
 
        char *name;
55
 
        struct sockaddr *addr;
56
 
        size_t addr_len;
57
 
        char *path;
58
 
        unsigned int version;
59
 
        unsigned int proximity;
60
 
        unsigned int weight;
61
 
        unsigned long cost;
62
 
        struct host *next;
63
 
};
64
 
 
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 *);
70
 
 
71
 
#endif
72