sniff

package
v0.0.0-...-6478c7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClientHelloFragmented = E.New("need more packet for chromium QUIC connection")

Functions

func BitTorrent

func BitTorrent(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

BitTorrent detects if the stream is a BitTorrent connection. For the BitTorrent protocol specification, see https://www.bittorrent.org/beps/bep_0003.html

func DTLSRecord

func DTLSRecord(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func DomainNameQuery

func DomainNameQuery(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func HTTPHost

func HTTPHost(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func PeekPacket

func PeekPacket(ctx context.Context, metadata *adapter.InboundContext, packet []byte, sniffers ...PacketSniffer) error

func PeekStream

func PeekStream(ctx context.Context, metadata *adapter.InboundContext, conn net.Conn, buffer *buf.Buffer, timeout time.Duration, sniffers ...StreamSniffer) error

func QUICClientHello

func QUICClientHello(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func STUNMessage

func STUNMessage(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

func StreamDomainNameQuery

func StreamDomainNameQuery(readCtx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func TLSClientHello

func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func UDPTracker

func UDPTracker(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

UDPTracker detects if the packet is a UDP Tracker Protocol packet. For the UDP Tracker Protocol specification, see https://www.bittorrent.org/beps/bep_0015.html

func UTP

func UTP(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

UTP detects if the packet is a uTP connection packet. For the uTP protocol specification, see

  1. https://www.bittorrent.org/beps/bep_0029.html
  2. https://github.com/bittorrent/libutp/blob/2b364cbb0650bdab64a5de2abb4518f9f228ec44/utp_internal.cpp#L112

Types

type PacketSniffer

type PacketSniffer = func(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

type StreamSniffer

type StreamSniffer = func(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL