xref: /titanic_52/usr/src/lib/libima/common/ima.h (revision 69112edd987c28fa551d4f8d9362a84a45365f17)
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  *  Ima.h - general header file for client
30  *       and library developers
31  *
32  * License:
33  *  The contents of this file are subject to the SNIA Public License
34  *  Version 1.0 (the "License"); you may not use this file except in
35  *  compliance with the License. You may obtain a copy of the License at
36  *
37  *  /http://www.snia.org/English/Resources/Code/OpenSource.html
38  *
39  *  Software distributed under the License is distributed on an "AS IS"
40  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
41  *  the License for the specific language governing rights and limitations
42  *  under the License.
43  *
44  * The Original Code is  SNIA HBA API and IMA general header file
45  *
46  * The Initial Developer of the Original Code is:
47  *      Benjamin F. Kuo, Troika Networks, Inc. (benk@troikanetworks.com)
48  *      David Dillard       VERITAS Software        david.dillard@veritas.com
49  *
50  * Contributor(s):
51  *  Jeff Ding, Adaptec, Inc. (jding@corp.adaptec.com)
52  *  Dave Wysochanski, Network Appliance, Inc. (davidw@netapp.com)
53  *
54  ******************************************************************************
55  *
56  *   Changes:
57  *  09/24/2003 Initial Draft
58  *  (for other changes... see the CVS logs)
59  *  12/15/2003 corrected the defined parameter in IMA_SetPhbaIsnsDiscovery().
60  *             lower case the computer name as iscsi name in
61  *             IMA_GenerateNodeName().
62  *  03/01/2004 Brought up to date with respect to IMA v1.0.1; made formatting
63  *             changes - lines to 80 cols - for readability.
64  *
65  *  01/21/2005 Updated to support IMA 1.1.3.
66  *****************************************************************************/
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 #ifndef IMA_H
72 #define IMA_H
73 
74 #include <time.h>
75 #include <wchar.h>
76 
77 
78 /* Library version string */
79 #define HBA_LIBVERSION 2
80 
81 #define	IMA_MAX_CALLBACK_PER_PLUGIN	64
82 #define IMA_MAX_NUM_PLUGINS		32
83 
84 /* DLL imports for WIN32 operation */
85 #ifdef WIN32
86 #ifdef IMA_EXPORTS
87 #define IMA_API __declspec(dllexport)
88 #else
89 #define IMA_API __declspec(dllimport)
90 #endif
91 #else
92 #define IMA_API
93 #endif
94 
95 /* OS specific definitions */
96 
97 #ifdef WIN32
98 typedef unsigned char   IMA_UINT8;  // Unsigned  8 bits
99 typedef char            IMA_INT8;   // Signed    8 bits
100 typedef unsigned short  IMA_UINT16; // Unsigned 16 bits
101 typedef short           IMA_INT16;  // Signed   16 bits
102 typedef unsigned int    IMA_UINT32; // Unsigned 32 bits
103 typedef int             IMA_INT32;  // Signed   32 bits
104 typedef void*           IMA_PVOID;  // Pointer  to void
105 typedef IMA_UINT32      IMA_VOID32; // Opaque   32 bits
106 
107 
108 /* Don't confuse, _WIN32 with WIN32... OK, how do you accompish that */
109 #ifdef _WIN32
110 typedef __int64             IMA_INT64;
111 typedef unsigned __int64    IMA_UINT64;
112 #else
113 typedef struct {
114     TN_UINT32   lo_val;
115     TN_UINT32   hi_val;
116 } IMA_INT64;
117 
118 typedef struct {
119     TN_UINT32   lo_val;
120     TN_UINT32   hi_val;
121 } IMA_UINT64;
122 #endif  /*  #ifdef _WIN32   */
123 
124 
125 #else
126 
127 /* Note this section needs to be cleaned up for various Unix platforms */
128 typedef unsigned char   IMA_UINT8;  /* Unsigned  8 bits */
129 typedef char            IMA_INT8;   /* Signed    8 bits */
130 typedef unsigned short  IMA_UINT16; /* Unsigned 16 bits */
131 typedef short           IMA_INT16;  /* Signed   16 bits */
132 typedef unsigned int    IMA_UINT32; /* Unsigned 32 bits */
133 typedef int             IMA_INT32;  /* Signed   32 bits */
134 typedef void*           IMA_PVOID;  /* Pointer  to void */
135 typedef IMA_UINT32      IMA_VOID32; /* Opaque   32 bits */
136 typedef long long       IMA_INT64;
137 typedef long long       IMA_UINT64;
138 
139 #endif  /*  #ifdef WIN32 */
140 
141 
142 
143 /**
144 *******************************************************************************
145 *
146 * Generic IMA Constant Definitions
147 *
148 *******************************************************************************
149 */
150 #define RL_LIBRARY_SEQNUM           0
151 #define RL_SHARED_NODE_SEQNUM       0
152 
153 /**
154 * Value which can be assigned to an IMA_BOOL and or an IMA_XBOOL.
155 */
156 #define IMA_TRUE        1
157 
158 /**
159 * Value which can be assigned to an IMA_BOOL and or an IMA_XBOOL.
160 */
161 #define IMA_FALSE       0
162 
163 /**
164 * Value which can be assigned to an IMA_XBOOL.
165 */
166 #define IMA_UNKNOWN     0xFFFFFFFF
167 
168 
169 
170 /**
171 *******************************************************************************
172 *
173 * Base IMA Type Definitions
174 *
175 * @note Types that have a specific size must be defined ImaOsTypes.h which is
176 *       an OS specific include file which is included by this file.
177 *
178 *******************************************************************************
179 */
180 
181 /**
182 * A character.
183 */
184 typedef char IMA_CHAR;
185 
186 /**
187 * A wide character.
188 */
189 typedef wchar_t IMA_WCHAR;
190 
191 /**
192 * An integer.  Spec states this is 32 bits on 32-bit systems, and 64-bit
193 * on 64-bit systems.
194 */
195 typedef unsigned long IMA_UINT;
196 
197 /**
198 * A boolean.
199 */
200 typedef IMA_UINT32 IMA_BOOL;
201 
202 /**
203 * An extended boolean: can have the values @ref IMA_TRUE, @ref IMA_FALSE, and
204 * @ref IMA_UNKNOWN.
205 */
206 typedef IMA_UINT32 IMA_XBOOL;
207 
208 /**
209 * A date and time.
210 */
211 typedef struct tm IMA_DATETIME;
212 
213 typedef unsigned char IMA_BYTE;
214 
215 /**
216 *******************************************************************************
217 *
218 * Constants and macros declarations related to IMA_STATUS
219 *
220 *******************************************************************************
221 */
222 #ifdef SOLARIS
223 typedef IMA_UINT IMA_STATUS;
224 
225 #define	IMA_STATUS_SUCCESS		0x00000000
226 #define	IMA_STATUS_ERROR		0x80000000
227 
228 #define	IMA_SUCCESS(status) (((IMA_STATUS)(status) & \
229 	    (IMA_STATUS)IMA_STATUS_ERROR) == 0 ? IMA_TRUE : IMA_FALSE)
230 #define	IMA_ERROR(status)   (((IMA_STATUS)(status) & \
231 	    (IMA_STATUS)IMA_STATUS_ERROR) == 0x8000000 ? IMA_TRUE : IMA_FALSE)
232 
233 #define	MAKE_IMA_STATUS(x)	((IMA_STATUS)(x))
234 #define	MAKE_IMA_ERROR(x)	((IMA_STATUS)(IMA_STATUS_ERROR | (x)))
235 #define	GET_SYSTEM_ERROR(x)	(((IMA_STATUS)(x) & 0x0000FFFF))
236 
237 #define	IMA_STATUS_REBOOT_NECESSARY		MAKE_IMA_STATUS(0x01)
238 #define	IMA_STATUS_INCONSISTENT_NODE_PROPERTIES	MAKE_IMA_STATUS(0x02)
239 #define	IMA_STATUS_SCSI_STATUS_CONDITION_MET	MAKE_IMA_STATUS(0x100)
240 
241 #define	IMA_ERROR_NOT_SUPPORTED			MAKE_IMA_ERROR(0x01)
242 #define	IMA_ERROR_INSUFFICIENT_MEMORY		MAKE_IMA_ERROR(0x02)
243 #define	IMA_ERROR_LAST_PRIMARY_DISCOVERY_METHOD	MAKE_IMA_ERROR(0x03)
244 #define	IMA_ERROR_UNEXPECTED_OS_ERROR		MAKE_IMA_ERROR(0x04)
245 #define	IMA_ERROR_SYNC_TIMEOUT			MAKE_IMA_ERROR(0x05)
246 #define	IMA_ERROR_LU_EXPOSED			MAKE_IMA_ERROR(0x06)
247 #define	IMA_ERROR_LU_NOT_EXPOSED		MAKE_IMA_ERROR(0x07)
248 #define	IMA_ERROR_LU_IN_USE			MAKE_IMA_ERROR(0x08)
249 #define	IMA_ERROR_TARGET_TIMEOUT		MAKE_IMA_ERROR(0x09)
250 #define	IMA_ERROR_LOGIN_REJECTED		MAKE_IMA_ERROR(0x0A)
251 #define	IMA_ERROR_STATS_COLLECTION_NOT_ENABLED	MAKE_IMA_ERROR(0x0B)
252 #define	IMA_ERROR_SCSI_STATUS_CHECK_CONDITION	MAKE_IMA_ERROR(0x100)
253 #define	IMA_ERROR_SCSI_STATUS_BUSY		MAKE_IMA_ERROR(0x101)
254 #define	IMA_ERROR_SCSI_STATUS_RESERVATION_CONFLICT  	MAKE_IMA_ERROR(0x102)
255 #define	IMA_ERROR_SCSI_STATUS_TASK_SET_FULL	MAKE_IMA_ERROR(0x103)
256 #define	IMA_ERROR_SCSI_STATUS_ACA_ACTIVE	MAKE_IMA_ERROR(0x104)
257 #define	IMA_ERROR_SCSI_STATUS_TASK_ABORTED	MAKE_IMA_ERROR(0x105)
258 #define	IMA_ERROR_INVALID_PARAMETER		MAKE_IMA_ERROR(0x40000000)
259 #define	IMA_ERROR_INVALID_OBJECT_TYPE		MAKE_IMA_ERROR(0x40000001)
260 #define	IMA_ERROR_INCORRECT_OBJECT_TYPE		MAKE_IMA_ERROR(0x40000002)
261 #define	IMA_ERROR_OBJECT_NOT_FOUND		MAKE_IMA_ERROR(0x40000003)
262 #define	IMA_ERROR_NAME_TOO_LONG			MAKE_IMA_ERROR(0x40000004)
263 #define	IMA_ERROR_UNKNOWN_ERROR			MAKE_IMA_ERROR(0x0fffffff)
264 
265 #else
266 
267 typedef enum {
268     IMA_STATUS_SUCCESS                      = 0x00000000,
269     IMA_STATUS_REBOOT_NECESSARY             = 0x00000001,
270     IMA_STATUS_INCONSISTENT_NODE_PROPERTIES = 0x00000002,
271     IMA_STATUS_SCSI_STATUS_CONDITION_MET    = 0x00000100,
272 
273     IMA_STATUS_ERROR                        = 0x80000000,
274     IMA_ERROR_NOT_SUPPORTED                 = 0x80000001,
275     IMA_ERROR_INSUFFICIENT_MEMORY           = 0x80000002,
276     IMA_ERROR_LAST_PRIMARY_DISCOVERY_METHOD = 0x80000003,
277     IMA_ERROR_UNEXPECTED_OS_ERROR           = 0x80000004,
278     IMA_ERROR_SYNC_TIMEOUT                  = 0x80000005,
279     IMA_ERROR_LU_EXPOSED                    = 0x80000006,
280     IMA_ERROR_LU_NOT_EXPOSED                = 0x80000007,
281     IMA_ERROR_LU_IN_USE                     = 0x80000008,
282     IMA_ERROR_TARGET_TIMEOUT                = 0x80000009,
283     IMA_ERROR_LOGIN_REJECTED                = 0x8000000A,
284     IMA_ERROR_STATS_COLLECTION_NOT_ENABLED  = 0x8000000B,
285     IMA_ERROR_SCSI_STATUS_CHECK_CONDITION      = 0x80000100,
286     IMA_ERROR_SCSI_STATUS_BUSY                 = 0x80000101,
287     IMA_ERROR_SCSI_STATUS_RESERVATION_CONFLICT = 0x80000102,
288     IMA_ERROR_SCSI_STATUS_TASK_SET_FULL        = 0x80000103,
289     IMA_ERROR_SCSI_STATUS_ACA_ACTIVE           = 0x80000104,
290     IMA_ERROR_SCSI_STATUS_TASK_ABORTED         = 0x80000105,
291     IMA_ERROR_INVALID_PARAMETER             = 0xC0000000,
292     IMA_ERROR_INVALID_OBJECT_TYPE           = 0xC0000001,
293     IMA_ERROR_INCORRECT_OBJECT_TYPE         = 0xC0000002,
294     IMA_ERROR_OBJECT_NOT_FOUND              = 0xC0000003,
295     IMA_ERROR_NAME_TOO_LONG                 = 0xC0000004,
296     IMA_ERROR_UNKNOWN_ERROR                 = 0x8FFFFFFF
297 } IMA_STATUS;
298 
299 /*
300 #define IMA_SUCCESS(status)     ( (IMA_UINT32)(status) & \
301                                   (IMA_UINT32)IMA_STATUS_ERROR == 0 ? \
302                                   IMA_TRUE : IMA_FALSE )
303 #define IMA_ERROR(status)       ( (IMA_UINT32)(status) & \
304                                   (IMA_UINT32)IMA_STATUS_ERROR == 0x8000000 ? \
305                                   IMA_TRUE : IMA_FALSE )
306 */
307 
308 #define IMA_SUCCESS(status)							!((status) & IMA_STATUS_ERROR)
309 #define IMA_ERROR(status)							((status) & IMA_STATUS_ERROR)
310 
311 #endif
312 
313 /**
314 *******************************************************************************
315 *
316 * Declaration of the IMA_OBJECT_TYPE enumeration
317 *
318 *******************************************************************************
319 */
320 typedef enum
321 {
322     IMA_OBJECT_TYPE_UNKNOWN =   0,
323     IMA_OBJECT_TYPE_PLUGIN  =   1,
324     IMA_OBJECT_TYPE_NODE    =   2,
325     IMA_OBJECT_TYPE_LHBA    =   3,
326     IMA_OBJECT_TYPE_PHBA    =   4,
327     IMA_OBJECT_TYPE_NETWORK_PORTAL  =   5,
328     IMA_OBJECT_TYPE_PORTAL_GROUP    =   6,
329     IMA_OBJECT_TYPE_LNP =   7,
330     IMA_OBJECT_TYPE_PNP =   8,
331     IMA_OBJECT_TYPE_TARGET  =   9,
332     IMA_OBJECT_TYPE_LU  =   10,
333 	IMA_OBJECT_TYPE_DISCOVERY_ADDRESS = 11,
334 	IMA_OBJECT_TYPE_STATIC_DISCOVERY_TARGET = 12,
335     IMA_OBJECT_TYPE_CONNECTION	=	13,
336 	IMA_OBJECT_TYPE_SESSION	=	14
337 } IMA_OBJECT_TYPE;
338 
339 typedef enum
340 {
341     IMA_ISNS_DISCOVERY_METHOD_STATIC    =   0,
342     IMA_ISNS_DISCOVERY_METHOD_DHCP  =   1,
343     IMA_ISNS_DISCOVERY_METHOD_SLP   =   2
344 } IMA_ISNS_DISCOVERY_METHOD;
345 
346 typedef enum
347 {
348     IMA_DOWNLOAD_IMAGE_TYPE_FIRMWARE    =   0,
349     IMA_DOWNLOAD_IMAGE_TYPE_OPTION_ROM  =   1,
350     IMA_DOWNLOAD_IMAGE_TYPE_ALL =   2,
351 	IMA_DOWNLOAD_IMAGE_TYPE_BOOTCODE = 3
352 } IMA_PHBA_DOWNLOAD_IMAGE_TYPE;
353 
354 typedef enum
355 {
356     IMA_PHBA_STATUS_WORKING =   0,
357     IMA_PHBA_STATUS_FAILED  =   1
358 } IMA_PHBA_STATUS;
359 
360 typedef enum
361 {
362     IMA_NETWORK_PORT_STATUS_WORKING =   0,
363     IMA_NETWORK_PORT_STATUS_DEGRADED    =   1,
364     IMA_NETWORK_PORT_STATUS_CRITICAL    =   2,
365     IMA_NETWORK_PORT_STATUS_FAILED  =   3,
366     IMA_NETWORK_PORT_STATUS_DISCONNECTED    =   4
367 } IMA_NETWORK_PORT_STATUS;
368 
369 typedef enum
370 {
371     IMA_TARGET_DISCOVERY_METHOD_STATIC      =   1,
372     IMA_TARGET_DISCOVERY_METHOD_SLP     =   2,
373     IMA_TARGET_DISCOVERY_METHOD_ISNS        =   4,
374     IMA_TARGET_DISCOVERY_METHOD_SENDTARGETS =   8
375 } IMA_TARGET_DISCOVERY_METHOD;
376 
377 typedef enum
378 {
379     IMA_AUTHMETHOD_NONE =   0,
380     IMA_AUTHMETHOD_CHAP =   1,
381     IMA_AUTHMETHOD_SRP  =   2,
382     IMA_AUTHMETHOD_KRB5 =   3,
383     IMA_AUTHMETHOD_SPKM1    =   4,
384     IMA_AUTHMETHOD_SPKM2    =   5
385 } IMA_AUTHMETHOD;
386 
387 typedef enum
388 {
389 	IMA_COMMIT_TYPE_AUTO	= 0,
390 	IMA_COMMIT_TYPE_ACTIVE,
391 	IMA_COMMIT_TYPE_PERSISTENT,
392 	IMA_COMMIT_TYPE_ACTIVE_AND_PERSISTENT,
393 	IMA_COMMIT_TYPE_ALL_WITH_RESET
394 } IMA_COMMIT_LEVEL;
395 
396 typedef enum
397 {
398 	IMA_DIGEST_NONE		= 0,
399 	IMA_DIGEST_CRC32C		= 1
400 } IMA_DIGEST_TYPE;
401 
402 
403 /**
404 *******************************************************************************
405 *
406 * Declaration of the IMA_OID structure
407 *
408 * This structure should be treated as opaque by clients of the API.
409 * Appropriate APIs should be used to extract information from the structure.
410 *
411 *******************************************************************************
412 */
413 typedef struct _IMA_OID
414 {
415     /**
416     * The type of the object.  When an object ID is supplied as a parameter
417     * to an API the library uses this value to insure that the supplied
418     * object's type is appropriate for the API.
419     */
420     IMA_OBJECT_TYPE objectType;
421 
422     /**
423     * A value determined by the library which it uses to uniquely identify the
424     * owner of an object.  The owner of an object is either the library itself
425     * or a plugin.  When an object ID is supplied as a parameter to an API the
426     * library uses this value to determine if it should handle the call itself
427     * or direct the call to one or more plugins.
428     */
429     IMA_UINT32      ownerId;
430 
431     /**
432     * A value determined by a plugin which a plugin uses, perhaps in
433     * combination with the object type, to uniquely identify one of its
434     * objects.
435     */
436     IMA_UINT64      objectSequenceNumber;
437 
438 } IMA_OID;
439 
440 
441 
442 /**
443 *******************************************************************************
444 *
445 * Declaration of the IMA_OID_LIST structure
446 *
447 * This structure is used by a number of APIs to return lists of objects.  Any
448 * instance of this structure returned by an API must be freed by a client
449 * using the IMA_FreeObjectIdList API.  Although oids is declared to be an
450 * array of one
451 * @ref IMA_OID structure it can in fact contain any number of
452 * @ref IMA_OID structures.
453 *
454 * @note The @a oids array is a variable length array, despite its declaration
455 *       below it can be of any length.
456 *
457 *******************************************************************************
458 */
459 typedef struct _IMA_OID_LIST
460 {
461     /**
462     * The number of object IDs in the @a oids array.
463     */
464     IMA_UINT        oidCount;
465 
466     /**
467     * A variable length array of zero or more object IDs.  There are
468     * 'oidCount' object IDs in this array.
469     */
470     IMA_OID         oids[1];
471 
472 } IMA_OID_LIST;
473 
474 #define IMA_HOST_NAME_LEN 256
475 typedef IMA_WCHAR IMA_HOST_NAME[IMA_HOST_NAME_LEN];
476 typedef IMA_BYTE IMA_MAC_ADDRESS[6];
477 
478 /**
479 *******************************************************************************
480 *
481 * Declaration of the IMA_LIBRARY_PROPERTIES structure
482 *
483 *******************************************************************************
484 */
485 typedef struct _IMA_LIBRARY_PROPERTIES
486 {
487     /**
488     * The version of the iSCSI Management API implemented by the library.
489     * The value returned by a library for the API as described in this
490     * document is one.
491     */
492     IMA_UINT        supportedImaVersion;
493 
494     /**
495     * A nul terminated ASCII string containing the name of the vendor that
496     * created the binary version of the library.
497     */
498     IMA_WCHAR       vendor[256];
499 
500     /**
501     * A nul terminated ASCII string containing the implementation version
502     * of the library from the vendor specified in the 'vendor' field.
503     */
504     IMA_WCHAR       implementationVersion[256];
505 
506     /**
507     * A nul terminated ASCII string ideally containing the path and file
508     * name of the library that is being used by the currently executing
509     * process can be found. If the path cannot be determined then it is
510     * acceptable to fill this field with only the name (and extension if
511     * applicable) of the file of the library.  If this cannot be determined
512     * then this field should be an empty string.
513     */
514     IMA_WCHAR       fileName[256];
515 
516     /**
517     * The time and date that the library that is executing was built.
518     */
519     IMA_DATETIME    buildTime;
520 
521     IMA_BYTE    reserved[64];
522 } IMA_LIBRARY_PROPERTIES;
523 
524 
525 
526 /**
527 *******************************************************************************
528 *
529 * Declaration of the IMA_PLUGIN_PROPERTIES structure
530 *
531 *******************************************************************************
532 */
533 typedef struct _IMA_PLUGIN_PROPERTIES
534 {
535         IMA_UINT        supportedImaVersion;
536         IMA_WCHAR       vendor[256];
537         IMA_WCHAR       implementationVersion[256];
538         IMA_WCHAR       fileName[256];
539         IMA_DATETIME    buildTime;
540 
541         IMA_BOOL        lhbasCanBeCreatedAndDestroyed;
542 
543         IMA_BYTE        reserved[64];
544 
545 } IMA_PLUGIN_PROPERTIES;
546 
547 
548 typedef struct _IMA_IP_ADDRESS
549 {
550         IMA_BOOL        ipv4Address;
551         IMA_BYTE        ipAddress[16];
552 
553 } IMA_IP_ADDRESS;
554 
555 typedef struct _IMA_ADDRESS_KEY
556 {
557         IMA_IP_ADDRESS  ipAddress;
558         IMA_UINT16      portNumber;
559 
560 } IMA_ADDRESS_KEY;
561 
562 typedef struct _IMA_ADDRESS_KEYS
563 {
564         IMA_UINT		addressKeyCount;
565         IMA_ADDRESS_KEY addressKeys[1];
566 
567 } IMA_ADDRESS_KEYS;
568 
569 typedef struct _IMA_ADDRESS_KEY_PROPERTIES
570 {
571         IMA_UINT        addressKeyCount;
572         IMA_ADDRESS_KEY addressKeys[1];
573 
574 } IMA_ADDRESS_KEY_PROPERTIES;
575 
576 typedef struct _IMA_IP_PROPERTIES
577 {
578         IMA_BOOL        ipConfigurationMethodSettable;
579         IMA_BOOL        dhcpConfigurationEnabled;
580 
581         IMA_BOOL        subnetMaskSettable;
582         IMA_BOOL        subnetMaskValid;
583         IMA_IP_ADDRESS  subnetMask;
584 
585         IMA_BOOL        defaultGatewaySettable;
586         IMA_BOOL        defaultGatewayValid;
587         IMA_IP_ADDRESS  defaultGateway;
588 
589         IMA_BOOL        primaryDnsServerAddressSettable;
590         IMA_BOOL        primaryDnsServerAddressValid;
591         IMA_IP_ADDRESS  primaryDnsServerAddress;
592 
593         IMA_BOOL        alternateDnsServerAddressSettable;
594         IMA_BOOL        alternateDnsServerAddressValid;
595         IMA_IP_ADDRESS  alternateDnsServerAddress;
596 
597         IMA_BYTE        reserved[64];
598 
599 } IMA_IP_PROPERTIES;
600 
601 typedef struct _IMA_HOST_ID
602 {
603 		IMA_BOOL hostnameInUse;
604 		union {
605 
606 			IMA_HOST_NAME 	hostname;
607 			IMA_IP_ADDRESS 	ipAddress;
608 
609 		} id;
610 
611 } IMA_HOST_ID;
612 
613 typedef struct _IMA_TARGET_ADDRESS
614 {
615 		IMA_HOST_ID hostnameIpAddress;
616 		IMA_UINT16 	portNumber;
617 
618 } IMA_TARGET_ADDRESS;
619 
620 /**
621 *******************************************************************************
622 *
623 * Declaration of the IMA_NODE_NAME type
624 *
625 *******************************************************************************
626 */
627 #define	IMA_NODE_NAME_LEN   224
628 typedef IMA_WCHAR IMA_NODE_NAME[IMA_NODE_NAME_LEN];
629 
630 
631 
632 /**
633 *******************************************************************************
634 *
635 * Declaration of the IMA_NODE_ALIAS type
636 *
637 *******************************************************************************
638 */
639 #define	IMA_NODE_ALIAS_LEN	256
640 typedef IMA_WCHAR IMA_NODE_ALIAS[IMA_NODE_ALIAS_LEN];
641 
642 
643 
644 /**
645 *******************************************************************************
646 *
647 * Declaration of the IMA_DOMAIN_NAME type
648 *
649 * A variable of this type may be formatted in any of the following four ways:
650 *       1.  An empty string, which indicates that no host or IP address is
651 *           specified
652 *       2.  A DNS host name
653 *       3.  A dotted-decimal IPv4 address
654 *       4.  A bracketed IPv6 address as specified in RFC 2732
655 *
656 * In all cases a domain name is terminated by a nul character.
657 * This type is used by several APIs: IMA_SetPhbaSnsDiscovery(),
658 * IMA_SetNetworkPortalIpAddress(), and indirectly by
659 * IMA_GetPhbaDiscoveryProperties().
660 *
661 *******************************************************************************
662 */
663 typedef wchar_t IMA_DOMAIN_NAME[256];
664 
665 typedef struct _IMA_PHBA_DOWNLOAD_IMAGE_PROPERTIES
666 {
667         IMA_PHBA_DOWNLOAD_IMAGE_TYPE    imageType;
668         IMA_WCHAR               version[32];
669         IMA_WCHAR               description[512];
670         IMA_XBOOL               upgrade;
671 } IMA_PHBA_DOWNLOAD_IMAGE_PROPERTIES;
672 
673 
674 /**
675 *******************************************************************************
676 *
677 * Declaration of the IMA_NODE_PROPERTIES structure
678 *
679 * This structure is returned by the IMA_GetNodeProperties() API.
680 *
681 * NOTE: It is possible for both 'runningInInitiatorMode' and
682 *       'runningInTargetMode' to be set to @c IMA_TRUE.  This means that
683 *       the node is operating both as an initiator and as a target.
684 *
685 *******************************************************************************
686 */
687 typedef struct _IMA_NODE_PROPERTIES
688 {
689     /**
690     * A boolean indicating if the node is running as initiator or not.
691     */
692     IMA_BOOL        runningInInitiatorMode;
693 
694     /**
695     * A boolean indicating if the node is running as a target or not.
696     */
697     IMA_BOOL        runningInTargetMode;
698 
699     /**
700     * A boolean which indicates if the node's name is set or not.
701     */
702     IMA_BOOL        nameValid;
703 
704     /**
705     * A nul terminated Unicode string which contains the name of the node.
706     * The value in this field is only valid if 'nameValid' is set to
707     * IMA_TRUE, in which case it will be Unicode NULL terminated.  If
708     * 'nameValid' is set to IMA_FALSE then this field will contain an
709     * empty string.
710     */
711     IMA_NODE_NAME   name;
712 
713     /**
714     * A boolean which indicates if the node's alias is set or not.
715     */
716     IMA_BOOL        aliasValid;
717 
718     /**
719     * A nul terminated Unicode string which contains the alias of the node.
720     * This field is only valid if 'aliasValid' is set to IMA_TRUE, in which
721     * case it will be Unicode NULL terminated.  If 'aliasValid' is set to
722     * IMA_FALSE then this field will contain an empty string.
723     */
724     IMA_NODE_ALIAS  alias;
725 
726     /*
727      * Boolean indicating if both the name and alias are settable using
728      * IMA_SetNodeName() and IMA_SetNodeAlias().
729      */
730     IMA_BOOL    nameAndAliasSettable;
731 
732     IMA_BYTE    reserved[64];
733 
734 } IMA_NODE_PROPERTIES;
735 
736 
737 
738 /**
739 *******************************************************************************
740 *
741 * Declaration of the IMA_LHBA_PROPERTIES structure
742 *
743 * This structure is returned by the IMA_GetLhbaProperties()  API.
744 *
745 *******************************************************************************
746 */
747 typedef struct _IMA_LHBA_PROPERTIES
748 {
749     IMA_WCHAR   osDeviceName[256];
750     IMA_BOOL    luExposingSupported;
751     IMA_BOOL    isDestroyable;
752 
753     IMA_BOOL    staleDataRemovable;
754     IMA_UINT    staleDataSize;
755 
756     IMA_BOOL    initiatorAuthMethodsSettable;
757     IMA_BOOL    targetAuthMethodsSettable;
758 
759     IMA_BYTE    reserved[128];
760 } IMA_LHBA_PROPERTIES;
761 
762 
763 
764 /**
765 *******************************************************************************
766 *
767 * Declaration of the IMA_ULP_xxx constants
768 *
769 *******************************************************************************
770 */
771 #define IMA_ULP_TCP             0x01
772 #define IMA_ULP_SCTP            0x02
773 #define IMA_ULP_UDP             0x04
774 
775 
776 
777 /**
778 *******************************************************************************
779 *
780 * Declaration of the IMA_MIN_MAX_VALUE structure
781 *
782 * Note: If the 'currentValueValid' field is IMA_FALSE then the value of
783 *       'settable' must also be set to IMA_FALSE.
784 *
785 * Note: The fields in this structure contain values which are defined by the
786 *       implementation and not by the iSCSI specification.  It is possible
787 *       that an implementation may be more or less restrictive in the values
788 *       that it can accept than the iSCSI specification allows.
789 *
790 * Note: An example of how to use 'incrementValue': Suppose that a structure is
791 *       obtained where 'currentValueValid' is IMA_TRUE, 'settable' is
792 *       IMA_TRUE, 'currentValue' is 50, 'defaultValue' is 50, 'minimumValue'
793 *       is 30, 'maximumValue' is 70 and 'incrementValue' is 10.  In this case,
794 *       the possible values that the property can be set to are 30, 40, 50,
795 *       60, and 70.  The new value must be the current value plus or minus
796 *       some multiple of 'incrementValue'.
797 *
798 *******************************************************************************
799 */
800 typedef struct _IMA_MIN_MAX_VALUE
801 {
802     /**
803     * A boolean indicating if the @a currentValue field contains a valid value.
804     */
805     IMA_BOOL        currentValueValid;
806 
807     /**
808     * Indicates if the corresponding property is settable.  If this field
809     * has the value IMA_TRUE then the 'defaultValue', 'minimumValue',
810     * 'maximumValue', and 'incrementValue' fields shall contain valid
811     * values.  If this field has the value IMA_FALSE then these fields
812     * have undefined values.
813     */
814     IMA_BOOL        settable;
815 
816     /**
817     * If currentValueValid has the value IMA_TRUE then this field contains
818     * the current value of the associated property.  If 'currentValueValid' has
819     * the value IMA_FALSE then the value of this field is undefined.
820     */
821     IMA_UINT32      currentValue;
822 
823     /**
824     * If 'settable' has the value IMA_TRUE then this field contains the
825     * implementation's default value of the associated property.  If 'settable'
826     * has the value IMA_FALSE then the value of this field is undefined.
827     */
828     IMA_UINT32      defaultValue;
829 
830     /**
831     * If 'settable' has the value IMA_TRUE then this field contains the
832     * implementation's minimum value of the associated property.  If 'settable'
833     * has the value IMA_FALSE then the value of this field is undefined.
834     */
835     IMA_UINT32      minimumValue;
836 
837     /**
838     * If 'settable' has the value IMA_TRUE then this field contains the
839     * implementation's maximum value of the associated property.  If 'settable'
840     * has the value IMA_FALSE then the value of this field is undefined.
841     */
842     IMA_UINT32      maximumValue;
843 
844     /**
845     * If 'settable' has the value IMA_TRUE then this field contains a value
846     * which can be added to or subtracted from 'currentValue' to obtain other
847     * possible values of the associated property. If 'settable' has the value
848     * IMA_FALSE then the value of this field is undefined.
849     */
850     IMA_UINT32      incrementValue;
851 
852 } IMA_MIN_MAX_VALUE;
853 
854 typedef struct _IMA_BOOL_VALUE
855 {
856     IMA_BOOL    currentValueValid;
857     IMA_BOOL    settable;
858     IMA_BOOL    currentValue;
859     IMA_BOOL    defaultValue;
860 } IMA_BOOL_VALUE;
861 
862 /**
863 *******************************************************************************
864 *
865 * Declaration of the IMA_PHBA_PROPERTIES structure
866 *
867 * This structure is returned by the IMA_GetPhbaProperties() API.
868 *
869 * Note: Both 'isInitiator' and 'isTarget' cannot be set to IMA_FALSE as this
870 *       would mean that the PHBA was not functioning as either an initiator or
871 *       target, which means that its not functioning at all.
872 *
873 *******************************************************************************
874 */
875 typedef struct _IMA_PHBA_PROPERTIES
876 {
877     /**
878     * A nul terminated ASCII string which contains the name of the vendor
879     * of a PHBA. If the first character in this field is nul then the
880     * vendor is unknown.
881     */
882     IMA_WCHAR       vendor[64];
883 
884     /**
885     * A nul terminated ASCII string which contains the name of the model of
886     * a PHBA. If the first character in this field is nul then the model is
887     * unknown.
888     */
889     IMA_WCHAR       model[256];
890 
891     /**
892     * A nul terminated ASCII string which contains a description of a PHBA.
893     * This is a user friendly description of the PHBA.  If the first character
894     * in this field is nul then there is no description.
895     */
896     IMA_WCHAR       description[256];
897 
898     /**
899     * A nul terminated ASCII string which contains the serial number of a
900     * PHBA.  If the first character in this field is nul then the serial
901     * number is unknown.
902     */
903     IMA_WCHAR       serialNumber[64];
904 
905     /**
906     * A nul terminated ASCII string which contains the hardware version of
907     * a PHBA. If the first character in this field is nul then the hardware
908     * version is unknown.
909     */
910     IMA_WCHAR       hardwareVersion[256];
911 
912     /**
913     * A nul terminated ASCII string which contains the ASIC version of a
914     * PHBA.  If the first character in this field is nul then the ASIC
915     * version is unknown or is not applicable.
916     */
917     IMA_WCHAR       asicVersion[256];
918 
919     /**
920     * A nul terminated ASCII string which contains the firmware version of
921     * a PHBA.  If the first character in this field is nul then the firmware
922     * version is unknown or is not applicable.
923     */
924     IMA_WCHAR       firmwareVersion[256];
925 
926     /**
927     * A nul terminated ASCII string which contains the option ROM version
928     * of a PHBA. If the first character in this field is nul then the option
929     * ROM version is unknown or is not applicable.
930     */
931     IMA_WCHAR       optionRomVersion[256];
932 
933     /**
934     * A nul terminated ASCII string which contains the name of the driver
935     * controlling a PHBA.  If the first character in this field is nul then
936     * the name of the driver is unknown.
937     */
938     IMA_WCHAR       driverName[256];
939 
940     /**
941     * A nul terminated ASCII string which contains the version of the driver
942     * specified in 'driverName'.  If the first character in this field is nul
943     * then the version of the driver is unknown.
944     *
945     * This field can have a known value only if @a driverName has a known
946     * value as well.
947     */
948     IMA_WCHAR       driverVersion[256];
949 
950     /**
951     * A field containing flags which indicate what upper level protocols
952     * are supported by a PHBA.  Examples of upper level protocols include:
953     *
954     *       - TCP, represented by IMA_ULP_TCP
955     *       - SCTP, represented by IMA_ULP_SCTP
956     *       - UDP, represented by IMA_ULP_UDP
957     */
958     IMA_UINT        supportedUlps;
959 
960     /**
961     * A extended boolean which indicates if a PHBA supports executing SCSI
962     * commands which cause bidirectional transfers.
963     *
964     * Note: The value of this field applies to the entire stack:
965     * the hardware, ASIC, firmware, driver, etc.  All must support SCSI
966     * commands which cause bidirectional transfers for this field to be
967     * set to IMA_TRUE.
968     */
969     IMA_XBOOL       bidirectionalTransfersSupported;
970 
971     /**
972     * The maximum length, in bytes, of a CDB that can be transferred by
973     * this PHBA.  If this field has a value of zero that indicates that
974     * this value is unknown.
975     *
976     * Note: The value of this field applies to the entire stack:
977     * the hardware, ASIC, firmware, driver, etc.  All must support the
978     * maximum CDB length returned in this field.
979     */
980     IMA_UINT        maximumCdbLength;
981 
982     /**
983     * An extended boolean which indicates if a PHBA can also function as
984     * a standard NIC concurrently with functioning as an iSCSI PHBA.
985     */
986     IMA_XBOOL       canBeNic;
987 
988     /**
989     * A extended boolean which indicates if a PHBA is functioning as a
990     * standard NIC concurrently with functioning as an iSCSI PHBA.
991     */
992     IMA_XBOOL       isNic;
993 
994     /**
995     * An extended boolean indicating if the PHBA is functioning as an
996     * initiator.
997     */
998     IMA_XBOOL       isInitiator;
999 
1000     /**
1001     * An extended boolean indicating if the PHBA is functioning as a target.
1002     */
1003     IMA_XBOOL       isTarget;
1004 
1005     /**
1006     * An extended boolean indicating if the PHBA is using a TCP offload engine.
1007     *
1008     * Note: This value should only be set to @c IMA_TRUE if a TCP offload
1009     * engine is present and is being used.  If it can be determined that a
1010     * TCP offload engine is present, but it cannot be determined if that
1011     * offload engine is being used then this value should be set to
1012     * IMA_UNKNOWN.
1013     */
1014     IMA_XBOOL       usingTcpOffloadEngine;
1015 
1016     /**
1017     * An extended boolean indicating if the PHBA is using a iSCSI offload
1018     * engine.
1019     *
1020     * Note: This value should only be set to @c IMA_TRUE if a iSCSI offload
1021     * engine is present and is being used.  If it can be determined that an
1022     * iSCSI offload engine is present, but it cannot be determined if that
1023     * offload engine is being used then this value should be set to
1024     * IMA_UNKNOWN.
1025     */
1026     IMA_XBOOL       usingIscsiOffloadEngine;
1027 
1028     IMA_BYTE        reserved[128];
1029 
1030 } IMA_PHBA_PROPERTIES;
1031 
1032 /**
1033 *******************************************************************************
1034 *
1035 * Declaration of the IMA_DISCOVERY_PROPERTIES structure
1036 *
1037 *******************************************************************************
1038 */
1039 typedef struct _IMA_DISCOVERY_PROPERTIES
1040 {
1041 		IMA_BOOL			iSnsDiscoverySettable;
1042 		IMA_XBOOL			iSnsDiscoveryEnabled;
1043 		IMA_ISNS_DISCOVERY_METHOD   	iSnsDiscoveryMethod;
1044 		IMA_HOST_ID			iSnsHost;
1045 
1046 		IMA_BOOL    			slpDiscoverySettable;
1047 		IMA_XBOOL   			slpDiscoveryEnabled;
1048 
1049 		IMA_BOOL    			staticDiscoverySettable;
1050 		IMA_XBOOL   			staticDiscoveryEnabled;
1051 
1052 		IMA_BOOL    			sendTargetsDiscoverySettable;
1053 		IMA_XBOOL   			sendTargetsDiscoveryEnabled;
1054 
1055 		IMA_BYTE    			reserved[128];
1056 } IMA_DISCOVERY_PROPERTIES;
1057 
1058 
1059 typedef struct _IMA_PHBA_DOWNLOAD_PROPERTIES
1060 {
1061         IMA_BOOL        isPhbaDownloadFileSupported;
1062         IMA_BOOL        optionRomDownloadSupported;
1063         IMA_BOOL        firmwareDownloadSupported;
1064 
1065         IMA_BYTE        reserved[32];
1066 } IMA_PHBA_DOWNLOAD_PROPERTIES;
1067 
1068 typedef struct _IMA_IPSEC_PROPERTIES
1069 {
1070         IMA_BOOL        ipsecSupported;
1071         IMA_BOOL        implementedInHardware;
1072         IMA_BOOL        implementedInSoftware;
1073 
1074         IMA_BYTE        reserved[32];
1075 
1076 } IMA_IPSEC_PROPERTIES;
1077 
1078 typedef struct _IMA_LNP_PROPERTIES
1079 {
1080         IMA_MAC_ADDRESS macAddress;
1081         IMA_BOOL        macAddressSettable;
1082         IMA_BYTE        reserved[32];
1083 
1084 } IMA_LNP_PROPERTIES;
1085 
1086 typedef struct _IMA_PNP_PROPERTIES
1087 {
1088         IMA_OID         associatedPhbaOid;
1089 
1090         IMA_MAC_ADDRESS macAddress;
1091         IMA_BOOL        macAddressSettable;
1092 
1093         IMA_UINT        maximumTransferRate;
1094         IMA_UINT        currentTransferRate;
1095 
1096         IMA_UINT        maximumFrameSize;
1097 
1098         IMA_BYTE        reserved[64];
1099 } IMA_PNP_PROPERTIES;
1100 
1101 typedef struct _IMA_PNP_STATISTICS
1102 {
1103         IMA_UINT64      bytesSent;
1104         IMA_UINT32      pdusSent;
1105         IMA_UINT64      bytesReceived;
1106         IMA_UINT32      pdusReceived;
1107 
1108 } IMA_PNP_STATISTICS;
1109 
1110 typedef struct _IMA_TARGET_PROPERTIES
1111 {
1112         IMA_OID associatedNodeOid;
1113         IMA_OID associatedLhbaOid;
1114 
1115         IMA_NODE_NAME   name;
1116         IMA_NODE_ALIAS  alias;
1117         IMA_UINT32      discoveryMethodFlags;
1118 
1119         IMA_BOOL        sendTargetsDiscoverySettable;
1120         IMA_BOOL        sendTargetsDiscoveryEnabled;
1121 
1122         IMA_BYTE        reserved[128];
1123 
1124 } IMA_TARGET_PROPERTIES;
1125 
1126 typedef struct _IMA_CONNECTION_PROPERTIES
1127 {
1128 	IMA_OID	associatedSessionOid;
1129 	IMA_UINT16	connectionId;
1130 	IMA_DIGEST_TYPE	dataDigest;
1131 	IMA_DIGEST_TYPE	headerDigest;
1132 	IMA_BOOL	ifMarker;
1133 	IMA_UINT32	ifMarkInt;
1134 	IMA_UINT32	maxRecvDataSegmentLength;
1135 	IMA_UINT32	maxTransmitDataSegmentLength;
1136 	IMA_BOOL	ofMarker;
1137 	IMA_UINT32	ofMarkInt;
1138 } IMA_CONNECTION_PROPERTIES;
1139 
1140 
1141 typedef struct _IMA_SESSION_PROPERTIES
1142 {
1143 	IMA_OID	associatedLhbaOid;
1144 	IMA_AUTHMETHOD	authMethod;
1145 	IMA_BOOL	dataPduInOrder;
1146 	IMA_BOOL	dataSequenceInOrder;
1147 	IMA_UINT16	defaultTime2Retain;
1148 	IMA_UINT16	defaultTime2Wait;
1149 	IMA_UINT16	errorRecoveryLevel;
1150 	IMA_UINT32	firstBurstLength;
1151 	IMA_BOOL	immediateData;
1152 	IMA_BOOL	initialR2T;
1153 	IMA_BYTE	isid[6];
1154 	IMA_UINT32	maxBurstLength;
1155 	IMA_UINT16	maxConnections;
1156 	IMA_UINT16	maxOutstandingR2T;
1157 	IMA_UINT16	targetPortalGroupTag;
1158 	IMA_UINT16	tsih;
1159 } IMA_SESSION_PROPERTIES;
1160 
1161 
1162 typedef struct _IMA_TARGET_ERROR_STATISTICS
1163 {
1164         IMA_BOOL        loginFailedCountValid;
1165         IMA_UINT32      loginFailedCount;
1166 
1167         IMA_BOOL        sessionFailedCountValid;
1168         IMA_UINT32      sessionFailedCount;
1169 
1170         IMA_BOOL        headerOrDigestSessionFailedCountValid;
1171         IMA_UINT32      headerOrDigestSessionFailedCount;
1172 
1173         IMA_BOOL        timeLimitExceededSessionFailedCountValid;
1174         IMA_UINT32      timeLimitExceededSessionFailedCount;
1175 
1176         IMA_BOOL        formatErrorSessionFailedCountValid;
1177         IMA_UINT32      formatErrorSessionFailedCount;
1178 
1179         IMA_BOOL        closedConnectionDueToTimeoutCountValid;
1180         IMA_UINT32      closedConnectionDueToTimeoutCount;
1181 
1182         IMA_BOOL        lastLoginFailureTimeValid;
1183         IMA_DATETIME    lastLoginFailureTime;
1184 
1185         IMA_BYTE        reserved[64];
1186 
1187 } IMA_TARGET_ERROR_STATISTICS;
1188 
1189 typedef struct _IMA_LU_PROPERTIES
1190 {
1191         IMA_OID         associatedTargetOid;
1192         IMA_UINT64      targetLun;
1193 
1194         IMA_BOOL        exposedToOs;
1195         IMA_DATETIME    timeExposedToOs;
1196 
1197         IMA_BOOL        osDeviceNameValid;
1198         IMA_WCHAR       osDeviceName[64];
1199 
1200         IMA_BOOL        osParallelIdsValid;
1201         IMA_UINT32      osBusNumber;
1202         IMA_UINT32      osTargetId;
1203         IMA_UINT32      osLun;
1204 
1205         IMA_BYTE        reserved[128];
1206 
1207 } IMA_LU_PROPERTIES;
1208 
1209 typedef struct _IMA_STATISTICS_PROPERTIES
1210 {
1211         IMA_BOOL        statisticsCollectionSettable;
1212         IMA_BOOL        statisticsCollectionEnabled;
1213 
1214 } IMA_STATISTICS_PROPERTIES;
1215 
1216 typedef struct _IMA_DEVICE_STATISTICS
1217 {
1218         IMA_UINT64      scsiPayloadBytesSent;
1219         IMA_UINT64      scsiPayloadBytesReceived;
1220 
1221         IMA_UINT64      iScsiPduBytesSent;
1222         IMA_UINT64      iScsiPduBytesReceived;
1223 
1224         IMA_UINT64      iScsiPdusSent;
1225         IMA_UINT64      iScsiPdusReceived;
1226 
1227         IMA_UINT64      millisecondsSpentSending;
1228         IMA_UINT64      millisecondsSpentReceiving;
1229 
1230 } IMA_DEVICE_STATISTICS;
1231 
1232 typedef struct _IMA_NETWORK_PORTAL_PROPERTIES
1233 {
1234         IMA_IP_ADDRESS  ipAddress;
1235         IMA_OID         associatedLnp;
1236 
1237         IMA_BYTE        reserved[32];
1238 } IMA_NETWORK_PORTAL_PROPERTIES;
1239 
1240 typedef void (* IMA_OBJECT_VISIBILITY_FN)(
1241         IMA_BOOL        becomingVisible,
1242         IMA_OID         oid
1243 );
1244 
1245 typedef void (* IMA_OBJECT_PROPERTY_FN)(
1246         IMA_OID         oid
1247 );
1248 
1249 typedef struct _IMA_CHAP_INITIATOR_AUTHPARMS
1250 {
1251 
1252         IMA_UINT        retries;
1253 
1254         IMA_BYTE        name[512];
1255         IMA_UINT        nameLength;
1256 
1257         IMA_UINT        minValueLength;
1258         IMA_UINT        maxValueLength;
1259 
1260         IMA_BYTE        challengeSecret[256];
1261         IMA_UINT        challengeSecretLength;
1262 
1263         IMA_BYTE        reserved[512];
1264 
1265 } IMA_CHAP_INITIATOR_AUTHPARMS;
1266 
1267 typedef struct _IMA_SRP_INITIATOR_AUTHPARMS
1268 {
1269 
1270         IMA_BYTE        userName[512];
1271         IMA_UINT        userNameLength;
1272 
1273         IMA_BYTE        reserved[512];
1274 
1275 } IMA_SRP_INITIATOR_AUTHPARMS;
1276 
1277 typedef struct _IMA_KRB5_INITIATOR_AUTHPARMS
1278 {
1279 
1280         IMA_BYTE        clientKey[1024];
1281         IMA_UINT        clientKeyLength;
1282 
1283         IMA_BYTE        reserved[2048];
1284 
1285 } IMA_KRB5_INITIATOR_AUTHPARMS;
1286 
1287 typedef struct _IMA_SPKM_INITIATOR_AUTHPARMS
1288 {
1289 
1290         IMA_BYTE        privateKey[4096];
1291         IMA_UINT        privateKeyLength;
1292 
1293         IMA_BYTE        publicKey[4096];
1294         IMA_UINT        publicKeyLength;
1295 
1296         IMA_BYTE        reserved[4096];
1297 
1298 } IMA_SPKM_INITIATOR_AUTHPARMS;
1299 
1300 typedef union _IMA_INITIATOR_AUTHPARMS
1301 {
1302 
1303         IMA_CHAP_INITIATOR_AUTHPARMS    chapParms;
1304         IMA_SRP_INITIATOR_AUTHPARMS     srpParms;
1305         IMA_KRB5_INITIATOR_AUTHPARMS    kerberosParms;
1306         IMA_SPKM_INITIATOR_AUTHPARMS    spkmParms;
1307 
1308 } IMA_INITIATOR_AUTHPARMS;
1309 
1310 
1311 typedef struct _IMA_STATIC_DISCOVERY_TARGET
1312 {
1313 		IMA_NODE_NAME 		targetName;
1314 		IMA_TARGET_ADDRESS 	targetAddress;
1315 
1316 } IMA_STATIC_DISCOVERY_TARGET;
1317 
1318 typedef struct _IMA_DISCOVERY_ADDRESS_PROPERTIES
1319 {
1320 		IMA_OID			associatedNodeOid;
1321 		IMA_OID			associatedLhbaOid;
1322 		IMA_TARGET_ADDRESS	discoveryAddress;
1323 
1324 } IMA_DISCOVERY_ADDRESS_PROPERTIES;
1325 
1326 typedef struct _IMA_STATIC_TGT_PROPERTIES
1327 {
1328 		IMA_OID				associatedNodeOid;
1329 		IMA_OID				associatedLhbaOid;
1330 		IMA_STATIC_DISCOVERY_TARGET	staticTarget;
1331 
1332 } IMA_STATIC_DISCOVERY_TARGET_PROPERTIES;
1333 
1334 typedef struct ima_plugin_info {
1335 	char PluginName[64];
1336         char PluginPath[256];
1337 #ifdef WIN32
1338 	HINSTANCE hPlugin; /* Handle to a loaded DLL */
1339 #else
1340 	void* hPlugin; /* Handle to a loaded DLL */
1341 #endif
1342 	IMA_UINT32 ownerId;
1343 #ifdef WIN32
1344 	HANDLE pluginMutex;
1345 #else
1346 	int pluginMutex;
1347 #endif
1348 	IMA_UINT number_of_vbcallbacks;
1349         IMA_OBJECT_VISIBILITY_FN vbcallback[IMA_MAX_CALLBACK_PER_PLUGIN];
1350         IMA_UINT number_of_pccallbacks;
1351         IMA_OBJECT_PROPERTY_FN pccallback[IMA_MAX_CALLBACK_PER_PLUGIN];
1352 } IMA_PLUGIN_INFO, *PIMA_PLUGIN_INFO;
1353 
1354 
1355 /**
1356 *******************************************************************************
1357 *
1358 * The individual APIs of the IMA are declared below.
1359 *
1360 *******************************************************************************
1361 */
1362 
1363 /**
1364 *******************************************************************************
1365 *
1366 * Gets the properties of the IMA library that is being used.
1367 *
1368 * @param  pProps
1369 *         A pointer to an IMA_LIBRARY_PROPERTIES structure allocated by
1370 *         the caller.  On successful return this structure will contain the
1371 *         properties of the IMA library.
1372 *
1373 * @return An IMA_STATUS indicating if the operation was successful or if
1374 *         an error occurred.
1375 *
1376 * @retval IMA_SUCCESS
1377 *         Returned if the library properties were successfully returned.
1378 *
1379 * @retval IMA_ERROR_INVALID_PARAMETER
1380 *         Returned if 'pProps' is NULL or specifies a memory area to which
1381 *         data cannot be written.
1382 *
1383 *******************************************************************************
1384 */
1385 IMA_API IMA_STATUS IMA_GetLibraryProperties(
1386         IMA_LIBRARY_PROPERTIES *pProps
1387 );
1388 
1389 
1390 
1391 /**
1392 *******************************************************************************
1393 *
1394 * Gets a list of the object IDs of all currently loaded plugins.
1395 *
1396 * @param ppList
1397 *        A pointer to a pointer to an IMA_OID_LIST.  On successful
1398 *        return this will contain a pointer to an @ref IMA_OID_LIST
1399 *        which contains the object IDs of all of the plugins currently
1400 *        loaded by the library.
1401 *
1402 * @return An IMA_STATUS indicating if the operation was successful or
1403 *         if an error occurred.
1404 *
1405 * @retval IMA_SUCCESS
1406 *         Returned if the plugin ID list was successfully returned.
1407 *
1408 * @retval IMA_ERROR_INVALID_PARAMETER
1409 *         Returned if 'ppList' is NULL or specifies a memory area to
1410 *         which data cannot be written.
1411 *
1412 *******************************************************************************
1413 */
1414 IMA_API IMA_STATUS IMA_GetPluginOidList(
1415         IMA_OID_LIST **ppList
1416 );
1417 
1418 
1419 
1420 /**
1421 *******************************************************************************
1422 *
1423 * Gets the properties of the specified vendor plugin.
1424 *
1425 * @param  pluginOid
1426 *         The ID of the plugin whose properties are being retrieved.
1427 *
1428 * @param  pProps
1429 *         A pointer to an @ref IMA_PLUGIN_PROPERTIES structure allocated by
1430 *         the caller.  On successful return this will contain the properties
1431 *         of the plugin specified by pluginOid.
1432 *
1433 * @return An IMA_STATUS indicating if the operation was successful or if an
1434 *         error occurred.
1435 *
1436 * @retval IMA_SUCCESS
1437 *         Returned if the plugin properties were successfully returned.
1438 *
1439 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1440 *         Returned if 'pluginOid' does not specify any valid object type.
1441 *
1442 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1443 *         Returned if 'pluginOid' does not specify a plugin object.
1444 *
1445 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1446 *         Returned if 'pluginOid' refers to a plugin, but not one that
1447 *         is currently loaded.
1448 * @retval IMA_ERROR_INVALID_PARAMETER
1449 *         Returned if 'pProps' is NULL or specifies a memory area to
1450 *         which data cannot be written.
1451 *
1452 *******************************************************************************
1453 */
1454 IMA_API IMA_STATUS IMA_GetPluginProperties(
1455         IMA_OID pluginOid,
1456         IMA_PLUGIN_PROPERTIES *pProps
1457 );
1458 
1459 
1460 
1461 /**
1462 *******************************************************************************
1463 *
1464 * Gets the object ID for the plugin associated with the specified object ID.
1465 *
1466 * @param  oid
1467 *         The object ID of an object that has been received from a previous
1468 *         library call.
1469 *
1470 * @param  pPluginOid
1471 *         A pointer to an IMA_OID structure allocated by the caller.  On
1472 *         successful return this will contain the object ID of the plugin
1473 *         associated with the object specified by @a objectId.  This
1474 *         can then be used to work with the plugin, e.g., to get the
1475 *         properties of the plugin or the send the plugin an IOCtl.
1476 *
1477 * @return An IMA_STATUS indicating if the operation was successful or if
1478 *         an error occurred.
1479 *
1480 * @retval IMA_SUCCESS
1481 *         Returned if the associated plugin ID was successfully returned.
1482 *
1483 * @retval IMA_ERROR_INVALID_PARAMETER
1484 *         Returned if 'pPluginOid' is NULL or specifies a memory area to
1485 *         which data cannot be written.
1486 *
1487 * @retval IMA_ERROR_INVALID_PARAMETER
1488 *         Returned if 'oid' specifies an object not owned by a plugin, but
1489 *         instead one that is owned by the library.
1490 *
1491 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1492 *         Returned if 'oid' specifies an object with an invalid type.
1493 *
1494 *******************************************************************************
1495 */
1496 IMA_API IMA_STATUS IMA_GetAssociatedPluginOid(
1497         IMA_OID oid,
1498         IMA_OID *pPluginOid
1499 );
1500 
1501 
1502 
1503 /**
1504 *******************************************************************************
1505 *
1506 * Gets the object ID of the shared node.
1507 *
1508 * @param  pSharedNodeOid
1509 *         A pointer to an IMA_OID structure allocated by the caller.  On
1510 *         successful return it will contain the object ID of the
1511 *         shared node of the currently executing system is placed.
1512 *
1513 * @return An IMA_STATUS indicating if the operation was successful or
1514 *         if an error occurred.
1515 *
1516 * @retval IMA_SUCCESS
1517 *         Returned if the shared node ID has been successfully retrieved.
1518 *
1519 * @retval IMA_ERROR_INVALID_PARAMETER
1520 *         Returned if 'pSharedNodeOid' is NULL or specifies a memory area
1521 *         to which data cannot be written.
1522 *
1523 *******************************************************************************
1524 */
1525 IMA_API IMA_STATUS IMA_GetSharedNodeOid(
1526         IMA_OID *pSharedNodeOid
1527 );
1528 
1529 IMA_API IMA_STATUS IMA_GetObjectType(
1530         IMA_OID oid,
1531         IMA_OBJECT_TYPE *pObjectType
1532 );
1533 
1534 
1535 /**
1536 *******************************************************************************
1537 *
1538 * Gets the properties of the specified iSCSI node.
1539 *
1540 * @param  nodeOid
1541 *         The ID of the node to get the properties of.
1542 *
1543 * @param  pProps
1544 *         A pointer to an @ref IMA_NODE_PROPERTIES structure which on
1545 *         successful return will contain the properties of the specified node.
1546 *
1547 * @return An IMA_STATUS indicating if the operation was successful or if
1548 *         an error occurred.
1549 *
1550 * @retval IMA_SUCCESS
1551 *         Returned if the node properties have been successfully retrieved.
1552 *
1553 * @retval IMA_ERROR_INVALID_PARAMETER
1554 *         Returned if 'pProps' is NULL or specifies a memory area to which
1555 *         data cannot be written.
1556 *
1557 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1558 *         Returned if 'nodeOid' does not specify any valid object type.
1559 *
1560 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1561 *         Returned if 'nodeOid' does not specify a node object.
1562 *
1563 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1564 *         Returned if 'nodeOid' does not specify a node which is currently
1565 *         known to the system.
1566 *
1567 *******************************************************************************
1568 */
1569 IMA_API IMA_STATUS IMA_GetNodeProperties(
1570         IMA_OID nodeOid,
1571         IMA_NODE_PROPERTIES *pProps
1572 );
1573 
1574 
1575 
1576 /**
1577 *******************************************************************************
1578 *
1579 * Sets the name of the specified node.
1580 *
1581 * @param  nodeOid
1582 *         The object ID of the node whose name is being set.
1583 *
1584 * @param  newName
1585 *         The new name of the node.
1586 *
1587 * @return An IMA_STATUS indicating if the operation was successful or
1588 *         if an error occurred.
1589 *
1590 * @retval IMA_SUCCESS
1591 *         Returned if the node name was successfully changed.
1592 *
1593 * @retval IMA_STATUS_REBOOT_NECESSARY
1594 *         Returned if a reboot is necessary before the setting of the
1595 *         name actually takes affect.
1596 *
1597 * @retval IMA_ERROR_INVALID_PARAMETER
1598 *         Returned if 'newName' is NULL, or specifies a memory area
1599 *         to which data cannot be written, or has a length of 0.
1600 *
1601 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1602 *         Returned if 'nodeOid' does not specify any valid object type.
1603 *
1604 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1605 *         Returned if 'nodeOid' does not specify a node object.
1606 *
1607 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1608 *         Returned if 'nodeOid' does not specify a node which is
1609 *         currently known to the system.
1610 *
1611 * @retval IMA_ERROR_NAME_TOO_LONG
1612 *         Returned if 'newName' contains too many characters.
1613 *
1614 *******************************************************************************
1615 */
1616 IMA_API IMA_STATUS IMA_SetNodeName(
1617         IMA_OID nodeOid,
1618         const IMA_NODE_NAME newName
1619 );
1620 
1621 
1622 
1623 /**
1624 *******************************************************************************
1625 *
1626 * Generates a unique node name for the currently running system.
1627 *
1628 * @param  generatedName
1629 *         On successful return contains the generated node name.
1630 *
1631 * @return  An IMA_STATUS indicating if the operation was successful or if an
1632 *          error occurred.
1633 *
1634 * @retval IMA_ERROR_INVALID_PARAMETER
1635 *         Returned if 'generatedname is NULL or
1636 *               specifies a memory area to which data cannot be written.
1637 *
1638 *******************************************************************************
1639 */
1640 IMA_API IMA_STATUS IMA_GenerateNodeName(
1641         IMA_NODE_NAME generatedName
1642 );
1643 
1644 
1645 
1646 /**
1647 *******************************************************************************
1648 *
1649 * Sets the alias of the specified node.
1650 *
1651 * @param  nodeOid
1652 *         The object ID of the node whose alias is being set.
1653 *
1654 * @param  newAlias
1655 *         A pointer to a Unicode string which contains the new node alias.
1656 *         If this parameter is NULL then the current alias is deleted, in which
1657 *         case the specified node no longer has an alias.
1658 *
1659 * @return An IMA_STATUS indicating if the operation was successful or
1660 *         if an error occurred.
1661 *
1662 * @retval IMA_SUCCESS
1663 *         Returned if the node's alias has been successfully set.
1664 *
1665 * @retval IMA_STATUS_REBOOT_NECESSARY
1666 *         A reboot is necessary before the setting of the alias actually
1667 *         takes effect.
1668 *
1669 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1670 *         Returned if 'nodeOid' does not specify any valid object type.
1671 *
1672 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1673 *         Returned if 'nodeOid' does not specify a node object.
1674 *
1675 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1676 *         Returned if 'nodeOid' does not specify a node which is currently
1677 *         known to the system.
1678 *
1679 * @retval IMA_ERROR_NAME_TOO_LONG
1680 *         Returned if 'newAlias' contains too many characters.
1681 *
1682 *******************************************************************************
1683 */
1684 IMA_API IMA_STATUS IMA_SetNodeAlias(
1685         IMA_OID nodeOid,
1686         const IMA_NODE_ALIAS newAlias
1687 );
1688 
1689 
1690 
1691 /**
1692 *******************************************************************************
1693 *
1694 * Gets a list of the object IDs of all the logical HBAs in the system.
1695 *
1696 * @param  ppList
1697 *         A pointer to a pointer to an @ref IMA_OID_LIST structure.  On
1698 *         successful return this will contain a pointer to an
1699 *         IMA_OID_LIST which contains the object IDs of all of the
1700 *         LHBAs currently in the system.
1701 *
1702 * @return An IMA_STATUS indicating if the operation was successful or if
1703 *         an error occurred.
1704 *
1705 * @retval IMA_SUCCESS
1706 *         Returned if the LHBA ID list has been successfully returned.
1707 *
1708 * @retval IMA_ERROR_INVALID_PARAMETER
1709 *         Returned if 'ppList' is NULL or specifies a memory area to which
1710 *         data cannot be written.
1711 *
1712 *******************************************************************************
1713 */
1714 IMA_API IMA_STATUS IMA_GetLhbaOidList(
1715         IMA_OID_LIST **ppList
1716 );
1717 
1718 
1719 
1720 /**
1721 *******************************************************************************
1722 *
1723 * Gets the properties of the specified logical HBA.
1724 *
1725 * @param  lhbaOid
1726 *         The object ID of the LHBA whose properties are being retrieved.
1727 *
1728 * @param  pProps
1729 *         A pointer to an IMA_LHBA_PROPERTIES structure.  On successful
1730 *         return this will contain the properties of the LHBA specified by
1731 *         'lhbaOid'.
1732 *
1733 * @return An IMA_STATUS indicating if the operation was successful or if
1734 *         an error occurred.
1735 *
1736 * @retval IMA_SUCCESS
1737 *         Returned if the properties of the specified LHBA have been
1738 *         successfully retrieved.
1739 *
1740 * @retval IMA_ERROR_INVALID_PARAMETER
1741 *         Returned if 'pProps' is NULL or specifies a memory area to which
1742 *         data cannot be written.
1743 *
1744 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1745 *         Returned if 'lhbaOid' does not specify any valid object type.
1746 *
1747 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1748 *         Returned if 'lhbaOid' does not specify a LHBA.
1749 *
1750 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1751 *         Returned if 'lhbaOid' does not specify a LHBA which is currently
1752 *         known to the system.
1753 *
1754 *******************************************************************************
1755 */
1756 IMA_API IMA_STATUS IMA_GetLhbaProperties(
1757         IMA_OID lhbaOid,
1758         IMA_LHBA_PROPERTIES *pProps
1759 );
1760 
1761 
1762 
1763 /**
1764 *******************************************************************************
1765 *
1766 * Gets a list of the object IDs of all the physical HBAs in the system.
1767 *
1768 * @param  ppList
1769 *         A pointer to a pointer to an IMA_OID_LIST structure.  On successful
1770 *         return this will contain a pointer to an IMA_OID_LIST which
1771 *         contains the object IDs of all of the PHBAs currently in the system.
1772 *
1773 * @return An IMA_STATUS indicating if the operation was successful or if
1774 *         an error occurred.
1775 *
1776 * @retval IMA_SUCCESS
1777 *         Returned if the PHBA OID list has been successfully returned.
1778 *
1779 * @retval IMA_ERROR_INVALID_PARAMETER
1780 *         Returned if 'ppList' is NULL or specifies a memory area to which
1781 *         data cannot be written.
1782 *
1783 *******************************************************************************
1784 */
1785 IMA_API IMA_STATUS IMA_GetPhbaOidList(
1786         IMA_OID_LIST **ppList
1787 );
1788 
1789 
1790 
1791 /**
1792 *******************************************************************************
1793 *
1794 * Gets the general properties of a physical HBA.
1795 *
1796 * @param  phbaOid
1797 *         The object ID of the PHBA whose properties are being queried.
1798 *
1799 * @param  pProps
1800 *         A pointer to an @ref IMA_PHBA_PROPERTIES structure.  On successful
1801 *         return this will contain the properties of the PHBA specified by
1802 *         'phbaOid'.
1803 #
1804 * @return An IMA_STATUS indicating if the operation was successful or
1805 *         if an error occurred.
1806 *
1807 * @retval IMA_SUCCESS
1808 *         Returned if the properties of the specified PHBA have been
1809 *         successfully retrieved.
1810 *
1811 * @retval IMA_ERROR_INVALID_PARAMETER
1812 *         Returned if 'pProps' is NULL or specifies a memory area to which
1813 *         data cannot be written.
1814 *
1815 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1816 *         Returned if 'phbaOid' does not specify any valid object type.
1817 *
1818 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1819 *         Returned if 'phbaOid' does not specify a PHBA.
1820 *
1821 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1822 *         Returned if 'phbaOid' does not specify a PHBA which is currently
1823 *         known to the system.
1824 *
1825 *******************************************************************************
1826 */
1827 IMA_API IMA_STATUS IMA_GetPhbaProperties(
1828         IMA_OID phbaOid,
1829         IMA_PHBA_PROPERTIES *pProps
1830 );
1831 
1832 /**
1833 *******************************************************************************
1834 *
1835 * Frees a previously allocated IMA_OID_LIST structure.
1836 *
1837 * @param pMemory  A pointer to an IMA_OID_LIST structure allocated by the
1838 *                 library.  On successful return the memory allocated by the
1839 *                 list is freed.
1840 * @return  An IMA_STATUS indicating if the operation was successful or if an
1841 *          error occurred.
1842 * @retval IMA_SUCCESS
1843 *         Returned if the specified object ID list was successfully
1844 *         freed.
1845 * @retval IMA_ERROR_INVALID_PARAMETER
1846 *         Returned if pMemory is NULL or specifies a memory area from which
1847 *         data cannot be read.
1848 *
1849 *******************************************************************************
1850 */
1851 IMA_API IMA_STATUS IMA_FreeMemory(
1852         void *pMemory
1853 );
1854 
1855 
1856 
1857 IMA_API IMA_STATUS IMA_GetNonSharedNodeOidList(
1858                 IMA_OID_LIST **ppList
1859 );
1860 
1861 
1862 
1863 
1864 /**
1865 *******************************************************************************
1866 *
1867 * Gets the first burst length properties of the specified logical HBA.
1868 *
1869 * @param  oid
1870 *         The object ID of the logical HBA to get the first burst length
1871 *         properties of.
1872 *
1873 * @param  pProps
1874 *         A pointer to a min/max values structure.
1875 *
1876 * @return An IMA_STATUS indicating if the operation was successful or if an
1877 *         error occurred.
1878 *
1879 * @retval IMA_SUCCESS
1880 *         Returned if the first burst length properties have been
1881 *         successfully retrieved.
1882 *
1883 * @retval IMA_ERROR_INVALID_PARAMETER
1884 *         Returned if pProps is NULL or specifies a memory area to which
1885 *         data cannot be written.
1886 *
1887 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1888 *         Returned if 'oid' does not specify any valid object type.
1889 *
1890 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1891 *         Returned if 'oid' does not specify a LHBA.
1892 *
1893 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1894 *         Returned if 'oid' does not specify a LHBA which is currently
1895 *         known to the system.
1896 *
1897 *******************************************************************************
1898 */
1899 IMA_API IMA_STATUS IMA_GetFirstBurstLengthProperties(
1900                 IMA_OID oid,
1901                 IMA_MIN_MAX_VALUE *pProps
1902 );
1903 
1904 
1905 /**
1906 *******************************************************************************
1907 *
1908 * Gets the max burst length properties of the specified logical HBA.
1909 *
1910 * @param  oid
1911 *         The object ID of the logical HBA to get the max burst length
1912 *         properties of.
1913 *
1914 * @param  pProps
1915 *         A pointer to an IMA_MIN_MAX_VALUE structure allocated by the
1916 *         caller.  On successful return this structure will contain the max
1917 *         burst length properties of this LHBA.
1918 *
1919 * @return An IMA_STATUS indicating if the operation was successful or if
1920 *         an error occurred.
1921 *
1922 * @retval IMA_SUCCESS
1923 *         Returned if the max burst length properties have been successfully
1924 *         retrieved.
1925 *
1926 * @retval IMA_ERROR_INVALID_PARAMETER
1927 *         Returned if pProps is NULL or specifies a memory area to which
1928 *         data cannot be written.
1929 *
1930 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1931 *         Returned if 'oid' does not specify any valid object type.
1932 *
1933 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1934 *         Returned if 'oid' does not specify a LHBA.
1935 *
1936 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1937 *         Returned if 'oid' does not specify a LHBA which is currently
1938 *         known to the system.
1939 *
1940 *******************************************************************************
1941 */
1942 IMA_API IMA_STATUS IMA_GetMaxBurstLengthProperties(
1943                 IMA_OID Oid,
1944                 IMA_MIN_MAX_VALUE *pProps
1945 );
1946 
1947 /**
1948 *******************************************************************************
1949 *
1950 * Gets the maximum receive data segment length properties of the specified
1951 * logical HBA.
1952 *
1953 * @param  oid
1954 *         The object ID of the logical HBA to get the max receive data
1955 *         segment length properties of.
1956 *
1957 * @param  pProps
1958 *         A pointer to an @ref IMA_MIN_MAX_VALUE structure allocated by the
1959 *         caller.  On successful return this structure will contain the max
1960 *         receive data segment length properties of this LHBA.
1961 *
1962 * @return An IMA_STATUS indicating if the operation was successful or if
1963 *         an error occurred.
1964 *
1965 * @retval IMA_SUCCESS
1966 *         Returned if the max receive data segment length properties
1967 *         have been successfully retrieved.
1968 *
1969 * @retval IMA_ERROR_INVALID_PARAMETER
1970 *         Returned if 'pProps' is NULL or specifies a memory area to which
1971 *         data cannot be written.
1972 *
1973 * @retval IMA_ERROR_INVALID_OBJECT_TYPE
1974 *         Returned if 'oid' does not specify any valid object type.
1975 *
1976 * @retval IMA_ERROR_INCORRECT_OBJECT_TYPE
1977 *         Returned if 'oid' does not specify a LHBA.
1978 *
1979 * @retval IMA_ERROR_OBJECT_NOT_FOUND
1980 *         Returned if 'oid' does not specify a LHBA which is currently
1981 *         known to the system.
1982 *
1983 *******************************************************************************
1984 */
1985 IMA_API IMA_STATUS IMA_GetMaxRecvDataSegmentLengthProperties(
1986                 IMA_OID oid,
1987                 IMA_MIN_MAX_VALUE *pProps
1988 );
1989 
1990 
1991 /*---------------------------------------------*/
1992 IMA_API IMA_STATUS IMA_PluginIOCtl(
1993                 IMA_OID pluginOid,
1994                 IMA_UINT command,
1995                 const void *pInputBuffer,
1996                 IMA_UINT inputBufferLength,
1997                 void *pOutputBuffer,
1998                 IMA_UINT *pOutputBufferLength
1999 );
2000 
2001 
2002 
2003 IMA_API IMA_STATUS IMA_GetNetworkPortalOidList(
2004                 IMA_OID oid,
2005                 IMA_OID_LIST **ppList
2006 );
2007 
2008 IMA_API IMA_STATUS IMA_SetFirstBurstLength(
2009                 IMA_OID oid,
2010                 IMA_UINT firstBurstLength
2011 );
2012 
2013 IMA_API IMA_STATUS IMA_SetMaxBurstLength(
2014                 IMA_OID oid,
2015                 IMA_UINT maxBurstLength
2016 );
2017 
2018 IMA_API IMA_STATUS IMA_SetMaxRecvDataSegmentLength(
2019                 IMA_OID oid,
2020                 IMA_UINT maxRecvDataSegmentLength
2021 );
2022 
2023 IMA_API IMA_STATUS IMA_GetMaxConnectionsProperties(
2024                 IMA_OID oid,
2025                 IMA_MIN_MAX_VALUE *pProps
2026 );
2027 
2028 IMA_API IMA_STATUS IMA_SetMaxConnections(
2029                 IMA_OID oid,
2030                 IMA_UINT maxConnections
2031 );
2032 
2033 IMA_API IMA_STATUS IMA_GetDefaultTime2RetainProperties(
2034                 IMA_OID oid,
2035                 IMA_MIN_MAX_VALUE *pProps
2036 );
2037 
2038 IMA_API IMA_STATUS IMA_SetDefaultTime2Retain(
2039                 IMA_OID oid,
2040                 IMA_UINT defaultTime2Retain
2041 );
2042 
2043 IMA_API IMA_STATUS IMA_GetDefaultTime2WaitProperties(
2044                 IMA_OID oid,
2045                 IMA_MIN_MAX_VALUE *pProps
2046 );
2047 
2048 IMA_API IMA_STATUS IMA_SetDefaultTime2Wait(
2049                 IMA_OID oid,
2050                 IMA_UINT defaultTime2Wait
2051 );
2052 
2053 IMA_API IMA_STATUS IMA_GetMaxOutstandingR2TProperties(
2054                 IMA_OID oid,
2055                 IMA_MIN_MAX_VALUE *pProps
2056 );
2057 
2058 IMA_API IMA_STATUS IMA_SetMaxOutstandingR2T(
2059                 IMA_OID oid,
2060                 IMA_UINT maxOutstandingR2T
2061 );
2062 
2063 IMA_API IMA_STATUS IMA_GetErrorRecoveryLevelProperties(
2064                 IMA_OID oid,
2065                 IMA_MIN_MAX_VALUE *pProps
2066 );
2067 
2068 IMA_API IMA_STATUS IMA_SetErrorRecoveryLevel(
2069                 IMA_OID oid,
2070                 IMA_UINT errorRecoveryLevel
2071 );
2072 
2073 IMA_API IMA_STATUS IMA_GetInitialR2TProperties(
2074                 IMA_OID oid,
2075                 IMA_BOOL_VALUE *pProps
2076 );
2077 
2078 IMA_API IMA_STATUS IMA_SetInitialR2T(
2079                 IMA_OID oid,
2080                 IMA_BOOL initialR2T
2081 );
2082 
2083 IMA_API IMA_STATUS IMA_GetImmediateDataProperties(
2084                 IMA_OID oid,
2085                 IMA_BOOL_VALUE *pProps
2086 );
2087 
2088 IMA_API IMA_STATUS IMA_SetImmediateData(
2089                 IMA_OID oid,
2090                 IMA_BOOL immediateData
2091 );
2092 
2093 IMA_API IMA_STATUS IMA_GetDataPduInOrderProperties(
2094                 IMA_OID oid,
2095                 IMA_BOOL_VALUE *pProps
2096 );
2097 
2098 IMA_API IMA_STATUS IMA_SetDataPduInOrder(
2099                 IMA_OID oid,
2100                 IMA_BOOL dataPduInOrder
2101 );
2102 
2103 IMA_API IMA_STATUS IMA_GetDataSequenceInOrderProperties(
2104                 IMA_OID oid,
2105                 IMA_BOOL_VALUE *pProps
2106 );
2107 
2108 IMA_API IMA_STATUS IMA_SetDataSequenceInOrder(
2109                 IMA_OID oid,
2110                 IMA_BOOL dataSequenceInOrder
2111 );
2112 
2113 IMA_API IMA_STATUS IMA_SetStatisticsCollection(
2114                 IMA_OID oid,
2115                 IMA_BOOL enableStatisticsCollection
2116 );
2117 
2118 IMA_API IMA_STATUS IMA_GetNetworkPortStatus(
2119                 IMA_OID portOid,
2120                 IMA_NETWORK_PORT_STATUS *pStatus
2121 );
2122 
2123 IMA_API IMA_STATUS IMA_GetTargetOidList(
2124                 IMA_OID oid,
2125                 IMA_OID_LIST **ppList
2126 );
2127 
2128 IMA_API IMA_STATUS IMA_RemoveStaleData(
2129                 IMA_OID lhbaOid
2130 );
2131 
2132 IMA_API	IMA_STATUS IMA_SetIsnsDiscovery(
2133 		IMA_OID phbaId,
2134 		IMA_BOOL enableIsnsDiscovery,
2135 		IMA_ISNS_DISCOVERY_METHOD discoveryMethod,
2136 		const IMA_HOST_ID *iSnsHost
2137 );
2138 
2139 IMA_API IMA_STATUS IMA_SetSlpDiscovery(
2140                 IMA_OID phbaOid,
2141                 IMA_BOOL enableSlpDiscovery
2142 );
2143 
2144 IMA_API IMA_STATUS IMA_SetStaticDiscovery(
2145                 IMA_OID phbaOid,
2146                 IMA_BOOL enableStaticDiscovery
2147 );
2148 
2149 IMA_API IMA_STATUS IMA_SetSendTargetsDiscovery(
2150                 IMA_OID oid,
2151                 IMA_BOOL enableSendTargetsDiscovery
2152 );
2153 
2154 IMA_API IMA_STATUS IMA_RemoveStaticDiscoveryTarget(
2155                 IMA_OID targetOid
2156 );
2157 
2158 IMA_API IMA_STATUS IMA_GetIpsecProperties(
2159                 IMA_OID phbaOid,
2160                 IMA_IPSEC_PROPERTIES *pProps
2161 );
2162 
2163 IMA_API IMA_STATUS IMA_GetPnpOidList(
2164                 IMA_OID oid,
2165                 IMA_OID_LIST **ppList
2166 );
2167 
2168 IMA_API IMA_STATUS IMA_GetPhbaDownloadProperties(
2169                 IMA_OID phbaOid,
2170                 IMA_PHBA_DOWNLOAD_PROPERTIES *pProps
2171 );
2172 
2173 IMA_API IMA_STATUS IMA_IsPhbaDownloadFile(
2174                 IMA_OID phbaOid,
2175                 const IMA_WCHAR *pFileName,
2176                 IMA_PHBA_DOWNLOAD_IMAGE_PROPERTIES *pProps
2177 );
2178 
2179 IMA_API IMA_STATUS IMA_PhbaDownload(
2180                 IMA_OID phbaOid,
2181                 IMA_PHBA_DOWNLOAD_IMAGE_TYPE imageType,
2182                 const IMA_WCHAR *pFileName
2183 );
2184 
2185 IMA_API IMA_STATUS IMA_GetNetworkPortalProperties(
2186                 IMA_OID networkPortalOid,
2187                 IMA_NETWORK_PORTAL_PROPERTIES *pProps
2188 );
2189 
2190 IMA_API IMA_STATUS IMA_SetNetworkPortalIpAddress(
2191                 IMA_OID networkPortalOid,
2192                 const IMA_IP_ADDRESS NewIpAddress
2193 );
2194 
2195 IMA_API IMA_STATUS IMA_GetLnpOidList(
2196                 IMA_OID_LIST **ppList
2197 );
2198 
2199 IMA_API IMA_STATUS IMA_GetLnpProperties(
2200                 IMA_OID lnpOid,
2201                 IMA_LNP_PROPERTIES *pProps
2202 );
2203 
2204 IMA_API IMA_STATUS IMA_GetPnpProperties(
2205                 IMA_OID pnpOid,
2206                 IMA_PNP_PROPERTIES *pProps
2207 );
2208 
2209 IMA_API IMA_STATUS IMA_GetPnpStatistics(
2210                 IMA_OID pnpOid,
2211                 IMA_PNP_STATISTICS *pStats
2212 );
2213 
2214 IMA_API IMA_STATUS IMA_GetTargetProperties(
2215                 IMA_OID targetOid,
2216                 IMA_TARGET_PROPERTIES *pProps
2217 );
2218 
2219 IMA_API IMA_STATUS IMA_GetTargetErrorStatistics(
2220                 IMA_OID targetOid,
2221                 IMA_TARGET_ERROR_STATISTICS *pStats
2222 );
2223 
2224 IMA_API IMA_STATUS IMA_GetLuOidList(
2225                 IMA_OID oid,
2226                 IMA_OID_LIST **ppList
2227 );
2228 
2229 IMA_API IMA_STATUS IMA_GetLuOid(
2230                 IMA_OID targetOid,
2231                 IMA_UINT64 lun,
2232                 IMA_OID *pluOid
2233 );
2234 
2235 IMA_API IMA_STATUS IMA_GetLuProperties(
2236                 IMA_OID luOid,
2237                 IMA_LU_PROPERTIES *pProps
2238 );
2239 
2240 IMA_API IMA_STATUS IMA_GetStatisticsProperties(
2241                 IMA_OID oid,
2242                 IMA_STATISTICS_PROPERTIES *pProps
2243 );
2244 
2245 IMA_API IMA_STATUS IMA_GetDeviceStatistics(
2246                 IMA_OID oid,
2247                 IMA_DEVICE_STATISTICS *pStats
2248 );
2249 
2250 IMA_API IMA_STATUS IMA_LuInquiry(
2251                 IMA_OID deviceOid,
2252                 IMA_BOOL evpd,
2253                 IMA_BOOL cmddt,
2254                 IMA_BYTE pageCode,
2255 
2256                 IMA_BYTE *pOutputBuffer,
2257                 IMA_UINT *pOutputBufferLength,
2258 
2259                 IMA_BYTE *pSenseBuffer,
2260                 IMA_UINT *pSenseBufferLength
2261 );
2262 
2263 IMA_API IMA_STATUS IMA_LuReadCapacity(
2264                 IMA_OID deviceOid,
2265                 IMA_UINT cdbLength,
2266                 IMA_BYTE *pOutputBuffer,
2267                 IMA_UINT *pOutputBufferLength,
2268 
2269                 IMA_BYTE *pSenseBuffer,
2270                 IMA_UINT *pSenseBufferLength
2271 );
2272 
2273 IMA_API IMA_STATUS IMA_LuReportLuns(
2274                 IMA_OID deviceOid,
2275                 IMA_BOOL sendToWellKnownLun,
2276                 IMA_BYTE selectReport,
2277 
2278                 IMA_BYTE *pOutputBuffer,
2279                 IMA_UINT *pOutputBufferLength,
2280 
2281                 IMA_BYTE *pSenseBuffer,
2282                 IMA_UINT *pSenseBufferLength
2283 );
2284 
2285 IMA_API IMA_STATUS IMA_ExposeLu(
2286                 IMA_OID luOid
2287 );
2288 
2289 IMA_API IMA_STATUS IMA_UnexposeLu(
2290                 IMA_OID luOid
2291 );
2292 
2293 IMA_API IMA_STATUS IMA_GetPhbaStatus(
2294                 IMA_OID hbaOid,
2295                 IMA_PHBA_STATUS *pStatus
2296 );
2297 
2298 IMA_API IMA_STATUS IMA_RegisterForObjectVisibilityChanges (
2299                 IMA_OBJECT_VISIBILITY_FN pClientFn
2300 );
2301 
2302 IMA_API IMA_STATUS IMA_DeregisterForObjectVisibilityChanges (
2303                 IMA_OBJECT_VISIBILITY_FN pClientFn
2304 );
2305 
2306 IMA_API IMA_STATUS IMA_RegisterForObjectPropertyChanges (
2307                 IMA_OBJECT_PROPERTY_FN pClientFn
2308 );
2309 
2310 IMA_API IMA_STATUS IMA_DeregisterForObjectPropertyChanges (
2311                 IMA_OBJECT_PROPERTY_FN pClientFn
2312 );
2313 
2314 
2315 IMA_API IMA_STATUS IMA_GetAddressKeyProperties(
2316                 IMA_OID targetOid,
2317                 IMA_ADDRESS_KEY_PROPERTIES **ppProps
2318 );
2319 
2320 IMA_API IMA_STATUS IMA_GetIpProperties(
2321                 IMA_OID oid,
2322                 IMA_IP_PROPERTIES *pProps
2323 );
2324 
2325 IMA_API IMA_STATUS IMA_SetIpConfigMethod(
2326                 IMA_OID oid,
2327                 IMA_BOOL enableDhcpIpConfiguration
2328 );
2329 
2330 IMA_API	IMA_STATUS IMA_SetIsnsDiscovery(
2331 		IMA_OID oid,
2332 		IMA_BOOL enableIsnsDiscovery,
2333 		IMA_ISNS_DISCOVERY_METHOD discoveryMethod,
2334 		const IMA_HOST_ID *iSnsHost
2335 );
2336 
2337 
2338 IMA_API IMA_STATUS IMA_SetSubnetMask(
2339                 IMA_OID oid,
2340                 IMA_IP_ADDRESS subnetMask
2341 );
2342 
2343 IMA_API IMA_STATUS IMA_SetDnsServerAddress(
2344                 IMA_OID oid,
2345                 const IMA_IP_ADDRESS *pPrimaryDnsServerAddress,
2346                 const IMA_IP_ADDRESS *pAlternateDnsServerAddress
2347 );
2348 
2349 IMA_API IMA_STATUS IMA_SetDefaultGateway(
2350                 IMA_OID oid,
2351                 IMA_IP_ADDRESS defaultGateway
2352 );
2353 
2354 IMA_API IMA_STATUS IMA_GetSupportedAuthMethods(
2355                 IMA_OID lhbaOid,
2356                 IMA_BOOL getSettableMethods,
2357                 IMA_UINT *pMethodCount,
2358                 IMA_AUTHMETHOD *pMethodList
2359 );
2360 
2361 IMA_API IMA_STATUS IMA_GetInUseInitiatorAuthMethods(
2362                 IMA_OID lhbaOid,
2363                 IMA_UINT        *pMethodCount,
2364                 IMA_AUTHMETHOD  *pMethodList
2365 );
2366 
2367 IMA_API IMA_STATUS IMA_GetInitiatorAuthParms(
2368                 IMA_OID lhbaOid,
2369                 IMA_AUTHMETHOD method,
2370                 IMA_INITIATOR_AUTHPARMS *pParms
2371 );
2372 
2373 IMA_API IMA_STATUS IMA_SetInitiatorAuthMethods(
2374                 IMA_OID lhbaOid,
2375                 IMA_UINT methodCount,
2376                 const IMA_AUTHMETHOD *pMethodList
2377 );
2378 
2379 IMA_API IMA_STATUS IMA_SetInitiatorAuthParms(
2380                 IMA_OID lhbaOid,
2381                 IMA_AUTHMETHOD method,
2382                 const IMA_INITIATOR_AUTHPARMS *pParms
2383 );
2384 
2385 
2386 IMA_API IMA_STATUS IMA_GetStaticDiscoveryTargetOidList (
2387                 IMA_OID oid,
2388                 IMA_OID_LIST **ppList
2389 );
2390 
2391 IMA_API IMA_STATUS IMA_GetStaticDiscoveryTargetProperties(
2392 		IMA_OID staticDiscoveryTargetOid,
2393 		IMA_STATIC_DISCOVERY_TARGET_PROPERTIES *pProps
2394 );
2395 
2396 IMA_API IMA_STATUS IMA_SetStaticDiscovery(
2397 		IMA_OID oid,
2398 		IMA_BOOL enableStaticDiscovery
2399 );
2400 
2401 IMA_API IMA_STATUS IMA_GetDiscoveryProperties(
2402 		IMA_OID oid,
2403 		IMA_DISCOVERY_PROPERTIES *pProps
2404 );
2405 
2406 IMA_API IMA_STATUS IMA_AddDiscoveryAddress(
2407 		IMA_OID oid,
2408 		const IMA_TARGET_ADDRESS discoveryAddress,
2409 		IMA_OID *pDiscoveryAddressOid
2410 );
2411 
2412 IMA_API IMA_STATUS IMA_AddStaticDiscoveryTarget(
2413 		IMA_OID oid,
2414 		const IMA_STATIC_DISCOVERY_TARGET staticDiscoveryTarget,
2415 		IMA_OID *pStaticDiscoveryTargetOid
2416 );
2417 
2418 IMA_API IMA_STATUS IMA_GetAddressKeys(
2419 		IMA_OID targetOid,
2420 		IMA_ADDRESS_KEYS **ppKeys
2421 );
2422 
2423 IMA_API IMA_STATUS IMA_GetSessionOidList (
2424 		IMA_OID oid,
2425 		IMA_OID_LIST **ppList
2426 );
2427 
2428 IMA_API IMA_STATUS IMA_GetConnectionOidList (
2429 		IMA_OID oid,
2430 		IMA_OID_LIST **ppList
2431 );
2432 
2433 IMA_API IMA_STATUS IMA_GetDiscoveryAddressOidList (
2434 		IMA_OID oid,
2435 		IMA_OID_LIST **ppList
2436 );
2437 
2438 IMA_API IMA_STATUS IMA_GetDiscoveryAddressProperties (
2439 		IMA_OID discoveryAddressOid,
2440 		IMA_DISCOVERY_ADDRESS_PROPERTIES *pProps
2441 );
2442 
2443 IMA_API IMA_STATUS IMA_RemoveDiscoveryAddress (
2444 		IMA_OID oid
2445 );
2446 
2447 IMA_API IMA_STATUS QIMA_SetUpdateInterval(IMA_OID pluginOid, time_t interval);
2448 
2449 IMA_API IMA_STATUS IMA_CommitHbaParameters (IMA_OID lhba, IMA_COMMIT_LEVEL commitLevel);
2450 
2451 #endif
2452 
2453 #ifdef __cplusplus
2454 };
2455 #endif
2456 
2457 
2458