saf-esm.h File Reference


Detailed Description

ESF Manager ESM Loader and Interface and ESM Module API.

Data structures and other definitions for the ESF Manager ESM Loader and ESM Module Interface.

See also:
saf-esm.c

Definition in file saf-esm.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SafEsmApi
 ESM Module API Procedure Table. More...
struct  SafPTab
 ESM Module Procedure Table. More...

Defines

#define SafESM_H
#define SafESM_API_VER_MAJ   1
 structure major version
#define SafESM_API_VER_MIN   3
 structure minor version
#define SafQUERY_MT   1
 32-bit int, nonzero for multithreaded env
#define SafQUERY_ALLGRP   2
 32-bit int, nonzero if all-groups mode
#define SafESM_PT_VER   1
 Table version.
#define SafESM_IF_VER   1
 Initial interface version.
#define SafESM_UPDATE   0
 Normal Update request.
#define SafESM_UPDATED   1
 Cached Update request (update private data only).
#define SafESM_REFRESH   2
 Refresh request (flush all private data).
#define SafESMRC_OK   0
 Success.
#define SafESMRC_NOTIMPL   1
 Procedure is not implemented.
#define SafESMRC_PARAM   2
 Invalid parameter.
#define SafESMRC_RESOURCE   3
 Resource allocation failure.
#define SafESMRC_EXTERNAL   4
 External failure (eg in ESM).
#define SafESMRC_MGRFAIL   5
 Failure in an ESF Manager service.
#define SafESMRC_FAIL   100
 Other failure.

Functions

mf_uns32 SafEsmInit (struct SafInit *Init)
 ESF ESM Module Loading and Initialization.
mf_uns32 SafEsmExit (void)
 Inform ESM Modules of Process Exit.
mf_uns32 SafEsmUnload (void)
 Unload ESM Modules.
mf_uns32 SafEsmEnable (mf_uns32 Index)
mf_uns32 SafEsmDisable (mf_uns32 Index)
const char * SafEsmName (mf_uns32 Index)
 Provide the Name of an ESM Module (For Logging).
mf_uns32 SafEsmCVerify (mf_uns32 EsmIdx, struct safpb_parameter_block *)
 Call an ESM Module's Verify Procedure.
mf_uns32 SafEsmCAuth (mf_uns32 EsmIdx, struct safpb_parameter_block *)
 Call an ESM Module's Auth Procedure.
mf_uns32 SafEsmCXAuth (mf_uns32 EsmIdx, struct safpb_parameter_block *)
 Call an ESM Module's XAuth Procedure.
mf_uns32 SafEsmCAdmin (mf_uns32 EsmIdx, struct safpb_parameter_block *)
 Call an ESM Module's Admin Procedure.
mf_uns32 SafEsmCUpdate (mf_s32 Type, mf_uns32 EsmIdx, struct safpb_parameter_block *)
 Call an ESM Module's Update Procedure.


Function Documentation

mf_uns32 SafEsmInit ( struct SafInit Init  ) 

ESF ESM Module Loading and Initialization.

For internal use only.

When ESF Manager is initialized, it calls this function to load and initialize all of the configured ESM Modules. Like the other init functions, this is not threadsafe.

Parameters:
[in,out] Init Pointer to the SafInit structure. Note that some fields (eg Reason and Detail) may be altered by this function.
Returns:
An integer value, zero for success and non-zero if initialization failed. See ESF Manager Initialization Return Codes and ESF Manager Initialization Internal Return Codes.

Definition at line 193 of file saf-esm.c.

References SafEsmApi::AceeIterate, SafInit::CasLockF, SafEsmApi::CasLockMgr, SafEsmApi::CasMessage, SafInit::CasMsgF, SafEsmApi::CasService, SafInit::CasTmpF, SafEsmApi::Count, EsmAceeIterate(), SafInit::ESMCfg, SafInit::ESMCnt, EsmExtractAuthStrings(), EsmExtractVerifyStrings(), EsmExtractXAuthStrings(), EsmFreeConfig(), EsmGetAcee(), EsmGetSafInit(), EsmGetSharedMem(), EsmLockDeq(), EsmLockEnq(), EsmLog(), EsmParseConfig(), EsmQueryConfig(), EsmSafQuery(), SafEsmApi::ExtractAuthStrings, SafEsmApi::ExtractVerifyStrings, SafEsmApi::ExtractXAuthStrings, SafEsmApi::FreeConfig, SafEsmApi::GetAcee, SafEsmApi::GetSafInit, SafEsmApi::GetSharedMem, SafEsmApi::LockDeq, SafEsmApi::LockEnq, SafEsmApi::Log, SafEsmApi::ParseConfig, SafEsmApi::QueryConfig, SafInit::Reason, SafESM_API_VER_MAJ, SafESM_API_VER_MIN, SafINIT_ESMCFG, SafINIT_MODNAME, SafINIT_NULL, SafINIT_OK, SafMGR_FAIL_ESMENTRY, SafEsmApi::SafQuery, and SafR_OK.

mf_uns32 SafEsmExit ( void   ) 

