diff options
| author | Joshua M. Clulow <josh@sysmgr.org> | 2012-02-02 20:16:51 +1100 | 
|---|---|---|
| committer | Joshua M. Clulow <josh@sysmgr.org> | 2012-02-02 20:16:51 +1100 | 
| commit | 52524f69f3692eb5443c2737c8f4fd9b11670d24 (patch) | |
| tree | cbeaf15d342a065eebd8d032305bbdc18f151aed /usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h | |
| parent | cd21e7c548ae2a3b5e522244bf798f2a6b4ba02d (diff) | |
| download | illumos-joyent-52524f69f3692eb5443c2737c8f4fd9b11670d24.tar.gz | |
2111 begone, pkcs11_kms!
Reviewed by: Alexander Eremin <alexander.eremin@nexenta.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h')
| -rw-r--r-- | usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h | 99 | 
1 files changed, 0 insertions, 99 deletions
| diff --git a/usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h b/usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h deleted file mode 100644 index cacec08c74..0000000000 --- a/usr/src/lib/libkmsagent/common/KMSAgentDataUnitCache.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (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 - * or http://www.opensolaris.org/os/licensing. - * 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 (c) 2010, Oracle and/or its affiliates. All rights reserved. - */ - -/** @file             KMSAgentDataUnitCache.h  - *  @defgroup         EncryptionAgent Encryption Agent API - * - */ -#ifndef KMSAGENT_DATA_UNIT_CACHE_H -#define KMSAGENT_DATA_UNIT_CACHE_H - -#define DATA_UNIT_CACHE_MAX_SIZE 128 - -typedef struct DataUnitCacheEntry -{ -    utf8char m_wsApplianceNetworkAddress[KMS_MAX_NETWORK_ADDRESS+1]; -    unsigned char m_aDataUnitID[KMS_DATA_UNIT_ID_SIZE]; -    unsigned char m_aDataUnitKeyID[KMS_KEY_ID_SIZE]; - -} DataUnitCacheEntry; - -/** - *  Maintains an affinity list between KMAs and DUs and KeyIDs.  - */ -class CDataUnitCache -{ - -public: -    CDataUnitCache(int i_iMaxSize = DATA_UNIT_CACHE_MAX_SIZE); -    ~CDataUnitCache(); - -    /** -     *   insert a new DataUnitCacheEntry into the cache list, either i_pDataUnitID or -     *   i_pDataUnitKeyID must be specified for affinity with the specified i_wsApplianceNetworkAddress -     *   @param i_pDataUnitID optional, specifies a DU ID cache entry if specified -     *   @param i_iDataUnitIDMaxLen ignored if i_pDataUnitID not specified, otherwise -     *      specifies the length of i_pDataUnitID -     *   @param i_pDataUnitKeyID optional, specifies a Key ID cache entry if specified -     *   @param i_iDataUnitKeyIDMaxLen ignored if i_pDataUnitKeyID is not specified,  -     *      otherwise specifies the length of i_pDataUnitKeyID -     *   @param i_wsApplianceNetworkAddress required and specifies the KMA affiliated  -     *      with the DU ID or Key ID -     *   @return True if successfully inserted into the cache -     */ -    bool Insert( -                const unsigned char* const i_pDataUnitID, -                int i_iDataUnitIDMaxLen,  -                const unsigned char* const i_pDataUnitKeyID , -                int i_iDataUnitKeyIDMaxLen, -                const utf8char* const i_wsApplianceNetworkAddress ); - -    bool GetApplianceByDataUnitID( -                const unsigned char* const i_pDataUnitID, -                int i_iDataUnitIDMaxLen, -                utf8char* const o_wsApplianceNetworkAddress, -                int i_iMaxApplianceNetworkAddressLen ); - -    bool GetApplianceByDataUnitKeyID( -                const unsigned char* const i_pDataUnitKeyID, -                int i_iDataUnitKeyIDMaxLen, -                utf8char* const o_wsApplianceNetworkAddress, -                int i_iMaxApplianceNetworkAddressLen ); - -protected: -    void Lock(); -    void Unlock(); - -private: -    K_MUTEX_HANDLE m_Lock; - -    int m_iIndex; -    int m_iSize; -    int m_iMaxSize; -    DataUnitCacheEntry *m_pCache; - -}; - -#endif | 
