~/bend-docscommunity

src/fs/p9wire.bend checks

raw source on the hub · import 0xcc60967bebc4a874a86f388a1bbb7c9c/src/fs/p9wire.bend as P9wire

3 imports
import Base
import ../lib/u64.bend as U
import ../lib/bytes.bend as B

Types

type Qid source · line 42 · raw

Data

type P9Req source · line 45 · raw

Data

type P9Stat source · line 72 · raw

Data

Rgetattr carries the full stat; the fields not listed (rdev, the nsec parts, btime, gen, data_version) are written as zero, valid as 2047 (P9_GETATTR_BASIC), blksize as 4096.

type P9Dirent source · line 77 · raw

Data

A directory entry in an Rreaddir: qid, the offset of the next entry, the type (DT_* value), the name.

type P9Resp source · line 80 · raw

Data

type P9Msg source · line 105 · raw

Data

A request: its tag and the decoded message. None when the bytes are not a whole message (short, size field disagreeing, or fields running past it). Rstatfs writes type 0x01021997 (V9FS_MAGIC), fsid 0 and namelen 255.

type P9Got source · line 140 · raw

Data

A decoded request and the offset where its fields end.

type P9Names source · line 144 · raw

Data

The names of a Twalk and the offset where they end.

type P9Out source · line 332 · raw

Data

A response's type and the bytes after its tag.

Definitions

def P9.le source · line 115 · raw

@n:Nat -> @b:List<&2, U32> -> @off:Nat -> U32

The little-endian field of n bytes (n <= 4) at off.

def P9.u16 source · line 118 · raw

@b:List<&2, U32> -> @off:Nat -> U32

def P9.u32 source · line 121 · raw

@b:List<&2, U32> -> @off:Nat -> U32

def P9.u64 source · line 124 · raw

@b:List<&2, U32> -> @off:Nat -> 0xcc60967bebc4a874a86f388a1bbb7c9c/src/lib/u64.U64

def P9.slen source · line 128 · raw

@b:List<&2, U32> -> @off:Nat -> Nat

The length of the string at off.

def P9.str source · line 132 · raw

@+b:List<&2, U32> -> @+off:Nat -> List<&2, U32>

The bytes of the string at off.

def P9.after source · line 136 · raw

@+b:List<&2, U32> -> @+off:Nat -> Nat

The offset just past the string at off.

def P9.names.cons source · line 147 · raw

@name:List<&2, U32> -> @rest:P9Names -> P9Names

def P9.names source · line 153 · raw

@n:Nat -> @+b:List<&2, U32> -> @+off:Nat -> P9Names

n strings from off on.

def P9.walk.got source · line 160 · raw

@fid:U32 -> @newfid:U32 -> @ns:P9Names -> P9Got

def P9.walk source · line 167 · raw

@ok:Bool -> @+b:List<&2, U32> -> @+n:Nat -> P9Got

A Twalk names at most 16 elements (MAXWELEM); more is refused by an end past any body.

def P9.fields source · line 175 · raw

@k:U32 -> @+b:List<&2, U32> -> P9Got

The fields of a message of type k, read from its body b.

def P9.when source · line 231 · raw

@ok:Bool -> @m:P9Msg -> Maybe<&2, P9Msg>

def P9.check source · line 239 · raw

@tag:U32 -> @+len:Nat -> @g:P9Got -> Maybe<&2, P9Msg>

Some message when its fields end inside the body.

def P9.decode source · line 244 · raw

@ok:Bool -> @+bs:List<&2, U32> -> @+len:Nat -> Maybe<&2, P9Msg>

def P9.parse source · line 252 · raw

@bs:List<&2, U32> -> Maybe<&2, P9Msg>

def P9.cat source · line 260 · raw

@a:List<&2, U32> -> @b:List<&2, U32> -> List<&2, U32>

def P9.byte source · line 263 · raw

@x:U32 -> List<&2, U32>

def P9.bstr source · line 267 · raw

@+s:List<&2, U32> -> List<&2, U32>

A string: len[2] then its bytes.

def P9.bqid source · line 270 · raw

@q:Qid -> List<&2, U32>

def P9.bqids source · line 275 · raw

@qs:List<&2, Qid> -> List<&2, U32>

def P9.bdirent source · line 282 · raw

@d:P9Dirent -> List<&2, U32>

def P9.bdirents.seq source · line 287 · raw

@ds:List<&2, P9Dirent> -> List<&2, U32>

def P9.leaf source · line 295 · raw

Nat

Lists up to this many entries are encoded sequentially.

def P9.small source · line 298 · raw

@+n:Nat -> Bool

def P9.bdirents source · line 303 · raw

@d:Nat -> @small:Bool -> @+n:Nat -> @+ds:List<&2, P9Dirent> -> List<&2, U32>

The entries of an Rreaddir (n of them), encoded as two halves in parallel when the list is long; d bounds the depth.

def P9.zero64 source · line 319 · raw

List<&2, U32>

def P9.bstat source · line 322 · raw

@st:P9Stat -> List<&2, U32>

def P9.out source · line 335 · raw

@r:P9Resp -> P9Out

def P9.frame source · line 386 · raw

@tag:U32 -> @o:P9Out -> List<&2, U32>

def P9.build source · line 392 · raw

@tag:U32 -> @r:P9Resp -> List<&2, U32>