devp2p / org.apache.tuweni.devp2p / Packet

Packet

sealed class Packet (source)

Properties

expiration

val expiration: Long

hash

val hash: Bytes32

nodeId

val nodeId: PublicKey

Functions

encodeTo

abstract fun encodeTo(dst: ByteBuffer): ByteBuffer
fun encodeTo(dst: ByteBuffer, packetType: PacketType, contentWriter: (RLPWriter) -> Unit): ByteBuffer

isExpired

fun isExpired(now: Long): Boolean

Companion Object Properties

MAX_SIZE

const val MAX_SIZE: Int

MIN_SIZE

const val MIN_SIZE: Int

Companion Object Functions

createSignature

fun createSignature(packetType: PacketType, keyPair: KeyPair, encoder: (RLPWriter) -> Unit): SigHash

decodeFrom

fun decodeFrom(datagram: ByteBuffer): Packet
fun decodeFrom(datagram: Bytes): Packet

expirationFor

fun expirationFor(now: Long): Long

Inheritors

ENRRequestPacket

class ENRRequestPacket : Packet

ENRResponsePacket

class ENRResponsePacket : Packet

FindNodePacket

class FindNodePacket : Packet

NeighborsPacket

class NeighborsPacket : Packet

PingPacket

class PingPacket : Packet

PongPacket

class PongPacket : Packet