Documentation ¶
Index ¶
- Variables
- func EncodePubkey(key *ecdsa.PublicKey) encPubkey
- type Config
- type ReadPacket
- type V4Udp
- func (t *V4Udp) BondedSourceFindNeighbours(toid enode.ID, toaddr *net.UDPAddr, target encPubkey) error
- func (t *V4Udp) BondedSourceFindNeighboursPastExpiration(toid enode.ID, toaddr *net.UDPAddr, target encPubkey) error
- func (t *V4Udp) FindnodeWithoutBond(toid enode.ID, toaddr *net.UDPAddr, target encPubkey) error
- func (t *V4Udp) Ping(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingBondedWithMangledFromField(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingExtraData(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingExtraDataWrongFrom(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingPastExpiration(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingTargetWrongPacketType(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingWrongFrom(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
- func (t *V4Udp) PingWrongTo(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, ...) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrPacketTooSmall = errors.New("too small") ErrBadHash = errors.New("bad hash") ErrExpired = errors.New("expired") ErrUnsolicitedReply = errors.New("unsolicited reply") ErrUnknownNode = errors.New("unknown node") ErrTimeout = errors.New("RPC timeout") ErrClockWarp = errors.New("reply deadline too far in the future") ErrClosed = errors.New("socket closed") ErrResponseReceived = errors.New("response received") ErrPacketMismatch = errors.New("packet mismatch") ErrCorruptDHT = errors.New("corrupt neighbours data") UnexpectedPacket = false )
Errors
Functions ¶
Types ¶
type Config ¶
type Config struct { // These settings are required and configure the UDP listener: PrivateKey *ecdsa.PrivateKey // These settings are optional: AnnounceAddr *net.UDPAddr // local address announced in the DHT NodeDBPath string // if set, the node database is stored at this filesystem location NetRestrict *netutil.Netlist // network whitelist Bootnodes []*enode.Node // list of bootstrap nodes Unhandled chan<- ReadPacket // unhandled packets are sent on this channel }
Config holds Table-related settings.
type ReadPacket ¶
ReadPacket is sent to the unhandled channel when it could not be processed
type V4Udp ¶
type V4Udp struct {
// contains filtered or unexported fields
}
V4Udp is the v4UDP test class
func (*V4Udp) BondedSourceFindNeighbours ¶
func (t *V4Udp) BondedSourceFindNeighbours(toid enode.ID, toaddr *net.UDPAddr, target encPubkey) error
BondedSourceFindNeighbours basic find neighbours tests
func (*V4Udp) BondedSourceFindNeighboursPastExpiration ¶
func (t *V4Udp) BondedSourceFindNeighboursPastExpiration(toid enode.ID, toaddr *net.UDPAddr, target encPubkey) error
BondedSourceFindNeighboursPastExpiration -
func (*V4Udp) FindnodeWithoutBond ¶
FindnodeWithoutBond tries to find a node without a previous bond
func (*V4Udp) Ping ¶
func (t *V4Udp) Ping(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
Ping sends a ping message to the given node and waits for a reply.
func (*V4Udp) PingBondedWithMangledFromField ¶
func (t *V4Udp) PingBondedWithMangledFromField(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
PingBondedWithMangledFromField ping a bonded node with bad from fields
func (*V4Udp) PingExtraData ¶
func (t *V4Udp) PingExtraData(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
PingExtraData ping with a 'future format' packet containing extra fields
func (*V4Udp) PingExtraDataWrongFrom ¶
func (t *V4Udp) PingExtraDataWrongFrom(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
PingExtraDataWrongFrom ping with a 'future format' packet containing extra fields and make sure it works even with the wrong 'from' field
func (*V4Udp) PingPastExpiration ¶
func (t *V4Udp) PingPastExpiration(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
PingPastExpiration check past expirations are handled correctly
func (*V4Udp) PingTargetWrongPacketType ¶
func (t *V4Udp) PingTargetWrongPacketType(toid enode.ID, toaddr *net.UDPAddr, validateEnodeID bool, recoveryCallback func(e *ecdsa.PublicKey)) error
PingTargetWrongPacketType send a packet (a ping packet, though it could be something else) with an unknown packet type to the client and see how the target behaves. If the target responds to the ping, then fail.