wire

package
v0.0.0-...-4805961 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPuzzleClientWouldAccept = 20
View Source
const NetworkBufferSize = 65 * 1024

Variables

This section is empty.

Functions

func Listen

func Listen(hostPort string, cfg *config.Config, handler func(wire *SecureWire)) error

Types

type PayLoadSize

type PayLoadSize struct {
	Size uint32
}

type SecureWire

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

func BuildSecureWire

func BuildSecureWire(keysBytes []byte, conn net.Conn, localKeyId, remoteKeyId [32]byte) (wire *SecureWire, err error)

func ClientHandshake

func ClientHandshake(conn net.Conn, cfg *config.Config) (wire *SecureWire, err error)

func NewSecureWireAES256CGM

func NewSecureWireAES256CGM(key []byte, nonce []byte, conn net.Conn, localKeyId, remoteKeyId [32]byte) (sw *SecureWire, err error)

func ServerHandshake

func ServerHandshake(conn net.Conn, cfg *config.Config) (wire *SecureWire, err error)

func (*SecureWire) Close

func (s *SecureWire) Close() error

func (*SecureWire) LocalAddr

func (s *SecureWire) LocalAddr() net.Addr

func (*SecureWire) LocalKeyId

func (s *SecureWire) LocalKeyId() [32]byte

func (*SecureWire) Read

func (s *SecureWire) Read(b []byte) (n int, err error)

func (*SecureWire) RemoteAddr

func (s *SecureWire) RemoteAddr() net.Addr

func (*SecureWire) RemoteKeyId

func (s *SecureWire) RemoteKeyId() [32]byte

func (*SecureWire) SetDeadline

func (s *SecureWire) SetDeadline(t time.Time) error

func (*SecureWire) SetReadDeadline

func (s *SecureWire) SetReadDeadline(t time.Time) error

func (*SecureWire) SetWriteDeadline

func (s *SecureWire) SetWriteDeadline(t time.Time) error

func (*SecureWire) Write

func (s *SecureWire) Write(b []byte) (n int, err error)

type ServerError

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

func Disconnect

func Disconnect(err error, cause uint32) *ServerError

func ServerErrorWrap

func ServerErrorWrap(err error) *ServerError

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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