|
Packit |
8681c6 |
/*
|
|
Packit |
8681c6 |
* COPYRIGHT (c) International Business Machines Corp. 2001-2017
|
|
Packit |
8681c6 |
*
|
|
Packit |
8681c6 |
* This program is provided under the terms of the Common Public License,
|
|
Packit |
8681c6 |
* version 1.0 (CPL-1.0). Any use, reproduction or distribution for this
|
|
Packit |
8681c6 |
* software constitutes recipient's acceptance of CPL-1.0 terms which can be
|
|
Packit |
8681c6 |
* found in the file LICENSE file or at
|
|
Packit |
8681c6 |
* https://opensource.org/licenses/cpl1.0.php
|
|
Packit |
8681c6 |
*/
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
#include <pkcs11types.h>
|
|
Packit |
8681c6 |
#include <limits.h>
|
|
Packit |
8681c6 |
#include <local_types.h>
|
|
Packit |
8681c6 |
#include <stdll.h>
|
|
Packit |
8681c6 |
#include <slotmgr.h>
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
#include "local_types.h"
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
#ifndef _APILOCAL_H
|
|
Packit |
8681c6 |
#define _APILOCAL_H
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
// SAB Add a linked list of STDLL's loaded to
|
|
Packit |
8681c6 |
// only load and get list once, but let multiple slots us it.
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
typedef struct {
|
|
Packit |
8681c6 |
CK_BOOL DLLoaded; // Flag to indicate if the STDDL has been loaded
|
|
Packit |
8681c6 |
char *dll_name; // Malloced space to copy the name.
|
|
Packit |
8681c6 |
void *dlop_p;
|
|
Packit |
8681c6 |
int dll_load_count;
|
|
Packit |
8681c6 |
// STDLL_FcnList_t *FcnList; // Function list pointer for the STDLL
|
|
Packit |
8681c6 |
} DLL_Load_t;
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
struct API_Slot {
|
|
Packit |
8681c6 |
CK_BOOL DLLoaded; // Flag to indicate if the STDDL has been loaded
|
|
Packit |
8681c6 |
void *dlop_p; // Pointer to the value returned from the DL open
|
|
Packit |
8681c6 |
STDLL_FcnList_t *FcnList; // Function list pointer for the STDLL
|
|
Packit |
8681c6 |
STDLL_TokData_t *TokData; // Pointer to Token specific data
|
|
Packit |
8681c6 |
DLL_Load_t *dll_information;
|
|
Packit |
8681c6 |
CK_RV (*pSTfini)(STDLL_TokData_t *, CK_SLOT_ID, SLOT_INFO *,
|
|
Packit |
8681c6 |
struct trace_handle_t *, CK_BBOOL);
|
|
Packit |
8681c6 |
CK_RV(*pSTcloseall)(STDLL_TokData_t *, CK_SLOT_ID);
|
|
Packit |
8681c6 |
};
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
// Per process API structure.
|
|
Packit |
8681c6 |
// Allocate one per process on the C_Initialize. This will be
|
|
Packit |
8681c6 |
// a global type for the API and will be used through out.
|
|
Packit |
8681c6 |
//
|
|
Packit |
8681c6 |
typedef struct {
|
|
Packit |
8681c6 |
pid_t Pid;
|
|
Packit |
8681c6 |
key_t shm_tok;
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
struct btree sess_btree;
|
|
Packit |
8681c6 |
void *SharedMemP;
|
|
Packit |
8681c6 |
Slot_Mgr_Socket_t SocketDataP;
|
|
Packit |
8681c6 |
uint16 MgrProcIndex; // Index into shared memory for This process ctl block
|
|
Packit |
8681c6 |
API_Slot_t SltList[NUMBER_SLOTS_MANAGED];
|
|
Packit |
8681c6 |
DLL_Load_t DLLs[NUMBER_SLOTS_MANAGED]; // worst case we have a separate DLL
|
|
Packit |
8681c6 |
// per slot
|
|
Packit |
8681c6 |
} API_Proc_Struct_t;
|
|
Packit |
8681c6 |
|
|
Packit |
8681c6 |
#endif
|