Documentation
¶
Index ¶
- Constants
- func NewPacketCombiner() protocol.PacketCombiner
- func SwapUint32(x uint32) uint32
- type AICHAnswer
- type AICHFileHashAnswer
- type AICHFileHashRequest
- type AICHRequest
- type AcceptUpload
- type AnswerSources2
- type CancelTransfer
- type CompressedPart32
- type CompressedPart64
- type ExtHello
- type ExtHelloAnswer
- type ExtendedHandshake
- type FileAnswer
- type FileComment
- type FileRequest
- type FileStatusAnswer
- type FileStatusRequest
- type HashSetAnswer
- type HashSetRequest
- type Hello
- type HelloAnswer
- type NoFileStatus
- type OutOfParts
- type PublicKey
- type QueueRanking
- type RequestParts32
- type RequestParts64
- type RequestSources2
- type SecIdentState
- type SendingPart32
- type SendingPart64
- type Signature
- type SourceExchangeEntry
- type StartUpload
Constants ¶
const ( SecIdentMaxPubKeyLen = 512 SecIdentMaxSigLen = 512 )
const MaxFileCommentLen = 128
const SourceExchange2Version byte = 4
SourceExchange2Version 为当前实现的 SX2 载荷版本(与 aMule SOURCEEXCHANGE2_VERSION 一致)。
Variables ¶
This section is empty.
Functions ¶
func NewPacketCombiner ¶
func NewPacketCombiner() protocol.PacketCombiner
func SwapUint32 ¶
SwapUint32 与 aMule wxUINT32_SWAP_ALWAYS 一致,用于 UserID 混合编码与旧版 SX1 兼容。
Types ¶
type AICHAnswer ¶ added in v0.1.0
func (AICHAnswer) BytesCount ¶ added in v0.1.0
func (a AICHAnswer) BytesCount() int
type AICHFileHashAnswer ¶ added in v0.1.0
AICHFileHashAnswer returns the file-level AICH root hash (deprecated in eMule).
func (AICHFileHashAnswer) BytesCount ¶ added in v0.1.0
func (a AICHFileHashAnswer) BytesCount() int
type AICHFileHashRequest ¶ added in v0.1.0
AICHFileHashRequest asks for the file-level AICH root hash (deprecated in eMule).
func (AICHFileHashRequest) BytesCount ¶ added in v0.1.0
func (a AICHFileHashRequest) BytesCount() int
type AICHRequest ¶ added in v0.1.0
func (AICHRequest) BytesCount ¶ added in v0.1.0
func (a AICHRequest) BytesCount() int
type AcceptUpload ¶
type AcceptUpload struct {
protocol.WithoutDataPacket
}
type AnswerSources2 ¶
type AnswerSources2 struct {
Version byte
Hash protocol.Hash
Entries []SourceExchangeEntry
}
AnswerSources2:OP_EMULEPROT OP_ANSWERSOURCES2 载荷。 顺序:uint8 版本 + 16 字节 hash + uint16 来源数量 + 每条目(版本依赖,见 Get)。
func (AnswerSources2) BytesCount ¶
func (a AnswerSources2) BytesCount() int
type CancelTransfer ¶
type CancelTransfer struct {
protocol.WithoutDataPacket
}
type CompressedPart32 ¶
func (CompressedPart32) BytesCount ¶
func (c CompressedPart32) BytesCount() int
func (CompressedPart32) PayloadSize ¶
func (c CompressedPart32) PayloadSize() int
type CompressedPart64 ¶
func (CompressedPart64) BytesCount ¶
func (c CompressedPart64) BytesCount() int
func (CompressedPart64) PayloadSize ¶
func (c CompressedPart64) PayloadSize() int
type ExtHello ¶
type ExtHello struct {
ExtendedHandshake
}
type ExtHelloAnswer ¶
type ExtHelloAnswer struct {
ExtendedHandshake
}
type ExtendedHandshake ¶
func (ExtendedHandshake) BytesCount ¶
func (e ExtendedHandshake) BytesCount() int
type FileAnswer ¶
type FileAnswer struct {
Hash protocol.Hash
Name protocol.ByteContainer16
}
func (FileAnswer) BytesCount ¶
func (f FileAnswer) BytesCount() int
type FileComment ¶ added in v0.1.0
FileComment carries a peer file rating and comment (OP_FILEDESC / 0x61).
func (FileComment) BytesCount ¶ added in v0.1.0
func (f FileComment) BytesCount() int
type FileRequest ¶
func (FileRequest) BytesCount ¶
func (f FileRequest) BytesCount() int
type FileStatusAnswer ¶
func (FileStatusAnswer) BytesCount ¶
func (f FileStatusAnswer) BytesCount() int
type FileStatusRequest ¶
func (FileStatusRequest) BytesCount ¶
func (f FileStatusRequest) BytesCount() int
type HashSetAnswer ¶
func (HashSetAnswer) BytesCount ¶
func (h HashSetAnswer) BytesCount() int
type HashSetRequest ¶
func (HashSetRequest) BytesCount ¶
func (h HashSetRequest) BytesCount() int
type HelloAnswer ¶
type HelloAnswer struct {
Hash protocol.Hash
Point protocol.Endpoint
Properties protocol.TagList
ServerPoint protocol.Endpoint
}
func (HelloAnswer) BytesCount ¶
func (h HelloAnswer) BytesCount() int
type NoFileStatus ¶
func (NoFileStatus) BytesCount ¶
func (n NoFileStatus) BytesCount() int
type OutOfParts ¶
type OutOfParts struct {
protocol.WithoutDataPacket
}
type PublicKey ¶ added in v0.1.0
type PublicKey struct {
Key []byte
}
func (PublicKey) BytesCount ¶ added in v0.1.0
type QueueRanking ¶
func (QueueRanking) BytesCount ¶
func (q QueueRanking) BytesCount() int
type RequestParts32 ¶
type RequestParts32 struct {
Hash protocol.Hash
CurrentFree int
BeginOffset [partsInRequest]uint32
EndOffset [partsInRequest]uint32
}
func (*RequestParts32) AppendRange ¶
func (r *RequestParts32) AppendRange(rg data.Range)
func (RequestParts32) BytesCount ¶
func (r RequestParts32) BytesCount() int
type RequestParts64 ¶
type RequestParts64 struct {
Hash protocol.Hash
CurrentFree int
BeginOffset [partsInRequest]uint64
EndOffset [partsInRequest]uint64
}
func (*RequestParts64) AppendRange ¶
func (r *RequestParts64) AppendRange(rg data.Range)
func (RequestParts64) BytesCount ¶
func (r RequestParts64) BytesCount() int
type RequestSources2 ¶
RequestSources2:OP_EMULEPROT OP_REQUESTSOURCES2 载荷。 顺序:uint8 版本(SourceExchange2Version)+ uint16 保留(0) + 16 字节文件 hash。
func (RequestSources2) BytesCount ¶
func (r RequestSources2) BytesCount() int
type SecIdentState ¶ added in v0.1.0
func (SecIdentState) BytesCount ¶ added in v0.1.0
func (s SecIdentState) BytesCount() int
type SendingPart32 ¶
func (SendingPart32) BytesCount ¶
func (s SendingPart32) BytesCount() int
func (SendingPart32) PayloadSize ¶
func (s SendingPart32) PayloadSize() int
type SendingPart64 ¶
func (SendingPart64) BytesCount ¶
func (s SendingPart64) BytesCount() int
func (SendingPart64) PayloadSize ¶
func (s SendingPart64) PayloadSize() int
type Signature ¶ added in v0.1.0
type Signature struct {
Signature []byte
}
func (Signature) BytesCount ¶ added in v0.1.0
type SourceExchangeEntry ¶
type SourceExchangeEntry struct {
UserID uint32
TCPPort uint16
ServerIP uint32
ServerPort uint16
UserHash protocol.Hash
CryptOptions uint8
}
SourceExchangeEntry 表示 AnswerSources2 中单个来源(SX2 v4:含 UserHash 与 CryptOptions)。
type StartUpload ¶
func (StartUpload) BytesCount ¶
func (s StartUpload) BytesCount() int
Source Files
¶
- accept_upload.go
- aich.go
- cancel_transfer.go
- compressed_part.go
- ext_hello.go
- ext_hello_answer.go
- extended_handshake.go
- file_answer.go
- file_comment.go
- file_request.go
- file_status_answer.go
- file_status_request.go
- hash_set_answer.go
- hash_set_request.go
- hello.go
- hello_answer.go
- no_file_status.go
- out_of_parts.go
- packet_combiner.go
- queue_ranking.go
- request_parts.go
- sec_ident.go
- sending_part.go
- source_exchange.go
- start_upload.go