Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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