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