fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _ISNS_OBJ_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _ISNS_OBJ_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ENTITY_KEY ISNS_EID_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_KEY ISNS_ISCSI_NAME_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORTAL_KEY1 ISNS_PORTAL_IP_ADDR_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORTAL_KEY2 ISNS_PORTAL_PORT_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PG_KEY1 ISNS_PG_ISCSI_NAME_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PG_KEY2 ISNS_PG_PORTAL_IP_ADDR_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PG_KEY3 ISNS_PG_PORTAL_PORT_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PG_PGT ISNS_PG_TAG_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DD_KEY ISNS_DD_ID_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DDS_KEY ISNS_DD_SET_ID_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ENTITY_END ISNS_ENTITY_CERT_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_END ISNS_ISCSI_AUTH_METHOD_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PORTAL_END ISNS_PORTAL_CERT_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PG_END ISNS_PG_NEXT_ID_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DD_END ISNS_DD_FEATURES_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DDS_END ISNS_DD_SET_STATUS_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ENTITY_KEY(ID) ((ID) == ENTITY_KEY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ISCSI_KEY(ID) ((ID) == ISCSI_KEY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PORTAL_KEY1(ID) ((ID) == PORTAL_KEY1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PORTAL_KEY2(ID) ((ID) == PORTAL_KEY2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PG_KEY1(ID) ((ID) == PG_KEY1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PG_KEY2(ID) ((ID) == PG_KEY2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PG_KEY3(ID) ((ID) == PG_KEY3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PG_PGT(ID) ((ID) == PG_PGT)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ENTITY_ATTR(ID) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ID) > ENTITY_KEY && (ID) <= ENTITY_END)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ISCSI_ATTR(ID) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ID) > ISCSI_KEY && (ID) <= ISCSI_END)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PORTAL_ATTR(ID) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ID) > PORTAL_KEY2 && (ID) <= PORTAL_END)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_PG_ATTR(ID) \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((ID) > PG_KEY1 && (ID) <= PG_END)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint obj_tab_init(struct cache *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t set_obj_uid(void *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint extract_attr(isns_attr_t *, const isns_tlv_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint assign_attr(isns_attr_t *, const isns_attr_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid free_one_object(isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid free_object(isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteisns_obj_t *obj_calloc(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteisns_obj_t *make_default_entity();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint reg_get_entity(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_obj_t **,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t **,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint reg_get_obj(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_obj_t **,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_attr_t *,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t **,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint reg_auth_src(isns_type_t, uint32_t, uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint set_parent_obj(isns_obj_t *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint buff_child_obj(const isns_type_t, const isns_type_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const void *, void const***);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint update_child_obj(const isns_type_t, const uint32_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void const***, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint update_ref_obj(const isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint verify_ref_obj(const isns_type_t, const uint32_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void const***);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint update_deref_obj(isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t set_child_number(isns_obj_t *, int, uint16_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint key_cmp(lookup_ctrl_t *, isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint register_object(isns_obj_t *, uint32_t *, int *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint register_assoc(isns_obj_t *, uint32_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint dereg_assoc(lookup_ctrl_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint dereg_object(lookup_ctrl_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint dereg_downwards(isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint data_sync(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t obj_hval(void *, uint16_t, uint32_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint is_obj_equal(isns_obj_t *, isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_obj_uid(const void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t is_obj_there(lookup_ctrl_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t is_parent_there(uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid *assoc_clone(void *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint obj_cmp(void *, void *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint add_object(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint replace_object(void *, void *, uint32_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef DEBUG
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid obj_dump(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t *get_child_n(isns_obj_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_ref_n(isns_obj_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_ref_t(isns_obj_t *, isns_type_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t *const get_parent_p(const isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_parent_uid(const isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t *get_child_t(isns_obj_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint is_obj_online(const isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_timestamp(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_OBJ_H */