xref: /illumos-gate/usr/src/uts/common/io/scsi/adapters/iscsi/persistent.h (revision 6e375c8351497b82ffa4f33cbf61d712999b4605)
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 2008 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 boolean_t	persistent_init(boolean_t restart);
50 void		persistent_fini(void);
51 boolean_t	persistent_disc_meth_set(iSCSIDiscoveryMethod_t method);
52 iSCSIDiscoveryMethod_t	persistent_disc_meth_get(void);
53 boolean_t	persistent_disc_meth_clear(iSCSIDiscoveryMethod_t method);
54 boolean_t	persistent_initiator_name_set(char *p);
55 boolean_t	persistent_initiator_name_get(char *p, int size);
56 boolean_t	persistent_alias_name_set(char *p);
57 boolean_t	persistent_alias_name_get(char *p, int size);
58 boolean_t	persistent_static_addr_set(char *node, entry_t *e);
59 boolean_t	persistent_static_addr_next(void **v, char *node, entry_t *e);
60 boolean_t	persistent_static_addr_clear(uint32_t oid);
61 void		persistent_static_addr_lock(void);
62 void		persistent_static_addr_unlock(void);
63 boolean_t	persistent_isns_addr_set(entry_t *e);
64 boolean_t	persistent_isns_addr_next(void **v, entry_t *e);
65 boolean_t	persistent_isns_addr_clear(entry_t *e);
66 void		persistent_isns_addr_lock(void);
67 void		persistent_isns_addr_unlock(void);
68 boolean_t	persistent_disc_addr_set(entry_t *e);
69 boolean_t	persistent_disc_addr_next(void **v, entry_t *e);
70 boolean_t	persistent_disc_addr_clear(entry_t *e);
71 void		persistent_disc_addr_lock(void);
72 void		persistent_disc_addr_unlock(void);
73 boolean_t	persistent_param_set(char *node, persistent_param_t *param);
74 boolean_t	persistent_param_get(char *node, persistent_param_t *param);
75 boolean_t	persistent_param_next(void **v, char *node,
76 		    persistent_param_t *param);
77 boolean_t	persistent_param_clear(char *node);
78 void		persistent_param_lock(void);
79 void		persistent_param_unlock(void);
80 boolean_t	persistent_chap_set(char *node, iscsi_chap_props_t *chap);
81 boolean_t	persistent_chap_get(char *node, iscsi_chap_props_t *chap);
82 boolean_t	persistent_chap_next(void **v,  char *node,
83 		    iscsi_chap_props_t *chap);
84 boolean_t	persistent_chap_clear(char *node);
85 void		persistent_chap_lock(void);
86 void		persistent_chap_unlock(void);
87 boolean_t	persistent_radius_set(iscsi_radius_props_t *radius);
88 iscsi_nvfile_status_t	persistent_radius_get(iscsi_radius_props_t *radius);
89 boolean_t	persistent_auth_set(char *node, iscsi_auth_props_t *auth);
90 boolean_t	persistent_auth_get(char *node, iscsi_auth_props_t *auth);
91 boolean_t	persistent_auth_next(void **v, char *node,
92 		    iscsi_auth_props_t *auth);
93 boolean_t	persistent_auth_clear(char *node);
94 void		persistent_auth_lock(void);
95 void		persistent_auth_unlock(void);
96 void		persistent_dump_data(void);
97 boolean_t	persistent_set_config_session(char *node,
98 		    iscsi_config_sess_t *ics);
99 boolean_t	persistent_get_config_session(char *node,
100 		    iscsi_config_sess_t *ics);
101 
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* _PERSISTENT_H */
108