nfsv2

package
v0.0.0-...-b3f7bda Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCall

type CreateCall struct {
	DirOpArgs
	Attr Sattr
}

func (*CreateCall) String

func (self *CreateCall) String() string

type CreateReply

type CreateReply struct {
	Nfs2Status
	DirOpRes
}

func (*CreateReply) String

func (self *CreateReply) String() string

type DirOpArgs

type DirOpArgs struct {
	FileHandle []byte `xdr:"limit=32"`
	FileName   []byte
}

func (DirOpArgs) FileNameStr

func (self DirOpArgs) FileNameStr() string

func (DirOpArgs) String

func (self DirOpArgs) String() string

type DirOpRes

type DirOpRes struct {
	FileHandle []byte `xdr:"limit=32"`
	Attr       Fattr
}

type Entry

type Entry struct {
	Field    uint32
	Filename []byte
	Cookie   uint32
}

type Entry2

type Entry2 struct {
	IsSet bool  `xdr:"union"`
	Entry Entry `xdr:"unioncase=1"`
}

type Fattr

type Fattr struct {
	Type                Nfs2Ftype //文件类型
	Mode                uint32    //mode
	NLink               uint32    //文件的硬链接数
	UID                 uint32    //文件的所有者的用户标识号码
	GID                 uint32    //文件的组的组标识号码
	Size                uint32    //以字节数计算的大小
	BlockSize           uint32
	Rdev                uint32
	Blocks              uint32
	FsId                uint32
	FileId              uint32
	Atime, Mtime, Ctime TimeVal
}

func (Fattr) String

func (self Fattr) String() string

type GetAttrCall

type GetAttrCall struct {
	FileHandle []byte `xdr:"limit=32"`
}

func (*GetAttrCall) String

func (self *GetAttrCall) String() string

type GetAttrReply

type GetAttrReply struct {
	Nfs2Status
	Fattr
}

func (*GetAttrReply) String

func (self *GetAttrReply) String() string

type LinkCall

type LinkCall struct {
	FileHandle []byte `xdr:"limit=32"` //from
	To         DirOpArgs
}

func (*LinkCall) String

func (self *LinkCall) String() string

type LinkReply

type LinkReply struct {
	Nfs2Status
}

func (*LinkReply) String

func (self *LinkReply) String() string

type LookUpCall

type LookUpCall struct {
	DirOpArgs
}

func (*LookUpCall) String

func (self *LookUpCall) String() string

type LookUpReply

type LookUpReply struct {
	Nfs2Status
	DirOpRes
}

func (*LookUpReply) String

func (self *LookUpReply) String() string

type MkdirCall

type MkdirCall struct {
	DirOpArgs
	Attr Sattr
}

func (*MkdirCall) String

func (self *MkdirCall) String() string

type MkdirReply

type MkdirReply struct {
	Nfs2Status
	DirOpRes
}

func (*MkdirReply) String

func (self *MkdirReply) String() string

type Nfs2Ftype

type Nfs2Ftype uint32
const (
	Nfs2FtypeNFNON Nfs2Ftype = iota
	Nfs2FtypeNFREG
	Nfs2FtypeNFDIR
	Nfs2FtypeNFBLK
	Nfs2FtypeNFCHR
	Nfs2FtypeNFLNK
)

func (Nfs2Ftype) String

func (f Nfs2Ftype) String() string

type Nfs2Status

type Nfs2Status uint32
const (
	NFS2StatusOK Nfs2Status = iota
	NFS2StatusPerm
	NFS2StatusNoEnt
	NFS2StatusIO
	NFS2StatusNXIO
	NFS2StatusAccess
	NFS2StatusExist
	NFS2StatusNoDev
	NFS2StatusNotDir
	NFS2StatusIsDir
	NFS2StatusFBig
	NFS2StatusNoSPC
	NFS2StatusROFS
	NFS2StatusTooLong
	NFS2StatusNotEmpty
	NFS2StatusDQuot
	NFS2StatusStale
	NFS2StatusWFlush
)

func (Nfs2Status) String

func (s Nfs2Status) String() string

type Procedure

type Procedure uint32

Procedure is the valid RPC calls for the nfs service.

const (
	NFS2ProcedureNull Procedure = iota
	NFS2ProcedureGetAttr
	NFS2ProcedureSetAttr
	NFS2ProcedureRoot // 无用
	NFS2ProcedureLookUp
	NFS2ProcedureReadlink
	NFS2ProcedureRead
	NFS2ProcedureWriteCache // 无用
	NFS2ProcedureWrite
	NFS2ProcedureCreate
	NFS2ProcedureRemove
	NFS2ProcedureRename
	NFS2ProcedureLink
	NFS2ProcedureSymlink
	NFS2ProcedureMkDir
	NFS2ProcedureRmDir
	NFS2ProcedureReadDir
	NFS2ProcedureStatFs
)

