packet_stream

package
v0.0.0-...-2a33acd Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CipherTest

func CipherTest()

Types

type CFB8

type CFB8 struct {
	// contains filtered or unexported fields
}

CFB stream with 8 bit segment size See http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf

func NewCFB8Decrypter

func NewCFB8Decrypter(block cipher.Block, iv []byte) *CFB8

func NewCFB8Encrypter

func NewCFB8Encrypter(block cipher.Block, iv []byte) *CFB8

func (*CFB8) BlockSize

func (x *CFB8) BlockSize() int

func (*CFB8) XORKeyStream

func (x *CFB8) XORKeyStream(dst, src []byte)

type IncomingPacketStream

type IncomingPacketStream struct {
	// contains filtered or unexported fields
}

func NewIncomingPacketStream

func NewIncomingPacketStream(conn net.Conn, closed *atomic.Value) *IncomingPacketStream

func (*IncomingPacketStream) Close

func (s *IncomingPacketStream) Close()

func (*IncomingPacketStream) EnableAsyncRead

func (s *IncomingPacketStream) EnableAsyncRead()

func (*IncomingPacketStream) GetPacket

func (s *IncomingPacketStream) GetPacket() *packet.IncomingPacket

func (*IncomingPacketStream) GetState

func (s *IncomingPacketStream) GetState() byte

func (*IncomingPacketStream) ReadData

func (s *IncomingPacketStream) ReadData() bool

func (*IncomingPacketStream) SetCipher

func (s *IncomingPacketStream) SetCipher(stream cipher.Stream)

func (*IncomingPacketStream) SetCompression

func (s *IncomingPacketStream) SetCompression(threshold int32)

func (*IncomingPacketStream) SetState

func (s *IncomingPacketStream) SetState(state byte)

type OutgoingPacketStream

type OutgoingPacketStream struct {
	// contains filtered or unexported fields
}

func NewOutgoingPacketStream

func NewOutgoingPacketStream(
	conn io.WriteCloser,
	closed *atomic.Value,
	length_threshold int,
	time_threshold time.Duration,
) *OutgoingPacketStream

func (*OutgoingPacketStream) Close

func (s *OutgoingPacketStream) Close()

This is not thread safe! Do not call Close() on different threads close to each other. If you call it once, it is safe to call again, but you should not call close twice at the same time.

func (*OutgoingPacketStream) EnableAsyncSend

func (s *OutgoingPacketStream) EnableAsyncSend()

func (*OutgoingPacketStream) Flush

func (s *OutgoingPacketStream) Flush()

func (*OutgoingPacketStream) NewPacket

func (s *OutgoingPacketStream) NewPacket() *packet.OutgoingPacket

func (*OutgoingPacketStream) NewPacketID

func (s *OutgoingPacketStream) NewPacketID(id int32) *packet.OutgoingPacket

func (*OutgoingPacketStream) SendProto

func (s *OutgoingPacketStream) SendProto(version mpacket.Version, proto *pb.Packet)

func (*OutgoingPacketStream) SetCipher

func (s *OutgoingPacketStream) SetCipher(stream cipher.Stream)

func (*OutgoingPacketStream) SetCompression

func (s *OutgoingPacketStream) SetCompression(threshold int32)

func (*OutgoingPacketStream) Write

func (s *OutgoingPacketStream) Write(packet *packet.OutgoingPacket)

Jump to

Keyboard shortcuts

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