4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
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.
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]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
32 #include <sys/idm/idm_impl.h>
35 * Numerical identifiers for iSCSI name-value pair keys (just so that
36 * we can use case statements to handle a particular key-value pair
37 * after we find it in idm_kvpair_xlate).
39 * We want to use a bitmask to keep track of negotiated key-value pairs
40 * so keep this enum under 64 values -- or spend some time reworking the
76 * ISCSI Operational Parameter Keys
87 KI_TARGET_PORTAL_GROUP_TAG
,
90 KI_MAX_RECV_DATA_SEGMENT_LENGTH
,
92 KI_FIRST_BURST_LENGTH
,
93 KI_DEFAULT_TIME_2_WAIT
,
94 KI_DEFAULT_TIME_2_RETAIN
,
95 KI_MAX_OUTSTANDING_R2T
,
97 KI_DATA_SEQUENCE_IN_ORDER
,
98 KI_ERROR_RECOVERY_LEVEL
,
109 KI_TARGET_RECV_DATA_SEGMENT_LENGTH
,
110 KI_INITIATOR_RECV_DATA_SEGMENT_LENGTH
,
111 KI_MAX_OUTSTANDING_UNEXPECTED_PDUS
,
114 * End of list marker, no keys below here.
119 /* Numerical types for iSCSI name-value pair values */
125 KT_NUMERICAL
, /* Hex or decimal constant */
126 KT_LARGE_NUMERICAL
, /* Hex, decimal or Base64 constant */
128 KT_REGULAR_BINARY
, /* Hex, decimal, base64 not longer than 64 bits */
129 KT_LARGE_BINARY
, /* Hex, decimal, base64 longer than 64 bites */
130 KT_BINARY
, /* Regular binary or large binary */
136 iscsikey_id_t ik_key_id
;
138 idmkey_type_t ik_idm_type
; /* RFC type */
139 boolean_t ik_declarative
;
142 const idm_kv_xlate_t
*
143 idm_lookup_kv_xlate(const char *key
, int keylen
);
146 idm_nvlist_add_keyvalue(nvlist_t
*nvl
, char *key
, int keylen
, char *value
);
149 idm_textbuf_to_nvlist(nvlist_t
*nvl
, char **textbuf
, int *textbuflen
);
152 idm_textbuf_to_firstfraglen(void *textbuf
, int textbuflen
);
155 idm_nvlist_to_textbuf(nvlist_t
*nvl
, char **textbuf
, int *textbuflen
,
156 int *tblen_required
);
159 idm_nvstat_to_kvstat(int nvrc
);
162 idm_kvstat_to_error(kv_status_t kvrc
, uint8_t *class, uint8_t *detail
);
165 idm_nvlist_add_id(nvlist_t
*nvl
, iscsikey_id_t kv_id
, char *value
);
168 idm_get_next_listvalue(nvpair_t
*value_list
, nvpair_t
*curr_nvp
);
171 idm_id_to_name(iscsikey_id_t kv_id
);
174 idm_nvpair_value_to_textbuf(nvpair_t
*nvp
);
177 idm_pdu_list_to_nvlist(list_t
*pdu_list
, nvlist_t
**nvlist
,
178 uint8_t *error_detail
);
181 idm_nvlist_to_itextbuf(nvlist_t
*nvl
);
184 idm_pdu_init_text_data(idm_pdu_t
*pdu
, void *arg
,
185 int max_xfer_len
, char *bufptr
, int *transit
);
188 idm_itextbuf_free(void *arg
);
194 #endif /* _IDM_TEXT_H_ */