Documentation
¶
Index ¶
Constants ¶
const ( Version = 0x0111 // Management commands OpReqDevlist = 0x8005 OpRepDevlist = 0x0005 OpReqImport = 0x8003 OpRepImport = 0x0003 // URB transfer commands CmdSubmitCode = 0x00000001 CmdUnlinkCode = 0x00000002 RetSubmitCode = 0x00000003 RetUnlinkCode = 0x00000004 // Directions used in usbip_header_basic.direction DirOut = 0x00000000 DirIn = 0x00000001 )
Wire constants (network byte order / big-endian)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CmdSubmit ¶
type CmdSubmit struct {
Basic HeaderBasic
TransferFlags uint32
TransferBufferLen uint32
StartFrame uint32
NumberOfPackets uint32
Interval uint32
Setup [8]byte
}
CmdSubmit header (before payload) length is 0x30.
type CmdUnlink ¶
type CmdUnlink struct {
Basic HeaderBasic
UnlinkSeqnum uint32
Padding [24]byte
}
CmdUnlink and RetUnlink
type DevListReplyHeader ¶
type DevListReplyHeader struct {
NDevices uint32
}
DevListReplyHeader is the header after MgmtHeader for OP_REP_DEVLIST.
type ExportMeta ¶
ExportMeta carries USB-IP bus identity for an emulated device. Uses fixed-size arrays matching the wire protocol format.
type ExportedDevice ¶
type ExportedDevice struct {
ExportMeta
Speed uint32
IDVendor uint16
IDProduct uint16
BcdDevice uint16
BDeviceClass uint8
BDeviceSubClass uint8
BDeviceProtocol uint8
BConfigurationValue uint8
BNumConfigurations uint8
BNumInterfaces uint8
// Interfaces: for each interface: class, subclass, protocol, pad
Interfaces []InterfaceDesc
}
ExportedDevice describes one exported device in devlist/import replies. Layout matches kernel doc, strings are fixed-size, remaining numbers are BE.
func (*ExportedDevice) WriteDevlist ¶
func (d *ExportedDevice) WriteDevlist(w io.Writer) error
WriteDevlist writes the device entry for OP_REP_DEVLIST (includes interface triplets).
func (*ExportedDevice) WriteImport ¶
func (d *ExportedDevice) WriteImport(w io.Writer) error
WriteImport writes the device entry for OP_REP_IMPORT (ends at bNumInterfaces).
type HeaderBasic ¶
HeaderBasic is common to all URB cmds and replies.
type InterfaceDesc ¶
type MgmtHeader ¶
MgmtHeader is the 8-byte header for management ops (devlist/import).