Documentation ¶
Overview ¶
Package proto implements the 9p2000 protocol messages and the code required to marshal the messages.
All the messages implement the FCall interface. Messages can be read from an io.Reader with the ParseCall function.
The details of the protocol aren't documented in this package. Instead, see the protocol RFC here: http://knusbaum.com/useful/rfc9p2000
The RFC contains in-depth descriptions of the messages and what they mean.
Index ¶
- Constants
- type FCall
- type Header
- type Mode
- type ParseError
- type Qid
- type RAttach
- type RAuth
- type RClunk
- type RCreate
- type RError
- type RFlush
- type ROpen
- type RRead
- type RRemove
- type RStat
- type RWalk
- type RWrite
- type RWstat
- type Stat
- type TAttach
- type TAuth
- type TClunk
- type TCreate
- type TFlush
- type TOpen
- type TRVersion
- type TRead
- type TRemove
- type TStat
- type TWalk
- type TWrite
- type TWstat
Constants ¶
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.
const ( DMDIR = uint32(1 << 31) DMAPPEND = uint32(1 << 30) DMEXCL = uint32(1 << 29) DMTMP = uint32(1 << 26) )
const (
IOUnit = 16384
)
const (
MaxMsgLen = 65535 // 65k should be enough for anyone.
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FCall ¶
type FCall interface { GetTag() uint16 String() string Compose() []byte // contains filtered or unexported methods }
FCall - the interface that all FCall types imlement. The String function returns a human readable string representation of the message. The Compose function returns a slice containing the 9p message marshaled according the the 9P2000 protocol, ready to be written to a stream.
type ParseError ¶
type ParseError struct {
Err string
}
func (*ParseError) Error ¶
func (pe *ParseError) Error() string
type Qid ¶
Qid - Qids are unique ids for files. Qtype should be the upper 8 bits of the file's permissions (Stat.Mode)
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 }