libexport.a: Remove dead code
[nfs-utils.git] / support / include / exportfs.h
1 /*
2  * support/include/exportfs.h
3  *
4  * Declarations for exportfs and mountd
5  *
6  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
7  */
8
9 #ifndef EXPORTFS_H
10 #define EXPORTFS_H
11
12 #include <netdb.h>
13 #include "nfslib.h"
14
15 enum {
16         MCL_FQDN = 0,
17         MCL_SUBNETWORK,
18         MCL_IPADDR = MCL_SUBNETWORK,
19         MCL_WILDCARD,
20         MCL_NETGROUP,
21         MCL_ANONYMOUS,
22         MCL_GSS,
23         MCL_MAXTYPES
24 };
25
26 enum {
27         FSLOC_NONE = 0,
28         FSLOC_REFER,
29         FSLOC_REPLICA,
30         FSLOC_STUB
31 };
32
33 typedef struct mclient {
34         struct mclient *        m_next;
35         char *                  m_hostname;
36         int                     m_type;
37         int                     m_naddr;
38         struct in_addr          m_addrlist[NFSCLNT_ADDRMAX];
39         int                     m_exported;     /* exported to nfsd */
40         int                     m_count;
41 } nfs_client;
42
43 typedef struct mexport {
44         struct mexport *        m_next;
45         struct mclient *        m_client;
46         struct exportent        m_export;
47         int                     m_exported;     /* known to knfsd. -1 means not sure */
48         int                     m_xtabent  : 1, /* xtab entry exists */
49                                 m_mayexport: 1, /* derived from xtabbed */
50                                 m_changed  : 1, /* options (may) have changed */
51                                 m_warned   : 1; /* warned about multiple exports
52                                                  * matching one client */
53 } nfs_export;
54
55 #define HASH_TABLE_SIZE 1021
56
57 typedef struct _exp_hash_entry {
58         nfs_export * p_first;
59         nfs_export * p_last;
60 } exp_hash_entry;
61
62 typedef struct _exp_hash_table {
63         nfs_export * p_head;
64         exp_hash_entry entries[HASH_TABLE_SIZE];
65 } exp_hash_table;
66
67 extern exp_hash_table exportlist[MCL_MAXTYPES];
68
69 extern nfs_client *             clientlist[MCL_MAXTYPES];
70
71 nfs_client *                    client_lookup(char *hname, int canonical);
72 void                            client_add(nfs_client *);
73 nfs_client *                    client_dup(nfs_client *, struct hostent *);
74 int                             client_gettype(char *hname);
75 int                             client_check(nfs_client *, struct hostent *);
76 void                            client_release(nfs_client *);
77 void                            client_freeall(void);
78 char *                          client_compose(struct hostent *he);
79 struct hostent *                client_resolve(struct in_addr addr);
80 int                             client_member(char *client, char *name);
81
82 int                             export_read(char *fname);
83 void                    export_add(nfs_export *);
84 void                            export_reset(nfs_export *);
85 nfs_export *                    export_lookup(char *hname, char *path, int caconical);
86 nfs_export *                    export_find(struct hostent *, char *path);
87 nfs_export *                    export_allowed(struct hostent *, char *path);
88 nfs_export *                    export_create(struct exportent *, int canonical);
89 nfs_export *                    export_dup(nfs_export *, struct hostent *);
90 void                            export_freeall(void);
91 int                             export_export(nfs_export *);
92 int                             export_unexport(nfs_export *);
93
94 int                             xtab_mount_read(void);
95 int                             xtab_export_read(void);
96 int                             xtab_mount_write(void);
97 int                             xtab_export_write(void);
98 void                            xtab_append(nfs_export *);
99
100 int                             secinfo_addflavor(struct flav_info *, struct exportent *);
101
102 int                             rmtab_read(void);
103
104 struct nfskey *                 key_lookup(char *hname);
105
106 struct export_features {
107         unsigned int flags;
108         unsigned int secinfo_flags;
109 };
110
111 struct export_features *get_export_features(void);
112
113 /* Record export error.  */
114 extern int export_errno;
115
116 #endif /* EXPORTFS_H */