virtual_fido

package module
v0.0.0-...-4e4639c Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CTAP_AUTH_DATA_FLAG_USER_PRESENT            uint8 = 0b00000001
	CTAP_AUTH_DATA_FLAG_USER_VERIFIED           uint8 = 0b00000100
	CTAP_AUTH_DATA_FLAG_ATTESTED_DATA_INCLUDED  uint8 = 0b01000000
	CTAP_AUTH_DATA_FLAG_EXTENSION_DATA_INCLUDED uint8 = 0b10000000
)
View Source
const (
	USB_CONFIG_ATTR_BASE          = 0b10000000
	USB_CONFIG_ATTR_SELF_POWERED  = 0b01000000
	USB_CONFIG_ATTR_REMOTE_WAKEUP = 0b00100000

	USB_INTERFACE_CLASS_HID = 3

	USB_LANGID_ENG_USA = 0x0409
)
View Source
const (
	USBIP_VERSION = 0x0111

	USBIP_COMMAND_SUBMIT     = 0x1
	USBIP_COMMAND_UNLINK     = 0x2
	USBIP_COMMAND_RET_SUBMIT = 0x3
	USBIP_COMMAND_RET_UNLINK = 0x4

	USBIP_DIR_OUT = 0x0
	USBIP_DIR_IN  = 0x1
)
View Source
const (
	CTAPHIDSERVER_MAX_PACKET_SIZE int = 64
)
View Source
const CTAPHID_STATUS_UPNEEDED uint8 = 2

Variables

View Source
var AAGUID = [16]byte{117, 108, 90, 245, 236, 166, 1, 163, 47, 198, 211, 12, 226, 242, 1, 197}

Functions

func SetLogOutput

func SetLogOutput(out io.Writer)

func Start

func Start(client Client)

Types

type COSEAlgorithmID

type COSEAlgorithmID int32
const (
	COSE_ALGORITHM_ID_ES256 COSEAlgorithmID = -7
)

type CTAPAttestedCredentialData

type CTAPAttestedCredentialData struct {
	AAGUID             []byte
	CredentialIDLength uint16
	CredentialID       []byte
	EncodedPublicKey   []byte
}

type CTAPAuthData

type CTAPAuthData struct {
	RelyingPartyIDHash     []byte
	Flags                  uint8
	AttestedCredentialData *CTAPAttestedCredentialData
}

type CTAPCOSEPublicKey

type CTAPCOSEPublicKey struct {
	Kty int8   `cbor:"1,keyasint"`
	Alg int8   `cbor:"3,keyasint"`
	Crv int8   `cbor:"-1,keyasint"`
	X   []byte `cbor:"-2,keyasint"`
	Y   []byte `cbor:"-3,keyasint"`
}

type CTAPClientPINArgs

type CTAPClientPINArgs struct {
	PinProtocol     uint32            `cbor:"1,keyasint"`
	SubCommand      uint32            `cbor:"2,keyasint"`
	KeyAgreement    CTAPCOSEPublicKey `cbor:"3,keyasint"`
	PINAuth         []byte            `cbor:"4,keyasint"`
	NewPINEncoding  []byte            `cbor:"5,keyasint"`
	PINHashEncoding []byte            `cbor:"6,keyasint"`
}

type CTAPCommand

type CTAPCommand uint8
const (
	CTAP_COMMAND_MAKE_CREDENTIAL    CTAPCommand = 0x01
	CTAP_COMMAND_GET_ASSERTION      CTAPCommand = 0x02
	CTAP_COMMAND_GET_INFO           CTAPCommand = 0x04
	CTAP_COMMAND_CLIENT_PIN         CTAPCommand = 0x06
	CTAP_COMMAND_RESET              CTAPCommand = 0x07
	CTAP_COMMAND_GET_NEXT_ASSERTION CTAPCommand = 0x08
)

type CTAPCommandOptions

type CTAPCommandOptions struct {
	ResidentKey      bool `cbor:"rk,omitempty"`
	UserVerification bool `cbor:"uv,omitempty"`
	UserPresence     bool `cbor:"up,omitempty"`
}

type CTAPGetAssertionArgs

