nbd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2014 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NBD_REQUEST_MAGIC = 0x25609513
	NBD_REPLY_MAGIC   = 0x67446698
)
View Source
const (
	NBD_CMD_READ  = 0
	NBD_CMD_WRITE = 1
	NBD_CMD_DISC  = 2
	NBD_CMD_FLUSH = 3
	NBD_CMD_TRIM  = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NbdReply

type NbdReply struct {
	Magic  uint32
	Error  uint32
	Handle uint64
}

type NbdRequest

type NbdRequest struct {
	Magic  uint32
	Type   uint32
	Handle uint64
	From   uint64
	Len    uint32
}

func (*NbdRequest) ToWireFormat

func (msg *NbdRequest) ToWireFormat() []byte

type NbdSession

type NbdSession struct {
	Conn   net.Conn
	Handle uint64
}

func (*NbdSession) Disconnect

func (session *NbdSession) Disconnect() error

func (*NbdSession) Flush

func (session *NbdSession) Flush() error

func (*NbdSession) Handshake

func (session *NbdSession) Handshake() error

func (*NbdSession) Recv

func (session *NbdSession) Recv() error

func (*NbdSession) Write

func (session *NbdSession) Write(from uint64, data []byte) error

Jump to

Keyboard shortcuts

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