Inform ESM Modules of Process Exit.

Invoke the Exit procedure for all loaded ESM Modules that implement this procedure. This notifies the modules that the process is exiting.

Currently there are no parameters.

Returns:
An integer value, zero for success, non-zero for error. Currently no specific error codes are defined.

Definition at line 529 of file saf-esm.c.

References SafLog(), and SafMsgWARN.

Referenced by safterm().

mf_uns32 SafEsmUnload ( void   ) 

Unload ESM Modules.

Unload any ESM Modules that were dynamically loaded. This is used when ESF is being shut down for possible restarting in the same process, and helps ensure that the modules will be reinitialized correctly.

Currently there are no parameters.

Returns:
An integer value, zero for success, non-zero for error. Currently no specific error codes are defined.

Definition at line 572 of file saf-esm.c.

References SafModUnload().

Referenced by safterm().

const char* SafEsmName ( mf_uns32  Index  ) 

Provide the Name of an ESM Module (For Logging).

Return the name of an ESM module, indicated by zero-based index into the module array passed at initialization.

Parameters:
[in] Index The index of the ESM module.
Returns:
A constant string containing the module name, or a default if the name is unavailable.

Definition at line 604 of file saf-esm.c.

References SafInit::ESMCfg.

Referenced by SafAdmin(), SafAuth(), SafUpdate(), SafVerify(), and SafXauth().

mf_uns32 SafEsmCVerify ( mf_uns32  EsmIdx,
struct safpb_parameter_block PBlock 
)

Call an ESM Module's Verify Procedure.

Invoke the Verify procedure for the specified ESM Module, if it provides one. If the module does not implement Verify, return the "Unimplemented" return code SafESMRC_NOTIMPL (see Return Codes).

Parameters:
[in,out] PBlock The ESF API parameter block for the request
[in] EsmIdx The index of the ESM Module to call
Returns:
An integer, zero for success, nonzero for error; see ESM Module Procedure Return Codes

Definition at line 631 of file saf-esm.c.

References SafESMRC_NOTIMPL, and SafESMRC_PARAM.

Referenced by SafVerify().

mf_uns32 SafEsmCAuth ( mf_uns32  EsmIdx,
struct safpb_parameter_block PBlock 
)

Call an ESM Module's Auth Procedure.

Invoke the Auth procedure for the specified ESM Module, if it provides one. If the module does not implement Auth, return the "Unimplemented" return code SafESMRC_NOTIMPL (see Return Codes).

Parameters:
[in,out] PBlock The ESF API parameter block for the request
[in] EsmIdx The index of the ESM Module to call
Returns:
An integer, zero for success, nonzero for error; see ESM Module Procedure Return Codes

Definition at line 657 of file saf-esm.c.

References SafESMRC_NOTIMPL, and SafESMRC_PARAM.

Referenced by SafAuth().

mf_uns32 SafEsmCXAuth ( mf_uns32  EsmIdx,
struct safpb_parameter_block PBlock 
)

Call an ESM Module's XAuth Procedure.

Invoke the XAuth procedure for the specified ESM Module, if it provides one. If the module does not implement XAuth, return the "Unimplemented" return code SafESMRC_NOTIMPL (see Return Codes).

Parameters:
[in,out] PBlock The ESF API parameter block for the request
[in] EsmIdx The index of the ESM Module to call
Returns:
An integer, zero for success, nonzero for error; see ESM Module Procedure Return Codes

Definition at line 683 of file saf-esm.c.

References SafESMRC_NOTIMPL, and SafESMRC_PARAM.

Referenced by SafXauth().

mf_uns32 SafEsmCAdmin ( mf_uns32  EsmIdx,
struct safpb_parameter_block PBlock 
)

Call an ESM Module's Admin Procedure.

Invoke the Admin procedure for the specified ESM Module, if it provides one. If the module does not implement Admin, return the "Unimplemented" return code SafESMRC_NOTIMPL (see Return Codes).

Parameters:
[in,out] PBlock The ESF API parameter block for the request
[in] EsmIdx The index of the ESM Module to call
Returns:
An integer, zero for success, nonzero for error; see ESM Module Procedure Return Codes

Definition at line 709 of file saf-esm.c.

References SafESMRC_NOTIMPL, and SafESMRC_PARAM.

Referenced by SafAdmin().

mf_uns32 SafEsmCUpdate ( mf_s32  Type,
mf_uns32  EsmIdx,
struct safpb_parameter_block PBlock 
)

Call an ESM Module's Update Procedure.

Invoke the Update procedure for the specified ESM Module, if it provides one. If the module does not implement Admin, return the "Unimplemented" return code SafESMRC_NOTIMPL (see Return Codes).

Parameters:
[in] Type The type of update call; see ESF ESM Update Request Types
[in] EsmIdx The index of the ESM Module to call
[in,out] PBlock The ESF API parameter block for the request
Returns:
An integer, zero for success, nonzero for error; see ESM Module Procedure Return Codes

Definition at line 736 of file saf-esm.c.

References SafESMRC_NOTIMPL, and SafESMRC_PARAM.

Referenced by SafUpdate().