type CTAPGetAssertionArgs struct {
	RpID           string                          `cbor:"1,keyasint"`
	ClientDataHash []byte                          `cbor:"2,keyasint"`
	AllowList      []PublicKeyCredentialDescriptor `cbor:"3,keyasint"`
	Options        CTAPCommandOptions              `cbor:"5,keyasint"`
}

type CTAPGetAssertionResponse

type CTAPGetAssertionResponse struct {
	//Credential          *PublicKeyCredentialDescriptor  `cbor:"1,keyasint,omitempty"`
	AuthenticatorData []byte `cbor:"2,keyasint"`
	Signature         []byte `cbor:"3,keyasint"`
}

type CTAPGetInfoOptions

type CTAPGetInfoOptions struct {
	IsPlatform     bool `cbor:"plat,omitempty"`
	CanResidentKey bool `cbor:"rk,omitempty"`
	//CanClientPin        bool `cbor:"clientPin,omitempty"`
	CanUserPresence     bool `cbor:"up,omitempty"`
	CanUserVerification bool `cbor:"uv,omitempty"`
}

type CTAPGetInfoResponse

type CTAPGetInfoResponse struct {
	Versions []string `cbor:"1,keyasint,omitempty"`
	//Extensions []string `cbor:"2,keyasint,omitempty"`
	AAGUID  [16]byte           `cbor:"3,keyasint,omitempty"`
	Options CTAPGetInfoOptions `cbor:"4,keyasint,omitempty"`
}

type CTAPHIDCapabilityFlag

type CTAPHIDCapabilityFlag uint8
const (
	CTAPHID_CAPABILITY_WINK CTAPHIDCapabilityFlag = 0x1
	CTAPHID_CAPABILITY_CBOR CTAPHIDCapabilityFlag = 0x4
	CTAPHID_CAPABILITY_NMSG CTAPHIDCapabilityFlag = 0x8
)

type CTAPHIDChannel

type CTAPHIDChannel struct {
	// contains filtered or unexported fields
}

func NewCTAPHIDChannel

func NewCTAPHIDChannel(channelId CTAPHIDChannelID) *CTAPHIDChannel

type CTAPHIDChannelID

type CTAPHIDChannelID uint32
const (
	CTAPHID_BROADCAST_CHANNEL CTAPHIDChannelID = 0xFFFFFFFF
)

type CTAPHIDCommand

type CTAPHIDCommand uint8
const (
	// Each CTAPHID command has its seventh bit set for easier reading
	CTAPHID_COMMAND_MSG       CTAPHIDCommand = 0x83
	CTAPHID_COMMAND_CBOR      CTAPHIDCommand = 0x90
	CTAPHID_COMMAND_INIT      CTAPHIDCommand = 0x86
	CTAPHID_COMMAND_PING      CTAPHIDCommand = 0x81
	CTAPHID_COMMAND_CANCEL    CTAPHIDCommand = 0x91
	CTAPHID_COMMAND_ERROR     CTAPHIDCommand = 0xBF
	CTAPHID_COMMAND_KEEPALIVE CTAPHIDCommand = 0xBB
	CTAPHID_COMMAND_WINK      CTAPHIDCommand = 0x88
	CTAPHID_COMMAND_LOCK      CTAPHIDCommand = 0x84
)

type CTAPHIDErrorCode

type CTAPHIDErrorCode uint8
const (
	CTAPHID_ERR_INVALID_COMMAND   CTAPHIDErrorCode = 0x01
	CTAPHID_ERR_INVALID_PARAMETER CTAPHIDErrorCode = 0x02
	CTAPHID_ERR_INVALID_LENGTH    CTAPHIDErrorCode = 0x03
	CTAPHID_ERR_INVALID_SEQUENCE  CTAPHIDErrorCode = 0x04
	CTAPHID_ERR_MESSAGE_TIMEOUT   CTAPHIDErrorCode = 0x05
	CTAPHID_ERR_CHANNEL_BUSY      CTAPHIDErrorCode = 0x06
	CTAPHID_ERR_LOCK_REQUIRED     CTAPHIDErrorCode = 0x0A
	CTAPHID_ERR_INVALID_CHANNEL   CTAPHIDErrorCode = 0x0B
	CTAPHID_ERR_OTHER             CTAPHIDErrorCode = 0x7F
)

type CTAPHIDInitReponse

