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

lcas.c File Reference

LCAS - the local centre authorization service. More...

#include "lcas_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <dlfcn.h>
#include <gssapi.h>
#include "lcas_types.h"
#include "_lcas_utils.h"
#include "_lcas_defines.h"
#include "_lcas_log.h"
#include "_lcas_db_read.h"

Include dependency graph for lcas.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  lcas_plugindl_s
 the plugin authorization module structure. More...


Defines

#define NUL   '\0'
#define MAXAUTHMODS   3
#define MAXPROCS   3
#define FAILED_LCAS_USERALLOW   1
#define FAILED_LCAS_USERBAN   2
#define FAILED_LCAS_CLOCKCHECK   3
#define FAILED_LCAS_OTHER   4
#define FAILED_LCAS_PLUGIN   5

Typedefs

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

typedef struct lcas_plugindl_s  lcas_plugindl_t
 the type definition of the plugin authorization module structure. More...


Enumerations

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


Functions

lcas_plugindl_tPluginInit (lcas_db_entry_t *, lcas_plugindl_t **)
 Initialize the plugin. More...

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

int print_lcas_plugin (int, lcas_plugindl_t *)
 print the lcas_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 (lcas_plugindl_t **)
 clean (free) the list of plugins and call the plugin termination functions. More...


Variables

lcas_cred_id_t lcas_cred
int lcas_initialized = 0
char* lcas_db_file_default = NULL
char* lcas_dir = NULL
lcas_plugindl_tplugin_list = NULL
lcas_plugindl_tauthmod_list = NULL
char* authmods [MAXAUTHMODS][2]


Detailed Description

LCAS - the local centre authorization service.

Author:
Martijn Steenbakkers for the EU DataGrid.

The interface to the LCAS module is composed of:
  1. lcas_init(): To initialize the LCAS module
  2. lcas_get_fabric_authorization(): to place an authorization request
  3. lcas_term(): To cleanly terminate the module

Definition in file lcas.c.


Define Documentation

#define FAILED_LCAS_CLOCKCHECK   3
 

return value of LCAS because of failure of clockcheck module (obsolete)

Definition at line 95 of file lcas.c.

#define FAILED_LCAS_OTHER   4
 

return value of LCAS because of general failure

Definition at line 97 of file lcas.c.

#define FAILED_LCAS_PLUGIN   5
 

return value of LCAS because of failure of plugin authorization module

Definition at line 98 of file lcas.c.

#define FAILED_LCAS_USERALLOW   1
 

return value of LCAS because of failure of userallow module (obsolete)

Definition at line 91 of file lcas.c.

#define FAILED_LCAS_USERBAN   2
 

return value of LCAS because of failure of userban module (obsolete)

Definition at line 93 of file lcas.c.

#define MAXAUTHMODS   3
 

maximum number of standard authorization modules

For internal use only.

Definition at line 85 of file lcas.c.

#define MAXPROCS   3
 

maximum number of interface symbols in authorization modules

For internal use only.

Definition at line 86 of file lcas.c.

#define NUL   '\0'
 

NUL character

For internal use only.

Definition at line 81 of file lcas.c.


Typedef Documentation

typedef struct lcas_plugindl_s lcas_plugindl_t
 

the type definition of the plugin authorization module structure.

For internal use only.

typedef int(* lcas_proc_t)()
 

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

For internal use only.

Definition at line 132 of file lcas.c.


Enumeration Type Documentation

enum lcas_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
AUTHPROC   this value corresponds to the plugin authorization request function
TERMPROC   this value corresponds to the plugin termination function

Definition at line 119 of file lcas.c.


Function Documentation

lcas_plugindl_t * PluginInit ( lcas_db_entry_t * db_handle,
lcas_plugindl_t ** list ) [static]
 

Initialize the plugin.

This function takes a plugin LCAS 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 LCAS 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 443 of file lcas.c.

Referenced by lcas_init().

int clean_plugin_list ( lcas_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 796 of file lcas.c.

Referenced by lcas_init().

lcas_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 756 of file lcas.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 695 of file lcas.c.

Referenced by PluginInit().

int print_lcas_plugin ( int debug_lvl,
lcas_plugindl_t * plugin ) [static]
 

print the lcas_plugindl_t structure.

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

For internal use only.

Definition at line 859 of file lcas.c.

Referenced by lcas_init().


Variable Documentation

lcas_plugindl_t * authmod_list = NULL [static]
 

For internal use only.

Definition at line 173 of file lcas.c.

char * authmods [static]
 

Initial value:

 {
                             {(char *) NULL, (char *) NULL},
                             {(char *) NULL, (char *) NULL},
                             {(char *) NULL, (char *) NULL}
}

For internal use only.

Definition at line 174 of file lcas.c.

lcas_cred_id_t lcas_cred [static]
 

For internal use only.

Definition at line 168 of file lcas.c.

char * lcas_db_file_default = NULL [static]
 

For internal use only.

Definition at line 170 of file lcas.c.

char * lcas_dir = NULL [static]
 

For internal use only.

Definition at line 171 of file lcas.c.

int lcas_initialized = 0 [static]
 

For internal use only.

Definition at line 169 of file lcas.c.

lcas_plugindl_t * plugin_list = NULL [static]
 

For internal use only.

Definition at line 172 of file lcas.c.


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