NfsProcedure Codes

func (Procedure) String

func (n Procedure) String() string

type ReadCall

type ReadCall struct {
	FileHandle []byte `xdr:"limit=32"`
	Offset     uint32
	Count      uint32
	TotalCount uint32 //没有使用
}

func (*ReadCall) String

func (self *ReadCall) String() string

type ReadDirCall

type ReadDirCall struct {
	FileHandle []byte `xdr:"limit=32"`
	Cookie     uint32
	Count      uint32
}

func (*ReadDirCall) String

func (self *ReadDirCall) String() string

type ReadDirReply

type ReadDirReply struct {
	Nfs2Status
	Entries []*Entry
}

func (*ReadDirReply) String

func (self *ReadDirReply) String() string

type ReadLinkCall

type ReadLinkCall struct {
	FileHandle []byte `xdr:"limit=32"`
}

func (*ReadLinkCall) String

func (self *ReadLinkCall) String() string

type ReadLinkReply

type ReadLinkReply struct {
	Nfs2Status
	FilePath string
}

func (*ReadLinkReply) String

func (self *ReadLinkReply) String() string

type ReadReply

type ReadReply struct {
	Nfs2Status
	Attr Fattr
	Data []byte
}

func (*ReadReply) String

func (self *ReadReply) String() string

type RemoveCall

type RemoveCall struct {
	DirOpArgs
}

func (*RemoveCall) String

func (self *RemoveCall) String() string

type RemoveReply

type RemoveReply struct {
	Nfs2Status
}

func (*RemoveReply) String

func (self *RemoveReply) String() string

type RenameCall

type RenameCall struct {
	From DirOpArgs
	To   DirOpArgs
}

func (*RenameCall) String

func (self *RenameCall) String() string

type RenameReply

type RenameReply struct {
	Nfs2Status
}

func (*RenameReply) String

func (self *RenameReply) String() string

type RmdirCall

type RmdirCall struct {
	DirOpArgs
}

func (*RmdirCall) String

func (self *RmdirCall) String() string

type RmdirReply

type RmdirReply struct {
	Nfs2Status
}

func (*RmdirReply) String

func (self *RmdirReply) String() string

type Sattr

type Sattr struct {
	Mode         uint32 //mode
	UID          uint32 //文件的所有者的用户标识号码
	GID          uint32 //文件的组的组标识号码
	Size         uint32 //以字节数计算的大小
	Atime, Mtime TimeVal
}

func (Sattr) String

func (self Sattr) String() string

type SetAttrCall

type SetAttrCall struct {
	FileHandle []byte `xdr:"limit=32"`
	Attr       Sattr
}

func (*SetAttrCall) String

func (self *SetAttrCall) String() string

type SetAttrReply

type SetAttrReply struct {
	Nfs2Status
	Fattr
}

func (*SetAttrReply) String

func (self *SetAttrReply) String() string

type StatFsCall

type StatFsCall struct {
	FileHandle []byte `xdr:"limit=32"`
}

func (*StatFsCall) String

func (self *StatFsCall) String() string

type StatFsReply

type StatFsReply struct {
	Nfs2Status
	TSize  uint32 //用字节表示的最优化的传输尺寸。这是服务器在READ 和 WRITE请求中的 最想要的数据字节数。
	BSize  uint32 //文件系统用字节表示的块尺寸。.
	Blocks uint32 //文件系统中 "bsize"块的总数。
	BFree  uint32 //文件系统中自由的“bsize”块的数目。
	BAvail uint32 //无特权用户可用的"bsize"块的数目。
}

func (*StatFsReply) String

func (self *StatFsReply) String() string

type SymlinkCall

type SymlinkCall struct {
	From DirOpArgs
	To   string
	Attr Sattr
}

func (*SymlinkCall) String

func (self *SymlinkCall) String() string

type SymlinkReply

type SymlinkReply struct {
	Nfs2Status
}

func (*SymlinkReply) String

func (self *SymlinkReply) String() string

type TimeVal

type TimeVal struct {
	Second   uint32 // 秒
	USeconds uint32 // 微妙
}

type WriteCall

type WriteCall struct {
	FileHandle  []byte `xdr:"limit=32"`
	BeginOffset uint32
	Offset      uint32
	TotalCount  uint32
	Data        []byte
}

func (*WriteCall) String

func (self *WriteCall) String() string

type WriteReply

type WriteReply struct {
	Nfs2Status
	Attr Fattr
}

func (*WriteReply) String

func (self *WriteReply) String() string

Jump to

Keyboard shortcuts

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