type CTAPHIDInitReponse struct {
	Nonce              [8]byte
	NewChannelID       CTAPHIDChannelID
	ProtocolVersion    uint8
	DeviceVersionMajor uint8
	DeviceVersionMinor uint8
	DeviceVersionBuild uint8
	CapabilitiesFlags  uint8
}

type CTAPHIDMessageHeader

type CTAPHIDMessageHeader struct {
	ChannelID     CTAPHIDChannelID
	Command       CTAPHIDCommand
	PayloadLength uint16
}

func (CTAPHIDMessageHeader) String

func (header CTAPHIDMessageHeader) String() string

type CTAPHIDServer

type CTAPHIDServer struct {
	// contains filtered or unexported fields
}

type CTAPMakeCredentialArgs

type CTAPMakeCredentialArgs struct {
	ClientDataHash   []byte                          `cbor:"1,keyasint,omitempty"`
	Rp               PublicKeyCredentialRpEntity     `cbor:"2,keyasint,omitempty"`
	User             PublicKeyCrendentialUserEntity  `cbor:"3,keyasint,omitempty"`
	PubKeyCredParams []PublicKeyCredentialParams     `cbor:"4,keyasint,omitempty"`
	ExcludeList      []PublicKeyCredentialDescriptor `cbor:"5,keyasint,omitempty"`
	Options          *CTAPCommandOptions             `cbor:"7,keyasint,omitempty"`
}

func (CTAPMakeCredentialArgs) String

func (args CTAPMakeCredentialArgs) String() string

type CTAPMakeCredentialReponse

type CTAPMakeCredentialReponse struct {
	FormatIdentifer      string                      `cbor:"1,keyasint"`
	AuthData             []byte                      `cbor:"2,keyasint"`
	AttestationStatement map[interface{}]interface{} `cbor:"3,keyasint"`
}

type CTAPServer

type CTAPServer struct {
	// contains filtered or unexported fields
}

type CTAPStatusCode

type CTAPStatusCode byte
const (
	CTAP1_ERR_SUCCESS           CTAPStatusCode = 0x00
	CTAP1_ERR_INVALID_COMMAND   CTAPStatusCode = 0x01
	CTAP1_ERR_INVALID_PARAMETER CTAPStatusCode = 0x02
	CTAP1_ERR_INVALID_LENGTH    CTAPStatusCode = 0x03
	CTAP1_ERR_INVALID_SEQ       CTAPStatusCode = 0x04
	CTAP1_ERR_TIMEOUT           CTAPStatusCode = 0x05
	CTAP1_ERR_CHANNEL_BUSY      CTAPStatusCode = 0x06

	CTAP2_ERR_UNSUPPORTED_ALGORITHM CTAPStatusCode = 0x26
	CTAP2_ERR_INVALID_CBOR          CTAPStatusCode = 0x12
	CTAP2_ERR_NO_CREDENTIALS        CTAPStatusCode = 0x2E
	CTAP2_ERR_OPERATION_DENIED      CTAPStatusCode = 0x27
)

type Client

type Client interface {
	NewCredentialSource(relyingParty PublicKeyCredentialRpEntity, user PublicKeyCrendentialUserEntity) *CredentialSource
	GetAssertionSource(relyingPartyID string, allowList []PublicKeyCredentialDescriptor) *CredentialSource

	SealingEncryptionKey() []byte
	NewPrivateKey() *ecdsa.PrivateKey
	NewAuthenticationCounterId() uint32
	CreateAttestationCertificiate(privateKey *ecdsa.PrivateKey) []byte

	ApproveAccountCreation(relyingParty string) bool
	ApproveAccountLogin(credentialSource *CredentialSource) bool
	ApproveU2FRegistration(keyHandle *KeyHandle) bool
	ApproveU2FAuthentication(keyHandle *KeyHandle) bool

	Identities() []CredentialSource
	DeleteIdentity(id []byte) bool
}

type ClientAction

type ClientAction uint8
const (
	CLIENT_ACTION_U2F_REGISTER         ClientAction = 0
	CLIENT_ACTION_U2F_AUTHENTICATE     ClientAction = 1
	CLIENT_ACTION_FIDO_MAKE_CREDENTIAL ClientAction = 2
	CLIENT_ACTION_FIDO_GET_ASSERTION   ClientAction = 3
)

