dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / isns / isnsd / isns_qry.h
blob4350d365248ffa7f71e97ceca4fa37378ce4072c
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _ISNS_QRY_H
28 #define _ISNS_QRY_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
34 #define TLV2TYPE(TLV) \
35 (TLV)->attr_id >= FIRST_TAG_DD ? OBJ_DD : \
36 (TLV)->attr_id >= FIRST_TAG_DDS ? OBJ_DDS : \
37 (TLV)->attr_id >= FIRST_TAG_PG ? OBJ_PG : \
38 (TLV)->attr_id >= FIRST_TAG_ISCSI ? OBJ_ISCSI : \
39 (TLV)->attr_id >= FIRST_TAG_PORTAL ? OBJ_PORTAL : \
40 (TLV)->attr_id >= FIRST_TAG_ENTITY ? OBJ_ENTITY : 0;
42 #define FOR_EACH_OBJS(IDS, NUM, UID, STMT) \
44 uint32_t i1609 = 0;\
45 while (i1609 < (NUM)) {\
46 UID = (IDS)[i1609];\
47 STMT\
48 i1609 ++;\
52 #define NEXT_OP(OP, OP_LEN, OP_TYPE) \
53 do {\
54 NEXT_TLV((OP), (OP_LEN));\
55 } while ((OP_LEN) >= 8 &&\
56 (OP)->attr_id >= TAG_RANGE[OP_TYPE][0] &&\
57 (OP)->attr_id <= TAG_RANGE[OP_TYPE][2]);
59 #define FOR_EACH_OP(OP, OP_LEN, OP_TYPE, STMT) \
61 while ((OP_LEN) >= 8) {\
62 OP_TYPE = TLV2TYPE(OP);\
63 STMT\
64 NEXT_OP((OP), (OP_LEN), (OP_TYPE));\
68 int validate_qry_key(isns_type_t, isns_tlv_t *, uint16_t,
69 isns_attr_t *);
70 int get_qry_keys(bmp_t *, uint32_t, isns_type_t *,
71 isns_tlv_t *, uint16_t, uint32_t **, uint32_t *);
72 int get_qry_ops(uint32_t, isns_type_t,
73 isns_type_t, uint32_t **, uint32_t *, uint32_t *);
74 int get_qry_ops2(uint32_t *, uint32_t, isns_type_t,
75 uint32_t **, uint32_t *, uint32_t *);
76 int get_qry_attrs(uint32_t, isns_type_t, isns_tlv_t *,
77 uint16_t, conn_arg_t *);
78 int get_qry_attrs1(uint32_t, isns_type_t, isns_tlv_t *,
79 uint16_t, conn_arg_t *);
80 uint32_t get_next_obj(isns_tlv_t *, uint32_t, isns_type_t,
81 uint32_t *, uint32_t);
83 #ifdef __cplusplus
85 #endif
87 #endif /* _ISNS_QRY_H */