Documentation ¶
Index ¶
- Constants
- type ConnectPacketCmd
- type ConnectPacketRet
- type DownloadPacketCmd
- type DownloadPacketRet
- type FileDataPacket
- type InitPacketCmd
- type InitPacketRet
- type ListenPacketCmd
- type ListenPacketRet
- type NetDataPacket
- type NetLForwardPacketCmd
- type NetLForwardPacketRet
- type NetRForwardPacketCmd
- type NetRForwardPacketRet
- type Packet
- type PacketHeader
- type ShellPacketCmd
- type ShellPacketRet
- type Socks5ControlPacketCmd
- type Socks5ControlPacketRet
- type SshConnectPacketCmd
- type SshConnectPacketRet
- type SyncPacket
- type UploadPacketCmd
- type UploadPacketRet
Constants ¶
View Source
const ( // 初始化,在node对象建立之前 INIT = iota // 控制协议 SYNC LISTEN CONNECT SHELL UPLOAD DOWNLOAD SOCKS LFORWARD RFORWARD SSHCONNECT // 数据传输协议 SOCKSDATA LFORWARDDATA RFORWARDDATA )
协议类型
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectPacketCmd ¶
type ConnectPacketRet ¶
type DownloadPacketCmd ¶
type DownloadPacketCmd struct { PathLen uint32 // 目标路径长度 Path []byte // 目标路径名 StillDownload uint32 // 如果文件过大是否还有继续下载 }
DownloadPacketCmd 文件下载命令
type DownloadPacketRet ¶
type DownloadPacketRet struct { Success uint16 // 操作是否成功, 1 or 0 MsgLen uint32 // 返回的信息长度 Msg []byte // 如果成功则为空, 否则为错误信息 FileLen uint64 // 文件大小 }
DownloadPacketRet 文件下载返回包
type FileDataPacket ¶
type InitPacketCmd ¶
InitPacketCmd 初始化数据包,命令数据
type InitPacketRet ¶
InitPacketRet 初始化数据包,命令数据
type ListenPacketCmd ¶
type ListenPacketCmd struct {
Port uint16
}
type ListenPacketRet ¶
type NetDataPacket ¶
type NetLForwardPacketCmd ¶
type NetLForwardPacketRet ¶
type NetRForwardPacketCmd ¶
type NetRForwardPacketRet ¶
type NetRForwardPacketRet struct {
Success uint16
}
type Packet ¶
type Packet struct { Separator string CmdType uint16 SrcHashID [32]byte // 源节点ID DstHashID [32]byte // 目的节点ID DataLen uint64 Data []byte }
Packet 是较为低层的数据包格式 比Packet高层的网络数据存放在Data中 如果Packet不属于本节点,则直接转发即可,无需解析Data格式
func (*Packet) ResolveData ¶
func (packet *Packet) ResolveData(cmdPacket interface{})
ResolveData 解析Packet Data字段的数据为特定格式的数据包
func (*Packet) ResolveHeader ¶
func (packet *Packet) ResolveHeader(header *PacketHeader)
ResolveHeader 解析Packet数据包中PacketHeader字段
type PacketHeader ¶
type ShellPacketCmd ¶
type ShellPacketRet ¶
type Socks5ControlPacketCmd ¶
type Socks5ControlPacketRet ¶
type Socks5ControlPacketRet struct {
Success uint16 // 启动一个socks5连接/关闭这个socks5连接,针对一个TCP连接而言
}
type SshConnectPacketCmd ¶
type SshConnectPacketRet ¶
type SyncPacket ¶
type UploadPacketCmd ¶
UploadPacketCmd
type UploadPacketRet ¶
type UploadPacketRet struct { Success uint16 // 操作是否成功, 1 or 0 MsgLen uint32 // 返回的信息长度 Msg []byte // 如果成功则为空, 否则为错误信息 }
UploadPacketRet 文件上传返回包
Click to show internal directories.
Click to hide internal directories.