1/*	$NetBSD: iscsid.h,v 1.2 2011/10/29 16:54:49 christos Exp $	*/
2
3/*-
4 * Copyright (c) 2004,2006,2011 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wasabi Systems, Inc.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31#ifndef _ISCSID_H_
32#define _ISCSID_H_
33
34#include <dev/iscsi/iscsi.h>
35
36#ifndef __BEGIN_DECLS
37#  if defined(__cplusplus)
38#  define __BEGIN_DECLS           extern "C" {
39#  define __END_DECLS             }
40#  else
41#  define __BEGIN_DECLS
42#  define __END_DECLS
43#  endif
44#endif
45
46__BEGIN_DECLS
47
48/* The socket name */
49
50#define ISCSID_SOCK_NAME   "/tmp/iscsid_socket"
51
52
53/* ==== Requests ==== */
54
55#define ISCSID_ADD_TARGET                 1
56#define ISCSID_ADD_PORTAL                 2
57#define ISCSID_SET_TARGET_OPTIONS         3
58#define ISCSID_GET_TARGET_OPTIONS         4
59#define ISCSID_SET_TARGET_AUTHENTICATION  5
60#define ISCSID_SLP_FIND_TARGETS           6
61#define ISCSID_REFRESH_TARGETS            7
62#define ISCSID_REMOVE_TARGET              8
63#define ISCSID_SEARCH_LIST                9
64#define ISCSID_GET_LIST                   10
65#define ISCSID_GET_TARGET_INFO            11
66#define ISCSID_GET_PORTAL_INFO            12
67#define ISCSID_ADD_ISNS_SERVER            13
68#define ISCSID_GET_ISNS_SERVER            14
69#define ISCSID_SLP_FIND_ISNS_SERVERS      15
70#define ISCSID_REMOVE_ISNS_SERVER         17
71#define ISCSID_ADD_INITIATOR_PORTAL       18
72#define ISCSID_GET_INITIATOR_PORTAL       19
73#define ISCSID_REMOVE_INITIATOR_PORTAL    20
74#define ISCSID_LOGIN                      21
75#define ISCSID_ADD_CONNECTION             22
76#define ISCSID_LOGOUT                     23
77#define ISCSID_REMOVE_CONNECTION          24
78#define ISCSID_GET_SESSION_LIST           25
79#define ISCSID_GET_CONNECTION_LIST        26
80#define ISCSID_GET_CONNECTION_INFO        27
81#define ISCSID_SET_NODE_NAME              28
82
83#define ISCSID_GET_VERSION				  100
84
85#define ISCSID_DAEMON_TEST                900
86#define ISCSID_DAEMON_TERMINATE           999
87
88/* ==== List kind used in some requests ==== */
89
90typedef enum {
91	TARGET_LIST,			/* list of targets */
92	PORTAL_LIST,			/* list of target portals */
93	SEND_TARGETS_LIST,		/* list of send targets portals */
94	ISNS_LIST,			/* list of isns servers */
95	SESSION_LIST,			/* list of sessions */
96	INITIATOR_LIST,			/* list of initiator portals */
97	NUM_DAEMON_LISTS		/* Number of lists the daemon keeps */
98} iscsid_list_kind_t;
99
100/* ==== Search kind for search_list request ==== */
101
102typedef enum {
103	FIND_ID,		/* search for numeric ID */
104	FIND_NAME,		/* search for symbolic name */
105	FIND_TARGET_NAME,	/* search for target or initiator name */
106	FIND_ADDRESS		/* search for target or server address */
107} iscsid_search_kind_t;
108
109/* ==== Symbolic or numeric ID ==== */
110
111typedef struct {
112	uint32_t id;
113	uint8_t	name[ISCSI_STRING_LENGTH];
114} iscsid_sym_id_t;
115
116/*
117   id
118      Numeric ID.
119   name
120      Symbolic ID. Ignored if numeric ID is nonzero.
121*/
122
123/* ==== Symbolic/Numeric ID with list kind ==== */
124
125typedef struct {
126	iscsid_list_kind_t	list_kind;
127	iscsid_sym_id_t		id;
128} iscsid_list_id_t;
129
130/*
131   list_kind
132      Which list (generally TARGET_LIST or SEND_TARGETS_LIST)
133   id
134      numeric/symbolic ID
135*/
136
137
138typedef struct {
139	struct {
140		unsigned int	HeaderDigest:1;
141		unsigned int	DataDigest:1;
142		unsigned int	MaxRecvDataSegmentLength:1;
143	} is_present;
144	iscsi_digest_t	HeaderDigest;
145	iscsi_digest_t	DataDigest;
146	uint32_t	MaxRecvDataSegmentLength;
147} iscsid_portal_options_t;
148
149/*
150   is_present
151      Contains a bitfield that indicates which members of the structure
152      contain valid data.
153   HeaderDigest
154      Indicates the digest to use for PDU headers.
155   DataDigest
156      Indicates the digest to use for PDU data.
157   MaxRecvDataSegmentLength
158      Allows limiting or extending the maximum receive data segment length.
159      Must contain a value between 512 and 2**24-1 if specified.
160*/
161
162
163/* ==== General request structure ==== */
164
165typedef struct {
166	uint32_t	request;
167	uint32_t	parameter_length;
168	uint8_t		parameter[0];
169} iscsid_request_t;
170
171/*
172   request
173      Is the request ID.
174   parameter_length
175      Specifies the size in bytes of the parameter structure contained in
176      parameter.
177   parameter
178      Contains a structure defining the parameters for the request.
179*/
180
181
182/* ==== General response structure ==== */
183
184typedef struct {
185	uint32_t	status;
186	uint32_t	parameter_length;
187	uint8_t		parameter[0];
188} iscsid_response_t;
189
190/*
191   status
192      Is the result of the request.
193   parameter_length
194      Specifies the size in bytes of the parameter structure contained in
195      parameter.
196   parameter
197      Contains a structure defining the parameters for the response.
198*/
199
200/* ==== ADD_TARGET ==== */
201
202/* Request */
203
204typedef struct {
205	iscsid_list_kind_t	list_kind;
206	uint8_t			sym_name[ISCSI_STRING_LENGTH];
207	uint8_t			TargetName[ISCSI_STRING_LENGTH];
208	uint32_t		num_portals;
209	iscsi_portal_address_t	portal[0];
210} iscsid_add_target_req_t;
211
212/*
213   list_kind
214      Kind of target list (TARGET_LIST or SEND_TARGETS_LIST)
215   sym_name
216      Symbolic name of the target (optional)
217   TargetName
218      Indicates the name of the target (zero terminated UTF-8 string).
219   num_portals
220      Number of portal addresses (may be zero).
221   portal
222      Array of portals for this target.
223*/
224
225typedef struct {
226	uint32_t	target_id;
227	uint32_t	num_portals;
228	uint32_t	portal_id[0];
229} iscsid_add_target_rsp_t;
230
231/*
232   target_id
233      Is the unique ID assigned to this target.
234   num_portals
235      Number of portal IDs following.
236   portal_id
237      Array of unique IDs for the given portals, in the same order as in
238      the request.
239*/
240
241/* ==== ADD_PORTAL ==== */
242
243/* Request */
244
245typedef struct {
246	iscsid_sym_id_t		target_id;
247	uint8_t			sym_name[ISCSI_STRING_LENGTH];
248	iscsi_portal_address_t	portal;
249	iscsid_portal_options_t	options;
250} iscsid_add_portal_req_t;
251
252/*
253   target_id
254      Is the unique ID for the target.
255   sym_name
256      Symbolic name of the portal (optional).
257   portal
258      Portal address.
259   options
260      Portal options.
261*/
262
263typedef struct {
264	iscsid_sym_id_t	target_id;
265	iscsid_sym_id_t	portal_id;
266} iscsid_add_portal_rsp_t;
267
268/*
269   target_id
270      Reflects the target ID.
271   portal_id
272      Returns the unique ID of the portal and its name.
273*/
274
275/* ==== SET_TARGET_OPTIONS ==== */
276
277/* Request */
278
279typedef struct {
280	iscsid_list_kind_t	list_kind;
281	iscsid_sym_id_t		target_id;
282	struct {
283		unsigned int	HeaderDigest:1;
284		unsigned int	DataDigest:1;
285		unsigned int	MaxConnections:1;
286		unsigned int	DefaultTime2Wait:1;
287		unsigned int	DefaultTime2Retain:1;
288		unsigned int	MaxRecvDataSegmentLength:1;
289		unsigned int	ErrorRecoveryLevel:1;
290	} is_present;
291	iscsi_digest_t		HeaderDigest;
292	iscsi_digest_t		DataDigest;
293	uint32_t		MaxRecvDataSegmentLength;
294	uint16_t		MaxConnections;
295	uint16_t		DefaultTime2Wait;
296	uint16_t		DefaultTime2Retain;
297	uint16_t		ErrorRecoveryLevel;
298} iscsid_get_set_target_options_t;
299
300/*
301   list_kind
302      Which list (TARGET_LIST or SEND_TARGETS_LIST)
303   target_id
304      Is the unique ID for the target.
305   is_present
306      Contains a bitfield that indicates which members of the structure
307      contain valid data.
308   HeaderDigest
309      Indicates the digest to use for PDU headers.
310   DataDigest
311      Indicates the digest to use for PDU data.
312   MaxRecvDataSegmentLength
313      Allows limiting or extending the maximum receive data segment length.
314      Must contain a value between 512 and 2**24-1 if specified.
315   MaxConnections
316      Contains a value between 1 and 65535 that specifies the maximum
317      number of connections to target devices that can be associated with
318      a single logon session. A value of 0 indicates that there no limit
319      to the number of connections.
320   DefaultTime2Wait
321      Specifies the minimum time to wait, in seconds, before attempting
322      to reconnect or reassign a connection that has been dropped.
323   DefaultTime2Retain
324      Specifies the maximum time, in seconds, allowed to reassign a
325      connection after the initial wait indicated in DefaultTime2Retain
326      has elapsed.
327   ErrorRecoveryLevel
328      Specifies the desired error recovery level for the session.
329	  The default and maximum is 2.
330*/
331
332/*
333   Response: Status only.
334*/
335
336/* ==== GET_TARGET_OPTIONS ==== */
337
338/*
339 * Request: iscsid_list_id_t
340*/
341
342/*
343   Response: iscsid_get_set_target_options_t, see SET_TARGET_OPTIONS.
344*/
345
346/* ==== SET_TARGET_AUTHENTICATION ==== */
347
348/* Request */
349
350typedef struct {
351	iscsid_list_kind_t	list_kind;
352	iscsid_sym_id_t		target_id;
353	iscsi_auth_info_t	auth_info;
354	uint8_t			user_name[ISCSI_STRING_LENGTH];
355	uint8_t			password[ISCSI_STRING_LENGTH];
356	uint8_t			target_password[ISCSI_STRING_LENGTH];
357} iscsid_set_target_authentication_req_t;
358
359/*
360   list_kind
361      Which list (TARGET_LIST or SEND_TARGETS_LIST)
362   target_id
363      Is the unique ID for the target or target portal.
364   auth_info
365      Is the information about authorization types and options.
366   user_name
367      Sets the user (or CHAP) name to use during login authentication of
368      the initiator (zero terminated UTF-8 string). Default is initiator
369      name.
370   password
371      Contains the password to use during login authentication of the
372      initiator (zero terminated UTF-8 string). Required if
373      authentication is requested.
374   target_password
375      Contains the password to use during login authentication of the
376      target (zero terminated UTF-8 string). Required if mutual
377      authentication is requested.
378*/
379/*
380   Response: Status only.
381*/
382
383/* ==== SLP_FIND_TARGETS ==== */
384
385/*
386   Request:
387      The parameter contains the LDAPv3 filter string for the SLP search.
388*/
389
390typedef struct {
391	uint32_t	num_portals;
392	uint32_t	portal_id[1];
393} iscsid_slp_find_targets_rsp_t;
394
395/*
396   num_portals
397      Number of portal IDs following.
398   portal_id
399      Array of unique IDs for the discovered portals.
400*/
401/*
402   Response: Status only.
403*/
404
405/* ==== REFRESH_TARGETS ==== */
406
407/* Request */
408
409typedef struct {
410	iscsid_list_kind_t	kind;
411	uint32_t		num_ids;
412	uint32_t		id[1];
413} iscsid_refresh_req_t;
414
415/*
416   kind
417      The kind of list to refresh - either SEND_TARGETS_LIST or ISNS_LIST.
418   num_ids
419      Number of IDs following. If zero, all list members are used to
420      refresh the target list.
421   id
422      Array of IDs to refresh.
423*/
424/*
425   Response: Status only.
426*/
427
428/* ==== REMOVE_TARGET ==== */
429
430/*
431 * Request: iscsid_list_id_t
432*/
433
434/*
435   Response: Status only.
436*/
437
438/* ==== SEARCH_LIST ==== */
439
440typedef struct {
441	iscsid_list_kind_t	list_kind;
442	iscsid_search_kind_t	search_kind;
443	uint8_t			strval[ISCSI_STRING_LENGTH];
444	uint32_t		intval;
445} iscsid_search_list_req_t;
446
447/*
448   list_kind
449      Is the list kind.
450   search_kind
451      What to search for, also defines the contents of the 'strval' and/or
452      'intval' fields.
453   strval
454      Is the string to look for.
455   intval
456      Is the integer value to look for.
457*/
458
459/*
460 * Response: iscsid_sym_id_t
461*/
462
463/* ==== GET_LIST ==== */
464
465/* Request */
466
467typedef struct {
468	iscsid_list_kind_t	list_kind;
469} iscsid_get_list_req_t;
470
471/*
472   list_kind
473      Is the list kind.
474*/
475
476typedef struct {
477	uint32_t		num_entries;
478	uint32_t		id[1];
479} iscsid_get_list_rsp_t;
480
481/*
482   num_entries
483      Number of ID entries following.
484   id
485      Array of IDs in the requested list.
486*/
487
488/* ==== GET_TARGET_INFO ==== */
489
490/*
491 * Request: iscsid_list_id_t
492*/
493
494typedef struct {
495	iscsid_sym_id_t		target_id;
496	uint8_t			TargetName[ISCSI_STRING_LENGTH];
497	uint8_t			TargetAlias[ISCSI_STRING_LENGTH];
498	uint32_t		num_portals;
499	uint32_t		portal[1];
500} iscsid_get_target_rsp_t;
501
502/*
503   TargetName
504      The name of the target (zero terminated UTF-8 string).
505   TargetAlias
506      The alias of the target (zero terminated UTF-8 string).
507   num_portals
508      Number of portal IDs following.
509   portal
510      Array of portal IDs for this target.
511*/
512
513/* ==== GET_PORTAL_INFO ==== */
514
515/*
516 * Request: iscsid_list_id_t
517*/
518
519typedef struct {
520	iscsid_sym_id_t		portal_id;
521	iscsid_sym_id_t		target_id;
522	iscsi_portal_address_t	portal;
523	iscsid_portal_options_t	options;
524} iscsid_get_portal_rsp_t;
525
526/*
527   portal_id
528      ID and symbolic name for the portal
529   target_id
530      ID and symbolic name for the associated target
531   portal
532      Portal address
533   options
534      Portal options
535*/
536
537/* ==== ADD_ISNS_SERVER ==== */
538
539/* Request */
540
541typedef struct {
542	uint8_t		name[ISCSI_STRING_LENGTH];
543	uint8_t		address[ISCSI_ADDRESS_LENGTH];
544	uint16_t	port;
545} iscsid_add_isns_server_req_t;
546
547/*
548   name
549      Symbolic name (optional)
550   address
551      Address (DNS name or IP address) of the iSNS server
552   port
553      IP port number.
554*/
555
556typedef struct {
557	uint32_t	server_id;
558} iscsid_add_isns_server_rsp_t;
559
560/*
561   server_id
562      Unique ID for the iSNS server.
563*/
564
565/* ==== GET_ISNS_SERVER ==== */
566
567/*
568 * Request: iscsid_sym_id_t
569*/
570
571typedef struct {
572	iscsid_sym_id_t	server_id;
573	uint8_t		address[ISCSI_STRING_LENGTH];
574	uint16_t	port;
575} iscsid_get_isns_server_rsp_t;
576
577/*
578   server_id
579      ID and symbolic name for the server
580   address
581      Server address
582   port
583      IP port number.
584*/
585
586/* ==== SLP_FIND_ISNS_SERVERS ==== */
587
588/*
589   Request:
590      The parameter may optionally contain a comma separated list of
591      scope names.
592*/
593
594typedef struct {
595	uint32_t	num_servers;
596	uint32_t	server_id[1];
597} iscsid_find_isns_rsp_t;
598
599/*
600   num_servers
601      Number of iSNS server IDs following.
602   server_id
603      Array of server IDs.
604*/
605
606/* ==== REMOVE_ISNS_SERVER ==== */
607
608/*
609 * Request: iscsid_sym_id_t
610*/
611/*
612   Response: Status only.
613*/
614
615/* ==== ADD_INITIATOR_PORTAL ==== */
616
617/* Request */
618
619typedef struct {
620	uint8_t		name[ISCSI_STRING_LENGTH];
621	uint8_t		address[ISCSI_ADDRESS_LENGTH];
622} iscsid_add_initiator_req_t;
623
624/*
625   name
626      Symbolic name for this entry. Optional.
627   address
628      Interface address to add. Required.
629*/
630
631typedef struct {
632	uint32_t	portal_id;
633} iscsid_add_initiator_rsp_t;
634
635/*
636   id
637      Unique ID for the portal.
638*/
639
640/* ==== GET_INITIATOR_PORTAL ==== */
641
642/*
643 * Request: iscsid_sym_id_t
644*/
645
646typedef struct {
647	iscsid_sym_id_t	portal_id;
648	uint8_t		address[ISCSI_ADDRESS_LENGTH];
649} iscsid_get_initiator_rsp_t;
650
651/*
652   portal_id
653      numeric and symbolic ID
654   address
655      Portal address.
656*/
657
658/* ==== REMOVE_INITIATOR_PORTAL ==== */
659
660/*
661 * Request: iscsid_sym_id_t
662*/
663/*
664   Response: status only.
665*/
666
667/* ==== LOGIN ==== */
668
669/* Request */
670
671typedef struct {
672	iscsid_sym_id_t			initiator_id;
673	iscsid_sym_id_t			session_id;
674	iscsid_sym_id_t			portal_id;
675	uint8_t				sym_name[ISCSI_STRING_LENGTH];
676	iscsi_login_session_type_t	login_type;
677} iscsid_login_req_t;
678
679/*
680   initiator_id
681      Contains the initiator portal ID. When 0, the initiator portal
682      is selected automatically.
683   session_id
684      Contains the session ID for this connection. Must be 0 for login, a valid
685      session ID for add_connection.
686   portal_id
687      Contains the target portal ID to connect to.
688   sym_name
689      Optional unique non-numeric symbolic session (or connection) name.
690   login_type
691      Contains an enumerator value of type LOGINSESSIONTYPE that
692      indicates the type of logon session (discovery, non-mapped, or
693      mapped).
694*/
695
696typedef struct {
697	iscsid_sym_id_t		session_id;
698	iscsid_sym_id_t		connection_id;
699} iscsid_login_rsp_t;
700
701/*
702   session_id
703      Receives an integer that identifies the session.
704   connection_id
705      Receives an integer that identifies the connection.
706*/
707
708/* ==== ADD_CONNECTION ==== */
709
710/*
711   Request and Response: see LOGIN.
712*/
713
714/* ==== LOGOUT ==== */
715
716/*
717 * Request: iscsid_sym_id_t
718*/
719/*
720   Response: Status only.
721*/
722
723
724/* ==== REMOVE_CONNECTION ==== */
725
726typedef struct {
727	iscsid_sym_id_t		session_id;
728	iscsid_sym_id_t		connection_id;
729} iscsid_remove_connection_req_t;
730
731/*
732   session_id
733      Contains an integer that identifies the session.
734   connection_id
735      Identifies the connection to remove.
736*/
737/*
738   Response: Status only.
739*/
740
741/* ==== GET_SESSION_LIST ==== */
742
743/*
744   Request: No parameter.
745*/
746
747typedef struct {
748	iscsid_sym_id_t		session_id;
749	uint32_t		first_connection_id;
750	uint32_t		num_connections;
751	uint32_t		portal_id;
752	uint32_t		initiator_id;
753} iscsid_session_list_entry_t;
754
755
756/*
757   session_id
758      Contains the session identifier.
759   first_connection_id
760      Contains the connection identifier for the first connection.
761   num_connections
762      The number of active connections in this session.
763   portal_id
764      Target portal ID.
765   initiator_id
766      Index of the initiator portal. May be zero.
767*/
768
769typedef struct {
770	uint32_t			num_entries;
771	iscsid_session_list_entry_t	session[1];
772} iscsid_get_session_list_rsp_t;
773
774/*
775   num_entries
776      The number of entries following.
777   session
778      The list entries (see above)
779*/
780
781
782/* ==== GET_CONNECTION_LIST ==== */
783
784/*
785 * Request: iscsid_sym_id_t - session ID
786*/
787
788typedef struct {
789	iscsid_sym_id_t		connection_id;
790	iscsid_sym_id_t		target_portal_id;
791	iscsi_portal_address_t	target_portal;
792} iscsid_connection_list_entry_t;
793
794/*
795   connection_id
796      Connection ID.
797   target_portal_id
798      Target portal ID.
799   target_portal
800      Portal addresses of the target.
801*/
802
803typedef struct {
804	uint32_t			num_connections;
805	iscsid_connection_list_entry_t	connection[1];
806} iscsid_get_connection_list_rsp_t;
807
808/*
809   num_connections
810      The number of connection descriptors following.
811   connection
812      The list entries (see above).
813*/
814
815
816/* ==== GET_CONNECTION_INFO ==== */
817
818typedef struct {
819	iscsid_sym_id_t		session_id;
820	iscsid_sym_id_t		connection_id;
821} iscsid_get_connection_info_req_t;
822
823/*
824   session_id
825      Contains an integer that identifies the session.
826   connection_id
827      Identifies the connection to retrieve.
828*/
829
830typedef struct {
831	iscsid_sym_id_t		session_id;
832	iscsid_sym_id_t		connection_id;
833	iscsid_sym_id_t		initiator_id;
834	iscsid_sym_id_t		target_portal_id;
835	uint8_t			initiator_address[ISCSI_ADDRESS_LENGTH];
836	uint8_t			TargetName[ISCSI_STRING_LENGTH];
837	uint8_t			TargetAlias[ISCSI_STRING_LENGTH];
838	iscsi_portal_address_t	target_portal;
839} iscsid_get_connection_info_rsp_t;
840
841/*
842   session_id
843      Reflects session ID
844   connection_id
845      Reflects  connection ID
846   initiator_id
847      Initiator portal ID. May be empty.
848   target_portal_id
849      Target portal ID.
850   initiator_address
851      Portal addresses of the initiator. May be empty if no initiators defined.
852   TargetName
853      The name of the target (zero terminated UTF-8 string).
854   TargetAlias
855      The alias of the target (zero terminated UTF-8 string).
856   target_portal
857      Portal addresses of the target.
858*/
859
860/* ===== set_node_name ===== */
861
862typedef struct {
863	uint8_t			InitiatorName[ISCSI_STRING_LENGTH];
864	uint8_t			InitiatorAlias[ISCSI_STRING_LENGTH];
865	uint8_t			ISID[6];
866} iscsid_set_node_name_req_t;
867
868/*
869   InitiatorName
870      Specifies the InitiatorName used during login. Required.
871   InitiatorAlias
872      Specifies the InitiatorAlias for use during login. May be empty.
873   ISID
874      Specifies the ISID (a 6 byte binary value) for use during login.
875      May be zero (all bytes) for the initiator to use a default value.
876*/
877/*
878   Response: Status only.
879*/
880
881/* ===== get_version ===== */
882
883/*
884   Request: No parameter.
885*/
886
887typedef struct {
888	uint16_t		interface_version;
889	uint16_t		major;
890	uint16_t		minor;
891	uint8_t			version_string[ISCSI_STRING_LENGTH];
892	uint16_t		driver_interface_version;
893	uint16_t		driver_major;
894	uint16_t		driver_minor;
895	uint8_t			driver_version_string[ISCSI_STRING_LENGTH];
896} iscsid_get_version_rsp_t;
897
898/*
899   interface_version
900      Updated when interface changes. Current Version is 2.
901   major
902      Major version number.
903   minor
904      Minor version number.
905   version_string
906      Displayable version string (zero terminated).
907   driver_xxx
908      Corresponding version information for driver.
909*/
910
911extern int nothreads;
912
913__END_DECLS
914
915#endif /* !_ISCSID_H_ */
916