Documentation ¶
Index ¶
- Constants
- func RunServer() (int, error)
- type MServer
- type ReinitRpcHandler
- type RpcHandler
- type ShellStateMap
- func (sm *ShellStateMap) Clear()
- func (sm *ShellStateMap) GetCurrentState(shellType string) (string, *packet.ShellState)
- func (sm *ShellStateMap) GetShells() []string
- func (sm *ShellStateMap) GetStateByHash(shellType string, hash string) *packet.ShellState
- func (sm *ShellStateMap) HasShell(shellType string) bool
- func (sm *ShellStateMap) SetCurrentState(shellType string, state *packet.ShellState) error
- type WriteFileContext
Constants ¶
View Source
const InboundRpcErrorTimeoutTime = 30 * time.Second
View Source
const MaxFileDataPacketSize = 16 * 1024
View Source
const MaxWriteFileContextData = 100
View Source
const WriteFileContextTimeout = 30 * time.Second
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MServer ¶
type MServer struct { Lock *sync.Mutex MainInput *packet.PacketParser Sender *packet.PacketSender ClientMap map[base.CommandKey]*shexec.ClientProc Debug bool WriteErrorCh chan bool // closed if there is a I/O write error WriteErrorChOnce *sync.Once Done bool InboundRpcHandlers map[string]RpcHandler InboundRpcErrorSent map[string]time.Time // limits the amount of error messages sent back to the client }
TODO create unblockable packet-sender (backed by an array) for clientproc
func (*MServer) MakeShellStatePacket ¶
func (*MServer) ProcessCommandPacket ¶
func (m *MServer) ProcessCommandPacket(pk packet.CommandPacketType)
func (*MServer) ProcessRpcPacket ¶
func (m *MServer) ProcessRpcPacket(pk packet.RpcPacketType)
type ReinitRpcHandler ¶
func (*ReinitRpcHandler) DispatchPacket ¶
func (rh *ReinitRpcHandler) DispatchPacket(reqId string, pkArg packet.RpcFollowUpPacketType)
func (*ReinitRpcHandler) GetTimeoutTime ¶
func (rh *ReinitRpcHandler) GetTimeoutTime() time.Time
func (*ReinitRpcHandler) UnRegisterCallback ¶
func (rh *ReinitRpcHandler) UnRegisterCallback()
type RpcHandler ¶
type RpcHandler interface { GetTimeoutTime() time.Time DispatchPacket(reqId string, pk packet.RpcFollowUpPacketType) UnRegisterCallback() }
type ShellStateMap ¶
type ShellStateMap struct { Lock *sync.Mutex StateMap map[shellStateMapKey]*packet.ShellState // shelltype+hash -> state CurrentStateMap map[string]string // shelltype -> hash }
func MakeShellStateMap ¶
func MakeShellStateMap() *ShellStateMap
func (*ShellStateMap) Clear ¶
func (sm *ShellStateMap) Clear()
func (*ShellStateMap) GetCurrentState ¶
func (sm *ShellStateMap) GetCurrentState(shellType string) (string, *packet.ShellState)
func (*ShellStateMap) GetShells ¶
func (sm *ShellStateMap) GetShells() []string
func (*ShellStateMap) GetStateByHash ¶
func (sm *ShellStateMap) GetStateByHash(shellType string, hash string) *packet.ShellState
func (*ShellStateMap) HasShell ¶
func (sm *ShellStateMap) HasShell(shellType string) bool
func (*ShellStateMap) SetCurrentState ¶
func (sm *ShellStateMap) SetCurrentState(shellType string, state *packet.ShellState) error
type WriteFileContext ¶
type WriteFileContext struct { CVar *sync.Cond Data []*packet.FileDataPacketType LastActive time.Time Err error Done bool }
func (*WriteFileContext) DispatchPacket ¶
func (wfc *WriteFileContext) DispatchPacket(reqId string, pkArg packet.RpcFollowUpPacketType)
func (*WriteFileContext) GetTimeoutTime ¶
func (wfc *WriteFileContext) GetTimeoutTime() time.Time
func (*WriteFileContext) UnRegisterCallback ¶
func (wfc *WriteFileContext) UnRegisterCallback()
Click to show internal directories.
Click to hide internal directories.