type ClientActionRequestParams

type ClientActionRequestParams struct {
	RelyingParty string
	UserName     string
}

type ClientDataSaver

type ClientDataSaver interface {
	SaveData(data []byte)
	RetrieveData() []byte
	Passphrase() string
}

type ClientImpl

type ClientImpl struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(
	attestationCertificate []byte,
	certificatePrivateKey *ecdsa.PrivateKey,
	secretEncryptionKey [32]byte,
	requestApprover ClientRequestApprover,
	dataSaver ClientDataSaver) *ClientImpl

func (ClientImpl) ApproveAccountCreation

func (client ClientImpl) ApproveAccountCreation(relyingParty string) bool

func (ClientImpl) ApproveAccountLogin

func (client ClientImpl) ApproveAccountLogin(credentialSource *CredentialSource) bool

func (ClientImpl) ApproveU2FAuthentication

func (client ClientImpl) ApproveU2FAuthentication(keyHandle *KeyHandle) bool

func (ClientImpl) ApproveU2FRegistration

func (client ClientImpl) ApproveU2FRegistration(keyHandle *KeyHandle) bool

func (*ClientImpl) CreateAttestationCertificiate

func (client *ClientImpl) CreateAttestationCertificiate(privateKey *ecdsa.PrivateKey) []byte

func (*ClientImpl) DeleteIdentity

func (client *ClientImpl) DeleteIdentity(id []byte) bool

func (*ClientImpl) GetAssertionSource

func (client *ClientImpl) GetAssertionSource(relyingPartyID string, allowList []PublicKeyCredentialDescriptor) *CredentialSource

func (*ClientImpl) Identities

func (client *ClientImpl) Identities() []CredentialSource

func (*ClientImpl) NewAuthenticationCounterId

func (client *ClientImpl) NewAuthenticationCounterId() uint32

func (*ClientImpl) NewCredentialSource

func (client *ClientImpl) NewCredentialSource(relyingParty PublicKeyCredentialRpEntity, user PublicKeyCrendentialUserEntity) *CredentialSource

func (*ClientImpl) NewPrivateKey

func (client *ClientImpl) NewPrivateKey() *ecdsa.PrivateKey

func (ClientImpl) SealingEncryptionKey

func (client ClientImpl) SealingEncryptionKey() []byte

type ClientRequestApprover

type ClientRequestApprover interface {
	ApproveClientAction(action ClientAction, params ClientActionRequestParams) bool
}

type CredentialSource

type CredentialSource struct {
	Type             string
	ID               []byte
	PrivateKey       *ecdsa.PrivateKey
	RelyingParty     PublicKeyCredentialRpEntity
	User             PublicKeyCrendentialUserEntity
	SignatureCounter int32
}

type DummyUSBDevice

type DummyUSBDevice struct{}

type EncryptedBox

type EncryptedBox struct {
	Data []byte `cbor:"1,keyasint"`
	IV   []byte `cbor:"2,keyasint"`
}

type IdentityVault

type IdentityVault struct {
	// contains filtered or unexported fields
}

type KeyHandle

type KeyHandle struct {
	PrivateKey    []byte `cbor:"1,keyasint"`
	ApplicationID []byte `cbor:"2,keyasint"`
}

type PassphraseEncryptedBlob

type PassphraseEncryptedBlob struct {
	Salt          []byte
	EncryptedKey  []byte
	KeyNonce      []byte
	EncryptedData []byte
	DataNonce     []byte
}

type PublicKeyCredentialDescriptor

type PublicKeyCredentialDescriptor struct {
	Type       string   `cbor:"type"`
	Id         []byte   `cbor:"id"`
	Transports []string `cbor:"transports,omitempty"`
}

type PublicKeyCredentialParams

type PublicKeyCredentialParams struct {
	Type      string          `cbor:"type"`
	Algorithm COSEAlgorithmID `cbor:"alg"`
}

type PublicKeyCredentialRpEntity

type PublicKeyCredentialRpEntity struct {
	Id   string `cbor:"id"`
	Name string `cbor:"name"`
}

func (PublicKeyCredentialRpEntity) String

func (rp PublicKeyCredentialRpEntity) String() string

