1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _PERSISTENT_H 27 #define _PERSISTENT_H 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 34 #include <iscsi.h> 35 36 /* 37 * Data Structures 38 */ 39 40 typedef struct persistent_param { 41 uint32_t p_bitmap; /* parameter override bitmap */ 42 iscsi_login_params_t p_params; 43 } persistent_param_t; 44 45 46 /* 47 * Function Prototypes 48 */ 49 void persistent_init(); 50 boolean_t persistent_load(); 51 void persistent_fini(void); 52 boolean_t persistent_disc_meth_set(iSCSIDiscoveryMethod_t method); 53 iSCSIDiscoveryMethod_t persistent_disc_meth_get(void); 54 boolean_t persistent_disc_meth_clear(iSCSIDiscoveryMethod_t method); 55 boolean_t persistent_initiator_name_set(char *p); 56 boolean_t persistent_initiator_name_get(char *p, int size); 57 boolean_t persistent_alias_name_set(char *p); 58 boolean_t persistent_alias_name_get(char *p, int size); 59 boolean_t persistent_static_addr_set(char *node, entry_t *e); 60 boolean_t persistent_static_addr_next(void **v, char *node, entry_t *e); 61 boolean_t persistent_static_addr_clear(uint32_t oid); 62 void persistent_static_addr_lock(void); 63 void persistent_static_addr_unlock(void); 64 boolean_t persistent_isns_addr_set(entry_t *e); 65 boolean_t persistent_isns_addr_next(void **v, entry_t *e); 66 boolean_t persistent_isns_addr_clear(entry_t *e); 67 void persistent_isns_addr_lock(void); 68 void persistent_isns_addr_unlock(void); 69 boolean_t persistent_disc_addr_set(entry_t *e); 70 boolean_t persistent_disc_addr_next(void **v, entry_t *e); 71 boolean_t persistent_disc_addr_clear(entry_t *e); 72 void persistent_disc_addr_lock(void); 73 void persistent_disc_addr_unlock(void); 74 boolean_t persistent_param_set(char *node, persistent_param_t *param); 75 boolean_t persistent_param_get(char *node, persistent_param_t *param); 76 boolean_t persistent_param_next(void **v, char *node, 77 persistent_param_t *param); 78 boolean_t persistent_param_clear(char *node); 79 void persistent_param_lock(void); 80 void persistent_param_unlock(void); 81 boolean_t persistent_chap_set(char *node, iscsi_chap_props_t *chap); 82 boolean_t persistent_chap_get(char *node, iscsi_chap_props_t *chap); 83 boolean_t persistent_chap_next(void **v, char *node, 84 iscsi_chap_props_t *chap); 85 boolean_t persistent_chap_clear(char *node); 86 void persistent_chap_lock(void); 87 void persistent_chap_unlock(void); 88 boolean_t persistent_radius_set(iscsi_radius_props_t *radius); 89 iscsi_nvfile_status_t persistent_radius_get(iscsi_radius_props_t *radius); 90 boolean_t persistent_auth_set(char *node, iscsi_auth_props_t *auth); 91 boolean_t persistent_auth_get(char *node, iscsi_auth_props_t *auth); 92 boolean_t persistent_auth_next(void **v, char *node, 93 iscsi_auth_props_t *auth); 94 boolean_t persistent_auth_clear(char *node); 95 void persistent_auth_lock(void); 96 void persistent_auth_unlock(void); 97 void persistent_dump_data(void); 98 boolean_t persistent_set_config_session(char *node, 99 iscsi_config_sess_t *ics); 100 boolean_t persistent_get_config_session(char *node, 101 iscsi_config_sess_t *ics); 102 103 104 #ifdef __cplusplus 105 } 106 #endif 107 108 #endif /* _PERSISTENT_H */ 109