oncrpc

package
v0.0.0-...-1ea2c94 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2018 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const RPCProtocolVersion = 2

Variables

This section is empty.

Functions

func NewClientCodec

func NewClientCodec(conn io.ReadWriteCloser, table []ProcEntry) rpc.ClientCodec

func NewServerCodec

func NewServerCodec(conn io.ReadWriteCloser, table []ProcEntry) rpc.ServerCodec

func ReadFullRecord

func ReadFullRecord(conn io.Reader) ([]byte, error)

func WriteFullRecord

func WriteFullRecord(conn io.Writer, data []byte) (int64, error)

Types

type AcceptStat

type AcceptStat int32
const (
	Success      AcceptStat = iota // RPC executed successfully
	ProgUnavail                    // Remote hasn't exported the program
	ProgMismatch                   // Remote can't support version number
	ProcUnavail                    // Program can't support procedure
	GarbageArgs                    // Procedure can't decode params
	SystemErr                      // Other errors
)

type AcceptedReply

type AcceptedReply struct {
	Verf          OpaqueAuth
	Stat          AcceptStat    `xdr:"union"`
	MismatchInfoP MismatchReply `xdr:"unioncase=1"` // ProgUnavail
	MismatchInfoV MismatchReply `xdr:"unioncase=2"` // ProgMismatch
}

type AuthFlavor

type AuthFlavor int32
const (
	AuthNone AuthFlavor = iota // No authentication
	AuthSys                    // Unix style
	AuthShort
	AuthDh
	AuthKerb
	AuthRSA
	RPCsecGss
)

type AuthStat

type AuthStat int32
const (
	AuthOk AuthStat = iota
	AuthBadcred
	AuthRejectedcred
	AuthBadverf
	AuthRejectedVerf
	AuthTooweak
	AuthInvalidresp
	AuthFailed
)

type CallBody

type CallBody struct {
	RPCVersion uint32 // must be equal to 2
	Program    uint32
	Version    uint32
	Procedure  uint32
	Cred       OpaqueAuth
	Verf       OpaqueAuth
}

type ErrProgMismatch

type ErrProgMismatch struct {
	Low  uint32
	High uint32
}

type ErrRPCMismatch

type ErrRPCMismatch struct {
	Low  uint32
	High uint32
}

type MismatchReply

type MismatchReply struct {
	Low  uint32
	High uint32
}

type MsgType

type MsgType int32
const (
	Call  MsgType = 0
	Reply MsgType = 1
)

type OpaqueAuth

type OpaqueAuth struct {
	Flavor AuthFlavor
	Body   []byte
}

type ProcEntry

type ProcEntry struct {
	Program  uint32   // Remote program
	Version  uint32   // Remote program's version
	ProcList []string // Procedure number
}

type RPCMsg

type RPCMsg struct {
	Xid   uint32
	Type  MsgType   `xdr:"union"`
	CBody CallBody  `xdr:"unioncase=0"`
	RBody ReplyBody `xdr:"unioncase=1"`
}

type RejectStat

type RejectStat int32
const (
	RPCMismatch RejectStat = 0 // RPC version number != 2
	AuthError   RejectStat = 1 // Remote can't authenticate caller
)

type RejectedReply

type RejectedReply struct {
	Stat         RejectStat    `xdr:"union"`
	MismatchInfo MismatchReply `xdr:"unioncase=0"` // RPCMismatch
	AuthStat     AuthStat      `xdr:"unioncase=1"` // AuthError
}

type ReplyBody

type ReplyBody struct {
	Stat   ReplyStat     `xdr:"union"`
	Areply AcceptedReply `xdr:"unioncase=0"`
	Rreply RejectedReply `xdr:"unioncase=1"`
}

type ReplyStat

type ReplyStat int32
const (
	MsgAccepted ReplyStat = 0
	MsgDenied   ReplyStat = 1
)

Jump to

Keyboard shortcuts

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