1 /* 2 * CDDL HEADER START 3 * 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. 7 * 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. 12 * 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] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 /* 27 * 28 * Description 29 * imaPlugin.h: interface for the iScsiPlugin class. 30 * 31 * License: 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 35 * 36 * /http://www.snia.org/English/Resources/Code/OpenSource.html 37 * 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 41 * under the License. 42 * 43 * The Original Code is SNIA HBA API and IMA general header file 44 * 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 48 * 49 * Contributor(s): 50 * Jeff Ding, Adaptec, Inc. (jding@corp.adaptec.com) 51 * 52 ******************************************************************************* 53 * 54 * Changes: 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 ******************************************************************************/ 60 61 #ifdef __cplusplus 62 extern "C" { 63 #endif 64 65 #ifndef IMAPLUGIN_H 66 #define IMAPLUGIN_H 67 68 typedef IMA_STATUS (* Initialize)( 69 IMA_UINT32 pluginOid 70 ); 71 72 typedef void (* TerminateFn)(); 73 74 75 typedef IMA_STATUS (* IMA_GetPluginPropertiesFn)( 76 IMA_OID pluginOid, 77 IMA_PLUGIN_PROPERTIES *pProps 78 ); 79 80 81 typedef IMA_STATUS (* IMA_GetSharedNodeOidFn)( 82 IMA_OID *pSharedNodeId 83 ); 84 85 86 typedef IMA_STATUS (* IMA_GetNodePropertiesFn)( 87 IMA_OID nodeOid, 88 IMA_NODE_PROPERTIES *pProps 89 ); 90 91 92 typedef IMA_STATUS (* IMA_SetNodeNameFn)( 93 IMA_OID nodeOid, 94 const IMA_NODE_NAME newName 95 ); 96 97 98 typedef IMA_STATUS (* IMA_GenerateNodeNameFn)( 99 IMA_NODE_NAME generatedname 100 ); 101 102 103 typedef IMA_STATUS (* IMA_SetNodeAliasFn)( 104 IMA_OID nodeOid, 105 const IMA_NODE_ALIAS newAlias 106 ); 107 108 109 typedef IMA_STATUS (* IMA_GetLhbaOidListFn)( 110 IMA_OID_LIST **ppList 111 ); 112 113 typedef IMA_STATUS (* IMA_GetLhbaPropertiesFn)( 114 IMA_OID lhbaId, 115 IMA_LHBA_PROPERTIES *pProps 116 ); 117 118 119 typedef IMA_STATUS (* IMA_GetPhbaOidListFn)( 120 IMA_OID_LIST **ppList 121 ); 122 123 124 typedef IMA_STATUS (* IMA_GetPhbaPropertiesFn)( 125 IMA_OID phbaId, 126 IMA_PHBA_PROPERTIES *pProps 127 ); 128 129 130 typedef IMA_STATUS (* IMA_GetNonSharedNodeOidListFn)( 131 IMA_OID_LIST **ppList 132 ); 133 134 135 typedef IMA_STATUS (* IMA_GetFirstBurstLengthPropertiesFn)( 136 IMA_OID Oid, 137 IMA_MIN_MAX_VALUE *pProps 138 ); 139 140 141 typedef IMA_STATUS (* IMA_GetMaxBurstLengthPropertiesFn)( 142 IMA_OID Oid, 143 IMA_MIN_MAX_VALUE *pProps 144 ); 145 146 147 typedef IMA_STATUS (* IMA_GetMaxRecvDataSegmentLengthPropertiesFn)( 148 IMA_OID Oid, 149 IMA_MIN_MAX_VALUE *pProps 150 ); 151 152 153 /*---------------------------------------------*/ 154 typedef IMA_STATUS (* IMA_PluginIOCtlFn)( 155 IMA_OID pluginOid, 156 IMA_UINT command, 157 const void *pInputBuffer, 158 IMA_UINT inputBufferLength, 159 void *pOutputBuffer, 160 IMA_UINT *pOutputBufferLength 161 ); 162 163 164 typedef IMA_STATUS (* IMA_GetNetworkPortalOidListFn)( 165 IMA_OID lhbaId, 166 IMA_OID_LIST **ppList 167 ); 168 169 170 typedef IMA_STATUS (* IMA_SetFirstBurstLengthFn)( 171 IMA_OID lhbaId, 172 IMA_UINT firstBurstLength 173 ); 174 175 typedef IMA_STATUS (* IMA_SetMaxBurstLengthFn)( 176 IMA_OID lhbaId, 177 IMA_UINT maxBurstLength 178 ); 179 180 typedef IMA_STATUS (* IMA_SetMaxRecvDataSegmentLengthFn)( 181 IMA_OID lhbaId, 182 IMA_UINT maxRecvDataSegmentLength 183 ); 184 185 typedef IMA_STATUS (* IMA_GetMaxConnectionsPropertiesFn)( 186 IMA_OID Oid, 187 IMA_MIN_MAX_VALUE *pProps 188 ); 189 190 typedef IMA_STATUS (* IMA_SetMaxConnectionsFn)( 191 IMA_OID lhbaId, 192 IMA_UINT maxConnections 193 ); 194 195 typedef IMA_STATUS (* IMA_GetDefaultTime2RetainPropertiesFn)( 196 IMA_OID lhbaId, 197 IMA_MIN_MAX_VALUE *pProps 198 ); 199 200 typedef IMA_STATUS (* IMA_SetDefaultTime2RetainFn)( 201 IMA_OID lhbaId, 202 IMA_UINT defaultTime2Retain 203 ); 204 205 typedef IMA_STATUS (* IMA_GetDefaultTime2WaitPropertiesFn)( 206 IMA_OID lhbaId, 207 IMA_MIN_MAX_VALUE *pProps 208 ); 209 210 typedef IMA_STATUS (* IMA_SetDefaultTime2WaitFn)( 211 IMA_OID lhbaId, 212 IMA_UINT defaultTime2Wait 213 ); 214 215 typedef IMA_STATUS (* IMA_GetMaxOutstandingR2TPropertiesFn)( 216 IMA_OID Oid, 217 IMA_MIN_MAX_VALUE *pProps 218 ); 219 220 typedef IMA_STATUS (* IMA_SetMaxOutstandingR2TFn)( 221 IMA_OID lhbaId, 222 IMA_UINT maxOutstandingR2T 223 ); 224 225 typedef IMA_STATUS (* IMA_GetErrorRecoveryLevelPropertiesFn)( 226 IMA_OID Oid, 227 IMA_MIN_MAX_VALUE *pProps 228 ); 229 230 typedef IMA_STATUS (* IMA_SetErrorRecoveryLevelFn)( 231 IMA_OID Oid, 232 IMA_UINT errorRecoveryLevel 233 ); 234 235 typedef IMA_STATUS (* IMA_GetInitialR2TPropertiesFn)( 236 IMA_OID Oid, 237 IMA_BOOL_VALUE *pProps 238 ); 239 240 typedef IMA_STATUS (* IMA_SetInitialR2TFn)( 241 IMA_OID Oid, 242 IMA_BOOL initialR2T 243 ); 244 245 typedef IMA_STATUS (* IMA_GetImmediateDataPropertiesFn)( 246 IMA_OID Oid, 247 IMA_BOOL_VALUE *pProps 248 ); 249 250 typedef IMA_STATUS (* IMA_SetImmediateDataFn)( 251 IMA_OID Oid, 252 IMA_BOOL immediateData 253 ); 254 255 typedef IMA_STATUS (* IMA_GetDataPduInOrderPropertiesFn)( 256 IMA_OID Oid, 257 IMA_BOOL_VALUE *pProps 258 ); 259 260 typedef IMA_STATUS (* IMA_SetDataPduInOrderFn)( 261 IMA_OID Oid, 262 IMA_BOOL dataPduInOrder 263 ); 264 265 typedef IMA_STATUS (* IMA_GetDataSequenceInOrderPropertiesFn)( 266 IMA_OID Oid, 267 IMA_BOOL_VALUE *pProps 268 ); 269 270 typedef IMA_STATUS (* IMA_SetDataSequenceInOrderFn)( 271 IMA_OID Oid, 272 IMA_BOOL dataSequenceInOrder 273 ); 274 275 typedef IMA_STATUS (* IMA_SetStatisticsCollectionFn)( 276 IMA_OID Oid, 277 IMA_BOOL enableStatisticsCollection 278 ); 279 280 typedef IMA_STATUS (* IMA_GetNetworkPortStatusFn)( 281 IMA_OID portOid, 282 IMA_NETWORK_PORT_STATUS *pStatus 283 ); 284 285 typedef IMA_STATUS (* IMA_GetTargetOidListFn)( 286 IMA_OID Oid, 287 IMA_OID_LIST **ppList 288 ); 289 290 typedef IMA_STATUS (* IMA_RemoveStaleDataFn)( 291 IMA_OID lhbaId 292 ); 293 294 typedef IMA_STATUS (* IMA_SetIsnsDiscoveryFn)( 295 IMA_OID phbaId, 296 IMA_BOOL enableIsnsDiscovery, 297 IMA_ISNS_DISCOVERY_METHOD discoveryMethod, 298 const IMA_HOST_ID *iSnsHost 299 ); 300 301 typedef IMA_STATUS (* IMA_SetSlpDiscoveryFn)( 302 IMA_OID phbaId, 303 IMA_BOOL enableSlpDiscovery 304 ); 305 306 typedef IMA_STATUS (* IMA_SetStaticDiscoveryFn)( 307 IMA_OID phbaId, 308 IMA_BOOL enableStaticDiscovery 309 ); 310 311 typedef IMA_STATUS (* IMA_SetSendTargetsDiscoveryFn)( 312 IMA_OID phbaId, 313 IMA_BOOL enableSendTargetsDiscovery 314 ); 315 316 typedef IMA_STATUS (* IMA_AddPhbaStaticDiscoveryTargetFn)( 317 IMA_OID phbaOid, 318 const IMA_TARGET_ADDRESS targetAddress, 319 IMA_OID_LIST **pTargetOidList 320 ); 321 322 typedef IMA_STATUS (* IMA_RemovePhbaStaticDiscoveryTargetFn)( 323 IMA_OID phbaOid, 324 IMA_OID targetOid 325 ); 326 327 typedef IMA_STATUS (* IMA_GetPnpOidListFn)( 328 IMA_OID Oid, 329 IMA_OID_LIST **ppList 330 ); 331 332 typedef IMA_STATUS (* IMA_GetPhbaDownloadPropertiesFn)( 333 IMA_OID phbaId, 334 IMA_PHBA_DOWNLOAD_PROPERTIES *pProps 335 ); 336 337 typedef IMA_STATUS (* IMA_IsPhbaDownloadFileFn)( 338 IMA_OID phbaId, 339 const IMA_WCHAR *pFileName, 340 IMA_PHBA_DOWNLOAD_IMAGE_PROPERTIES *pProps 341 ); 342 343 typedef IMA_STATUS (* IMA_PhbaDownloadFn)( 344 IMA_OID phbaId, 345 IMA_PHBA_DOWNLOAD_IMAGE_TYPE imageType, 346 const IMA_WCHAR *pFileName 347 ); 348 349 typedef IMA_STATUS (* IMA_GetNetworkPortalPropertiesFn)( 350 IMA_OID networkPortalId, 351 IMA_NETWORK_PORTAL_PROPERTIES *pProps 352 ); 353 354 typedef IMA_STATUS (* IMA_SetNetworkPortalIpAddressFn)( 355 IMA_OID networkPortalId, 356 const IMA_IP_ADDRESS NewIpAddress 357 ); 358 359 typedef IMA_STATUS (* IMA_GetLnpOidListFn)( 360 IMA_OID_LIST **ppList 361 ); 362 363 typedef IMA_STATUS (* IMA_GetLnpPropertiesFn)( 364 IMA_OID lnpId, 365 IMA_LNP_PROPERTIES *pProps 366 ); 367 368 typedef IMA_STATUS (* IMA_GetPnpPropertiesFn)( 369 IMA_OID pnpId, 370 IMA_PNP_PROPERTIES *pProps 371 ); 372 373 typedef IMA_STATUS (* IMA_GetPnpStatisticsFn)( 374 IMA_OID pnpId, 375 IMA_PNP_STATISTICS *pStats 376 ); 377 378 typedef IMA_STATUS (* IMA_GetConnectionPropertiesFn)( 379 IMA_OID connectionId, 380 IMA_CONNECTION_PROPERTIES *pProps 381 ); 382 383 typedef IMA_STATUS (* IMA_GetTargetPropertiesFn)( 384 IMA_OID targetId, 385 IMA_TARGET_PROPERTIES *pProps 386 ); 387 388 typedef IMA_STATUS (* IMA_GetSessionPropertiesFn)( 389 IMA_OID sessionId, 390 IMA_SESSION_PROPERTIES *pProps 391 ); 392 393 typedef IMA_STATUS (* IMA_GetTargetErrorStatisticsFn)( 394 IMA_OID targetId, 395 IMA_TARGET_ERROR_STATISTICS *pStats 396 ); 397 398 typedef IMA_STATUS (* IMA_GetLuOidListFn)( 399 IMA_OID Oid, 400 IMA_OID_LIST **ppList 401 ); 402 403 typedef IMA_STATUS (* IMA_GetLuOidFn)( 404 IMA_OID targetId, 405 IMA_UINT64 lun, 406 IMA_OID *pluId 407 ); 408 409 typedef IMA_STATUS (* IMA_GetLuPropertiesFn)( 410 IMA_OID luId, 411 IMA_LU_PROPERTIES *pProps 412 ); 413 414 typedef IMA_STATUS (* IMA_GetStatisticsPropertiesFn)( 415 IMA_OID oid, 416 IMA_STATISTICS_PROPERTIES *pProps 417 ); 418 419 typedef IMA_STATUS (* IMA_GetDeviceStatisticsFn)( 420 IMA_OID luId, 421 IMA_DEVICE_STATISTICS *pStats 422 ); 423 424 typedef IMA_STATUS (* IMA_LuInquiryFn)( 425 IMA_OID deviceId, 426 IMA_BOOL evpd, 427 IMA_BOOL cmddt, 428 IMA_BYTE pageCode, 429 430 IMA_BYTE *pOutputBuffer, 431 IMA_UINT *pOutputBufferLength, 432 433 IMA_BYTE *pSenseBuffer, 434 IMA_UINT *pSenseBufferLength 435 ); 436 437 typedef IMA_STATUS (* IMA_LuReadCapacityFn)( 438 IMA_OID deviceId, 439 IMA_UINT cdbLength, 440 IMA_BYTE *pOutputBuffer, 441 IMA_UINT *pOutputBufferLength, 442 443 IMA_BYTE *pSenseBuffer, 444 IMA_UINT *pSenseBufferLength 445 ); 446 447 typedef IMA_STATUS (* IMA_LuReportLunsFn)( 448 IMA_OID deviceId, 449 IMA_BOOL sendToWellKnownLun, 450 IMA_BYTE selectReport, 451 452 IMA_BYTE *pOutputBuffer, 453 IMA_UINT *pOutputBufferLength, 454 455 IMA_BYTE *pSenseBuffer, 456 IMA_UINT *pSenseBufferLength 457 ); 458 459 typedef IMA_STATUS (* IMA_ExposeLuFn)( 460 IMA_OID luId 461 ); 462 463 typedef IMA_STATUS (* IMA_UnexposeLuFn)( 464 IMA_OID luId 465 ); 466 467 typedef IMA_STATUS (* IMA_GetPhbaStatusFn)( 468 IMA_OID hbaId, 469 IMA_PHBA_STATUS *pStatus 470 ); 471 472 typedef IMA_STATUS (* IMA_RegisterForObjectVisibilityChangesFn) ( 473 IMA_OBJECT_VISIBILITY_FN pClientFn 474 ); 475 476 typedef IMA_STATUS (* IMA_DeregisterForObjectVisibilityChangesFn) ( 477 IMA_OBJECT_VISIBILITY_FN pClientFn 478 ); 479 480 typedef IMA_STATUS (* IMA_RegisterForObjectPropertyChangesFn) ( 481 IMA_OBJECT_PROPERTY_FN pClientFn 482 ); 483 484 typedef IMA_STATUS (* IMA_DeregisterForObjectPropertyChangesFn) ( 485 IMA_OBJECT_PROPERTY_FN pClientFn 486 ); 487 488 489 typedef IMA_STATUS (* IMA_GetAddressKeyPropertiesFn)( 490 IMA_OID targetOid, 491 IMA_ADDRESS_KEY_PROPERTIES **ppProps 492 ); 493 494 typedef IMA_STATUS (* IMA_GetIpPropertiesFn)( 495 IMA_OID oid, 496 IMA_IP_PROPERTIES *pProps 497 ); 498 499 typedef IMA_STATUS (* IMA_SetIpConfigMethodFn)( 500 IMA_OID oid, 501 IMA_BOOL enableDhcpIpConfiguration 502 ); 503 504 typedef IMA_STATUS (* IMA_SetSubnetMaskFn)( 505 IMA_OID oid, 506 IMA_IP_ADDRESS subnetMask 507 ); 508 509 typedef IMA_STATUS (* IMA_SetDnsServerAddressFn)( 510 IMA_OID oid, 511 const IMA_IP_ADDRESS *primaryDnsServerAddress, 512 const IMA_IP_ADDRESS *alternateDnsServerAddress 513 ); 514 515 typedef IMA_STATUS (* IMA_SetDefaultGatewayFn)( 516 IMA_OID oid, 517 IMA_IP_ADDRESS defaultGateway 518 ); 519 520 typedef IMA_STATUS (* IMA_GetSupportedAuthMethodsFn)( 521 IMA_OID lhbaOid, 522 IMA_BOOL getSettableMethods, 523 IMA_UINT *pMethodCount, 524 IMA_AUTHMETHOD *pMethodList 525 ); 526 527 typedef IMA_STATUS (* IMA_GetInUseInitiatorAuthMethodsFn)( 528 IMA_OID lhbaOid, 529 IMA_UINT *pMethodCount, 530 IMA_AUTHMETHOD *pMethodList 531 ); 532 533 typedef IMA_STATUS (* IMA_GetInitiatorAuthParmsFn)( 534 IMA_OID lhbaOid, 535 IMA_AUTHMETHOD method, 536 IMA_INITIATOR_AUTHPARMS *pParms 537 ); 538 539 typedef IMA_STATUS (* IMA_SetInitiatorAuthMethodsFn)( 540 IMA_OID lhbaOid, 541 IMA_UINT methodCount, 542 const IMA_AUTHMETHOD *pMethodList 543 ); 544 545 typedef IMA_STATUS (* IMA_SetInitiatorAuthParmsFn)( 546 IMA_OID lhbaOid, 547 IMA_AUTHMETHOD method, 548 const IMA_INITIATOR_AUTHPARMS *pParms 549 ); 550 551 typedef IMA_STATUS (* IMA_FreeMemoryFn)( 552 void *pMemory 553 ); 554 555 typedef IMA_STATUS (* IMA_GetStaticDiscoveryTargetOidListFn)( 556 IMA_OID oid, 557 IMA_OID_LIST **ppList 558 ); 559 560 typedef IMA_STATUS (* IMA_GetDiscoveryPropertiesFn)( 561 IMA_OID oid, 562 IMA_DISCOVERY_PROPERTIES *pProps 563 ); 564 565 typedef IMA_STATUS (* IMA_AddDiscoveryAddressFn)( 566 IMA_OID oid, 567 const IMA_TARGET_ADDRESS discoveryAddress, 568 IMA_OID *pDiscoveryAddressOid 569 ); 570 571 typedef IMA_STATUS (* IMA_AddStaticDiscoveryTargetFn)( 572 IMA_OID oid, 573 const IMA_STATIC_DISCOVERY_TARGET staticDiscoveryTarget, 574 IMA_OID *pStaticDiscoveryTargetOid 575 ); 576 577 typedef IMA_STATUS (* IMA_RemoveStaticDiscoveryTargetFn)( 578 IMA_OID oid 579 ); 580 581 typedef IMA_STATUS (* IMA_GetStaticDiscoveryTargetPropertiesFn)( 582 IMA_OID staticDiscoveryTargetOid, 583 IMA_STATIC_DISCOVERY_TARGET_PROPERTIES *pProps 584 ); 585 586 typedef IMA_STATUS (* IMA_GetDiscoveryAddressOidListFn) ( 587 IMA_OID Oid, 588 IMA_OID_LIST **ppList 589 ); 590 591 typedef IMA_STATUS (* IMA_GetSessionOidListFn) ( 592 IMA_OID Oid, 593 IMA_OID_LIST **ppList 594 ); 595 596 typedef IMA_STATUS (* IMA_GetConnectionOidListFn) ( 597 IMA_OID Oid, 598 IMA_OID_LIST **ppList 599 ); 600 601 typedef IMA_STATUS (* IMA_GetDiscoveryAddressPropertiesFn) ( 602 IMA_OID discoveryAddressOid, 603 IMA_DISCOVERY_ADDRESS_PROPERTIES *pProps 604 ); 605 606 typedef IMA_STATUS (* IMA_RemoveDiscoveryAddressFn) ( 607 IMA_OID discoveryAddressOid 608 ); 609 610 typedef IMA_STATUS (* IMA_GetIpsecPropertiesFn) ( 611 IMA_OID oid, 612 IMA_IPSEC_PROPERTIES *pProps 613 ); 614 615 typedef IMA_STATUS (* IMA_GetAddressKeysFn) ( 616 IMA_OID targetOid, 617 IMA_ADDRESS_KEYS **ppKeys 618 ); 619 620 typedef IMA_STATUS (* QIMA_SetUpdateIntervalFn)( 621 IMA_OID pluginOid, 622 time_t interval 623 ); 624 625 typedef IMA_STATUS (* IMA_CommitHbaParametersFn)( 626 IMA_OID oid, IMA_COMMIT_LEVEL commitLevel 627 ); 628 629 typedef IMA_STATUS (* SUN_IMA_GetTunablePropertiesFn) ( 630 IMA_OID oid, 631 ISCSI_TUNABLE_PARAM *param 632 ); 633 634 typedef IMA_STATUS (* SUN_IMA_SetTunablePropertiesFn) ( 635 IMA_OID oid, 636 ISCSI_TUNABLE_PARAM *param 637 ); 638 639 #endif 640 641 #ifdef __cplusplus 642 } 643 #endif 644 645