00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00041
00042
00043
00044
00045
00046 #include "lcmaps_config.h"
00047 #include <stdio.h>
00048 #include <stdlib.h>
00049 #include <string.h>
00050 #include "lcmaps_modules.h"
00051 #include "lcmaps_arguments.h"
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00087 int plugin_introspect(
00088 int * argc,
00089 lcmaps_argument_t ** argv
00090 )
00091 {
00092 static lcmaps_argument_t argList[] = {
00093 { "job_request" , "lcmaps_request_t" , 1, NULL},
00094 { "user_cred" , "gss_cred_id_t" , 0, NULL},
00095 { "user_dn" , "char *" , 0, NULL},
00096 { "job_request" , "char *" , 0, NULL},
00097 { NULL , NULL , -1, NULL}
00098 };
00099
00100 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_introspect(): introspecting\n");
00101
00102 *argv = argList;
00103 *argc = lcmaps_cntArgs(argList);
00104 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_introspect(): address first argument: 0x%x\n",argList);
00105
00106 return LCMAPS_MOD_SUCCESS;
00107 }
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00139 int plugin_initialize(
00140 int argc,
00141 char ** argv
00142 )
00143 {
00144 int i;
00145
00146 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_initialize(): passed arguments:\n");
00147 for (i=0; i < argc; i++)
00148 {
00149 lcmaps_log_debug(2,"\tlcmaps_plugin_example-plugin_initialize(): arg %d is %s\n",
00150 i,argv[i]);
00151 }
00152
00153 return LCMAPS_MOD_SUCCESS;
00154 }
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00182 int plugin_run(
00183 int argc,
00184 lcmaps_argument_t * argv
00185 )
00186 {
00187 lcmaps_request_t * prequest=NULL;
00188 gss_cred_id_t * pcred;
00189 gss_cred_id_t cred;
00190
00191 char ** pstring;
00192
00193 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run():\n");
00194
00195
00196
00197
00198 if ( ( pstring = (char **) lcmaps_getArgValue("job_request", "char *", argc, argv) ) )
00199 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): job_request: %s\n",*pstring);
00200 else
00201 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): could not get value of job_request !\n");
00202
00203 if ( ( pstring = (char **) lcmaps_getArgValue("user_dn", "char *", argc, argv) ) )
00204 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): user_dn: %s\n",*pstring);
00205 else
00206 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): could not get value of user_dn !\n");
00207
00208 if ( ( prequest = (lcmaps_request_t *) lcmaps_getArgValue("job_request", "lcmaps_request_t", argc, argv) ) )
00209 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): job_request: %s\n",*prequest);
00210 else
00211 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): could not get value of job_request !\n");
00212
00213 if ( ( pcred = (gss_cred_id_t *) lcmaps_getArgValue("user_cred", "gss_cred_id_t", argc, argv) ) )
00214 {
00215 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): address user_cred: %p\n",pcred);
00216 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): value user_cred: %p\n",*pcred);
00217 cred=*pcred;
00218 if (cred) {
00219 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): inside value user_cred: %p\n",*(int *)(cred));
00220 }
00221 }
00222 else
00223 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): could not get address of user_cred !\n");
00224
00225 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_run(): address first argument: 0x%x\n",argv);
00226
00227
00228 return LCMAPS_MOD_SUCCESS;
00229
00230 fail_example:
00231 return LCMAPS_MOD_FAIL;
00232 }
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00250 int plugin_terminate()
00251 {
00252 lcmaps_log_debug(1,"\tlcmaps_plugin_example-plugin_terminate(): terminating\n");
00253
00254 return LCMAPS_MOD_SUCCESS;
00255 }
00256
00257
00258
00259
00260
00261
00262
00263
00264