2 Define NVData structures used by the iSCSI configuration component.
4 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _ISCSI_NVDATASTRUC_H_
16 #define _ISCSI_NVDATASTRUC_H_
18 #define ISCSI_CONFIG_GUID \
20 0x6456ed61, 0x3579, 0x41c9, { 0x8a, 0x26, 0x0a, 0x0b, 0xd6, 0x2b, 0x78, 0xfc } \
23 #define VAR_EQ_TEST_NAME 0x100
24 #define CONFIGURATION_VARSTORE_ID 0x6666
26 #define FORMID_MAIN_FORM 1
27 #define FORMID_MAC_FORM 2
28 #define FORMID_ATTEMPT_FORM 3
29 #define FORMID_ORDER_FORM 4
30 #define FORMID_DELETE_FORM 5
32 #define ISCSI_NAME_IFR_MIN_SIZE 4
33 #define ISCSI_NAME_IFR_MAX_SIZE 223
34 #define ISCSI_NAME_MAX_SIZE 224
36 #define ATTEMPT_NAME_MAX_SIZE 96
37 #define ATTEMPT_NAME_SIZE 10
39 #define CONNECT_MIN_RETRY 0
40 #define CONNECT_MAX_RETRY 16
42 #define CONNECT_MIN_TIMEOUT 100
43 #define CONNECT_MAX_TIMEOUT 20000
44 #define CONNECT_DEFAULT_TIMEOUT 1000
46 #define ISCSI_MAX_ATTEMPTS_NUM 255
48 #define ISCSI_DISABLED 0
49 #define ISCSI_ENABLED 1
50 #define ISCSI_ENABLED_FOR_MPIO 2
54 #define IP_MODE_AUTOCONFIG 2
56 #define ISCSI_AUTH_TYPE_NONE 0
57 #define ISCSI_AUTH_TYPE_CHAP 1
58 #define ISCSI_AUTH_TYPE_KRB 2
60 #define IP4_MIN_SIZE 7
61 #define IP4_MAX_SIZE 15
62 #define IP4_STR_MAX_SIZE 16
65 // Macros used for an IPv4 or an IPv6 address.
68 #define IP_MAX_SIZE 39
69 #define IP_STR_MAX_SIZE 40
71 #define LUN_MIN_SIZE 1
72 #define LUN_MAX_SIZE 20
74 #define ISCSI_CHAP_UNI 1
75 #define ISCSI_CHAP_MUTUAL 2
77 #define TARGET_PORT_MIN_NUM 0
78 #define TARGET_PORT_MAX_NUM 65535
79 #define LABEL_END 0xffff
81 #define KEY_INITIATOR_NAME 0x101
82 #define KEY_DHCP_ENABLE 0x102
83 #define KEY_LOCAL_IP 0x103
84 #define KEY_SUBNET_MASK 0x104
85 #define KEY_GATE_WAY 0x105
86 #define KEY_TARGET_IP 0x106
87 #define KEY_CHAP_NAME 0x107
88 #define KEY_CHAP_SECRET 0x108
89 #define KEY_REVERSE_CHAP_NAME 0x109
90 #define KEY_REVERSE_CHAP_SECRET 0x10a
91 #define KEY_SAVE_CHANGES 0x10b
92 #define KEY_TARGET_NAME 0x10c
93 #define KEY_BOOT_LUN 0x10d
95 #define KEY_ADD_ATTEMPT 0x10e
96 #define KEY_SAVE_ATTEMPT_CONFIG 0x10f
97 #define KEY_ORDER_ATTEMPT_CONFIG 0x110
98 #define KEY_SAVE_ORDER_CHANGES 0x111
99 #define KEY_IGNORE_ORDER_CHANGES 0x112
100 #define KEY_ATTEMPT_NAME 0x113
101 #define KEY_SAVE_DELETE_ATTEMPT 0x114
102 #define KEY_IGNORE_DELETE_ATTEMPT 0x115
103 #define KEY_DELETE_ATTEMPT 0x116
105 #define KEY_IP_MODE 0x11c
106 #define KEY_AUTH_TYPE 0x11d
107 #define KEY_CONFIG_ISID 0x11e
109 #define ATTEMPT_ENTRY_LABEL 0x9000
110 #define KEY_ATTEMPT_ENTRY_BASE 0xa000
111 #define KEY_DE_ATTEMPT_ENTRY_BASE 0xb000
113 #define KEY_DEVICE_ENTRY_BASE 0x1000
114 #define KEY_MAC_ENTRY_BASE 0x2000
115 #define MAC_ENTRY_LABEL 0x3000
116 #define ORDER_ENTRY_LABEL 0x4000
117 #define DELETE_ENTRY_LABEL 0x5000
118 #define CONFIG_OPTION_OFFSET 0x9000
120 #define ISCSI_LUN_STR_MAX_LEN 21
121 #define ISCSI_CHAP_SECRET_MIN_LEN 12
122 #define ISCSI_CHAP_SECRET_MAX_LEN 16
124 // ISCSI_CHAP_SECRET_STORAGE = ISCSI_CHAP_SECRET_MAX_LEN + sizeof (NULL-Terminator)
126 #define ISCSI_CHAP_SECRET_STORAGE 17
127 #define ISCSI_CHAP_NAME_MAX_LEN 126
128 #define ISCSI_CHAP_NAME_STORAGE 127
130 #define KERBEROS_SECRET_MIN_LEN 12
131 #define KERBEROS_SECRET_MAX_LEN 16
132 #define KERBEROS_SECRET_STORAGE 17
133 #define KERBEROS_NAME_MAX_LEN 96
134 #define KERBEROS_KDC_PORT_MIN_NUM 0
135 #define KERBEROS_KDC_PORT_MAX_NUM 65535
137 #define ISID_CONFIGURABLE_MIN_LEN 6
138 #define ISID_CONFIGURABLE_MAX_LEN 12
139 #define ISID_CONFIGURABLE_STORAGE 13
142 typedef struct _ISCSI_CONFIG_IFR_NVDATA
{
143 CHAR16 InitiatorName
[ISCSI_NAME_MAX_SIZE
];
144 CHAR16 AttemptName
[ATTEMPT_NAME_MAX_SIZE
];
149 UINT8 ConnectRetryCount
;
151 UINT16 ConnectTimeout
; // Timeout value in milliseconds.
153 UINT8 InitiatorInfoFromDhcp
;
154 UINT8 TargetInfoFromDhcp
;
155 CHAR16 LocalIp
[IP4_STR_MAX_SIZE
];
156 CHAR16 SubnetMask
[IP4_STR_MAX_SIZE
];
157 CHAR16 Gateway
[IP4_STR_MAX_SIZE
];
159 CHAR16 TargetName
[ISCSI_NAME_MAX_SIZE
];
160 CHAR16 TargetIp
[IP_STR_MAX_SIZE
];
162 CHAR16 BootLun
[ISCSI_LUN_STR_MAX_LEN
];
164 UINT8 AuthenticationType
;
167 CHAR16 CHAPName
[ISCSI_CHAP_NAME_STORAGE
];
168 CHAR16 CHAPSecret
[ISCSI_CHAP_SECRET_STORAGE
];
169 CHAR16 ReverseCHAPName
[ISCSI_CHAP_NAME_STORAGE
];
170 CHAR16 ReverseCHAPSecret
[ISCSI_CHAP_SECRET_STORAGE
];
172 BOOLEAN MutualRequired
;
174 CHAR16 KerberosUserName
[KERBEROS_NAME_MAX_LEN
];
175 CHAR16 KerberosUserSecret
[KERBEROS_SECRET_STORAGE
];
176 CHAR16 KerberosKDCName
[KERBEROS_NAME_MAX_LEN
];
177 CHAR16 KerberosKDCRealm
[KERBEROS_NAME_MAX_LEN
];
178 CHAR16 KerberosKDCIp
[IP_STR_MAX_SIZE
];
179 UINT16 KerberosKDCPort
;
181 UINT8 DynamicOrderedList
[ISCSI_MAX_ATTEMPTS_NUM
];
182 UINT8 DeleteAttemptList
[ISCSI_MAX_ATTEMPTS_NUM
];
184 CHAR16 IsId
[ISID_CONFIGURABLE_STORAGE
];
185 } ISCSI_CONFIG_IFR_NVDATA
;