nfs-ganesha 1.4

nfs_creds.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_CREDS_H
00039 #define _NFS_CREDS_H
00040 
00041 #include <pthread.h>
00042 #include <sys/types.h>
00043 #include <sys/param.h>
00044 
00045 #include "ganesha_rpc.h"
00046 #include "LRU_List.h"
00047 #include "fsal.h"
00048 #include "cache_inode.h"
00049 
00050 #include "nfs23.h"
00051 #include "nfs4.h"
00052 #include "mount.h"
00053 
00054 #include "err_LRU_List.h"
00055 #include "err_HashTable.h"
00056 
00057 typedef enum CredType__
00058 { CRED_NONE = 1, CRED_UNIX = 2, CRED_GSS = 3 } CredType_t;
00059 
00060 typedef struct CredUnix__
00061 {
00062   u_int uid;
00063   u_int gid;
00064   /* May be we could had list of groups management */
00065 } CredUnix_t;
00066 
00067 typedef struct CredGss__
00068 {
00069 #if(  defined( HAVE_KRB5 ) && defined ( _HAVE_GSSAPI ) )
00070   gss_qop_t qop;
00071   gss_OID mech;
00072   rpc_gss_svc_t svc;
00073   gss_ctx_id_t context;
00074 #else
00075   int dummy;
00076 #endif
00077 } CredGss_t;
00078 
00079 typedef union CredData__
00080 {
00081 #ifdef HAVE_KRB5
00082   CredUnix_t unix_cred;
00083   CredGss_t gss_cred;
00084 #else
00085   int dummy;
00086 #endif
00087 } CredData_t;
00088 
00089 typedef struct RPCSEC_GSS_cred__
00090 {
00091   CredType_t type;
00092   CredData_t data;
00093 } RPCSEC_GSS_cred_t;
00094 
00095 #endif                          /* _NFS_CREDS_H */