X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Finclude%2Fexportfs.h;h=a5cf482584af668e5f8a847909ec7e827a747705;hp=458611b8f5ac3d3b0056c056b08079bd0040b965;hb=4cacc965afc4fb03a465ffcc6cb3078aeadc3818;hpb=5fb04a376e6d5ba940e66507e4a615f4e94116e6 diff --git a/support/include/exportfs.h b/support/include/exportfs.h index 458611b..a5cf482 100644 --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -32,7 +32,7 @@ enum { 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]; @@ -47,11 +47,26 @@ typedef struct mexport { 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, int canonical); nfs_client * client_find(struct hostent *); @@ -62,11 +77,12 @@ 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 in_addr addr); +char * client_compose(struct hostent *he); +struct hostent * client_resolve(struct in_addr addr); int client_member(char *client, 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, int caconical); nfs_export * export_find(struct hostent *, char *path);