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