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_SCN_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _ISNS_SCN_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* raw scn data type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn_raw {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t event;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int type;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t uid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t *iscsi;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ref;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ilen;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t nt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in6_addr_t *ip;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dd_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dds_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_raw_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* scn context data type */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn_text {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flag;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ref;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t uid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t *iscsi;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ilen;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t nt;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dd_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t dds_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct scn_text *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_text_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* portal data type stroed in scn registry */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn_portal {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t uid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sz;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in_addr_t in;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in6_addr_t *in6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } ip;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ref;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int so;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct scn_portal *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_portal_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn_list {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_text_t *text;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_portal_t *portal;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } data;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct scn_list *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_list_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* scn trigger uint */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t event;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_raw_t *raw;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_list_t *list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } data;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct scn *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* scn registry list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct scn_registry {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t uid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t *name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t nlen;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t bitmap;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte union {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_portal_t *p;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_list_t *l;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } portal;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte scn_t *scn;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct scn_registry *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} scn_registry_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* function prototypes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid *scn_proc(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint scn_list_load(uint32_t, uchar_t *, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint verify_scn_portal(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint add_scn_entry(uchar_t *, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint remove_scn_entry(uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint remove_scn_portal(uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint make_scn(uint32_t, isns_obj_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint connect_to(int, in_addr_t, in6_addr_t *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_SCN_H */