xref: /titanic_41/usr/src/uts/common/sys/iscsit/isns_protocol.h (revision a6d42e7d71324c5193c3b94d57d96ba2925d52e1)
1*a6d42e7dSPeter Dunlap /*
2*a6d42e7dSPeter Dunlap  * CDDL HEADER START
3*a6d42e7dSPeter Dunlap  *
4*a6d42e7dSPeter Dunlap  * The contents of this file are subject to the terms of the
5*a6d42e7dSPeter Dunlap  * Common Development and Distribution License (the "License").
6*a6d42e7dSPeter Dunlap  * You may not use this file except in compliance with the License.
7*a6d42e7dSPeter Dunlap  *
8*a6d42e7dSPeter Dunlap  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*a6d42e7dSPeter Dunlap  * or http://www.opensolaris.org/os/licensing.
10*a6d42e7dSPeter Dunlap  * See the License for the specific language governing permissions
11*a6d42e7dSPeter Dunlap  * and limitations under the License.
12*a6d42e7dSPeter Dunlap  *
13*a6d42e7dSPeter Dunlap  * When distributing Covered Code, include this CDDL HEADER in each
14*a6d42e7dSPeter Dunlap  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*a6d42e7dSPeter Dunlap  * If applicable, add the following below this CDDL HEADER, with the
16*a6d42e7dSPeter Dunlap  * fields enclosed by brackets "[]" replaced with your own identifying
17*a6d42e7dSPeter Dunlap  * information: Portions Copyright [yyyy] [name of copyright owner]
18*a6d42e7dSPeter Dunlap  *
19*a6d42e7dSPeter Dunlap  * CDDL HEADER END
20*a6d42e7dSPeter Dunlap  */
21*a6d42e7dSPeter Dunlap 
22*a6d42e7dSPeter Dunlap /*
23*a6d42e7dSPeter Dunlap  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*a6d42e7dSPeter Dunlap  * Use is subject to license terms.
25*a6d42e7dSPeter Dunlap  */
26*a6d42e7dSPeter Dunlap 
27*a6d42e7dSPeter Dunlap #ifndef	_ISNS_PROTOCOL_H
28*a6d42e7dSPeter Dunlap #define	_ISNS_PROTOCOL_H
29*a6d42e7dSPeter Dunlap 
30*a6d42e7dSPeter Dunlap #ifdef __cplusplus
31*a6d42e7dSPeter Dunlap extern "C" {
32*a6d42e7dSPeter Dunlap #endif
33*a6d42e7dSPeter Dunlap 
34*a6d42e7dSPeter Dunlap #include <netinet/in.h>
35*a6d42e7dSPeter Dunlap #include <sys/socket.h>
36*a6d42e7dSPeter Dunlap #include <sys/types.h>
37*a6d42e7dSPeter Dunlap 
38*a6d42e7dSPeter Dunlap #define	ISNSP_VERSION			(0x01)
39*a6d42e7dSPeter Dunlap 
40*a6d42e7dSPeter Dunlap #define	ISNS_DEFAULT_SERVER_PORT	(3205)
41*a6d42e7dSPeter Dunlap 
42*a6d42e7dSPeter Dunlap #define	ISNSP_HEADER_SIZE		(12)
43*a6d42e7dSPeter Dunlap #define	ISNSP_RSP_CODE_SIZE		(4)
44*a6d42e7dSPeter Dunlap #define	ISNSP_MAX_PAYLOAD_SIZE		(65532)
45*a6d42e7dSPeter Dunlap #define	ISNSP_MAX_PDU_SIZE		(ISNSP_HEADER_SIZE + \
46*a6d42e7dSPeter Dunlap 					ISNSP_MAX_PAYLOAD_SIZE)
47*a6d42e7dSPeter Dunlap 
48*a6d42e7dSPeter Dunlap #define	ISNS_TLV_ATTR_ID_LEN		(4)
49*a6d42e7dSPeter Dunlap #define	ISNS_TLV_ATTR_LEN_LEN		(4)
50*a6d42e7dSPeter Dunlap #define	MAX_ISNS_MESG_ATTR_ENTRIES	(8)
51*a6d42e7dSPeter Dunlap #define	MAX_ISNS_OPER_ATTR_ENTRIES	(32)
52*a6d42e7dSPeter Dunlap 
53*a6d42e7dSPeter Dunlap /* iSNS Entity Protocol, iSNS Draft - section 6.2.2. */
54*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_PROTOCOL_NO		(1)
55*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_PROTOCOL_ISCSI	(2)
56*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_PROTOCOL_FCP	(3)
57*a6d42e7dSPeter Dunlap 
58*a6d42e7dSPeter Dunlap /* iSNS Function IDs, iSNS Draft - section 4.1.3. */
59*a6d42e7dSPeter Dunlap #define	ISNS_DEV_ATTR_REG		(0x0001)
60*a6d42e7dSPeter Dunlap #define	ISNS_DEV_ATTR_QRY		(0x0002)
61*a6d42e7dSPeter Dunlap #define	ISNS_DEV_GET_NEXT		(0x0003)
62*a6d42e7dSPeter Dunlap #define	ISNS_DEV_DEREG			(0x0004)
63*a6d42e7dSPeter Dunlap #define	ISNS_SCN_REG			(0x0005)
64*a6d42e7dSPeter Dunlap #define	ISNS_SCN_DEREG			(0x0006)
65*a6d42e7dSPeter Dunlap #define	ISNS_SCN_EVENT			(0x0007)
66*a6d42e7dSPeter Dunlap #define	ISNS_SCN			(0x0008)
67*a6d42e7dSPeter Dunlap #define	ISNS_DD_REG			(0x0009)
68*a6d42e7dSPeter Dunlap #define	ISNS_DD_DEREG			(0x000A)
69*a6d42e7dSPeter Dunlap #define	ISNS_DDS_REG			(0x000B)
70*a6d42e7dSPeter Dunlap #define	ISNS_DDS_DEREG			(0x000C)
71*a6d42e7dSPeter Dunlap #define	ISNS_ESI			(0x000D)
72*a6d42e7dSPeter Dunlap #define	ISNS_HEARTBEAT			(0x000E)
73*a6d42e7dSPeter Dunlap #define	ISNS_DEV_ATTR_REG_RSP		(0x8001)
74*a6d42e7dSPeter Dunlap #define	ISNS_DEV_ATTR_QRY_RSP		(0x8002)
75*a6d42e7dSPeter Dunlap #define	ISNS_DEV_GET_NEXT_RSP		(0x8003)
76*a6d42e7dSPeter Dunlap #define	ISNS_DEV_DEREG_RSP		(0x8004)
77*a6d42e7dSPeter Dunlap #define	ISNS_SCN_REG_RSP		(0x8005)
78*a6d42e7dSPeter Dunlap #define	ISNS_SCN_DEREG_RSP		(0x8006)
79*a6d42e7dSPeter Dunlap #define	ISNS_SCN_EVENT_RSP		(0x8007)
80*a6d42e7dSPeter Dunlap #define	ISNS_SCN_RSP			(0x8008)
81*a6d42e7dSPeter Dunlap #define	ISNS_DD_REG_RSP			(0x8009)
82*a6d42e7dSPeter Dunlap #define	ISNS_DD_DEREG_RSP		(0x800A)
83*a6d42e7dSPeter Dunlap #define	ISNS_DDS_REG_RSP		(0x800B)
84*a6d42e7dSPeter Dunlap #define	ISNS_DDS_DEREG_RSP		(0x800C)
85*a6d42e7dSPeter Dunlap #define	ISNS_ESI_RSP			(0x800D)
86*a6d42e7dSPeter Dunlap 
87*a6d42e7dSPeter Dunlap /* iSNS Flags, iSNS Draft - section 5.1.4. */
88*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_FIRST_PDU		(0x0400)
89*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_LAST_PDU		(0x0800)
90*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_REPLACE_REG		(0x1000)
91*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_AUTH_BLK_PRESENTED	(0x2000)
92*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_SERVER		(0x4000)
93*a6d42e7dSPeter Dunlap #define	ISNS_FLAG_CLIENT		(0x8000)
94*a6d42e7dSPeter Dunlap 
95*a6d42e7dSPeter Dunlap /* iSNS Response Status, iSNS Draft - section 5.4 */
96*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SUCCESSFUL		(0)
97*a6d42e7dSPeter Dunlap #define	ISNS_RSP_UNKNOWN_ERROR		(1)
98*a6d42e7dSPeter Dunlap #define	ISNS_RSP_MSG_FORMAT_ERROR	(2)
99*a6d42e7dSPeter Dunlap #define	ISNS_RSP_INVALID_REGIS		(3)
100*a6d42e7dSPeter Dunlap #define	ISNS_RSP_INVALID_QRY		(5)
101*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SRC_UNKNOWN		(6)
102*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SRC_ABSENT		(7)
103*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SRC_UNAUTHORIZED	(8)
104*a6d42e7dSPeter Dunlap #define	ISNS_RSP_NO_SUCH_ENTRY		(9)
105*a6d42e7dSPeter Dunlap #define	ISNS_RSP_VER_NOT_SUPPORTED	(10)
106*a6d42e7dSPeter Dunlap #define	ISNS_RSP_INTERNAL_ERROR		(11)
107*a6d42e7dSPeter Dunlap #define	ISNS_RSP_BUSY			(12)
108*a6d42e7dSPeter Dunlap #define	ISNS_RSP_OPTION_NOT_UNDERSTOOD	(13)
109*a6d42e7dSPeter Dunlap #define	ISNS_RSP_INVALID_UPDATE		(14)
110*a6d42e7dSPeter Dunlap #define	ISNS_RSP_MSG_NOT_SUPPORTED	(15)
111*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SCN_EVENT_REJECTED	(16)
112*a6d42e7dSPeter Dunlap #define	ISNS_RSP_SCN_REGIS_REJECTED	(17)
113*a6d42e7dSPeter Dunlap #define	ISNS_RSP_ATTR_NOT_IMPL		(18)
114*a6d42e7dSPeter Dunlap #define	ISNS_RSP_ESI_NOT_AVAILABLE	(21)
115*a6d42e7dSPeter Dunlap #define	ISNS_RSP_INVALID_DEREGIS	(22)
116*a6d42e7dSPeter Dunlap #define	ISNS_RSP_REGIS_NOT_SUPPORTED	(23)
117*a6d42e7dSPeter Dunlap 
118*a6d42e7dSPeter Dunlap /* iSNS Attribute IDs, iSNS Draft - section 6.1. */
119*a6d42e7dSPeter Dunlap #define	ISNS_DELIMITER_ATTR_ID		(0)
120*a6d42e7dSPeter Dunlap #define	ISNS_EID_ATTR_ID		(1)
121*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_PROTOCOL_ATTR_ID	(2)
122*a6d42e7dSPeter Dunlap #define	ISNS_MGMT_IP_ADDR_ATTR_ID	(3)
123*a6d42e7dSPeter Dunlap #define	ISNS_TIMESTAMP_ATTR_ID		(4)
124*a6d42e7dSPeter Dunlap #define	ISNS_VERSION_RANGE_ATTR_ID	(5)
125*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_REG_PERIOD_ATTR_ID	(6)
126*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_INDEX_ATTR_ID	(7)
127*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_NEXT_INDEX_ATTR_ID	(8)
128*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_ISAKMP_P1_ATTR_ID	(11)
129*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_CERT_ATTR_ID	(12)
130*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_IP_ADDR_ATTR_ID	(16)
131*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_PORT_ATTR_ID	(17)
132*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_NAME_ATTR_ID	(18)
133*a6d42e7dSPeter Dunlap #define	ISNS_ESI_INTERVAL_ATTR_ID	(19)
134*a6d42e7dSPeter Dunlap #define	ISNS_ESI_PORT_ATTR_ID		(20)
135*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_INDEX_ATTR_ID	(22)
136*a6d42e7dSPeter Dunlap #define	ISNS_SCN_PORT_ATTR_ID		(23)
137*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_NEXT_INDEX_ATTR_ID	(24)
138*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_SEC_BMP_ATTR_ID	(27)
139*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_ISAKMP_P1_ATTR_ID	(28)
140*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_ISAKMP_P2_ATTR_ID	(29)
141*a6d42e7dSPeter Dunlap #define	ISNS_PORTAL_CERT_ATTR_ID	(31)
142*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_NAME_ATTR_ID		(32)
143*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_NODE_TYPE_ATTR_ID	(33)
144*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_ALIAS_ATTR_ID	(34)
145*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_SCN_BITMAP_ATTR_ID	(35)
146*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_NODE_INDEX_ATTR_ID	(36)
147*a6d42e7dSPeter Dunlap #define	ISNS_WWNN_TOKEN_ATTR_ID		(37)
148*a6d42e7dSPeter Dunlap #define	ISNS_NODE_NEXT_INDEX_ATTR_ID	(38)
149*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_AUTH_METHOD_ATTR_ID	(42)
150*a6d42e7dSPeter Dunlap #define	ISNS_PG_ISCSI_NAME_ATTR_ID	(48)
151*a6d42e7dSPeter Dunlap #define	ISNS_PG_PORTAL_IP_ADDR_ATTR_ID	(49)
152*a6d42e7dSPeter Dunlap #define	ISNS_PG_PORTAL_PORT_ATTR_ID	(50)
153*a6d42e7dSPeter Dunlap #define	ISNS_PG_TAG_ATTR_ID		(51)
154*a6d42e7dSPeter Dunlap #define	ISNS_PG_INDEX_ATTR_ID		(52)
155*a6d42e7dSPeter Dunlap #define	ISNS_PG_NEXT_ID_ATTR_ID		(53)
156*a6d42e7dSPeter Dunlap #define	ISNS_DD_SET_ID_ATTR_ID		(2049)
157*a6d42e7dSPeter Dunlap #define	ISNS_DD_SET_NAME_ATTR_ID	(2050)
158*a6d42e7dSPeter Dunlap #define	ISNS_DD_SET_STATUS_ATTR_ID	(2051)
159*a6d42e7dSPeter Dunlap #define	ISNS_DD_ID_ATTR_ID		(2065)
160*a6d42e7dSPeter Dunlap #define	ISNS_DD_NAME_ATTR_ID		(2066)
161*a6d42e7dSPeter Dunlap #define	ISNS_DD_ISCSI_INDEX_ATTR_ID	(2067)
162*a6d42e7dSPeter Dunlap #define	ISNS_DD_ISCSI_NAME_ATTR_ID	(2068)
163*a6d42e7dSPeter Dunlap #define	ISNS_DD_FC_PORT_NAME_ATTR_ID	(2069)
164*a6d42e7dSPeter Dunlap #define	ISNS_DD_PORTAL_INDEX_ATTR_ID	(2070)
165*a6d42e7dSPeter Dunlap #define	ISNS_DD_PORTAL_IP_ADDR_ATTR_ID	(2071)
166*a6d42e7dSPeter Dunlap #define	ISNS_DD_PORTAL_PORT_ATTR_ID	(2072)
167*a6d42e7dSPeter Dunlap #define	ISNS_DD_FEATURES_ATTR_ID	(2078)
168*a6d42e7dSPeter Dunlap 
169*a6d42e7dSPeter Dunlap /* Entity Protocol, RFC 4171 - section 6.2.2. */
170*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_NO_PROTOCOL		(1)
171*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_ISCSI		(2)
172*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_IFCP		(3)
173*a6d42e7dSPeter Dunlap 
174*a6d42e7dSPeter Dunlap /* Protocol Version Range, RFC 4171 - section 6.2.5. */
175*a6d42e7dSPeter Dunlap #define	ISNS_VER_SHIFT			(16)
176*a6d42e7dSPeter Dunlap #define	ISNS_VERSION			(0x0000FFFF)
177*a6d42e7dSPeter Dunlap 
178*a6d42e7dSPeter Dunlap /* Portal Port, RFC 4171 - section 6.3.2. */
179*a6d42e7dSPeter Dunlap #define	ISNS_PORT_BITS			(0x0000FFFF)    /* Bits 16 - 31 */
180*a6d42e7dSPeter Dunlap #define	ISNS_PORT_TYPE			(0x00010000)    /* Bit 15 */
181*a6d42e7dSPeter Dunlap 
182*a6d42e7dSPeter Dunlap /* Portal Security Bitmap, RFC 4171 - section 6.3.9. */
183*a6d42e7dSPeter Dunlap #define	ISNS_TUNNEL_MODE_PREFERRED	(0x0040)	/* Bit 25 */
184*a6d42e7dSPeter Dunlap #define	ISNS_TRANS_MODE_PREFERRED	(0x0020)	/* Bit 26 */
185*a6d42e7dSPeter Dunlap #define	ISNS_PFS_ENABLED		(0x0010)	/* Bit 27 */
186*a6d42e7dSPeter Dunlap #define	ISNS_AGGR_MODE_ENABLED		(0x0008)	/* Bit 28 */
187*a6d42e7dSPeter Dunlap #define	ISNS_MAIN_MODE_ENABLED		(0x0004)	/* Bit 29 */
188*a6d42e7dSPeter Dunlap #define	ISNS_IKE_IPSEC_ENABLED		(0x0002)	/* Bit 30 */
189*a6d42e7dSPeter Dunlap #define	ISNS_BITMAP_VALID		(0x0001)	/* Bit 31 */
190*a6d42e7dSPeter Dunlap 
191*a6d42e7dSPeter Dunlap /* iSCSI Node Type, RFC 4171 - section 6.4.2. */
192*a6d42e7dSPeter Dunlap #define	ISNS_TARGET_NODE_TYPE		(0x0001)
193*a6d42e7dSPeter Dunlap #define	ISNS_INITIATOR_NODE_TYPE	(0x0002)
194*a6d42e7dSPeter Dunlap #define	ISNS_CONTROL_NODE_TYPE		(0x0004)
195*a6d42e7dSPeter Dunlap 
196*a6d42e7dSPeter Dunlap /* iSCSI Node SCN Bitmap, RFC 4171 - section 6.4.4. */
197*a6d42e7dSPeter Dunlap #define	ISNS_INIT_SELF_INFO_ONLY	(0x0080)	/* Bit 24 */
198*a6d42e7dSPeter Dunlap #define	ISNS_TARGET_SELF_INFO_ONLY	(0x0040)	/* Bit 25 */
199*a6d42e7dSPeter Dunlap #define	ISNS_MGMT_REG			(0x0020)	/* Bit 26 */
200*a6d42e7dSPeter Dunlap #define	ISNS_OBJECT_REMOVED		(0x0010)	/* Bit 27 */
201*a6d42e7dSPeter Dunlap #define	ISNS_OBJECT_ADDED		(0x0008)	/* Bit 28 */
202*a6d42e7dSPeter Dunlap #define	ISNS_OBJECT_UPDATED		(0x0004)	/* Bit 29 */
203*a6d42e7dSPeter Dunlap #define	ISNS_MEMBER_REMOVED		(0x0002)	/* Bit 30 */
204*a6d42e7dSPeter Dunlap #define	ISNS_MEMBER_ADDED		(0x0001)	/* Bit 31 */
205*a6d42e7dSPeter Dunlap 
206*a6d42e7dSPeter Dunlap /* Portal Group Tag, RFC 4171 - section 6.5.4. */
207*a6d42e7dSPeter Dunlap #define	ISNS_PG_TAG			(0x0000FFFF)	/* Bits 16 - 31 */
208*a6d42e7dSPeter Dunlap 
209*a6d42e7dSPeter Dunlap /* DDS Status, RFC 4171 - section 6.11.1.3. */
210*a6d42e7dSPeter Dunlap #define	ISNS_DDS_STATUS			(0x0001)	/* Bit 31 */
211*a6d42e7dSPeter Dunlap 
212*a6d42e7dSPeter Dunlap /* DD Feature, RFC 4171 - section 6.11.2.9. */
213*a6d42e7dSPeter Dunlap #define	ISNS_DD_BOOTLIST		(0x0001)	/* Bit 31 */
214*a6d42e7dSPeter Dunlap 
215*a6d42e7dSPeter Dunlap /* iSNS Defaults */
216*a6d42e7dSPeter Dunlap #define	ISNS_DEFAULT_PGT		(0x00000001)
217*a6d42e7dSPeter Dunlap #define	ISNS_DEFAULT_DD_SET_ID		(1)
218*a6d42e7dSPeter Dunlap #define	ISNS_DEFAULT_DD_ID		(1)
219*a6d42e7dSPeter Dunlap 
220*a6d42e7dSPeter Dunlap /* Min/Max length of names */
221*a6d42e7dSPeter Dunlap #define	ISNS_DDS_MAX_NAME_LEN		(256)
222*a6d42e7dSPeter Dunlap #define	ISNS_DD_MAX_NAME_LEN		(256)
223*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_MAX_NAME_LEN		(224)
224*a6d42e7dSPeter Dunlap #define	ISNS_ISCSI_MAX_ALIAS_LEN	(256)
225*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_MIN_EID_LEN		(3)
226*a6d42e7dSPeter Dunlap #define	ISNS_ENTITY_MAX_EID_LEN		(255)
227*a6d42e7dSPeter Dunlap 
228*a6d42e7dSPeter Dunlap 
229*a6d42e7dSPeter Dunlap typedef struct isns_tlv {
230*a6d42e7dSPeter Dunlap 	uint32_t attr_id;
231*a6d42e7dSPeter Dunlap 	uint32_t attr_len;
232*a6d42e7dSPeter Dunlap 	uint8_t attr_value[1];
233*a6d42e7dSPeter Dunlap } isns_tlv_t;
234*a6d42e7dSPeter Dunlap 
235*a6d42e7dSPeter Dunlap typedef struct isns_packet_data {
236*a6d42e7dSPeter Dunlap 	uint16_t version;
237*a6d42e7dSPeter Dunlap 	uint16_t func_id;
238*a6d42e7dSPeter Dunlap 	uint16_t payload_len;
239*a6d42e7dSPeter Dunlap 	uint16_t flags;
240*a6d42e7dSPeter Dunlap 	uint16_t xid;
241*a6d42e7dSPeter Dunlap 	uint16_t seq;
242*a6d42e7dSPeter Dunlap 
243*a6d42e7dSPeter Dunlap 	int num_of_tlvs;
244*a6d42e7dSPeter Dunlap 	isns_tlv_t tlvs[MAX_ISNS_OPER_ATTR_ENTRIES];
245*a6d42e7dSPeter Dunlap } isns_packet_data_t;
246*a6d42e7dSPeter Dunlap 
247*a6d42e7dSPeter Dunlap typedef struct isns_reg_mesg {
248*a6d42e7dSPeter Dunlap 	isns_tlv_t src_attr;
249*a6d42e7dSPeter Dunlap 	int num_of_mesg_attrs;
250*a6d42e7dSPeter Dunlap 	isns_tlv_t *mesg_attrs[MAX_ISNS_MESG_ATTR_ENTRIES];
251*a6d42e7dSPeter Dunlap 	isns_tlv_t delimiter_attr;
252*a6d42e7dSPeter Dunlap 	isns_tlv_t *operating_attrs[MAX_ISNS_OPER_ATTR_ENTRIES];
253*a6d42e7dSPeter Dunlap } isns_reg_mesg_t;
254*a6d42e7dSPeter Dunlap 
255*a6d42e7dSPeter Dunlap typedef struct isns_resp_mesg {
256*a6d42e7dSPeter Dunlap 	uint8_t	status[4];
257*a6d42e7dSPeter Dunlap 	isns_tlv_t messages_attrs[MAX_ISNS_MESG_ATTR_ENTRIES];
258*a6d42e7dSPeter Dunlap 	isns_tlv_t delimiter_attr;
259*a6d42e7dSPeter Dunlap 	isns_tlv_t operating_attrs[MAX_ISNS_OPER_ATTR_ENTRIES];
260*a6d42e7dSPeter Dunlap } isns_resp_mesg_t;
261*a6d42e7dSPeter Dunlap 
262*a6d42e7dSPeter Dunlap typedef struct isns_pdu {
263*a6d42e7dSPeter Dunlap 	uint16_t version;
264*a6d42e7dSPeter Dunlap 	uint16_t func_id;
265*a6d42e7dSPeter Dunlap 	uint16_t payload_len;
266*a6d42e7dSPeter Dunlap 	uint16_t flags;
267*a6d42e7dSPeter Dunlap 	uint16_t xid;
268*a6d42e7dSPeter Dunlap 	uint16_t seq;
269*a6d42e7dSPeter Dunlap 	uint8_t payload[1];
270*a6d42e7dSPeter Dunlap } isns_pdu_t;
271*a6d42e7dSPeter Dunlap 
272*a6d42e7dSPeter Dunlap typedef struct isns_resp {
273*a6d42e7dSPeter Dunlap 	uint32_t status;
274*a6d42e7dSPeter Dunlap 	uint8_t data[1];
275*a6d42e7dSPeter Dunlap } isns_resp_t;
276*a6d42e7dSPeter Dunlap 
277*a6d42e7dSPeter Dunlap #ifdef __cplusplus
278*a6d42e7dSPeter Dunlap }
279*a6d42e7dSPeter Dunlap #endif
280*a6d42e7dSPeter Dunlap 
281*a6d42e7dSPeter Dunlap #endif /* _ISNS_PROTOCOL_H */
282