iPXE
iscsi.h
Go to the documentation of this file.
1 #ifndef _IPXE_ISCSI_H
2 #define _IPXE_ISCSI_H
3 
4 /** @file
5  *
6  * iSCSI protocol
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <ipxe/socket.h>
14 #include <ipxe/scsi.h>
15 #include <ipxe/chap.h>
16 #include <ipxe/refcnt.h>
17 #include <ipxe/xfer.h>
18 #include <ipxe/process.h>
19 #include <ipxe/acpi.h>
20 #include <ipxe/settings.h>
21 
22 /** Default iSCSI port */
23 #define ISCSI_PORT 3260
24 
25 /**
26  * iSCSI segment lengths
27  *
28  * iSCSI uses an icky structure with one one-byte field (a dword
29  * count) and one three-byte field (a byte count). This structure,
30  * and the accompanying macros, relieve some of the pain.
31  */
33  struct {
34  /** The AHS length (measured in dwords) */
36  /** The data length (measured in bytes), in network
37  * byte order
38  */
40  } bytes;
41  /** The data length (measured in bytes), in network byte
42  * order, with ahs_len as the first byte.
43  */
45 };
46 
47 /** The length of the additional header segment, in dwords */
48 #define ISCSI_AHS_LEN( segment_lengths ) \
49  ( (segment_lengths).bytes.ahs_len )
50 
51 /** The length of the data segment, in bytes, excluding any padding */
52 #define ISCSI_DATA_LEN( segment_lengths ) \
53  ( ntohl ( (segment_lengths).ahs_and_data_len ) & 0xffffff )
54 
55 /** The padding of the data segment, in bytes */
56 #define ISCSI_DATA_PAD_LEN( segment_lengths ) \
57  ( ( 0 - (segment_lengths).bytes.data_len[2] ) & 0x03 )
58 
59 /** Set additional header and data segment lengths */
60 #define ISCSI_SET_LENGTHS( segment_lengths, ahs_len, data_len ) do { \
61  (segment_lengths).ahs_and_data_len = \
62  htonl ( data_len | ( ahs_len << 24 ) ); \
63  } while ( 0 )
64 
65 /**
66  * iSCSI basic header segment common fields
67  *
68  */
70  /** Opcode */
72  /** Flags */
74  /** Fields specific to the PDU type */
76  /** Segment lengths */
78  /** Fields specific to the PDU type */
80  /** Initiator Task Tag */
82  /** Fields specific to the PDU type */
84 };
85 
86 /** Opcode mask */
87 #define ISCSI_OPCODE_MASK 0x3f
88 
89 /** Immediate delivery */
90 #define ISCSI_FLAG_IMMEDIATE 0x40
91 
92 /** Final PDU of a sequence */
93 #define ISCSI_FLAG_FINAL 0x80
94 
95 /** iSCSI tag magic marker */
96 #define ISCSI_TAG_MAGIC 0x18ae0000
97 
98 /** iSCSI reserved tag value */
99 #define ISCSI_TAG_RESERVED 0xffffffff
100 
101 /**
102  * iSCSI basic header segment common request fields
103  *
104  */
106  /** Opcode */
108  /** Flags */
110  /** Fields specific to the PDU type */
112  /** Segment lengths */
114  /** Fields specific to the PDU type */
116  /** Initiator Task Tag */
118  /** Fields specific to the PDU type */
120  /** Status sequence number */
122  /** Expected command sequence number */
124  /** Fields specific to the PDU type */
126 };
127 
128 /**
129  * iSCSI login request basic header segment
130  *
131  */
133  /** Opcode */
135  /** Flags */
137  /** Maximum supported version number */
139  /** Minimum supported version number */
141  /** Segment lengths */
143  /** Initiator session ID (IANA format) enterprise number and flags */
145  /** Initiator session ID (IANA format) qualifier */
147  /** Target session identifying handle */
149  /** Initiator Task Tag */
151  /** Connection ID */
153  /** Reserved */
155  /** Command sequence number */
157  /** Expected status sequence number */
159  /** Reserved */
161 };
162 
163 /** Login request opcode */
164 #define ISCSI_OPCODE_LOGIN_REQUEST 0x03
165 
166 /** Willingness to transition to next stage */
167 #define ISCSI_LOGIN_FLAG_TRANSITION 0x80
168 
169 /** Key=value pairs continued in subsequent request */
170 #define ISCSI_LOGIN_FLAG_CONTINUE 0x40
171 
172 /* Current stage values and mask */
173 #define ISCSI_LOGIN_CSG_MASK 0x0c
174 #define ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION 0x00
175 #define ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION 0x04
176 #define ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE 0x0c
177 
178 /* Next stage values and mask */
179 #define ISCSI_LOGIN_NSG_MASK 0x03
180 #define ISCSI_LOGIN_NSG_SECURITY_NEGOTIATION 0x00
181 #define ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION 0x01
182 #define ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE 0x03
183 
184 /** ISID IANA format marker */
185 #define ISCSI_ISID_IANA 0x40000000
186 
187 /** Fen Systems Ltd. IANA enterprise number
188  *
189  * Permission is hereby granted to use Fen Systems Ltd.'s IANA
190  * enterprise number with this iSCSI implementation.
191  */
192 #define IANA_EN_FEN_SYSTEMS 10019
193 
194 /**
195  * iSCSI login response basic header segment
196  *
197  */
199  /** Opcode */
201  /** Flags */
203  /** Maximum supported version number */
205  /** Minimum supported version number */
207  /** Segment lengths */
209  /** Initiator session ID (IANA format) enterprise number and flags */
211  /** Initiator session ID (IANA format) qualifier */
213  /** Target session identifying handle */
215  /** Initiator Task Tag */
217  /** Reserved */
219  /** Status sequence number */
221  /** Expected command sequence number */
223  /** Maximum command sequence number */
225  /** Status class */
227  /** Status detail */
229  /** Reserved */
231 };
232 
233 /** Login response opcode */
234 #define ISCSI_OPCODE_LOGIN_RESPONSE 0x23
235 
236 /* Login response status codes */
237 #define ISCSI_STATUS_SUCCESS 0x00
238 #define ISCSI_STATUS_REDIRECT 0x01
239 #define ISCSI_STATUS_INITIATOR_ERROR 0x02
240 #define ISCSI_STATUS_INITIATOR_ERROR_AUTHENTICATION 0x01
241 #define ISCSI_STATUS_INITIATOR_ERROR_AUTHORISATION 0x02
242 #define ISCSI_STATUS_INITIATOR_ERROR_NOT_FOUND 0x03
243 #define ISCSI_STATUS_INITIATOR_ERROR_REMOVED 0x04
244 #define ISCSI_STATUS_TARGET_ERROR 0x03
245 #define ISCSI_STATUS_TARGET_ERROR_UNAVAILABLE 0x01
246 #define ISCSI_STATUS_TARGET_ERROR_NO_RESOURCES 0x02
247 
248 /**
249  * iSCSI SCSI command basic header segment
250  *
251  */
253  /** Opcode */
255  /** Flags */
257  /** Reserved */
259  /** Segment lengths */
261  /** SCSI Logical Unit Number */
262  struct scsi_lun lun;
263  /** Initiator Task Tag */
265  /** Expected data transfer length */
267  /** Command sequence number */
269  /** Expected status sequence number */
271  /** SCSI Command Descriptor Block (CDB) */
272  union scsi_cdb cdb;
273 };
274 
275 /** SCSI command opcode */
276 #define ISCSI_OPCODE_SCSI_COMMAND 0x01
277 
278 /** Command will read data */
279 #define ISCSI_COMMAND_FLAG_READ 0x40
280 
281 /** Command will write data */
282 #define ISCSI_COMMAND_FLAG_WRITE 0x20
283 
284 /* Task attributes */
285 #define ISCSI_COMMAND_ATTR_UNTAGGED 0x00
286 #define ISCSI_COMMAND_ATTR_SIMPLE 0x01
287 #define ISCSI_COMMAND_ATTR_ORDERED 0x02
288 #define ISCSI_COMMAND_ATTR_HEAD_OF_QUEUE 0x03
289 #define ISCSI_COMMAND_ATTR_ACA 0x04
290 
291 /**
292  * iSCSI SCSI response basic header segment
293  *
294  */
296  /** Opcode */
298  /** Flags */
300  /** Response code */
302  /** SCSI status code */
304  /** Segment lengths */
306  /** Reserved */
308  /** Initiator Task Tag */
310  /** SNACK tag */
312  /** Status sequence number */
314  /** Expected command sequence number */
316  /** Maximum command sequence number */
318  /** Expected data sequence number */
320  /** Bidirectional read residual count */
322  /** Residual count */
324 };
325 
326 /** SCSI response opcode */
327 #define ISCSI_OPCODE_SCSI_RESPONSE 0x21
328 
329 /** SCSI command completed at target */
330 #define ISCSI_RESPONSE_COMMAND_COMPLETE 0x00
331 
332 /** SCSI target failure */
333 #define ISCSI_RESPONSE_TARGET_FAILURE 0x01
334 
335 /** Data overflow occurred */
336 #define ISCSI_RESPONSE_FLAG_OVERFLOW 0x20
337 
338 /** Data underflow occurred */
339 #define ISCSI_RESPONSE_FLAG_UNDERFLOW 0x40
340 
341 /**
342  * iSCSI data-in basic header segment
343  *
344  */
346  /** Opcode */
348  /** Flags */
350  /** Reserved */
352  /** SCSI status code */
354  /** Segment lengths */
356  /** Logical Unit Number */
357  struct scsi_lun lun;
358  /** Initiator Task Tag */
360  /** Target Transfer Tag */
362  /** Status sequence number */
364  /** Expected command sequence number */
366  /** Maximum command sequence number */
368  /** Data sequence number */
370  /** Buffer offset */
372  /** Residual count */
374 };
375 
376 /** Data-in opcode */
377 #define ISCSI_OPCODE_DATA_IN 0x25
378 
379 /** Data requires acknowledgement */
380 #define ISCSI_DATA_FLAG_ACKNOWLEDGE 0x40
381 
382 /** Data overflow occurred */
383 #define ISCSI_DATA_FLAG_OVERFLOW 0x04
384 
385 /** Data underflow occurred */
386 #define ISCSI_DATA_FLAG_UNDERFLOW 0x02
387 
388 /** SCSI status code and overflow/underflow flags are valid */
389 #define ISCSI_DATA_FLAG_STATUS 0x01
390 
391 /**
392  * iSCSI data-out basic header segment
393  *
394  */
396  /** Opcode */
398  /** Flags */
400  /** Reserved */
402  /** Segment lengths */
404  /** Logical Unit Number */
405  struct scsi_lun lun;
406  /** Initiator Task Tag */
408  /** Target Transfer Tag */
410  /** Reserved */
412  /** Expected status sequence number */
414  /** Reserved */
416  /** Data sequence number */
418  /** Buffer offset */
420  /** Reserved */
422 };
423 
424 /** Data-out opcode */
425 #define ISCSI_OPCODE_DATA_OUT 0x05
426 
427 /**
428  * iSCSI request to transfer basic header segment
429  *
430  */
432  /** Opcode */
434  /** Flags */
436  /** Reserved */
438  /** Segment lengths */
440  /** Logical Unit Number */
441  struct scsi_lun lun;
442  /** Initiator Task Tag */
444  /** Target Transfer Tag */
446  /** Status sequence number */
448  /** Expected command sequence number */
450  /** Maximum command sequence number */
452  /** R2T sequence number */
454  /** Buffer offset */
456  /** Desired data transfer length */
458 };
459 
460 /** R2T opcode */
461 #define ISCSI_OPCODE_R2T 0x31
462 
463 /**
464  * iSCSI NOP-In basic header segment
465  *
466  */
467 struct iscsi_nop_in {
468  /** Opcode */
470  /** Reserved */
472  /** Segment lengths */
474  /** Logical Unit Number */
475  struct scsi_lun lun;
476  /** Initiator Task Tag */
478  /** Target Transfer Tag */
480  /** Status sequence number */
482  /** Expected command sequence number */
484  /** Maximum command sequence number */
486  /** Reserved */
488 };
489 
490 /** NOP-In opcode */
491 #define ISCSI_OPCODE_NOP_IN 0x20
492 
493 /**
494  * An iSCSI basic header segment
495  */
496 union iscsi_bhs {
507  unsigned char bytes[ sizeof ( struct iscsi_bhs_common ) ];
508 };
509 
510 /** State of an iSCSI TX engine */
512  /** Nothing to send */
514  /** Sending the basic header segment */
516  /** Sending the additional header segment */
518  /** Sending the data segment */
520 };
521 
522 /** State of an iSCSI RX engine */
524  /** Receiving the basic header segment */
526  /** Receiving the additional header segment */
528  /** Receiving the data segment */
530  /** Receiving the data segment padding */
532 };
533 
534 /** An iSCSI session */
536  /** Reference counter */
537  struct refcnt refcnt;
538 
539  /** SCSI command-issuing interface */
541  /** SCSI command interface */
542  struct interface data;
543  /** Transport-layer socket */
545 
546  /** Initiator IQN */
548  /** Target address */
550  /** Target port */
551  unsigned int target_port;
552  /** Target IQN */
553  char *target_iqn;
554 
555  /** Session status
556  *
557  * This is the bitwise-OR of zero or more ISCSI_STATUS_XXX
558  * constants.
559  */
560  int status;
561 
562  /** Initiator username (if any) */
564  /** Initiator password (if any) */
566  /** Target username (if any) */
568  /** Target password (if any) */
570  /** CHAP challenge (for target auth only)
571  *
572  * This is a block of random data; the first byte is used as
573  * the CHAP identifier (CHAP_I) and the remainder as the CHAP
574  * challenge (CHAP_C).
575  */
576  unsigned char chap_challenge[17];
577  /** CHAP response (used for both initiator and target auth) */
579 
580  /** Initiator session ID (IANA format) qualifier
581  *
582  * This is part of the ISID. It is generated randomly
583  * whenever a new connection is opened.
584  */
586  /** Initiator task tag
587  *
588  * This is the tag of the current command. It is incremented
589  * whenever a new command is started.
590  */
592  /** Target transfer tag
593  *
594  * This is the tag attached to a sequence of data-out PDUs in
595  * response to an R2T.
596  */
598  /** Transfer offset
599  *
600  * This is the offset for an in-progress sequence of data-out
601  * PDUs in response to an R2T.
602  */
604  /** Transfer length
605  *
606  * This is the length for an in-progress sequence of data-out
607  * PDUs in response to an R2T.
608  */
610  /** Command sequence number
611  *
612  * This is the sequence number of the current command, used to
613  * fill out the CmdSN field in iSCSI request PDUs. It is
614  * updated with the value of the ExpCmdSN field whenever we
615  * receive an iSCSI response PDU containing such a field.
616  */
618  /** Status sequence number
619  *
620  * This is the most recent status sequence number present in
621  * the StatSN field of an iSCSI response PDU containing such a
622  * field. Whenever we send an iSCSI request PDU, we fill out
623  * the ExpStatSN field with this value plus one.
624  */
626 
627  /** Basic header segment for current TX PDU */
629  /** State of the TX engine */
631  /** TX process */
632  struct process process;
633 
634  /** Basic header segment for current RX PDU */
636  /** State of the RX engine */
638  /** Byte offset within the current RX state */
639  size_t rx_offset;
640  /** Length of the current RX state */
641  size_t rx_len;
642  /** Buffer for received data (not always used) */
643  void *rx_buffer;
644 
645  /** Current SCSI command, if any */
646  struct scsi_cmd *command;
647 
648  /** Target socket address (for boot firmware table) */
650  /** SCSI LUN (for boot firmware table) */
651  struct scsi_lun lun;
652  /** ACPI descriptor */
654 };
655 
656 /** iSCSI session is currently in the security negotiation phase */
657 #define ISCSI_STATUS_SECURITY_NEGOTIATION_PHASE \
658  ( ISCSI_LOGIN_CSG_SECURITY_NEGOTIATION | \
659  ISCSI_LOGIN_NSG_OPERATIONAL_NEGOTIATION )
660 
661 /** iSCSI session is currently in the operational parameter
662  * negotiation phase
663  */
664 #define ISCSI_STATUS_OPERATIONAL_NEGOTIATION_PHASE \
665  ( ISCSI_LOGIN_CSG_OPERATIONAL_NEGOTIATION | \
666  ISCSI_LOGIN_NSG_FULL_FEATURE_PHASE )
667 
668 /** iSCSI session is currently in the full feature phase */
669 #define ISCSI_STATUS_FULL_FEATURE_PHASE ISCSI_LOGIN_CSG_FULL_FEATURE_PHASE
670 
671 /** Mask for all iSCSI session phases */
672 #define ISCSI_STATUS_PHASE_MASK ( ISCSI_LOGIN_CSG_MASK | ISCSI_LOGIN_NSG_MASK )
673 
674 /** iSCSI session needs to send the initial security negotiation strings */
675 #define ISCSI_STATUS_STRINGS_SECURITY 0x0100
676 
677 /** iSCSI session needs to send the CHAP_A string */
678 #define ISCSI_STATUS_STRINGS_CHAP_ALGORITHM 0x0200
679 
680 /** iSCSI session needs to send the CHAP response */
681 #define ISCSI_STATUS_STRINGS_CHAP_RESPONSE 0x0400
682 
683 /** iSCSI session needs to send the mutual CHAP challenge */
684 #define ISCSI_STATUS_STRINGS_CHAP_CHALLENGE 0x0800
685 
686 /** iSCSI session needs to send the operational negotiation strings */
687 #define ISCSI_STATUS_STRINGS_OPERATIONAL 0x1000
688 
689 /** Mask for all iSCSI "needs to send" flags */
690 #define ISCSI_STATUS_STRINGS_MASK 0xff00
691 
692 /** Target has requested forward (initiator) authentication */
693 #define ISCSI_STATUS_AUTH_FORWARD_REQUIRED 0x00010000
694 
695 /** Initiator requires target (reverse) authentication */
696 #define ISCSI_STATUS_AUTH_REVERSE_REQUIRED 0x00020000
697 
698 /** Target authenticated itself correctly */
699 #define ISCSI_STATUS_AUTH_REVERSE_OK 0x00040000
700 
701 /** Default initiator IQN prefix */
702 #define ISCSI_DEFAULT_IQN_PREFIX "iqn.2010-04.org.ipxe"
703 
704 extern const struct setting
705 initiator_iqn_setting __setting ( SETTING_SANBOOT_EXTRA, initiator-iqn );
706 
707 #endif /* _IPXE_ISCSI_H */
uint32_t isid_iana_en
Initiator session ID (IANA format) enterprise number and flags.
Definition: iscsi.h:144
A process.
Definition: process.h:17
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
Definition: iscsi.h:146
iscsi_tx_state
State of an iSCSI TX engine.
Definition: iscsi.h:511
iSCSI data-in basic header segment
Definition: iscsi.h:345
uint8_t flags
Flags.
Definition: iscsi.h:109
iSCSI NOP-In basic header segment
Definition: iscsi.h:467
unsigned short uint16_t
Definition: stdint.h:11
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:315
A CHAP response.
Definition: chap.h:18
struct iscsi_bhs_login_request login_request
Definition: iscsi.h:499
uint32_t snack
SNACK tag.
Definition: iscsi.h:311
#define SETTING_SANBOOT_EXTRA
SAN boot additional settings.
Definition: settings.h:74
struct iscsi_segment_lengths::@543 bytes
uint8_t reserved_a[8]
Reserved.
Definition: iscsi.h:307
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:123
char * initiator_username
Initiator username (if any)
Definition: iscsi.h:563
uint8_t opcode
Opcode.
Definition: iscsi.h:107
An iSCSI session.
Definition: iscsi.h:535
struct iscsi_bhs_common common
Definition: iscsi.h:497
struct sockaddr target_sockaddr
Target socket address (for boot firmware table)
Definition: iscsi.h:649
uint32_t ttt
Target transfer tag.
Definition: iscsi.h:597
uint32_t residual_count
Residual count.
Definition: iscsi.h:373
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:403
uint8_t other_b[8]
Fields specific to the PDU type.
Definition: iscsi.h:79
uint32_t maxcmdsn
Maximum command sequence number.
Definition: iscsi.h:367
Receiving the data segment.
Definition: iscsi.h:529
uint16_t cid
Connection ID.
Definition: iscsi.h:152
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:439
struct interface socket
Transport-layer socket.
Definition: iscsi.h:544
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:142
uint32_t offset
Buffer offset.
Definition: iscsi.h:371
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:216
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:264
uint16_t reserved_a
Reserved.
Definition: iscsi.h:258
iSCSI login request basic header segment
Definition: iscsi.h:132
struct iscsi_bhs_data_out data_out
Definition: iscsi.h:504
struct iscsi_bhs_common_response common_response
Definition: iscsi.h:498
uint32_t r2tsn
R2T sequence number.
Definition: iscsi.h:453
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:309
uint8_t flags
Flags.
Definition: iscsi.h:299
uint32_t maxcmdsn
Maximum command sequence number.
Definition: iscsi.h:451
uint32_t statsn
Status sequence number.
Definition: iscsi.h:313
uint32_t expstatsn
Expected status sequence number.
Definition: iscsi.h:270
struct scsi_lun lun
Logical Unit Number.
Definition: iscsi.h:441
uint8_t other_c[28]
Fields specific to the PDU type.
Definition: iscsi.h:83
uint32_t maxcmdsn
Maximum command sequence number.
Definition: iscsi.h:317
size_t rx_len
Length of the current RX state.
Definition: iscsi.h:641
uint16_t tsih
Target session identifying handle.
Definition: iscsi.h:148
iscsi_rx_state
State of an iSCSI RX engine.
Definition: iscsi.h:523
uint8_t flags
Flags.
Definition: iscsi.h:136
uint8_t response
Response code.
Definition: iscsi.h:301
struct scsi_lun lun
Logical Unit Number.
Definition: iscsi.h:475
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:365
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:449
uint32_t statsn
Status sequence number.
Definition: iscsi.h:121
uint32_t maxcmdsn
Maximum command sequence number.
Definition: iscsi.h:224
void * rx_buffer
Buffer for received data (not always used)
Definition: iscsi.h:643
uint8_t opcode
Opcode.
Definition: iscsi.h:200
struct iscsi_bhs_r2t r2t
Definition: iscsi.h:505
uint8_t status
SCSI status code.
Definition: iscsi.h:303
uint16_t reserved_a
Reserved.
Definition: iscsi.h:437
iSCSI SCSI command basic header segment
Definition: iscsi.h:252
uint8_t status
SCSI status code.
Definition: iscsi.h:353
uint8_t version_min
Minimum supported version number.
Definition: iscsi.h:206
uint32_t statsn
Status sequence number.
Definition: iscsi.h:625
Data transfer interfaces.
A reference counter.
Definition: refcnt.h:26
unsigned int target_port
Target port.
Definition: iscsi.h:551
struct scsi_lun lun
Logical Unit Number.
Definition: iscsi.h:405
char * initiator_password
Initiator password (if any)
Definition: iscsi.h:565
uint8_t status_detail
Status detail.
Definition: iscsi.h:228
uint32_t ttt
Target Transfer Tag.
Definition: iscsi.h:361
uint8_t reserved_b[12]
Reserved.
Definition: iscsi.h:487
size_t rx_offset
Byte offset within the current RX state.
Definition: iscsi.h:639
unsigned char bytes[sizeof(struct iscsi_bhs_common)]
Definition: iscsi.h:507
uint32_t reserved_a
Reserved.
Definition: iscsi.h:218
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:222
uint8_t version_min
Minimum supported version number.
Definition: iscsi.h:140
struct interface control
SCSI command-issuing interface.
Definition: iscsi.h:540
Nothing to send.
Definition: iscsi.h:513
uint8_t reserved_a
Reserved.
Definition: iscsi.h:351
uint16_t tsih
Target session identifying handle.
Definition: iscsi.h:214
uint8_t other_c[4]
Fields specific to the PDU type.
Definition: iscsi.h:119
uint8_t data_len[3]
The data length (measured in bytes), in network byte order.
Definition: iscsi.h:39
A SCSI command.
Definition: scsi.c:262
An object interface.
Definition: interface.h:109
uint8_t opcode
Opcode.
Definition: iscsi.h:433
uint8_t flags
Flags.
Definition: iscsi.h:73
uint32_t itt
Initiator task tag.
Definition: iscsi.h:591
uint32_t datasn
Data sequence number.
Definition: iscsi.h:417
uint16_t reserved_a
Reserved.
Definition: iscsi.h:154
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:355
Receiving the data segment padding.
Definition: iscsi.h:531
uint8_t status_class
Status class.
Definition: iscsi.h:226
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:443
int status
Session status.
Definition: iscsi.h:560
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:260
uint8_t other_d[16]
Fields specific to the PDU type.
Definition: iscsi.h:125
uint8_t reserved_b[10]
Reserved.
Definition: iscsi.h:230
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:117
uint8_t opcode
Opcode.
Definition: iscsi.h:347
uint32_t ttt
Target Transfer Tag.
Definition: iscsi.h:409
struct acpi_descriptor desc
ACPI descriptor.
Definition: iscsi.h:653
union iscsi_bhs tx_bhs
Basic header segment for current TX PDU.
Definition: iscsi.h:628
iSCSI basic header segment common request fields
Definition: iscsi.h:105
uint32_t reserved_b
Reserved.
Definition: iscsi.h:411
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:477
uint32_t statsn
Status sequence number.
Definition: iscsi.h:481
Configuration settings.
union scsi_cdb cdb
SCSI Command Descriptor Block (CDB)
Definition: iscsi.h:272
Generalized socket address structure.
Definition: socket.h:96
Receiving the additional header segment.
Definition: iscsi.h:527
uint32_t offset
Buffer offset.
Definition: iscsi.h:455
iSCSI basic header segment common fields
Definition: iscsi.h:69
iSCSI segment lengths
Definition: iscsi.h:32
ACPI data structures.
struct scsi_lun lun
SCSI LUN (for boot firmware table)
Definition: iscsi.h:651
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:359
CHAP protocol.
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:305
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
enum iscsi_rx_state rx_state
State of the RX engine.
Definition: iscsi.h:637
uint32_t offset
Buffer offset.
Definition: iscsi.h:419
uint8_t flags
Flags.
Definition: iscsi.h:399
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:150
uint8_t opcode
Opcode.
Definition: iscsi.h:254
uint8_t version_max
Maximum supported version number.
Definition: iscsi.h:204
const struct setting initiator_iqn_setting __setting(SETTING_SANBOOT_EXTRA, initiator-iqn)
iSCSI request to transfer basic header segment
Definition: iscsi.h:431
char * target_address
Target address.
Definition: iscsi.h:549
iSCSI login response basic header segment
Definition: iscsi.h:198
struct chap_response chap
CHAP response (used for both initiator and target auth)
Definition: iscsi.h:578
uint32_t expdatasn
Expected data sequence number.
Definition: iscsi.h:319
struct scsi_lun lun
SCSI Logical Unit Number.
Definition: iscsi.h:262
Processes.
unsigned char uint8_t
Definition: stdint.h:10
uint8_t flags
Flags.
Definition: iscsi.h:202
uint8_t flags
Flags.
Definition: iscsi.h:349
uint8_t flags
Flags.
Definition: iscsi.h:435
Sending the additional header segment.
Definition: iscsi.h:517
uint8_t opcode
Opcode.
Definition: iscsi.h:134
uint8_t ahs_len
The AHS length (measured in dwords)
Definition: iscsi.h:35
uint32_t statsn
Status sequence number.
Definition: iscsi.h:363
struct interface data
SCSI command interface.
Definition: iscsi.h:542
unsigned int uint32_t
Definition: stdint.h:12
uint32_t expstatsn
Expected status sequence number.
Definition: iscsi.h:158
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
Definition: iscsi.h:585
uint32_t datasn
Data sequence number.
Definition: iscsi.h:369
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:113
uint32_t len
Desired data transfer length.
Definition: iscsi.h:457
unsigned char chap_challenge[17]
CHAP challenge (for target auth only)
Definition: iscsi.h:576
A setting.
Definition: settings.h:23
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:77
A SCSI Command Data Block.
Definition: scsi.h:207
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:208
uint32_t transfer_offset
Transfer offset.
Definition: iscsi.h:603
SCSI devices.
A SCSI command information unit.
Definition: scsi.h:249
uint8_t reserved_b[16]
Reserved.
Definition: iscsi.h:160
An ACPI descriptor (used to construct ACPI tables)
Definition: acpi.h:143
uint8_t opcode
Opcode.
Definition: iscsi.h:71
iSCSI data-out basic header segment
Definition: iscsi.h:395
char * target_iqn
Target IQN.
Definition: iscsi.h:553
uint32_t expstatsn
Expected status sequence number.
Definition: iscsi.h:413
uint8_t opcode
Opcode.
Definition: iscsi.h:297
uint32_t transfer_len
Transfer length.
Definition: iscsi.h:609
struct iscsi_nop_in nop_in
Definition: iscsi.h:506
uint8_t flags
Flags.
Definition: iscsi.h:256
An iSCSI basic header segment.
Definition: iscsi.h:496
uint32_t ahs_and_data_len
The data length (measured in bytes), in network byte order, with ahs_len as the first byte.
Definition: iscsi.h:44
struct iscsi_bhs_login_response login_response
Definition: iscsi.h:500
uint32_t cmdsn
Command sequence number.
Definition: iscsi.h:156
uint8_t other_b[8]
Fields specific to the PDU type.
Definition: iscsi.h:115
uint8_t version_max
Maximum supported version number.
Definition: iscsi.h:138
uint32_t bidi_residual_count
Bidirectional read residual count.
Definition: iscsi.h:321
uint32_t statsn
Status sequence number.
Definition: iscsi.h:220
uint32_t cmdsn
Command sequence number.
Definition: iscsi.h:617
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:407
uint8_t reserved_a[3]
Reserved.
Definition: iscsi.h:471
uint16_t reserved_a
Reserved.
Definition: iscsi.h:401
uint32_t ttt
Target Transfer Tag.
Definition: iscsi.h:445
uint32_t reserved_c
Reserved.
Definition: iscsi.h:415
Reference counting.
uint32_t residual_count
Residual count.
Definition: iscsi.h:323
iSCSI SCSI response basic header segment
Definition: iscsi.h:295
uint8_t other_a[2]
Fields specific to the PDU type.
Definition: iscsi.h:111
union iscsi_bhs rx_bhs
Basic header segment for current RX PDU.
Definition: iscsi.h:635
uint8_t opcode
Opcode.
Definition: iscsi.h:397
A SCSI LUN.
Definition: scsi.h:236
uint8_t opcode
Opcode.
Definition: iscsi.h:469
char * initiator_iqn
Initiator IQN.
Definition: iscsi.h:547
Sending the data segment.
Definition: iscsi.h:519
uint32_t expcmdsn
Expected command sequence number.
Definition: iscsi.h:483
struct iscsi_bhs_scsi_response scsi_response
Definition: iscsi.h:502
char * target_password
Target password (if any)
Definition: iscsi.h:569
struct scsi_cmd * command
Current SCSI command, if any.
Definition: iscsi.h:646
Socket addresses.
uint32_t isid_iana_en
Initiator session ID (IANA format) enterprise number and flags.
Definition: iscsi.h:210
char * target_username
Target username (if any)
Definition: iscsi.h:567
Sending the basic header segment.
Definition: iscsi.h:515
Receiving the basic header segment.
Definition: iscsi.h:525
uint32_t ttt
Target Transfer Tag.
Definition: iscsi.h:479
uint32_t statsn
Status sequence number.
Definition: iscsi.h:447
uint16_t isid_iana_qual
Initiator session ID (IANA format) qualifier.
Definition: iscsi.h:212
struct iscsi_bhs_data_in data_in
Definition: iscsi.h:503
uint32_t itt
Initiator Task Tag.
Definition: iscsi.h:81
uint32_t maxcmdsn
Maximum command sequence number.
Definition: iscsi.h:485
uint32_t exp_len
Expected data transfer length.
Definition: iscsi.h:266
struct scsi_lun lun
Logical Unit Number.
Definition: iscsi.h:357
uint32_t reserved_d
Reserved.
Definition: iscsi.h:421
enum iscsi_tx_state tx_state
State of the TX engine.
Definition: iscsi.h:630
union iscsi_segment_lengths lengths
Segment lengths.
Definition: iscsi.h:473
uint8_t other_a[2]
Fields specific to the PDU type.
Definition: iscsi.h:75
uint32_t cmdsn
Command sequence number.
Definition: iscsi.h:268