00001 /* 00002 * Copyright (c) 2001 EU DataGrid. 00003 * For license conditions see http://www.eu-datagrid.org/license.html 00004 * 00005 * Copyright (c) 2001, 2002 by 00006 * Martijn Steenbakkers <martijn@nikhef.nl>, 00007 * David Groep <davidg@nikhef.nl>, 00008 * NIKHEF Amsterdam, the Netherlands 00009 */ 00010 00023 #ifndef _LCAS_UTILS_H 00024 #define _LCAS_UTILS_H 00025 00026 /****************************************************************************** 00027 Include header files 00028 ******************************************************************************/ 00029 #include <gssapi.h> 00030 #include "lcas_types.h" 00031 #include "lcas_utils.h" 00032 00033 /****************************************************************************** 00034 * Module definition 00035 *****************************************************************************/ 00036 00038 /* Beginning of credential functions */ 00039 /****************************************************************************** 00040 Function: lcas_fill_cred() 00041 Description: Fill cedential from dn and globus credential 00042 Parameters: 00043 dn: distinguished name 00044 cred: globus credential 00045 lcas_cred: pointer to lcas_credential 00046 Returns: 0: succes 00047 1: failure 00048 ******************************************************************************/ 00068 extern int lcas_fill_cred( 00069 char * dn, 00070 gss_cred_id_t cred, 00071 lcas_cred_id_t * lcas_credential 00072 ); 00073 /****************************************************************************** 00074 Function: lcas_release_cred() 00075 Description: release lcas credential 00076 Parameters: 00077 plcas_cred: pointer to lcas_credential 00078 Returns: 0: succes 00079 1: failure 00080 ******************************************************************************/ 00091 extern int lcas_release_cred( 00092 lcas_cred_id_t * lcas_credential 00093 ); /* End of credential functions */ 00095 00096 /****************************************************************************** 00097 OTHER STUFF 00098 ******************************************************************************/ 00100 /* Beginning of other functions */ 00101 /****************************************************************************** 00102 Function: lcas_tokenize() (in modified form from globus_gatekeeper_utils.c) 00103 00104 Description: 00105 Breakup the command in to args, pointing the args array 00106 at the tokens. Replace white space at the end of each 00107 token with a null. A token maybe in quotes. 00108 00109 Parameters: 00110 command: The command line to be parsed. 00111 args: A pointer to an array of pointers to be filled it 00112 n: Size of the array, on input, and set to size used on output. 00113 sep: string of separating characters 00114 00115 Returns: 00116 0 on success. 00117 -1 on to malloc 00118 -2 on to many args 00119 -3 on quote not matched 00120 ******************************************************************************/ 00143 extern int lcas_tokenize( 00144 const char * command, 00145 char ** args, 00146 int * n, 00147 char * sep 00148 ); /* End of other functions */ 00150 00151 #endif /* _LCAS_UTILS_H */ 00152 00153 /****************************************************************************** 00154 CVS Information: 00155 $Source: /cvs/fabric_mgt/gridification/lcas/src/_lcas_utils.h,v $ 00156 $Date: 2003/02/06 13:39:48 $ 00157 $Revision: 2.3 $ 00158 $Author: martijn $ 00159 ******************************************************************************/