Skip to main content

Module opcode

Module opcode 

Source
Expand description

Defines the iSCSI opcode enumeration. Helpers for encoding / decoding the very first byte of every iSCSI Basic-Header-Segment (BHS).

The byte layout is defined by RFC 7143 § 5.3:

 7   6   5   4   3   2   1   0      bit position
+---+---+---------------------------+
| . | I |        OPCODE (6 bits)    |  ← first BHS octet
+---+---+---------------------------+
  • IImmediate flag. When set, the PDU is processed by the target before any queued commands.
  • OPCODE – 6-bit operation code identifying the PDU type.

The utilities below allow you to

  • split the raw byte into a pair (IfFlags, Opcode) (TryFrom<u8>)
  • merge a pair back into the raw byte (From<&BhsOpcode> for u8).

Structs§

BhsOpcode
Typed representation of the very first BHS byte.
RawBhsOpcode
Wire-safe, zero-copy first BHS octet. Transparent over u8, so it can live inside a zerocopy BHS struct.
UnknownOpcode
Returned when the lower six bits contain an undefined op-code.

Enums§

Opcode
All op-codes defined by RFC 3720 & RFC 7143 (§ 9.1).