4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 * imaPlugin.h: interface for the iScsiPlugin class.
32 * The contents of this file are subject to the SNIA Public License
33 * Version 1.0 (the "License"); you may not use this file except in
34 * compliance with the License. You may obtain a copy of the License at
36 * /http://www.snia.org/English/Resources/Code/OpenSource.html
38 * Software distributed under the License is distributed on an "AS IS"
39 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
40 * the License for the specific language governing rights and limitations
43 * The Original Code is SNIA HBA API and IMA general header file
45 * The Initial Developer of the Original Code is:
46 * Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
47 * David Dillard VERITAS Software david.dillard@veritas.com
50 * Jeff Ding, Adaptec, Inc. (jding@corp.adaptec.com)
52 *******************************************************************************
55 * 09/24/2003 Initial Draft
56 * (for other changes... see the CVS logs)
57 * 12/15/2003 corrected the defined parameter in IMA_SetPhbaIsnsDiscovery().
58 * lower case the computer name as iscsi name in IMA_GenerateNodeName().
59 ******************************************************************************/
68 typedef IMA_STATUS (* Initialize
)(
72 typedef void (* TerminateFn
)();
75 typedef IMA_STATUS (* IMA_GetPluginPropertiesFn
)(
77 IMA_PLUGIN_PROPERTIES
*pProps
81 typedef IMA_STATUS (* IMA_GetSharedNodeOidFn
)(
82 IMA_OID
*pSharedNodeId
86 typedef IMA_STATUS (* IMA_GetNodePropertiesFn
)(
88 IMA_NODE_PROPERTIES
*pProps
92 typedef IMA_STATUS (* IMA_SetNodeNameFn
)(
94 const IMA_NODE_NAME newName
98 typedef IMA_STATUS (* IMA_GenerateNodeNameFn
)(
99 IMA_NODE_NAME generatedname
103 typedef IMA_STATUS (* IMA_SetNodeAliasFn
)(
105 const IMA_NODE_ALIAS newAlias
109 typedef IMA_STATUS (* IMA_GetLhbaOidListFn
)(
110 IMA_OID_LIST
**ppList
113 typedef IMA_STATUS (* IMA_GetLhbaPropertiesFn
)(
115 IMA_LHBA_PROPERTIES
*pProps
119 typedef IMA_STATUS (* IMA_GetPhbaOidListFn
)(
120 IMA_OID_LIST
**ppList
124 typedef IMA_STATUS (* IMA_GetPhbaPropertiesFn
)(
126 IMA_PHBA_PROPERTIES
*pProps
130 typedef IMA_STATUS (* IMA_GetNonSharedNodeOidListFn
)(
131 IMA_OID_LIST
**ppList
135 typedef IMA_STATUS (* IMA_GetFirstBurstLengthPropertiesFn
)(
137 IMA_MIN_MAX_VALUE
*pProps
141 typedef IMA_STATUS (* IMA_GetMaxBurstLengthPropertiesFn
)(
143 IMA_MIN_MAX_VALUE
*pProps
147 typedef IMA_STATUS (* IMA_GetMaxRecvDataSegmentLengthPropertiesFn
)(
149 IMA_MIN_MAX_VALUE
*pProps
153 /*---------------------------------------------*/
154 typedef IMA_STATUS (* IMA_PluginIOCtlFn
)(
157 const void *pInputBuffer
,
158 IMA_UINT inputBufferLength
,
160 IMA_UINT
*pOutputBufferLength
164 typedef IMA_STATUS (* IMA_GetNetworkPortalOidListFn
)(
166 IMA_OID_LIST
**ppList
170 typedef IMA_STATUS (* IMA_SetFirstBurstLengthFn
)(
172 IMA_UINT firstBurstLength
175 typedef IMA_STATUS (* IMA_SetMaxBurstLengthFn
)(
177 IMA_UINT maxBurstLength
180 typedef IMA_STATUS (* IMA_SetMaxRecvDataSegmentLengthFn
)(
182 IMA_UINT maxRecvDataSegmentLength
185 typedef IMA_STATUS (* IMA_GetMaxConnectionsPropertiesFn
)(
187 IMA_MIN_MAX_VALUE
*pProps
190 typedef IMA_STATUS (* IMA_SetMaxConnectionsFn
)(
192 IMA_UINT maxConnections
195 typedef IMA_STATUS (* IMA_GetDefaultTime2RetainPropertiesFn
)(
197 IMA_MIN_MAX_VALUE
*pProps
200 typedef IMA_STATUS (* IMA_SetDefaultTime2RetainFn
)(
202 IMA_UINT defaultTime2Retain
205 typedef IMA_STATUS (* IMA_GetDefaultTime2WaitPropertiesFn
)(
207 IMA_MIN_MAX_VALUE
*pProps
210 typedef IMA_STATUS (* IMA_SetDefaultTime2WaitFn
)(
212 IMA_UINT defaultTime2Wait
215 typedef IMA_STATUS (* IMA_GetMaxOutstandingR2TPropertiesFn
)(
217 IMA_MIN_MAX_VALUE
*pProps
220 typedef IMA_STATUS (* IMA_SetMaxOutstandingR2TFn
)(
222 IMA_UINT maxOutstandingR2T
225 typedef IMA_STATUS (* IMA_GetErrorRecoveryLevelPropertiesFn
)(
227 IMA_MIN_MAX_VALUE
*pProps
230 typedef IMA_STATUS (* IMA_SetErrorRecoveryLevelFn
)(
232 IMA_UINT errorRecoveryLevel
235 typedef IMA_STATUS (* IMA_GetInitialR2TPropertiesFn
)(
237 IMA_BOOL_VALUE
*pProps
240 typedef IMA_STATUS (* IMA_SetInitialR2TFn
)(
245 typedef IMA_STATUS (* IMA_GetImmediateDataPropertiesFn
)(
247 IMA_BOOL_VALUE
*pProps
250 typedef IMA_STATUS (* IMA_SetImmediateDataFn
)(
252 IMA_BOOL immediateData
255 typedef IMA_STATUS (* IMA_GetDataPduInOrderPropertiesFn
)(
257 IMA_BOOL_VALUE
*pProps
260 typedef IMA_STATUS (* IMA_SetDataPduInOrderFn
)(
262 IMA_BOOL dataPduInOrder
265 typedef IMA_STATUS (* IMA_GetDataSequenceInOrderPropertiesFn
)(
267 IMA_BOOL_VALUE
*pProps
270 typedef IMA_STATUS (* IMA_SetDataSequenceInOrderFn
)(
272 IMA_BOOL dataSequenceInOrder
275 typedef IMA_STATUS (* IMA_SetStatisticsCollectionFn
)(
277 IMA_BOOL enableStatisticsCollection
280 typedef IMA_STATUS (* IMA_GetNetworkPortStatusFn
)(
282 IMA_NETWORK_PORT_STATUS
*pStatus
285 typedef IMA_STATUS (* IMA_GetTargetOidListFn
)(
287 IMA_OID_LIST
**ppList
290 typedef IMA_STATUS (* IMA_RemoveStaleDataFn
)(
294 typedef IMA_STATUS (* IMA_SetIsnsDiscoveryFn
)(
296 IMA_BOOL enableIsnsDiscovery
,
297 IMA_ISNS_DISCOVERY_METHOD discoveryMethod
,
298 const IMA_HOST_ID
*iSnsHost
301 typedef IMA_STATUS (* IMA_SetSlpDiscoveryFn
)(
303 IMA_BOOL enableSlpDiscovery
306 typedef IMA_STATUS (* IMA_SetStaticDiscoveryFn
)(
308 IMA_BOOL enableStaticDiscovery
311 typedef IMA_STATUS (* IMA_SetSendTargetsDiscoveryFn
)(
313 IMA_BOOL enableSendTargetsDiscovery
316 typedef IMA_STATUS (* IMA_AddPhbaStaticDiscoveryTargetFn
)(
318 const IMA_TARGET_ADDRESS targetAddress
,
319 IMA_OID_LIST
**pTargetOidList
322 typedef IMA_STATUS (* IMA_RemovePhbaStaticDiscoveryTargetFn
)(
327 typedef IMA_STATUS (* IMA_GetPnpOidListFn
)(
329 IMA_OID_LIST
**ppList
332 typedef IMA_STATUS (* IMA_GetPhbaDownloadPropertiesFn
)(
334 IMA_PHBA_DOWNLOAD_PROPERTIES
*pProps
337 typedef IMA_STATUS (* IMA_IsPhbaDownloadFileFn
)(
339 const IMA_WCHAR
*pFileName
,
340 IMA_PHBA_DOWNLOAD_IMAGE_PROPERTIES
*pProps
343 typedef IMA_STATUS (* IMA_PhbaDownloadFn
)(
345 IMA_PHBA_DOWNLOAD_IMAGE_TYPE imageType
,
346 const IMA_WCHAR
*pFileName
349 typedef IMA_STATUS (* IMA_GetNetworkPortalPropertiesFn
)(
350 IMA_OID networkPortalId
,
351 IMA_NETWORK_PORTAL_PROPERTIES
*pProps
354 typedef IMA_STATUS (* IMA_SetNetworkPortalIpAddressFn
)(
355 IMA_OID networkPortalId
,
356 const IMA_IP_ADDRESS NewIpAddress
359 typedef IMA_STATUS (* IMA_GetLnpOidListFn
)(
360 IMA_OID_LIST
**ppList
363 typedef IMA_STATUS (* IMA_GetLnpPropertiesFn
)(
365 IMA_LNP_PROPERTIES
*pProps
368 typedef IMA_STATUS (* IMA_GetPnpPropertiesFn
)(
370 IMA_PNP_PROPERTIES
*pProps
373 typedef IMA_STATUS (* IMA_GetPnpStatisticsFn
)(
375 IMA_PNP_STATISTICS
*pStats
378 typedef IMA_STATUS (* IMA_GetConnectionPropertiesFn
)(
379 IMA_OID connectionId
,
380 IMA_CONNECTION_PROPERTIES
*pProps
383 typedef IMA_STATUS (* IMA_GetTargetPropertiesFn
)(
385 IMA_TARGET_PROPERTIES
*pProps
388 typedef IMA_STATUS (* IMA_GetSessionPropertiesFn
)(
390 IMA_SESSION_PROPERTIES
*pProps
393 typedef IMA_STATUS (* IMA_GetTargetErrorStatisticsFn
)(
395 IMA_TARGET_ERROR_STATISTICS
*pStats
398 typedef IMA_STATUS (* IMA_GetLuOidListFn
)(
400 IMA_OID_LIST
**ppList
403 typedef IMA_STATUS (* IMA_GetLuOidFn
)(
409 typedef IMA_STATUS (* IMA_GetLuPropertiesFn
)(
411 IMA_LU_PROPERTIES
*pProps
414 typedef IMA_STATUS (* IMA_GetStatisticsPropertiesFn
)(
416 IMA_STATISTICS_PROPERTIES
*pProps
419 typedef IMA_STATUS (* IMA_GetDeviceStatisticsFn
)(
421 IMA_DEVICE_STATISTICS
*pStats
424 typedef IMA_STATUS (* IMA_LuInquiryFn
)(
430 IMA_BYTE
*pOutputBuffer
,
431 IMA_UINT
*pOutputBufferLength
,
433 IMA_BYTE
*pSenseBuffer
,
434 IMA_UINT
*pSenseBufferLength
437 typedef IMA_STATUS (* IMA_LuReadCapacityFn
)(
440 IMA_BYTE
*pOutputBuffer
,
441 IMA_UINT
*pOutputBufferLength
,
443 IMA_BYTE
*pSenseBuffer
,
444 IMA_UINT
*pSenseBufferLength
447 typedef IMA_STATUS (* IMA_LuReportLunsFn
)(
449 IMA_BOOL sendToWellKnownLun
,
450 IMA_BYTE selectReport
,
452 IMA_BYTE
*pOutputBuffer
,
453 IMA_UINT
*pOutputBufferLength
,
455 IMA_BYTE
*pSenseBuffer
,
456 IMA_UINT
*pSenseBufferLength
459 typedef IMA_STATUS (* IMA_ExposeLuFn
)(
463 typedef IMA_STATUS (* IMA_UnexposeLuFn
)(
467 typedef IMA_STATUS (* IMA_GetPhbaStatusFn
)(
469 IMA_PHBA_STATUS
*pStatus
472 typedef IMA_STATUS (* IMA_RegisterForObjectVisibilityChangesFn
) (
473 IMA_OBJECT_VISIBILITY_FN pClientFn
476 typedef IMA_STATUS (* IMA_DeregisterForObjectVisibilityChangesFn
) (
477 IMA_OBJECT_VISIBILITY_FN pClientFn
480 typedef IMA_STATUS (* IMA_RegisterForObjectPropertyChangesFn
) (
481 IMA_OBJECT_PROPERTY_FN pClientFn
484 typedef IMA_STATUS (* IMA_DeregisterForObjectPropertyChangesFn
) (
485 IMA_OBJECT_PROPERTY_FN pClientFn
489 typedef IMA_STATUS (* IMA_GetAddressKeyPropertiesFn
)(
491 IMA_ADDRESS_KEY_PROPERTIES
**ppProps
494 typedef IMA_STATUS (* IMA_GetIpPropertiesFn
)(
496 IMA_IP_PROPERTIES
*pProps
499 typedef IMA_STATUS (* IMA_SetIpConfigMethodFn
)(
501 IMA_BOOL enableDhcpIpConfiguration
504 typedef IMA_STATUS (* IMA_SetSubnetMaskFn
)(
506 IMA_IP_ADDRESS subnetMask
509 typedef IMA_STATUS (* IMA_SetDnsServerAddressFn
)(
511 const IMA_IP_ADDRESS
*primaryDnsServerAddress
,
512 const IMA_IP_ADDRESS
*alternateDnsServerAddress
515 typedef IMA_STATUS (* IMA_SetDefaultGatewayFn
)(
517 IMA_IP_ADDRESS defaultGateway
520 typedef IMA_STATUS (* IMA_GetSupportedAuthMethodsFn
)(
522 IMA_BOOL getSettableMethods
,
523 IMA_UINT
*pMethodCount
,
524 IMA_AUTHMETHOD
*pMethodList
527 typedef IMA_STATUS (* IMA_GetInUseInitiatorAuthMethodsFn
)(
529 IMA_UINT
*pMethodCount
,
530 IMA_AUTHMETHOD
*pMethodList
533 typedef IMA_STATUS (* IMA_GetInitiatorAuthParmsFn
)(
535 IMA_AUTHMETHOD method
,
536 IMA_INITIATOR_AUTHPARMS
*pParms
539 typedef IMA_STATUS (* IMA_SetInitiatorAuthMethodsFn
)(
541 IMA_UINT methodCount
,
542 const IMA_AUTHMETHOD
*pMethodList
545 typedef IMA_STATUS (* IMA_SetInitiatorAuthParmsFn
)(
547 IMA_AUTHMETHOD method
,
548 const IMA_INITIATOR_AUTHPARMS
*pParms
551 typedef IMA_STATUS (* IMA_FreeMemoryFn
)(
555 typedef IMA_STATUS (* IMA_GetStaticDiscoveryTargetOidListFn
)(
557 IMA_OID_LIST
**ppList
560 typedef IMA_STATUS (* IMA_GetDiscoveryPropertiesFn
)(
562 IMA_DISCOVERY_PROPERTIES
*pProps
565 typedef IMA_STATUS (* IMA_AddDiscoveryAddressFn
)(
567 const IMA_TARGET_ADDRESS discoveryAddress
,
568 IMA_OID
*pDiscoveryAddressOid
571 typedef IMA_STATUS (* IMA_AddStaticDiscoveryTargetFn
)(
573 const IMA_STATIC_DISCOVERY_TARGET staticDiscoveryTarget
,
574 IMA_OID
*pStaticDiscoveryTargetOid
577 typedef IMA_STATUS (* IMA_RemoveStaticDiscoveryTargetFn
)(
581 typedef IMA_STATUS (* IMA_GetStaticDiscoveryTargetPropertiesFn
)(
582 IMA_OID staticDiscoveryTargetOid
,
583 IMA_STATIC_DISCOVERY_TARGET_PROPERTIES
*pProps
586 typedef IMA_STATUS (* IMA_GetDiscoveryAddressOidListFn
) (
588 IMA_OID_LIST
**ppList
591 typedef IMA_STATUS (* IMA_GetSessionOidListFn
) (
593 IMA_OID_LIST
**ppList
596 typedef IMA_STATUS (* IMA_GetConnectionOidListFn
) (
598 IMA_OID_LIST
**ppList
601 typedef IMA_STATUS (* IMA_GetDiscoveryAddressPropertiesFn
) (
602 IMA_OID discoveryAddressOid
,
603 IMA_DISCOVERY_ADDRESS_PROPERTIES
*pProps
606 typedef IMA_STATUS (* IMA_RemoveDiscoveryAddressFn
) (
607 IMA_OID discoveryAddressOid
610 typedef IMA_STATUS (* IMA_GetIpsecPropertiesFn
) (
612 IMA_IPSEC_PROPERTIES
*pProps
615 typedef IMA_STATUS (* IMA_GetAddressKeysFn
) (
617 IMA_ADDRESS_KEYS
**ppKeys
620 typedef IMA_STATUS (* QIMA_SetUpdateIntervalFn
)(
625 typedef IMA_STATUS (* IMA_CommitHbaParametersFn
)(
626 IMA_OID oid
, IMA_COMMIT_LEVEL commitLevel
629 typedef IMA_STATUS (* SUN_IMA_GetTunablePropertiesFn
) (
631 ISCSI_TUNABLE_PARAM
*param
634 typedef IMA_STATUS (* SUN_IMA_SetTunablePropertiesFn
) (
636 ISCSI_TUNABLE_PARAM
*param