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 /*
23 * Copyright 2010 Emulex. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef _EMLXS_DHCHAP_H
28 #define _EMLXS_DHCHAP_H
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #ifdef DHCHAP_SUPPORT
35 #include <sys/random.h>
36
37
38 /* emlxs_auth_cfg_t */
39 #define PASSWORD_TYPE_ASCII 1
40 #define PASSWORD_TYPE_BINARY 2
41 #define PASSWORD_TYPE_IGNORE 3
42
43 #define AUTH_MODE_DISABLED 1
44 #define AUTH_MODE_ACTIVE 2
45 #define AUTH_MODE_PASSIVE 3
259 #define ESC_EMLXS_34 "ESC_emlxs_ioctl_auth_setpwd"
260 #define ESC_EMLXS_35 "ESC_emlxs_ioctl_auth_delcfg"
261 #define ESC_EMLXS_36 "ESC_emlxs_ioctl_auth_delpwd"
262
263
264 /* From HBAnyware dfc lib FC-SP */
265 typedef struct emlxs_auth_cfg
266 {
267 NAME_TYPE local_entity; /* host wwpn (NPIV support) */
268 NAME_TYPE remote_entity; /* switch or target wwpn */
269 uint32_t authentication_timeout;
270 uint32_t authentication_mode;
271 uint32_t bidirectional:1;
272 uint32_t reserved:31;
273 uint32_t authentication_type_priority[4];
274 uint32_t hash_priority[4];
275 uint32_t dh_group_priority[8];
276 uint32_t reauthenticate_time_interval;
277
278 dfc_auth_status_t auth_status;
279 time_t auth_time;
280 struct emlxs_node *node;
281
282 struct emlxs_auth_cfg *prev;
283 struct emlxs_auth_cfg *next;
284 } emlxs_auth_cfg_t;
285
286
287 typedef struct emlxs_auth_key
288 {
289 NAME_TYPE local_entity; /* host wwpn */
290 /* (NPIV support) */
291 NAME_TYPE remote_entity; /* switch or target */
292 /* wwpn */
293 uint16_t local_password_length;
294 uint16_t local_password_type;
295 uint8_t local_password[128]; /* hba authenticates */
296 /* to switch */
297 uint16_t remote_password_length;
298 uint16_t remote_password_type;
299 uint8_t remote_password[128]; /* hba authenticates */
339
340 /*
341 * emlxs_port_dhc struct to be used by emlxs_port_t in emlxs_fc.h
342 *
343 * This structure contains all the data used by DHCHAP.
344 * They are from EMLXSHBA_t in emlxs driver.
345 *
346 */
347 typedef struct emlxs_port_dhc
348 {
349
350 int32_t state;
351 #define ELX_FABRIC_STATE_UNKNOWN 0x00
352 #define ELX_FABRIC_AUTH_DISABLED 0x01
353 #define ELX_FABRIC_AUTH_FAILED 0x02
354 #define ELX_FABRIC_AUTH_SUCCESS 0x03
355 #define ELX_FABRIC_IN_AUTH 0x04
356 #define ELX_FABRIC_IN_REAUTH 0x05
357
358 dfc_auth_status_t auth_status; /* Fabric auth status */
359 time_t auth_time;
360
361 } emlxs_port_dhc_t;
362
363
364 /* Node Events */
365 #define NODE_EVENT_DEVICE_RM 0x0 /* Auth response timeout and */
366 /* fail */
367 #define NODE_EVENT_DEVICE_RECOVERY 0x1 /* Auth response timeout and */
368 /* recovery */
369 #define NODE_EVENT_RCV_AUTH_MSG 0x2 /* Unsolicited Auth received */
370 #define NODE_EVENT_CMPL_AUTH_MSG 0x3
371 #define NODE_EVENT_MAX_EVENT 0x4
372
373 /*
374 * emlxs_node_dhc struct to be used in emlxs_node_t.
375 * They are from emlxs_nodelist_t in emlxs driver.
376 */
377 typedef struct emlxs_node_dhc
378 {
379 uint16_t state; /* used for state machine */
|
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 /*
23 * Copyright 2010 Emulex. All rights reserved.
24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
28 */
29
30 #ifndef _EMLXS_DHCHAP_H
31 #define _EMLXS_DHCHAP_H
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #ifdef DHCHAP_SUPPORT
38 #include <sys/random.h>
39
40
41 /* emlxs_auth_cfg_t */
42 #define PASSWORD_TYPE_ASCII 1
43 #define PASSWORD_TYPE_BINARY 2
44 #define PASSWORD_TYPE_IGNORE 3
45
46 #define AUTH_MODE_DISABLED 1
47 #define AUTH_MODE_ACTIVE 2
48 #define AUTH_MODE_PASSIVE 3
262 #define ESC_EMLXS_34 "ESC_emlxs_ioctl_auth_setpwd"
263 #define ESC_EMLXS_35 "ESC_emlxs_ioctl_auth_delcfg"
264 #define ESC_EMLXS_36 "ESC_emlxs_ioctl_auth_delpwd"
265
266
267 /* From HBAnyware dfc lib FC-SP */
268 typedef struct emlxs_auth_cfg
269 {
270 NAME_TYPE local_entity; /* host wwpn (NPIV support) */
271 NAME_TYPE remote_entity; /* switch or target wwpn */
272 uint32_t authentication_timeout;
273 uint32_t authentication_mode;
274 uint32_t bidirectional:1;
275 uint32_t reserved:31;
276 uint32_t authentication_type_priority[4];
277 uint32_t hash_priority[4];
278 uint32_t dh_group_priority[8];
279 uint32_t reauthenticate_time_interval;
280
281 dfc_auth_status_t auth_status;
282 uint32_t auth_time;
283 struct emlxs_node *node;
284
285 struct emlxs_auth_cfg *prev;
286 struct emlxs_auth_cfg *next;
287 } emlxs_auth_cfg_t;
288
289
290 typedef struct emlxs_auth_key
291 {
292 NAME_TYPE local_entity; /* host wwpn */
293 /* (NPIV support) */
294 NAME_TYPE remote_entity; /* switch or target */
295 /* wwpn */
296 uint16_t local_password_length;
297 uint16_t local_password_type;
298 uint8_t local_password[128]; /* hba authenticates */
299 /* to switch */
300 uint16_t remote_password_length;
301 uint16_t remote_password_type;
302 uint8_t remote_password[128]; /* hba authenticates */
342
343 /*
344 * emlxs_port_dhc struct to be used by emlxs_port_t in emlxs_fc.h
345 *
346 * This structure contains all the data used by DHCHAP.
347 * They are from EMLXSHBA_t in emlxs driver.
348 *
349 */
350 typedef struct emlxs_port_dhc
351 {
352
353 int32_t state;
354 #define ELX_FABRIC_STATE_UNKNOWN 0x00
355 #define ELX_FABRIC_AUTH_DISABLED 0x01
356 #define ELX_FABRIC_AUTH_FAILED 0x02
357 #define ELX_FABRIC_AUTH_SUCCESS 0x03
358 #define ELX_FABRIC_IN_AUTH 0x04
359 #define ELX_FABRIC_IN_REAUTH 0x05
360
361 dfc_auth_status_t auth_status; /* Fabric auth status */
362 uint32_t auth_time;
363
364 } emlxs_port_dhc_t;
365
366
367 /* Node Events */
368 #define NODE_EVENT_DEVICE_RM 0x0 /* Auth response timeout and */
369 /* fail */
370 #define NODE_EVENT_DEVICE_RECOVERY 0x1 /* Auth response timeout and */
371 /* recovery */
372 #define NODE_EVENT_RCV_AUTH_MSG 0x2 /* Unsolicited Auth received */
373 #define NODE_EVENT_CMPL_AUTH_MSG 0x3
374 #define NODE_EVENT_MAX_EVENT 0x4
375
376 /*
377 * emlxs_node_dhc struct to be used in emlxs_node_t.
378 * They are from emlxs_nodelist_t in emlxs driver.
379 */
380 typedef struct emlxs_node_dhc
381 {
382 uint16_t state; /* used for state machine */
|