X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Finclude%2Fexportfs.h;h=9a19cbb68b7c13afeacfdd64b642d4506d8a5ccb;hp=d440dc1ff4462a44b7c191f1cb701e3e18f6367b;hb=5f722d8855ebcb2d041e182c8c69c8cbee4bf408;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 diff --git a/support/include/exportfs.h b/support/include/exportfs.h index d440dc1..9a19cbb 100644 --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -19,12 +19,20 @@ enum { MCL_WILDCARD, MCL_NETGROUP, MCL_ANONYMOUS, + MCL_GSS, MCL_MAXTYPES }; +enum { + FSLOC_NONE = 0, + FSLOC_REFER, + FSLOC_REPLICA, + FSLOC_STUB +}; + typedef struct mclient { struct mclient * m_next; - char m_hostname[NFSCLNT_IDMAX+1]; + char * m_hostname; int m_type; int m_naddr; struct in_addr m_addrlist[NFSCLNT_ADDRMAX]; @@ -36,32 +44,49 @@ typedef struct mexport { struct mexport * m_next; struct mclient * m_client; struct exportent m_export; - int m_exported : 1, /* known to knfsd */ - m_xtabent : 1, /* xtab entry exists */ + int m_exported; /* known to knfsd. -1 means not sure */ + int m_xtabent : 1, /* xtab entry exists */ m_mayexport: 1, /* derived from xtabbed */ - m_changed : 1; /* options (may) have changed */ + m_changed : 1, /* options (may) have changed */ + m_warned : 1; /* warned about multiple exports + * matching one client */ } nfs_export; +#define HASH_TABLE_SIZE 1021 + +typedef struct _exp_hash_entry { + nfs_export * p_first; + nfs_export * p_last; +} exp_hash_entry; + +typedef struct _exp_hash_table { + nfs_export * p_head; + exp_hash_entry entries[HASH_TABLE_SIZE]; +} exp_hash_table; + +extern exp_hash_table exportlist[MCL_MAXTYPES]; + extern nfs_client * clientlist[MCL_MAXTYPES]; -extern nfs_export * exportlist[MCL_MAXTYPES]; -nfs_client * client_lookup(char *hname); -nfs_client * client_find(struct hostent *); +nfs_client * client_lookup(char *hname, int canonical); void client_add(nfs_client *); nfs_client * client_dup(nfs_client *, struct hostent *); int client_gettype(char *hname); int client_check(nfs_client *, struct hostent *); -int client_match(nfs_client *, char *hname); void client_release(nfs_client *); void client_freeall(void); +char * client_compose(struct hostent *he); +struct hostent * client_resolve(struct in_addr addr); +int client_member(const char *client, + const char *name); int export_read(char *fname); -void export_add(nfs_export *); +void export_add(nfs_export *); void export_reset(nfs_export *); -nfs_export * export_lookup(char *hname, char *path); +nfs_export * export_lookup(char *hname, char *path, int caconical); nfs_export * export_find(struct hostent *, char *path); -struct exportent * export_allowed(struct hostent *, char *path); -nfs_export * export_create(struct exportent *); +nfs_export * export_allowed(struct hostent *, char *path); +nfs_export * export_create(struct exportent *, int canonical); nfs_export * export_dup(nfs_export *, struct hostent *); void export_freeall(void); int export_export(nfs_export *); @@ -73,8 +98,20 @@ int xtab_mount_write(void); int xtab_export_write(void); void xtab_append(nfs_export *); +int secinfo_addflavor(struct flav_info *, struct exportent *); + int rmtab_read(void); struct nfskey * key_lookup(char *hname); +struct export_features { + unsigned int flags; + unsigned int secinfo_flags; +}; + +struct export_features *get_export_features(void); + +/* Record export error. */ +extern int export_errno; + #endif /* EXPORTFS_H */