2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 #ifndef __BFA_DEFS_AUTH_H__
18 #define __BFA_DEFS_AUTH_H__
20 #include <defs/bfa_defs_types.h>
22 #define PUBLIC_KEY 15409
23 #define PRIVATE_KEY 19009
25 #define BFA_AUTH_SECRET_STRING_LEN 256
26 #define BFA_AUTH_FAIL_NO_PASSWORD 0xFE
27 #define BFA_AUTH_FAIL_TIMEOUT 0xFF
30 * Authentication status
32 enum bfa_auth_status
{
33 BFA_AUTH_STATUS_NONE
= 0, /* no authentication */
34 BFA_AUTH_UNINIT
= 1, /* state - uninit */
35 BFA_AUTH_NEG_SEND
= 2, /* state - negotiate send */
36 BFA_AUTH_CHAL_WAIT
= 3, /* state - challenge wait */
37 BFA_AUTH_NEG_RETRY
= 4, /* state - negotiate retry */
38 BFA_AUTH_REPLY_SEND
= 5, /* state - reply send */
39 BFA_AUTH_STATUS_WAIT
= 6, /* state - status wait */
40 BFA_AUTH_SUCCESS
= 7, /* state - success */
41 BFA_AUTH_FAILED
= 8, /* state - failed */
42 BFA_AUTH_STATUS_UNKNOWN
= 9, /* authentication status unknown */
45 enum bfa_auth_rej_code
{
46 BFA_AUTH_RJT_CODE_AUTH_FAILURE
= 1, /* auth failure */
47 BFA_AUTH_RJT_CODE_LOGICAL_ERR
= 2, /* logical error */
51 * Authentication reject codes
53 enum bfa_auth_rej_code_exp
{
54 BFA_AUTH_MECH_NOT_USABLE
= 1, /* auth. mechanism not usable */
55 BFA_AUTH_DH_GROUP_NOT_USABLE
= 2, /* DH Group not usable */
56 BFA_AUTH_HASH_FUNC_NOT_USABLE
= 3, /* hash Function not usable */
57 BFA_AUTH_AUTH_XACT_STARTED
= 4, /* auth xact started */
58 BFA_AUTH_AUTH_FAILED
= 5, /* auth failed */
59 BFA_AUTH_INCORRECT_PLD
= 6, /* incorrect payload */
60 BFA_AUTH_INCORRECT_PROTO_MSG
= 7, /* incorrect proto msg */
61 BFA_AUTH_RESTART_AUTH_PROTO
= 8, /* restart auth protocol */
62 BFA_AUTH_AUTH_CONCAT_NOT_SUPP
= 9, /* auth concat not supported */
63 BFA_AUTH_PROTO_VER_NOT_SUPP
= 10,/* proto version not supported */
66 struct auth_proto_stats_s
{
71 u32 dhchap_challenges
;
77 * Authentication related statistics
79 struct bfa_auth_stats_s
{
80 u32 auth_failures
; /* authentication failures */
81 u32 auth_successes
; /* authentication successes*/
82 struct auth_proto_stats_s auth_rx_stats
; /* Rx protocol stats */
83 struct auth_proto_stats_s auth_tx_stats
; /* Tx protocol stats */
87 * Authentication hash function algorithms
90 BFA_AUTH_ALGO_MD5
= 1, /* Message-Digest algorithm 5 */
91 BFA_AUTH_ALGO_SHA1
= 2, /* Secure Hash Algorithm 1 */
92 BFA_AUTH_ALGO_MS
= 3, /* MD5, then SHA-1 */
93 BFA_AUTH_ALGO_SM
= 4, /* SHA-1, then MD5 */
99 * Current value could be combination of one or more of the following values
101 enum bfa_auth_group
{
102 BFA_AUTH_GROUP_DHNULL
= 0, /* DH NULL (value == 0) */
103 BFA_AUTH_GROUP_DH768
= 1, /* DH group 768 (value == 1) */
104 BFA_AUTH_GROUP_DH1024
= 2, /* DH group 1024 (value == 2) */
105 BFA_AUTH_GROUP_DH1280
= 4, /* DH group 1280 (value == 3) */
106 BFA_AUTH_GROUP_DH1536
= 8, /* DH group 1536 (value == 4) */
108 BFA_AUTH_GROUP_ALL
= 256 /* Use default DH group order
113 * Authentication secret sources
115 enum bfa_auth_secretsource
{
116 BFA_AUTH_SECSRC_LOCAL
= 1, /* locally configured */
117 BFA_AUTH_SECSRC_RADIUS
= 2, /* use radius server */
118 BFA_AUTH_SECSRC_TACACS
= 3, /* TACACS server */
122 * Authentication attributes
124 struct bfa_auth_attr_s
{
125 enum bfa_auth_status status
;
126 enum bfa_auth_algo algo
;
127 enum bfa_auth_group dh_grp
;
134 #endif /* __BFA_DEFS_AUTH_H__ */