1*7836SJohn.Forte@Sun.COM /* 2*7836SJohn.Forte@Sun.COM * CDDL HEADER START 3*7836SJohn.Forte@Sun.COM * 4*7836SJohn.Forte@Sun.COM * The contents of this file are subject to the terms of the 5*7836SJohn.Forte@Sun.COM * Common Development and Distribution License (the "License"). 6*7836SJohn.Forte@Sun.COM * You may not use this file except in compliance with the License. 7*7836SJohn.Forte@Sun.COM * 8*7836SJohn.Forte@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*7836SJohn.Forte@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*7836SJohn.Forte@Sun.COM * See the License for the specific language governing permissions 11*7836SJohn.Forte@Sun.COM * and limitations under the License. 12*7836SJohn.Forte@Sun.COM * 13*7836SJohn.Forte@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*7836SJohn.Forte@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*7836SJohn.Forte@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*7836SJohn.Forte@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*7836SJohn.Forte@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*7836SJohn.Forte@Sun.COM * 19*7836SJohn.Forte@Sun.COM * CDDL HEADER END 20*7836SJohn.Forte@Sun.COM */ 21*7836SJohn.Forte@Sun.COM 22*7836SJohn.Forte@Sun.COM /* 23*7836SJohn.Forte@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24*7836SJohn.Forte@Sun.COM * Use is subject to license terms. 25*7836SJohn.Forte@Sun.COM */ 26*7836SJohn.Forte@Sun.COM 27*7836SJohn.Forte@Sun.COM #ifndef _ISNS_SCN_H 28*7836SJohn.Forte@Sun.COM #define _ISNS_SCN_H 29*7836SJohn.Forte@Sun.COM 30*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 31*7836SJohn.Forte@Sun.COM extern "C" { 32*7836SJohn.Forte@Sun.COM #endif 33*7836SJohn.Forte@Sun.COM 34*7836SJohn.Forte@Sun.COM /* raw scn data type */ 35*7836SJohn.Forte@Sun.COM typedef struct scn_raw { 36*7836SJohn.Forte@Sun.COM uint32_t event; 37*7836SJohn.Forte@Sun.COM int type; 38*7836SJohn.Forte@Sun.COM uint32_t uid; 39*7836SJohn.Forte@Sun.COM uchar_t *iscsi; 40*7836SJohn.Forte@Sun.COM uint32_t ref; 41*7836SJohn.Forte@Sun.COM uint32_t ilen; 42*7836SJohn.Forte@Sun.COM uint32_t nt; 43*7836SJohn.Forte@Sun.COM in6_addr_t *ip; 44*7836SJohn.Forte@Sun.COM uint32_t port; 45*7836SJohn.Forte@Sun.COM uint32_t dd_id; 46*7836SJohn.Forte@Sun.COM uint32_t dds_id; 47*7836SJohn.Forte@Sun.COM } scn_raw_t; 48*7836SJohn.Forte@Sun.COM 49*7836SJohn.Forte@Sun.COM /* scn context data type */ 50*7836SJohn.Forte@Sun.COM typedef struct scn_text { 51*7836SJohn.Forte@Sun.COM int flag; 52*7836SJohn.Forte@Sun.COM uint32_t ref; 53*7836SJohn.Forte@Sun.COM uint32_t uid; 54*7836SJohn.Forte@Sun.COM uchar_t *iscsi; 55*7836SJohn.Forte@Sun.COM uint32_t ilen; 56*7836SJohn.Forte@Sun.COM uint32_t nt; 57*7836SJohn.Forte@Sun.COM uint32_t dd_id; 58*7836SJohn.Forte@Sun.COM uint32_t dds_id; 59*7836SJohn.Forte@Sun.COM struct scn_text *next; 60*7836SJohn.Forte@Sun.COM } scn_text_t; 61*7836SJohn.Forte@Sun.COM 62*7836SJohn.Forte@Sun.COM /* portal data type stroed in scn registry */ 63*7836SJohn.Forte@Sun.COM typedef struct scn_portal { 64*7836SJohn.Forte@Sun.COM uint32_t uid; 65*7836SJohn.Forte@Sun.COM int sz; 66*7836SJohn.Forte@Sun.COM union { 67*7836SJohn.Forte@Sun.COM in_addr_t in; 68*7836SJohn.Forte@Sun.COM in6_addr_t *in6; 69*7836SJohn.Forte@Sun.COM } ip; 70*7836SJohn.Forte@Sun.COM uint32_t port; 71*7836SJohn.Forte@Sun.COM uint32_t ref; 72*7836SJohn.Forte@Sun.COM int so; 73*7836SJohn.Forte@Sun.COM struct scn_portal *next; 74*7836SJohn.Forte@Sun.COM } scn_portal_t; 75*7836SJohn.Forte@Sun.COM 76*7836SJohn.Forte@Sun.COM typedef struct scn_list { 77*7836SJohn.Forte@Sun.COM union { 78*7836SJohn.Forte@Sun.COM scn_text_t *text; 79*7836SJohn.Forte@Sun.COM scn_portal_t *portal; 80*7836SJohn.Forte@Sun.COM } data; 81*7836SJohn.Forte@Sun.COM struct scn_list *next; 82*7836SJohn.Forte@Sun.COM } scn_list_t; 83*7836SJohn.Forte@Sun.COM 84*7836SJohn.Forte@Sun.COM /* scn trigger uint */ 85*7836SJohn.Forte@Sun.COM typedef struct scn { 86*7836SJohn.Forte@Sun.COM uint32_t event; 87*7836SJohn.Forte@Sun.COM union { 88*7836SJohn.Forte@Sun.COM scn_raw_t *raw; 89*7836SJohn.Forte@Sun.COM scn_list_t *list; 90*7836SJohn.Forte@Sun.COM } data; 91*7836SJohn.Forte@Sun.COM struct scn *next; 92*7836SJohn.Forte@Sun.COM } scn_t; 93*7836SJohn.Forte@Sun.COM 94*7836SJohn.Forte@Sun.COM /* scn registry list */ 95*7836SJohn.Forte@Sun.COM typedef struct scn_registry { 96*7836SJohn.Forte@Sun.COM uint32_t uid; 97*7836SJohn.Forte@Sun.COM uchar_t *name; 98*7836SJohn.Forte@Sun.COM uint32_t nlen; 99*7836SJohn.Forte@Sun.COM uint32_t bitmap; 100*7836SJohn.Forte@Sun.COM union { 101*7836SJohn.Forte@Sun.COM scn_portal_t *p; 102*7836SJohn.Forte@Sun.COM scn_list_t *l; 103*7836SJohn.Forte@Sun.COM } portal; 104*7836SJohn.Forte@Sun.COM scn_t *scn; 105*7836SJohn.Forte@Sun.COM struct scn_registry *next; 106*7836SJohn.Forte@Sun.COM } scn_registry_t; 107*7836SJohn.Forte@Sun.COM 108*7836SJohn.Forte@Sun.COM 109*7836SJohn.Forte@Sun.COM /* function prototypes */ 110*7836SJohn.Forte@Sun.COM void *scn_proc(void *); 111*7836SJohn.Forte@Sun.COM 112*7836SJohn.Forte@Sun.COM int scn_list_load(uint32_t, uchar_t *, uint32_t, uint32_t); 113*7836SJohn.Forte@Sun.COM int verify_scn_portal(void); 114*7836SJohn.Forte@Sun.COM int add_scn_entry(uchar_t *, uint32_t, uint32_t); 115*7836SJohn.Forte@Sun.COM int remove_scn_entry(uchar_t *); 116*7836SJohn.Forte@Sun.COM int remove_scn_portal(uint32_t); 117*7836SJohn.Forte@Sun.COM int make_scn(uint32_t, isns_obj_t *); 118*7836SJohn.Forte@Sun.COM 119*7836SJohn.Forte@Sun.COM int connect_to(int, in_addr_t, in6_addr_t *, uint32_t); 120*7836SJohn.Forte@Sun.COM 121*7836SJohn.Forte@Sun.COM #ifdef __cplusplus 122*7836SJohn.Forte@Sun.COM } 123*7836SJohn.Forte@Sun.COM #endif 124*7836SJohn.Forte@Sun.COM 125*7836SJohn.Forte@Sun.COM #endif /* _ISNS_SCN_H */ 126