pkcs11Sessionlist.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * pkcs11_session_add: 2N/A * Create a session and add it to the list of sessions associated 2N/A * with the slot it is being opened on. The session handle, fwsessionp, 2N/A * will be the memory address of the session, typecast to a CK_SESSION_HANDLE. 2N/A * Assumptions: slotp is a valid slot, mutexes are not held, and 2N/A * the provider already successfully opened related session. 2N/A /* Insert the new session in the front of the slot's session list */ 2N/A /* Typecast the address of session structure to a session handle */ 2N/A * pkcs11_session_delete: 2N/A * Delete a session from a particular slot's session list. 2N/A * Assumptions: slotp is a valid slot, sessp is a valid session, 2N/A * provider has already successfully closed this session, and 2N/A * mutexes are not held. 2N/A /* Acquire the slot's lock */ 2N/A /* This is the first session in the list */ 2N/A /* Session is the only one in the list */ 2N/A /* Session is not the first one in the list */ 2N/A /* Session is in the middle of the list */ 2N/A /* Session is the last one in the list */ 2N/A /* Mark session as no longer valid */ 2N/A * pkcs11_sessionlist_delete: 2N/A * Delete all sessions associated with a particular slot's session list. 2N/A * Assumptions: slotp is a valid slot, no mutexes are held, and the 2N/A * sessions were successfully closed with the provider already. 2N/A /* Delete all the sessions in this slot's session list */