Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

lcas_plugin_example.c File Reference

Interface to the LCAS plugins. More...

#include "lcas_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lcas_modules.h"

Include dependency graph for lcas_plugin_example.c:

Include dependency graph

Go to the source code of this file.

Functions

int plugin_initialize (int argc, char **argv)
 initialize the plugin. More...

int plugin_confirm_authorization (lcas_request_t request, lcas_cred_id_t lcas_cred)
 ******************************************************************************. More...

int plugin_terminate ()
 Whatever is needed to terminate the plugin module goes in here. More...


Detailed Description

Interface to the LCAS plugins.

Author:
Martijn Steenbakkers for the EU DataGrid.

This file contains the code for an example LCAS plugin and shows the interface the plugin has to provide to the LCAS. The interface consists of the following functions:
  1. plugin_initialize()
  2. plugin_confirm_authorization()
  3. plugin_terminate()

Definition in file lcas_plugin_example.c.


Function Documentation

int plugin_confirm_authorization ( lcas_request_t request,
lcas_cred_id_t lcas_cred )
 

******************************************************************************.

Ask for authorization by passing the RSL (later JDL) and the user credential. The user credential will contain information on the role the user wants to have. In the RSL (JDL) the user might specify the resources he wants to use. The authorization decision has to be made using this information. The LCAS provides no library for parsing the RSL (JDL).

Parameters:
request   LCAS (RSL) request
lcas_cred   LCAS credential
Return values:
LCAS_MOD_SUCCESS   authorization succeeded
LCAS_MOD_FAIL   authorization failed
LCAS_MOD_NOFILE   private plugin database could not be found (LCAS will deny authorization)

Definition at line 132 of file lcas_plugin_example.c.

int plugin_initialize ( int argc,
char ** argv )
 

initialize the plugin.

Everything that is needed to initialize the plugin should be put inside this function. Arguments as read from the LCAS database (argc, argv) are passed to the plugin.

Parameters:
argc   number of passed arguments.
argv   argument list. argv[0] contains the name of the plugin.
Return values:
LCAS_MOD_SUCCESS   successful initialization
LCAS_MOD_FAIL   failure in the plugin initialization
LCAS_MOD_NOFILE   private plugin database could not be found (same effect as LCAS_MOD_FAIL)

Definition at line 84 of file lcas_plugin_example.c.

int plugin_terminate ( )
 

Whatever is needed to terminate the plugin module goes in here.

Return values:
LCAS_MOD_SUCCESS   success
LCAS_MOD_FAIL   failure (will result in an authorization failure)

Definition at line 186 of file lcas_plugin_example.c.


Generated at Tue Sep 23 15:07:04 2003 for edg-lcas by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001