• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

saf-esm.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  *
00003  * Copyright (C) Micro Focus 2006-2013. All rights reserved.
00004  *
00005  * The software and information contained herein are proprietary to, and
00006  * comprise valuable trade secrets of, Micro Focus International Ltd., 
00007  * which intends to preserve as trade secrets such software and 
00008  * information. This software is an unpublished copyright of Micro Focus  
00009  * and may not be used, copied, transmitted, or stored in any manner.  
00010  * This software and information or any other copies thereof may not be
00011  * provided or otherwise made available to any other person.
00012  *
00013  *      Enterprise Server SAF (Security) Manager
00014  *      ESM Loader and Interface
00015  *
00016  *      @(#)saf-esm.h   $Revision: 617205 $     
00017  *
00018  *      $Date: 2014-07-12 13:59:20 -0400 (Sat, 12 Jul 2014) $
00019  *
00020  ****************************************************************************/
00021 
00022 /* Start of source module saf-esm.h */
00023 #if !defined(SafESM_H)
00024 #define SafESM_H
00025 
00034 /* Declare structures defined elsewhere */
00035 struct SafInit;
00036 struct SafACEE;
00037 struct safpb_parameter_block;
00038 struct SafStore;
00039 struct SafEsmConfig;
00040 struct SafLockInfo;
00041 
00042 
00043 /* ESM Module Interface */
00044 
01020 /*** Utility API for ESM Modules ***/
01021 
01062 struct SafEsmApi
01063 {
01064    mf_uns32    VerMajor; 
01066    #define     SafESM_API_VER_MAJ 1 
01067    mf_uns32    VerMinor; 
01069    #define     SafESM_API_VER_MIN 4 
01070    mf_uns32    Count;    
01073    mf_uns32    (*Log)(mf_uns32 Number, mf_uns32 Level, const char *Text,
01074                       mf_uns32 Length, void *Reserved);
01075 
01078    mf_uns32    (*GetAcee)(const char *Name, const char *Group,
01079                           struct SafACEE **AceePtr, mf_uns32 *Info,
01080                           void *Reserved);
01081 
01083    mf_uns32    (*GetSharedMem)(const char *Name, mf_uns32 *SizePtr,
01084                                void **MemPtr, void *Reserved);
01085 
01087    mf_uns32    (*LockEnq)(const char *QName, const char *RName,
01088                           mf_uns32 RNameLen, struct SafLockInfo *Info,
01089                           void *Reserved);
01090 
01092    mf_uns32    (*LockDeq)(const char *QName, const char *RName,
01093                           mf_uns32 RNameLen, struct SafLockInfo *Info,
01094                           void *Reserved);
01095 
01097    mf_uns32    (*GetSafInit)(struct SafInit **InitPtr, void *Reserved);
01098 
01101    mf_uns32    (*ExtractVerifyStrings)(struct safpb_parameter_block *Request,
01102                                        char *UserBuf,  mf_uns32 UserMax,
01103                                        char *PassBuf,  mf_uns32 PassMax,
01104                                        char *NPassBuf, mf_uns32 NPassMax,
01105                                        char *GroupBuf, mf_uns32 GroupMax,
01106                                        void *Reserved);
01107 
01110    mf_uns32    (*ExtractAuthStrings)(struct safpb_parameter_block *Request,
01111                                      char *ClassBuf,    mf_uns32 ClassMax,
01112                                      char *EntityBuf,   mf_uns32 EntityMax,
01113                                      char *FacilityBuf, mf_uns32 FacilityMax,
01114                                      char *TransBuf,    mf_uns32 TransMax,
01115                                      void *Reserved);
01116 
01118    int         (*CasMessage)();
01119 
01121    int         (*CasService)();
01122 
01124    int         (*CasLockMgr)();
01125 
01128    mf_uns32    (*ExtractXAuthStrings)(struct safpb_parameter_block *Request,
01129                                       char *ClassBuf,    mf_uns32 ClassMax,
01130                                       char *EntityBuf,   mf_uns32 EntityMax,
01131                                       char *FacilityBuf, mf_uns32 FacilityMax,
01132                                       char *TransBuf,    mf_uns32 TransMax,
01133                                       void *Reserved);
01134 
01137    mf_uns32    (*SafQuery)(mf_uns32 Type, void *Result, mf_uns32 ResSize,
01138                            void *Reserved);
01139 
01142    mf_uns32    (*ParseConfig)(const char *Text, struct SafStore **Result,
01143                               void *Reserved);
01144 
01147    mf_uns32    (*QueryConfig)(struct SafStore *Config,
01148                               const char *Class, const char *Name,
01149                               char **Value, void *Reserved);
01150 
01152    mf_uns32    (*FreeConfig)(struct SafStore *Config, void *Reserved);
01153 
01155    mf_uns32    (*AceeIterate)(void *Data,
01156                               int (*Callback)(struct SafACEE *, void *),
01157                               void *Reserved);
01159    mf_uns32    (*SafControl)(mf_uns32 Type, void *Param,
01160                              mf_uns32 ParamSize, void *Reserved);
01161 };
01162 
01163 
01166 #define SafQUERY_MT        1  
01167 #define SafQUERY_ALLGRP    2  
01168 #define SafQUERY_THREADID  3  
01169 #define SafQUERY_NAME      4  
01170 #define SafQUERY_FEDERATE  5  
01172 #define SafQUERY_REDUNDANT 6  
01175 
01176 
01179 #define SafCTL_LOCK_TMOUT  1  
01181 
01182 
01198 struct SafLockInfo
01199 {
01200    mf_uns32    Version;    
01202    #define     SafESM_API_LOCK_INFO_VER 1 
01203    mf_uns32    Type;       
01206    #define     SafESM_API_LOCK_GLOBAL  0  
01207    #define     SafESM_API_LOCK_LOCAL   1  
01209 };
01210 
01211 
01212 
01213 /*** Interface into ESM Modules ***/
01214 
01215 
01245 struct SafPTab
01246 {
01247    mf_uns32     Version; 
01248    #define      SafESM_PT_VER  1       
01269    mf_uns32     (*Init)(const mf_uns32 *Index,
01270                         struct SafEsmConfig *Config,
01271                         const struct SafEsmApi *Api, void *Reserved);
01272 
01285    mf_uns32     (*Info)(const char **Name, mf_uns32 *IFVersion,
01286                         const unsigned char **Signature, void *Reserved);
01287    #define      SafESM_IF_VER  1       
01296    mf_uns32     (*Verify)(struct safpb_parameter_block *Request,
01297                           void *Reserved);
01298 
01306    mf_uns32     (*Auth)(struct safpb_parameter_block *Request, void *Reserved);
01307 
01315    mf_uns32     (*XAuth)(struct safpb_parameter_block *Request, void *Reserved);
01316 
01326    mf_uns32     (*Update)(mf_s32 Type, struct safpb_parameter_block *Request,
01327                           void *Reserved);
01330    #define      SafESM_UPDATE  0       
01331    #define      SafESM_UPDATED 1       
01333    #define      SafESM_REFRESH 2       
01336 
01337 
01342    mf_uns32     (*Status)();
01343 
01359    mf_uns32     (*Control)(mf_uns32 Index, mf_s32 Type, void *Data,
01360                            void *Reserved);
01369    #define      SafESM_RECONFIG 0
01370 
01381    mf_uns32     (*Exit)(const mf_uns32 *Index, void *Reserved);
01382 
01390    mf_uns32     (*Admin)(struct safpb_parameter_block *Request,
01391                          void *Reserved);
01392 
01396    mf_uns32     (*Reserved)();
01397 };
01398 
01399 
01416 struct SafEsmConfig
01417 {
01418    mf_uns32    Version;       
01419    #define     SafESM_CFG_VER 1              
01421    const char filler[4 + sizeof(void*) + 4]; 
01427    mf_uns32    Priority;
01428 
01429    mf_uns32    CacheTTL;      
01430    mf_uns32    CacheLimit;    
01431    char        Name[256];     
01432    char        Module[256];   
01433    char        EsmConn[256];  
01434    char        EsmUser[256];  
01435    char        EsmPass[256];  
01445    const char *Config;
01446    
01447    void       *Reserved;      
01449 };
01450 
01451 
01452 
01455 #define SafESMRC_OK          0   
01456 #define SafESMRC_NOTIMPL     1   
01457 #define SafESMRC_PARAM       2   
01458 #define SafESMRC_RESOURCE    3   
01459 #define SafESMRC_EXTERNAL    4   
01460 #define SafESMRC_MGRFAIL     5   
01461 #define SafESMRC_FAIL      100   
01463 
01464 
01465 
01466 /*** ESM Loader Interface ***/
01467 
01468 mf_uns32 SafEsmInit(struct SafInit *Init);
01469 mf_uns32 SafEsmExit(void);
01470 mf_uns32 SafEsmUnload(void);
01471 
01472 mf_uns32 SafEsmEnable(mf_uns32 Index);
01473 mf_uns32 SafEsmDisable(mf_uns32 Index);
01474 
01475 const char *SafEsmName(mf_uns32 Index);
01476 
01477 /* Cover routines for ESM Module procedures */
01478 mf_uns32 SafEsmCVerify(mf_uns32 EsmIdx, struct safpb_parameter_block *);
01479 mf_uns32 SafEsmCAuth(mf_uns32 EsmIdx, struct safpb_parameter_block *);
01480 mf_uns32 SafEsmCXAuth(mf_uns32 EsmIdx, struct safpb_parameter_block *);
01481 mf_uns32 SafEsmCAdmin(mf_uns32 EsmIdx, struct safpb_parameter_block *);
01482 mf_uns32 SafEsmCControl(mf_s32 Type, mf_uns32 EsmIdx, void *Data);
01483 mf_uns32 SafEsmCUpdate(mf_s32 Type, mf_uns32 EsmIdx,
01484                        struct safpb_parameter_block *);
01485 
01486 
01487 /***
01488 The Extract*Strings routines are part of the ESM API, but they're also used
01489 by the ESF Caching code, so they need to be public.
01490 ***/
01491 mf_uns32 SafExtractVerifyStrings(
01492    struct safpb_parameter_block *Request, 
01493    char *UserBuf,  mf_uns32 UserMax,  char *PassBuf,  mf_uns32 PassMax,
01494    char *NPassBuf, mf_uns32 NPassMax, char *GroupBuf, mf_uns32 GroupMax,
01495    void *Reserved);
01496 mf_uns32 SafExtractAuthStrings(
01497    struct safpb_parameter_block *Request,
01498    char *ClassBuf,    mf_uns32 ClassMax,
01499    char *EntityBuf,   mf_uns32 EntityMax,
01500    char *FacilityBuf, mf_uns32 FacilityMax,
01501    char *TransBuf,    mf_uns32 TransMax,
01502    void *Reserved);
01503 mf_uns32 SafExtractXAuthStrings(
01504    struct safpb_parameter_block *Request,
01505    char *ClassBuf,    mf_uns32 ClassMax,
01506    char *EntityBuf,   mf_uns32 EntityMax,
01507    char *String1Buf,  mf_uns32 String1Max,
01508    char *String2Buf,  mf_uns32 String2Max,
01509    void *Reserved);
01510 
01511 #endif
01512 
01513 /* End of saf-esm.h */
01514