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

lcmaps_pluginmanager.c File Reference

the plugin manager for LCMAPS. More...

#include "lcmaps_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <dlfcn.h>
#include <gssapi.h>
#include "lcmaps_types.h"
#include "lcmaps_log.h"
#include "lcmaps_arguments.h"
#include "lcmaps_defines.h"
#include "_lcmaps_utils.h"
#include "_lcmaps_db_read.h"
#include "_lcmaps_runvars.h"
#include "_lcmaps_cred_data.h"
#include "../evaluationmanager/evaluationmanager.h"

Include dependency graph for lcmaps_pluginmanager.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  lcmaps_plugindl_s
 the lcmaps plugin module structure. More...


Defines

#define NUL   '\0'
#define MAXPROCS   4

Typedefs

typedef int (* lcmaps_proc_t )()
 this type corresponds to the types of the plugin interface functions. More...

typedef struct lcmaps_plugindl_s  lcmaps_plugindl_t
 the type definition of the lcmaps plugin module structure. More...


Enumerations

enum  lcmaps_proctype_e {
  INITPROC, RUNPROC, TERMPROC, INTROPROC,
  ENDOFPROCS
}
 This enumeration type gives the different plugin symbol/function types. More...


Functions

lcmaps_plugindl_tPluginInit (lcmaps_db_entry_t *, lcmaps_plugindl_t **)
 Initialize the plugin. More...

lcmaps_proc_t get_procsymbol (void *, char *)
 get procedure symbol from dlopen-ed library. More...

int print_lcmaps_plugin (int, lcmaps_plugindl_t *)
 print the lcmaps_plugindl_t structure. More...

int parse_args_plugin (const char *, const char *, char **, int *)
 convert plugin argument string into xargc, xargv. More...

int clean_plugin_list (lcmaps_plugindl_t **)
 clean (free) the list of plugins and call the plugin termination functions. More...


Variables

char* lcmaps_db_file_default = NULL
char* lcmaps_dir = NULL
lcmaps_plugindl_tplugin_list = NULL


Detailed Description

the plugin manager for LCMAPS.

Author:
Martijn Steenbakkers for the EU DataGrid.

The interface to the PluginManager module is composed of:
  1. startPluginManager(): start the PluginManager --> load plugins, start evaluation manager
  2. runPluginManager(): run the PluginManager --> run evaluation manager --> run plugins
  3. stopPluginManager(): stop the PluginManager
  4. reloadPluginManager(): reload the PluginManager ? (will we implement this ?)
  5. runPlugin(): run the specified plugin. (used by Evaluation Manager)
  6. resetCredentialData(): reset the Credential Data. (used by Evaluation Manager)

Definition in file lcmaps_pluginmanager.c.


Define Documentation

#define MAXPROCS   4
 

maximum number of interface symbols in plugin modules

For internal use only.

Definition at line 65 of file lcmaps_pluginmanager.c.

#define NUL   '\0'
 

NUL character

For internal use only.

Definition at line 61 of file lcmaps_pluginmanager.c.


Typedef Documentation

typedef struct lcmaps_plugindl_s lcmaps_plugindl_t
 

the type definition of the lcmaps plugin module structure.

For internal use only.

typedef int(* lcmaps_proc_t)()
 

this type corresponds to the types of the plugin interface functions.

For internal use only.

Definition at line 91 of file lcmaps_pluginmanager.c.


Enumeration Type Documentation

enum lcmaps_proctype_e
 

This enumeration type gives the different plugin symbol/function types.

For internal use only.

Enumeration values:
INITPROC   this value corresponds to the plugin initialization function
RUNPROC   this value corresponds to the plugin run function (get credentials)
TERMPROC   this value corresponds to the plugin termination function
INTROPROC   this value corresponds to the plugin introspect function

Definition at line 77 of file lcmaps_pluginmanager.c.


Function Documentation

lcmaps_plugindl_t * PluginInit ( lcmaps_db_entry_t * db_handle,
lcmaps_plugindl_t ** list ) [static]
 

Initialize the plugin.

This function takes a plugin LCMAPS database entry and performs the following tasks:

  • Create entry in (plugin)list
  • Open the plugins and check the symbols plugin_init and confirm_authorization
  • run plugin_init
Parameters:
db_handle   handle to LCMAPS db (containing pluginname and pluginargs)
list   pointer to plugin structure list to which (plugin) module has to be added

Returns:
pointer to newly created plugin structure or NULL in case of failure

For internal use only.

Definition at line 354 of file lcmaps_pluginmanager.c.

Referenced by startPluginManager().

int clean_plugin_list ( lcmaps_plugindl_t ** list ) [static]
 

clean (free) the list of plugins and call the plugin termination functions.

Parameters:
list  
list   pointer to list of plugins which has to be freeed.
Return values:
0   succes.
1   failure.

For internal use only.

Definition at line 781 of file lcmaps_pluginmanager.c.

Referenced by startPluginManager(), and stopPluginManager().

lcmaps_proc_t get_procsymbol ( void * handle,
char * symname ) [static]
 

get procedure symbol from dlopen-ed library.

Parameters:
handle   handle of dynamic library
symname   name of procedure symbol
Returns:
handle to procedure symbol or NUll

For internal use only.

Definition at line 639 of file lcmaps_pluginmanager.c.

Referenced by PluginInit().

int parse_args_plugin ( const char * name,
const char * argstring,
char ** xargv,
int * xargc ) [static]
 

convert plugin argument string into xargc, xargv.

Parse the argument string of the plugin and create xargv and xargc

Parameters:
name   name of the plugin (goes into xargv[0])
argstring   string containing the arguments
xargv   array of argument strings (has to be freed later)
xargc   number of arguments
Return values:
0   succes.
1   failure.

For internal use only.

Definition at line 578 of file lcmaps_pluginmanager.c.

Referenced by PluginInit().

int print_lcmaps_plugin ( int debug_lvl,
lcmaps_plugindl_t * plugin ) [static]
 

print the lcmaps_plugindl_t structure.

Parameters:
debug_lvl   debugging level
plugin   plugin structure
Return values:
0   succes.
1   failure.

For internal use only.

Definition at line 680 of file lcmaps_pluginmanager.c.

Referenced by runPluginManager(), and startPluginManager().


Variable Documentation

char * lcmaps_db_file_default = NULL [static]
 

For internal use only.

Definition at line 129 of file lcmaps_pluginmanager.c.

char * lcmaps_dir = NULL [static]
 

For internal use only.

Definition at line 130 of file lcmaps_pluginmanager.c.

lcmaps_plugindl_t * plugin_list = NULL [static]
 

For internal use only.

Definition at line 131 of file lcmaps_pluginmanager.c.


Generated at Thu Mar 4 17:39:26 2004 for edg-lcmaps by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001