Versions in this module Expand all Collapse all v1 v1.0.0 Nov 3, 2023 Changes in this version + const FindnodeMsg + const NodesMsg + const PingMsg + const PongMsg + const RequestTicketMsg + const TalkRequestMsg + const TalkResponseMsg + const TicketMsg + const UnknownPacket + const WhoareyouPacket + var DefaultProtocolID = [6]byte + var ErrInvalidReqID = errors.New("request ID larger than 8 bytes") + func DecodePubkey(curve elliptic.Curve, e []byte) (*ecdsa.PublicKey, error) + func EncodePubkey(key *ecdsa.PublicKey) []byte + func IsInvalidHeader(err error) bool + type Codec struct + func NewCodec(ln *enode.LocalNode, key *ecdsa.PrivateKey, clock mclock.Clock, ...) *Codec + func (c *Codec) Decode(inputData []byte, addr string) (src enode.ID, n *enode.Node, p Packet, err error) + func (c *Codec) Encode(id enode.ID, addr string, packet Packet, challenge *Whoareyou) ([]byte, Nonce, error) + func (c *Codec) EncodeRaw(id enode.ID, head Header, msgdata []byte) ([]byte, error) + type Findnode struct + Distances []uint + OpID uint64 + ReqID []byte + func (p *Findnode) AppendLogInfo(ctx []interface{}) []interface{} + func (p *Findnode) Kind() byte + func (p *Findnode) Name() string + func (p *Findnode) RequestID() []byte + func (p *Findnode) SetRequestID(id []byte) + type Header struct + AuthData []byte + IV [sizeofMaskingIV]byte + type Nodes struct + Nodes []*enr.Record + ReqID []byte + RespCount uint8 + func (*Nodes) Kind() byte + func (*Nodes) Name() string + func (p *Nodes) AppendLogInfo(ctx []interface{}) []interface{} + func (p *Nodes) RequestID() []byte + func (p *Nodes) SetRequestID(id []byte) + type Nonce [gcmNonceSize]byte + type Packet interface + AppendLogInfo func(ctx []interface{}) []interface{} + Kind func() byte + Name func() string + RequestID func() []byte + SetRequestID func([]byte) + func DecodeMessage(ptype byte, body []byte) (Packet, error) + type Ping struct + ENRSeq uint64 + ReqID []byte + func (*Ping) Kind() byte + func (*Ping) Name() string + func (p *Ping) AppendLogInfo(ctx []interface{}) []interface{} + func (p *Ping) RequestID() []byte + func (p *Ping) SetRequestID(id []byte) + type Pong struct + ENRSeq uint64 + ReqID []byte + ToIP net.IP + ToPort uint16 + func (*Pong) Kind() byte + func (*Pong) Name() string + func (p *Pong) AppendLogInfo(ctx []interface{}) []interface{} + func (p *Pong) RequestID() []byte + func (p *Pong) SetRequestID(id []byte) + type SessionCache struct + func NewSessionCache(maxItems int, clock mclock.Clock) *SessionCache + type StaticHeader struct + AuthSize uint16 + Flag byte + Nonce Nonce + ProtocolID [6]byte + Version uint16 + type TalkRequest struct + Message []byte + Protocol string + ReqID []byte + func (*TalkRequest) Kind() byte + func (*TalkRequest) Name() string + func (p *TalkRequest) AppendLogInfo(ctx []interface{}) []interface{} + func (p *TalkRequest) RequestID() []byte + func (p *TalkRequest) SetRequestID(id []byte) + type TalkResponse struct + Message []byte + ReqID []byte + func (*TalkResponse) Kind() byte + func (*TalkResponse) Name() string + func (p *TalkResponse) AppendLogInfo(ctx []interface{}) []interface{} + func (p *TalkResponse) RequestID() []byte + func (p *TalkResponse) SetRequestID(id []byte) + type Unknown struct + Nonce Nonce + func (*Unknown) AppendLogInfo(ctx []interface{}) []interface{} + func (*Unknown) Kind() byte + func (*Unknown) Name() string + func (*Unknown) RequestID() []byte + func (*Unknown) SetRequestID([]byte) + type Whoareyou struct + ChallengeData []byte + IDNonce [16]byte + Node *enode.Node + Nonce Nonce + RecordSeq uint64 + func (*Whoareyou) AppendLogInfo(ctx []interface{}) []interface{} + func (*Whoareyou) Kind() byte + func (*Whoareyou) Name() string + func (*Whoareyou) RequestID() []byte + func (*Whoareyou) SetRequestID([]byte)