Versions in this module Expand all Collapse all v1 v1.2.0 Jul 19, 2026 Changes in this version + var ErrDontFragmentUnsupported = errors.New("icmpengine: dont fragment is only supported on linux") type Option + func WithDontFragment(b bool) Option + func WithSource(addr netip.Addr) Option v1.1.0 Jul 19, 2026 Changes in this version + const IsRaceEnabled + var ErrAlreadyStarted = errors.New("icmpengine: engine already started") + var ErrCountRange = errors.New("icmpengine: count out of range [0,65535]") + var ErrDSCPRange = errors.New("icmpengine: dscp out of range [0,63]") + var ErrDuplicatePing = errors.New("icmpengine: address already being pinged") + var ErrInvalidAddr = errors.New("icmpengine: invalid destination address") + var ErrNotStarted = errors.New("icmpengine: engine not started") + var ErrPayloadSizeRange = errors.New("icmpengine: payload size out of range [0,65500]") + var ErrTTLRange = errors.New("icmpengine: ttl out of range [0,255]") + var ErrTimeoutRange = errors.New("icmpengine: ping timeout must be >= 0") + type Backend int + const BackendBTree + const BackendDaryHeap + const BackendHeap + const BackendPairing + const BackendRadix + const BackendTimingWheel + func (b Backend) String() string + type Engine struct + func New(opts ...Option) (*Engine, error) + func (e *Engine) Close() error + func (e *Engine) Err() error + func (e *Engine) Ping(ctx context.Context, addr netip.Addr, count int, interval time.Duration, ...) (Result, error) + func (e *Engine) PingAll(ctx context.Context, concurrency int, targets []Target) ([]Result, error) + func (e *Engine) Start(ctx context.Context) error + type ICMPEchoReply struct + Checksum uint16 + Code uint8 + Identifier uint16 + Seq uint16 + Type uint8 + func ParseICMPEchoReply(b []byte) (*ICMPEchoReply, error) + func ParseICMPEchoReplyBB(b bytes.Buffer) (*ICMPEchoReply, error) + type Option func(*config) + func WithDSCP(v int) Option + func WithExpiryBackend(b Backend) Option + func WithFakeSuccess(b bool) Option + func WithHackSysctl(b bool) Option + func WithLogger(l *slog.Logger) Option + func WithReadDeadline(d time.Duration) Option + func WithReceivers(v4, v6 int) Option + func WithSplayReceivers(b bool) Option + func WithTTL(n int) Option + func WithTimeout(d time.Duration) Option + type PingOption func(*pingConfig) + func DropProbability(p float64) PingOption + func PayloadSize(n int) PingOption + func PingTimeout(d time.Duration) PingOption + func SortRTTs() PingOption + type Result struct + Count int + Duration time.Duration + Failures int + IP netip.Addr + Max time.Duration + Mean time.Duration + Min time.Duration + OutOfOrder int + RTTs []time.Duration + Successes int + Sum time.Duration + Variance time.Duration + type Target struct + Addr netip.Addr + Count int + Interval time.Duration + Options []PingOption