aoe

package
v0.783.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package aoe decodes ATA over Ethernet (AoE, EtherType 0x88A2) — the CORAID protocol that exposes raw ATA disk commands directly over an Ethernet segment. AoE has **no authentication and no IP layer**: any host on the same L2 segment can issue ATA READ / WRITE to an exposed AoE target (a major unauthenticated data-theft / data-destruction surface). A captured AoE frame is storage-reconnaissance: it reveals the target disk (shelf.slot), the ATA command (READ / WRITE / IDENTIFY), the 48-bit LBA and sector count being transferred, or — via the Query Config Information command — the target's config string and firmware. It joins the project's other L2 / capture decoders.

Wrap-vs-native judgement

Native. An AoE frame is a fixed 10-byte header (version/flags, error,
shelf, slot, command, tag) plus a command-specific body. A byte-field
read + a command switch; stdlib only, no new go.mod dep.

Verifiable / no confidently-wrong output

The structural fields — version, shelf (major), slot (minor), command,
tag, and the ATA command / sector count / 48-bit little-endian LBA,
plus the Query-Config fields — were verified field-for-field against
scapy's AoE layer (scapy.contrib.aoe). The header **Response / Error**
flags are decoded per the AoE spec (bit 3 = 0x08 Response, bit 2 =
0x04 Error, as Wireshark's dissector does): scapy's AoE layer maps
those flag bits incorrectly, so the spec is followed and the raw flag
nibble is also surfaced. The ATA aflags byte's bit meanings are not
authoritatively settled across implementations, so it is surfaced raw
rather than labelled — the read-vs-write intent is already unambiguous
from the ATA command byte.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ATACommand

type ATACommand struct {
	AFlagsHex   string `json:"aflags_hex"`
	ErrFeature  int    `json:"err_feature"`
	SectorCount int    `json:"sector_count"`
	ATACmd      int    `json:"ata_command"`
	ATACmdName  string `json:"ata_command_name"`
	LBA         uint64 `json:"lba"`
	DataHex     string `json:"data_hex,omitempty"`
}

ATACommand is the decoded Issue-ATA-Command body.

type QueryConfig

type QueryConfig struct {
	BufferCount int    `json:"buffer_count"`
	Firmware    int    `json:"firmware_version"`
	SectorCount int    `json:"sector_count"`
	AoEVersion  int    `json:"aoe_version"`
	ConfigCmd   int    `json:"config_command"`
	ConfigName  string `json:"config_command_name"`
	ConfigStr   string `json:"config_string,omitempty"`
	ConfigHex   string `json:"config_hex,omitempty"`
}

QueryConfig is the decoded Query-Config-Information body.

type Result

type Result struct {
	Version   int    `json:"version"`
	FlagsHex  string `json:"flags_hex"`
	Response  bool   `json:"response"`
	Error     bool   `json:"error_flag"`
	ErrorCode int    `json:"error_code"`
	ErrorName string `json:"error_name,omitempty"`
	Shelf     int    `json:"shelf"` // major
	Slot      int    `json:"slot"`  // minor
	Command   int    `json:"command"`
	CmdName   string `json:"command_name"`
	Tag       string `json:"tag"`

	ATA   *ATACommand  `json:"ata_command,omitempty"`
	Query *QueryConfig `json:"query_config,omitempty"`

	BodyHex string   `json:"body_hex,omitempty"`
	Notes   []string `json:"notes,omitempty"`
}

Result is the decoded view of an AoE frame.

func Decode

func Decode(input string) (*Result, error)

Decode parses an AoE frame (the EtherType-0x88A2 payload) from hex (whitespace / ':' / '-' / '_' separators and a '0x' prefix tolerated).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL