Versions in this module Expand all Collapse all v1 v1.9.25 Nov 3, 2020 v1.9.24 Nov 3, 2020 Changes in this version + const FindnodeMsg + const NodesMsg + const PingMsg + const PongMsg + const RegconfirmationMsg + const RegtopicMsg + const RequestTicketMsg + const TalkRequestMsg + const TalkResponseMsg + const TicketMsg + const TopicQueryMsg + const UnknownPacket + const WhoareyouPacket + 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 + type Codec struct + func NewCodec(ln *enode.LocalNode, key *ecdsa.PrivateKey, clock mclock.Clock) *Codec + func (c *Codec) Decode(input []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 + ReqID []byte + func (*Findnode) Kind() byte + func (*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 + Total uint8 + func (*Nodes) Kind() byte + func (*Nodes) Name() string + func (p *Nodes) RequestID() []byte + func (p *Nodes) SetRequestID(id []byte) + type Nonce [gcmNonceSize]byte + type Packet 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) 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) RequestID() []byte + func (p *Pong) SetRequestID(id []byte) + type Regconfirmation struct + Registered bool + ReqID []byte + func (*Regconfirmation) Kind() byte + func (*Regconfirmation) Name() string + func (p *Regconfirmation) RequestID() []byte + func (p *Regconfirmation) SetRequestID(id []byte) + type Regtopic struct + ENR *enr.Record + ReqID []byte + Ticket []byte + func (*Regtopic) Kind() byte + func (*Regtopic) Name() string + func (p *Regtopic) RequestID() []byte + func (p *Regtopic) SetRequestID(id []byte) + type RequestTicket struct + ReqID []byte + Topic []byte + func (*RequestTicket) Kind() byte + func (*RequestTicket) Name() string + func (p *RequestTicket) RequestID() []byte + func (p *RequestTicket) 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) 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) RequestID() []byte + func (p *TalkResponse) SetRequestID(id []byte) + type Ticket struct + ReqID []byte + Ticket []byte + func (*Ticket) Kind() byte + func (*Ticket) Name() string + func (p *Ticket) RequestID() []byte + func (p *Ticket) SetRequestID(id []byte) + type TopicQuery struct + ReqID []byte + Topic []byte + func (*TopicQuery) Kind() byte + func (*TopicQuery) Name() string + func (p *TopicQuery) RequestID() []byte + func (p *TopicQuery) SetRequestID(id []byte) + type Unknown struct + Nonce Nonce + 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) Kind() byte + func (*Whoareyou) Name() string + func (*Whoareyou) RequestID() []byte + func (*Whoareyou) SetRequestID([]byte)