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_ESI_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _ISNS_ESI_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EV_ESI = 1,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte EV_REG_EXP
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ev_type_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_INIT (0x01)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_AGAIN (0x02)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_WAKEUP (0x04)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REMOVE (0x08)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REM_P1 (0x10)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REM_P2 (0x20)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REM_P3 (0x40)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REM_P4 (0x80)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define EV_FLAG_REM_P (0xF0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct esi_portal {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sz;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in_addr_t ip4;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte in6_addr_t *ip6;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t port;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t esip;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t ref;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int so;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct esi_portal *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} esi_portal_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct ev {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ev_type_t type;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t uid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t intval;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t *eid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t eid_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte esi_portal_t *portal;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pthread_mutex_t mtx;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct ev *next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} ev_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* function prototypes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint esi_load(uint32_t, uchar_t *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint esi_add(uint32_t, uchar_t *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint esi_remove(uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint esi_remove_obj(const isns_obj_t *, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint verify_esi_portal();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_stopwatch(int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t ev_intval(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint ev_match(void *, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint ev_remove(void *, uint32_t, int, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid ev_free(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evf_init(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evf_again(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evf_wakeup(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evf_rem(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evf_rem_pending(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid evf_zero(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid evl_append(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid evl_strip(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint evl_remove(uint32_t, uint32_t, int);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid *esi_proc(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid portal_dies(uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid reg_expiring(void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_ESI_H */