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