type PublicKeyCrendentialUserEntity

type PublicKeyCrendentialUserEntity struct {
	Id          []byte `cbor:"id"`
	DisplayName string `cbor:"displayName"`
	Name        string `cbor:"name"`
}

func (PublicKeyCrendentialUserEntity) String

func (user PublicKeyCrendentialUserEntity) String() string

type SavedClientState

type SavedClientState struct {
	DeviceEncryptionKey   []byte
	CertificateAuthority  []byte
	CertPrivateKey        []byte
	AuthenticationCounter uint32
	CredentialSources     []byte
}

type SavedCredentialSource

type SavedCredentialSource struct {
	Type             string
	ID               []byte
	PrivateKey       []byte
	RelyingParty     PublicKeyCredentialRpEntity
	User             PublicKeyCrendentialUserEntity
	SignatureCounter int32
}

type U2FAuthenticateControl

type U2FAuthenticateControl uint8
const (
	U2F_AUTH_CONTROL_CHECK_ONLY                     U2FAuthenticateControl = 0x07
	U2F_AUTH_CONTROL_ENFORCE_USER_PRESENCE_AND_SIGN U2FAuthenticateControl = 0x03
	U2F_AUTH_CONTROL_SIGN                           U2FAuthenticateControl = 0x08
)

type U2FCommand

type U2FCommand uint8
const (
	U2F_COMMAND_REGISTER     U2FCommand = 0x01
	U2F_COMMAND_AUTHENTICATE U2FCommand = 0x02
	U2F_COMMAND_VERSION      U2FCommand = 0x03
)

type U2FMessageHeader

type U2FMessageHeader struct {
	Cla     uint8
	Command U2FCommand
	Param1  uint8
	Param2  uint8
}

func (U2FMessageHeader) String

func (header U2FMessageHeader) String() string

type U2FServer

type U2FServer struct {
	// contains filtered or unexported fields
}

type U2FStatusWord

type U2FStatusWord uint16
const (
	U2F_SW_NO_ERROR                 U2FStatusWord = 0x9000
	U2F_SW_CONDITIONS_NOT_SATISFIED U2FStatusWord = 0x6985
	U2F_SW_WRONG_DATA               U2FStatusWord = 0x6A80
	U2F_SW_WRONG_LENGTH             U2FStatusWord = 0x6700
	U2F_SW_CLA_NOT_SUPPORTED        U2FStatusWord = 0x6E00
	U2F_SW_INS_NOT_SUPPORTED        U2FStatusWord = 0x6D00
)

type USBConfigurationDescriptor

type USBConfigurationDescriptor struct {
	BLength             uint8
	BDescriptorType     USBDescriptorType
	WTotalLength        uint16
	BNumInterfaces      uint8
	BConfigurationValue uint8
	IConfiguration      uint8
	BmAttributes        uint8
	BMaxPower           uint8
}

type USBDescriptorType

type USBDescriptorType uint8
const (
	USB_DESCRIPTOR_DEVICE                    USBDescriptorType = 1
	USB_DESCRIPTOR_CONFIGURATION             USBDescriptorType = 2
	USB_DESCRIPTOR_STRING                    USBDescriptorType = 3
	USB_DESCRIPTOR_INTERFACE                 USBDescriptorType = 4
	USB_DESCRIPTOR_ENDPOINT                  USBDescriptorType = 5
	USB_DESCRIPTOR_DEVICE_QUALIFIER          USBDescriptorType = 6
	USB_DESCRIPTOR_OTHER_SPEED_CONFIGURATION USBDescriptorType = 7
	USB_DESCRIPTOR_INTERFACE_POWER           USBDescriptorType = 8
	USB_DESCRIPTOR_HID                       USBDescriptorType = 33
	USB_DESCRIPTOR_HID_REPORT                USBDescriptorType = 34
)

type USBDevice

type USBDevice interface {
	// contains filtered or unexported methods
}

type USBDeviceDescriptor

type USBDeviceDescriptor struct {
	BLength            uint8
	BDescriptorType    USBDescriptorType
	BcdUSB             uint16
	BDeviceClass       uint8
	BDeviceSubclass    uint8
	BDeviceProtocol    uint8
	BMaxPacketSize     uint8
	IdVendor           uint16
	IdProduct          uint16
	BcdDevice          uint16
	IManufacturer      uint8
	IProduct           uint8
	ISerialNumber      uint8
	BNumConfigurations uint8
}

