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.
21 #include <protocol/types.h>
26 FC_AUTH_ELS_MORE_FRAGS_FLAG
= 0x80, /*! bit-7. More Fragments
29 FC_AUTH_ELS_CONCAT_FLAG
= 0x40, /*! bit-6. Concatenation Flag */
30 FC_AUTH_ELS_SEQ_NUM_FLAG
= 0x01 /*! bit-0. Sequence Number */
34 FC_AUTH_MC_AUTH_RJT
= 0x0A, /*! Auth Reject */
35 FC_AUTH_MC_AUTH_NEG
= 0x0B, /*! Auth Negotiate */
36 FC_AUTH_MC_AUTH_DONE
= 0x0C, /*! Auth Done */
38 FC_AUTH_MC_DHCHAP_CHAL
= 0x10, /*! DHCHAP Challenge */
39 FC_AUTH_MC_DHCHAP_REPLY
= 0x11, /*! DHCHAP Reply */
40 FC_AUTH_MC_DHCHAP_SUCC
= 0x12, /*! DHCHAP Success */
42 FC_AUTH_MC_FCAP_REQ
= 0x13, /*! FCAP Request */
43 FC_AUTH_MC_FCAP_ACK
= 0x14, /*! FCAP Acknowledge */
44 FC_AUTH_MC_FCAP_CONF
= 0x15, /*! FCAP Confirm */
46 FC_AUTH_MC_FCPAP_INIT
= 0x16, /*! FCPAP Init */
47 FC_AUTH_MC_FCPAP_ACC
= 0x17, /*! FCPAP Accept */
48 FC_AUTH_MC_FCPAP_COMP
= 0x18, /*! FCPAP Complete */
50 FC_AUTH_MC_IKE_SA_INIT
= 0x22, /*! IKE SA INIT */
51 FC_AUTH_MC_IKE_SA_AUTH
= 0x23, /*! IKE SA Auth */
52 FC_AUTH_MC_IKE_CREATE_CHILD_SA
= 0x24, /*! IKE Create Child SA */
53 FC_AUTH_MC_IKE_INFO
= 0x25, /*! IKE informational */
56 enum auth_proto_version
{
57 FC_AUTH_PROTO_VER_1
= 1, /*! Protocol Version 1 */
61 FC_AUTH_ELS_COMMAND_CODE
= 0x90,/*! Authentication ELS Command code */
62 FC_AUTH_PROTO_PARAM_LEN_SZ
= 4, /*! Size of Proto Parameter Len Field */
63 FC_AUTH_PROTO_PARAM_VAL_SZ
= 4, /*! Size of Proto Parameter Val Field */
64 FC_MAX_AUTH_SECRET_LEN
= 256,
65 /*! Maximum secret string length */
66 FC_AUTH_NUM_USABLE_PROTO_LEN_SZ
= 4,
67 /*! Size of usable protocols field */
68 FC_AUTH_RESP_VALUE_LEN_SZ
= 4,
69 /*! Size of response value length */
70 FC_MAX_CHAP_KEY_LEN
= 256, /*! Maximum md5 digest length */
71 FC_MAX_AUTH_RETRIES
= 3, /*! Maximum number of retries */
72 FC_MD5_DIGEST_LEN
= 16, /*! MD5 digest length */
73 FC_SHA1_DIGEST_LEN
= 20, /*! SHA1 digest length */
74 FC_MAX_DHG_SUPPORTED
= 1, /*! Maximum DH Groups supported */
75 FC_MAX_ALG_SUPPORTED
= 1, /*! Maximum algorithms supported */
76 FC_MAX_PROTO_SUPPORTED
= 1, /*! Maximum protocols supported */
77 FC_START_TXN_ID
= 2, /*! Starting transaction ID */
81 FC_AUTH_PROTO_DHCHAP
= 0x00000001,
82 FC_AUTH_PROTO_FCAP
= 0x00000002,
83 FC_AUTH_PROTO_FCPAP
= 0x00000003,
84 FC_AUTH_PROTO_IKEv2
= 0x00000004,
85 FC_AUTH_PROTO_IKEv2_AUTH
= 0x00000005,
89 u16 name_tag
; /*! Name Tag = 1 for Authentication */
90 u16 name_len
; /*! Name Length = 8 for Authentication
92 wwn_t name
; /*! Name. TODO - is this PWWN */
97 FC_AUTH_HASH_FUNC_MD5
= 0x00000005,
98 FC_AUTH_HASH_FUNC_SHA_1
= 0x00000006,
102 FC_AUTH_DH_GID_0_DHG_NULL
= 0x00000000,
103 FC_AUTH_DH_GID_1_DHG_1024
= 0x00000001,
104 FC_AUTH_DH_GID_2_DHG_1280
= 0x00000002,
105 FC_AUTH_DH_GID_3_DHG_1536
= 0x00000003,
106 FC_AUTH_DH_GID_4_DHG_2048
= 0x00000004,
107 FC_AUTH_DH_GID_6_DHG_3072
= 0x00000006,
108 FC_AUTH_DH_GID_7_DHG_4096
= 0x00000007,
109 FC_AUTH_DH_GID_8_DHG_6144
= 0x00000008,
110 FC_AUTH_DH_GID_9_DHG_8192
= 0x00000009,
113 struct auth_els_msg_s
{
114 u8 auth_els_code
; /* Authentication ELS Code (0x90) */
115 u8 auth_els_flag
; /* Authentication ELS Flags */
116 u8 auth_msg_code
; /* Authentication Message Code */
117 u8 proto_version
; /* Protocol Version */
118 u32 msg_len
; /* Message Length */
119 u32 trans_id
; /* Transaction Identifier (T_ID) */
121 /* Msg payload follows... */
125 enum auth_neg_param_tags
{
126 FC_AUTH_NEG_DHCHAP_HASHLIST
= 0x0001,
127 FC_AUTH_NEG_DHCHAP_DHG_ID_LIST
= 0x0002,
131 struct dhchap_param_format_s
{
132 u16 tag
; /*! Parameter Tag. See
133 * auth_neg_param_tags_t
137 /* followed by variable length parameter value... */
140 struct auth_proto_params_s
{
145 * Followed by variable length Protocol specific parameters. DH-CHAP
146 * uses dhchap_param_format_t
150 struct auth_neg_msg_s
{
151 struct auth_name_s auth_ini_name
;
152 u32 usable_auth_protos
;
153 struct auth_proto_params_s proto_params
[1]; /*! (1..usable_auth_proto)
158 struct auth_dh_val_s
{
163 struct auth_dhchap_chal_msg_s
{
164 struct auth_els_msg_s hdr
;
165 struct auth_name_s auth_responder_name
; /* TODO VRK - is auth_name_t
173 /* ...followed by variable Challenge length/value and DH length/value */
177 enum auth_rjt_codes
{
178 FC_AUTH_RJT_CODE_AUTH_FAILURE
= 0x01,
179 FC_AUTH_RJT_CODE_LOGICAL_ERR
= 0x02,
182 enum auth_rjt_code_exps
{
183 FC_AUTH_CEXP_AUTH_MECH_NOT_USABLE
= 0x01,
184 FC_AUTH_CEXP_DH_GROUP_NOT_USABLE
= 0x02,
185 FC_AUTH_CEXP_HASH_FUNC_NOT_USABLE
= 0x03,
186 FC_AUTH_CEXP_AUTH_XACT_STARTED
= 0x04,
187 FC_AUTH_CEXP_AUTH_FAILED
= 0x05,
188 FC_AUTH_CEXP_INCORRECT_PLD
= 0x06,
189 FC_AUTH_CEXP_INCORRECT_PROTO_MSG
= 0x07,
190 FC_AUTH_CEXP_RESTART_AUTH_PROTO
= 0x08,
191 FC_AUTH_CEXP_AUTH_CONCAT_NOT_SUPP
= 0x09,
192 FC_AUTH_CEXP_PROTO_VER_NOT_SUPP
= 0x0A,
196 FC_AUTH_STATE_INPROGRESS
= 0, /*! authentication in progress */
197 FC_AUTH_STATE_FAILED
= 1, /*! authentication failed */
198 FC_AUTH_STATE_SUCCESS
= 2 /*! authentication successful */
201 struct auth_rjt_msg_s
{
202 struct auth_els_msg_s hdr
;
209 struct auth_dhchap_neg_msg_s
{
210 struct auth_els_msg_s hdr
;
211 struct auth_neg_msg_s nego
;
214 struct auth_dhchap_reply_msg_s
{
215 struct auth_els_msg_s hdr
;
218 * followed by response value length & Value + DH Value Length & Value
224 #endif /* __FC_SP_H__ */