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