type USBDeviceImpl

type USBDeviceImpl struct {
	Index         int
	CTAPHIDServer *CTAPHIDServer
	// contains filtered or unexported fields
}

type USBDirection

type USBDirection uint8
const (
	USB_HOST_TO_DEVICE USBDirection = 0
	USB_DEVICE_TO_HOST USBDirection = 1
)

type USBEndpointDescriptor

type USBEndpointDescriptor struct {
	BLength          uint8
	BDescriptorType  USBDescriptorType
	BEndpointAddress uint8
	BmAttributes     uint8
	WMaxPacketSize   uint16
	BInterval        uint8
}

type USBHIDDescriptor

type USBHIDDescriptor struct {
	BLength                 uint8
	BDescriptorType         USBDescriptorType
	BcdHID                  uint16
	BCountryCode            uint8
	BNumDescriptors         uint8
	BClassDescriptorType    USBDescriptorType
	WReportDescriptorLength uint16
}

type USBHIDRequestType

type USBHIDRequestType uint8
const (
	USB_HID_REQUEST_GET_REPORT     USBHIDRequestType = 1
	USB_HID_REQUEST_GET_IDLE       USBHIDRequestType = 2
	USB_HID_REQUEST_GET_PROTOCOL   USBHIDRequestType = 3
	USB_HID_REQUEST_GET_DESCRIPTOR USBHIDRequestType = 6
	USB_HID_REQUEST_SET_DESCRIPTOR USBHIDRequestType = 7
	USB_HID_REQUEST_SET_REPORT     USBHIDRequestType = 9
	USB_HID_REQUEST_SET_IDLE       USBHIDRequestType = 10
	USB_HID_REQUEST_SET_PROTOCOL   USBHIDRequestType = 11
)

type USBIPCommandSubmitBody

type USBIPCommandSubmitBody struct {
	TransferFlags        uint32
	TransferBufferLength uint32
	StartFrame           uint32
	NumberOfPackets      uint32
	Interval             uint32
	SetupBytes           [8]byte
}

func (USBIPCommandSubmitBody) Setup

func (USBIPCommandSubmitBody) String

func (body USBIPCommandSubmitBody) String() string

type USBIPCommandUnlinkBody

type USBIPCommandUnlinkBody struct {
	UnlinkSequenceNumber uint32
	Padding              [24]byte
}

type USBIPControlCommand

type USBIPControlCommand uint16
const (
	USBIP_COMMAND_OP_REQ_DEVLIST USBIPControlCommand = 0x8005
	USBIP_COMMAND_OP_REP_DEVLIST USBIPControlCommand = 0x0005
	USBIP_COMMAND_OP_REQ_IMPORT  USBIPControlCommand = 0x8003
	USBIP_COMMAND_OP_REP_IMPORT  USBIPControlCommand = 0x0003
)

type USBIPControlHeader

type USBIPControlHeader struct {
	Version     uint16
	CommandCode USBIPControlCommand
	Status      uint32
}

func (*USBIPControlHeader) String

func (header *USBIPControlHeader) String() string

type USBIPDeviceInterface

type USBIPDeviceInterface struct {
	BInterfaceClass    uint8
	BInterfaceSubclass uint8
	Padding            uint8
}

type USBIPDeviceSummary

type USBIPDeviceSummary struct {
	Header          USBIPDeviceSummaryHeader
	DeviceInterface USBIPDeviceInterface // We only support one interface to use binary.Write/Read
}

func (USBIPDeviceSummary) String

func (summary USBIPDeviceSummary) String() string

type USBIPDeviceSummaryHeader

type USBIPDeviceSummaryHeader struct {
	Path                [256]byte
	BusId               [32]byte
	Busnum              uint32
	Devnum              uint32
	Speed               uint32
	IdVendor            uint16
	IdProduct           uint16
	BcdDevice           uint16
	BDeviceClass        uint8
	BDeviceSubclass     uint8
	BDeviceProtocol     uint8
	BConfigurationValue uint8
	BNumConfigurations  uint8
	BNumInterfaces      uint8
}

