usr/config.h: fix comment for struct iscsi_session_timeout_config
[open-iscsi.git] / usr / config.h
blob768b9e413505605d633ff4a0b850037aa250acc3
1 /*
2 * iSCSI Configuration
4 * Copyright (C) 2002 Cisco Systems, Inc.
5 * maintained by linux-iscsi-devel@lists.sourceforge.net
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * See the file COPYING included with this distribution for more details.
20 #ifndef CONFIG_H
21 #define CONFIG_H
23 #include <netdb.h>
24 #include <net/if.h>
26 #include "types.h"
27 #include "auth.h" /* for the username and password sizes */
28 #include "list.h"
29 #include "iscsi_proto.h"
30 #include "iscsi_net_util.h"
32 /* ISIDs now have a typed naming authority in them. We use an OUI */
33 #define DRIVER_ISID_0 0x00
34 #define DRIVER_ISID_1 0x02
35 #define DRIVER_ISID_2 0x3D
37 /* number of possible connections per session */
38 #define ISCSI_CONN_MAX 1
39 /* max len of interface */
40 #define ISCSI_MAX_IFACE_LEN 65
42 /* the following structures store the options set in the config file.
43 * a structure is defined for each logically-related group of options.
44 * if you are adding a new option, first check if it should belong
45 * to one of the existing groups. If it does, add it. If not, define
46 * a new structure.
49 /* all authentication-related options should be added to this structure.
50 * this structure is per-session, and can be configured
51 * by TargetName but not Subnet.
53 struct iscsi_auth_config {
54 unsigned int authmethod;
55 char username[AUTH_STR_MAX_LEN];
56 unsigned char password[AUTH_STR_MAX_LEN];
57 unsigned int password_length;
58 char username_in[AUTH_STR_MAX_LEN];
59 unsigned char password_in[AUTH_STR_MAX_LEN];
60 unsigned int password_in_length;
63 /* all per-connection timeouts go in this structure.
64 * this structure is per-portal, and can be configured
65 * both by TargetName and Subnet.
67 struct iscsi_connection_timeout_config {
68 int login_timeout;
69 int logout_timeout;
70 int auth_timeout;
71 int active_timeout;
72 int noop_out_interval;
73 int noop_out_timeout;
76 /* all per-session timeouts go in this structure.
77 * this structure is per-session, and can be configured
78 * by TargetName but not by Subnet.
80 struct iscsi_session_timeout_config {
81 int replacement_timeout;
84 /* all error handling timeouts go in this structure.
85 * this structure is per-portal, and can be configured
86 * both by TargetName and Subnet.
88 struct iscsi_error_timeout_config {
89 int abort_timeout;
90 int host_reset_timeout;
91 int lu_reset_timeout;
92 int tgt_reset_timeout;
95 /* all TCP options go in this structure.
96 * this structure is per-portal, and can be configured
97 * both by TargetName and Subnet.
99 struct iscsi_tcp_config {
100 int window_size;
101 int type_of_service; /* try to set IP TOS bits */
104 struct iscsi_conn_operational_config {
105 int MaxRecvDataSegmentLength;
106 int MaxXmitDataSegmentLength;
107 int HeaderDigest;
108 int DataDigest;
109 int IFMarker;
110 int OFMarker;
113 /* all iSCSI operational params go in this structure.
114 * this structure is per-portal, and can be configured
115 * both by TargetName and Subnet.
117 struct iscsi_session_operational_config {
118 int DataPDUInOrder;
119 int DataSequenceInOrder;
120 int protocol;
121 int InitialR2T;
122 int ImmediateData;
123 int FirstBurstLength;
124 int MaxBurstLength;
125 int DefaultTime2Wait;
126 int DefaultTime2Retain;
127 int MaxConnections;
128 int MaxOutstandingR2T;
129 int ERL;
130 int FastAbort;
133 #define CONFIG_DIGEST_NEVER 0
134 #define CONFIG_DIGEST_ALWAYS 1
135 #define CONFIG_DIGEST_PREFER_ON 2
136 #define CONFIG_DIGEST_PREFER_OFF 3
138 struct iscsi_sendtargets_config {
139 int reopen_max;
140 int use_discoveryd;
141 int discoveryd_poll_inval;
142 struct iscsi_auth_config auth;
143 struct iscsi_connection_timeout_config conn_timeo;
144 struct iscsi_conn_operational_config conn_conf;
145 struct iscsi_session_operational_config session_conf;
148 struct iscsi_isns_config {
149 int use_discoveryd;
150 int discoveryd_poll_inval;
153 struct iscsi_slp_config {
154 char *scopes;
155 char *interfaces; /* for multicast, list of interfaces names,
156 * "all", or "none" */
157 int poll_interval;
158 struct iscsi_auth_config auth;
161 typedef enum iscsi_startup {
162 ISCSI_STARTUP_MANUAL,
163 ISCSI_STARTUP_AUTOMATIC,
164 ISCSI_STARTUP_ONBOOT,
165 } iscsi_startup_e;
167 typedef enum discovery_type {
168 DISCOVERY_TYPE_SENDTARGETS,
169 DISCOVERY_TYPE_ISNS,
170 DISCOVERY_TYPE_OFFLOAD_SENDTARGETS,
171 DISCOVERY_TYPE_SLP,
172 DISCOVERY_TYPE_STATIC,
173 DISCOVERY_TYPE_FW,
174 } discovery_type_e;
176 typedef struct conn_rec {
177 iscsi_startup_e startup;
178 char address[NI_MAXHOST];
179 int port;
180 struct iscsi_tcp_config tcp;
181 struct iscsi_connection_timeout_config timeo;
182 struct iscsi_conn_operational_config iscsi;
183 } conn_rec_t;
185 typedef struct session_rec {
186 int initial_cmdsn;
187 int reopen_max;
188 int xmit_thread_priority;
189 int cmds_max;
190 int queue_depth;
191 int initial_login_retry_max;
192 int nr_sessions;
193 struct iscsi_auth_config auth;
194 struct iscsi_session_timeout_config timeo;
195 struct iscsi_error_timeout_config err_timeo;
196 struct iscsi_session_operational_config iscsi;
197 struct session_info *info;
198 unsigned sid;
200 * This is a flag passed to iscsid. If set, multiple sessions are
201 * allowed to be initiated on this record
203 unsigned char multiple;
204 } session_rec_t;
206 #define ISCSI_TRANSPORT_NAME_MAXLEN 16
207 #define ISCSI_MAX_STR_LEN 80
209 typedef struct iface_rec {
210 struct list_head list;
211 /* iscsi iface record name */
212 char name[ISCSI_MAX_IFACE_LEN];
213 uint32_t iface_num;
214 /* network layer iface name (eth0) */
215 char netdev[IFNAMSIZ];
216 char ipaddress[NI_MAXHOST];
217 char subnet_mask[NI_MAXHOST];
218 char gateway[NI_MAXHOST];
219 char bootproto[ISCSI_MAX_STR_LEN];
220 char ipv6_linklocal[NI_MAXHOST];
221 char ipv6_router[NI_MAXHOST];
222 char ipv6_autocfg[NI_MAXHOST];
223 char linklocal_autocfg[NI_MAXHOST];
224 char router_autocfg[NI_MAXHOST];
225 uint16_t vlan_id;
226 uint8_t vlan_priority;
227 char vlan_state[ISCSI_MAX_STR_LEN];
228 char state[ISCSI_MAX_STR_LEN]; /* 0 = disable,
229 * 1 = enable */
230 uint16_t mtu;
231 uint16_t port;
233 * TODO: we may have to make this bigger and interconnect
234 * specific for infinniband
236 char hwaddress[ISCSI_HWADDRESS_BUF_SIZE];
237 char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
239 * This is only used for boot now, but the iser guys
240 * can use this for their virtualization idea.
242 char alias[TARGET_NAME_MAXLEN + 1];
243 char iname[TARGET_NAME_MAXLEN + 1];
244 } iface_rec_t;
246 typedef struct node_rec {
247 struct list_head list;
248 char name[TARGET_NAME_MAXLEN];
249 int tpgt;
250 iscsi_startup_e startup;
251 int leading_login;
252 session_rec_t session;
253 conn_rec_t conn[ISCSI_CONN_MAX];
254 iface_rec_t iface;
255 discovery_type_e disc_type;
256 char disc_address[NI_MAXHOST];
257 int disc_port;
258 } node_rec_t;
260 typedef struct discovery_rec {
261 iscsi_startup_e startup;
262 discovery_type_e type;
263 char address[NI_MAXHOST];
264 int port;
265 union {
266 struct iscsi_sendtargets_config sendtargets;
267 struct iscsi_slp_config slp;
268 struct iscsi_isns_config isns;
269 } u;
270 } discovery_rec_t;
272 #endif /* CONFIG_H */