1*a6d42e7dSPeter Dunlap /* 2*a6d42e7dSPeter Dunlap * CDDL HEADER START 3*a6d42e7dSPeter Dunlap * 4*a6d42e7dSPeter Dunlap * The contents of this file are subject to the terms of the 5*a6d42e7dSPeter Dunlap * Common Development and Distribution License (the "License"). 6*a6d42e7dSPeter Dunlap * You may not use this file except in compliance with the License. 7*a6d42e7dSPeter Dunlap * 8*a6d42e7dSPeter Dunlap * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*a6d42e7dSPeter Dunlap * or http://www.opensolaris.org/os/licensing. 10*a6d42e7dSPeter Dunlap * See the License for the specific language governing permissions 11*a6d42e7dSPeter Dunlap * and limitations under the License. 12*a6d42e7dSPeter Dunlap * 13*a6d42e7dSPeter Dunlap * When distributing Covered Code, include this CDDL HEADER in each 14*a6d42e7dSPeter Dunlap * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*a6d42e7dSPeter Dunlap * If applicable, add the following below this CDDL HEADER, with the 16*a6d42e7dSPeter Dunlap * fields enclosed by brackets "[]" replaced with your own identifying 17*a6d42e7dSPeter Dunlap * information: Portions Copyright [yyyy] [name of copyright owner] 18*a6d42e7dSPeter Dunlap * 19*a6d42e7dSPeter Dunlap * CDDL HEADER END 20*a6d42e7dSPeter Dunlap */ 21*a6d42e7dSPeter Dunlap /* 22*a6d42e7dSPeter Dunlap * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 23*a6d42e7dSPeter Dunlap * Use is subject to license terms. 24*a6d42e7dSPeter Dunlap */ 25*a6d42e7dSPeter Dunlap 26*a6d42e7dSPeter Dunlap #ifndef _LIBISCSIT_H 27*a6d42e7dSPeter Dunlap #define _LIBISCSIT_H 28*a6d42e7dSPeter Dunlap 29*a6d42e7dSPeter Dunlap #ifndef _KERNEL 30*a6d42e7dSPeter Dunlap #include <libnvpair.h> 31*a6d42e7dSPeter Dunlap #include <sys/socket.h> 32*a6d42e7dSPeter Dunlap #endif 33*a6d42e7dSPeter Dunlap 34*a6d42e7dSPeter Dunlap #ifdef __cplusplus 35*a6d42e7dSPeter Dunlap extern "C" { 36*a6d42e7dSPeter Dunlap #endif 37*a6d42e7dSPeter Dunlap 38*a6d42e7dSPeter Dunlap #define ISCSIT_MODNAME "iscsit" 39*a6d42e7dSPeter Dunlap #define ISCSIT_NODE "/devices/pseudo/iscsit@0:iscsit" 40*a6d42e7dSPeter Dunlap 41*a6d42e7dSPeter Dunlap #define MAX_TPGT 256 42*a6d42e7dSPeter Dunlap #define CFG_TPGTLIST "tpgt-list" 43*a6d42e7dSPeter Dunlap 44*a6d42e7dSPeter Dunlap /* 45*a6d42e7dSPeter Dunlap * Object Hierarchy 46*a6d42e7dSPeter Dunlap * 47*a6d42e7dSPeter Dunlap * _______________________ 48*a6d42e7dSPeter Dunlap * | | 49*a6d42e7dSPeter Dunlap * | iSCSI Target Config | 50*a6d42e7dSPeter Dunlap * | it_config_t | 51*a6d42e7dSPeter Dunlap * |_______________________| 52*a6d42e7dSPeter Dunlap * | | 53*a6d42e7dSPeter Dunlap * | | 54*a6d42e7dSPeter Dunlap * | | ________ ________ ________ 55*a6d42e7dSPeter Dunlap * | | | | | | | | 56*a6d42e7dSPeter Dunlap * | | | Target |-->| Target |-- - - -->| Target | 57*a6d42e7dSPeter Dunlap * | | |________| |________| |________| 58*a6d42e7dSPeter Dunlap * | | | 59*a6d42e7dSPeter Dunlap * | | | 60*a6d42e7dSPeter Dunlap * | | | 61*a6d42e7dSPeter Dunlap * | | | ______ ______ 62*a6d42e7dSPeter Dunlap * | | | | | | | 63*a6d42e7dSPeter Dunlap * | | +----->| TPGT |-- - - -->| TPGT | 64*a6d42e7dSPeter Dunlap * | | |______| |______| 65*a6d42e7dSPeter Dunlap * | | | | 66*a6d42e7dSPeter Dunlap * | +--+ | | 67*a6d42e7dSPeter Dunlap * | | _______ _______ | ______ | 68*a6d42e7dSPeter Dunlap * | | | | | |<--+ | |<--+ 69*a6d42e7dSPeter Dunlap * | +->| TPG |-->| TPG |-- - - -->| TPG | 70*a6d42e7dSPeter Dunlap * | |_______| |_______| |______| 71*a6d42e7dSPeter Dunlap * | 72*a6d42e7dSPeter Dunlap * | ___________ ___________ ___________ 73*a6d42e7dSPeter Dunlap * | | | | | | | 74*a6d42e7dSPeter Dunlap * +---->| Initiator |-->| Initiator |-- - - -->| Initiator | 75*a6d42e7dSPeter Dunlap * | Context | | Context | | Context | 76*a6d42e7dSPeter Dunlap * |___________| |___________| |___________| 77*a6d42e7dSPeter Dunlap * 78*a6d42e7dSPeter Dunlap * 79*a6d42e7dSPeter Dunlap * it_config_t includes a list of global properties 80*a6d42e7dSPeter Dunlap * 81*a6d42e7dSPeter Dunlap * Targets include a list of properties which override the global properties 82*a6d42e7dSPeter Dunlap * if set 83*a6d42e7dSPeter Dunlap * 84*a6d42e7dSPeter Dunlap * Initiators also include a list of properties but never inherit properties 85*a6d42e7dSPeter Dunlap * from the global config. 86*a6d42e7dSPeter Dunlap */ 87*a6d42e7dSPeter Dunlap 88*a6d42e7dSPeter Dunlap /* Maximum size of a Target Portal Group name */ 89*a6d42e7dSPeter Dunlap #define MAX_TPG_NAMELEN 256 /* XXX */ 90*a6d42e7dSPeter Dunlap 91*a6d42e7dSPeter Dunlap /* Maximum size of an iSCSI Target Node name */ 92*a6d42e7dSPeter Dunlap #define MAX_ISCSI_NODENAMELEN 256 /* XXX */ 93*a6d42e7dSPeter Dunlap 94*a6d42e7dSPeter Dunlap /* 95*a6d42e7dSPeter Dunlap * A target portal group tag is a binding between a target and a target 96*a6d42e7dSPeter Dunlap * portal group along with a numerical value associated with that binding. 97*a6d42e7dSPeter Dunlap * The numerical identifier is used as the 'target portal group tag' defined 98*a6d42e7dSPeter Dunlap * in RFC3720. 99*a6d42e7dSPeter Dunlap * 100*a6d42e7dSPeter Dunlap * tpgt_tpg_name The name of the target portal group associated with 101*a6d42e7dSPeter Dunlap * this target portal group tag. 102*a6d42e7dSPeter Dunlap * tpgt_generation Generation number which is incremented each time the 103*a6d42e7dSPeter Dunlap * structure changes. 104*a6d42e7dSPeter Dunlap * tpgt_next Next target portal group tag in th list of target portal 105*a6d42e7dSPeter Dunlap * group tags. If tpgt_next is NUL, then this is the last 106*a6d42e7dSPeter Dunlap * target portal group in the list. 107*a6d42e7dSPeter Dunlap * tpgt_tag A numerical identifier that uniquely identifies a 108*a6d42e7dSPeter Dunlap * target portal group within the associated target node. 109*a6d42e7dSPeter Dunlap */ 110*a6d42e7dSPeter Dunlap typedef struct it_tpgt_s { 111*a6d42e7dSPeter Dunlap char tpgt_tpg_name[MAX_TPG_NAMELEN]; 112*a6d42e7dSPeter Dunlap uint64_t tpgt_generation; 113*a6d42e7dSPeter Dunlap struct it_tpgt_s *tpgt_next; 114*a6d42e7dSPeter Dunlap uint16_t tpgt_tag; 115*a6d42e7dSPeter Dunlap } it_tpgt_t; 116*a6d42e7dSPeter Dunlap 117*a6d42e7dSPeter Dunlap /* 118*a6d42e7dSPeter Dunlap * An iSCSI target node is represented by an it_tgt_structure. Each 119*a6d42e7dSPeter Dunlap * target node includes a list of associated target portal group tags 120*a6d42e7dSPeter Dunlap * and a list of properties. 121*a6d42e7dSPeter Dunlap * 122*a6d42e7dSPeter Dunlap * tgt_name The iSCSI target node name in either IQN or EUI 123*a6d42e7dSPeter Dunlap * format (see RFC3720). 124*a6d42e7dSPeter Dunlap * tgt_generation Generation number which is incremented each time 125*a6d42e7dSPeter Dunlap * the structure changes. 126*a6d42e7dSPeter Dunlap * tgt_next Next target in the list of targets. If tgt_next 127*a6d42e7dSPeter Dunlap * is NULL, then this is the last target in the list. 128*a6d42e7dSPeter Dunlap * tgt_tpgt_list A linked list representing the current target 129*a6d42e7dSPeter Dunlap * portal group tags associated with this target. 130*a6d42e7dSPeter Dunlap * tgt_tpgt_count The number of currently defined target portal 131*a6d42e7dSPeter Dunlap * group tags. 132*a6d42e7dSPeter Dunlap * tgt_properties An nvlist representation of the properties 133*a6d42e7dSPeter Dunlap * associated with this target. This list can be 134*a6d42e7dSPeter Dunlap * manipulated using libnvpair(3lib), and should be 135*a6d42e7dSPeter Dunlap * validated and stored using it_tgt_setprop(). 136*a6d42e7dSPeter Dunlap * 137*a6d42e7dSPeter Dunlap * Target nvlist Properties: 138*a6d42e7dSPeter Dunlap * 139*a6d42e7dSPeter Dunlap * nvlist Key Type Valid Values 140*a6d42e7dSPeter Dunlap * -------------------------------------------------------------------- 141*a6d42e7dSPeter Dunlap * targetchapuser string any string or "none" to remove 142*a6d42e7dSPeter Dunlap * targetchapsecret string string of at least 12 characters 143*a6d42e7dSPeter Dunlap * but not more than 255 characters. 144*a6d42e7dSPeter Dunlap * secret will be base64 encoded when 145*a6d42e7dSPeter Dunlap * stored. 146*a6d42e7dSPeter Dunlap * alias string any string or "none" to remove 147*a6d42e7dSPeter Dunlap * auth string "radius", "chap", or "none" 148*a6d42e7dSPeter Dunlap * 149*a6d42e7dSPeter Dunlap */ 150*a6d42e7dSPeter Dunlap typedef struct it_tgt_s { 151*a6d42e7dSPeter Dunlap char tgt_name[MAX_ISCSI_NODENAMELEN]; 152*a6d42e7dSPeter Dunlap uint64_t tgt_generation; 153*a6d42e7dSPeter Dunlap struct it_tgt_s *tgt_next; 154*a6d42e7dSPeter Dunlap it_tpgt_t *tgt_tpgt_list; 155*a6d42e7dSPeter Dunlap uint32_t tgt_tpgt_count; 156*a6d42e7dSPeter Dunlap nvlist_t *tgt_properties; 157*a6d42e7dSPeter Dunlap } it_tgt_t; 158*a6d42e7dSPeter Dunlap 159*a6d42e7dSPeter Dunlap /* 160*a6d42e7dSPeter Dunlap * A target portal is represented by an IP address and a listening 161*a6d42e7dSPeter Dunlap * TCP port. 162*a6d42e7dSPeter Dunlap * 163*a6d42e7dSPeter Dunlap * portal_addr sockaddr_storage structure representing the 164*a6d42e7dSPeter Dunlap * IPv4 or IPv6 address and TCP port associated 165*a6d42e7dSPeter Dunlap * with the portal. 166*a6d42e7dSPeter Dunlap * portal_next Next portal in the list of portals. If 167*a6d42e7dSPeter Dunlap * portal_next is NULL, this is the last portal 168*a6d42e7dSPeter Dunlap * in the list. 169*a6d42e7dSPeter Dunlap */ 170*a6d42e7dSPeter Dunlap typedef struct it_portal_s { 171*a6d42e7dSPeter Dunlap struct sockaddr_storage portal_addr; 172*a6d42e7dSPeter Dunlap struct it_portal_s *next; 173*a6d42e7dSPeter Dunlap } it_portal_t; 174*a6d42e7dSPeter Dunlap 175*a6d42e7dSPeter Dunlap /* 176*a6d42e7dSPeter Dunlap * A portal is an IP address and TCP port and a portal group is a set 177*a6d42e7dSPeter Dunlap * of portals. Each defined portal belongs to exactly one portal group. 178*a6d42e7dSPeter Dunlap * Applications can associate a target portal group with a particular 179*a6d42e7dSPeter Dunlap * target using a target portal group name. Initiators can only connect 180*a6d42e7dSPeter Dunlap * to targets through the portals associated with the target's target 181*a6d42e7dSPeter Dunlap * portal group tags. 182*a6d42e7dSPeter Dunlap * 183*a6d42e7dSPeter Dunlap * tpg_name Identifier for the target portal group. 184*a6d42e7dSPeter Dunlap * tpg_generation Generation number which is incremented each 185*a6d42e7dSPeter Dunlap * time this structure changes. 186*a6d42e7dSPeter Dunlap * tpg_next Next target portal group in the list of target 187*a6d42e7dSPeter Dunlap * portal groups. If tpg_next is NULL, this is the 188*a6d42e7dSPeter Dunlap * last target portal group in the list. 189*a6d42e7dSPeter Dunlap * tpg_portal_count Number of it_portal_t structures in the list. 190*a6d42e7dSPeter Dunlap * tpg_portal_list Linked list of it_portal_t structures. 191*a6d42e7dSPeter Dunlap */ 192*a6d42e7dSPeter Dunlap typedef struct it_tpg_s { 193*a6d42e7dSPeter Dunlap char tpg_name[MAX_TPG_NAMELEN]; 194*a6d42e7dSPeter Dunlap uint64_t tpg_generation; 195*a6d42e7dSPeter Dunlap struct it_tpg_s *tpg_next; 196*a6d42e7dSPeter Dunlap uint32_t tpg_portal_count; 197*a6d42e7dSPeter Dunlap it_portal_t *tpg_portal_list; 198*a6d42e7dSPeter Dunlap } it_tpg_t; 199*a6d42e7dSPeter Dunlap 200*a6d42e7dSPeter Dunlap /* 201*a6d42e7dSPeter Dunlap * A context representing a remote iSCSI initiator node. The purpose 202*a6d42e7dSPeter Dunlap * of this structure is to maintain information specific to a remote 203*a6d42e7dSPeter Dunlap * initiator such as the CHAP username and CHAP secret. 204*a6d42e7dSPeter Dunlap * 205*a6d42e7dSPeter Dunlap * ini_name the iSCSI node name of the remote initiator. 206*a6d42e7dSPeter Dunlap * ini_generation Generation number which is incremented each 207*a6d42e7dSPeter Dunlap * time this structure changes. 208*a6d42e7dSPeter Dunlap * ini_next Next initiator in the list of initiators. 209*a6d42e7dSPeter Dunlap * If ini_next is NULL, this is the last initiator 210*a6d42e7dSPeter Dunlap * in the list. 211*a6d42e7dSPeter Dunlap * ini_properties Name/Value list containing the properties 212*a6d42e7dSPeter Dunlap * associated with the initiator context. This list 213*a6d42e7dSPeter Dunlap * can be manipulated using libnvpair(3lib), and should 214*a6d42e7dSPeter Dunlap * be validated and stored using it_ini_setprop(). 215*a6d42e7dSPeter Dunlap * 216*a6d42e7dSPeter Dunlap * Initiator nvlist Properties: 217*a6d42e7dSPeter Dunlap * 218*a6d42e7dSPeter Dunlap * nvlist Key Type Valid Values 219*a6d42e7dSPeter Dunlap * -------------------------------------------------------------------- 220*a6d42e7dSPeter Dunlap * chapuser string any string 221*a6d42e7dSPeter Dunlap * chapsecret string string of at least 12 characters 222*a6d42e7dSPeter Dunlap * but not more than 255 characters. 223*a6d42e7dSPeter Dunlap * secret will be base64 encoded when 224*a6d42e7dSPeter Dunlap * stored. 225*a6d42e7dSPeter Dunlap */ 226*a6d42e7dSPeter Dunlap typedef struct it_ini_s { 227*a6d42e7dSPeter Dunlap char ini_name[MAX_ISCSI_NODENAMELEN]; 228*a6d42e7dSPeter Dunlap uint64_t ini_generation; 229*a6d42e7dSPeter Dunlap struct it_ini_s *ini_next; 230*a6d42e7dSPeter Dunlap nvlist_t *ini_properties; 231*a6d42e7dSPeter Dunlap } it_ini_t; 232*a6d42e7dSPeter Dunlap 233*a6d42e7dSPeter Dunlap 234*a6d42e7dSPeter Dunlap /* 235*a6d42e7dSPeter Dunlap * This structure represents a complete configuration for the iscsit 236*a6d42e7dSPeter Dunlap * port provider. In addition to the global configuration, it_config_t 237*a6d42e7dSPeter Dunlap * includes lists of child objects including targets, target portal 238*a6d42e7dSPeter Dunlap * groups and initiator contexts. Each object includes a "generation" 239*a6d42e7dSPeter Dunlap * value which is used by the iscsit kernel driver to identify changes 240*a6d42e7dSPeter Dunlap * from one configuration update to the next. 241*a6d42e7dSPeter Dunlap * 242*a6d42e7dSPeter Dunlap * stmf_token A uint64_t that contains the value returned from a 243*a6d42e7dSPeter Dunlap * successful call to stmfGetProviderDataProt(3STMF). 244*a6d42e7dSPeter Dunlap * This token is used to verify that the configuration 245*a6d42e7dSPeter Dunlap * data persistently stored in COMSTAR has not been 246*a6d42e7dSPeter Dunlap * modified since this version was loaded. 247*a6d42e7dSPeter Dunlap * config_version Version number for this configuration structure 248*a6d42e7dSPeter Dunlap * config_tgt_list Linked list of target contexts representing the 249*a6d42e7dSPeter Dunlap * currently defined targets. Applications can add 250*a6d42e7dSPeter Dunlap * targets to or remove targets from this list using 251*a6d42e7dSPeter Dunlap * the it_tgt_create and it_tgt_delete functions. 252*a6d42e7dSPeter Dunlap * config_tgt_count The number of currently defined targets. 253*a6d42e7dSPeter Dunlap * config_tpg_list Linked list of target portal group contexts. 254*a6d42e7dSPeter Dunlap * Applications can add or remove target portal groups 255*a6d42e7dSPeter Dunlap * to/from this list using the it_tpg_create and 256*a6d42e7dSPeter Dunlap * it_tpg_delete functions. 257*a6d42e7dSPeter Dunlap * config_tpg_count The number of currently defined target portal groups 258*a6d42e7dSPeter Dunlap * config_ini_list Linked list of initiator contexts. Applications 259*a6d42e7dSPeter Dunlap * can add initiator contexts or remove initiator 260*a6d42e7dSPeter Dunlap * contexts from this list using the it_ini_create 261*a6d42e7dSPeter Dunlap * and it_ini_delete functions. 262*a6d42e7dSPeter Dunlap * config_ini_count The number of currently defined initiator contexts. 263*a6d42e7dSPeter Dunlap * config_global_properties 264*a6d42e7dSPeter Dunlap * Name/Value list representing the current global 265*a6d42e7dSPeter Dunlap * property settings. This list can be manipulated 266*a6d42e7dSPeter Dunlap * using libnvpair(3lib), and should be validated 267*a6d42e7dSPeter Dunlap * and stored using it_config_setprop(). 268*a6d42e7dSPeter Dunlap * config_isns_svr_list 269*a6d42e7dSPeter Dunlap * Linked list of currently defined iSNS servers. 270*a6d42e7dSPeter Dunlap * Applications can add or remove iSNS servers by 271*a6d42e7dSPeter Dunlap * using the it_config_setprop() function and changing 272*a6d42e7dSPeter Dunlap * the array of iSNS servers stored in the "isnsserver" 273*a6d42e7dSPeter Dunlap * property. 274*a6d42e7dSPeter Dunlap * config_isns_svr_count 275*a6d42e7dSPeter Dunlap * The number of currently defined iSNS servers. 276*a6d42e7dSPeter Dunlap * 277*a6d42e7dSPeter Dunlap * Global nvlist Properties: 278*a6d42e7dSPeter Dunlap * 279*a6d42e7dSPeter Dunlap * nvlist Key Type Valid Values 280*a6d42e7dSPeter Dunlap * -------------------------------------------------------------------- 281*a6d42e7dSPeter Dunlap * alias string any string 282*a6d42e7dSPeter Dunlap * auth string "radius", "chap", or "none" 283*a6d42e7dSPeter Dunlap * isns boolean B_TRUE, B_FALSE 284*a6d42e7dSPeter Dunlap * isnsserver string array Array of portal specifications of 285*a6d42e7dSPeter Dunlap * the form IPaddress:port. Port 286*a6d42e7dSPeter Dunlap * is optional; if not specified, the 287*a6d42e7dSPeter Dunlap * default iSNS port number of 3205 will 288*a6d42e7dSPeter Dunlap * be used. IPv6 addresses should 289*a6d42e7dSPeter Dunlap * be enclosed in square brackets '[' ']'. 290*a6d42e7dSPeter Dunlap * If "none" is specified, all defined 291*a6d42e7dSPeter Dunlap * iSNS servers will be removed from the 292*a6d42e7dSPeter Dunlap * configuration. 293*a6d42e7dSPeter Dunlap * radiusserver string IPaddress:port specification as 294*a6d42e7dSPeter Dunlap * described for 'isnsserver'. 295*a6d42e7dSPeter Dunlap * radiussecret string string of at least 12 characters 296*a6d42e7dSPeter Dunlap * but not more than 255 characters. 297*a6d42e7dSPeter Dunlap * secret will be base64 encoded when 298*a6d42e7dSPeter Dunlap * stored. 299*a6d42e7dSPeter Dunlap */ 300*a6d42e7dSPeter Dunlap typedef struct it_config_s { 301*a6d42e7dSPeter Dunlap uint64_t stmf_token; 302*a6d42e7dSPeter Dunlap uint32_t config_version; 303*a6d42e7dSPeter Dunlap it_tgt_t *config_tgt_list; 304*a6d42e7dSPeter Dunlap uint32_t config_tgt_count; 305*a6d42e7dSPeter Dunlap it_tpg_t *config_tpg_list; 306*a6d42e7dSPeter Dunlap uint32_t config_tpg_count; 307*a6d42e7dSPeter Dunlap it_ini_t *config_ini_list; 308*a6d42e7dSPeter Dunlap uint32_t config_ini_count; 309*a6d42e7dSPeter Dunlap it_portal_t *config_isns_svr_list; 310*a6d42e7dSPeter Dunlap uint32_t config_isns_svr_count; 311*a6d42e7dSPeter Dunlap nvlist_t *config_global_properties; 312*a6d42e7dSPeter Dunlap } it_config_t; 313*a6d42e7dSPeter Dunlap 314*a6d42e7dSPeter Dunlap /* 315*a6d42e7dSPeter Dunlap * Function: it_config_load() 316*a6d42e7dSPeter Dunlap * 317*a6d42e7dSPeter Dunlap * Allocate and create an it_config_t structure representing the 318*a6d42e7dSPeter Dunlap * current iSCSI configuration. This structure is compiled using 319*a6d42e7dSPeter Dunlap * the 'provider' data returned by stmfGetProviderData(). If there 320*a6d42e7dSPeter Dunlap * is no provider data associated with iscsit, the it_config_t 321*a6d42e7dSPeter Dunlap * structure will be set to a default configuration. 322*a6d42e7dSPeter Dunlap * 323*a6d42e7dSPeter Dunlap * Parameters: 324*a6d42e7dSPeter Dunlap * cfg A C representation of the current iSCSI configuration 325*a6d42e7dSPeter Dunlap * 326*a6d42e7dSPeter Dunlap * Return Values: 327*a6d42e7dSPeter Dunlap * 0 Success 328*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 329*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 330*a6d42e7dSPeter Dunlap */ 331*a6d42e7dSPeter Dunlap int 332*a6d42e7dSPeter Dunlap it_config_load(it_config_t **cfg); 333*a6d42e7dSPeter Dunlap 334*a6d42e7dSPeter Dunlap /* 335*a6d42e7dSPeter Dunlap * Function: it_config_commit() 336*a6d42e7dSPeter Dunlap * 337*a6d42e7dSPeter Dunlap * Informs the iscsit service that the configuration has changed and 338*a6d42e7dSPeter Dunlap * commits the new configuration to persistent store by calling 339*a6d42e7dSPeter Dunlap * stmfSetProviderData. This function can be called multiple times 340*a6d42e7dSPeter Dunlap * during a configuration sequence if necessary. 341*a6d42e7dSPeter Dunlap * 342*a6d42e7dSPeter Dunlap * Parameters: 343*a6d42e7dSPeter Dunlap * cfg A C representation of the current iSCSI configuration 344*a6d42e7dSPeter Dunlap * 345*a6d42e7dSPeter Dunlap * Return Values: 346*a6d42e7dSPeter Dunlap * 0 Success 347*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 348*a6d42e7dSPeter Dunlap * EINVAL Invalid it_config_t structure 349*a6d42e7dSPeter Dunlap * STMF_ERROR_SERVICE_DATA_VERSION Configuration was updated by another 350*a6d42e7dSPeter Dunlap * client. See stmfSetProviderDataProt(). 351*a6d42e7dSPeter Dunlap */ 352*a6d42e7dSPeter Dunlap int 353*a6d42e7dSPeter Dunlap it_config_commit(it_config_t *cfg); 354*a6d42e7dSPeter Dunlap 355*a6d42e7dSPeter Dunlap /* 356*a6d42e7dSPeter Dunlap * Function: it_config_setprop() 357*a6d42e7dSPeter Dunlap * 358*a6d42e7dSPeter Dunlap * Validate the provided property list and set the global properties 359*a6d42e7dSPeter Dunlap * for iSCSI Target. If errlist is not NULL, returns detailed 360*a6d42e7dSPeter Dunlap * errors for each property that failed. The format for errorlist 361*a6d42e7dSPeter Dunlap * is key = property, value = error string. 362*a6d42e7dSPeter Dunlap * 363*a6d42e7dSPeter Dunlap * Parameters: 364*a6d42e7dSPeter Dunlap * 365*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 366*a6d42e7dSPeter Dunlap * it_config_load() 367*a6d42e7dSPeter Dunlap * proplist nvlist_t containing properties for this target. 368*a6d42e7dSPeter Dunlap * errlist (optional) nvlist_t of errors encountered when 369*a6d42e7dSPeter Dunlap * validating the properties. 370*a6d42e7dSPeter Dunlap * 371*a6d42e7dSPeter Dunlap * Return Values: 372*a6d42e7dSPeter Dunlap * 0 Success 373*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 374*a6d42e7dSPeter Dunlap * EINVAL Invalid property 375*a6d42e7dSPeter Dunlap * 376*a6d42e7dSPeter Dunlap */ 377*a6d42e7dSPeter Dunlap int 378*a6d42e7dSPeter Dunlap it_config_setprop(it_config_t *cfg, nvlist_t *proplist, nvlist_t **errlist); 379*a6d42e7dSPeter Dunlap 380*a6d42e7dSPeter Dunlap /* 381*a6d42e7dSPeter Dunlap * Function: it_config_free() 382*a6d42e7dSPeter Dunlap * 383*a6d42e7dSPeter Dunlap * Free any resources associated with the it_config_t structure. 384*a6d42e7dSPeter Dunlap * 385*a6d42e7dSPeter Dunlap * Parameters: 386*a6d42e7dSPeter Dunlap * cfg A C representation of the current iSCSI configuration 387*a6d42e7dSPeter Dunlap */ 388*a6d42e7dSPeter Dunlap void 389*a6d42e7dSPeter Dunlap it_config_free(it_config_t *cfg); 390*a6d42e7dSPeter Dunlap 391*a6d42e7dSPeter Dunlap /* 392*a6d42e7dSPeter Dunlap * Function: it_tgt_create() 393*a6d42e7dSPeter Dunlap * 394*a6d42e7dSPeter Dunlap * Allocate and create an it_tgt_t structure representing a new iSCSI 395*a6d42e7dSPeter Dunlap * target node. If tgt_name is NULL, then a unique target node name will 396*a6d42e7dSPeter Dunlap * be generated automatically. Otherwise, the value of tgt_name will be 397*a6d42e7dSPeter Dunlap * used as the target node name. The new it_tgt_t structure is added to 398*a6d42e7dSPeter Dunlap * the target list (cfg_tgt_list) in the configuration structure, and the 399*a6d42e7dSPeter Dunlap * new target will not be instantiated until the modified configuration 400*a6d42e7dSPeter Dunlap * is committed by calling it_config_commit(). 401*a6d42e7dSPeter Dunlap * 402*a6d42e7dSPeter Dunlap * Parameters: 403*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 404*a6d42e7dSPeter Dunlap * it_config_load() 405*a6d42e7dSPeter Dunlap * tgt Pointer to an iSCSI target structure 406*a6d42e7dSPeter Dunlap * tgt_name The target node name for the target to be created. 407*a6d42e7dSPeter Dunlap * The name must be in either IQN or EUI format. If 408*a6d42e7dSPeter Dunlap * this value is NULL, a node name will be generated 409*a6d42e7dSPeter Dunlap * automatically in IQN format. 410*a6d42e7dSPeter Dunlap * 411*a6d42e7dSPeter Dunlap * Return Values: 412*a6d42e7dSPeter Dunlap * 0 Success 413*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 414*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 415*a6d42e7dSPeter Dunlap * EEXIST The requested target node name is already configured 416*a6d42e7dSPeter Dunlap * EFAULT Invalid iSCSI target name 417*a6d42e7dSPeter Dunlap */ 418*a6d42e7dSPeter Dunlap int 419*a6d42e7dSPeter Dunlap it_tgt_create(it_config_t *cfg, it_tgt_t **tgt, char *tgt_name); 420*a6d42e7dSPeter Dunlap 421*a6d42e7dSPeter Dunlap /* 422*a6d42e7dSPeter Dunlap * Function: it_tgt_setprop() 423*a6d42e7dSPeter Dunlap * 424*a6d42e7dSPeter Dunlap * Validate the provided property list and set the properties for 425*a6d42e7dSPeter Dunlap * the specified target. If errlist is not NULL, returns detailed 426*a6d42e7dSPeter Dunlap * errors for each property that failed. The format for errorlist 427*a6d42e7dSPeter Dunlap * is key = property, value = error string. 428*a6d42e7dSPeter Dunlap * 429*a6d42e7dSPeter Dunlap * Parameters: 430*a6d42e7dSPeter Dunlap * 431*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 432*a6d42e7dSPeter Dunlap * it_config_load() 433*a6d42e7dSPeter Dunlap * tgt Pointer to an iSCSI target structure 434*a6d42e7dSPeter Dunlap * proplist nvlist_t containing properties for this target. 435*a6d42e7dSPeter Dunlap * errlist (optional) nvlist_t of errors encountered when 436*a6d42e7dSPeter Dunlap * validating the properties. 437*a6d42e7dSPeter Dunlap * 438*a6d42e7dSPeter Dunlap * Return Values: 439*a6d42e7dSPeter Dunlap * 0 Success 440*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 441*a6d42e7dSPeter Dunlap * EINVAL Invalid property 442*a6d42e7dSPeter Dunlap * 443*a6d42e7dSPeter Dunlap */ 444*a6d42e7dSPeter Dunlap int 445*a6d42e7dSPeter Dunlap it_tgt_setprop(it_config_t *cfg, it_tgt_t *tgt, nvlist_t *proplist, 446*a6d42e7dSPeter Dunlap nvlist_t **errlist); 447*a6d42e7dSPeter Dunlap 448*a6d42e7dSPeter Dunlap 449*a6d42e7dSPeter Dunlap /* 450*a6d42e7dSPeter Dunlap * Function: it_tgt_delete() 451*a6d42e7dSPeter Dunlap * 452*a6d42e7dSPeter Dunlap * Delete target represented by 'tgt', where 'tgt' is an existing 453*a6d42e7dSPeter Dunlap * it_tgt_t structure within the configuration 'cfg'. The target removal 454*a6d42e7dSPeter Dunlap * will not take effect until the modified configuration is committed 455*a6d42e7dSPeter Dunlap * by calling it_config_commit(). 456*a6d42e7dSPeter Dunlap * 457*a6d42e7dSPeter Dunlap * Parameters: 458*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 459*a6d42e7dSPeter Dunlap * it_config_load() 460*a6d42e7dSPeter Dunlap * tgt Pointer to an iSCSI target structure 461*a6d42e7dSPeter Dunlap * force Set the target to offline before removing it from 462*a6d42e7dSPeter Dunlap * the config. If not specified, the operation will 463*a6d42e7dSPeter Dunlap * fail if the target is determined to be online. 464*a6d42e7dSPeter Dunlap * 465*a6d42e7dSPeter Dunlap * Return Values: 466*a6d42e7dSPeter Dunlap * 0 Success 467*a6d42e7dSPeter Dunlap * EBUSY Target is online 468*a6d42e7dSPeter Dunlap */ 469*a6d42e7dSPeter Dunlap int 470*a6d42e7dSPeter Dunlap it_tgt_delete(it_config_t *cfg, it_tgt_t *tgt, boolean_t force); 471*a6d42e7dSPeter Dunlap 472*a6d42e7dSPeter Dunlap /* 473*a6d42e7dSPeter Dunlap * Function: it_tpgt_create() 474*a6d42e7dSPeter Dunlap * 475*a6d42e7dSPeter Dunlap * Allocate and create an it_tpgt_t structure representing a new iSCSI 476*a6d42e7dSPeter Dunlap * target portal group tag. The new it_tpgt_t structure is added to the 477*a6d42e7dSPeter Dunlap * target tpgt list (tgt_tpgt_list) in the it_tgt_t structure. The new 478*a6d42e7dSPeter Dunlap * target portal group tag will not be instantiated until the modified 479*a6d42e7dSPeter Dunlap * configuration is committed by calling it_config_commit(). 480*a6d42e7dSPeter Dunlap * 481*a6d42e7dSPeter Dunlap * Parameters: 482*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 483*a6d42e7dSPeter Dunlap * it_config_load() 484*a6d42e7dSPeter Dunlap * tgt Pointer to the iSCSI target structure associated 485*a6d42e7dSPeter Dunlap * with the target portal group tag 486*a6d42e7dSPeter Dunlap * tpgt Pointer to a target portal group tag structure 487*a6d42e7dSPeter Dunlap * tpg_name The name of the TPG to be associated with this TPGT 488*a6d42e7dSPeter Dunlap * tpgt_tag 16-bit numerical identifier for this TPGT. Valid 489*a6d42e7dSPeter Dunlap * values are 2 through 65535. If tpgt_tag is '0', 490*a6d42e7dSPeter Dunlap * this function will assign an appropriate tag number. 491*a6d42e7dSPeter Dunlap * If tpgt_tag is != 0, and the requested number is 492*a6d42e7dSPeter Dunlap * unavailable, another value will be chosen. 493*a6d42e7dSPeter Dunlap * 494*a6d42e7dSPeter Dunlap * Return Values: 495*a6d42e7dSPeter Dunlap * 0 Success 496*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 497*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 498*a6d42e7dSPeter Dunlap * EEXIST Specified TPG is already associated with the target 499*a6d42e7dSPeter Dunlap * E2BIG All tag numbers already in use 500*a6d42e7dSPeter Dunlap */ 501*a6d42e7dSPeter Dunlap int 502*a6d42e7dSPeter Dunlap it_tpgt_create(it_config_t *cfg, it_tgt_t *tgt, it_tpgt_t **tpgt, 503*a6d42e7dSPeter Dunlap char *tpg_name, uint16_t tpgt_tag); 504*a6d42e7dSPeter Dunlap 505*a6d42e7dSPeter Dunlap /* 506*a6d42e7dSPeter Dunlap * Function: it_tpgt_delete() 507*a6d42e7dSPeter Dunlap * 508*a6d42e7dSPeter Dunlap * Delete the target portal group tag represented by 'tpgt', where 509*a6d42e7dSPeter Dunlap * 'tpgt' is an existing is_tpgt_t structure within the target 'tgt'. 510*a6d42e7dSPeter Dunlap * The target portal group tag removal will not take effect until the 511*a6d42e7dSPeter Dunlap * modified configuation is committed by calling it_config_commit(). 512*a6d42e7dSPeter Dunlap * 513*a6d42e7dSPeter Dunlap * Parameters: 514*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 515*a6d42e7dSPeter Dunlap * it_config_load() 516*a6d42e7dSPeter Dunlap * tgt Pointer to the iSCSI target structure associated 517*a6d42e7dSPeter Dunlap * with the target portal group tag 518*a6d42e7dSPeter Dunlap * tpgt Pointer to a target portal group tag structure 519*a6d42e7dSPeter Dunlap */ 520*a6d42e7dSPeter Dunlap void 521*a6d42e7dSPeter Dunlap it_tpgt_delete(it_config_t *cfg, it_tgt_t *tgt, it_tpgt_t *tpgt); 522*a6d42e7dSPeter Dunlap 523*a6d42e7dSPeter Dunlap /* 524*a6d42e7dSPeter Dunlap * Function: it_tpg_create() 525*a6d42e7dSPeter Dunlap * 526*a6d42e7dSPeter Dunlap * Allocate and create an it_tpg_t structure representing a new iSCSI 527*a6d42e7dSPeter Dunlap * target portal group. The new it_tpg_t structure is added to the global 528*a6d42e7dSPeter Dunlap * tpg list (cfg_tgt_list) in the it_config_t structure. The new target 529*a6d42e7dSPeter Dunlap * portal group will not be instantiated until the modified configuration 530*a6d42e7dSPeter Dunlap * is committed by calling it_config_commit(). 531*a6d42e7dSPeter Dunlap * 532*a6d42e7dSPeter Dunlap * Parameters: 533*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 534*a6d42e7dSPeter Dunlap * it_config_load() 535*a6d42e7dSPeter Dunlap * tpg Pointer to the it_tpg_t structure representing 536*a6d42e7dSPeter Dunlap * the target portal group 537*a6d42e7dSPeter Dunlap * tpg_name Identifier for the target portal group 538*a6d42e7dSPeter Dunlap * portal_ip_port A string containing an appropriatedly formatted 539*a6d42e7dSPeter Dunlap * IP address:port. Both IPv4 and IPv6 addresses are 540*a6d42e7dSPeter Dunlap * permitted. This value becomes the first portal in 541*a6d42e7dSPeter Dunlap * the TPG -- applications can add additional values 542*a6d42e7dSPeter Dunlap * using it_portal_create() before committing the TPG. 543*a6d42e7dSPeter Dunlap * Return Values: 544*a6d42e7dSPeter Dunlap * 0 Success 545*a6d42e7dSPeter Dunlap * ENOMEM Cannot allocate resources 546*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 547*a6d42e7dSPeter Dunlap * EEXIST Portal already configured for another portal group 548*a6d42e7dSPeter Dunlap * associated with this target. 549*a6d42e7dSPeter Dunlap */ 550*a6d42e7dSPeter Dunlap int 551*a6d42e7dSPeter Dunlap it_tpg_create(it_config_t *cfg, it_tpg_t **tpg, char *tpg_name, 552*a6d42e7dSPeter Dunlap char *portal_ip_port); 553*a6d42e7dSPeter Dunlap 554*a6d42e7dSPeter Dunlap /* 555*a6d42e7dSPeter Dunlap * Function: it_tpg_delete() 556*a6d42e7dSPeter Dunlap * 557*a6d42e7dSPeter Dunlap * Delete target portal group represented by 'tpg', where 'tpg' is an 558*a6d42e7dSPeter Dunlap * existing it_tpg_t structure within the global configuration 'cfg'. 559*a6d42e7dSPeter Dunlap * The target portal group removal will not take effect until the 560*a6d42e7dSPeter Dunlap * modified configuration is committed by calling it_config_commit(). 561*a6d42e7dSPeter Dunlap * 562*a6d42e7dSPeter Dunlap * Parameters: 563*a6d42e7dSPeter Dunlap * cfg The current iSCSI configuration obtained from 564*a6d42e7dSPeter Dunlap * it_config_load() 565*a6d42e7dSPeter Dunlap * tpg Pointer to the it_tpg_t structure representing 566*a6d42e7dSPeter Dunlap * the target portal group 567*a6d42e7dSPeter Dunlap * force Remove this target portal group even if it's 568*a6d42e7dSPeter Dunlap * associated with one or more targets. 569*a6d42e7dSPeter Dunlap * 570*a6d42e7dSPeter Dunlap * Return Values: 571*a6d42e7dSPeter Dunlap * 0 Success 572*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 573*a6d42e7dSPeter Dunlap * EBUSY Portal group associated with one or more targets. 574*a6d42e7dSPeter Dunlap */ 575*a6d42e7dSPeter Dunlap int 576*a6d42e7dSPeter Dunlap it_tpg_delete(it_config_t *cfg, it_tpg_t *tpg, boolean_t force); 577*a6d42e7dSPeter Dunlap 578*a6d42e7dSPeter Dunlap /* 579*a6d42e7dSPeter Dunlap * Function: it_portal_create() 580*a6d42e7dSPeter Dunlap * 581*a6d42e7dSPeter Dunlap * Add an it_portal_t structure representing a new portal to the specified 582*a6d42e7dSPeter Dunlap * target portal group. The change to the target portal group will not take 583*a6d42e7dSPeter Dunlap * effect until the modified configuration is committed by calling 584*a6d42e7dSPeter Dunlap * it_config_commit(). 585*a6d42e7dSPeter Dunlap * 586*a6d42e7dSPeter Dunlap * Parameters: 587*a6d42e7dSPeter Dunlap * cfg The current iSCSI configration obtained from 588*a6d42e7dSPeter Dunlap * it_config_load() 589*a6d42e7dSPeter Dunlap * tpg Pointer to the it_tpg_t structure representing the 590*a6d42e7dSPeter Dunlap * target portal group or "none" to remove 591*a6d42e7dSPeter Dunlap * portal Pointer to the it_portal_t structure representing 592*a6d42e7dSPeter Dunlap * the portal 593*a6d42e7dSPeter Dunlap * portal_ip_port A string containing an appropriately formatted 594*a6d42e7dSPeter Dunlap * IP address or IP address:port in either IPv4 or 595*a6d42e7dSPeter Dunlap * IPv6 format. 596*a6d42e7dSPeter Dunlap * Return Values: 597*a6d42e7dSPeter Dunlap * 0 Success 598*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 599*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter 600*a6d42e7dSPeter Dunlap * EEXIST Portal already configured for another portal group 601*a6d42e7dSPeter Dunlap */ 602*a6d42e7dSPeter Dunlap int 603*a6d42e7dSPeter Dunlap it_portal_create(it_config_t *cfg, it_tpg_t *tpg, it_portal_t **portal, 604*a6d42e7dSPeter Dunlap char *portal_ip_port); 605*a6d42e7dSPeter Dunlap 606*a6d42e7dSPeter Dunlap /* 607*a6d42e7dSPeter Dunlap * Function: it_portal_delete() 608*a6d42e7dSPeter Dunlap * 609*a6d42e7dSPeter Dunlap * Remove the specified portal from the specified target portal group. 610*a6d42e7dSPeter Dunlap * The portal removal will not take effect until the modified configuration 611*a6d42e7dSPeter Dunlap * is committed by calling it_config_commit(). 612*a6d42e7dSPeter Dunlap * 613*a6d42e7dSPeter Dunlap * Parameters: 614*a6d42e7dSPeter Dunlap * cfg The current iSCSI configration obtained from 615*a6d42e7dSPeter Dunlap * it_config_load() 616*a6d42e7dSPeter Dunlap * tpg Pointer to the it_tpg_t structure representing the 617*a6d42e7dSPeter Dunlap * target portal group 618*a6d42e7dSPeter Dunlap * portal Pointer to the it_portal_t structure representing 619*a6d42e7dSPeter Dunlap * the portal 620*a6d42e7dSPeter Dunlap */ 621*a6d42e7dSPeter Dunlap void 622*a6d42e7dSPeter Dunlap it_portal_delete(it_config_t *cfg, it_tpg_t *tpg, it_portal_t *portal); 623*a6d42e7dSPeter Dunlap 624*a6d42e7dSPeter Dunlap /* 625*a6d42e7dSPeter Dunlap * Function: it_ini_create() 626*a6d42e7dSPeter Dunlap * 627*a6d42e7dSPeter Dunlap * Add an initiator context to the global configuration. The new 628*a6d42e7dSPeter Dunlap * initiator context will not be instantiated until the modified 629*a6d42e7dSPeter Dunlap * configuration is committed by calling it_config_commit(). 630*a6d42e7dSPeter Dunlap * 631*a6d42e7dSPeter Dunlap * Parameters: 632*a6d42e7dSPeter Dunlap * cfg The current iSCSI configration obtained from 633*a6d42e7dSPeter Dunlap * it_config_load() 634*a6d42e7dSPeter Dunlap * ini Pointer to the it_ini_t structure representing 635*a6d42e7dSPeter Dunlap * the initiator context. 636*a6d42e7dSPeter Dunlap * ini_node_name The iSCSI node name of the remote initiator. 637*a6d42e7dSPeter Dunlap * 638*a6d42e7dSPeter Dunlap * Return Values: 639*a6d42e7dSPeter Dunlap * 0 Success 640*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 641*a6d42e7dSPeter Dunlap * EINVAL Invalid parameter. 642*a6d42e7dSPeter Dunlap * EEXIST Initiator already configured 643*a6d42e7dSPeter Dunlap * EFAULT Invalid initiator name 644*a6d42e7dSPeter Dunlap */ 645*a6d42e7dSPeter Dunlap int 646*a6d42e7dSPeter Dunlap it_ini_create(it_config_t *cfg, it_ini_t **ini, char *ini_node_name); 647*a6d42e7dSPeter Dunlap 648*a6d42e7dSPeter Dunlap /* 649*a6d42e7dSPeter Dunlap * Function: it_ini_setprop() 650*a6d42e7dSPeter Dunlap * 651*a6d42e7dSPeter Dunlap * Validate the provided property list and set the initiator properties. 652*a6d42e7dSPeter Dunlap * If errlist is not NULL, returns detailed errors for each property 653*a6d42e7dSPeter Dunlap * that failed. The format for errorlist is 654*a6d42e7dSPeter Dunlap * key = property, value = error string. 655*a6d42e7dSPeter Dunlap * 656*a6d42e7dSPeter Dunlap * Parameters: 657*a6d42e7dSPeter Dunlap * 658*a6d42e7dSPeter Dunlap * ini The initiator being updated. 659*a6d42e7dSPeter Dunlap * proplist nvlist_t containing properties for this target. 660*a6d42e7dSPeter Dunlap * errlist (optional) nvlist_t of errors encountered when 661*a6d42e7dSPeter Dunlap * validating the properties. 662*a6d42e7dSPeter Dunlap * 663*a6d42e7dSPeter Dunlap * Return Values: 664*a6d42e7dSPeter Dunlap * 0 Success 665*a6d42e7dSPeter Dunlap * ENOMEM Could not allocate resources 666*a6d42e7dSPeter Dunlap * EINVAL Invalid property 667*a6d42e7dSPeter Dunlap * 668*a6d42e7dSPeter Dunlap */ 669*a6d42e7dSPeter Dunlap int 670*a6d42e7dSPeter Dunlap it_ini_setprop(it_ini_t *ini, nvlist_t *proplist, nvlist_t **errlist); 671*a6d42e7dSPeter Dunlap 672*a6d42e7dSPeter Dunlap /* 673*a6d42e7dSPeter Dunlap * Function: it_ini_delete() 674*a6d42e7dSPeter Dunlap * 675*a6d42e7dSPeter Dunlap * Remove the specified initiator context from the global configuration. 676*a6d42e7dSPeter Dunlap * The removal will not take effect until the modified configuration is 677*a6d42e7dSPeter Dunlap * committed by calling it_config_commit(). 678*a6d42e7dSPeter Dunlap * 679*a6d42e7dSPeter Dunlap * Parameters: 680*a6d42e7dSPeter Dunlap * cfg The current iSCSI configration obtained from 681*a6d42e7dSPeter Dunlap * it_config_load() 682*a6d42e7dSPeter Dunlap * ini Pointer to the it_ini_t structure representing 683*a6d42e7dSPeter Dunlap * the initiator context. 684*a6d42e7dSPeter Dunlap */ 685*a6d42e7dSPeter Dunlap void 686*a6d42e7dSPeter Dunlap it_ini_delete(it_config_t *cfg, it_ini_t *ini); 687*a6d42e7dSPeter Dunlap 688*a6d42e7dSPeter Dunlap /* 689*a6d42e7dSPeter Dunlap * Function: it_config_free() 690*a6d42e7dSPeter Dunlap * 691*a6d42e7dSPeter Dunlap * Free any resources associated with the it_config_t structure. 692*a6d42e7dSPeter Dunlap * 693*a6d42e7dSPeter Dunlap * Parameters: 694*a6d42e7dSPeter Dunlap * cfg A C representation of the current iSCSI configuration 695*a6d42e7dSPeter Dunlap */ 696*a6d42e7dSPeter Dunlap void 697*a6d42e7dSPeter Dunlap it_config_free(it_config_t *cfg); 698*a6d42e7dSPeter Dunlap 699*a6d42e7dSPeter Dunlap /* 700*a6d42e7dSPeter Dunlap * Function: it_tgt_free() 701*a6d42e7dSPeter Dunlap * 702*a6d42e7dSPeter Dunlap * Frees an it_tgt_t structure. If tgt_next is not NULL, frees 703*a6d42e7dSPeter Dunlap * all structures in the list. 704*a6d42e7dSPeter Dunlap */ 705*a6d42e7dSPeter Dunlap void 706*a6d42e7dSPeter Dunlap it_tgt_free(it_tgt_t *tgt); 707*a6d42e7dSPeter Dunlap 708*a6d42e7dSPeter Dunlap /* 709*a6d42e7dSPeter Dunlap * Function: it_tpgt_free() 710*a6d42e7dSPeter Dunlap * 711*a6d42e7dSPeter Dunlap * Deallocates resources of an it_tpgt_t structure. If tpgt->next 712*a6d42e7dSPeter Dunlap * is not NULL, frees all members of the list. 713*a6d42e7dSPeter Dunlap */ 714*a6d42e7dSPeter Dunlap void 715*a6d42e7dSPeter Dunlap it_tpgt_free(it_tpgt_t *tpgt); 716*a6d42e7dSPeter Dunlap 717*a6d42e7dSPeter Dunlap /* 718*a6d42e7dSPeter Dunlap * Function: it_tpg_free() 719*a6d42e7dSPeter Dunlap * 720*a6d42e7dSPeter Dunlap * Deallocates resources associated with an it_tpg_t structure. 721*a6d42e7dSPeter Dunlap * If tpg->next is not NULL, frees all members of the list. 722*a6d42e7dSPeter Dunlap */ 723*a6d42e7dSPeter Dunlap void 724*a6d42e7dSPeter Dunlap it_tpg_free(it_tpg_t *tpg); 725*a6d42e7dSPeter Dunlap 726*a6d42e7dSPeter Dunlap /* 727*a6d42e7dSPeter Dunlap * Function: it_ini_free() 728*a6d42e7dSPeter Dunlap * 729*a6d42e7dSPeter Dunlap * Deallocates resources of an it_ini_t structure. If ini->next is 730*a6d42e7dSPeter Dunlap * not NULL, frees all members of the list. 731*a6d42e7dSPeter Dunlap */ 732*a6d42e7dSPeter Dunlap void 733*a6d42e7dSPeter Dunlap it_ini_free(it_ini_t *ini); 734*a6d42e7dSPeter Dunlap 735*a6d42e7dSPeter Dunlap /* 736*a6d42e7dSPeter Dunlap * Function: validate_iscsi_name() 737*a6d42e7dSPeter Dunlap * 738*a6d42e7dSPeter Dunlap * Ensures the passed-in string is a valid IQN or EUI iSCSI name 739*a6d42e7dSPeter Dunlap */ 740*a6d42e7dSPeter Dunlap boolean_t 741*a6d42e7dSPeter Dunlap validate_iscsi_name(char *in_name); 742*a6d42e7dSPeter Dunlap 743*a6d42e7dSPeter Dunlap #ifdef __cplusplus 744*a6d42e7dSPeter Dunlap } 745*a6d42e7dSPeter Dunlap #endif 746*a6d42e7dSPeter Dunlap 747*a6d42e7dSPeter Dunlap #endif /* _LIBISCSIT_H */ 748