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  */
32 union iscsi_segment_lengths {
33 	struct {
34 		/** The AHS length (measured in dwords) */
35 		uint8_t ahs_len;
36 		/** The data length (measured in bytes), in network
37 		 * byte order
38 		 */
39 		uint8_t data_len[3];
40 	} bytes;
41 	/** The data length (measured in bytes), in network byte
42 	 * order, with ahs_len as the first byte.
43 	 */
44 	uint32_t ahs_and_data_len;
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  */
69 struct iscsi_bhs_common {
70 	/** Opcode */
71 	uint8_t opcode;
72 	/** Flags */
73 	uint8_t flags;
74 	/** Fields specific to the PDU type */
75 	uint8_t other_a[2];
76 	/** Segment lengths */
77 	union iscsi_segment_lengths lengths;
78 	/** Fields specific to the PDU type */
79 	uint8_t other_b[8];
80 	/** Initiator Task Tag */
81 	uint32_t itt;
82 	/** Fields specific to the PDU type */
83 	uint8_t other_c[28];
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  */
105 struct iscsi_bhs_common_response {
106 	/** Opcode */
107 	uint8_t opcode;
108 	/** Flags */
109 	uint8_t flags;
110 	/** Fields specific to the PDU type */
111 	uint8_t other_a[2];
112 	/** Segment lengths */
113 	union iscsi_segment_lengths lengths;
114 	/** Fields specific to the PDU type */
115 	uint8_t other_b[8];
116 	/** Initiator Task Tag */
117 	uint32_t itt;
118 	/** Fields specific to the PDU type */
119 	uint8_t other_c[4];
120 	/** Status sequence number */
121 	uint32_t statsn;
122 	/** Expected command sequence number */
123 	uint32_t expcmdsn;
124 	/** Fields specific to the PDU type */
125 	uint8_t other_d[16];
126 };
127 
128 /**
129  * iSCSI login request basic header segment
130  *
131  */
132 struct iscsi_bhs_login_request {
133 	/** Opcode */
134 	uint8_t opcode;
135 	/** Flags */
136 	uint8_t flags;
137 	/** Maximum supported version number */
138 	uint8_t version_max;
139 	/** Minimum supported version number */
140 	uint8_t version_min;
141 	/** Segment lengths */
142 	union iscsi_segment_lengths lengths;
143 	/** Initiator session ID (IANA format) enterprise number and flags */
144 	uint32_t isid_iana_en;
145 	/** Initiator session ID (IANA format) qualifier */
146 	uint16_t isid_iana_qual;
147 	/** Target session identifying handle */
148 	uint16_t tsih;
149 	/** Initiator Task Tag */
150 	uint32_t itt;
151 	/** Connection ID */
152 	uint16_t cid;
153 	/** Reserved */
154 	uint16_t reserved_a;
155 	/** Command sequence number */
156 	uint32_t cmdsn;
157 	/** Expected status sequence number */
158 	uint32_t expstatsn;
159 	/** Reserved */
160 	uint8_t reserved_b[16];
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  */
198 struct iscsi_bhs_login_response {
199 	/** Opcode */
200 	uint8_t opcode;
201 	/** Flags */
202 	uint8_t flags;
203 	/** Maximum supported version number */
204 	uint8_t version_max;
205 	/** Minimum supported version number */
206 	uint8_t version_min;
207 	/** Segment lengths */
208 	union iscsi_segment_lengths lengths;
209 	/** Initiator session ID (IANA format) enterprise number and flags */
210 	uint32_t isid_iana_en;
211 	/** Initiator session ID (IANA format) qualifier */
212 	uint16_t isid_iana_qual;
213 	/** Target session identifying handle */
214 	uint16_t tsih;
215 	/** Initiator Task Tag */
216 	uint32_t itt;
217 	/** Reserved */
218 	uint32_t reserved_a;
219 	/** Status sequence number */
220 	uint32_t statsn;
221 	/** Expected command sequence number */
222 	uint32_t expcmdsn;
223 	/** Maximum command sequence number */
224 	uint32_t maxcmdsn;
225 	/** Status class */
226 	uint8_t status_class;
227 	/** Status detail */
228 	uint8_t status_detail;
229 	/** Reserved */
230 	uint8_t reserved_b[10];
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  */
252 struct iscsi_bhs_scsi_command {
253 	/** Opcode */
254 	uint8_t opcode;
255 	/** Flags */
256 	uint8_t flags;
257 	/** Reserved */
258 	uint16_t reserved_a;
259 	/** Segment lengths */
260 	union iscsi_segment_lengths lengths;
261 	/** SCSI Logical Unit Number */
262 	struct scsi_lun lun;
263 	/** Initiator Task Tag */
264 	uint32_t itt;
265 	/** Expected data transfer length */
266 	uint32_t exp_len;
267 	/** Command sequence number */
268 	uint32_t cmdsn;
269 	/** Expected status sequence number */
270 	uint32_t expstatsn;
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  */
295 struct iscsi_bhs_scsi_response {
296 	/** Opcode */
297 	uint8_t opcode;
298 	/** Flags */
299 	uint8_t flags;
300 	/** Response code */
301 	uint8_t response;
302 	/** SCSI status code */
303 	uint8_t status;
304 	/** Segment lengths */
305 	union iscsi_segment_lengths lengths;
306 	/** Reserved */
307 	uint8_t reserved_a[8];
308 	/** Initiator Task Tag */
309 	uint32_t itt;
310 	/** SNACK tag */
311 	uint32_t snack;
312 	/** Status sequence number */
313 	uint32_t statsn;
314 	/** Expected command sequence number */
315 	uint32_t expcmdsn;
316 	/** Maximum command sequence number */
317 	uint32_t maxcmdsn;
318 	/** Expected data sequence number */
319 	uint32_t expdatasn;
320 	/** Bidirectional read residual count */
321 	uint32_t bidi_residual_count;
322 	/** Residual count */
323 	uint32_t 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  */
345 struct iscsi_bhs_data_in {
346 	/** Opcode */
347 	uint8_t opcode;
348 	/** Flags */
349 	uint8_t flags;
350 	/** Reserved */
351 	uint8_t reserved_a;
352 	/** SCSI status code */
353 	uint8_t status;
354 	/** Segment lengths */
355 	union iscsi_segment_lengths lengths;
356 	/** Logical Unit Number */
357 	struct scsi_lun lun;
358 	/** Initiator Task Tag */
359 	uint32_t itt;
360 	/** Target Transfer Tag */
361 	uint32_t ttt;
362 	/** Status sequence number */
363 	uint32_t statsn;
364 	/** Expected command sequence number */
365 	uint32_t expcmdsn;
366 	/** Maximum command sequence number */
367 	uint32_t maxcmdsn;
368 	/** Data sequence number */
369 	uint32_t datasn;
370 	/** Buffer offset */
371 	uint32_t offset;
372 	/** Residual count */
373 	uint32_t 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  */
395 struct iscsi_bhs_data_out {
396 	/** Opcode */
397 	uint8_t opcode;
398 	/** Flags */
399 	uint8_t flags;
400 	/** Reserved */
401 	uint16_t reserved_a;
402 	/** Segment lengths */
403 	union iscsi_segment_lengths lengths;
404 	/** Logical Unit Number */
405 	struct scsi_lun lun;
406 	/** Initiator Task Tag */
407 	uint32_t itt;
408 	/** Target Transfer Tag */
409 	uint32_t ttt;
410 	/** Reserved */
411 	uint32_t reserved_b;
412 	/** Expected status sequence number */
413 	uint32_t expstatsn;
414 	/** Reserved */
415 	uint32_t reserved_c;
416 	/** Data sequence number */
417 	uint32_t datasn;
418 	/** Buffer offset */
419 	uint32_t offset;
420 	/** Reserved */
421 	uint32_t reserved_d;
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  */
431 struct iscsi_bhs_r2t {
432 	/** Opcode */
433 	uint8_t opcode;
434 	/** Flags */
435 	uint8_t flags;
436 	/** Reserved */
437 	uint16_t reserved_a;
438 	/** Segment lengths */
439 	union iscsi_segment_lengths lengths;
440 	/** Logical Unit Number */
441 	struct scsi_lun lun;
442 	/** Initiator Task Tag */
443 	uint32_t itt;
444 	/** Target Transfer Tag */
445 	uint32_t ttt;
446 	/** Status sequence number */
447 	uint32_t statsn;
448 	/** Expected command sequence number */
449 	uint32_t expcmdsn;
450 	/** Maximum command sequence number */
451 	uint32_t maxcmdsn;
452 	/** R2T sequence number */
453 	uint32_t r2tsn;
454 	/** Buffer offset */
455 	uint32_t offset;
456 	/** Desired data transfer length */
457 	uint32_t len;
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 */
469 	uint8_t opcode;
470 	/** Reserved */
471 	uint8_t reserved_a[3];
472 	/** Segment lengths */
473 	union iscsi_segment_lengths lengths;
474 	/** Logical Unit Number */
475 	struct scsi_lun lun;
476 	/** Initiator Task Tag */
477 	uint32_t itt;
478 	/** Target Transfer Tag */
479 	uint32_t ttt;
480 	/** Status sequence number */
481 	uint32_t statsn;
482 	/** Expected command sequence number */
483 	uint32_t expcmdsn;
484 	/** Maximum command sequence number */
485 	uint32_t maxcmdsn;
486 	/** Reserved */
487 	uint8_t reserved_b[12];
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 {
497 	struct iscsi_bhs_common common;
498 	struct iscsi_bhs_common_response common_response;
499 	struct iscsi_bhs_login_request login_request;
500 	struct iscsi_bhs_login_response login_response;
501 	struct iscsi_bhs_scsi_command scsi_command;
502 	struct iscsi_bhs_scsi_response scsi_response;
503 	struct iscsi_bhs_data_in data_in;
504 	struct iscsi_bhs_data_out data_out;
505 	struct iscsi_bhs_r2t r2t;
506 	struct iscsi_nop_in nop_in;
507 	unsigned char bytes[ sizeof ( struct iscsi_bhs_common ) ];
508 };
509 
510 /** State of an iSCSI TX engine */
511 enum iscsi_tx_state {
512 	/** Nothing to send */
513 	ISCSI_TX_IDLE = 0,
514 	/** Sending the basic header segment */
515 	ISCSI_TX_BHS,
516 	/** Sending the additional header segment */
517 	ISCSI_TX_AHS,
518 	/** Sending the data segment */
519 	ISCSI_TX_DATA,
520 };
521 
522 /** State of an iSCSI RX engine */
523 enum iscsi_rx_state {
524 	/** Receiving the basic header segment */
525 	ISCSI_RX_BHS = 0,
526 	/** Receiving the additional header segment */
527 	ISCSI_RX_AHS,
528 	/** Receiving the data segment */
529 	ISCSI_RX_DATA,
530 	/** Receiving the data segment padding */
531 	ISCSI_RX_DATA_PADDING,
532 };
533 
534 /** An iSCSI session */
535 struct iscsi_session {
536 	/** Reference counter */
537 	struct refcnt refcnt;
538 
539 	/** SCSI command-issuing interface */
540 	struct interface control;
541 	/** SCSI command interface */
542 	struct interface data;
543 	/** Transport-layer socket */
544 	struct interface socket;
545 
546 	/** Initiator IQN */
547 	char *initiator_iqn;
548 	/** Target address */
549 	char *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) */
563 	char *initiator_username;
564 	/** Initiator password (if any) */
565 	char *initiator_password;
566 	/** Target username (if any) */
567 	char *target_username;
568 	/** Target password (if any) */
569 	char *target_password;
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) */
578 	struct chap_response chap;
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 	 */
585 	uint16_t isid_iana_qual;
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 	 */
591 	uint32_t itt;
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 	 */
597 	uint32_t ttt;
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 	 */
603 	uint32_t transfer_offset;
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 	 */
609 	uint32_t transfer_len;
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 	 */
617 	uint32_t cmdsn;
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 	 */
625 	uint32_t statsn;
626 
627 	/** Basic header segment for current TX PDU */
628 	union iscsi_bhs tx_bhs;
629 	/** State of the TX engine */
630 	enum iscsi_tx_state tx_state;
631 	/** TX process */
632 	struct process process;
633 
634 	/** Basic header segment for current RX PDU */
635 	union iscsi_bhs rx_bhs;
636 	/** State of the RX engine */
637 	enum iscsi_rx_state rx_state;
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) */
649 	struct sockaddr target_sockaddr;
650 	/** SCSI LUN (for boot firmware table) */
651 	struct scsi_lun lun;
652 	/** ACPI descriptor */
653 	struct acpi_descriptor desc;
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 */
708