Data structures and other definitions for the ESF Manager API, used to initialize and control the ESF Manager.
Definition in file safmgr.h.
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | SafInit |
ESF Manager Initialization Control Block. More... | |
Defines | |
#define | SafMGR_H |
#define | SafESM_MAX 8 |
Maximum number of ESM Modules. | |
#define | SafMGR_API_VER 0 |
Initial API version. | |
#define | SafENV_CAS 0 |
Executing under CAS w/o MTO. | |
#define | SafENV_MFDS (1<< 0) |
Executing under MFDS. | |
#define | SafENV_CICS (1<< 1) |
Executing under CAS w/ CICS. | |
#define | SafENV_IMS (1<< 2) |
Executing under CAS w/ IMS. | |
#define | SafENV_JES (1<< 3) |
Executing under CAS w/ IMS. | |
#define | SafENV_SOLO (1ul<<31) |
Executing standalone. | |
#define | SafENV_MTOMASK 0x0eul |
Mask for MTO personalities. | |
#define | SafMGR_FAIL_NONE 0 |
No failure. | |
#define | SafMGR_FAIL_GENERAL 1 |
Error with no specific code. | |
#define | SafMGR_FAIL_RESOURCE 2 |
Resource allocation failed. | |
#define | SafMGR_FAIL_MGRCFG 3 |
Bad ESF Manager configuration. | |
#define | SafMGR_FAIL_LOAD 4 |
Failure loading ESM Module. | |
#define | SafMGR_FAIL_ESMCFG 5 |
Bad ESM Module configuration. | |
#define | SafMGR_FAIL_ESMENTRY 100 |
Bad ESM Module entry. | |
#define | SafMGR_FAIL_ESM 101 |
Error reported by ESM Module. | |
#define | SafMGR_FAIL_ENV 200 |
Environment init failure. | |
#define | SafINIT_OK 0 |
Initialization succeeded. | |
#define | SafINIT_NULL 1 |
Null pointer passed for the SafInit parameter. | |
#define | SafINIT_VER 2 |
Incorrect SafInit::Version value. | |
#define | SafINIT_BAD_CB 3 |
SafInit structure appears to be invalid. | |
#define | SafINIT_ENV 4 |
Illegal SafInit::Environment value. | |
#define | SafINIT_CFG 5 |
Null SafInit::Config pointer. | |
#define | SafINIT_CNT 6 |
Invalid SafInit::ESMCnt value (> SafESM_MAX). | |
#define | SafINIT_ESMCFG 7 |
Null pointer in SafInit::ESMCfg array. | |
#define | SafINIT_RESRCE 8 |
Resource unavailable. | |
#define | SafINIT_OTHER 15 |
Other failure. | |
#define | SafINIT_FAIL 16 |
Initialization failed; see SafInit::Reason. | |
#define | SafINIT_BADENV 128 |
Invalid environment. | |
#define | SafINIT_INTERNAL 129 |
Internal error. | |
#define | SafINIT_MODNAME 130 |
Problem with ESM Module name. | |
#define | SafINIT_MODLOAD 131 |
Failure loading ESM Module. | |
#define | SafINIT_ENVFUNC 132 |
Failure resolving environment function. | |
#define | SafINIT_EXTERNAL 133 |
An external service (eg auditing) failed. | |
#define | SafTERM_THREAD 0 |
Thread is terminating. | |
#define | SafTERM_PROCESS 1 |
Process is terminating. | |
#define | SafTERM_ESF 2 |
ESF is being terminated but may be restarted. | |
#define | SafSTRCMP(s1, op, s2) (strcmp((s1),(s2)) op 0) |
Wrapper for strcmp that inlines the operator. | |
#define | SafSTRCMP_N(s1, op, s2, n) (strncmp((s1),(s2),(n)) op 0) |
Wrapper for strncmp that inlines the operator. | |
#define | SafSTRCMP_CI(s1, op, s2) (SafStrcmpCI((s1),(s2)) op 0) |
Wrapper for SafStrcmpCI that inlines the operator. | |
#define | SafSTRCMP_CIN(s1, op, s2, n) (SafStrcmpCIN((s1),(s2),(n)) op 0) |
Wrapper for SafStrcmpCIN that inlines the operator. | |
#define | SafDO_STR(x) #x |
#define | SafSTRING(x) SafDO_STR(x) |
Macro to convert argument to string. | |
Enumerations | |
enum | SafRet { SafR_OK = 0, SafR_PARAM = 1, SafR_RESOURCE = 2, SafR_EXFAIL = 3, SafR_STATE = 4, SafR_INTERNAL = 5, SafR_NOTFOUND = 6, SafR_TRUNCATED = 7, SafR_NOMORE = 8, SafR_INVALID = 9, SafR_ESM = 10, SafR_END = 11, SafR_Invalid, SafR_Sizer = (1<<30) } |
ESF Manager API Return Codes. More... | |
Functions | |
mf_uns32 | safmgr (struct SafInit *Init) |
ESF Manager Initialization. | |
mf_uns32 | safterm (mf_uns32 What, void *Reserved) |
ESF Manager Termination. | |
mf_uns32 | SafNative32u (mf_uns32 NetValue) |
int | SafState (void) |
ESF Manager Run State. | |
SafRet | SafQueryCfg (const char *Class, const char *Name, char **ValueP) |
Query ESF Manager Custom Configuration. |
#define SafESM_MAX 8 |
Maximum number of ESM Modules.
The ESF Manager supports multiple ESM Modules. Up to this many may be configured for an application (ES region or MFDS).
Definition at line 730 of file safmgr.h.
Referenced by SafAdmin(), and safmgr().
#define SafSTRCMP | ( | s1, | |||
op, | |||||
s2 | ) | (strcmp((s1),(s2)) op 0) |
Wrapper for strcmp that inlines the operator.
Invoke as eg
if (SafSTRCMP(foo, !=, bar))
Definition at line 1021 of file safmgr.h.
Referenced by SafModLoad(), SafModUnload(), and SafVerify().
#define SafSTRCMP_N | ( | s1, | |||
op, | |||||
s2, | |||||
n | ) | (strncmp((s1),(s2),(n)) op 0) |
Wrapper for strncmp that inlines the operator.
Like SafSTRCMP(), but with a maximum comparison length as per strncmp().
#define SafSTRCMP_CI | ( | s1, | |||
op, | |||||
s2 | ) | (SafStrcmpCI((s1),(s2)) op 0) |
Wrapper for SafStrcmpCI that inlines the operator.
Like SafSTRCMP(), but case-insensitive.
Definition at line 1037 of file safmgr.h.
Referenced by SafStoreIterate(), and SafVerify().
#define SafSTRCMP_CIN | ( | s1, | |||
op, | |||||
s2, | |||||
n | ) | (SafStrcmpCIN((s1),(s2),(n)) op 0) |
Wrapper for SafStrcmpCIN that inlines the operator.
Like SafSTRCMP_N(), but case-insensitive.
enum SafRet |
ESF Manager API Return Codes.
These return codes are used by the public functions in the ESF Manager API. Zero is success and positive values are used for various error conditions.
mf_uns32 safmgr | ( | struct SafInit * | Init | ) |
ESF Manager Initialization.
This function must be invoked before any other ESF Manager functions are used.
After successful initialization, a subsequent initialization has no effect. If initialization fails, it can be retried after the problem has been corrected.
Init | A pointer to struct SafInit. On entry the following fields must be set:
|
Reason
and Detail
. They will be zero for success, non-zero for error. If a failure occurred in an ESM Module's initialization (see the description for SafInit::Detail), ESMCnt
will be set to the index (from 0) of the ESM Module that reported the error.
Definition at line 163 of file safmgr.c.
References SafInit::Config, SafInit::ESMCfg, SafInit::ESMCnt, SafESM_MAX, SafINIT_BAD_CB, SafINIT_CFG, SafINIT_CNT, SafINIT_ESMCFG, SafINIT_NULL, SafINIT_OK, SafINIT_VER, SafMGR_API_VER, and SafInit::Version.
mf_uns32 safterm | ( | mf_uns32 | What, | |
void * | Reserved | |||
) |
ESF Manager Termination.
This function should be called when a thread or process that has used ESF is terminating. It will inform the ESM Modules (currently for process exit only), and will perform any necessary cleanup for the Manager itself, including environment-specific cleanup.
[in] | What | Indicates what is terminating; see "What" Codes for safterm() |
Reserved | Reserved for future use (pass a null pointer) |
Definition at line 538 of file safmgr.c.
References SafEsmExit(), SafEsmUnload(), SafRaiseAuditEvent(), SafTERM_ESF, SafTERM_PROCESS, SafThrLock(), and SafThrUnlock().
int SafState | ( | void | ) |
ESF Manager Run State.
Returns the run state of ESF Manager (uninitialized, running, terminated).
No parameters
Definition at line 597 of file safmgr.c.
Referenced by SafAdmin(), SafAuth(), SafUpdate(), SafVerify(), and SafXauth().
SafRet SafQueryCfg | ( | const char * | Class, | |
const char * | Name, | |||
char ** | ValueP | |||
) |
Query ESF Manager Custom Configuration.
MFDS provides a "Configuration Information" text area in each Security Manager configuration object. This area can be used to set custom configuration attributes in "ini" format, with name=value pairs grouped under section headings in square brackets.
This function can be used to query the value associated with a name in a given section.
[in] | Class | Section heading (without the brackets) |
[in] | Name | Item name |
[out] | ValueP | Returned pointer to value, if any |
Definition at line 621 of file safmgr.c.
References SafStoreFind().
Referenced by SafAdmin(), and SafVerify().