proto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Tversion = 100
	Rversion = 101
	Tauth    = 102
	Rauth    = 103
	Tattach  = 104
	Rattach  = 105
	Terror   = 106 /* illegal */
	Rerror   = 107
	Tflush   = 108
	Rflush   = 109
	Twalk    = 110
	Rwalk    = 111
	Topen    = 112
	Ropen    = 113
	Tcreate  = 114
	Rcreate  = 115
	Tread    = 116
	Rread    = 117
	Twrite   = 118
	Rwrite   = 119
	Tclunk   = 120
	Rclunk   = 121
	Tremove  = 122
	Rremove  = 123
	Tstat    = 124
	Rstat    = 125
	Twstat   = 126
	Rwstat   = 127
)

These constants represent the message types and belong in the type field of the Header that is a part of every FCall.

View Source
const (
	Oread   = 0
	Owrite  = 1
	Ordwr   = 2
	Oexec   = 3
	None    = 4
	Otrunc  = 0x10
	Orclose = 0x40
)

Open mode file constants

View Source
const (
	DMDIR    = uint32(1 << 31)
	DMAPPEND = uint32(1 << 30)
	DMEXCL   = uint32(1 << 29)
	DMTMP    = uint32(1 << 26)
)
View Source
const (
	IOUnit = 8168
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FCall

type FCall interface {
	String() string
	Compose() []byte
	// contains filtered or unexported methods
}

FCall - the interface that all FCall types imlement. String - typical human readable string representation. Compose - returns a slice containing the call serialized according the the 9P2000 protocol, ready to be written.

func ParseCall

func ParseCall(r io.Reader) (FCall, error)

ParseCall - Reads from a 9P2000 stream and parses an FCall from it. On error, the protocol on the stream is in an unknown state and the stream should be closed.

type Header struct {
	Type uint8
	Tag  uint16
}

Header - every 9p message begins with this header.

func (*Header) String

func (fc *Header) String() string

type Mode

type Mode uint8

type ParseError

type ParseError struct {
	Err string
}

func (*ParseError) Error

func (pe *ParseError) Error() string

type Qid

type Qid struct {
	Qtype uint8
	Vers  uint32
	Uid   uint64
}

Qid - Qids are unique ids for files. Qtype should be the upper 8 bits of the file's permissions (Stat.Mode)

func (*Qid) Compose

func (qid *Qid) Compose() []byte

Compose - Returns a slice of the Qid serialized to be written out on a 9P2000 stream.

func (*Qid) String

func (qid *Qid) String() string

type RAttach

type RAttach struct {
	Header
	Qid Qid
}

func (*RAttach) Compose

func (attach *RAttach) Compose() []byte

func (*RAttach) String

func (attach *RAttach) String() string

type RAuth

type RAuth struct {
	Header
	Aqid Qid
}

func (*RAuth) Compose

func (auth *RAuth) Compose() []byte

func (*RAuth) String

func (auth *RAuth) String() string

type RClunk

type RClunk struct {
	Header
}

func (*RClunk) Compose

func (clunk *RClunk) Compose() []byte

func (*RClunk) String

func (clunk *RClunk) String() string

type RCreate

type RCreate struct {
	Header
	Qid    Qid
	Iounit uint32
}

func (*RCreate) Compose

func (create *RCreate) Compose() []byte

func (*RCreate) String

func (create *RCreate) String() string

type RError

type RError struct {
	Header
	Ename string
}

func (*RError) Compose

func (error *RError) Compose() []byte

func (*RError) String

func (error *RError) String() string

type RFlush

type RFlush struct {
	Header
}

func (*RFlush) Compose

func (flush *RFlush) Compose() []byte

func (*RFlush) String

func (flush *RFlush) String() string

type ROpen

type ROpen struct {
	Header
	Qid    Qid
	Iounit uint32
}

func (*ROpen) Compose

func (open *ROpen) Compose() []byte

func (*ROpen) String

func (open *ROpen) String() string

type RRead

type RRead struct {
	Header
	Count uint32
	Data  []byte
}

func (*RRead) Compose

func (read *RRead) Compose() []byte

func (*RRead) String

func (read *RRead) String() string

type RRemove

type RRemove struct {
	Header
}

func (*RRemove) Compose

func (remove *RRemove) Compose() []byte

func (*RRemove) String

func (remove *RRemove) String() string

type RStat

type RStat struct {
	Header
	Stat
}

func (*RStat) Compose

func (stat *RStat) Compose() []byte

func (*RStat) String

func (stat *RStat) String() string

type RWalk

type RWalk struct {
	Header
	Nwqid uint16
	Wqid  []Qid
}

func (*RWalk) Compose

func (walk *RWalk) Compose() []byte

func (*RWalk) String

func (walk *RWalk) String() string

type RWrite

type RWrite struct {
	Header
	Count uint32
}

func (*RWrite) Compose

func (write *RWrite) Compose() []byte

func (*RWrite) String

func (write *RWrite) String() string

type RWstat

type RWstat struct {
	Header
}

func (*RWstat) Compose

func (wstat *RWstat) Compose() []byte

func (*RWstat) String

func (wstat *RWstat) String() string

type Stat

type Stat struct {
	Type   uint16
	Dev    uint32
	Qid    Qid
	Mode   uint32
	Atime  uint32
	Mtime  uint32
	Length uint64
	Name   string
	Uid    string
	Gid    string
	Muid   string
}

func (*Stat) Compose

func (stat *Stat) Compose() []byte

func (*Stat) ComposeLength

func (stat *Stat) ComposeLength() uint16

func (*Stat) String

func (stat *Stat) String() string

type TAttach

type TAttach struct {
	Header
	Fid   uint32
	Afid  uint32
	Uname string
	Aname string
}

func (*TAttach) Compose

func (attach *TAttach) Compose() []byte

func (*TAttach) String

func (attach *TAttach) String() string

type TAuth

type TAuth struct {
	Header
	Afid  uint32
	Uname string
	Aname string
}

func (*TAuth) Compose

func (auth *TAuth) Compose() []byte

func (*TAuth) String

func (auth *TAuth) String() string

type TClunk

type TClunk struct {
	Header
	Fid uint32
}

func (*TClunk) Compose

func (clunk *TClunk) Compose() []byte

func (*TClunk) String

func (clunk *TClunk) String() string

type TCreate

type TCreate struct {
	Header
	Fid  uint32
	Name string
	Perm uint32
	Mode uint8
}

func (*TCreate) Compose

func (create *TCreate) Compose() []byte

func (*TCreate) String

func (create *TCreate) String() string

type TFlush

type TFlush struct {
	Header
	Oldtag uint16
}

func (*TFlush) Compose

func (flush *TFlush) Compose() []byte

func (*TFlush) String

func (flush *TFlush) String() string

type TOpen

type TOpen struct {
	Header
	Fid uint32
	Mode
}

func (*TOpen) Compose

func (open *TOpen) Compose() []byte

func (*TOpen) String

func (open *TOpen) String() string

type TRVersion

type TRVersion struct {
	Header
	Msize   uint32
	Version string
}

func (*TRVersion) Compose

func (version *TRVersion) Compose() []byte

func (*TRVersion) String

func (version *TRVersion) String() string

type TRead

type TRead struct {
	Header
	Fid    uint32
	Offset uint64
	Count  uint32
}

func (*TRead) Compose

func (read *TRead) Compose() []byte

func (*TRead) String

func (read *TRead) String() string

type TRemove

type TRemove struct {
	Header
	Fid uint32
}

func (*TRemove) Compose

func (remove *TRemove) Compose() []byte

func (*TRemove) String

func (remove *TRemove) String() string

type TStat

type TStat struct {
	Header
	Fid uint32
}

func (*TStat) Compose

func (stat *TStat) Compose() []byte

func (*TStat) String

func (stat *TStat) String() string

type TWalk

type TWalk struct {
	Header
	Fid    uint32
	Newfid uint32
	Nwname uint16
	Wname  []string
}

func (*TWalk) Compose

func (walk *TWalk) Compose() []byte

func (*TWalk) String

func (walk *TWalk) String() string

type TWrite

type TWrite struct {
	Header
	Fid    uint32
	Offset uint64
	Count  uint32
	Data   []byte
}

func (*TWrite) Compose

func (write *TWrite) Compose() []byte

func (*TWrite) String

func (write *TWrite) String() string

type TWstat

type TWstat struct {
	Header
	Fid  uint32
	Stat Stat
}

func (*TWstat) Compose

func (wstat *TWstat) Compose() []byte

func (*TWstat) String

func (wstat *TWstat) String() string

Jump to

Keyboard shortcuts

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