func (USBIPDeviceSummaryHeader) String

func (header USBIPDeviceSummaryHeader) String() string

type USBIPMessageHeader

type USBIPMessageHeader struct {
	Command        uint32
	SequenceNumber uint32
	DeviceId       uint32
	Direction      uint32
	Endpoint       uint32
}

func (USBIPMessageHeader) CommandName

func (header USBIPMessageHeader) CommandName() string

func (USBIPMessageHeader) DirectionName

func (header USBIPMessageHeader) DirectionName() string

func (USBIPMessageHeader) String

func (header USBIPMessageHeader) String() string

type USBIPOpRepDevlist

type USBIPOpRepDevlist struct {
	Header     USBIPControlHeader
	NumDevices uint32
	Devices    []USBIPDeviceSummary
}

type USBIPOpRepImport

type USBIPOpRepImport struct {
	// contains filtered or unexported fields
}

func (USBIPOpRepImport) String

func (reply USBIPOpRepImport) String() string

type USBIPReturnSubmitBody

type USBIPReturnSubmitBody struct {
	Status          uint32
	ActualLength    uint32
	StartFrame      uint32
	NumberOfPackets uint32
	ErrorCount      uint32
	Padding         uint64
}

type USBIPReturnUnlinkBody

type USBIPReturnUnlinkBody struct {
	Status  int32
	Padding [24]byte
}

type USBIPServer

type USBIPServer struct {
	// contains filtered or unexported fields
}

type USBISOPacketDescriptor

type USBISOPacketDescriptor struct {
	Offset       uint32
	Length       uint32
	ActualLength uint32
	Status       uint32
}

type USBInterfaceDescriptor

type USBInterfaceDescriptor struct {
	BLength            uint8
	BDescriptorType    USBDescriptorType
	BInterfaceNumber   uint8
	BAlternateSetting  uint8
	BNumEndpoints      uint8
	BInterfaceClass    uint8
	BInterfaceSubclass uint8
	BInterfaceProtocol uint8
	IInterface         uint8
}

type USBRequestClass

type USBRequestClass uint8
const (
	USB_REQUEST_CLASS_STANDARD USBRequestClass = 0
	USB_REQUEST_CLASS_CLASS    USBRequestClass = 1
	USB_REQUEST_CLASS_VENDOR   USBRequestClass = 2
	USB_REQUEST_CLASS_RESERVED USBRequestClass = 3
)

type USBRequestRecipient

type USBRequestRecipient uint8
const (
	USB_REQUEST_RECIPIENT_DEVICE    USBRequestRecipient = 0
	USB_REQUEST_RECIPIENT_INTERFACE USBRequestRecipient = 1
	USB_REQUEST_RECIPIENT_ENDPOINT  USBRequestRecipient = 2
	USB_REQUEST_RECIPIENT_OTHER     USBRequestRecipient = 3
)

type USBRequestType

type USBRequestType uint8
const (
	USB_REQUEST_GET_STATUS        USBRequestType = 0
	USB_REQUEST_CLEAR_FEATURE     USBRequestType = 1
	USB_REQUEST_SET_FEATURE       USBRequestType = 3
	USB_REQUEST_SET_ADDRESS       USBRequestType = 5
	USB_REQUEST_GET_DESCRIPTOR    USBRequestType = 6
	USB_REQUEST_SET_DESCRIPTOR    USBRequestType = 7
	USB_REQUEST_GET_CONFIGURATION USBRequestType = 8
	USB_REQUEST_SET_CONFIGURATION USBRequestType = 9
	USB_REQUEST_GET_INTERFACE     USBRequestType = 10
	USB_REQUEST_SET_INTERFACE     USBRequestType = 11
	USB_REQUEST_SYNCH_FRAME       USBRequestType = 12
)

type USBSetupPacket

type USBSetupPacket struct {
	BmRequestType uint8
	BRequest      USBRequestType
	WValue        uint16
	WIndex        uint16
	WLength       uint16
}

func (USBSetupPacket) String

func (setup USBSetupPacket) String() string

type USBStringDescriptorHeader

type USBStringDescriptorHeader struct {
	BLength         uint8
	BDescriptorType USBDescriptorType
}

Jump to

Keyboard shortcuts

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