nfs-ganesha 1.4

nfs_tools.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright CEA/DAM/DIF  (2008)
00005  * contributeur : Philippe DENIEL   philippe.deniel@cea.fr
00006  *                Thomas LEIBOVICI  thomas.leibovici@cea.fr
00007  *
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 3 of the License, or (at your option) any later version.
00013  * 
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with this library; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  * 
00023  * ---------------------------------------
00024  */
00025 
00038 #ifndef _NFS_TOOLS_H
00039 #define _NFS_TOOLS_H
00040 
00041 #include "fsal.h"
00042 #include "nfs23.h"
00043 #include "nfs4.h"
00044 #include "mount.h"
00045 #include "nfs_exports.h"
00046 #include "config_parsing.h"
00047 
00048 #define  ATTRVALS_BUFFLEN  1024
00049 
00050 int nfs_ParseConfLine(char *Argv[],
00051                       int nbArgv,
00052                       char *line,
00053                       int (*separator_function) (char), int (*endLine_func) (char));
00054 
00055 int ReadExports(config_file_t in_config, exportlist_t ** pEx);
00056 
00057 exportlist_t *BuildDefaultExport();
00058 
00059 /* Mount list management */
00060 int nfs_Add_MountList_Entry(char *hostname, char *path);
00061 int nfs_Remove_MountList_Entry(char *hostname, char *path);
00062 int nfs_Init_MountList(void);
00063 int nfs_Purge_MountList(void);
00064 mountlist nfs_Get_MountList(void);
00065 void nfs_Print_MountList(void);
00066 
00067 char *nfsstat2_to_str(nfsstat2 code);
00068 char *nfsstat3_to_str(nfsstat3 code);
00069 char *nfsstat4_to_str(nfsstat4 code);
00070 char *nfstype2_to_str(ftype2 code);
00071 char *nfstype3_to_str(ftype3 code);
00072 
00073 void nfs4_sprint_fhandle(nfs_fh4 * fh4p, char *outstr) ;
00074 
00075 /* Hash and LRU functions */
00076 unsigned long decimal_simple_hash_func(hash_parameter_t * p_hparam,
00077                                        hash_buffer_t * buffclef);
00078 unsigned long decimal_rbt_hash_func(hash_parameter_t * p_hparam,
00079                                     hash_buffer_t * buffclef);
00080 
00081 int display_cache(hash_buffer_t * pbuff, char *str);
00082 int compare_cache(hash_buffer_t * buff1, hash_buffer_t * buff2);
00083 int print_cache(LRU_data_t data, char *str);
00084 int clean_cache(LRU_entry_t * pentry, void *addparam);
00085 
00086 int lru_data_entry_to_str(LRU_data_t data, char *str);
00087 int lru_inode_clean_entry(LRU_entry_t * entry, void *adddata);
00088 int lru_data_clean_entry(LRU_entry_t * entry, void *adddata);
00089 int lru_inode_entry_to_str(LRU_data_t data, char *str);
00090 
00091 #endif                          /* _NFS_TOOLS_H */