pkcs11Slot.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PKCS11_SLOT_H
#define _PKCS11_SLOT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include "pkcs11Session.h"
#define MECHLIST_SIZE 32
/*
* Used to pass arguments to child threads for C_WaitForSlotEvent.
*/
typedef struct wfse_args {
} wfse_args_t;
typedef struct pkcs11_slot {
/* sl_tid, sl_wfse_state, */
/* and sl_wfse_args */
void *sl_dldesc; /* from dlopen */
/*
* State definitions used for C_WaitForSlotEvent, stored in sl_wfse_state
* for each slot. These states are mutually exclusive, ie only one should
* be set at a time.
*/
#define WFSE_CLEAR 0x0
#define WFSE_EVENT 0x1
#define WFSE_ACTIVE 0x2
/*
* Dynamically allocated array of slots, indexed by the slotID assigned
* by the framework. st_first will be initialized to 1. Only if there
* is more than one other slot present, triggering the existence of the
* metaslot, with st_first be set to 0. st_last will be set to the
* last slotID assigned, also used for looping through the slottable.
*/
typedef struct pkcs11_slottable {
/* except for st_start_cond. */
/*
* This macro is used to quickly derefence from a framework slot ID,
* provided by an application, to the function pointers for the correct
* underlying provider.
*/
/*
* This macro is used to quickly get the slot ID associated with this
* slot ID, that is used by the underlying provider.
*/
extern pkcs11_slottable_t *slottable;
extern CK_RV pkcs11_slottable_initialize();
extern CK_RV pkcs11_slottable_delete();
#ifdef __cplusplus
}
#endif
#endif /* _PKCS11_SLOT_H */